@documentation-robotics/cli 0.1.12 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/README.md +39 -1
  2. package/dist/analyzers/verify-engine.js +22 -19
  3. package/dist/analyzers/verify-engine.js.map +2 -2
  4. package/dist/cli.js +101 -27
  5. package/dist/cli.js.map +3 -3
  6. package/dist/coding-agents/agents/claude-code.js +3 -1
  7. package/dist/coding-agents/agents/claude-code.js.map +2 -2
  8. package/dist/coding-agents/claude-code-client.js +2 -1
  9. package/dist/coding-agents/claude-code-client.js.map +2 -2
  10. package/dist/coding-agents/copilot-client.js +17 -12
  11. package/dist/coding-agents/copilot-client.js.map +2 -2
  12. package/dist/coding-agents/default-permissions.js +122 -0
  13. package/dist/coding-agents/default-permissions.js.map +7 -0
  14. package/dist/commands/add.js +10 -6
  15. package/dist/commands/add.js.map +2 -2
  16. package/dist/commands/analyzer.js +18 -10
  17. package/dist/commands/analyzer.js.map +2 -2
  18. package/dist/commands/audit.js +6 -6
  19. package/dist/commands/audit.js.map +2 -2
  20. package/dist/commands/changeset.js +238 -145
  21. package/dist/commands/changeset.js.map +2 -2
  22. package/dist/commands/delete.js +45 -18
  23. package/dist/commands/delete.js.map +3 -3
  24. package/dist/commands/element.js +3 -2
  25. package/dist/commands/element.js.map +2 -2
  26. package/dist/commands/farm.js +657 -0
  27. package/dist/commands/farm.js.map +7 -0
  28. package/dist/commands/init.js +11 -1
  29. package/dist/commands/init.js.map +2 -2
  30. package/dist/commands/mcp.js +107 -0
  31. package/dist/commands/mcp.js.map +7 -0
  32. package/dist/commands/relationship.js +53 -30
  33. package/dist/commands/relationship.js.map +2 -2
  34. package/dist/commands/reports.js +1 -1
  35. package/dist/commands/reports.js.map +2 -2
  36. package/dist/commands/update.js +19 -6
  37. package/dist/commands/update.js.map +2 -2
  38. package/dist/commands/validate.js +41 -3
  39. package/dist/commands/validate.js.map +2 -2
  40. package/dist/commands/version.js +2 -2
  41. package/dist/commands/version.js.map +2 -2
  42. package/dist/config.js +83 -0
  43. package/dist/config.js.map +7 -0
  44. package/dist/core/annotation-store.js +138 -0
  45. package/dist/core/annotation-store.js.map +7 -0
  46. package/dist/core/farm-manifest.js +134 -0
  47. package/dist/core/farm-manifest.js.map +7 -0
  48. package/dist/core/farm-sync-engine.js +346 -0
  49. package/dist/core/farm-sync-engine.js.map +7 -0
  50. package/dist/core/farm-sync-state.js +159 -0
  51. package/dist/core/farm-sync-state.js.map +7 -0
  52. package/dist/core/manifest.js +6 -3
  53. package/dist/core/manifest.js.map +2 -2
  54. package/dist/core/migration-registry.js +55 -1
  55. package/dist/core/migration-registry.js.map +2 -2
  56. package/dist/core/model.js +177 -16
  57. package/dist/core/model.js.map +3 -3
  58. package/dist/core/virtual-projection.js +1 -0
  59. package/dist/core/virtual-projection.js.map +2 -2
  60. package/dist/generated/node-types.js +1 -1
  61. package/dist/generated/node-types.js.map +2 -2
  62. package/dist/generated/relationship-index.js +45 -9
  63. package/dist/generated/relationship-index.js.map +2 -2
  64. package/dist/integrations/claude_code/docs/MCP_SERVER.md +55 -0
  65. package/dist/integrations/claude_code/docs/README.md +4 -0
  66. package/dist/mcp/api-key-manager.js +98 -0
  67. package/dist/mcp/api-key-manager.js.map +7 -0
  68. package/dist/mcp/http-transport.js +176 -0
  69. package/dist/mcp/http-transport.js.map +7 -0
  70. package/dist/mcp/resource-registry.js +97 -0
  71. package/dist/mcp/resource-registry.js.map +7 -0
  72. package/dist/mcp/tool-registry.js +44 -0
  73. package/dist/mcp/tool-registry.js.map +7 -0
  74. package/dist/mcp/tools/annotation-create.js +39 -0
  75. package/dist/mcp/tools/annotation-create.js.map +7 -0
  76. package/dist/mcp/tools/annotation-delete.js +29 -0
  77. package/dist/mcp/tools/annotation-delete.js.map +7 -0
  78. package/dist/mcp/tools/annotation-get.js +29 -0
  79. package/dist/mcp/tools/annotation-get.js.map +7 -0
  80. package/dist/mcp/tools/annotation-list.js +24 -0
  81. package/dist/mcp/tools/annotation-list.js.map +7 -0
  82. package/dist/mcp/tools/annotation-reply.js +34 -0
  83. package/dist/mcp/tools/annotation-reply.js.map +7 -0
  84. package/dist/mcp/tools/annotation-shared.js +10 -0
  85. package/dist/mcp/tools/annotation-shared.js.map +7 -0
  86. package/dist/mcp/tools/annotation-update.js +39 -0
  87. package/dist/mcp/tools/annotation-update.js.map +7 -0
  88. package/dist/mcp/tools/changeset-list.js +33 -0
  89. package/dist/mcp/tools/changeset-list.js.map +7 -0
  90. package/dist/mcp/tools/changeset-show.js +39 -0
  91. package/dist/mcp/tools/changeset-show.js.map +7 -0
  92. package/dist/mcp/tools/chat-launch.js +50 -0
  93. package/dist/mcp/tools/chat-launch.js.map +7 -0
  94. package/dist/mcp/tools/chat-status.js +26 -0
  95. package/dist/mcp/tools/chat-status.js.map +7 -0
  96. package/dist/mcp/tools/index.js +47 -0
  97. package/dist/mcp/tools/index.js.map +7 -0
  98. package/dist/mcp/tools/model-add.js +106 -0
  99. package/dist/mcp/tools/model-add.js.map +7 -0
  100. package/dist/mcp/tools/model-delete.js +99 -0
  101. package/dist/mcp/tools/model-delete.js.map +7 -0
  102. package/dist/mcp/tools/model-export.js +72 -0
  103. package/dist/mcp/tools/model-export.js.map +7 -0
  104. package/dist/mcp/tools/model-info.js +51 -0
  105. package/dist/mcp/tools/model-info.js.map +7 -0
  106. package/dist/mcp/tools/model-list.js +53 -0
  107. package/dist/mcp/tools/model-list.js.map +7 -0
  108. package/dist/mcp/tools/model-reload.js +34 -0
  109. package/dist/mcp/tools/model-reload.js.map +7 -0
  110. package/dist/mcp/tools/model-search.js +88 -0
  111. package/dist/mcp/tools/model-search.js.map +7 -0
  112. package/dist/mcp/tools/model-show.js +41 -0
  113. package/dist/mcp/tools/model-show.js.map +7 -0
  114. package/dist/mcp/tools/model-stats.js +22 -0
  115. package/dist/mcp/tools/model-stats.js.map +7 -0
  116. package/dist/mcp/tools/model-trace.js +55 -0
  117. package/dist/mcp/tools/model-trace.js.map +7 -0
  118. package/dist/mcp/tools/model-update.js +105 -0
  119. package/dist/mcp/tools/model-update.js.map +7 -0
  120. package/dist/mcp/tools/model-validate.js +78 -0
  121. package/dist/mcp/tools/model-validate.js.map +7 -0
  122. package/dist/mcp/tools/shared.js +103 -0
  123. package/dist/mcp/tools/shared.js.map +7 -0
  124. package/dist/reports/model-layer-report-generator.js +5 -3
  125. package/dist/reports/model-layer-report-generator.js.map +2 -2
  126. package/dist/reports/model-readme-generator.js +116 -0
  127. package/dist/reports/model-readme-generator.js.map +7 -0
  128. package/dist/reports/model-report-data.js +37 -1
  129. package/dist/reports/model-report-data.js.map +2 -2
  130. package/dist/reports/model-report-orchestrator.js +29 -6
  131. package/dist/reports/model-report-orchestrator.js.map +2 -2
  132. package/dist/reports/model-report-utils.js +9 -0
  133. package/dist/reports/model-report-utils.js.map +7 -0
  134. package/dist/schemas/bundled/analyzers/cbm.json +2 -2
  135. package/dist/schemas/bundled/analyzers/manifest.json +2 -2
  136. package/dist/schemas/bundled/api.json +1 -1
  137. package/dist/schemas/bundled/apm.json +1 -1
  138. package/dist/schemas/bundled/application.json +12 -1
  139. package/dist/schemas/bundled/base.json +1 -1
  140. package/dist/schemas/bundled/business.json +1 -1
  141. package/dist/schemas/bundled/data-model.json +38 -2
  142. package/dist/schemas/bundled/data-store.json +1 -1
  143. package/dist/schemas/bundled/manifest.json +4 -4
  144. package/dist/schemas/bundled/motivation.json +1 -1
  145. package/dist/schemas/bundled/navigation.json +1 -1
  146. package/dist/schemas/bundled/product.json +1 -1
  147. package/dist/schemas/bundled/security.json +1 -1
  148. package/dist/schemas/bundled/technology.json +1 -1
  149. package/dist/schemas/bundled/testing.json +1 -1
  150. package/dist/schemas/bundled/ux.json +1 -1
  151. package/dist/server/server.js +45 -7
  152. package/dist/server/server.js.map +2 -2
  153. package/dist/telemetry/config.js +2 -40
  154. package/dist/telemetry/config.js.map +2 -2
  155. package/dist/telemetry/index.js +1 -1
  156. package/dist/types/index.js.map +2 -2
  157. package/dist/utils/ansi-suppressor.js +25 -0
  158. package/dist/utils/ansi-suppressor.js.map +7 -0
  159. package/dist/utils/color-utils.js +34 -0
  160. package/dist/utils/color-utils.js.map +7 -0
  161. package/dist/utils/element-reference-shape.js +15 -1
  162. package/dist/utils/element-reference-shape.js.map +3 -3
  163. package/dist/utils/errors.js +69 -10
  164. package/dist/utils/errors.js.map +2 -2
  165. package/dist/utils/globals.js +17 -1
  166. package/dist/utils/globals.js.map +2 -2
  167. package/dist/utils/project-paths.js +24 -2
  168. package/dist/utils/project-paths.js.map +2 -2
  169. package/dist/utils/reference-path-parser.js +49 -0
  170. package/dist/utils/reference-path-parser.js.map +7 -0
  171. package/dist/utils/source-reference.js +5 -0
  172. package/dist/utils/source-reference.js.map +2 -2
  173. package/dist/utils/spec-version.js +10 -2
  174. package/dist/utils/spec-version.js.map +2 -2
  175. package/dist/validators/composed-reference-validator.js +262 -0
  176. package/dist/validators/composed-reference-validator.js.map +7 -0
  177. package/dist/validators/reference-validator.js +59 -8
  178. package/dist/validators/reference-validator.js.map +3 -3
  179. package/dist/validators/relationship-schema-validator.js +30 -2
  180. package/dist/validators/relationship-schema-validator.js.map +3 -3
  181. package/dist/viewer/README.md +6 -6
  182. package/dist/viewer/assets/main-B7AOQXXX.js +81 -0
  183. package/dist/viewer/assets/main-vdrFrG7q.css +1 -0
  184. package/dist/viewer/index.html +2 -2
  185. package/dist/viewer/manifest.json +10 -10
  186. package/dist/viewer/version.json +1 -1
  187. package/package.json +6 -3
  188. package/dist/viewer/assets/main-BRPZyc36.css +0 -1
  189. package/dist/viewer/assets/main-BrpLargo.js +0 -81
@@ -1,81 +0,0 @@
1
- var vj=Object.defineProperty,xj=Object.defineProperties;var bj=Object.getOwnPropertyDescriptors;var wu=Object.getOwnPropertySymbols;var E0=Object.prototype.hasOwnProperty,k0=Object.prototype.propertyIsEnumerable;var M0=e=>{throw TypeError(e)},Nu=Math.pow,Gh=(e,t,n)=>t in e?vj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R=(e,t)=>{for(var n in t||(t={}))E0.call(t,n)&&Gh(e,n,t[n]);if(wu)for(var n of wu(t))k0.call(t,n)&&Gh(e,n,t[n]);return e},V=(e,t)=>xj(e,bj(t));var pe=(e,t)=>{var n={};for(var i in e)E0.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&wu)for(var i of wu(e))t.indexOf(i)<0&&k0.call(e,i)&&(n[i]=e[i]);return n};var _j=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ct=(e,t,n)=>Gh(e,typeof t!="symbol"?t+"":t,n),Yh=(e,t,n)=>t.has(e)||M0("Cannot "+n);var X=(e,t,n)=>(Yh(e,t,"read from private field"),n?n.call(e):t.get(e)),Be=(e,t,n)=>t.has(e)?M0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),je=(e,t,n,i)=>(Yh(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),We=(e,t,n)=>(Yh(e,t,"access private method"),n);var Cu=(e,t,n,i)=>({set _(r){je(e,t,r,n)},get _(){return X(e,t,i)}});var Ge=(e,t,n)=>new Promise((i,r)=>{var c=h=>{try{u(n.next(h))}catch(m){r(m)}},o=h=>{try{u(n.throw(h))}catch(m){r(m)}},u=h=>h.done?i(h.value):Promise.resolve(h.value).then(c,o);u((n=n.apply(e,t)).next())});import{r as Lp,a as l_,g as Sj,b as M,R as re,c as md}from"./vendor-CxKvDp2x.js";var d9=_j(Hg=>{(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const o of c.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(r){if(r.ep)return;r.ep=!0;const c=n(r);fetch(r.href,c)}})();var Kh={exports:{}},So={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var T0;function wj(){if(T0)return So;T0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,r,c){var o=null;if(c!==void 0&&(o=""+c),r.key!==void 0&&(o=""+r.key),"key"in r){c={};for(var u in r)u!=="key"&&(c[u]=r[u])}else c=r;return r=c.ref,{$$typeof:e,type:i,key:o,ref:r!==void 0?r:null,props:c}}return So.Fragment=t,So.jsx=n,So.jsxs=n,So}var R0;function Nj(){return R0||(R0=1,Kh.exports=wj()),Kh.exports}var d=Nj(),Xh={exports:{}},wo={},Qh={exports:{}},Zh={};/**
10
- * @license React
11
- * scheduler.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var A0;function Cj(){return A0||(A0=1,(function(e){function t($,Q){var G=$.length;$.push(Q);e:for(;0<G;){var W=G-1>>>1,O=$[W];if(0<r(O,Q))$[W]=Q,$[G]=O,G=W;else break e}}function n($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var Q=$[0],G=$.pop();if(G!==Q){$[0]=G;e:for(var W=0,O=$.length,se=O>>>1;W<se;){var ue=2*(W+1)-1,I=$[ue],ie=ue+1,ye=$[ie];if(0>r(I,G))ie<O&&0>r(ye,I)?($[W]=ye,$[ie]=G,W=ie):($[W]=I,$[ue]=G,W=ue);else if(ie<O&&0>r(ye,G))$[W]=ye,$[ie]=G,W=ie;else break e}}return Q}function r($,Q){var G=$.sortIndex-Q.sortIndex;return G!==0?G:$.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var h=[],m=[],g=1,p=null,y=3,x=!1,_=!1,S=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate!="undefined"?setImmediate:null;function j($){for(var Q=n(m);Q!==null;){if(Q.callback===null)i(m);else if(Q.startTime<=$)i(m),Q.sortIndex=Q.expirationTime,t(h,Q);else break;Q=n(m)}}function A($){if(S=!1,j($),!_)if(n(h)!==null)_=!0,L||(L=!0,P());else{var Q=n(m);Q!==null&&q(A,Q.startTime-$)}}var L=!1,z=-1,F=5,D=-1;function T(){return w?!0:!(e.unstable_now()-D<F)}function B(){if(w=!1,L){var $=e.unstable_now();D=$;var Q=!0;try{e:{_=!1,S&&(S=!1,k(z),z=-1),x=!0;var G=y;try{t:{for(j($),p=n(h);p!==null&&!(p.expirationTime>$&&T());){var W=p.callback;if(typeof W=="function"){p.callback=null,y=p.priorityLevel;var O=W(p.expirationTime<=$);if($=e.unstable_now(),typeof O=="function"){p.callback=O,j($),Q=!0;break t}p===n(h)&&i(h),j($)}else i(h);p=n(h)}if(p!==null)Q=!0;else{var se=n(m);se!==null&&q(A,se.startTime-$),Q=!1}}break e}finally{p=null,y=G,x=!1}Q=void 0}}finally{Q?P():L=!1}}}var P;if(typeof C=="function")P=function(){C(B)};else if(typeof MessageChannel!="undefined"){var K=new MessageChannel,H=K.port2;K.port1.onmessage=B,P=function(){H.postMessage(null)}}else P=function(){N(B,0)};function q($,Q){z=N(function(){$(e.unstable_now())},Q)}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($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function($){switch(y){case 1:case 2:case 3:var Q=3;break;default:Q=y}var G=y;y=Q;try{return $()}finally{y=G}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function($,Q){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var G=y;y=$;try{return Q()}finally{y=G}},e.unstable_scheduleCallback=function($,Q,G){var W=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?W+G:W):G=W,$){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=G+O,$={id:g++,callback:Q,priorityLevel:$,startTime:G,expirationTime:O,sortIndex:-1},G>W?($.sortIndex=G,t(m,$),n(h)===null&&$===n(m)&&(S?(k(z),z=-1):S=!0,q(A,G-W))):($.sortIndex=O,t(h,$),_||x||(_=!0,L||(L=!0,P()))),$},e.unstable_shouldYield=T,e.unstable_wrapCallback=function($){var Q=y;return function(){var G=y;y=Q;try{return $.apply(this,arguments)}finally{y=G}}}})(Zh)),Zh}var L0;function jj(){return L0||(L0=1,Qh.exports=Cj()),Qh.exports}/**
18
- * @license React
19
- * react-dom-client.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var D0;function Ej(){if(D0)return wo;D0=1;var e=jj(),t=Lp(),n=l_();function i(a){var s="https://react.dev/errors/"+a;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+a+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function c(a){var s=a,l=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,(s.flags&4098)!==0&&(l=s.return),a=s.return;while(a)}return s.tag===3?l:null}function o(a){if(a.tag===13){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function u(a){if(a.tag===31){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function h(a){if(c(a)!==a)throw Error(i(188))}function m(a){var s=a.alternate;if(!s){if(s=c(a),s===null)throw Error(i(188));return s!==a?null:a}for(var l=a,f=s;;){var v=l.return;if(v===null)break;var b=v.alternate;if(b===null){if(f=v.return,f!==null){l=f;continue}break}if(v.child===b.child){for(b=v.child;b;){if(b===l)return h(v),a;if(b===f)return h(v),s;b=b.sibling}throw Error(i(188))}if(l.return!==f.return)l=v,f=b;else{for(var E=!1,U=v.child;U;){if(U===l){E=!0,l=v,f=b;break}if(U===f){E=!0,f=v,l=b;break}U=U.sibling}if(!E){for(U=b.child;U;){if(U===l){E=!0,l=b,f=v;break}if(U===f){E=!0,f=b,l=v;break}U=U.sibling}if(!E)throw Error(i(189))}}if(l.alternate!==f)throw Error(i(190))}if(l.tag!==3)throw Error(i(188));return l.stateNode.current===l?a:s}function g(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a;for(a=a.child;a!==null;){if(s=g(a),s!==null)return s;a=a.sibling}return null}var p=Object.assign,y=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),C=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function P(a){return a===null||typeof a!="object"?null:(a=B&&a[B]||a["@@iterator"],typeof a=="function"?a:null)}var K=Symbol.for("react.client.reference");function H(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===K?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case N:return"Profiler";case w:return"StrictMode";case A:return"Suspense";case L:return"SuspenseList";case D:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case _:return"Portal";case C:return a.displayName||"Context";case k:return(a._context.displayName||"Context")+".Consumer";case j:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case z:return s=a.displayName||null,s!==null?s:H(a.type)||"Memo";case F:s=a._payload,a=a._init;try{return H(a(s))}catch(l){}}return null}var q=Array.isArray,$=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},W=[],O=-1;function se(a){return{current:a}}function ue(a){0>O||(a.current=W[O],W[O]=null,O--)}function I(a,s){O++,W[O]=a.current,a.current=s}var ie=se(null),ye=se(null),xe=se(null),Ce=se(null);function Se(a,s){switch(I(xe,s),I(ye,a),I(ie,null),s.nodeType){case 9:case 11:a=(a=s.documentElement)&&(a=a.namespaceURI)?Q1(a):0;break;default:if(a=s.tagName,s=s.namespaceURI)s=Q1(s),a=Z1(s,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}ue(ie),I(ie,a)}function Pe(){ue(ie),ue(ye),ue(xe)}function vt(a){a.memoizedState!==null&&I(Ce,a);var s=ie.current,l=Z1(s,a.type);s!==l&&(I(ye,a),I(ie,l))}function mt(a){ye.current===a&&(ue(ie),ue(ye)),Ce.current===a&&(ue(Ce),vo._currentValue=G)}var Ut,rt;function $e(a){if(Ut===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);Ut=s&&s[1]||"",rt=-1<l.stack.indexOf(`
26
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
27
- `+Ut+a+rt}var Ue=!1;function xt(a,s){if(!a||Ue)return"";Ue=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(s){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(oe){var ae=oe}Reflect.construct(a,[],ge)}else{try{ge.call()}catch(oe){ae=oe}a.call(ge.prototype)}}else{try{throw Error()}catch(oe){ae=oe}(ge=a())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(oe){if(oe&&ae&&typeof oe.stack=="string")return[oe.stack,ae.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=f.DetermineComponentFrameRoot(),E=b[0],U=b[1];if(E&&U){var Y=E.split(`
28
- `),ne=U.split(`
29
- `);for(v=f=0;f<Y.length&&!Y[f].includes("DetermineComponentFrameRoot");)f++;for(;v<ne.length&&!ne[v].includes("DetermineComponentFrameRoot");)v++;if(f===Y.length||v===ne.length)for(f=Y.length-1,v=ne.length-1;1<=f&&0<=v&&Y[f]!==ne[v];)v--;for(;1<=f&&0<=v;f--,v--)if(Y[f]!==ne[v]){if(f!==1||v!==1)do if(f--,v--,0>v||Y[f]!==ne[v]){var fe=`
30
- `+Y[f].replace(" at new "," at ");return a.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",a.displayName)),fe}while(1<=f&&0<=v);break}}}finally{Ue=!1,Error.prepareStackTrace=l}return(l=a?a.displayName||a.name:"")?$e(l):""}function ke(a,s){switch(a.tag){case 26:case 27:case 5:return $e(a.type);case 16:return $e("Lazy");case 13:return a.child!==s&&s!==null?$e("Suspense Fallback"):$e("Suspense");case 19:return $e("SuspenseList");case 0:case 15:return xt(a.type,!1);case 11:return xt(a.type.render,!1);case 1:return xt(a.type,!0);case 31:return $e("Activity");default:return""}}function ft(a){try{var s="",l=null;do s+=ke(a,l),l=a,a=a.return;while(a);return s}catch(f){return`
31
- Error generating stack: `+f.message+`
32
- `+f.stack}}var Me=Object.prototype.hasOwnProperty,$n=e.unstable_scheduleCallback,yn=e.unstable_cancelCallback,wn=e.unstable_shouldYield,Ca=e.unstable_requestPaint,Rt=e.unstable_now,za=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,nt=e.unstable_LowPriority,Te=e.unstable_IdlePriority,_t=e.log,Et=e.unstable_setDisableYieldValue,Ie=null,pt=null;function Xe(a){if(typeof _t=="function"&&Et(a),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(Ie,a)}catch(s){}}var Je=Math.clz32?Math.clz32:_r,Nn=Math.log,ln=Math.LN2;function _r(a){return a>>>=0,a===0?32:31-(Nn(a)/ln|0)|0}var ei=256,Ia=262144,ti=4194304;function en(a){var s=a&42;if(s!==0)return s;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function sa(a,s,l){var f=a.pendingLanes;if(f===0)return 0;var v=0,b=a.suspendedLanes,E=a.pingedLanes;a=a.warmLanes;var U=f&134217727;return U!==0?(f=U&~b,f!==0?v=en(f):(E&=U,E!==0?v=en(E):l||(l=U&~a,l!==0&&(v=en(l))))):(U=f&~b,U!==0?v=en(U):E!==0?v=en(E):l||(l=f&~a,l!==0&&(v=en(l)))),v===0?0:s!==0&&s!==v&&(s&b)===0&&(b=v&-v,l=s&-s,b>=l||b===32&&(l&4194048)!==0)?s:v}function Mn(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function Ba(a,s){switch(a){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 Li(){var a=ti;return ti<<=1,(ti&62914560)===0&&(ti=4194304),a}function ni(a){for(var s=[],l=0;31>l;l++)s.push(a);return s}function Ua(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function qn(a,s,l,f,v,b){var E=a.pendingLanes;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=l,a.entangledLanes&=l,a.errorRecoveryDisabledLanes&=l,a.shellSuspendCounter=0;var U=a.entanglements,Y=a.expirationTimes,ne=a.hiddenUpdates;for(l=E&~l;0<l;){var fe=31-Je(l),ge=1<<fe;U[fe]=0,Y[fe]=-1;var ae=ne[fe];if(ae!==null)for(ne[fe]=null,fe=0;fe<ae.length;fe++){var oe=ae[fe];oe!==null&&(oe.lane&=-536870913)}l&=~ge}f!==0&&Fa(a,f,0),b!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=b&~(E&~s))}function Fa(a,s,l){a.pendingLanes|=s,a.suspendedLanes&=~s;var f=31-Je(s);a.entangledLanes|=s,a.entanglements[f]=a.entanglements[f]|1073741824|l&261930}function ai(a,s){var l=a.entangledLanes|=s;for(a=a.entanglements;l;){var f=31-Je(l),v=1<<f;v&s|a[f]&s&&(a[f]|=s),l&=~v}}function ja(a,s){var l=s&-s;return l=(l&42)!==0?1:Ea(l),(l&(a.suspendedLanes|s))!==0?0:l}function Ea(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Di(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function ii(){var a=Q.p;return a!==0?a:(a=window.event,a===void 0?32:b0(a.type))}function Ha(a,s){var l=Q.p;try{return Q.p=a,s()}finally{Q.p=l}}var Vn=Math.random().toString(36).slice(2),le="__reactFiber$"+Vn,we="__reactProps$"+Vn,De="__reactContainer$"+Vn,Ye="__reactEvents$"+Vn,$t="__reactListeners$"+Vn,ra="__reactHandles$"+Vn,on="__reactResources$"+Vn,fn="__reactMarker$"+Vn;function Gn(a){delete a[le],delete a[we],delete a[Ye],delete a[$t],delete a[ra]}function J(a){var s=a[le];if(s)return s;for(var l=a.parentNode;l;){if(s=l[De]||l[le]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(a=i0(a);a!==null;){if(l=a[le])return l;a=i0(a)}return s}a=l,l=a.parentNode}return null}function he(a){if(a=a[le]||a[De]){var s=a.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return a}return null}function _e(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(i(33))}function ze(a){var s=a[on];return s||(s=a[on]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Ae(a){a[fn]=!0}var tt=new Set,ht={};function Ft(a,s){tn(a,s),tn(a+"Capture",s)}function tn(a,s){for(ht[a]=s,a=0;a<s.length;a++)tt.add(s[a])}var Oi=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]*$"),Al={},Ll={};function fc(a){return Me.call(Ll,a)?!0:Me.call(Al,a)?!1:Oi.test(a)?Ll[a]=!0:(Al[a]=!0,!1)}function Ht(a,s,l){if(fc(s))if(l===null)a.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var f=s.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+l)}}function nn(a,s,l){if(l===null)a.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(s);return}a.setAttribute(s,""+l)}}function vn(a,s,l,f){if(f===null)a.removeAttribute(l);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(l);return}a.setAttributeNS(s,l,""+f)}}function la(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Pg(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function dN(a,s,l){var f=Object.getOwnPropertyDescriptor(a.constructor.prototype,s);if(!a.hasOwnProperty(s)&&typeof f!="undefined"&&typeof f.get=="function"&&typeof f.set=="function"){var v=f.get,b=f.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return v.call(this)},set:function(E){l=""+E,b.call(this,E)}}),Object.defineProperty(a,s,{enumerable:f.enumerable}),{getValue:function(){return l},setValue:function(E){l=""+E},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function Bd(a){if(!a._valueTracker){var s=Pg(a)?"checked":"value";a._valueTracker=dN(a,s,""+a[s])}}function $g(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var l=s.getValue(),f="";return a&&(f=Pg(a)?a.checked?"true":"false":a.value),a=f,a!==l?(s.setValue(a),!0):!1}function hc(a){if(a=a||(typeof document!="undefined"?document:void 0),typeof a=="undefined")return null;try{return a.activeElement||a.body}catch(s){return a.body}}var fN=/[\n"\\]/g;function oa(a){return a.replace(fN,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ud(a,s,l,f,v,b,E,U){a.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?a.type=E:a.removeAttribute("type"),s!=null?E==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+la(s)):a.value!==""+la(s)&&(a.value=""+la(s)):E!=="submit"&&E!=="reset"||a.removeAttribute("value"),s!=null?Fd(a,E,la(s)):l!=null?Fd(a,E,la(l)):f!=null&&a.removeAttribute("value"),v==null&&b!=null&&(a.defaultChecked=!!b),v!=null&&(a.checked=v&&typeof v!="function"&&typeof v!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?a.name=""+la(U):a.removeAttribute("name")}function qg(a,s,l,f,v,b,E,U){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(a.type=b),s!=null||l!=null){if(!(b!=="submit"&&b!=="reset"||s!=null)){Bd(a);return}l=l!=null?""+la(l):"",s=s!=null?""+la(s):l,U||s===a.value||(a.value=s),a.defaultValue=s}f=f!=null?f:v,f=typeof f!="function"&&typeof f!="symbol"&&!!f,a.checked=U?a.checked:!!f,a.defaultChecked=!!f,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(a.name=E),Bd(a)}function Fd(a,s,l){s==="number"&&hc(a.ownerDocument)===a||a.defaultValue===""+l||(a.defaultValue=""+l)}function Sr(a,s,l,f){if(a=a.options,s){s={};for(var v=0;v<l.length;v++)s["$"+l[v]]=!0;for(l=0;l<a.length;l++)v=s.hasOwnProperty("$"+a[l].value),a[l].selected!==v&&(a[l].selected=v),v&&f&&(a[l].defaultSelected=!0)}else{for(l=""+la(l),s=null,v=0;v<a.length;v++){if(a[v].value===l){a[v].selected=!0,f&&(a[v].defaultSelected=!0);return}s!==null||a[v].disabled||(s=a[v])}s!==null&&(s.selected=!0)}}function Vg(a,s,l){if(s!=null&&(s=""+la(s),s!==a.value&&(a.value=s),l==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=l!=null?""+la(l):""}function Gg(a,s,l,f){if(s==null){if(f!=null){if(l!=null)throw Error(i(92));if(q(f)){if(1<f.length)throw Error(i(93));f=f[0]}l=f}l==null&&(l=""),s=l}l=la(s),a.defaultValue=l,f=a.textContent,f===l&&f!==""&&f!==null&&(a.value=f),Bd(a)}function wr(a,s){if(s){var l=a.firstChild;if(l&&l===a.lastChild&&l.nodeType===3){l.nodeValue=s;return}}a.textContent=s}var hN=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 Yg(a,s,l){var f=s.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?f?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":f?a.setProperty(s,l):typeof l!="number"||l===0||hN.has(s)?s==="float"?a.cssFloat=l:a[s]=(""+l).trim():a[s]=l+"px"}function Kg(a,s,l){if(s!=null&&typeof s!="object")throw Error(i(62));if(a=a.style,l!=null){for(var f in l)!l.hasOwnProperty(f)||s!=null&&s.hasOwnProperty(f)||(f.indexOf("--")===0?a.setProperty(f,""):f==="float"?a.cssFloat="":a[f]="");for(var v in s)f=s[v],s.hasOwnProperty(v)&&l[v]!==f&&Yg(a,v,f)}else for(var b in s)s.hasOwnProperty(b)&&Yg(a,b,s[b])}function Hd(a){if(a.indexOf("-")===-1)return!1;switch(a){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 mN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),pN=/^[\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 mc(a){return pN.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function si(){}var Pd=null;function $d(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Nr=null,Cr=null;function Xg(a){var s=he(a);if(s&&(a=s.stateNode)){var l=a[we]||null;e:switch(a=s.stateNode,s.type){case"input":if(Ud(a,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),s=l.name,l.type==="radio"&&s!=null){for(l=a;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+oa(""+s)+'"][type="radio"]'),s=0;s<l.length;s++){var f=l[s];if(f!==a&&f.form===a.form){var v=f[we]||null;if(!v)throw Error(i(90));Ud(f,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(s=0;s<l.length;s++)f=l[s],f.form===a.form&&$g(f)}break e;case"textarea":Vg(a,l.value,l.defaultValue);break e;case"select":s=l.value,s!=null&&Sr(a,!!l.multiple,s,!1)}}}var qd=!1;function Qg(a,s,l){if(qd)return a(s,l);qd=!0;try{var f=a(s);return f}finally{if(qd=!1,(Nr!==null||Cr!==null)&&(tu(),Nr&&(s=Nr,a=Cr,Cr=Nr=null,Xg(s),a)))for(s=0;s<a.length;s++)Xg(a[s])}}function Dl(a,s){var l=a.stateNode;if(l===null)return null;var f=l[we]||null;if(f===null)return null;l=f[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(a=a.type,f=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!f;break e;default:a=!1}if(a)return null;if(l&&typeof l!="function")throw Error(i(231,s,typeof l));return l}var ri=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),Vd=!1;if(ri)try{var Ol={};Object.defineProperty(Ol,"passive",{get:function(){Vd=!0}}),window.addEventListener("test",Ol,Ol),window.removeEventListener("test",Ol,Ol)}catch(a){Vd=!1}var zi=null,Gd=null,pc=null;function Zg(){if(pc)return pc;var a,s=Gd,l=s.length,f,v="value"in zi?zi.value:zi.textContent,b=v.length;for(a=0;a<l&&s[a]===v[a];a++);var E=l-a;for(f=1;f<=E&&s[l-f]===v[b-f];f++);return pc=v.slice(a,1<f?1-f:void 0)}function gc(a){var s=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&s===13&&(a=13)):a=s,a===10&&(a=13),32<=a||a===13?a:0}function yc(){return!0}function Jg(){return!1}function Tn(a){function s(l,f,v,b,E){this._reactName=l,this._targetInst=v,this.type=f,this.nativeEvent=b,this.target=E,this.currentTarget=null;for(var U in a)a.hasOwnProperty(U)&&(l=a[U],this[U]=l?l(b):b[U]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?yc:Jg,this.isPropagationStopped=Jg,this}return p(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=yc)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=yc)},persist:function(){},isPersistent:yc}),s}var Rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vc=Tn(Rs),zl=p({},Rs,{view:0,detail:0}),gN=Tn(zl),Yd,Kd,Il,xc=p({},zl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qd,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Il&&(Il&&a.type==="mousemove"?(Yd=a.screenX-Il.screenX,Kd=a.screenY-Il.screenY):Kd=Yd=0,Il=a),Yd)},movementY:function(a){return"movementY"in a?a.movementY:Kd}}),Wg=Tn(xc),yN=p({},xc,{dataTransfer:0}),vN=Tn(yN),xN=p({},zl,{relatedTarget:0}),Xd=Tn(xN),bN=p({},Rs,{animationName:0,elapsedTime:0,pseudoElement:0}),_N=Tn(bN),SN=p({},Rs,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),wN=Tn(SN),NN=p({},Rs,{data:0}),ey=Tn(NN),CN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jN={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"},EN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kN(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=EN[a])?!!s[a]:!1}function Qd(){return kN}var MN=p({},zl,{key:function(a){if(a.key){var s=CN[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=gc(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?jN[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qd,charCode:function(a){return a.type==="keypress"?gc(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?gc(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),TN=Tn(MN),RN=p({},xc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ty=Tn(RN),AN=p({},zl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qd}),LN=Tn(AN),DN=p({},Rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),ON=Tn(DN),zN=p({},xc,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),IN=Tn(zN),BN=p({},Rs,{newState:0,oldState:0}),UN=Tn(BN),FN=[9,13,27,32],Zd=ri&&"CompositionEvent"in window,Bl=null;ri&&"documentMode"in document&&(Bl=document.documentMode);var HN=ri&&"TextEvent"in window&&!Bl,ny=ri&&(!Zd||Bl&&8<Bl&&11>=Bl),ay=" ",iy=!1;function sy(a,s){switch(a){case"keyup":return FN.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ry(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var jr=!1;function PN(a,s){switch(a){case"compositionend":return ry(s);case"keypress":return s.which!==32?null:(iy=!0,ay);case"textInput":return a=s.data,a===ay&&iy?null:a;default:return null}}function $N(a,s){if(jr)return a==="compositionend"||!Zd&&sy(a,s)?(a=Zg(),pc=Gd=zi=null,jr=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return ny&&s.locale!=="ko"?null:s.data;default:return null}}var qN={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 ly(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!qN[a.type]:s==="textarea"}function oy(a,s,l,f){Nr?Cr?Cr.push(f):Cr=[f]:Nr=f,s=ou(s,"onChange"),0<s.length&&(l=new vc("onChange","change",null,l,f),a.push({event:l,listeners:s}))}var Ul=null,Fl=null;function VN(a){q1(a,0)}function bc(a){var s=_e(a);if($g(s))return a}function cy(a,s){if(a==="change")return s}var uy=!1;if(ri){var Jd;if(ri){var Wd="oninput"in document;if(!Wd){var dy=document.createElement("div");dy.setAttribute("oninput","return;"),Wd=typeof dy.oninput=="function"}Jd=Wd}else Jd=!1;uy=Jd&&(!document.documentMode||9<document.documentMode)}function fy(){Ul&&(Ul.detachEvent("onpropertychange",hy),Fl=Ul=null)}function hy(a){if(a.propertyName==="value"&&bc(Fl)){var s=[];oy(s,Fl,a,$d(a)),Qg(VN,s)}}function GN(a,s,l){a==="focusin"?(fy(),Ul=s,Fl=l,Ul.attachEvent("onpropertychange",hy)):a==="focusout"&&fy()}function YN(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return bc(Fl)}function KN(a,s){if(a==="click")return bc(s)}function XN(a,s){if(a==="input"||a==="change")return bc(s)}function QN(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var Yn=typeof Object.is=="function"?Object.is:QN;function Hl(a,s){if(Yn(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var l=Object.keys(a),f=Object.keys(s);if(l.length!==f.length)return!1;for(f=0;f<l.length;f++){var v=l[f];if(!Me.call(s,v)||!Yn(a[v],s[v]))return!1}return!0}function my(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function py(a,s){var l=my(a);a=0;for(var f;l;){if(l.nodeType===3){if(f=a+l.textContent.length,a<=s&&f>=s)return{node:l,offset:s-a};a=f}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=my(l)}}function gy(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?gy(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function yy(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=hc(a.document);s instanceof a.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch(f){l=!1}if(l)a=s.contentWindow;else break;s=hc(a.document)}return s}function ef(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}var ZN=ri&&"documentMode"in document&&11>=document.documentMode,Er=null,tf=null,Pl=null,nf=!1;function vy(a,s,l){var f=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;nf||Er==null||Er!==hc(f)||(f=Er,"selectionStart"in f&&ef(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Pl&&Hl(Pl,f)||(Pl=f,f=ou(tf,"onSelect"),0<f.length&&(s=new vc("onSelect","select",null,s,l),a.push({event:s,listeners:f}),s.target=Er)))}function As(a,s){var l={};return l[a.toLowerCase()]=s.toLowerCase(),l["Webkit"+a]="webkit"+s,l["Moz"+a]="moz"+s,l}var kr={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionrun:As("Transition","TransitionRun"),transitionstart:As("Transition","TransitionStart"),transitioncancel:As("Transition","TransitionCancel"),transitionend:As("Transition","TransitionEnd")},af={},xy={};ri&&(xy=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);function Ls(a){if(af[a])return af[a];if(!kr[a])return a;var s=kr[a],l;for(l in s)if(s.hasOwnProperty(l)&&l in xy)return af[a]=s[l];return a}var by=Ls("animationend"),_y=Ls("animationiteration"),Sy=Ls("animationstart"),JN=Ls("transitionrun"),WN=Ls("transitionstart"),eC=Ls("transitioncancel"),wy=Ls("transitionend"),Ny=new Map,sf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");sf.push("scrollEnd");function ka(a,s){Ny.set(a,s),Ft(s,[a])}var _c=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},ca=[],Mr=0,rf=0;function Sc(){for(var a=Mr,s=rf=Mr=0;s<a;){var l=ca[s];ca[s++]=null;var f=ca[s];ca[s++]=null;var v=ca[s];ca[s++]=null;var b=ca[s];if(ca[s++]=null,f!==null&&v!==null){var E=f.pending;E===null?v.next=v:(v.next=E.next,E.next=v),f.pending=v}b!==0&&Cy(l,v,b)}}function wc(a,s,l,f){ca[Mr++]=a,ca[Mr++]=s,ca[Mr++]=l,ca[Mr++]=f,rf|=f,a.lanes|=f,a=a.alternate,a!==null&&(a.lanes|=f)}function lf(a,s,l,f){return wc(a,s,l,f),Nc(a)}function Ds(a,s){return wc(a,null,null,s),Nc(a)}function Cy(a,s,l){a.lanes|=l;var f=a.alternate;f!==null&&(f.lanes|=l);for(var v=!1,b=a.return;b!==null;)b.childLanes|=l,f=b.alternate,f!==null&&(f.childLanes|=l),b.tag===22&&(a=b.stateNode,a===null||a._visibility&1||(v=!0)),a=b,b=b.return;return a.tag===3?(b=a.stateNode,v&&s!==null&&(v=31-Je(l),a=b.hiddenUpdates,f=a[v],f===null?a[v]=[s]:f.push(s),s.lane=l|536870912),b):null}function Nc(a){if(50<uo)throw uo=0,gh=null,Error(i(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var Tr={};function tC(a,s,l,f){this.tag=a,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kn(a,s,l,f){return new tC(a,s,l,f)}function of(a){return a=a.prototype,!(!a||!a.isReactComponent)}function li(a,s){var l=a.alternate;return l===null?(l=Kn(a.tag,s,a.key,a.mode),l.elementType=a.elementType,l.type=a.type,l.stateNode=a.stateNode,l.alternate=a,a.alternate=l):(l.pendingProps=s,l.type=a.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=a.flags&65011712,l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,s=a.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=a.sibling,l.index=a.index,l.ref=a.ref,l.refCleanup=a.refCleanup,l}function jy(a,s){a.flags&=65011714;var l=a.alternate;return l===null?(a.childLanes=0,a.lanes=s,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,s=l.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a}function Cc(a,s,l,f,v,b){var E=0;if(f=a,typeof a=="function")of(a)&&(E=1);else if(typeof a=="string")E=rj(a,l,ie.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case D:return a=Kn(31,l,s,v),a.elementType=D,a.lanes=b,a;case S:return Os(l.children,v,b,s);case w:E=8,v|=24;break;case N:return a=Kn(12,l,s,v|2),a.elementType=N,a.lanes=b,a;case A:return a=Kn(13,l,s,v),a.elementType=A,a.lanes=b,a;case L:return a=Kn(19,l,s,v),a.elementType=L,a.lanes=b,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case C:E=10;break e;case k:E=9;break e;case j:E=11;break e;case z:E=14;break e;case F:E=16,f=null;break e}E=29,l=Error(i(130,a===null?"null":typeof a,"")),f=null}return s=Kn(E,l,s,v),s.elementType=a,s.type=f,s.lanes=b,s}function Os(a,s,l,f){return a=Kn(7,a,f,s),a.lanes=l,a}function cf(a,s,l){return a=Kn(6,a,null,s),a.lanes=l,a}function Ey(a){var s=Kn(18,null,null,0);return s.stateNode=a,s}function uf(a,s,l){return s=Kn(4,a.children!==null?a.children:[],a.key,s),s.lanes=l,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}var ky=new WeakMap;function ua(a,s){if(typeof a=="object"&&a!==null){var l=ky.get(a);return l!==void 0?l:(s={value:a,source:s,stack:ft(s)},ky.set(a,s),s)}return{value:a,source:s,stack:ft(s)}}var Rr=[],Ar=0,jc=null,$l=0,da=[],fa=0,Ii=null,Pa=1,$a="";function oi(a,s){Rr[Ar++]=$l,Rr[Ar++]=jc,jc=a,$l=s}function My(a,s,l){da[fa++]=Pa,da[fa++]=$a,da[fa++]=Ii,Ii=a;var f=Pa;a=$a;var v=32-Je(f)-1;f&=~(1<<v),l+=1;var b=32-Je(s)+v;if(30<b){var E=v-v%5;b=(f&(1<<E)-1).toString(32),f>>=E,v-=E,Pa=1<<32-Je(s)+v|l<<v|f,$a=b+a}else Pa=1<<b|l<<v|f,$a=a}function df(a){a.return!==null&&(oi(a,1),My(a,1,0))}function ff(a){for(;a===jc;)jc=Rr[--Ar],Rr[Ar]=null,$l=Rr[--Ar],Rr[Ar]=null;for(;a===Ii;)Ii=da[--fa],da[fa]=null,$a=da[--fa],da[fa]=null,Pa=da[--fa],da[fa]=null}function Ty(a,s){da[fa++]=Pa,da[fa++]=$a,da[fa++]=Ii,Pa=s.id,$a=s.overflow,Ii=a}var hn=null,zt=null,ct=!1,Bi=null,ha=!1,hf=Error(i(519));function Ui(a){var s=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ql(ua(s,a)),hf}function Ry(a){var s=a.stateNode,l=a.type,f=a.memoizedProps;switch(s[le]=a,s[we]=f,l){case"dialog":it("cancel",s),it("close",s);break;case"iframe":case"object":case"embed":it("load",s);break;case"video":case"audio":for(l=0;l<ho.length;l++)it(ho[l],s);break;case"source":it("error",s);break;case"img":case"image":case"link":it("error",s),it("load",s);break;case"details":it("toggle",s);break;case"input":it("invalid",s),qg(s,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":it("invalid",s);break;case"textarea":it("invalid",s),Gg(s,f.value,f.defaultValue,f.children)}l=f.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||s.textContent===""+l||f.suppressHydrationWarning===!0||K1(s.textContent,l)?(f.popover!=null&&(it("beforetoggle",s),it("toggle",s)),f.onScroll!=null&&it("scroll",s),f.onScrollEnd!=null&&it("scrollend",s),f.onClick!=null&&(s.onclick=si),s=!0):s=!1,s||Ui(a,!0)}function Ay(a){for(hn=a.return;hn;)switch(hn.tag){case 5:case 31:case 13:ha=!1;return;case 27:case 3:ha=!0;return;default:hn=hn.return}}function Lr(a){if(a!==hn)return!1;if(!ct)return Ay(a),ct=!0,!1;var s=a.tag,l;if((l=s!==3&&s!==27)&&((l=s===5)&&(l=a.type,l=!(l!=="form"&&l!=="button")||Rh(a.type,a.memoizedProps)),l=!l),l&&zt&&Ui(a),Ay(a),s===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));zt=a0(a)}else if(s===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));zt=a0(a)}else s===27?(s=zt,Wi(a.type)?(a=zh,zh=null,zt=a):zt=s):zt=hn?pa(a.stateNode.nextSibling):null;return!0}function zs(){zt=hn=null,ct=!1}function mf(){var a=Bi;return a!==null&&(Dn===null?Dn=a:Dn.push.apply(Dn,a),Bi=null),a}function ql(a){Bi===null?Bi=[a]:Bi.push(a)}var pf=se(null),Is=null,ci=null;function Fi(a,s,l){I(pf,s._currentValue),s._currentValue=l}function ui(a){a._currentValue=pf.current,ue(pf)}function gf(a,s,l){for(;a!==null;){var f=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,f!==null&&(f.childLanes|=s)):f!==null&&(f.childLanes&s)!==s&&(f.childLanes|=s),a===l)break;a=a.return}}function yf(a,s,l,f){var v=a.child;for(v!==null&&(v.return=a);v!==null;){var b=v.dependencies;if(b!==null){var E=v.child;b=b.firstContext;e:for(;b!==null;){var U=b;b=v;for(var Y=0;Y<s.length;Y++)if(U.context===s[Y]){b.lanes|=l,U=b.alternate,U!==null&&(U.lanes|=l),gf(b.return,l,a),f||(E=null);break e}b=U.next}}else if(v.tag===18){if(E=v.return,E===null)throw Error(i(341));E.lanes|=l,b=E.alternate,b!==null&&(b.lanes|=l),gf(E,l,a),E=null}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===a){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}}function Dr(a,s,l,f){a=null;for(var v=s,b=!1;v!==null;){if(!b){if((v.flags&524288)!==0)b=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var E=v.alternate;if(E===null)throw Error(i(387));if(E=E.memoizedProps,E!==null){var U=v.type;Yn(v.pendingProps.value,E.value)||(a!==null?a.push(U):a=[U])}}else if(v===Ce.current){if(E=v.alternate,E===null)throw Error(i(387));E.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(a!==null?a.push(vo):a=[vo])}v=v.return}a!==null&&yf(s,a,l,f),s.flags|=262144}function Ec(a){for(a=a.firstContext;a!==null;){if(!Yn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Bs(a){Is=a,ci=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function mn(a){return Ly(Is,a)}function kc(a,s){return Is===null&&Bs(a),Ly(a,s)}function Ly(a,s){var l=s._currentValue;if(s={context:s,memoizedValue:l,next:null},ci===null){if(a===null)throw Error(i(308));ci=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else ci=ci.next=s;return l}var nC=typeof AbortController!="undefined"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(l,f){a.push(f)}};this.abort=function(){s.aborted=!0,a.forEach(function(l){return l()})}},aC=e.unstable_scheduleCallback,iC=e.unstable_NormalPriority,Xt={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vf(){return{controller:new nC,data:new Map,refCount:0}}function Vl(a){a.refCount--,a.refCount===0&&aC(iC,function(){a.controller.abort()})}var Gl=null,xf=0,Or=0,zr=null;function sC(a,s){if(Gl===null){var l=Gl=[];xf=0,Or=Sh(),zr={status:"pending",value:void 0,then:function(f){l.push(f)}}}return xf++,s.then(Dy,Dy),s}function Dy(){if(--xf===0&&Gl!==null){zr!==null&&(zr.status="fulfilled");var a=Gl;Gl=null,Or=0,zr=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function rC(a,s){var l=[],f={status:"pending",value:null,reason:null,then:function(v){l.push(v)}};return a.then(function(){f.status="fulfilled",f.value=s;for(var v=0;v<l.length;v++)(0,l[v])(s)},function(v){for(f.status="rejected",f.reason=v,v=0;v<l.length;v++)(0,l[v])(void 0)}),f}var Oy=$.S;$.S=function(a,s){v1=Rt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&sC(a,s),Oy!==null&&Oy(a,s)};var Us=se(null);function bf(){var a=Us.current;return a!==null?a:At.pooledCache}function Mc(a,s){s===null?I(Us,Us.current):I(Us,s.pool)}function zy(){var a=bf();return a===null?null:{parent:Xt._currentValue,pool:a}}var Ir=Error(i(460)),_f=Error(i(474)),Tc=Error(i(542)),Rc={then:function(){}};function Iy(a){return a=a.status,a==="fulfilled"||a==="rejected"}function By(a,s,l){switch(l=a[l],l===void 0?a.push(s):l!==s&&(s.then(si,si),s=l),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,Fy(a),a;default:if(typeof s.status=="string")s.then(si,si);else{if(a=At,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=s,a.status="pending",a.then(function(f){if(s.status==="pending"){var v=s;v.status="fulfilled",v.value=f}},function(f){if(s.status==="pending"){var v=s;v.status="rejected",v.reason=f}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,Fy(a),a}throw Hs=s,Ir}}function Fs(a){try{var s=a._init;return s(a._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Hs=l,Ir):l}}var Hs=null;function Uy(){if(Hs===null)throw Error(i(459));var a=Hs;return Hs=null,a}function Fy(a){if(a===Ir||a===Tc)throw Error(i(483))}var Br=null,Yl=0;function Ac(a){var s=Yl;return Yl+=1,Br===null&&(Br=[]),By(Br,a,s)}function Kl(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function Lc(a,s){throw s.$$typeof===y?Error(i(525)):(a=Object.prototype.toString.call(s),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":a)))}function Hy(a){function s(ee,Z){if(a){var te=ee.deletions;te===null?(ee.deletions=[Z],ee.flags|=16):te.push(Z)}}function l(ee,Z){if(!a)return null;for(;Z!==null;)s(ee,Z),Z=Z.sibling;return null}function f(ee){for(var Z=new Map;ee!==null;)ee.key!==null?Z.set(ee.key,ee):Z.set(ee.index,ee),ee=ee.sibling;return Z}function v(ee,Z){return ee=li(ee,Z),ee.index=0,ee.sibling=null,ee}function b(ee,Z,te){return ee.index=te,a?(te=ee.alternate,te!==null?(te=te.index,te<Z?(ee.flags|=67108866,Z):te):(ee.flags|=67108866,Z)):(ee.flags|=1048576,Z)}function E(ee){return a&&ee.alternate===null&&(ee.flags|=67108866),ee}function U(ee,Z,te,me){return Z===null||Z.tag!==6?(Z=cf(te,ee.mode,me),Z.return=ee,Z):(Z=v(Z,te),Z.return=ee,Z)}function Y(ee,Z,te,me){var Fe=te.type;return Fe===S?fe(ee,Z,te.props.children,me,te.key):Z!==null&&(Z.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===F&&Fs(Fe)===Z.type)?(Z=v(Z,te.props),Kl(Z,te),Z.return=ee,Z):(Z=Cc(te.type,te.key,te.props,null,ee.mode,me),Kl(Z,te),Z.return=ee,Z)}function ne(ee,Z,te,me){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==te.containerInfo||Z.stateNode.implementation!==te.implementation?(Z=uf(te,ee.mode,me),Z.return=ee,Z):(Z=v(Z,te.children||[]),Z.return=ee,Z)}function fe(ee,Z,te,me,Fe){return Z===null||Z.tag!==7?(Z=Os(te,ee.mode,me,Fe),Z.return=ee,Z):(Z=v(Z,te),Z.return=ee,Z)}function ge(ee,Z,te){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=cf(""+Z,ee.mode,te),Z.return=ee,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case x:return te=Cc(Z.type,Z.key,Z.props,null,ee.mode,te),Kl(te,Z),te.return=ee,te;case _:return Z=uf(Z,ee.mode,te),Z.return=ee,Z;case F:return Z=Fs(Z),ge(ee,Z,te)}if(q(Z)||P(Z))return Z=Os(Z,ee.mode,te,null),Z.return=ee,Z;if(typeof Z.then=="function")return ge(ee,Ac(Z),te);if(Z.$$typeof===C)return ge(ee,kc(ee,Z),te);Lc(ee,Z)}return null}function ae(ee,Z,te,me){var Fe=Z!==null?Z.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Fe!==null?null:U(ee,Z,""+te,me);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return te.key===Fe?Y(ee,Z,te,me):null;case _:return te.key===Fe?ne(ee,Z,te,me):null;case F:return te=Fs(te),ae(ee,Z,te,me)}if(q(te)||P(te))return Fe!==null?null:fe(ee,Z,te,me,null);if(typeof te.then=="function")return ae(ee,Z,Ac(te),me);if(te.$$typeof===C)return ae(ee,Z,kc(ee,te),me);Lc(ee,te)}return null}function oe(ee,Z,te,me,Fe){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return ee=ee.get(te)||null,U(Z,ee,""+me,Fe);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case x:return ee=ee.get(me.key===null?te:me.key)||null,Y(Z,ee,me,Fe);case _:return ee=ee.get(me.key===null?te:me.key)||null,ne(Z,ee,me,Fe);case F:return me=Fs(me),oe(ee,Z,te,me,Fe)}if(q(me)||P(me))return ee=ee.get(te)||null,fe(Z,ee,me,Fe,null);if(typeof me.then=="function")return oe(ee,Z,te,Ac(me),Fe);if(me.$$typeof===C)return oe(ee,Z,te,kc(Z,me),Fe);Lc(Z,me)}return null}function Re(ee,Z,te,me){for(var Fe=null,gt=null,Le=Z,Ze=Z=0,ot=null;Le!==null&&Ze<te.length;Ze++){Le.index>Ze?(ot=Le,Le=null):ot=Le.sibling;var yt=ae(ee,Le,te[Ze],me);if(yt===null){Le===null&&(Le=ot);break}a&&Le&&yt.alternate===null&&s(ee,Le),Z=b(yt,Z,Ze),gt===null?Fe=yt:gt.sibling=yt,gt=yt,Le=ot}if(Ze===te.length)return l(ee,Le),ct&&oi(ee,Ze),Fe;if(Le===null){for(;Ze<te.length;Ze++)Le=ge(ee,te[Ze],me),Le!==null&&(Z=b(Le,Z,Ze),gt===null?Fe=Le:gt.sibling=Le,gt=Le);return ct&&oi(ee,Ze),Fe}for(Le=f(Le);Ze<te.length;Ze++)ot=oe(Le,ee,Ze,te[Ze],me),ot!==null&&(a&&ot.alternate!==null&&Le.delete(ot.key===null?Ze:ot.key),Z=b(ot,Z,Ze),gt===null?Fe=ot:gt.sibling=ot,gt=ot);return a&&Le.forEach(function(is){return s(ee,is)}),ct&&oi(ee,Ze),Fe}function Ve(ee,Z,te,me){if(te==null)throw Error(i(151));for(var Fe=null,gt=null,Le=Z,Ze=Z=0,ot=null,yt=te.next();Le!==null&&!yt.done;Ze++,yt=te.next()){Le.index>Ze?(ot=Le,Le=null):ot=Le.sibling;var is=ae(ee,Le,yt.value,me);if(is===null){Le===null&&(Le=ot);break}a&&Le&&is.alternate===null&&s(ee,Le),Z=b(is,Z,Ze),gt===null?Fe=is:gt.sibling=is,gt=is,Le=ot}if(yt.done)return l(ee,Le),ct&&oi(ee,Ze),Fe;if(Le===null){for(;!yt.done;Ze++,yt=te.next())yt=ge(ee,yt.value,me),yt!==null&&(Z=b(yt,Z,Ze),gt===null?Fe=yt:gt.sibling=yt,gt=yt);return ct&&oi(ee,Ze),Fe}for(Le=f(Le);!yt.done;Ze++,yt=te.next())yt=oe(Le,ee,Ze,yt.value,me),yt!==null&&(a&&yt.alternate!==null&&Le.delete(yt.key===null?Ze:yt.key),Z=b(yt,Z,Ze),gt===null?Fe=yt:gt.sibling=yt,gt=yt);return a&&Le.forEach(function(yj){return s(ee,yj)}),ct&&oi(ee,Ze),Fe}function Tt(ee,Z,te,me){if(typeof te=="object"&&te!==null&&te.type===S&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case x:e:{for(var Fe=te.key;Z!==null;){if(Z.key===Fe){if(Fe=te.type,Fe===S){if(Z.tag===7){l(ee,Z.sibling),me=v(Z,te.props.children),me.return=ee,ee=me;break e}}else if(Z.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===F&&Fs(Fe)===Z.type){l(ee,Z.sibling),me=v(Z,te.props),Kl(me,te),me.return=ee,ee=me;break e}l(ee,Z);break}else s(ee,Z);Z=Z.sibling}te.type===S?(me=Os(te.props.children,ee.mode,me,te.key),me.return=ee,ee=me):(me=Cc(te.type,te.key,te.props,null,ee.mode,me),Kl(me,te),me.return=ee,ee=me)}return E(ee);case _:e:{for(Fe=te.key;Z!==null;){if(Z.key===Fe)if(Z.tag===4&&Z.stateNode.containerInfo===te.containerInfo&&Z.stateNode.implementation===te.implementation){l(ee,Z.sibling),me=v(Z,te.children||[]),me.return=ee,ee=me;break e}else{l(ee,Z);break}else s(ee,Z);Z=Z.sibling}me=uf(te,ee.mode,me),me.return=ee,ee=me}return E(ee);case F:return te=Fs(te),Tt(ee,Z,te,me)}if(q(te))return Re(ee,Z,te,me);if(P(te)){if(Fe=P(te),typeof Fe!="function")throw Error(i(150));return te=Fe.call(te),Ve(ee,Z,te,me)}if(typeof te.then=="function")return Tt(ee,Z,Ac(te),me);if(te.$$typeof===C)return Tt(ee,Z,kc(ee,te),me);Lc(ee,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,Z!==null&&Z.tag===6?(l(ee,Z.sibling),me=v(Z,te),me.return=ee,ee=me):(l(ee,Z),me=cf(te,ee.mode,me),me.return=ee,ee=me),E(ee)):l(ee,Z)}return function(ee,Z,te,me){try{Yl=0;var Fe=Tt(ee,Z,te,me);return Br=null,Fe}catch(Le){if(Le===Ir||Le===Tc)throw Le;var gt=Kn(29,Le,null,ee.mode);return gt.lanes=me,gt.return=ee,gt}finally{}}}var Ps=Hy(!0),Py=Hy(!1),Hi=!1;function Sf(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wf(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Pi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function $i(a,s,l){var f=a.updateQueue;if(f===null)return null;if(f=f.shared,(bt&2)!==0){var v=f.pending;return v===null?s.next=s:(s.next=v.next,v.next=s),f.pending=s,s=Nc(a),Cy(a,null,l),s}return wc(a,f,s,l),Nc(a)}function Xl(a,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194048)!==0)){var f=s.lanes;f&=a.pendingLanes,l|=f,s.lanes=l,ai(a,l)}}function Nf(a,s){var l=a.updateQueue,f=a.alternate;if(f!==null&&(f=f.updateQueue,l===f)){var v=null,b=null;if(l=l.firstBaseUpdate,l!==null){do{var E={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};b===null?v=b=E:b=b.next=E,l=l.next}while(l!==null);b===null?v=b=s:b=b.next=s}else v=b=s;l={baseState:f.baseState,firstBaseUpdate:v,lastBaseUpdate:b,shared:f.shared,callbacks:f.callbacks},a.updateQueue=l;return}a=l.lastBaseUpdate,a===null?l.firstBaseUpdate=s:a.next=s,l.lastBaseUpdate=s}var Cf=!1;function Ql(){if(Cf){var a=zr;if(a!==null)throw a}}function Zl(a,s,l,f){Cf=!1;var v=a.updateQueue;Hi=!1;var b=v.firstBaseUpdate,E=v.lastBaseUpdate,U=v.shared.pending;if(U!==null){v.shared.pending=null;var Y=U,ne=Y.next;Y.next=null,E===null?b=ne:E.next=ne,E=Y;var fe=a.alternate;fe!==null&&(fe=fe.updateQueue,U=fe.lastBaseUpdate,U!==E&&(U===null?fe.firstBaseUpdate=ne:U.next=ne,fe.lastBaseUpdate=Y))}if(b!==null){var ge=v.baseState;E=0,fe=ne=Y=null,U=b;do{var ae=U.lane&-536870913,oe=ae!==U.lane;if(oe?(lt&ae)===ae:(f&ae)===ae){ae!==0&&ae===Or&&(Cf=!0),fe!==null&&(fe=fe.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Re=a,Ve=U;ae=s;var Tt=l;switch(Ve.tag){case 1:if(Re=Ve.payload,typeof Re=="function"){ge=Re.call(Tt,ge,ae);break e}ge=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ve.payload,ae=typeof Re=="function"?Re.call(Tt,ge,ae):Re,ae==null)break e;ge=p({},ge,ae);break e;case 2:Hi=!0}}ae=U.callback,ae!==null&&(a.flags|=64,oe&&(a.flags|=8192),oe=v.callbacks,oe===null?v.callbacks=[ae]:oe.push(ae))}else oe={lane:ae,tag:U.tag,payload:U.payload,callback:U.callback,next:null},fe===null?(ne=fe=oe,Y=ge):fe=fe.next=oe,E|=ae;if(U=U.next,U===null){if(U=v.shared.pending,U===null)break;oe=U,U=oe.next,oe.next=null,v.lastBaseUpdate=oe,v.shared.pending=null}}while(!0);fe===null&&(Y=ge),v.baseState=Y,v.firstBaseUpdate=ne,v.lastBaseUpdate=fe,b===null&&(v.shared.lanes=0),Ki|=E,a.lanes=E,a.memoizedState=ge}}function $y(a,s){if(typeof a!="function")throw Error(i(191,a));a.call(s)}function qy(a,s){var l=a.callbacks;if(l!==null)for(a.callbacks=null,a=0;a<l.length;a++)$y(l[a],s)}var Ur=se(null),Dc=se(0);function Vy(a,s){a=xi,I(Dc,a),I(Ur,s),xi=a|s.baseLanes}function jf(){I(Dc,xi),I(Ur,Ur.current)}function Ef(){xi=Dc.current,ue(Ur),ue(Dc)}var Xn=se(null),ma=null;function qi(a){var s=a.alternate;I(Yt,Yt.current&1),I(Xn,a),ma===null&&(s===null||Ur.current!==null||s.memoizedState!==null)&&(ma=a)}function kf(a){I(Yt,Yt.current),I(Xn,a),ma===null&&(ma=a)}function Gy(a){a.tag===22?(I(Yt,Yt.current),I(Xn,a),ma===null&&(ma=a)):Vi()}function Vi(){I(Yt,Yt.current),I(Xn,Xn.current)}function Qn(a){ue(Xn),ma===a&&(ma=null),ue(Yt)}var Yt=se(0);function Oc(a){for(var s=a;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Dh(l)||Oh(l)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var di=0,Qe=null,kt=null,Qt=null,zc=!1,Fr=!1,$s=!1,Ic=0,Jl=0,Hr=null,lC=0;function qt(){throw Error(i(321))}function Mf(a,s){if(s===null)return!1;for(var l=0;l<s.length&&l<a.length;l++)if(!Yn(a[l],s[l]))return!1;return!0}function Tf(a,s,l,f,v,b){return di=b,Qe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,$.H=a===null||a.memoizedState===null?Mv:Vf,$s=!1,b=l(f,v),$s=!1,Fr&&(b=Ky(s,l,f,v)),Yy(a),b}function Yy(a){$.H=to;var s=kt!==null&&kt.next!==null;if(di=0,Qt=kt=Qe=null,zc=!1,Jl=0,Hr=null,s)throw Error(i(300));a===null||Zt||(a=a.dependencies,a!==null&&Ec(a)&&(Zt=!0))}function Ky(a,s,l,f){Qe=a;var v=0;do{if(Fr&&(Hr=null),Jl=0,Fr=!1,25<=v)throw Error(i(301));if(v+=1,Qt=kt=null,a.updateQueue!=null){var b=a.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}$.H=Tv,b=s(l,f)}while(Fr);return b}function oC(){var a=$.H,s=a.useState()[0];return s=typeof s.then=="function"?Wl(s):s,a=a.useState()[0],(kt!==null?kt.memoizedState:null)!==a&&(Qe.flags|=1024),s}function Rf(){var a=Ic!==0;return Ic=0,a}function Af(a,s,l){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~l}function Lf(a){if(zc){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}zc=!1}di=0,Qt=kt=Qe=null,Fr=!1,Jl=Ic=0,Hr=null}function Cn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?Qe.memoizedState=Qt=a:Qt=Qt.next=a,Qt}function Kt(){if(kt===null){var a=Qe.alternate;a=a!==null?a.memoizedState:null}else a=kt.next;var s=Qt===null?Qe.memoizedState:Qt.next;if(s!==null)Qt=s,kt=a;else{if(a===null)throw Qe.alternate===null?Error(i(467)):Error(i(310));kt=a,a={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},Qt===null?Qe.memoizedState=Qt=a:Qt=Qt.next=a}return Qt}function Bc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wl(a){var s=Jl;return Jl+=1,Hr===null&&(Hr=[]),a=By(Hr,a,s),s=Qe,(Qt===null?s.memoizedState:Qt.next)===null&&(s=s.alternate,$.H=s===null||s.memoizedState===null?Mv:Vf),a}function Uc(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Wl(a);if(a.$$typeof===C)return mn(a)}throw Error(i(438,String(a)))}function Df(a){var s=null,l=Qe.updateQueue;if(l!==null&&(s=l.memoCache),s==null){var f=Qe.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(s={data:f.data.map(function(v){return v.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),l===null&&(l=Bc(),Qe.updateQueue=l),l.memoCache=s,l=s.data[s.index],l===void 0)for(l=s.data[s.index]=Array(a),f=0;f<a;f++)l[f]=T;return s.index++,l}function fi(a,s){return typeof s=="function"?s(a):s}function Fc(a){var s=Kt();return Of(s,kt,a)}function Of(a,s,l){var f=a.queue;if(f===null)throw Error(i(311));f.lastRenderedReducer=l;var v=a.baseQueue,b=f.pending;if(b!==null){if(v!==null){var E=v.next;v.next=b.next,b.next=E}s.baseQueue=v=b,f.pending=null}if(b=a.baseState,v===null)a.memoizedState=b;else{s=v.next;var U=E=null,Y=null,ne=s,fe=!1;do{var ge=ne.lane&-536870913;if(ge!==ne.lane?(lt&ge)===ge:(di&ge)===ge){var ae=ne.revertLane;if(ae===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ge===Or&&(fe=!0);else if((di&ae)===ae){ne=ne.next,ae===Or&&(fe=!0);continue}else ge={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},Y===null?(U=Y=ge,E=b):Y=Y.next=ge,Qe.lanes|=ae,Ki|=ae;ge=ne.action,$s&&l(b,ge),b=ne.hasEagerState?ne.eagerState:l(b,ge)}else ae={lane:ge,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},Y===null?(U=Y=ae,E=b):Y=Y.next=ae,Qe.lanes|=ge,Ki|=ge;ne=ne.next}while(ne!==null&&ne!==s);if(Y===null?E=b:Y.next=U,!Yn(b,a.memoizedState)&&(Zt=!0,fe&&(l=zr,l!==null)))throw l;a.memoizedState=b,a.baseState=E,a.baseQueue=Y,f.lastRenderedState=b}return v===null&&(f.lanes=0),[a.memoizedState,f.dispatch]}function zf(a){var s=Kt(),l=s.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=a;var f=l.dispatch,v=l.pending,b=s.memoizedState;if(v!==null){l.pending=null;var E=v=v.next;do b=a(b,E.action),E=E.next;while(E!==v);Yn(b,s.memoizedState)||(Zt=!0),s.memoizedState=b,s.baseQueue===null&&(s.baseState=b),l.lastRenderedState=b}return[b,f]}function Xy(a,s,l){var f=Qe,v=Kt(),b=ct;if(b){if(l===void 0)throw Error(i(407));l=l()}else l=s();var E=!Yn((kt||v).memoizedState,l);if(E&&(v.memoizedState=l,Zt=!0),v=v.queue,Uf(Jy.bind(null,f,v,a),[a]),v.getSnapshot!==s||E||Qt!==null&&Qt.memoizedState.tag&1){if(f.flags|=2048,Pr(9,{destroy:void 0},Zy.bind(null,f,v,l,s),null),At===null)throw Error(i(349));b||(di&127)!==0||Qy(f,s,l)}return l}function Qy(a,s,l){a.flags|=16384,a={getSnapshot:s,value:l},s=Qe.updateQueue,s===null?(s=Bc(),Qe.updateQueue=s,s.stores=[a]):(l=s.stores,l===null?s.stores=[a]:l.push(a))}function Zy(a,s,l,f){s.value=l,s.getSnapshot=f,Wy(s)&&ev(a)}function Jy(a,s,l){return l(function(){Wy(s)&&ev(a)})}function Wy(a){var s=a.getSnapshot;a=a.value;try{var l=s();return!Yn(a,l)}catch(f){return!0}}function ev(a){var s=Ds(a,2);s!==null&&On(s,a,2)}function If(a){var s=Cn();if(typeof a=="function"){var l=a;if(a=l(),$s){Xe(!0);try{l()}finally{Xe(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:a},s}function tv(a,s,l,f){return a.baseState=l,Of(a,kt,typeof f=="function"?f:fi)}function cC(a,s,l,f,v){if($c(a))throw Error(i(485));if(a=s.action,a!==null){var b={payload:v,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){b.listeners.push(E)}};$.T!==null?l(!0):b.isTransition=!1,f(b),l=s.pending,l===null?(b.next=s.pending=b,nv(s,b)):(b.next=l.next,s.pending=l.next=b)}}function nv(a,s){var l=s.action,f=s.payload,v=a.state;if(s.isTransition){var b=$.T,E={};$.T=E;try{var U=l(v,f),Y=$.S;Y!==null&&Y(E,U),av(a,s,U)}catch(ne){Bf(a,s,ne)}finally{b!==null&&E.types!==null&&(b.types=E.types),$.T=b}}else try{b=l(v,f),av(a,s,b)}catch(ne){Bf(a,s,ne)}}function av(a,s,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(f){iv(a,s,f)},function(f){return Bf(a,s,f)}):iv(a,s,l)}function iv(a,s,l){s.status="fulfilled",s.value=l,sv(s),a.state=l,s=a.pending,s!==null&&(l=s.next,l===s?a.pending=null:(l=l.next,s.next=l,nv(a,l)))}function Bf(a,s,l){var f=a.pending;if(a.pending=null,f!==null){f=f.next;do s.status="rejected",s.reason=l,sv(s),s=s.next;while(s!==f)}a.action=null}function sv(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function rv(a,s){return s}function lv(a,s){if(ct){var l=At.formState;if(l!==null){e:{var f=Qe;if(ct){if(zt){t:{for(var v=zt,b=ha;v.nodeType!==8;){if(!b){v=null;break t}if(v=pa(v.nextSibling),v===null){v=null;break t}}b=v.data,v=b==="F!"||b==="F"?v:null}if(v){zt=pa(v.nextSibling),f=v.data==="F!";break e}}Ui(f)}f=!1}f&&(s=l[0])}}return l=Cn(),l.memoizedState=l.baseState=s,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rv,lastRenderedState:s},l.queue=f,l=jv.bind(null,Qe,f),f.dispatch=l,f=If(!1),b=qf.bind(null,Qe,!1,f.queue),f=Cn(),v={state:s,dispatch:null,action:a,pending:null},f.queue=v,l=cC.bind(null,Qe,v,b,l),v.dispatch=l,f.memoizedState=a,[s,l,!1]}function ov(a){var s=Kt();return cv(s,kt,a)}function cv(a,s,l){if(s=Of(a,s,rv)[0],a=Fc(fi)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var f=Wl(s)}catch(E){throw E===Ir?Tc:E}else f=s;s=Kt();var v=s.queue,b=v.dispatch;return l!==s.memoizedState&&(Qe.flags|=2048,Pr(9,{destroy:void 0},uC.bind(null,v,l),null)),[f,b,a]}function uC(a,s){a.action=s}function uv(a){var s=Kt(),l=kt;if(l!==null)return cv(s,l,a);Kt(),s=s.memoizedState,l=Kt();var f=l.queue.dispatch;return l.memoizedState=a,[s,f,!1]}function Pr(a,s,l,f){return a={tag:a,create:l,deps:f,inst:s,next:null},s=Qe.updateQueue,s===null&&(s=Bc(),Qe.updateQueue=s),l=s.lastEffect,l===null?s.lastEffect=a.next=a:(f=l.next,l.next=a,a.next=f,s.lastEffect=a),a}function dv(){return Kt().memoizedState}function Hc(a,s,l,f){var v=Cn();Qe.flags|=a,v.memoizedState=Pr(1|s,{destroy:void 0},l,f===void 0?null:f)}function Pc(a,s,l,f){var v=Kt();f=f===void 0?null:f;var b=v.memoizedState.inst;kt!==null&&f!==null&&Mf(f,kt.memoizedState.deps)?v.memoizedState=Pr(s,b,l,f):(Qe.flags|=a,v.memoizedState=Pr(1|s,b,l,f))}function fv(a,s){Hc(8390656,8,a,s)}function Uf(a,s){Pc(2048,8,a,s)}function dC(a){Qe.flags|=4;var s=Qe.updateQueue;if(s===null)s=Bc(),Qe.updateQueue=s,s.events=[a];else{var l=s.events;l===null?s.events=[a]:l.push(a)}}function hv(a){var s=Kt().memoizedState;return dC({ref:s,nextImpl:a}),function(){if((bt&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}function mv(a,s){return Pc(4,2,a,s)}function pv(a,s){return Pc(4,4,a,s)}function gv(a,s){if(typeof s=="function"){a=a();var l=s(a);return function(){typeof l=="function"?l():s(null)}}if(s!=null)return a=a(),s.current=a,function(){s.current=null}}function yv(a,s,l){l=l!=null?l.concat([a]):null,Pc(4,4,gv.bind(null,s,a),l)}function Ff(){}function vv(a,s){var l=Kt();s=s===void 0?null:s;var f=l.memoizedState;return s!==null&&Mf(s,f[1])?f[0]:(l.memoizedState=[a,s],a)}function xv(a,s){var l=Kt();s=s===void 0?null:s;var f=l.memoizedState;if(s!==null&&Mf(s,f[1]))return f[0];if(f=a(),$s){Xe(!0);try{a()}finally{Xe(!1)}}return l.memoizedState=[f,s],f}function Hf(a,s,l){return l===void 0||(di&1073741824)!==0&&(lt&261930)===0?a.memoizedState=s:(a.memoizedState=l,a=b1(),Qe.lanes|=a,Ki|=a,l)}function bv(a,s,l,f){return Yn(l,s)?l:Ur.current!==null?(a=Hf(a,l,f),Yn(a,s)||(Zt=!0),a):(di&42)===0||(di&1073741824)!==0&&(lt&261930)===0?(Zt=!0,a.memoizedState=l):(a=b1(),Qe.lanes|=a,Ki|=a,s)}function _v(a,s,l,f,v){var b=Q.p;Q.p=b!==0&&8>b?b:8;var E=$.T,U={};$.T=U,qf(a,!1,s,l);try{var Y=v(),ne=$.S;if(ne!==null&&ne(U,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var fe=rC(Y,f);eo(a,s,fe,Wn(a))}else eo(a,s,f,Wn(a))}catch(ge){eo(a,s,{then:function(){},status:"rejected",reason:ge},Wn())}finally{Q.p=b,E!==null&&U.types!==null&&(E.types=U.types),$.T=E}}function fC(){}function Pf(a,s,l,f){if(a.tag!==5)throw Error(i(476));var v=Sv(a).queue;_v(a,v,s,G,l===null?fC:function(){return wv(a),l(f)})}function Sv(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:G},next:null};var l={};return s.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:l},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function wv(a){var s=Sv(a);s.next===null&&(s=a.alternate.memoizedState),eo(a,s.next.queue,{},Wn())}function $f(){return mn(vo)}function Nv(){return Kt().memoizedState}function Cv(){return Kt().memoizedState}function hC(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var l=Wn();a=Pi(l);var f=$i(s,a,l);f!==null&&(On(f,s,l),Xl(f,s,l)),s={cache:vf()},a.payload=s;return}s=s.return}}function mC(a,s,l){var f=Wn();l={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},$c(a)?Ev(s,l):(l=lf(a,s,l,f),l!==null&&(On(l,a,f),kv(l,s,f)))}function jv(a,s,l){var f=Wn();eo(a,s,l,f)}function eo(a,s,l,f){var v={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if($c(a))Ev(s,v);else{var b=a.alternate;if(a.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var E=s.lastRenderedState,U=b(E,l);if(v.hasEagerState=!0,v.eagerState=U,Yn(U,E))return wc(a,s,v,0),At===null&&Sc(),!1}catch(Y){}finally{}if(l=lf(a,s,v,f),l!==null)return On(l,a,f),kv(l,s,f),!0}return!1}function qf(a,s,l,f){if(f={lane:2,revertLane:Sh(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},$c(a)){if(s)throw Error(i(479))}else s=lf(a,l,f,2),s!==null&&On(s,a,2)}function $c(a){var s=a.alternate;return a===Qe||s!==null&&s===Qe}function Ev(a,s){Fr=zc=!0;var l=a.pending;l===null?s.next=s:(s.next=l.next,l.next=s),a.pending=s}function kv(a,s,l){if((l&4194048)!==0){var f=s.lanes;f&=a.pendingLanes,l|=f,s.lanes=l,ai(a,l)}}var to={readContext:mn,use:Uc,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useLayoutEffect:qt,useInsertionEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useSyncExternalStore:qt,useId:qt,useHostTransitionStatus:qt,useFormState:qt,useActionState:qt,useOptimistic:qt,useMemoCache:qt,useCacheRefresh:qt};to.useEffectEvent=qt;var Mv={readContext:mn,use:Uc,useCallback:function(a,s){return Cn().memoizedState=[a,s===void 0?null:s],a},useContext:mn,useEffect:fv,useImperativeHandle:function(a,s,l){l=l!=null?l.concat([a]):null,Hc(4194308,4,gv.bind(null,s,a),l)},useLayoutEffect:function(a,s){return Hc(4194308,4,a,s)},useInsertionEffect:function(a,s){Hc(4,2,a,s)},useMemo:function(a,s){var l=Cn();s=s===void 0?null:s;var f=a();if($s){Xe(!0);try{a()}finally{Xe(!1)}}return l.memoizedState=[f,s],f},useReducer:function(a,s,l){var f=Cn();if(l!==void 0){var v=l(s);if($s){Xe(!0);try{l(s)}finally{Xe(!1)}}}else v=s;return f.memoizedState=f.baseState=v,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:v},f.queue=a,a=a.dispatch=mC.bind(null,Qe,a),[f.memoizedState,a]},useRef:function(a){var s=Cn();return a={current:a},s.memoizedState=a},useState:function(a){a=If(a);var s=a.queue,l=jv.bind(null,Qe,s);return s.dispatch=l,[a.memoizedState,l]},useDebugValue:Ff,useDeferredValue:function(a,s){var l=Cn();return Hf(l,a,s)},useTransition:function(){var a=If(!1);return a=_v.bind(null,Qe,a.queue,!0,!1),Cn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,l){var f=Qe,v=Cn();if(ct){if(l===void 0)throw Error(i(407));l=l()}else{if(l=s(),At===null)throw Error(i(349));(lt&127)!==0||Qy(f,s,l)}v.memoizedState=l;var b={value:l,getSnapshot:s};return v.queue=b,fv(Jy.bind(null,f,b,a),[a]),f.flags|=2048,Pr(9,{destroy:void 0},Zy.bind(null,f,b,l,s),null),l},useId:function(){var a=Cn(),s=At.identifierPrefix;if(ct){var l=$a,f=Pa;l=(f&~(1<<32-Je(f)-1)).toString(32)+l,s="_"+s+"R_"+l,l=Ic++,0<l&&(s+="H"+l.toString(32)),s+="_"}else l=lC++,s="_"+s+"r_"+l.toString(32)+"_";return a.memoizedState=s},useHostTransitionStatus:$f,useFormState:lv,useActionState:lv,useOptimistic:function(a){var s=Cn();s.memoizedState=s.baseState=a;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=l,s=qf.bind(null,Qe,!0,l),l.dispatch=s,[a,s]},useMemoCache:Df,useCacheRefresh:function(){return Cn().memoizedState=hC.bind(null,Qe)},useEffectEvent:function(a){var s=Cn(),l={impl:a};return s.memoizedState=l,function(){if((bt&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}},Vf={readContext:mn,use:Uc,useCallback:vv,useContext:mn,useEffect:Uf,useImperativeHandle:yv,useInsertionEffect:mv,useLayoutEffect:pv,useMemo:xv,useReducer:Fc,useRef:dv,useState:function(){return Fc(fi)},useDebugValue:Ff,useDeferredValue:function(a,s){var l=Kt();return bv(l,kt.memoizedState,a,s)},useTransition:function(){var a=Fc(fi)[0],s=Kt().memoizedState;return[typeof a=="boolean"?a:Wl(a),s]},useSyncExternalStore:Xy,useId:Nv,useHostTransitionStatus:$f,useFormState:ov,useActionState:ov,useOptimistic:function(a,s){var l=Kt();return tv(l,kt,a,s)},useMemoCache:Df,useCacheRefresh:Cv};Vf.useEffectEvent=hv;var Tv={readContext:mn,use:Uc,useCallback:vv,useContext:mn,useEffect:Uf,useImperativeHandle:yv,useInsertionEffect:mv,useLayoutEffect:pv,useMemo:xv,useReducer:zf,useRef:dv,useState:function(){return zf(fi)},useDebugValue:Ff,useDeferredValue:function(a,s){var l=Kt();return kt===null?Hf(l,a,s):bv(l,kt.memoizedState,a,s)},useTransition:function(){var a=zf(fi)[0],s=Kt().memoizedState;return[typeof a=="boolean"?a:Wl(a),s]},useSyncExternalStore:Xy,useId:Nv,useHostTransitionStatus:$f,useFormState:uv,useActionState:uv,useOptimistic:function(a,s){var l=Kt();return kt!==null?tv(l,kt,a,s):(l.baseState=a,[a,l.queue.dispatch])},useMemoCache:Df,useCacheRefresh:Cv};Tv.useEffectEvent=hv;function Gf(a,s,l,f){s=a.memoizedState,l=l(f,s),l=l==null?s:p({},s,l),a.memoizedState=l,a.lanes===0&&(a.updateQueue.baseState=l)}var Yf={enqueueSetState:function(a,s,l){a=a._reactInternals;var f=Wn(),v=Pi(f);v.payload=s,l!=null&&(v.callback=l),s=$i(a,v,f),s!==null&&(On(s,a,f),Xl(s,a,f))},enqueueReplaceState:function(a,s,l){a=a._reactInternals;var f=Wn(),v=Pi(f);v.tag=1,v.payload=s,l!=null&&(v.callback=l),s=$i(a,v,f),s!==null&&(On(s,a,f),Xl(s,a,f))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var l=Wn(),f=Pi(l);f.tag=2,s!=null&&(f.callback=s),s=$i(a,f,l),s!==null&&(On(s,a,l),Xl(s,a,l))}};function Rv(a,s,l,f,v,b,E){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(f,b,E):s.prototype&&s.prototype.isPureReactComponent?!Hl(l,f)||!Hl(v,b):!0}function Av(a,s,l,f){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(l,f),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(l,f),s.state!==a&&Yf.enqueueReplaceState(s,s.state,null)}function qs(a,s){var l=s;if("ref"in s){l={};for(var f in s)f!=="ref"&&(l[f]=s[f])}if(a=a.defaultProps){l===s&&(l=p({},l));for(var v in a)l[v]===void 0&&(l[v]=a[v])}return l}function Lv(a){_c(a)}function Dv(a){console.error(a)}function Ov(a){_c(a)}function qc(a,s){try{var l=a.onUncaughtError;l(s.value,{componentStack:s.stack})}catch(f){setTimeout(function(){throw f})}}function zv(a,s,l){try{var f=a.onCaughtError;f(l.value,{componentStack:l.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Kf(a,s,l){return l=Pi(l),l.tag=3,l.payload={element:null},l.callback=function(){qc(a,s)},l}function Iv(a){return a=Pi(a),a.tag=3,a}function Bv(a,s,l,f){var v=l.type.getDerivedStateFromError;if(typeof v=="function"){var b=f.value;a.payload=function(){return v(b)},a.callback=function(){zv(s,l,f)}}var E=l.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(a.callback=function(){zv(s,l,f),typeof v!="function"&&(Xi===null?Xi=new Set([this]):Xi.add(this));var U=f.stack;this.componentDidCatch(f.value,{componentStack:U!==null?U:""})})}function pC(a,s,l,f,v){if(l.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(s=l.alternate,s!==null&&Dr(s,l,v,!0),l=Xn.current,l!==null){switch(l.tag){case 31:case 13:return ma===null?nu():l.alternate===null&&Vt===0&&(Vt=3),l.flags&=-257,l.flags|=65536,l.lanes=v,f===Rc?l.flags|=16384:(s=l.updateQueue,s===null?l.updateQueue=new Set([f]):s.add(f),xh(a,f,v)),!1;case 22:return l.flags|=65536,f===Rc?l.flags|=16384:(s=l.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([f])},l.updateQueue=s):(l=s.retryQueue,l===null?s.retryQueue=new Set([f]):l.add(f)),xh(a,f,v)),!1}throw Error(i(435,l.tag))}return xh(a,f,v),nu(),!1}if(ct)return s=Xn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=v,f!==hf&&(a=Error(i(422),{cause:f}),ql(ua(a,l)))):(f!==hf&&(s=Error(i(423),{cause:f}),ql(ua(s,l))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,f=ua(f,l),v=Kf(a.stateNode,f,v),Nf(a,v),Vt!==4&&(Vt=2)),!1;var b=Error(i(520),{cause:f});if(b=ua(b,l),co===null?co=[b]:co.push(b),Vt!==4&&(Vt=2),s===null)return!0;f=ua(f,l),l=s;do{switch(l.tag){case 3:return l.flags|=65536,a=v&-v,l.lanes|=a,a=Kf(l.stateNode,f,a),Nf(l,a),!1;case 1:if(s=l.type,b=l.stateNode,(l.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Xi===null||!Xi.has(b))))return l.flags|=65536,v&=-v,l.lanes|=v,v=Iv(v),Bv(v,a,l,f),Nf(l,v),!1}l=l.return}while(l!==null);return!1}var Xf=Error(i(461)),Zt=!1;function pn(a,s,l,f){s.child=a===null?Py(s,null,l,f):Ps(s,a.child,l,f)}function Uv(a,s,l,f,v){l=l.render;var b=s.ref;if("ref"in f){var E={};for(var U in f)U!=="ref"&&(E[U]=f[U])}else E=f;return Bs(s),f=Tf(a,s,l,E,b,v),U=Rf(),a!==null&&!Zt?(Af(a,s,v),hi(a,s,v)):(ct&&U&&df(s),s.flags|=1,pn(a,s,f,v),s.child)}function Fv(a,s,l,f,v){if(a===null){var b=l.type;return typeof b=="function"&&!of(b)&&b.defaultProps===void 0&&l.compare===null?(s.tag=15,s.type=b,Hv(a,s,b,f,v)):(a=Cc(l.type,null,f,s,s.mode,v),a.ref=s.ref,a.return=s,s.child=a)}if(b=a.child,!ah(a,v)){var E=b.memoizedProps;if(l=l.compare,l=l!==null?l:Hl,l(E,f)&&a.ref===s.ref)return hi(a,s,v)}return s.flags|=1,a=li(b,f),a.ref=s.ref,a.return=s,s.child=a}function Hv(a,s,l,f,v){if(a!==null){var b=a.memoizedProps;if(Hl(b,f)&&a.ref===s.ref)if(Zt=!1,s.pendingProps=f=b,ah(a,v))(a.flags&131072)!==0&&(Zt=!0);else return s.lanes=a.lanes,hi(a,s,v)}return Qf(a,s,l,f,v)}function Pv(a,s,l,f){var v=f.children,b=a!==null?a.memoizedState:null;if(a===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((s.flags&128)!==0){if(b=b!==null?b.baseLanes|l:l,a!==null){for(f=s.child=a.child,v=0;f!==null;)v=v|f.lanes|f.childLanes,f=f.sibling;f=v&~b}else f=0,s.child=null;return $v(a,s,b,l,f)}if((l&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&Mc(s,b!==null?b.cachePool:null),b!==null?Vy(s,b):jf(),Gy(s);else return f=s.lanes=536870912,$v(a,s,b!==null?b.baseLanes|l:l,l,f)}else b!==null?(Mc(s,b.cachePool),Vy(s,b),Vi(),s.memoizedState=null):(a!==null&&Mc(s,null),jf(),Vi());return pn(a,s,v,l),s.child}function no(a,s){return a!==null&&a.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function $v(a,s,l,f,v){var b=bf();return b=b===null?null:{parent:Xt._currentValue,pool:b},s.memoizedState={baseLanes:l,cachePool:b},a!==null&&Mc(s,null),jf(),Gy(s),a!==null&&Dr(a,s,f,!0),s.childLanes=v,null}function Vc(a,s){return s=Yc({mode:s.mode,children:s.children},a.mode),s.ref=a.ref,a.child=s,s.return=a,s}function qv(a,s,l){return Ps(s,a.child,null,l),a=Vc(s,s.pendingProps),a.flags|=2,Qn(s),s.memoizedState=null,a}function gC(a,s,l){var f=s.pendingProps,v=(s.flags&128)!==0;if(s.flags&=-129,a===null){if(ct){if(f.mode==="hidden")return a=Vc(s,f),s.lanes=536870912,no(null,a);if(kf(s),(a=zt)?(a=n0(a,ha),a=a!==null&&a.data==="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Ii!==null?{id:Pa,overflow:$a}:null,retryLane:536870912,hydrationErrors:null},l=Ey(a),l.return=s,s.child=l,hn=s,zt=null)):a=null,a===null)throw Ui(s);return s.lanes=536870912,null}return Vc(s,f)}var b=a.memoizedState;if(b!==null){var E=b.dehydrated;if(kf(s),v)if(s.flags&256)s.flags&=-257,s=qv(a,s,l);else if(s.memoizedState!==null)s.child=a.child,s.flags|=128,s=null;else throw Error(i(558));else if(Zt||Dr(a,s,l,!1),v=(l&a.childLanes)!==0,Zt||v){if(f=At,f!==null&&(E=ja(f,l),E!==0&&E!==b.retryLane))throw b.retryLane=E,Ds(a,E),On(f,a,E),Xf;nu(),s=qv(a,s,l)}else a=b.treeContext,zt=pa(E.nextSibling),hn=s,ct=!0,Bi=null,ha=!1,a!==null&&Ty(s,a),s=Vc(s,f),s.flags|=4096;return s}return a=li(a.child,{mode:f.mode,children:f.children}),a.ref=s.ref,s.child=a,a.return=s,a}function Gc(a,s){var l=s.ref;if(l===null)a!==null&&a.ref!==null&&(s.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(i(284));(a===null||a.ref!==l)&&(s.flags|=4194816)}}function Qf(a,s,l,f,v){return Bs(s),l=Tf(a,s,l,f,void 0,v),f=Rf(),a!==null&&!Zt?(Af(a,s,v),hi(a,s,v)):(ct&&f&&df(s),s.flags|=1,pn(a,s,l,v),s.child)}function Vv(a,s,l,f,v,b){return Bs(s),s.updateQueue=null,l=Ky(s,f,l,v),Yy(a),f=Rf(),a!==null&&!Zt?(Af(a,s,b),hi(a,s,b)):(ct&&f&&df(s),s.flags|=1,pn(a,s,l,b),s.child)}function Gv(a,s,l,f,v){if(Bs(s),s.stateNode===null){var b=Tr,E=l.contextType;typeof E=="object"&&E!==null&&(b=mn(E)),b=new l(f,b),s.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Yf,s.stateNode=b,b._reactInternals=s,b=s.stateNode,b.props=f,b.state=s.memoizedState,b.refs={},Sf(s),E=l.contextType,b.context=typeof E=="object"&&E!==null?mn(E):Tr,b.state=s.memoizedState,E=l.getDerivedStateFromProps,typeof E=="function"&&(Gf(s,l,E,f),b.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(E=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),E!==b.state&&Yf.enqueueReplaceState(b,b.state,null),Zl(s,f,b,v),Ql(),b.state=s.memoizedState),typeof b.componentDidMount=="function"&&(s.flags|=4194308),f=!0}else if(a===null){b=s.stateNode;var U=s.memoizedProps,Y=qs(l,U);b.props=Y;var ne=b.context,fe=l.contextType;E=Tr,typeof fe=="object"&&fe!==null&&(E=mn(fe));var ge=l.getDerivedStateFromProps;fe=typeof ge=="function"||typeof b.getSnapshotBeforeUpdate=="function",U=s.pendingProps!==U,fe||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(U||ne!==E)&&Av(s,b,f,E),Hi=!1;var ae=s.memoizedState;b.state=ae,Zl(s,f,b,v),Ql(),ne=s.memoizedState,U||ae!==ne||Hi?(typeof ge=="function"&&(Gf(s,l,ge,f),ne=s.memoizedState),(Y=Hi||Rv(s,l,Y,f,ae,ne,E))?(fe||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(s.flags|=4194308)):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=f,s.memoizedState=ne),b.props=f,b.state=ne,b.context=E,f=Y):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),f=!1)}else{b=s.stateNode,wf(a,s),E=s.memoizedProps,fe=qs(l,E),b.props=fe,ge=s.pendingProps,ae=b.context,ne=l.contextType,Y=Tr,typeof ne=="object"&&ne!==null&&(Y=mn(ne)),U=l.getDerivedStateFromProps,(ne=typeof U=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(E!==ge||ae!==Y)&&Av(s,b,f,Y),Hi=!1,ae=s.memoizedState,b.state=ae,Zl(s,f,b,v),Ql();var oe=s.memoizedState;E!==ge||ae!==oe||Hi||a!==null&&a.dependencies!==null&&Ec(a.dependencies)?(typeof U=="function"&&(Gf(s,l,U,f),oe=s.memoizedState),(fe=Hi||Rv(s,l,fe,f,ae,oe,Y)||a!==null&&a.dependencies!==null&&Ec(a.dependencies))?(ne||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(f,oe,Y),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(f,oe,Y)),typeof b.componentDidUpdate=="function"&&(s.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof b.componentDidUpdate!="function"||E===a.memoizedProps&&ae===a.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===a.memoizedProps&&ae===a.memoizedState||(s.flags|=1024),s.memoizedProps=f,s.memoizedState=oe),b.props=f,b.state=oe,b.context=Y,f=fe):(typeof b.componentDidUpdate!="function"||E===a.memoizedProps&&ae===a.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===a.memoizedProps&&ae===a.memoizedState||(s.flags|=1024),f=!1)}return b=f,Gc(a,s),f=(s.flags&128)!==0,b||f?(b=s.stateNode,l=f&&typeof l.getDerivedStateFromError!="function"?null:b.render(),s.flags|=1,a!==null&&f?(s.child=Ps(s,a.child,null,v),s.child=Ps(s,null,l,v)):pn(a,s,l,v),s.memoizedState=b.state,a=s.child):a=hi(a,s,v),a}function Yv(a,s,l,f){return zs(),s.flags|=256,pn(a,s,l,f),s.child}var Zf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jf(a){return{baseLanes:a,cachePool:zy()}}function Wf(a,s,l){return a=a!==null?a.childLanes&~l:0,s&&(a|=Jn),a}function Kv(a,s,l){var f=s.pendingProps,v=!1,b=(s.flags&128)!==0,E;if((E=b)||(E=a!==null&&a.memoizedState===null?!1:(Yt.current&2)!==0),E&&(v=!0,s.flags&=-129),E=(s.flags&32)!==0,s.flags&=-33,a===null){if(ct){if(v?qi(s):Vi(),(a=zt)?(a=n0(a,ha),a=a!==null&&a.data!=="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Ii!==null?{id:Pa,overflow:$a}:null,retryLane:536870912,hydrationErrors:null},l=Ey(a),l.return=s,s.child=l,hn=s,zt=null)):a=null,a===null)throw Ui(s);return Oh(a)?s.lanes=32:s.lanes=536870912,null}var U=f.children;return f=f.fallback,v?(Vi(),v=s.mode,U=Yc({mode:"hidden",children:U},v),f=Os(f,v,l,null),U.return=s,f.return=s,U.sibling=f,s.child=U,f=s.child,f.memoizedState=Jf(l),f.childLanes=Wf(a,E,l),s.memoizedState=Zf,no(null,f)):(qi(s),eh(s,U))}var Y=a.memoizedState;if(Y!==null&&(U=Y.dehydrated,U!==null)){if(b)s.flags&256?(qi(s),s.flags&=-257,s=th(a,s,l)):s.memoizedState!==null?(Vi(),s.child=a.child,s.flags|=128,s=null):(Vi(),U=f.fallback,v=s.mode,f=Yc({mode:"visible",children:f.children},v),U=Os(U,v,l,null),U.flags|=2,f.return=s,U.return=s,f.sibling=U,s.child=f,Ps(s,a.child,null,l),f=s.child,f.memoizedState=Jf(l),f.childLanes=Wf(a,E,l),s.memoizedState=Zf,s=no(null,f));else if(qi(s),Oh(U)){if(E=U.nextSibling&&U.nextSibling.dataset,E)var ne=E.dgst;E=ne,f=Error(i(419)),f.stack="",f.digest=E,ql({value:f,source:null,stack:null}),s=th(a,s,l)}else if(Zt||Dr(a,s,l,!1),E=(l&a.childLanes)!==0,Zt||E){if(E=At,E!==null&&(f=ja(E,l),f!==0&&f!==Y.retryLane))throw Y.retryLane=f,Ds(a,f),On(E,a,f),Xf;Dh(U)||nu(),s=th(a,s,l)}else Dh(U)?(s.flags|=192,s.child=a.child,s=null):(a=Y.treeContext,zt=pa(U.nextSibling),hn=s,ct=!0,Bi=null,ha=!1,a!==null&&Ty(s,a),s=eh(s,f.children),s.flags|=4096);return s}return v?(Vi(),U=f.fallback,v=s.mode,Y=a.child,ne=Y.sibling,f=li(Y,{mode:"hidden",children:f.children}),f.subtreeFlags=Y.subtreeFlags&65011712,ne!==null?U=li(ne,U):(U=Os(U,v,l,null),U.flags|=2),U.return=s,f.return=s,f.sibling=U,s.child=f,no(null,f),f=s.child,U=a.child.memoizedState,U===null?U=Jf(l):(v=U.cachePool,v!==null?(Y=Xt._currentValue,v=v.parent!==Y?{parent:Y,pool:Y}:v):v=zy(),U={baseLanes:U.baseLanes|l,cachePool:v}),f.memoizedState=U,f.childLanes=Wf(a,E,l),s.memoizedState=Zf,no(a.child,f)):(qi(s),l=a.child,a=l.sibling,l=li(l,{mode:"visible",children:f.children}),l.return=s,l.sibling=null,a!==null&&(E=s.deletions,E===null?(s.deletions=[a],s.flags|=16):E.push(a)),s.child=l,s.memoizedState=null,l)}function eh(a,s){return s=Yc({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function Yc(a,s){return a=Kn(22,a,null,s),a.lanes=0,a}function th(a,s,l){return Ps(s,a.child,null,l),a=eh(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function Xv(a,s,l){a.lanes|=s;var f=a.alternate;f!==null&&(f.lanes|=s),gf(a.return,s,l)}function nh(a,s,l,f,v,b){var E=a.memoizedState;E===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:f,tail:l,tailMode:v,treeForkCount:b}:(E.isBackwards=s,E.rendering=null,E.renderingStartTime=0,E.last=f,E.tail=l,E.tailMode=v,E.treeForkCount=b)}function Qv(a,s,l){var f=s.pendingProps,v=f.revealOrder,b=f.tail;f=f.children;var E=Yt.current,U=(E&2)!==0;if(U?(E=E&1|2,s.flags|=128):E&=1,I(Yt,E),pn(a,s,f,l),f=ct?$l:0,!U&&a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Xv(a,l,s);else if(a.tag===19)Xv(a,l,s);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(v){case"forwards":for(l=s.child,v=null;l!==null;)a=l.alternate,a!==null&&Oc(a)===null&&(v=l),l=l.sibling;l=v,l===null?(v=s.child,s.child=null):(v=l.sibling,l.sibling=null),nh(s,!1,v,l,b,f);break;case"backwards":case"unstable_legacy-backwards":for(l=null,v=s.child,s.child=null;v!==null;){if(a=v.alternate,a!==null&&Oc(a)===null){s.child=v;break}a=v.sibling,v.sibling=l,l=v,v=a}nh(s,!0,l,null,b,f);break;case"together":nh(s,!1,null,null,void 0,f);break;default:s.memoizedState=null}return s.child}function hi(a,s,l){if(a!==null&&(s.dependencies=a.dependencies),Ki|=s.lanes,(l&s.childLanes)===0)if(a!==null){if(Dr(a,s,l,!1),(l&s.childLanes)===0)return null}else return null;if(a!==null&&s.child!==a.child)throw Error(i(153));if(s.child!==null){for(a=s.child,l=li(a,a.pendingProps),s.child=l,l.return=s;a.sibling!==null;)a=a.sibling,l=l.sibling=li(a,a.pendingProps),l.return=s;l.sibling=null}return s.child}function ah(a,s){return(a.lanes&s)!==0?!0:(a=a.dependencies,!!(a!==null&&Ec(a)))}function yC(a,s,l){switch(s.tag){case 3:Se(s,s.stateNode.containerInfo),Fi(s,Xt,a.memoizedState.cache),zs();break;case 27:case 5:vt(s);break;case 4:Se(s,s.stateNode.containerInfo);break;case 10:Fi(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,kf(s),null;break;case 13:var f=s.memoizedState;if(f!==null)return f.dehydrated!==null?(qi(s),s.flags|=128,null):(l&s.child.childLanes)!==0?Kv(a,s,l):(qi(s),a=hi(a,s,l),a!==null?a.sibling:null);qi(s);break;case 19:var v=(a.flags&128)!==0;if(f=(l&s.childLanes)!==0,f||(Dr(a,s,l,!1),f=(l&s.childLanes)!==0),v){if(f)return Qv(a,s,l);s.flags|=128}if(v=s.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),I(Yt,Yt.current),f)break;return null;case 22:return s.lanes=0,Pv(a,s,l,s.pendingProps);case 24:Fi(s,Xt,a.memoizedState.cache)}return hi(a,s,l)}function Zv(a,s,l){if(a!==null)if(a.memoizedProps!==s.pendingProps)Zt=!0;else{if(!ah(a,l)&&(s.flags&128)===0)return Zt=!1,yC(a,s,l);Zt=(a.flags&131072)!==0}else Zt=!1,ct&&(s.flags&1048576)!==0&&My(s,$l,s.index);switch(s.lanes=0,s.tag){case 16:e:{var f=s.pendingProps;if(a=Fs(s.elementType),s.type=a,typeof a=="function")of(a)?(f=qs(a,f),s.tag=1,s=Gv(null,s,a,f,l)):(s.tag=0,s=Qf(null,s,a,f,l));else{if(a!=null){var v=a.$$typeof;if(v===j){s.tag=11,s=Uv(null,s,a,f,l);break e}else if(v===z){s.tag=14,s=Fv(null,s,a,f,l);break e}}throw s=H(a)||a,Error(i(306,s,""))}}return s;case 0:return Qf(a,s,s.type,s.pendingProps,l);case 1:return f=s.type,v=qs(f,s.pendingProps),Gv(a,s,f,v,l);case 3:e:{if(Se(s,s.stateNode.containerInfo),a===null)throw Error(i(387));f=s.pendingProps;var b=s.memoizedState;v=b.element,wf(a,s),Zl(s,f,null,l);var E=s.memoizedState;if(f=E.cache,Fi(s,Xt,f),f!==b.cache&&yf(s,[Xt],l,!0),Ql(),f=E.element,b.isDehydrated)if(b={element:f,isDehydrated:!1,cache:E.cache},s.updateQueue.baseState=b,s.memoizedState=b,s.flags&256){s=Yv(a,s,f,l);break e}else if(f!==v){v=ua(Error(i(424)),s),ql(v),s=Yv(a,s,f,l);break e}else{switch(a=s.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(zt=pa(a.firstChild),hn=s,ct=!0,Bi=null,ha=!0,l=Py(s,null,f,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(zs(),f===v){s=hi(a,s,l);break e}pn(a,s,f,l)}s=s.child}return s;case 26:return Gc(a,s),a===null?(l=o0(s.type,null,s.pendingProps,null))?s.memoizedState=l:ct||(l=s.type,a=s.pendingProps,f=cu(xe.current).createElement(l),f[le]=s,f[we]=a,gn(f,l,a),Ae(f),s.stateNode=f):s.memoizedState=o0(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return vt(s),a===null&&ct&&(f=s.stateNode=s0(s.type,s.pendingProps,xe.current),hn=s,ha=!0,v=zt,Wi(s.type)?(zh=v,zt=pa(f.firstChild)):zt=v),pn(a,s,s.pendingProps.children,l),Gc(a,s),a===null&&(s.flags|=4194304),s.child;case 5:return a===null&&ct&&((v=f=zt)&&(f=YC(f,s.type,s.pendingProps,ha),f!==null?(s.stateNode=f,hn=s,zt=pa(f.firstChild),ha=!1,v=!0):v=!1),v||Ui(s)),vt(s),v=s.type,b=s.pendingProps,E=a!==null?a.memoizedProps:null,f=b.children,Rh(v,b)?f=null:E!==null&&Rh(v,E)&&(s.flags|=32),s.memoizedState!==null&&(v=Tf(a,s,oC,null,null,l),vo._currentValue=v),Gc(a,s),pn(a,s,f,l),s.child;case 6:return a===null&&ct&&((a=l=zt)&&(l=KC(l,s.pendingProps,ha),l!==null?(s.stateNode=l,hn=s,zt=null,a=!0):a=!1),a||Ui(s)),null;case 13:return Kv(a,s,l);case 4:return Se(s,s.stateNode.containerInfo),f=s.pendingProps,a===null?s.child=Ps(s,null,f,l):pn(a,s,f,l),s.child;case 11:return Uv(a,s,s.type,s.pendingProps,l);case 7:return pn(a,s,s.pendingProps,l),s.child;case 8:return pn(a,s,s.pendingProps.children,l),s.child;case 12:return pn(a,s,s.pendingProps.children,l),s.child;case 10:return f=s.pendingProps,Fi(s,s.type,f.value),pn(a,s,f.children,l),s.child;case 9:return v=s.type._context,f=s.pendingProps.children,Bs(s),v=mn(v),f=f(v),s.flags|=1,pn(a,s,f,l),s.child;case 14:return Fv(a,s,s.type,s.pendingProps,l);case 15:return Hv(a,s,s.type,s.pendingProps,l);case 19:return Qv(a,s,l);case 31:return gC(a,s,l);case 22:return Pv(a,s,l,s.pendingProps);case 24:return Bs(s),f=mn(Xt),a===null?(v=bf(),v===null&&(v=At,b=vf(),v.pooledCache=b,b.refCount++,b!==null&&(v.pooledCacheLanes|=l),v=b),s.memoizedState={parent:f,cache:v},Sf(s),Fi(s,Xt,v)):((a.lanes&l)!==0&&(wf(a,s),Zl(s,null,null,l),Ql()),v=a.memoizedState,b=s.memoizedState,v.parent!==f?(v={parent:f,cache:f},s.memoizedState=v,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=v),Fi(s,Xt,f)):(f=b.cache,Fi(s,Xt,f),f!==v.cache&&yf(s,[Xt],l,!0))),pn(a,s,s.pendingProps.children,l),s.child;case 29:throw s.pendingProps}throw Error(i(156,s.tag))}function mi(a){a.flags|=4}function ih(a,s,l,f,v){if((s=(a.mode&32)!==0)&&(s=!1),s){if(a.flags|=16777216,(v&335544128)===v)if(a.stateNode.complete)a.flags|=8192;else if(N1())a.flags|=8192;else throw Hs=Rc,_f}else a.flags&=-16777217}function Jv(a,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!h0(s))if(N1())a.flags|=8192;else throw Hs=Rc,_f}function Kc(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?Li():536870912,a.lanes|=s,Gr|=s)}function ao(a,s){if(!ct)switch(a.tailMode){case"hidden":s=a.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?a.tail=null:l.sibling=null;break;case"collapsed":l=a.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:f.sibling=null}}function It(a){var s=a.alternate!==null&&a.alternate.child===a.child,l=0,f=0;if(s)for(var v=a.child;v!==null;)l|=v.lanes|v.childLanes,f|=v.subtreeFlags&65011712,f|=v.flags&65011712,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)l|=v.lanes|v.childLanes,f|=v.subtreeFlags,f|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=f,a.childLanes=l,s}function vC(a,s,l){var f=s.pendingProps;switch(ff(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(s),null;case 1:return It(s),null;case 3:return l=s.stateNode,f=null,a!==null&&(f=a.memoizedState.cache),s.memoizedState.cache!==f&&(s.flags|=2048),ui(Xt),Pe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(a===null||a.child===null)&&(Lr(s)?mi(s):a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,mf())),It(s),null;case 26:var v=s.type,b=s.memoizedState;return a===null?(mi(s),b!==null?(It(s),Jv(s,b)):(It(s),ih(s,v,null,f,l))):b?b!==a.memoizedState?(mi(s),It(s),Jv(s,b)):(It(s),s.flags&=-16777217):(a=a.memoizedProps,a!==f&&mi(s),It(s),ih(s,v,a,f,l)),null;case 27:if(mt(s),l=xe.current,v=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==f&&mi(s);else{if(!f){if(s.stateNode===null)throw Error(i(166));return It(s),null}a=ie.current,Lr(s)?Ry(s):(a=s0(v,f,l),s.stateNode=a,mi(s))}return It(s),null;case 5:if(mt(s),v=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==f&&mi(s);else{if(!f){if(s.stateNode===null)throw Error(i(166));return It(s),null}if(b=ie.current,Lr(s))Ry(s);else{var E=cu(xe.current);switch(b){case 1:b=E.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:b=E.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":b=E.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":b=E.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":b=E.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof f.is=="string"?E.createElement("select",{is:f.is}):E.createElement("select"),f.multiple?b.multiple=!0:f.size&&(b.size=f.size);break;default:b=typeof f.is=="string"?E.createElement(v,{is:f.is}):E.createElement(v)}}b[le]=s,b[we]=f;e:for(E=s.child;E!==null;){if(E.tag===5||E.tag===6)b.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===s)break e;for(;E.sibling===null;){if(E.return===null||E.return===s)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}s.stateNode=b;e:switch(gn(b,v,f),v){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&mi(s)}}return It(s),ih(s,s.type,a===null?null:a.memoizedProps,s.pendingProps,l),null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==f&&mi(s);else{if(typeof f!="string"&&s.stateNode===null)throw Error(i(166));if(a=xe.current,Lr(s)){if(a=s.stateNode,l=s.memoizedProps,f=null,v=hn,v!==null)switch(v.tag){case 27:case 5:f=v.memoizedProps}a[le]=s,a=!!(a.nodeValue===l||f!==null&&f.suppressHydrationWarning===!0||K1(a.nodeValue,l)),a||Ui(s,!0)}else a=cu(a).createTextNode(f),a[le]=s,s.stateNode=a}return It(s),null;case 31:if(l=s.memoizedState,a===null||a.memoizedState!==null){if(f=Lr(s),l!==null){if(a===null){if(!f)throw Error(i(318));if(a=s.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[le]=s}else zs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;It(s),a=!1}else l=mf(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=l),a=!0;if(!a)return s.flags&256?(Qn(s),s):(Qn(s),null);if((s.flags&128)!==0)throw Error(i(558))}return It(s),null;case 13:if(f=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(v=Lr(s),f!==null&&f.dehydrated!==null){if(a===null){if(!v)throw Error(i(318));if(v=s.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(i(317));v[le]=s}else zs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;It(s),v=!1}else v=mf(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=v),v=!0;if(!v)return s.flags&256?(Qn(s),s):(Qn(s),null)}return Qn(s),(s.flags&128)!==0?(s.lanes=l,s):(l=f!==null,a=a!==null&&a.memoizedState!==null,l&&(f=s.child,v=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(v=f.alternate.memoizedState.cachePool.pool),b=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(b=f.memoizedState.cachePool.pool),b!==v&&(f.flags|=2048)),l!==a&&l&&(s.child.flags|=8192),Kc(s,s.updateQueue),It(s),null);case 4:return Pe(),a===null&&jh(s.stateNode.containerInfo),It(s),null;case 10:return ui(s.type),It(s),null;case 19:if(ue(Yt),f=s.memoizedState,f===null)return It(s),null;if(v=(s.flags&128)!==0,b=f.rendering,b===null)if(v)ao(f,!1);else{if(Vt!==0||a!==null&&(a.flags&128)!==0)for(a=s.child;a!==null;){if(b=Oc(a),b!==null){for(s.flags|=128,ao(f,!1),a=b.updateQueue,s.updateQueue=a,Kc(s,a),s.subtreeFlags=0,a=l,l=s.child;l!==null;)jy(l,a),l=l.sibling;return I(Yt,Yt.current&1|2),ct&&oi(s,f.treeForkCount),s.child}a=a.sibling}f.tail!==null&&Rt()>Wc&&(s.flags|=128,v=!0,ao(f,!1),s.lanes=4194304)}else{if(!v)if(a=Oc(b),a!==null){if(s.flags|=128,v=!0,a=a.updateQueue,s.updateQueue=a,Kc(s,a),ao(f,!0),f.tail===null&&f.tailMode==="hidden"&&!b.alternate&&!ct)return It(s),null}else 2*Rt()-f.renderingStartTime>Wc&&l!==536870912&&(s.flags|=128,v=!0,ao(f,!1),s.lanes=4194304);f.isBackwards?(b.sibling=s.child,s.child=b):(a=f.last,a!==null?a.sibling=b:s.child=b,f.last=b)}return f.tail!==null?(a=f.tail,f.rendering=a,f.tail=a.sibling,f.renderingStartTime=Rt(),a.sibling=null,l=Yt.current,I(Yt,v?l&1|2:l&1),ct&&oi(s,f.treeForkCount),a):(It(s),null);case 22:case 23:return Qn(s),Ef(),f=s.memoizedState!==null,a!==null?a.memoizedState!==null!==f&&(s.flags|=8192):f&&(s.flags|=8192),f?(l&536870912)!==0&&(s.flags&128)===0&&(It(s),s.subtreeFlags&6&&(s.flags|=8192)):It(s),l=s.updateQueue,l!==null&&Kc(s,l.retryQueue),l=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==l&&(s.flags|=2048),a!==null&&ue(Us),null;case 24:return l=null,a!==null&&(l=a.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),ui(Xt),It(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function xC(a,s){switch(ff(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return ui(Xt),Pe(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return mt(s),null;case 31:if(s.memoizedState!==null){if(Qn(s),s.alternate===null)throw Error(i(340));zs()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 13:if(Qn(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(i(340));zs()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return ue(Yt),null;case 4:return Pe(),null;case 10:return ui(s.type),null;case 22:case 23:return Qn(s),Ef(),a!==null&&ue(Us),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return ui(Xt),null;case 25:return null;default:return null}}function Wv(a,s){switch(ff(s),s.tag){case 3:ui(Xt),Pe();break;case 26:case 27:case 5:mt(s);break;case 4:Pe();break;case 31:s.memoizedState!==null&&Qn(s);break;case 13:Qn(s);break;case 19:ue(Yt);break;case 10:ui(s.type);break;case 22:case 23:Qn(s),Ef(),a!==null&&ue(Us);break;case 24:ui(Xt)}}function io(a,s){try{var l=s.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var v=f.next;l=v;do{if((l.tag&a)===a){f=void 0;var b=l.create,E=l.inst;f=b(),E.destroy=f}l=l.next}while(l!==v)}}catch(U){Nt(s,s.return,U)}}function Gi(a,s,l){try{var f=s.updateQueue,v=f!==null?f.lastEffect:null;if(v!==null){var b=v.next;f=b;do{if((f.tag&a)===a){var E=f.inst,U=E.destroy;if(U!==void 0){E.destroy=void 0,v=s;var Y=l,ne=U;try{ne()}catch(fe){Nt(v,Y,fe)}}}f=f.next}while(f!==b)}}catch(fe){Nt(s,s.return,fe)}}function e1(a){var s=a.updateQueue;if(s!==null){var l=a.stateNode;try{qy(s,l)}catch(f){Nt(a,a.return,f)}}}function t1(a,s,l){l.props=qs(a.type,a.memoizedProps),l.state=a.memoizedState;try{l.componentWillUnmount()}catch(f){Nt(a,s,f)}}function so(a,s){try{var l=a.ref;if(l!==null){switch(a.tag){case 26:case 27:case 5:var f=a.stateNode;break;case 30:f=a.stateNode;break;default:f=a.stateNode}typeof l=="function"?a.refCleanup=l(f):l.current=f}}catch(v){Nt(a,s,v)}}function qa(a,s){var l=a.ref,f=a.refCleanup;if(l!==null)if(typeof f=="function")try{f()}catch(v){Nt(a,s,v)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(v){Nt(a,s,v)}else l.current=null}function n1(a){var s=a.type,l=a.memoizedProps,f=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":l.autoFocus&&f.focus();break e;case"img":l.src?f.src=l.src:l.srcSet&&(f.srcset=l.srcSet)}}catch(v){Nt(a,a.return,v)}}function sh(a,s,l){try{var f=a.stateNode;HC(f,a.type,l,s),f[we]=s}catch(v){Nt(a,a.return,v)}}function a1(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Wi(a.type)||a.tag===4}function rh(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||a1(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Wi(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function lh(a,s,l){var f=a.tag;if(f===5||f===6)a=a.stateNode,s?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(a,s):(s=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,s.appendChild(a),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=si));else if(f!==4&&(f===27&&Wi(a.type)&&(l=a.stateNode,s=null),a=a.child,a!==null))for(lh(a,s,l),a=a.sibling;a!==null;)lh(a,s,l),a=a.sibling}function Xc(a,s,l){var f=a.tag;if(f===5||f===6)a=a.stateNode,s?l.insertBefore(a,s):l.appendChild(a);else if(f!==4&&(f===27&&Wi(a.type)&&(l=a.stateNode),a=a.child,a!==null))for(Xc(a,s,l),a=a.sibling;a!==null;)Xc(a,s,l),a=a.sibling}function i1(a){var s=a.stateNode,l=a.memoizedProps;try{for(var f=a.type,v=s.attributes;v.length;)s.removeAttributeNode(v[0]);gn(s,f,l),s[le]=a,s[we]=l}catch(b){Nt(a,a.return,b)}}var pi=!1,Jt=!1,oh=!1,s1=typeof WeakSet=="function"?WeakSet:Set,cn=null;function bC(a,s){if(a=a.containerInfo,Mh=gu,a=yy(a),ef(a)){if("selectionStart"in a)var l={start:a.selectionStart,end:a.selectionEnd};else e:{l=(l=a.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var v=f.anchorOffset,b=f.focusNode;f=f.focusOffset;try{l.nodeType,b.nodeType}catch(Ve){l=null;break e}var E=0,U=-1,Y=-1,ne=0,fe=0,ge=a,ae=null;t:for(;;){for(var oe;ge!==l||v!==0&&ge.nodeType!==3||(U=E+v),ge!==b||f!==0&&ge.nodeType!==3||(Y=E+f),ge.nodeType===3&&(E+=ge.nodeValue.length),(oe=ge.firstChild)!==null;)ae=ge,ge=oe;for(;;){if(ge===a)break t;if(ae===l&&++ne===v&&(U=E),ae===b&&++fe===f&&(Y=E),(oe=ge.nextSibling)!==null)break;ge=ae,ae=ge.parentNode}ge=oe}l=U===-1||Y===-1?null:{start:U,end:Y}}else l=null}l=l||{start:0,end:0}}else l=null;for(Th={focusedElem:a,selectionRange:l},gu=!1,cn=s;cn!==null;)if(s=cn,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,cn=a;else for(;cn!==null;){switch(s=cn,b=s.alternate,a=s.flags,s.tag){case 0:if((a&4)!==0&&(a=s.updateQueue,a=a!==null?a.events:null,a!==null))for(l=0;l<a.length;l++)v=a[l],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&b!==null){a=void 0,l=s,v=b.memoizedProps,b=b.memoizedState,f=l.stateNode;try{var Re=qs(l.type,v);a=f.getSnapshotBeforeUpdate(Re,b),f.__reactInternalSnapshotBeforeUpdate=a}catch(Ve){Nt(l,l.return,Ve)}}break;case 3:if((a&1024)!==0){if(a=s.stateNode.containerInfo,l=a.nodeType,l===9)Lh(a);else if(l===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Lh(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=s.sibling,a!==null){a.return=s.return,cn=a;break}cn=s.return}}function r1(a,s,l){var f=l.flags;switch(l.tag){case 0:case 11:case 15:yi(a,l),f&4&&io(5,l);break;case 1:if(yi(a,l),f&4)if(a=l.stateNode,s===null)try{a.componentDidMount()}catch(E){Nt(l,l.return,E)}else{var v=qs(l.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(v,s,a.__reactInternalSnapshotBeforeUpdate)}catch(E){Nt(l,l.return,E)}}f&64&&e1(l),f&512&&so(l,l.return);break;case 3:if(yi(a,l),f&64&&(a=l.updateQueue,a!==null)){if(s=null,l.child!==null)switch(l.child.tag){case 27:case 5:s=l.child.stateNode;break;case 1:s=l.child.stateNode}try{qy(a,s)}catch(E){Nt(l,l.return,E)}}break;case 27:s===null&&f&4&&i1(l);case 26:case 5:yi(a,l),s===null&&f&4&&n1(l),f&512&&so(l,l.return);break;case 12:yi(a,l);break;case 31:yi(a,l),f&4&&c1(a,l);break;case 13:yi(a,l),f&4&&u1(a,l),f&64&&(a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(l=MC.bind(null,l),XC(a,l))));break;case 22:if(f=l.memoizedState!==null||pi,!f){s=s!==null&&s.memoizedState!==null||Jt,v=pi;var b=Jt;pi=f,(Jt=s)&&!b?vi(a,l,(l.subtreeFlags&8772)!==0):yi(a,l),pi=v,Jt=b}break;case 30:break;default:yi(a,l)}}function l1(a){var s=a.alternate;s!==null&&(a.alternate=null,l1(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&Gn(s)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Pt=null,Rn=!1;function gi(a,s,l){for(l=l.child;l!==null;)o1(a,s,l),l=l.sibling}function o1(a,s,l){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(Ie,l)}catch(b){}switch(l.tag){case 26:Jt||qa(l,s),gi(a,s,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Jt||qa(l,s);var f=Pt,v=Rn;Wi(l.type)&&(Pt=l.stateNode,Rn=!1),gi(a,s,l),po(l.stateNode),Pt=f,Rn=v;break;case 5:Jt||qa(l,s);case 6:if(f=Pt,v=Rn,Pt=null,gi(a,s,l),Pt=f,Rn=v,Pt!==null)if(Rn)try{(Pt.nodeType===9?Pt.body:Pt.nodeName==="HTML"?Pt.ownerDocument.body:Pt).removeChild(l.stateNode)}catch(b){Nt(l,s,b)}else try{Pt.removeChild(l.stateNode)}catch(b){Nt(l,s,b)}break;case 18:Pt!==null&&(Rn?(a=Pt,e0(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,l.stateNode),el(a)):e0(Pt,l.stateNode));break;case 4:f=Pt,v=Rn,Pt=l.stateNode.containerInfo,Rn=!0,gi(a,s,l),Pt=f,Rn=v;break;case 0:case 11:case 14:case 15:Gi(2,l,s),Jt||Gi(4,l,s),gi(a,s,l);break;case 1:Jt||(qa(l,s),f=l.stateNode,typeof f.componentWillUnmount=="function"&&t1(l,s,f)),gi(a,s,l);break;case 21:gi(a,s,l);break;case 22:Jt=(f=Jt)||l.memoizedState!==null,gi(a,s,l),Jt=f;break;default:gi(a,s,l)}}function c1(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{el(a)}catch(l){Nt(s,s.return,l)}}}function u1(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{el(a)}catch(l){Nt(s,s.return,l)}}function _C(a){switch(a.tag){case 31:case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new s1),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new s1),s;default:throw Error(i(435,a.tag))}}function Qc(a,s){var l=_C(a);s.forEach(function(f){if(!l.has(f)){l.add(f);var v=TC.bind(null,a,f);f.then(v,v)}})}function An(a,s){var l=s.deletions;if(l!==null)for(var f=0;f<l.length;f++){var v=l[f],b=a,E=s,U=E;e:for(;U!==null;){switch(U.tag){case 27:if(Wi(U.type)){Pt=U.stateNode,Rn=!1;break e}break;case 5:Pt=U.stateNode,Rn=!1;break e;case 3:case 4:Pt=U.stateNode.containerInfo,Rn=!0;break e}U=U.return}if(Pt===null)throw Error(i(160));o1(b,E,v),Pt=null,Rn=!1,b=v.alternate,b!==null&&(b.return=null),v.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)d1(s,a),s=s.sibling}var Ma=null;function d1(a,s){var l=a.alternate,f=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:An(s,a),Ln(a),f&4&&(Gi(3,a,a.return),io(3,a),Gi(5,a,a.return));break;case 1:An(s,a),Ln(a),f&512&&(Jt||l===null||qa(l,l.return)),f&64&&pi&&(a=a.updateQueue,a!==null&&(f=a.callbacks,f!==null&&(l=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=l===null?f:l.concat(f))));break;case 26:var v=Ma;if(An(s,a),Ln(a),f&512&&(Jt||l===null||qa(l,l.return)),f&4){var b=l!==null?l.memoizedState:null;if(f=a.memoizedState,l===null)if(f===null)if(a.stateNode===null){e:{f=a.type,l=a.memoizedProps,v=v.ownerDocument||v;t:switch(f){case"title":b=v.getElementsByTagName("title")[0],(!b||b[fn]||b[le]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=v.createElement(f),v.head.insertBefore(b,v.querySelector("head > title"))),gn(b,f,l),b[le]=a,Ae(b),f=b;break e;case"link":var E=d0("link","href",v).get(f+(l.href||""));if(E){for(var U=0;U<E.length;U++)if(b=E[U],b.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&b.getAttribute("rel")===(l.rel==null?null:l.rel)&&b.getAttribute("title")===(l.title==null?null:l.title)&&b.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){E.splice(U,1);break t}}b=v.createElement(f),gn(b,f,l),v.head.appendChild(b);break;case"meta":if(E=d0("meta","content",v).get(f+(l.content||""))){for(U=0;U<E.length;U++)if(b=E[U],b.getAttribute("content")===(l.content==null?null:""+l.content)&&b.getAttribute("name")===(l.name==null?null:l.name)&&b.getAttribute("property")===(l.property==null?null:l.property)&&b.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&b.getAttribute("charset")===(l.charSet==null?null:l.charSet)){E.splice(U,1);break t}}b=v.createElement(f),gn(b,f,l),v.head.appendChild(b);break;default:throw Error(i(468,f))}b[le]=a,Ae(b),f=b}a.stateNode=f}else f0(v,a.type,a.stateNode);else a.stateNode=u0(v,f,a.memoizedProps);else b!==f?(b===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):b.count--,f===null?f0(v,a.type,a.stateNode):u0(v,f,a.memoizedProps)):f===null&&a.stateNode!==null&&sh(a,a.memoizedProps,l.memoizedProps)}break;case 27:An(s,a),Ln(a),f&512&&(Jt||l===null||qa(l,l.return)),l!==null&&f&4&&sh(a,a.memoizedProps,l.memoizedProps);break;case 5:if(An(s,a),Ln(a),f&512&&(Jt||l===null||qa(l,l.return)),a.flags&32){v=a.stateNode;try{wr(v,"")}catch(Re){Nt(a,a.return,Re)}}f&4&&a.stateNode!=null&&(v=a.memoizedProps,sh(a,v,l!==null?l.memoizedProps:v)),f&1024&&(oh=!0);break;case 6:if(An(s,a),Ln(a),f&4){if(a.stateNode===null)throw Error(i(162));f=a.memoizedProps,l=a.stateNode;try{l.nodeValue=f}catch(Re){Nt(a,a.return,Re)}}break;case 3:if(fu=null,v=Ma,Ma=uu(s.containerInfo),An(s,a),Ma=v,Ln(a),f&4&&l!==null&&l.memoizedState.isDehydrated)try{el(s.containerInfo)}catch(Re){Nt(a,a.return,Re)}oh&&(oh=!1,f1(a));break;case 4:f=Ma,Ma=uu(a.stateNode.containerInfo),An(s,a),Ln(a),Ma=f;break;case 12:An(s,a),Ln(a);break;case 31:An(s,a),Ln(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,Qc(a,f)));break;case 13:An(s,a),Ln(a),a.child.flags&8192&&a.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Jc=Rt()),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,Qc(a,f)));break;case 22:v=a.memoizedState!==null;var Y=l!==null&&l.memoizedState!==null,ne=pi,fe=Jt;if(pi=ne||v,Jt=fe||Y,An(s,a),Jt=fe,pi=ne,Ln(a),f&8192)e:for(s=a.stateNode,s._visibility=v?s._visibility&-2:s._visibility|1,v&&(l===null||Y||pi||Jt||Vs(a)),l=null,s=a;;){if(s.tag===5||s.tag===26){if(l===null){Y=l=s;try{if(b=Y.stateNode,v)E=b.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{U=Y.stateNode;var ge=Y.memoizedProps.style,ae=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;U.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Re){Nt(Y,Y.return,Re)}}}else if(s.tag===6){if(l===null){Y=s;try{Y.stateNode.nodeValue=v?"":Y.memoizedProps}catch(Re){Nt(Y,Y.return,Re)}}}else if(s.tag===18){if(l===null){Y=s;try{var oe=Y.stateNode;v?t0(oe,!0):t0(Y.stateNode,!1)}catch(Re){Nt(Y,Y.return,Re)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===a)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;l===s&&(l=null),s=s.return}l===s&&(l=null),s.sibling.return=s.return,s=s.sibling}f&4&&(f=a.updateQueue,f!==null&&(l=f.retryQueue,l!==null&&(f.retryQueue=null,Qc(a,l))));break;case 19:An(s,a),Ln(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,Qc(a,f)));break;case 30:break;case 21:break;default:An(s,a),Ln(a)}}function Ln(a){var s=a.flags;if(s&2){try{for(var l,f=a.return;f!==null;){if(a1(f)){l=f;break}f=f.return}if(l==null)throw Error(i(160));switch(l.tag){case 27:var v=l.stateNode,b=rh(a);Xc(a,b,v);break;case 5:var E=l.stateNode;l.flags&32&&(wr(E,""),l.flags&=-33);var U=rh(a);Xc(a,U,E);break;case 3:case 4:var Y=l.stateNode.containerInfo,ne=rh(a);lh(a,ne,Y);break;default:throw Error(i(161))}}catch(fe){Nt(a,a.return,fe)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function f1(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;f1(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function yi(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)r1(a,s.alternate,s),s=s.sibling}function Vs(a){for(a=a.child;a!==null;){var s=a;switch(s.tag){case 0:case 11:case 14:case 15:Gi(4,s,s.return),Vs(s);break;case 1:qa(s,s.return);var l=s.stateNode;typeof l.componentWillUnmount=="function"&&t1(s,s.return,l),Vs(s);break;case 27:po(s.stateNode);case 26:case 5:qa(s,s.return),Vs(s);break;case 22:s.memoizedState===null&&Vs(s);break;case 30:Vs(s);break;default:Vs(s)}a=a.sibling}}function vi(a,s,l){for(l=l&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var f=s.alternate,v=a,b=s,E=b.flags;switch(b.tag){case 0:case 11:case 15:vi(v,b,l),io(4,b);break;case 1:if(vi(v,b,l),f=b,v=f.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ne){Nt(f,f.return,ne)}if(f=b,v=f.updateQueue,v!==null){var U=f.stateNode;try{var Y=v.shared.hiddenCallbacks;if(Y!==null)for(v.shared.hiddenCallbacks=null,v=0;v<Y.length;v++)$y(Y[v],U)}catch(ne){Nt(f,f.return,ne)}}l&&E&64&&e1(b),so(b,b.return);break;case 27:i1(b);case 26:case 5:vi(v,b,l),l&&f===null&&E&4&&n1(b),so(b,b.return);break;case 12:vi(v,b,l);break;case 31:vi(v,b,l),l&&E&4&&c1(v,b);break;case 13:vi(v,b,l),l&&E&4&&u1(v,b);break;case 22:b.memoizedState===null&&vi(v,b,l),so(b,b.return);break;case 30:break;default:vi(v,b,l)}s=s.sibling}}function ch(a,s){var l=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==l&&(a!=null&&a.refCount++,l!=null&&Vl(l))}function uh(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Vl(a))}function Ta(a,s,l,f){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)h1(a,s,l,f),s=s.sibling}function h1(a,s,l,f){var v=s.flags;switch(s.tag){case 0:case 11:case 15:Ta(a,s,l,f),v&2048&&io(9,s);break;case 1:Ta(a,s,l,f);break;case 3:Ta(a,s,l,f),v&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Vl(a)));break;case 12:if(v&2048){Ta(a,s,l,f),a=s.stateNode;try{var b=s.memoizedProps,E=b.id,U=b.onPostCommit;typeof U=="function"&&U(E,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(Y){Nt(s,s.return,Y)}}else Ta(a,s,l,f);break;case 31:Ta(a,s,l,f);break;case 13:Ta(a,s,l,f);break;case 23:break;case 22:b=s.stateNode,E=s.alternate,s.memoizedState!==null?b._visibility&2?Ta(a,s,l,f):ro(a,s):b._visibility&2?Ta(a,s,l,f):(b._visibility|=2,$r(a,s,l,f,(s.subtreeFlags&10256)!==0||!1)),v&2048&&ch(E,s);break;case 24:Ta(a,s,l,f),v&2048&&uh(s.alternate,s);break;default:Ta(a,s,l,f)}}function $r(a,s,l,f,v){for(v=v&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var b=a,E=s,U=l,Y=f,ne=E.flags;switch(E.tag){case 0:case 11:case 15:$r(b,E,U,Y,v),io(8,E);break;case 23:break;case 22:var fe=E.stateNode;E.memoizedState!==null?fe._visibility&2?$r(b,E,U,Y,v):ro(b,E):(fe._visibility|=2,$r(b,E,U,Y,v)),v&&ne&2048&&ch(E.alternate,E);break;case 24:$r(b,E,U,Y,v),v&&ne&2048&&uh(E.alternate,E);break;default:$r(b,E,U,Y,v)}s=s.sibling}}function ro(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var l=a,f=s,v=f.flags;switch(f.tag){case 22:ro(l,f),v&2048&&ch(f.alternate,f);break;case 24:ro(l,f),v&2048&&uh(f.alternate,f);break;default:ro(l,f)}s=s.sibling}}var lo=8192;function qr(a,s,l){if(a.subtreeFlags&lo)for(a=a.child;a!==null;)m1(a,s,l),a=a.sibling}function m1(a,s,l){switch(a.tag){case 26:qr(a,s,l),a.flags&lo&&a.memoizedState!==null&&lj(l,Ma,a.memoizedState,a.memoizedProps);break;case 5:qr(a,s,l);break;case 3:case 4:var f=Ma;Ma=uu(a.stateNode.containerInfo),qr(a,s,l),Ma=f;break;case 22:a.memoizedState===null&&(f=a.alternate,f!==null&&f.memoizedState!==null?(f=lo,lo=16777216,qr(a,s,l),lo=f):qr(a,s,l));break;default:qr(a,s,l)}}function p1(a){var s=a.alternate;if(s!==null&&(a=s.child,a!==null)){s.child=null;do s=a.sibling,a.sibling=null,a=s;while(a!==null)}}function oo(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var f=s[l];cn=f,y1(f,a)}p1(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)g1(a),a=a.sibling}function g1(a){switch(a.tag){case 0:case 11:case 15:oo(a),a.flags&2048&&Gi(9,a,a.return);break;case 3:oo(a);break;case 12:oo(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&2&&(a.return===null||a.return.tag!==13)?(s._visibility&=-3,Zc(a)):oo(a);break;default:oo(a)}}function Zc(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var f=s[l];cn=f,y1(f,a)}p1(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:Gi(8,s,s.return),Zc(s);break;case 22:l=s.stateNode,l._visibility&2&&(l._visibility&=-3,Zc(s));break;default:Zc(s)}a=a.sibling}}function y1(a,s){for(;cn!==null;){var l=cn;switch(l.tag){case 0:case 11:case 15:Gi(8,l,s);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var f=l.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Vl(l.memoizedState.cache)}if(f=l.child,f!==null)f.return=l,cn=f;else e:for(l=a;cn!==null;){f=cn;var v=f.sibling,b=f.return;if(l1(f),f===l){cn=null;break e}if(v!==null){v.return=b,cn=v;break e}cn=b}}}var SC={getCacheForType:function(a){var s=mn(Xt),l=s.data.get(a);return l===void 0&&(l=a(),s.data.set(a,l)),l},cacheSignal:function(){return mn(Xt).controller.signal}},wC=typeof WeakMap=="function"?WeakMap:Map,bt=0,At=null,at=null,lt=0,wt=0,Zn=null,Yi=!1,Vr=!1,dh=!1,xi=0,Vt=0,Ki=0,Gs=0,fh=0,Jn=0,Gr=0,co=null,Dn=null,hh=!1,Jc=0,v1=0,Wc=1/0,eu=null,Xi=null,an=0,Qi=null,Yr=null,bi=0,mh=0,ph=null,x1=null,uo=0,gh=null;function Wn(){return(bt&2)!==0&&lt!==0?lt&-lt:$.T!==null?Sh():ii()}function b1(){if(Jn===0)if((lt&536870912)===0||ct){var a=Ia;Ia<<=1,(Ia&3932160)===0&&(Ia=262144),Jn=a}else Jn=536870912;return a=Xn.current,a!==null&&(a.flags|=32),Jn}function On(a,s,l){(a===At&&(wt===2||wt===9)||a.cancelPendingCommit!==null)&&(Kr(a,0),Zi(a,lt,Jn,!1)),Ua(a,l),((bt&2)===0||a!==At)&&(a===At&&((bt&2)===0&&(Gs|=l),Vt===4&&Zi(a,lt,Jn,!1)),Va(a))}function _1(a,s,l){if((bt&6)!==0)throw Error(i(327));var f=!l&&(s&127)===0&&(s&a.expiredLanes)===0||Mn(a,s),v=f?jC(a,s):vh(a,s,!0),b=f;do{if(v===0){Vr&&!f&&Zi(a,s,0,!1);break}else{if(l=a.current.alternate,b&&!NC(l)){v=vh(a,s,!1),b=!1;continue}if(v===2){if(b=s,a.errorRecoveryDisabledLanes&b)var E=0;else E=a.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){s=E;e:{var U=a;v=co;var Y=U.current.memoizedState.isDehydrated;if(Y&&(Kr(U,E).flags|=256),E=vh(U,E,!1),E!==2){if(dh&&!Y){U.errorRecoveryDisabledLanes|=b,Gs|=b,v=4;break e}b=Dn,Dn=v,b!==null&&(Dn===null?Dn=b:Dn.push.apply(Dn,b))}v=E}if(b=!1,v!==2)continue}}if(v===1){Kr(a,0),Zi(a,s,0,!0);break}e:{switch(f=a,b=v,b){case 0:case 1:throw Error(i(345));case 4:if((s&4194048)!==s)break;case 6:Zi(f,s,Jn,!Yi);break e;case 2:Dn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((s&62914560)===s&&(v=Jc+300-Rt(),10<v)){if(Zi(f,s,Jn,!Yi),sa(f,0,!0)!==0)break e;bi=s,f.timeoutHandle=J1(S1.bind(null,f,l,Dn,eu,hh,s,Jn,Gs,Gr,Yi,b,"Throttled",-0,0),v);break e}S1(f,l,Dn,eu,hh,s,Jn,Gs,Gr,Yi,b,null,-0,0)}}break}while(!0);Va(a)}function S1(a,s,l,f,v,b,E,U,Y,ne,fe,ge,ae,oe){if(a.timeoutHandle=-1,ge=s.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:si},m1(s,b,ge);var Re=(b&62914560)===b?Jc-Rt():(b&4194048)===b?v1-Rt():0;if(Re=oj(ge,Re),Re!==null){bi=b,a.cancelPendingCommit=Re(T1.bind(null,a,s,b,l,f,v,E,U,Y,fe,ge,null,ae,oe)),Zi(a,b,E,!ne);return}}T1(a,s,b,l,f,v,E,U,Y)}function NC(a){for(var s=a;;){var l=s.tag;if((l===0||l===11||l===15)&&s.flags&16384&&(l=s.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var f=0;f<l.length;f++){var v=l[f],b=v.getSnapshot;v=v.value;try{if(!Yn(b(),v))return!1}catch(E){return!1}}if(l=s.child,s.subtreeFlags&16384&&l!==null)l.return=s,s=l;else{if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Zi(a,s,l,f){s&=~fh,s&=~Gs,a.suspendedLanes|=s,a.pingedLanes&=~s,f&&(a.warmLanes|=s),f=a.expirationTimes;for(var v=s;0<v;){var b=31-Je(v),E=1<<b;f[b]=-1,v&=~E}l!==0&&Fa(a,l,s)}function tu(){return(bt&6)===0?(fo(0),!1):!0}function yh(){if(at!==null){if(wt===0)var a=at.return;else a=at,ci=Is=null,Lf(a),Br=null,Yl=0,a=at;for(;a!==null;)Wv(a.alternate,a),a=a.return;at=null}}function Kr(a,s){var l=a.timeoutHandle;l!==-1&&(a.timeoutHandle=-1,qC(l)),l=a.cancelPendingCommit,l!==null&&(a.cancelPendingCommit=null,l()),bi=0,yh(),At=a,at=l=li(a.current,null),lt=s,wt=0,Zn=null,Yi=!1,Vr=Mn(a,s),dh=!1,Gr=Jn=fh=Gs=Ki=Vt=0,Dn=co=null,hh=!1,(s&8)!==0&&(s|=s&32);var f=a.entangledLanes;if(f!==0)for(a=a.entanglements,f&=s;0<f;){var v=31-Je(f),b=1<<v;s|=a[v],f&=~b}return xi=s,Sc(),l}function w1(a,s){Qe=null,$.H=to,s===Ir||s===Tc?(s=Uy(),wt=3):s===_f?(s=Uy(),wt=4):wt=s===Xf?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Zn=s,at===null&&(Vt=1,qc(a,ua(s,a.current)))}function N1(){var a=Xn.current;return a===null?!0:(lt&4194048)===lt?ma===null:(lt&62914560)===lt||(lt&536870912)!==0?a===ma:!1}function C1(){var a=$.H;return $.H=to,a===null?to:a}function j1(){var a=$.A;return $.A=SC,a}function nu(){Vt=4,Yi||(lt&4194048)!==lt&&Xn.current!==null||(Vr=!0),(Ki&134217727)===0&&(Gs&134217727)===0||At===null||Zi(At,lt,Jn,!1)}function vh(a,s,l){var f=bt;bt|=2;var v=C1(),b=j1();(At!==a||lt!==s)&&(eu=null,Kr(a,s)),s=!1;var E=Vt;e:do try{if(wt!==0&&at!==null){var U=at,Y=Zn;switch(wt){case 8:yh(),E=6;break e;case 3:case 2:case 9:case 6:Xn.current===null&&(s=!0);var ne=wt;if(wt=0,Zn=null,Xr(a,U,Y,ne),l&&Vr){E=0;break e}break;default:ne=wt,wt=0,Zn=null,Xr(a,U,Y,ne)}}CC(),E=Vt;break}catch(fe){w1(a,fe)}while(!0);return s&&a.shellSuspendCounter++,ci=Is=null,bt=f,$.H=v,$.A=b,at===null&&(At=null,lt=0,Sc()),E}function CC(){for(;at!==null;)E1(at)}function jC(a,s){var l=bt;bt|=2;var f=C1(),v=j1();At!==a||lt!==s?(eu=null,Wc=Rt()+500,Kr(a,s)):Vr=Mn(a,s);e:do try{if(wt!==0&&at!==null){s=at;var b=Zn;t:switch(wt){case 1:wt=0,Zn=null,Xr(a,s,b,1);break;case 2:case 9:if(Iy(b)){wt=0,Zn=null,k1(s);break}s=function(){wt!==2&&wt!==9||At!==a||(wt=7),Va(a)},b.then(s,s);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:Iy(b)?(wt=0,Zn=null,k1(s)):(wt=0,Zn=null,Xr(a,s,b,7));break;case 5:var E=null;switch(at.tag){case 26:E=at.memoizedState;case 5:case 27:var U=at;if(E?h0(E):U.stateNode.complete){wt=0,Zn=null;var Y=U.sibling;if(Y!==null)at=Y;else{var ne=U.return;ne!==null?(at=ne,au(ne)):at=null}break t}}wt=0,Zn=null,Xr(a,s,b,5);break;case 6:wt=0,Zn=null,Xr(a,s,b,6);break;case 8:yh(),Vt=6;break e;default:throw Error(i(462))}}EC();break}catch(fe){w1(a,fe)}while(!0);return ci=Is=null,$.H=f,$.A=v,bt=l,at!==null?0:(At=null,lt=0,Sc(),Vt)}function EC(){for(;at!==null&&!wn();)E1(at)}function E1(a){var s=Zv(a.alternate,a,xi);a.memoizedProps=a.pendingProps,s===null?au(a):at=s}function k1(a){var s=a,l=s.alternate;switch(s.tag){case 15:case 0:s=Vv(l,s,s.pendingProps,s.type,void 0,lt);break;case 11:s=Vv(l,s,s.pendingProps,s.type.render,s.ref,lt);break;case 5:Lf(s);default:Wv(l,s),s=at=jy(s,xi),s=Zv(l,s,xi)}a.memoizedProps=a.pendingProps,s===null?au(a):at=s}function Xr(a,s,l,f){ci=Is=null,Lf(s),Br=null,Yl=0;var v=s.return;try{if(pC(a,v,s,l,lt)){Vt=1,qc(a,ua(l,a.current)),at=null;return}}catch(b){if(v!==null)throw at=v,b;Vt=1,qc(a,ua(l,a.current)),at=null;return}s.flags&32768?(ct||f===1?a=!0:Vr||(lt&536870912)!==0?a=!1:(Yi=a=!0,(f===2||f===9||f===3||f===6)&&(f=Xn.current,f!==null&&f.tag===13&&(f.flags|=16384))),M1(s,a)):au(s)}function au(a){var s=a;do{if((s.flags&32768)!==0){M1(s,Yi);return}a=s.return;var l=vC(s.alternate,s,xi);if(l!==null){at=l;return}if(s=s.sibling,s!==null){at=s;return}at=s=a}while(s!==null);Vt===0&&(Vt=5)}function M1(a,s){do{var l=xC(a.alternate,a);if(l!==null){l.flags&=32767,at=l;return}if(l=a.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!s&&(a=a.sibling,a!==null)){at=a;return}at=a=l}while(a!==null);Vt=6,at=null}function T1(a,s,l,f,v,b,E,U,Y){a.cancelPendingCommit=null;do iu();while(an!==0);if((bt&6)!==0)throw Error(i(327));if(s!==null){if(s===a.current)throw Error(i(177));if(b=s.lanes|s.childLanes,b|=rf,qn(a,l,b,E,U,Y),a===At&&(at=At=null,lt=0),Yr=s,Qi=a,bi=l,mh=b,ph=v,x1=f,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,RC(Oe,function(){return O1(),null})):(a.callbackNode=null,a.callbackPriority=0),f=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||f){f=$.T,$.T=null,v=Q.p,Q.p=2,E=bt,bt|=4;try{bC(a,s,l)}finally{bt=E,Q.p=v,$.T=f}}an=1,R1(),A1(),L1()}}function R1(){if(an===1){an=0;var a=Qi,s=Yr,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=$.T,$.T=null;var f=Q.p;Q.p=2;var v=bt;bt|=4;try{d1(s,a);var b=Th,E=yy(a.containerInfo),U=b.focusedElem,Y=b.selectionRange;if(E!==U&&U&&U.ownerDocument&&gy(U.ownerDocument.documentElement,U)){if(Y!==null&&ef(U)){var ne=Y.start,fe=Y.end;if(fe===void 0&&(fe=ne),"selectionStart"in U)U.selectionStart=ne,U.selectionEnd=Math.min(fe,U.value.length);else{var ge=U.ownerDocument||document,ae=ge&&ge.defaultView||window;if(ae.getSelection){var oe=ae.getSelection(),Re=U.textContent.length,Ve=Math.min(Y.start,Re),Tt=Y.end===void 0?Ve:Math.min(Y.end,Re);!oe.extend&&Ve>Tt&&(E=Tt,Tt=Ve,Ve=E);var ee=py(U,Ve),Z=py(U,Tt);if(ee&&Z&&(oe.rangeCount!==1||oe.anchorNode!==ee.node||oe.anchorOffset!==ee.offset||oe.focusNode!==Z.node||oe.focusOffset!==Z.offset)){var te=ge.createRange();te.setStart(ee.node,ee.offset),oe.removeAllRanges(),Ve>Tt?(oe.addRange(te),oe.extend(Z.node,Z.offset)):(te.setEnd(Z.node,Z.offset),oe.addRange(te))}}}}for(ge=[],oe=U;oe=oe.parentNode;)oe.nodeType===1&&ge.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<ge.length;U++){var me=ge[U];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}gu=!!Mh,Th=Mh=null}finally{bt=v,Q.p=f,$.T=l}}a.current=s,an=2}}function A1(){if(an===2){an=0;var a=Qi,s=Yr,l=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||l){l=$.T,$.T=null;var f=Q.p;Q.p=2;var v=bt;bt|=4;try{r1(a,s.alternate,s)}finally{bt=v,Q.p=f,$.T=l}}an=3}}function L1(){if(an===4||an===3){an=0,Ca();var a=Qi,s=Yr,l=bi,f=x1;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?an=5:(an=0,Yr=Qi=null,D1(a,a.pendingLanes));var v=a.pendingLanes;if(v===0&&(Xi=null),Di(l),s=s.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(Ie,s,void 0,(s.current.flags&128)===128)}catch(Y){}if(f!==null){s=$.T,v=Q.p,Q.p=2,$.T=null;try{for(var b=a.onRecoverableError,E=0;E<f.length;E++){var U=f[E];b(U.value,{componentStack:U.stack})}}finally{$.T=s,Q.p=v}}(bi&3)!==0&&iu(),Va(a),v=a.pendingLanes,(l&261930)!==0&&(v&42)!==0?a===gh?uo++:(uo=0,gh=a):uo=0,fo(0)}}function D1(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,Vl(s)))}function iu(){return R1(),A1(),L1(),O1()}function O1(){if(an!==5)return!1;var a=Qi,s=mh;mh=0;var l=Di(bi),f=$.T,v=Q.p;try{Q.p=32>l?32:l,$.T=null,l=ph,ph=null;var b=Qi,E=bi;if(an=0,Yr=Qi=null,bi=0,(bt&6)!==0)throw Error(i(331));var U=bt;if(bt|=4,g1(b.current),h1(b,b.current,E,l),bt=U,fo(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(Ie,b)}catch(Y){}return!0}finally{Q.p=v,$.T=f,D1(a,s)}}function z1(a,s,l){s=ua(l,s),s=Kf(a.stateNode,s,2),a=$i(a,s,2),a!==null&&(Ua(a,2),Va(a))}function Nt(a,s,l){if(a.tag===3)z1(a,a,l);else for(;s!==null;){if(s.tag===3){z1(s,a,l);break}else if(s.tag===1){var f=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Xi===null||!Xi.has(f))){a=ua(l,a),l=Iv(2),f=$i(s,l,2),f!==null&&(Bv(l,f,s,a),Ua(f,2),Va(f));break}}s=s.return}}function xh(a,s,l){var f=a.pingCache;if(f===null){f=a.pingCache=new wC;var v=new Set;f.set(s,v)}else v=f.get(s),v===void 0&&(v=new Set,f.set(s,v));v.has(l)||(dh=!0,v.add(l),a=kC.bind(null,a,s,l),s.then(a,a))}function kC(a,s,l){var f=a.pingCache;f!==null&&f.delete(s),a.pingedLanes|=a.suspendedLanes&l,a.warmLanes&=~l,At===a&&(lt&l)===l&&(Vt===4||Vt===3&&(lt&62914560)===lt&&300>Rt()-Jc?(bt&2)===0&&Kr(a,0):fh|=l,Gr===lt&&(Gr=0)),Va(a)}function I1(a,s){s===0&&(s=Li()),a=Ds(a,s),a!==null&&(Ua(a,s),Va(a))}function MC(a){var s=a.memoizedState,l=0;s!==null&&(l=s.retryLane),I1(a,l)}function TC(a,s){var l=0;switch(a.tag){case 31:case 13:var f=a.stateNode,v=a.memoizedState;v!==null&&(l=v.retryLane);break;case 19:f=a.stateNode;break;case 22:f=a.stateNode._retryCache;break;default:throw Error(i(314))}f!==null&&f.delete(s),I1(a,l)}function RC(a,s){return $n(a,s)}var su=null,Qr=null,bh=!1,ru=!1,_h=!1,Ji=0;function Va(a){a!==Qr&&a.next===null&&(Qr===null?su=Qr=a:Qr=Qr.next=a),ru=!0,bh||(bh=!0,LC())}function fo(a,s){if(!_h&&ru){_h=!0;do for(var l=!1,f=su;f!==null;){if(a!==0){var v=f.pendingLanes;if(v===0)var b=0;else{var E=f.suspendedLanes,U=f.pingedLanes;b=(1<<31-Je(42|a)+1)-1,b&=v&~(E&~U),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(l=!0,H1(f,b))}else b=lt,b=sa(f,f===At?b:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(b&3)===0||Mn(f,b)||(l=!0,H1(f,b));f=f.next}while(l);_h=!1}}function AC(){B1()}function B1(){ru=bh=!1;var a=0;Ji!==0&&$C()&&(a=Ji);for(var s=Rt(),l=null,f=su;f!==null;){var v=f.next,b=U1(f,s);b===0?(f.next=null,l===null?su=v:l.next=v,v===null&&(Qr=l)):(l=f,(a!==0||(b&3)!==0)&&(ru=!0)),f=v}an!==0&&an!==5||fo(a),Ji!==0&&(Ji=0)}function U1(a,s){for(var l=a.suspendedLanes,f=a.pingedLanes,v=a.expirationTimes,b=a.pendingLanes&-62914561;0<b;){var E=31-Je(b),U=1<<E,Y=v[E];Y===-1?((U&l)===0||(U&f)!==0)&&(v[E]=Ba(U,s)):Y<=s&&(a.expiredLanes|=U),b&=~U}if(s=At,l=lt,l=sa(a,a===s?l:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f=a.callbackNode,l===0||a===s&&(wt===2||wt===9)||a.cancelPendingCommit!==null)return f!==null&&f!==null&&yn(f),a.callbackNode=null,a.callbackPriority=0;if((l&3)===0||Mn(a,l)){if(s=l&-l,s===a.callbackPriority)return s;switch(f!==null&&yn(f),Di(l)){case 2:case 8:l=de;break;case 32:l=Oe;break;case 268435456:l=Te;break;default:l=Oe}return f=F1.bind(null,a),l=$n(l,f),a.callbackPriority=s,a.callbackNode=l,s}return f!==null&&f!==null&&yn(f),a.callbackPriority=2,a.callbackNode=null,2}function F1(a,s){if(an!==0&&an!==5)return a.callbackNode=null,a.callbackPriority=0,null;var l=a.callbackNode;if(iu()&&a.callbackNode!==l)return null;var f=lt;return f=sa(a,a===At?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f===0?null:(_1(a,f,s),U1(a,Rt()),a.callbackNode!=null&&a.callbackNode===l?F1.bind(null,a):null)}function H1(a,s){if(iu())return null;_1(a,s,!0)}function LC(){VC(function(){(bt&6)!==0?$n(ce,AC):B1()})}function Sh(){if(Ji===0){var a=Or;a===0&&(a=ei,ei<<=1,(ei&261888)===0&&(ei=256)),Ji=a}return Ji}function P1(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:mc(""+a)}function $1(a,s){var l=s.ownerDocument.createElement("input");return l.name=s.name,l.value=s.value,a.id&&l.setAttribute("form",a.id),s.parentNode.insertBefore(l,s),a=new FormData(a),l.parentNode.removeChild(l),a}function DC(a,s,l,f,v){if(s==="submit"&&l&&l.stateNode===v){var b=P1((v[we]||null).action),E=f.submitter;E&&(s=(s=E[we]||null)?P1(s.formAction):E.getAttribute("formAction"),s!==null&&(b=s,E=null));var U=new vc("action","action",null,f,v);a.push({event:U,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Ji!==0){var Y=E?$1(v,E):new FormData(v);Pf(l,{pending:!0,data:Y,method:v.method,action:b},null,Y)}}else typeof b=="function"&&(U.preventDefault(),Y=E?$1(v,E):new FormData(v),Pf(l,{pending:!0,data:Y,method:v.method,action:b},b,Y))},currentTarget:v}]})}}for(var wh=0;wh<sf.length;wh++){var Nh=sf[wh],OC=Nh.toLowerCase(),zC=Nh[0].toUpperCase()+Nh.slice(1);ka(OC,"on"+zC)}ka(by,"onAnimationEnd"),ka(_y,"onAnimationIteration"),ka(Sy,"onAnimationStart"),ka("dblclick","onDoubleClick"),ka("focusin","onFocus"),ka("focusout","onBlur"),ka(JN,"onTransitionRun"),ka(WN,"onTransitionStart"),ka(eC,"onTransitionCancel"),ka(wy,"onTransitionEnd"),tn("onMouseEnter",["mouseout","mouseover"]),tn("onMouseLeave",["mouseout","mouseover"]),tn("onPointerEnter",["pointerout","pointerover"]),tn("onPointerLeave",["pointerout","pointerover"]),Ft("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ft("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ft("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ft("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ft("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ft("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ho="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(" "),IC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ho));function q1(a,s){s=(s&4)!==0;for(var l=0;l<a.length;l++){var f=a[l],v=f.event;f=f.listeners;e:{var b=void 0;if(s)for(var E=f.length-1;0<=E;E--){var U=f[E],Y=U.instance,ne=U.currentTarget;if(U=U.listener,Y!==b&&v.isPropagationStopped())break e;b=U,v.currentTarget=ne;try{b(v)}catch(fe){_c(fe)}v.currentTarget=null,b=Y}else for(E=0;E<f.length;E++){if(U=f[E],Y=U.instance,ne=U.currentTarget,U=U.listener,Y!==b&&v.isPropagationStopped())break e;b=U,v.currentTarget=ne;try{b(v)}catch(fe){_c(fe)}v.currentTarget=null,b=Y}}}}function it(a,s){var l=s[Ye];l===void 0&&(l=s[Ye]=new Set);var f=a+"__bubble";l.has(f)||(V1(s,a,2,!1),l.add(f))}function Ch(a,s,l){var f=0;s&&(f|=4),V1(l,a,f,s)}var lu="_reactListening"+Math.random().toString(36).slice(2);function jh(a){if(!a[lu]){a[lu]=!0,tt.forEach(function(l){l!=="selectionchange"&&(IC.has(l)||Ch(l,!1,a),Ch(l,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[lu]||(s[lu]=!0,Ch("selectionchange",!1,s))}}function V1(a,s,l,f){switch(b0(s)){case 2:var v=dj;break;case 8:v=fj;break;default:v=Hh}l=v.bind(null,s,l,a),v=void 0,!Vd||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(v=!0),f?v!==void 0?a.addEventListener(s,l,{capture:!0,passive:v}):a.addEventListener(s,l,!0):v!==void 0?a.addEventListener(s,l,{passive:v}):a.addEventListener(s,l,!1)}function Eh(a,s,l,f,v){var b=f;if((s&1)===0&&(s&2)===0&&f!==null)e:for(;;){if(f===null)return;var E=f.tag;if(E===3||E===4){var U=f.stateNode.containerInfo;if(U===v)break;if(E===4)for(E=f.return;E!==null;){var Y=E.tag;if((Y===3||Y===4)&&E.stateNode.containerInfo===v)return;E=E.return}for(;U!==null;){if(E=J(U),E===null)return;if(Y=E.tag,Y===5||Y===6||Y===26||Y===27){f=b=E;continue e}U=U.parentNode}}f=f.return}Qg(function(){var ne=b,fe=$d(l),ge=[];e:{var ae=Ny.get(a);if(ae!==void 0){var oe=vc,Re=a;switch(a){case"keypress":if(gc(l)===0)break e;case"keydown":case"keyup":oe=TN;break;case"focusin":Re="focus",oe=Xd;break;case"focusout":Re="blur",oe=Xd;break;case"beforeblur":case"afterblur":oe=Xd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=Wg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=vN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=LN;break;case by:case _y:case Sy:oe=_N;break;case wy:oe=ON;break;case"scroll":case"scrollend":oe=gN;break;case"wheel":oe=IN;break;case"copy":case"cut":case"paste":oe=wN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=ty;break;case"toggle":case"beforetoggle":oe=UN}var Ve=(s&4)!==0,Tt=!Ve&&(a==="scroll"||a==="scrollend"),ee=Ve?ae!==null?ae+"Capture":null:ae;Ve=[];for(var Z=ne,te;Z!==null;){var me=Z;if(te=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||te===null||ee===null||(me=Dl(Z,ee),me!=null&&Ve.push(mo(Z,me,te))),Tt)break;Z=Z.return}0<Ve.length&&(ae=new oe(ae,Re,null,l,fe),ge.push({event:ae,listeners:Ve}))}}if((s&7)===0){e:{if(ae=a==="mouseover"||a==="pointerover",oe=a==="mouseout"||a==="pointerout",ae&&l!==Pd&&(Re=l.relatedTarget||l.fromElement)&&(J(Re)||Re[De]))break e;if((oe||ae)&&(ae=fe.window===fe?fe:(ae=fe.ownerDocument)?ae.defaultView||ae.parentWindow:window,oe?(Re=l.relatedTarget||l.toElement,oe=ne,Re=Re?J(Re):null,Re!==null&&(Tt=c(Re),Ve=Re.tag,Re!==Tt||Ve!==5&&Ve!==27&&Ve!==6)&&(Re=null)):(oe=null,Re=ne),oe!==Re)){if(Ve=Wg,me="onMouseLeave",ee="onMouseEnter",Z="mouse",(a==="pointerout"||a==="pointerover")&&(Ve=ty,me="onPointerLeave",ee="onPointerEnter",Z="pointer"),Tt=oe==null?ae:_e(oe),te=Re==null?ae:_e(Re),ae=new Ve(me,Z+"leave",oe,l,fe),ae.target=Tt,ae.relatedTarget=te,me=null,J(fe)===ne&&(Ve=new Ve(ee,Z+"enter",Re,l,fe),Ve.target=te,Ve.relatedTarget=Tt,me=Ve),Tt=me,oe&&Re)t:{for(Ve=BC,ee=oe,Z=Re,te=0,me=ee;me;me=Ve(me))te++;me=0;for(var Fe=Z;Fe;Fe=Ve(Fe))me++;for(;0<te-me;)ee=Ve(ee),te--;for(;0<me-te;)Z=Ve(Z),me--;for(;te--;){if(ee===Z||Z!==null&&ee===Z.alternate){Ve=ee;break t}ee=Ve(ee),Z=Ve(Z)}Ve=null}else Ve=null;oe!==null&&G1(ge,ae,oe,Ve,!1),Re!==null&&Tt!==null&&G1(ge,Tt,Re,Ve,!0)}}e:{if(ae=ne?_e(ne):window,oe=ae.nodeName&&ae.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ae.type==="file")var gt=cy;else if(ly(ae))if(uy)gt=XN;else{gt=YN;var Le=GN}else oe=ae.nodeName,!oe||oe.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&Hd(ne.elementType)&&(gt=cy):gt=KN;if(gt&&(gt=gt(a,ne))){oy(ge,gt,l,fe);break e}Le&&Le(a,ae,ne),a==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&Fd(ae,"number",ae.value)}switch(Le=ne?_e(ne):window,a){case"focusin":(ly(Le)||Le.contentEditable==="true")&&(Er=Le,tf=ne,Pl=null);break;case"focusout":Pl=tf=Er=null;break;case"mousedown":nf=!0;break;case"contextmenu":case"mouseup":case"dragend":nf=!1,vy(ge,l,fe);break;case"selectionchange":if(ZN)break;case"keydown":case"keyup":vy(ge,l,fe)}var Ze;if(Zd)e:{switch(a){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else jr?sy(a,l)&&(ot="onCompositionEnd"):a==="keydown"&&l.keyCode===229&&(ot="onCompositionStart");ot&&(ny&&l.locale!=="ko"&&(jr||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&jr&&(Ze=Zg()):(zi=fe,Gd="value"in zi?zi.value:zi.textContent,jr=!0)),Le=ou(ne,ot),0<Le.length&&(ot=new ey(ot,a,null,l,fe),ge.push({event:ot,listeners:Le}),Ze?ot.data=Ze:(Ze=ry(l),Ze!==null&&(ot.data=Ze)))),(Ze=HN?PN(a,l):$N(a,l))&&(ot=ou(ne,"onBeforeInput"),0<ot.length&&(Le=new ey("onBeforeInput","beforeinput",null,l,fe),ge.push({event:Le,listeners:ot}),Le.data=Ze)),DC(ge,a,ne,l,fe)}q1(ge,s)})}function mo(a,s,l){return{instance:a,listener:s,currentTarget:l}}function ou(a,s){for(var l=s+"Capture",f=[];a!==null;){var v=a,b=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||b===null||(v=Dl(a,l),v!=null&&f.unshift(mo(a,v,b)),v=Dl(a,s),v!=null&&f.push(mo(a,v,b))),a.tag===3)return f;a=a.return}return[]}function BC(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function G1(a,s,l,f,v){for(var b=s._reactName,E=[];l!==null&&l!==f;){var U=l,Y=U.alternate,ne=U.stateNode;if(U=U.tag,Y!==null&&Y===f)break;U!==5&&U!==26&&U!==27||ne===null||(Y=ne,v?(ne=Dl(l,b),ne!=null&&E.unshift(mo(l,ne,Y))):v||(ne=Dl(l,b),ne!=null&&E.push(mo(l,ne,Y)))),l=l.return}E.length!==0&&a.push({event:s,listeners:E})}var UC=/\r\n?/g,FC=/\u0000|\uFFFD/g;function Y1(a){return(typeof a=="string"?a:""+a).replace(UC,`
33
- `).replace(FC,"")}function K1(a,s){return s=Y1(s),Y1(a)===s}function Mt(a,s,l,f,v,b){switch(l){case"children":typeof f=="string"?s==="body"||s==="textarea"&&f===""||wr(a,f):(typeof f=="number"||typeof f=="bigint")&&s!=="body"&&wr(a,""+f);break;case"className":nn(a,"class",f);break;case"tabIndex":nn(a,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":nn(a,l,f);break;case"style":Kg(a,f,b);break;case"data":if(s!=="object"){nn(a,"data",f);break}case"src":case"href":if(f===""&&(s!=="a"||l!=="href")){a.removeAttribute(l);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(l);break}f=mc(""+f),a.setAttribute(l,f);break;case"action":case"formAction":if(typeof f=="function"){a.setAttribute(l,"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 b=="function"&&(l==="formAction"?(s!=="input"&&Mt(a,s,"name",v.name,v,null),Mt(a,s,"formEncType",v.formEncType,v,null),Mt(a,s,"formMethod",v.formMethod,v,null),Mt(a,s,"formTarget",v.formTarget,v,null)):(Mt(a,s,"encType",v.encType,v,null),Mt(a,s,"method",v.method,v,null),Mt(a,s,"target",v.target,v,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(l);break}f=mc(""+f),a.setAttribute(l,f);break;case"onClick":f!=null&&(a.onclick=si);break;case"onScroll":f!=null&&it("scroll",a);break;case"onScrollEnd":f!=null&&it("scrollend",a);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(i(61));if(l=f.__html,l!=null){if(v.children!=null)throw Error(i(60));a.innerHTML=l}}break;case"multiple":a.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":a.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){a.removeAttribute("xlink:href");break}l=mc(""+f),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(l,""+f):a.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(l,""):a.removeAttribute(l);break;case"capture":case"download":f===!0?a.setAttribute(l,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(l,f):a.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?a.setAttribute(l,f):a.removeAttribute(l);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?a.removeAttribute(l):a.setAttribute(l,f);break;case"popover":it("beforetoggle",a),it("toggle",a),Ht(a,"popover",f);break;case"xlinkActuate":vn(a,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":vn(a,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":vn(a,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":vn(a,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":vn(a,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":vn(a,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":vn(a,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":vn(a,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":vn(a,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Ht(a,"is",f);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=mN.get(l)||l,Ht(a,l,f))}}function kh(a,s,l,f,v,b){switch(l){case"style":Kg(a,f,b);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(i(61));if(l=f.__html,l!=null){if(v.children!=null)throw Error(i(60));a.innerHTML=l}}break;case"children":typeof f=="string"?wr(a,f):(typeof f=="number"||typeof f=="bigint")&&wr(a,""+f);break;case"onScroll":f!=null&&it("scroll",a);break;case"onScrollEnd":f!=null&&it("scrollend",a);break;case"onClick":f!=null&&(a.onclick=si);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ht.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(v=l.endsWith("Capture"),s=l.slice(2,v?l.length-7:void 0),b=a[we]||null,b=b!=null?b[l]:null,typeof b=="function"&&a.removeEventListener(s,b,v),typeof f=="function")){typeof b!="function"&&b!==null&&(l in a?a[l]=null:a.hasAttribute(l)&&a.removeAttribute(l)),a.addEventListener(s,f,v);break e}l in a?a[l]=f:f===!0?a.setAttribute(l,""):Ht(a,l,f)}}}function gn(a,s,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",a),it("load",a);var f=!1,v=!1,b;for(b in l)if(l.hasOwnProperty(b)){var E=l[b];if(E!=null)switch(b){case"src":f=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Mt(a,s,b,E,l,null)}}v&&Mt(a,s,"srcSet",l.srcSet,l,null),f&&Mt(a,s,"src",l.src,l,null);return;case"input":it("invalid",a);var U=b=E=v=null,Y=null,ne=null;for(f in l)if(l.hasOwnProperty(f)){var fe=l[f];if(fe!=null)switch(f){case"name":v=fe;break;case"type":E=fe;break;case"checked":Y=fe;break;case"defaultChecked":ne=fe;break;case"value":b=fe;break;case"defaultValue":U=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(i(137,s));break;default:Mt(a,s,f,fe,l,null)}}qg(a,b,U,Y,ne,E,v,!1);return;case"select":it("invalid",a),f=E=b=null;for(v in l)if(l.hasOwnProperty(v)&&(U=l[v],U!=null))switch(v){case"value":b=U;break;case"defaultValue":E=U;break;case"multiple":f=U;default:Mt(a,s,v,U,l,null)}s=b,l=E,a.multiple=!!f,s!=null?Sr(a,!!f,s,!1):l!=null&&Sr(a,!!f,l,!0);return;case"textarea":it("invalid",a),b=v=f=null;for(E in l)if(l.hasOwnProperty(E)&&(U=l[E],U!=null))switch(E){case"value":f=U;break;case"defaultValue":v=U;break;case"children":b=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(91));break;default:Mt(a,s,E,U,l,null)}Gg(a,f,v,b);return;case"option":for(Y in l)if(l.hasOwnProperty(Y)&&(f=l[Y],f!=null))switch(Y){case"selected":a.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Mt(a,s,Y,f,l,null)}return;case"dialog":it("beforetoggle",a),it("toggle",a),it("cancel",a),it("close",a);break;case"iframe":case"object":it("load",a);break;case"video":case"audio":for(f=0;f<ho.length;f++)it(ho[f],a);break;case"image":it("error",a),it("load",a);break;case"details":it("toggle",a);break;case"embed":case"source":case"link":it("error",a),it("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in l)if(l.hasOwnProperty(ne)&&(f=l[ne],f!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Mt(a,s,ne,f,l,null)}return;default:if(Hd(s)){for(fe in l)l.hasOwnProperty(fe)&&(f=l[fe],f!==void 0&&kh(a,s,fe,f,l,void 0));return}}for(U in l)l.hasOwnProperty(U)&&(f=l[U],f!=null&&Mt(a,s,U,f,l,null))}function HC(a,s,l,f){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,b=null,E=null,U=null,Y=null,ne=null,fe=null;for(oe in l){var ge=l[oe];if(l.hasOwnProperty(oe)&&ge!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":Y=ge;default:f.hasOwnProperty(oe)||Mt(a,s,oe,null,f,ge)}}for(var ae in f){var oe=f[ae];if(ge=l[ae],f.hasOwnProperty(ae)&&(oe!=null||ge!=null))switch(ae){case"type":b=oe;break;case"name":v=oe;break;case"checked":ne=oe;break;case"defaultChecked":fe=oe;break;case"value":E=oe;break;case"defaultValue":U=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,s));break;default:oe!==ge&&Mt(a,s,ae,oe,f,ge)}}Ud(a,E,U,Y,ne,fe,b,v);return;case"select":oe=E=U=ae=null;for(b in l)if(Y=l[b],l.hasOwnProperty(b)&&Y!=null)switch(b){case"value":break;case"multiple":oe=Y;default:f.hasOwnProperty(b)||Mt(a,s,b,null,f,Y)}for(v in f)if(b=f[v],Y=l[v],f.hasOwnProperty(v)&&(b!=null||Y!=null))switch(v){case"value":ae=b;break;case"defaultValue":U=b;break;case"multiple":E=b;default:b!==Y&&Mt(a,s,v,b,f,Y)}s=U,l=E,f=oe,ae!=null?Sr(a,!!l,ae,!1):!!f!=!!l&&(s!=null?Sr(a,!!l,s,!0):Sr(a,!!l,l?[]:"",!1));return;case"textarea":oe=ae=null;for(U in l)if(v=l[U],l.hasOwnProperty(U)&&v!=null&&!f.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:Mt(a,s,U,null,f,v)}for(E in f)if(v=f[E],b=l[E],f.hasOwnProperty(E)&&(v!=null||b!=null))switch(E){case"value":ae=v;break;case"defaultValue":oe=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(i(91));break;default:v!==b&&Mt(a,s,E,v,f,b)}Vg(a,ae,oe);return;case"option":for(var Re in l)if(ae=l[Re],l.hasOwnProperty(Re)&&ae!=null&&!f.hasOwnProperty(Re))switch(Re){case"selected":a.selected=!1;break;default:Mt(a,s,Re,null,f,ae)}for(Y in f)if(ae=f[Y],oe=l[Y],f.hasOwnProperty(Y)&&ae!==oe&&(ae!=null||oe!=null))switch(Y){case"selected":a.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:Mt(a,s,Y,ae,f,oe)}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 Ve in l)ae=l[Ve],l.hasOwnProperty(Ve)&&ae!=null&&!f.hasOwnProperty(Ve)&&Mt(a,s,Ve,null,f,ae);for(ne in f)if(ae=f[ne],oe=l[ne],f.hasOwnProperty(ne)&&ae!==oe&&(ae!=null||oe!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,s));break;default:Mt(a,s,ne,ae,f,oe)}return;default:if(Hd(s)){for(var Tt in l)ae=l[Tt],l.hasOwnProperty(Tt)&&ae!==void 0&&!f.hasOwnProperty(Tt)&&kh(a,s,Tt,void 0,f,ae);for(fe in f)ae=f[fe],oe=l[fe],!f.hasOwnProperty(fe)||ae===oe||ae===void 0&&oe===void 0||kh(a,s,fe,ae,f,oe);return}}for(var ee in l)ae=l[ee],l.hasOwnProperty(ee)&&ae!=null&&!f.hasOwnProperty(ee)&&Mt(a,s,ee,null,f,ae);for(ge in f)ae=f[ge],oe=l[ge],!f.hasOwnProperty(ge)||ae===oe||ae==null&&oe==null||Mt(a,s,ge,ae,f,oe)}function X1(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function PC(){if(typeof performance.getEntriesByType=="function"){for(var a=0,s=0,l=performance.getEntriesByType("resource"),f=0;f<l.length;f++){var v=l[f],b=v.transferSize,E=v.initiatorType,U=v.duration;if(b&&U&&X1(E)){for(E=0,U=v.responseEnd,f+=1;f<l.length;f++){var Y=l[f],ne=Y.startTime;if(ne>U)break;var fe=Y.transferSize,ge=Y.initiatorType;fe&&X1(ge)&&(Y=Y.responseEnd,E+=fe*(Y<U?1:(U-ne)/(Y-ne)))}if(--f,s+=8*(b+E)/(v.duration/1e3),a++,10<a)break}}if(0<a)return s/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Mh=null,Th=null;function cu(a){return a.nodeType===9?a:a.ownerDocument}function Q1(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Z1(a,s){if(a===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&s==="foreignObject"?0:a}function Rh(a,s){return a==="textarea"||a==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Ah=null;function $C(){var a=window.event;return a&&a.type==="popstate"?a===Ah?!1:(Ah=a,!0):(Ah=null,!1)}var J1=typeof setTimeout=="function"?setTimeout:void 0,qC=typeof clearTimeout=="function"?clearTimeout:void 0,W1=typeof Promise=="function"?Promise:void 0,VC=typeof queueMicrotask=="function"?queueMicrotask:typeof W1!="undefined"?function(a){return W1.resolve(null).then(a).catch(GC)}:J1;function GC(a){setTimeout(function(){throw a})}function Wi(a){return a==="head"}function e0(a,s){var l=s,f=0;do{var v=l.nextSibling;if(a.removeChild(l),v&&v.nodeType===8)if(l=v.data,l==="/$"||l==="/&"){if(f===0){a.removeChild(v),el(s);return}f--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")f++;else if(l==="html")po(a.ownerDocument.documentElement);else if(l==="head"){l=a.ownerDocument.head,po(l);for(var b=l.firstChild;b;){var E=b.nextSibling,U=b.nodeName;b[fn]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&b.rel.toLowerCase()==="stylesheet"||l.removeChild(b),b=E}}else l==="body"&&po(a.ownerDocument.body);l=v}while(l);el(s)}function t0(a,s){var l=a;a=0;do{var f=l.nextSibling;if(l.nodeType===1?s?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(s?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),f&&f.nodeType===8)if(l=f.data,l==="/$"){if(a===0)break;a--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||a++;l=f}while(l)}function Lh(a){var s=a.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var l=s;switch(s=s.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Lh(l),Gn(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}a.removeChild(l)}}function YC(a,s,l,f){for(;a.nodeType===1;){var v=l;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!f&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(f){if(!a[fn])switch(s){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(b=a.getAttribute("rel"),b==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(b!==v.rel||a.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||a.getAttribute("title")!==(v.title==null?null:v.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(b=a.getAttribute("src"),(b!==(v.src==null?null:v.src)||a.getAttribute("type")!==(v.type==null?null:v.type)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&b&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(s==="input"&&a.type==="hidden"){var b=v.name==null?null:""+v.name;if(v.type==="hidden"&&a.getAttribute("name")===b)return a}else return a;if(a=pa(a.nextSibling),a===null)break}return null}function KC(a,s,l){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!l||(a=pa(a.nextSibling),a===null))return null;return a}function n0(a,s){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!s||(a=pa(a.nextSibling),a===null))return null;return a}function Dh(a){return a.data==="$?"||a.data==="$~"}function Oh(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function XC(a,s){var l=a.ownerDocument;if(a.data==="$~")a._reactRetry=s;else if(a.data!=="$?"||l.readyState!=="loading")s();else{var f=function(){s(),l.removeEventListener("DOMContentLoaded",f)};l.addEventListener("DOMContentLoaded",f),a._reactRetry=f}}function pa(a){for(;a!=null;a=a.nextSibling){var s=a.nodeType;if(s===1||s===3)break;if(s===8){if(s=a.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return a}var zh=null;function a0(a){a=a.nextSibling;for(var s=0;a;){if(a.nodeType===8){var l=a.data;if(l==="/$"||l==="/&"){if(s===0)return pa(a.nextSibling);s--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||s++}a=a.nextSibling}return null}function i0(a){a=a.previousSibling;for(var s=0;a;){if(a.nodeType===8){var l=a.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(s===0)return a;s--}else l!=="/$"&&l!=="/&"||s++}a=a.previousSibling}return null}function s0(a,s,l){switch(s=cu(l),a){case"html":if(a=s.documentElement,!a)throw Error(i(452));return a;case"head":if(a=s.head,!a)throw Error(i(453));return a;case"body":if(a=s.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function po(a){for(var s=a.attributes;s.length;)a.removeAttributeNode(s[0]);Gn(a)}var ga=new Map,r0=new Set;function uu(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var _i=Q.d;Q.d={f:QC,r:ZC,D:JC,C:WC,L:ej,m:tj,X:aj,S:nj,M:ij};function QC(){var a=_i.f(),s=tu();return a||s}function ZC(a){var s=he(a);s!==null&&s.tag===5&&s.type==="form"?wv(s):_i.r(a)}var Zr=typeof document=="undefined"?null:document;function l0(a,s,l){var f=Zr;if(f&&typeof s=="string"&&s){var v=oa(s);v='link[rel="'+a+'"][href="'+v+'"]',typeof l=="string"&&(v+='[crossorigin="'+l+'"]'),r0.has(v)||(r0.add(v),a={rel:a,crossOrigin:l,href:s},f.querySelector(v)===null&&(s=f.createElement("link"),gn(s,"link",a),Ae(s),f.head.appendChild(s)))}}function JC(a){_i.D(a),l0("dns-prefetch",a,null)}function WC(a,s){_i.C(a,s),l0("preconnect",a,s)}function ej(a,s,l){_i.L(a,s,l);var f=Zr;if(f&&a&&s){var v='link[rel="preload"][as="'+oa(s)+'"]';s==="image"&&l&&l.imageSrcSet?(v+='[imagesrcset="'+oa(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(v+='[imagesizes="'+oa(l.imageSizes)+'"]')):v+='[href="'+oa(a)+'"]';var b=v;switch(s){case"style":b=Jr(a);break;case"script":b=Wr(a)}ga.has(b)||(a=p({rel:"preload",href:s==="image"&&l&&l.imageSrcSet?void 0:a,as:s},l),ga.set(b,a),f.querySelector(v)!==null||s==="style"&&f.querySelector(go(b))||s==="script"&&f.querySelector(yo(b))||(s=f.createElement("link"),gn(s,"link",a),Ae(s),f.head.appendChild(s)))}}function tj(a,s){_i.m(a,s);var l=Zr;if(l&&a){var f=s&&typeof s.as=="string"?s.as:"script",v='link[rel="modulepreload"][as="'+oa(f)+'"][href="'+oa(a)+'"]',b=v;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Wr(a)}if(!ga.has(b)&&(a=p({rel:"modulepreload",href:a},s),ga.set(b,a),l.querySelector(v)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(yo(b)))return}f=l.createElement("link"),gn(f,"link",a),Ae(f),l.head.appendChild(f)}}}function nj(a,s,l){_i.S(a,s,l);var f=Zr;if(f&&a){var v=ze(f).hoistableStyles,b=Jr(a);s=s||"default";var E=v.get(b);if(!E){var U={loading:0,preload:null};if(E=f.querySelector(go(b)))U.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":s},l),(l=ga.get(b))&&Ih(a,l);var Y=E=f.createElement("link");Ae(Y),gn(Y,"link",a),Y._p=new Promise(function(ne,fe){Y.onload=ne,Y.onerror=fe}),Y.addEventListener("load",function(){U.loading|=1}),Y.addEventListener("error",function(){U.loading|=2}),U.loading|=4,du(E,s,f)}E={type:"stylesheet",instance:E,count:1,state:U},v.set(b,E)}}}function aj(a,s){_i.X(a,s);var l=Zr;if(l&&a){var f=ze(l).hoistableScripts,v=Wr(a),b=f.get(v);b||(b=l.querySelector(yo(v)),b||(a=p({src:a,async:!0},s),(s=ga.get(v))&&Bh(a,s),b=l.createElement("script"),Ae(b),gn(b,"link",a),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},f.set(v,b))}}function ij(a,s){_i.M(a,s);var l=Zr;if(l&&a){var f=ze(l).hoistableScripts,v=Wr(a),b=f.get(v);b||(b=l.querySelector(yo(v)),b||(a=p({src:a,async:!0,type:"module"},s),(s=ga.get(v))&&Bh(a,s),b=l.createElement("script"),Ae(b),gn(b,"link",a),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},f.set(v,b))}}function o0(a,s,l,f){var v=(v=xe.current)?uu(v):null;if(!v)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(s=Jr(l.href),l=ze(v).hoistableStyles,f=l.get(s),f||(f={type:"style",instance:null,count:0,state:null},l.set(s,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){a=Jr(l.href);var b=ze(v).hoistableStyles,E=b.get(a);if(E||(v=v.ownerDocument||v,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(a,E),(b=v.querySelector(go(a)))&&!b._p&&(E.instance=b,E.state.loading=5),ga.has(a)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ga.set(a,l),b||sj(v,a,l,E.state))),s&&f===null)throw Error(i(528,""));return E}if(s&&f!==null)throw Error(i(529,""));return null;case"script":return s=l.async,l=l.src,typeof l=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Wr(l),l=ze(v).hoistableScripts,f=l.get(s),f||(f={type:"script",instance:null,count:0,state:null},l.set(s,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function Jr(a){return'href="'+oa(a)+'"'}function go(a){return'link[rel="stylesheet"]['+a+"]"}function c0(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function sj(a,s,l,f){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?f.loading=1:(s=a.createElement("link"),f.preload=s,s.addEventListener("load",function(){return f.loading|=1}),s.addEventListener("error",function(){return f.loading|=2}),gn(s,"link",l),Ae(s),a.head.appendChild(s))}function Wr(a){return'[src="'+oa(a)+'"]'}function yo(a){return"script[async]"+a}function u0(a,s,l){if(s.count++,s.instance===null)switch(s.type){case"style":var f=a.querySelector('style[data-href~="'+oa(l.href)+'"]');if(f)return s.instance=f,Ae(f),f;var v=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return f=(a.ownerDocument||a).createElement("style"),Ae(f),gn(f,"style",v),du(f,l.precedence,a),s.instance=f;case"stylesheet":v=Jr(l.href);var b=a.querySelector(go(v));if(b)return s.state.loading|=4,s.instance=b,Ae(b),b;f=c0(l),(v=ga.get(v))&&Ih(f,v),b=(a.ownerDocument||a).createElement("link"),Ae(b);var E=b;return E._p=new Promise(function(U,Y){E.onload=U,E.onerror=Y}),gn(b,"link",f),s.state.loading|=4,du(b,l.precedence,a),s.instance=b;case"script":return b=Wr(l.src),(v=a.querySelector(yo(b)))?(s.instance=v,Ae(v),v):(f=l,(v=ga.get(b))&&(f=p({},l),Bh(f,v)),a=a.ownerDocument||a,v=a.createElement("script"),Ae(v),gn(v,"link",f),a.head.appendChild(v),s.instance=v);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(f=s.instance,s.state.loading|=4,du(f,l.precedence,a));return s.instance}function du(a,s,l){for(var f=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=f.length?f[f.length-1]:null,b=v,E=0;E<f.length;E++){var U=f[E];if(U.dataset.precedence===s)b=U;else if(b!==v)break}b?b.parentNode.insertBefore(a,b.nextSibling):(s=l.nodeType===9?l.head:l,s.insertBefore(a,s.firstChild))}function Ih(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function Bh(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var fu=null;function d0(a,s,l){if(fu===null){var f=new Map,v=fu=new Map;v.set(l,f)}else v=fu,f=v.get(l),f||(f=new Map,v.set(l,f));if(f.has(a))return f;for(f.set(a,null),l=l.getElementsByTagName(a),v=0;v<l.length;v++){var b=l[v];if(!(b[fn]||b[le]||a==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var E=b.getAttribute(s)||"";E=a+E;var U=f.get(E);U?U.push(b):f.set(E,[b])}}return f}function f0(a,s,l){a=a.ownerDocument||a,a.head.insertBefore(l,s==="title"?a.querySelector("head > title"):null)}function rj(a,s,l){if(l===1||s.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return a=s.disabled,typeof s.precedence=="string"&&a==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function h0(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function lj(a,s,l,f){if(l.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var v=Jr(f.href),b=s.querySelector(go(v));if(b){s=b._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(a.count++,a=hu.bind(a),s.then(a,a)),l.state.loading|=4,l.instance=b,Ae(b);return}b=s.ownerDocument||s,f=c0(f),(v=ga.get(v))&&Ih(f,v),b=b.createElement("link"),Ae(b);var E=b;E._p=new Promise(function(U,Y){E.onload=U,E.onerror=Y}),gn(b,"link",f),l.instance=b}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(l,s),(s=l.state.preload)&&(l.state.loading&3)===0&&(a.count++,l=hu.bind(a),s.addEventListener("load",l),s.addEventListener("error",l))}}var Uh=0;function oj(a,s){return a.stylesheets&&a.count===0&&pu(a,a.stylesheets),0<a.count||0<a.imgCount?function(l){var f=setTimeout(function(){if(a.stylesheets&&pu(a,a.stylesheets),a.unsuspend){var b=a.unsuspend;a.unsuspend=null,b()}},6e4+s);0<a.imgBytes&&Uh===0&&(Uh=62500*PC());var v=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&pu(a,a.stylesheets),a.unsuspend)){var b=a.unsuspend;a.unsuspend=null,b()}},(a.imgBytes>Uh?50:800)+s);return a.unsuspend=l,function(){a.unsuspend=null,clearTimeout(f),clearTimeout(v)}}:null}function hu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)pu(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var mu=null;function pu(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,mu=new Map,s.forEach(cj,a),mu=null,hu.call(a))}function cj(a,s){if(!(s.state.loading&4)){var l=mu.get(a);if(l)var f=l.get(null);else{l=new Map,mu.set(a,l);for(var v=a.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<v.length;b++){var E=v[b];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(l.set(E.dataset.precedence,E),f=E)}f&&l.set(null,f)}v=s.instance,E=v.getAttribute("data-precedence"),b=l.get(E)||f,b===f&&l.set(null,v),l.set(E,v),this.count++,f=hu.bind(this),v.addEventListener("load",f),v.addEventListener("error",f),b?b.parentNode.insertBefore(v,b.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(v,a.firstChild)),s.state.loading|=4}}var vo={$$typeof:C,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function uj(a,s,l,f,v,b,E,U,Y){this.tag=1,this.containerInfo=a,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=ni(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ni(0),this.hiddenUpdates=ni(null),this.identifierPrefix=f,this.onUncaughtError=v,this.onCaughtError=b,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function m0(a,s,l,f,v,b,E,U,Y,ne,fe,ge){return a=new uj(a,s,l,E,Y,ne,fe,ge,U),s=1,b===!0&&(s|=24),b=Kn(3,null,null,s),a.current=b,b.stateNode=a,s=vf(),s.refCount++,a.pooledCache=s,s.refCount++,b.memoizedState={element:f,isDehydrated:l,cache:s},Sf(b),a}function p0(a){return a?(a=Tr,a):Tr}function g0(a,s,l,f,v,b){v=p0(v),f.context===null?f.context=v:f.pendingContext=v,f=Pi(s),f.payload={element:l},b=b===void 0?null:b,b!==null&&(f.callback=b),l=$i(a,f,s),l!==null&&(On(l,a,s),Xl(l,a,s))}function y0(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var l=a.retryLane;a.retryLane=l!==0&&l<s?l:s}}function Fh(a,s){y0(a,s),(a=a.alternate)&&y0(a,s)}function v0(a){if(a.tag===13||a.tag===31){var s=Ds(a,67108864);s!==null&&On(s,a,67108864),Fh(a,67108864)}}function x0(a){if(a.tag===13||a.tag===31){var s=Wn();s=Ea(s);var l=Ds(a,s);l!==null&&On(l,a,s),Fh(a,s)}}var gu=!0;function dj(a,s,l,f){var v=$.T;$.T=null;var b=Q.p;try{Q.p=2,Hh(a,s,l,f)}finally{Q.p=b,$.T=v}}function fj(a,s,l,f){var v=$.T;$.T=null;var b=Q.p;try{Q.p=8,Hh(a,s,l,f)}finally{Q.p=b,$.T=v}}function Hh(a,s,l,f){if(gu){var v=Ph(f);if(v===null)Eh(a,s,f,yu,l),_0(a,f);else if(mj(v,a,s,l,f))f.stopPropagation();else if(_0(a,f),s&4&&-1<hj.indexOf(a)){for(;v!==null;){var b=he(v);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var E=en(b.pendingLanes);if(E!==0){var U=b;for(U.pendingLanes|=2,U.entangledLanes|=2;E;){var Y=1<<31-Je(E);U.entanglements[1]|=Y,E&=~Y}Va(b),(bt&6)===0&&(Wc=Rt()+500,fo(0))}}break;case 31:case 13:U=Ds(b,2),U!==null&&On(U,b,2),tu(),Fh(b,2)}if(b=Ph(f),b===null&&Eh(a,s,f,yu,l),b===v)break;v=b}v!==null&&f.stopPropagation()}else Eh(a,s,f,null,l)}}function Ph(a){return a=$d(a),$h(a)}var yu=null;function $h(a){if(yu=null,a=J(a),a!==null){var s=c(a);if(s===null)a=null;else{var l=s.tag;if(l===13){if(a=o(s),a!==null)return a;a=null}else if(l===31){if(a=u(s),a!==null)return a;a=null}else if(l===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;a=null}else s!==a&&(a=null)}}return yu=a,null}function b0(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(za()){case ce:return 2;case de:return 8;case Oe:case nt:return 32;case Te:return 268435456;default:return 32}default:return 32}}var qh=!1,es=null,ts=null,ns=null,xo=new Map,bo=new Map,as=[],hj="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 _0(a,s){switch(a){case"focusin":case"focusout":es=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":ns=null;break;case"pointerover":case"pointerout":xo.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":bo.delete(s.pointerId)}}function _o(a,s,l,f,v,b){return a===null||a.nativeEvent!==b?(a={blockedOn:s,domEventName:l,eventSystemFlags:f,nativeEvent:b,targetContainers:[v]},s!==null&&(s=he(s),s!==null&&v0(s)),a):(a.eventSystemFlags|=f,s=a.targetContainers,v!==null&&s.indexOf(v)===-1&&s.push(v),a)}function mj(a,s,l,f,v){switch(s){case"focusin":return es=_o(es,a,s,l,f,v),!0;case"dragenter":return ts=_o(ts,a,s,l,f,v),!0;case"mouseover":return ns=_o(ns,a,s,l,f,v),!0;case"pointerover":var b=v.pointerId;return xo.set(b,_o(xo.get(b)||null,a,s,l,f,v)),!0;case"gotpointercapture":return b=v.pointerId,bo.set(b,_o(bo.get(b)||null,a,s,l,f,v)),!0}return!1}function S0(a){var s=J(a.target);if(s!==null){var l=c(s);if(l!==null){if(s=l.tag,s===13){if(s=o(l),s!==null){a.blockedOn=s,Ha(a.priority,function(){x0(l)});return}}else if(s===31){if(s=u(l),s!==null){a.blockedOn=s,Ha(a.priority,function(){x0(l)});return}}else if(s===3&&l.stateNode.current.memoizedState.isDehydrated){a.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}a.blockedOn=null}function vu(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var l=Ph(a.nativeEvent);if(l===null){l=a.nativeEvent;var f=new l.constructor(l.type,l);Pd=f,l.target.dispatchEvent(f),Pd=null}else return s=he(l),s!==null&&v0(s),a.blockedOn=l,!1;s.shift()}return!0}function w0(a,s,l){vu(a)&&l.delete(s)}function pj(){qh=!1,es!==null&&vu(es)&&(es=null),ts!==null&&vu(ts)&&(ts=null),ns!==null&&vu(ns)&&(ns=null),xo.forEach(w0),bo.forEach(w0)}function xu(a,s){a.blockedOn===s&&(a.blockedOn=null,qh||(qh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,pj)))}var bu=null;function N0(a){bu!==a&&(bu=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bu===a&&(bu=null);for(var s=0;s<a.length;s+=3){var l=a[s],f=a[s+1],v=a[s+2];if(typeof f!="function"){if($h(f||l)===null)continue;break}var b=he(l);b!==null&&(a.splice(s,3),s-=3,Pf(b,{pending:!0,data:v,method:l.method,action:f},f,v))}}))}function el(a){function s(Y){return xu(Y,a)}es!==null&&xu(es,a),ts!==null&&xu(ts,a),ns!==null&&xu(ns,a),xo.forEach(s),bo.forEach(s);for(var l=0;l<as.length;l++){var f=as[l];f.blockedOn===a&&(f.blockedOn=null)}for(;0<as.length&&(l=as[0],l.blockedOn===null);)S0(l),l.blockedOn===null&&as.shift();if(l=(a.ownerDocument||a).$$reactFormReplay,l!=null)for(f=0;f<l.length;f+=3){var v=l[f],b=l[f+1],E=v[we]||null;if(typeof b=="function")E||N0(l);else if(E){var U=null;if(b&&b.hasAttribute("formAction")){if(v=b,E=b[we]||null)U=E.formAction;else if($h(v)!==null)continue}else U=E.action;typeof U=="function"?l[f+1]=U:(l.splice(f,3),f-=3),N0(l)}}}function C0(){function a(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(E){return v=E})},focusReset:"manual",scroll:"manual"})}function s(){v!==null&&(v(),v=null),f||setTimeout(l,20)}function l(){if(!f&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,v=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(l,100),function(){f=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),v!==null&&(v(),v=null)}}}function Vh(a){this._internalRoot=a}_u.prototype.render=Vh.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(i(409));var l=s.current,f=Wn();g0(l,f,a,s,null,null)},_u.prototype.unmount=Vh.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;g0(a.current,2,null,a,null,null),tu(),s[De]=null}};function _u(a){this._internalRoot=a}_u.prototype.unstable_scheduleHydration=function(a){if(a){var s=ii();a={blockedOn:null,target:a,priority:s};for(var l=0;l<as.length&&s!==0&&s<as[l].priority;l++);as.splice(l,0,a),l===0&&S0(a)}};var j0=t.version;if(j0!=="19.2.4")throw Error(i(527,j0,"19.2.4"));Q.findDOMNode=function(a){var s=a._reactInternals;if(s===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=m(s),a=a!==null?g(a):null,a=a===null?null:a.stateNode,a};var gj={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var Su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Su.isDisabled&&Su.supportsFiber)try{Ie=Su.inject(gj),pt=Su}catch(a){}}return wo.createRoot=function(a,s){if(!r(a))throw Error(i(299));var l=!1,f="",v=Lv,b=Dv,E=Ov;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(b=s.onCaughtError),s.onRecoverableError!==void 0&&(E=s.onRecoverableError)),s=m0(a,1,!1,null,null,l,f,null,v,b,E,C0),a[De]=s.current,jh(a),new Vh(s)},wo.hydrateRoot=function(a,s,l){if(!r(a))throw Error(i(299));var f=!1,v="",b=Lv,E=Dv,U=Ov,Y=null;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(v=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(E=l.onCaughtError),l.onRecoverableError!==void 0&&(U=l.onRecoverableError),l.formState!==void 0&&(Y=l.formState)),s=m0(a,1,!0,s,l!=null?l:null,f,v,Y,b,E,U,C0),s.context=p0(null),l=s.current,f=Wn(),f=Ea(f),v=Pi(f),v.callback=null,$i(l,v,f),l=f,s.current.lanes=l,Ua(s,l),Va(s),a[De]=s.current,jh(a),new _u(s)},wo.version="19.2.4",wo}var O0;function kj(){if(O0)return Xh.exports;O0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Xh.exports=Ej(),Xh.exports}var Mj=kj();const Tj=Sj(Mj),Pm=new WeakMap,Rj=new WeakMap,Zu={current:[]};let Jh=!1,Bo=0;const Ao=new Set,ju=new Map;function o_(e){for(const t of e){if(Zu.current.includes(t))continue;Zu.current.push(t),t.recompute();const n=Rj.get(t);if(n)for(const i of n){const r=Pm.get(i);r!=null&&r.length&&o_(r)}}}function Aj(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Lj(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function c_(e){var t;if(Bo>0&&!ju.has(e)&&ju.set(e,e.prevState),Ao.add(e),!(Bo>0)&&!Jh)try{for(Jh=!0;Ao.size>0;){const n=Array.from(Ao);Ao.clear();for(const i of n){const r=(t=ju.get(i))!=null?t:i.prevState;i.prevState=r,Aj(i)}for(const i of n){const r=Pm.get(i);r&&(Zu.current.push(i),o_(r))}for(const i of n){const r=Pm.get(i);if(r)for(const c of r)Lj(c)}}}finally{Jh=!1,Zu.current=[],ju.clear()}}function Dj(e){Bo++;try{e()}finally{if(Bo--,Bo===0){const t=Ao.values().next().value;t&&c_(t)}}}function Oj(e){return typeof e=="function"}class zj{constructor(t,n){this.listeners=new Set,this.subscribe=i=>{var r,c;this.listeners.add(i);const o=(c=(r=this.options)==null?void 0:r.onSubscribe)==null?void 0:c.call(r,i,this);return()=>{this.listeners.delete(i),o==null||o()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,i,r;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):Oj(t)?this.state=t(this.prevState):this.state=t,(r=(i=this.options)==null?void 0:i.onUpdate)==null||r.call(i),c_(this)}}const ws="__TSR_index",z0="popstate",I0="beforeunload";function Ij(e){let t=e.getLocation();const n=new Set,i=o=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:o}))},r=o=>{var u;(u=e.notifyOnIndexChange)==null||u?i(o):t=e.getLocation()},c=m=>Ge(null,null,function*(){var g=m,{task:o,navigateOpts:u}=g,h=pe(g,["task","navigateOpts"]);var _,S,w,N;if((_=u==null?void 0:u.ignoreBlocker)!=null?_:!1){o();return}const y=(w=(S=e.getBlockers)==null?void 0:S.call(e))!=null?w:[],x=h.type==="PUSH"||h.type==="REPLACE";if(typeof document!="undefined"&&y.length&&x)for(const k of y){const C=Go(h.path,h.state);if(yield k.blockerFn({currentLocation:t,nextLocation:C,action:h.type})){(N=e.onBlocked)==null||N.call(e);return}}o()});return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,u,h)=>{const m=t.state[ws];u=B0(m+1,u),c({task:()=>{e.pushState(o,u),i({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:o,state:u})},replace:(o,u,h)=>{const m=t.state[ws];u=B0(m,u),c({task:()=>{e.replaceState(o,u),i({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:o,state:u})},go:(o,u)=>{c({task:()=>{e.go(o),r({type:"GO",index:o})},navigateOpts:u,type:"GO"})},back:o=>{c({task:()=>{var u;e.back((u=o==null?void 0:o.ignoreBlocker)!=null?u:!1),r({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{c({task:()=>{var u;e.forward((u=o==null?void 0:o.ignoreBlocker)!=null?u:!1),r({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[ws]!==0,createHref:o=>e.createHref(o),block:o=>{var h,m;if(!e.setBlockers)return()=>{};const u=(m=(h=e.getBlockers)==null?void 0:h.call(e))!=null?m:[];return e.setBlockers([...u,o]),()=>{var p,y,x;const g=(y=(p=e.getBlockers)==null?void 0:p.call(e))!=null?y:[];(x=e.setBlockers)==null||x.call(e,g.filter(_=>_!==o))}},flush:()=>{var o;return(o=e.flush)==null?void 0:o.call(e)},destroy:()=>{var o;return(o=e.destroy)==null?void 0:o.call(e)},notify:i}}function B0(e,t){t||(t={});const n=Dp();return V(R({},t),{key:n,__TSR_key:n,[ws]:e})}function u_(e){var F,D,T,B,P;const t=(F=e==null?void 0:e.window)!=null?F:typeof document!="undefined"?window:void 0,n=t.history.pushState,i=t.history.replaceState;let r=[];const c=()=>r,o=K=>r=K,u=(D=e==null?void 0:e.createHref)!=null?D:(K=>K),h=(T=e==null?void 0:e.parseLocation)!=null?T:(()=>Go(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!((B=t.history.state)!=null&&B.__TSR_key)&&!((P=t.history.state)!=null&&P.key)){const K=Dp();t.history.replaceState({[ws]:0,key:K,__TSR_key:K},"")}let m=h(),g,p=!1,y=!1,x=!1,_=!1;const S=()=>m;let w,N;const k=()=>{w&&(z._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),z._ignoreSubscribers=!1,w=void 0,N=void 0,g=void 0)},C=(K,H,q)=>{const $=u(H);N||(g=m),m=Go(H,q),w={href:$,state:q,isPush:(w==null?void 0:w.isPush)||K==="push"},N||(N=Promise.resolve().then(()=>k()))},j=K=>{m=h(),z.notify({type:K})},A=()=>Ge(null,null,function*(){if(y){y=!1;return}const K=h(),H=K.state[ws]-m.state[ws],q=H===1,$=H===-1,Q=!q&&!$||p;p=!1;const G=Q?"GO":$?"BACK":"FORWARD",W=Q?{type:"GO",index:H}:{type:$?"BACK":"FORWARD"};if(x)x=!1;else{const O=c();if(typeof document!="undefined"&&O.length){for(const se of O)if(yield se.blockerFn({currentLocation:m,nextLocation:K,action:G})){y=!0,t.history.go(1),z.notify(W);return}}}m=h(),z.notify(W)}),L=K=>{var $;if(_){_=!1;return}let H=!1;const q=c();if(typeof document!="undefined"&&q.length)for(const Q of q){const G=($=Q.enableBeforeUnload)!=null?$:!0;if(G===!0){H=!0;break}if(typeof G=="function"&&G()===!0){H=!0;break}}if(H)return K.preventDefault(),K.returnValue=""},z=Ij({getLocation:S,getLength:()=>t.history.length,pushState:(K,H)=>C("push",K,H),replaceState:(K,H)=>C("replace",K,H),back:K=>(K&&(x=!0),_=!0,t.history.back()),forward:K=>{K&&(x=!0),_=!0,t.history.forward()},go:K=>{p=!0,t.history.go(K)},createHref:K=>u(K),flush:k,destroy:()=>{t.history.pushState=n,t.history.replaceState=i,t.removeEventListener(I0,L,{capture:!0}),t.removeEventListener(z0,A)},onBlocked:()=>{g&&m!==g&&(m=g)},getBlockers:c,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(I0,L,{capture:!0}),t.addEventListener(z0,A),t.history.pushState=function(...K){const H=n.apply(t.history,K);return z._ignoreSubscribers||j("PUSH"),H},t.history.replaceState=function(...K){const H=i.apply(t.history,K);return z._ignoreSubscribers||j("REPLACE"),H},z}function Bj(e){const t=typeof document!="undefined"?window:void 0;return u_({window:t,parseLocation:()=>{var h;const n=t.location.hash.split("#").slice(1),i=(h=n[0])!=null?h:"/",r=t.location.search,c=n.slice(1),o=c.length===0?"":`#${c.join("#")}`,u=`${i}${r}${o}`;return Go(u,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function Uj(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Go(e,t){const n=Uj(e),i=n.indexOf("#"),r=n.indexOf("?"),c=Dp();return{href:n,pathname:n.substring(0,i>0?r>0?Math.min(i,r):i:r>0?r:n.length),hash:i>-1?n.substring(i):"",search:r>-1?n.slice(r,i===-1?void 0:i):"",state:t||{[ws]:0,key:c,__TSR_key:c}}}function Dp(){return(Math.random()+1).toString(36).substring(7)}const Wh=!1;function Uo(e){let t;return Dj(()=>{t=e()}),t}function Yo(e){return e[e.length-1]}function Fj(e){return typeof e=="function"}function bs(e,t){return Fj(e)?e(t):e}const Hj=Object.prototype.hasOwnProperty,U0=Object.prototype.propertyIsEnumerable;function ta(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=t,r=P0(e)&&P0(i);if(!r&&!(Ju(e)&&Ju(i)))return i;const c=r?e:F0(e);if(!c)return i;const o=r?i:F0(i);if(!o)return i;const u=c.length,h=o.length,m=r?new Array(h):{};let g=0;for(let p=0;p<h;p++){const y=r?p:o[p],x=e[y],_=i[y];if(x===_){m[y]=x,(r?p<u:Hj.call(e,y))&&g++;continue}if(x===null||_===null||typeof x!="object"||typeof _!="object"){m[y]=_;continue}const S=ta(x,_,n+1);m[y]=S,S===x&&g++}return u===h&&g===u?e:m}function F0(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!U0.call(e,r))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const i=t;for(const r of n){if(!U0.call(e,r))return!1;i.push(r)}return i}function Ju(e){if(!H0(e))return!1;const t=e.constructor;if(typeof t=="undefined")return!0;const n=t.prototype;return!(!H0(n)||!n.hasOwnProperty("isPrototypeOf"))}function H0(e){return Object.prototype.toString.call(e)==="[object Object]"}function P0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cr(e,t,n){var i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,c=e.length;r<c;r++)if(!cr(e[r],t[r],n))return!1;return!0}if(Ju(e)&&Ju(t)){const r=(i=n==null?void 0:n.ignoreUndefined)!=null?i:!0;if(n!=null&&n.partial){for(const u in t)if((!r||t[u]!==void 0)&&!cr(e[u],t[u],n))return!1;return!0}let c=0;if(!r)c=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&c++;let o=0;for(const u in t)if((!r||t[u]!==void 0)&&(o++,o>c||!cr(e[u],t[u],n)))return!1;return c===o}return!1}function bl(e){let t,n;const i=new Promise((r,c)=>{t=r,n=c});return i.status="pending",i.resolve=r=>{i.status="resolved",i.value=r,t(r),e==null||e(r)},i.reject=r=>{i.status="rejected",n(r)},i}function rl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Pj(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function $0(e){let t;try{t=decodeURI(e)}catch(n){t=e.replaceAll(/%[0-9A-F]{2}/gi,i=>{try{return decodeURI(i)}catch(r){return i}})}return Pj(t)}const d_=["http:","https:","mailto:","tel:"];function Wu(e){if(!e)return!1;try{const t=new URL(e);return!d_.includes(t.protocol)}catch(t){return!1}}function No(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,i="",r;for(;(r=t.exec(e))!==null;)i+=$0(e.slice(n,r.index))+r[0],n=t.lastIndex;i=i+$0(n?e.slice(n):e);let c=!1;return i.startsWith("//")&&(c=!0,i="/"+i.replace(/^\/+/,"")),{path:i,handledProtocolRelativeURL:c}}function $j(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var qj="Invariant failed";function Ri(e,t){if(!e)throw new Error(qj)}function ed(e){const t=new Map;let n,i;const r=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,i&&(i.next=c,c.prev=i)):(c.next.prev=void 0,n=c.next,c.next=void 0,i&&(c.prev=i,i.next=c)),i=c)};return{get(c){const o=t.get(c);if(o)return r(o),o.value},set(c,o){if(t.size>=e&&n){const h=n;t.delete(h.key),h.next&&(n=h.next,h.next.prev=void 0),h===i&&(i=void 0)}const u=t.get(c);if(u)u.value=o,r(u);else{const h={key:c,value:o,prev:i};i&&(i.next=h),i=h,n||(n=h),t.set(c,h)}},clear(){t.clear(),n=void 0,i=void 0}}}const _l=0,hr=1,mr=2,Ko=3,Zs=4,f_=5;function Vj(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Op(e,t,n=new Uint16Array(6)){const i=e.indexOf("/",t),r=i===-1?e.length:i,c=e.substring(t,r);if(!c||!c.includes("$"))return n[0]=_l,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n;if(c==="$"){const u=e.length;return n[0]=mr,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,n}if(c.charCodeAt(0)===36)return n[0]=hr,n[1]=t,n[2]=t+1,n[3]=r,n[4]=r,n[5]=r,n;const o=Vj(c);if(o){const[u,h]=o,m=c.charCodeAt(u+1);if(m===45){if(u+2<c.length&&c.charCodeAt(u+2)===36){const g=u+3,p=h;if(g<p)return n[0]=Ko,n[1]=t+u,n[2]=t+g,n[3]=t+p,n[4]=t+h+1,n[5]=r,n}}else if(m===36){const g=u+1,p=u+2;return p===h?(n[0]=mr,n[1]=t+u,n[2]=t+g,n[3]=t+p,n[4]=t+h+1,n[5]=e.length,n):(n[0]=hr,n[1]=t+u,n[2]=t+p,n[3]=t+h,n[4]=t+h+1,n[5]=r,n)}}return n[0]=_l,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}function pd(e,t,n,i,r,c,o){var h,m,g,p,y,x,_,S,w,N,k,C,j,A,L,z,F,D,T,B,P,K,H,q,$,Q,G,W,O,se,ue;o==null||o(n);let u=i;{const I=(h=n.fullPath)!=null?h:n.from,ie=I.length,ye=(g=(m=n.options)==null?void 0:m.caseSensitive)!=null?g:e,xe=!!((y=(p=n.options)==null?void 0:p.params)!=null&&y.parse&&((_=(x=n.options)==null?void 0:x.skipRouteOnParseError)!=null&&_.params));for(;u<ie;){const Se=Op(I,u,t);let Pe;const vt=u,mt=Se[5];switch(u=mt+1,c++,Se[0]){case _l:{const rt=I.substring(Se[2],Se[3]);if(ye){const $e=(S=r.static)==null?void 0:S.get(rt);if($e)Pe=$e;else{(w=r.static)!=null||(r.static=new Map);const Ue=Js((N=n.fullPath)!=null?N:n.from);Ue.parent=r,Ue.depth=c,Pe=Ue,r.static.set(rt,Ue)}}else{const $e=rt.toLowerCase(),Ue=(k=r.staticInsensitive)==null?void 0:k.get($e);if(Ue)Pe=Ue;else{(C=r.staticInsensitive)!=null||(r.staticInsensitive=new Map);const xt=Js((j=n.fullPath)!=null?j:n.from);xt.parent=r,xt.depth=c,Pe=xt,r.staticInsensitive.set($e,xt)}}break}case hr:{const rt=I.substring(vt,Se[1]),$e=I.substring(Se[4],mt),Ue=ye&&!!(rt||$e),xt=rt?Ue?rt:rt.toLowerCase():void 0,ke=$e?Ue?$e:$e.toLowerCase():void 0,ft=!xe&&((A=r.dynamic)==null?void 0:A.find(Me=>!Me.skipOnParamError&&Me.caseSensitive===Ue&&Me.prefix===xt&&Me.suffix===ke));if(ft)Pe=ft;else{const Me=tm(hr,(L=n.fullPath)!=null?L:n.from,Ue,xt,ke);Pe=Me,Me.depth=c,Me.parent=r,(z=r.dynamic)!=null||(r.dynamic=[]),r.dynamic.push(Me)}break}case Ko:{const rt=I.substring(vt,Se[1]),$e=I.substring(Se[4],mt),Ue=ye&&!!(rt||$e),xt=rt?Ue?rt:rt.toLowerCase():void 0,ke=$e?Ue?$e:$e.toLowerCase():void 0,ft=!xe&&((F=r.optional)==null?void 0:F.find(Me=>!Me.skipOnParamError&&Me.caseSensitive===Ue&&Me.prefix===xt&&Me.suffix===ke));if(ft)Pe=ft;else{const Me=tm(Ko,(D=n.fullPath)!=null?D:n.from,Ue,xt,ke);Pe=Me,Me.parent=r,Me.depth=c,(T=r.optional)!=null||(r.optional=[]),r.optional.push(Me)}break}case mr:{const rt=I.substring(vt,Se[1]),$e=I.substring(Se[4],mt),Ue=ye&&!!(rt||$e),xt=rt?Ue?rt:rt.toLowerCase():void 0,ke=$e?Ue?$e:$e.toLowerCase():void 0,ft=tm(mr,(B=n.fullPath)!=null?B:n.from,Ue,xt,ke);Pe=ft,ft.parent=r,ft.depth=c,(P=r.wildcard)!=null||(r.wildcard=[]),r.wildcard.push(ft)}}r=Pe}if(xe&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const Se=Js((K=n.fullPath)!=null?K:n.from);Se.kind=f_,Se.parent=r,c++,Se.depth=c,(H=r.pathless)!=null||(r.pathless=[]),r.pathless.push(Se),r=Se}const Ce=(n.path||!n.children)&&!n.isRoot;if(Ce&&I.endsWith("/")){const Se=Js((q=n.fullPath)!=null?q:n.from);Se.kind=Zs,Se.parent=r,c++,Se.depth=c,r.index=Se,r=Se}r.parse=(G=(Q=($=n.options)==null?void 0:$.params)==null?void 0:Q.parse)!=null?G:null,r.skipOnParamError=xe,r.parsingPriority=(se=(O=(W=n.options)==null?void 0:W.skipRouteOnParseError)==null?void 0:O.priority)!=null?se:0,Ce&&!r.route&&(r.route=n,r.fullPath=(ue=n.fullPath)!=null?ue:n.from)}if(n.children)for(const I of n.children)pd(e,t,I,u,r,c,o)}function em(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;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 us(e){var t,n,i;if(e.pathless)for(const r of e.pathless)us(r);if(e.static)for(const r of e.static.values())us(r);if(e.staticInsensitive)for(const r of e.staticInsensitive.values())us(r);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(em);for(const r of e.dynamic)us(r)}if((n=e.optional)!=null&&n.length){e.optional.sort(em);for(const r of e.optional)us(r)}if((i=e.wildcard)!=null&&i.length){e.wildcard.sort(em);for(const r of e.wildcard)us(r)}}function Js(e){return{kind:_l,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function tm(e,t,n,i,r){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:i,suffix:r}}function Gj(e,t){const n=Js("/"),i=new Uint16Array(6);for(const r of e)pd(!1,i,r,1,n,0);us(n),t.masksTree=n,t.flatCache=ed(1e3)}function Yj(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const i=zp(e,t.masksTree);return t.flatCache.set(e,i),i}function Kj(e,t,n,i,r){e||(e="/"),i||(i="/");const c=t?`case\0${e}`:e;let o=r.singleCache.get(c);if(!o){o=Js("/");const u=new Uint16Array(6);pd(t,u,{from:e},1,o,0),r.singleCache.set(c,o)}return zp(i,o,n)}function Xj(e,t,n=!1){const i=n?e:`nofuzz\0${e}`,r=t.matchCache.get(i);if(r!==void 0)return r;e||(e="/");let c;try{c=zp(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)c=null;else throw o}return c&&(c.branch=Jj(c.route)),t.matchCache.set(i,c),c}function Qj(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Zj(e,t=!1,n){const i=Js(e.fullPath),r=new Uint16Array(6),c={},o={};let u=0;return pd(t,r,e,1,i,0,m=>{if(n==null||n(m,u),Ri(!(m.id in c),`Duplicate routes found with id: ${String(m.id)}`),c[m.id]=m,u!==0&&m.path){const g=Qj(m.fullPath);(!o[g]||m.fullPath.endsWith("/"))&&(o[g]=m)}u++}),us(i),{processedTree:{segmentTree:i,singleCache:ed(1e3),matchCache:ed(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:o}}function zp(e,t,n=!1){const i=e.split("/"),r=eE(e,i,t,n);if(!r)return null;const[c]=h_(e,i,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function h_(e,t,n){var g,p,y,x,_,S,w,N,k,C,j,A,L,z,F,D,T,B,P,K;const i=Wj(n.node);let r=null;const c={};let o=(p=(g=n.extract)==null?void 0:g.part)!=null?p:0,u=(x=(y=n.extract)==null?void 0:y.node)!=null?x:0,h=(S=(_=n.extract)==null?void 0:_.path)!=null?S:0,m=(N=(w=n.extract)==null?void 0:w.segment)!=null?N:0;for(;u<i.length;o++,u++,h++,m++){const H=i[u];if(H.kind===Zs)break;if(H.kind===f_){m--,o--,h--;continue}const q=t[o],$=h;if(q&&(h+=q.length),H.kind===hr){r!=null||(r=n.node.fullPath.split("/"));const Q=r[m],G=(C=(k=H.prefix)==null?void 0:k.length)!=null?C:0;if(Q.charCodeAt(G)===123){const O=(A=(j=H.suffix)==null?void 0:j.length)!=null?A:0,se=Q.substring(G+2,Q.length-O-1),ue=q.substring(G,q.length-O);c[se]=decodeURIComponent(ue)}else{const O=Q.substring(1);c[O]=decodeURIComponent(q)}}else if(H.kind===Ko){if(n.skipped&1<<u){o--,h=$-1;continue}r!=null||(r=n.node.fullPath.split("/"));const Q=r[m],G=(z=(L=H.prefix)==null?void 0:L.length)!=null?z:0,W=(D=(F=H.suffix)==null?void 0:F.length)!=null?D:0,O=Q.substring(G+3,Q.length-W-1),se=H.suffix||H.prefix?q.substring(G,q.length-W):q;se&&(c[O]=decodeURIComponent(se))}else if(H.kind===mr){const Q=H,G=e.substring($+((B=(T=Q.prefix)==null?void 0:T.length)!=null?B:0),e.length-((K=(P=Q.suffix)==null?void 0:P.length)!=null?K:0)),W=decodeURIComponent(G);c["*"]=W,c._splat=W;break}}return n.rawParams&&Object.assign(c,n.rawParams),[c,{part:o,node:u,path:h,segment:m}]}function Jj(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Wj(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function eE(e,t,n,i){var p;if(e==="/"&&n.index)return{node:n.index,skipped:0};const r=!Yo(t),c=r&&e!=="/",o=t.length-(r?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,m=null,g=null;for(;u.length;){const y=u.pop(),{node:x,index:_,skipped:S,depth:w,statics:N,dynamics:k,optionals:C}=y;let{extract:j,rawParams:A,parsedParams:L}=y;if(x.skipOnParamError){if(!nm(e,t,y))continue;A=y.rawParams,j=y.extract,L=y.parsedParams}i&&x.route&&x.kind!==Zs&&Co(m,y)&&(m=y);const z=_===o;if(z&&(x.route&&!c&&Co(g,y)&&(g=y),!x.optional&&!x.wildcard&&!x.index&&!x.pathless))continue;const F=z?void 0:t[_];let D;if(z&&x.index){const T={node:x.index,index:_,skipped:S,depth:w+1,statics:N,dynamics:k,optionals:C,extract:j,rawParams:A,parsedParams:L};let B=!0;if(x.index.skipOnParamError&&(nm(e,t,T)||(B=!1)),B){if(N===o&&!k&&!C&&!S)return T;Co(g,T)&&(g=T)}}if(x.wildcard&&Co(h,y))for(const T of x.wildcard){const{prefix:B,suffix:P}=T;if(B&&(z||!(T.caseSensitive?F:D!=null?D:D=F.toLowerCase()).startsWith(B)))continue;if(P){if(z)continue;const H=t.slice(_).join("/").slice(-P.length);if((T.caseSensitive?H:H.toLowerCase())!==P)continue}const K={node:T,index:o,skipped:S,depth:w,statics:N,dynamics:k,optionals:C,extract:j,rawParams:A,parsedParams:L};if(!(T.skipOnParamError&&!nm(e,t,K))){h=K;break}}if(x.optional){const T=S|1<<w,B=w+1;for(let P=x.optional.length-1;P>=0;P--){const K=x.optional[P];u.push({node:K,index:_,skipped:T,depth:B,statics:N,dynamics:k,optionals:C,extract:j,rawParams:A,parsedParams:L})}if(!z)for(let P=x.optional.length-1;P>=0;P--){const K=x.optional[P],{prefix:H,suffix:q}=K;if(H||q){const $=K.caseSensitive?F:D!=null?D:D=F.toLowerCase();if(H&&!$.startsWith(H)||q&&!$.endsWith(q))continue}u.push({node:K,index:_+1,skipped:S,depth:B,statics:N,dynamics:k,optionals:C+1,extract:j,rawParams:A,parsedParams:L})}}if(!z&&x.dynamic&&F)for(let T=x.dynamic.length-1;T>=0;T--){const B=x.dynamic[T],{prefix:P,suffix:K}=B;if(P||K){const H=B.caseSensitive?F:D!=null?D:D=F.toLowerCase();if(P&&!H.startsWith(P)||K&&!H.endsWith(K))continue}u.push({node:B,index:_+1,skipped:S,depth:w+1,statics:N,dynamics:k+1,optionals:C,extract:j,rawParams:A,parsedParams:L})}if(!z&&x.staticInsensitive){const T=x.staticInsensitive.get(D!=null?D:D=F.toLowerCase());T&&u.push({node:T,index:_+1,skipped:S,depth:w+1,statics:N+1,dynamics:k,optionals:C,extract:j,rawParams:A,parsedParams:L})}if(!z&&x.static){const T=x.static.get(F);T&&u.push({node:T,index:_+1,skipped:S,depth:w+1,statics:N+1,dynamics:k,optionals:C,extract:j,rawParams:A,parsedParams:L})}if(x.pathless){const T=w+1;for(let B=x.pathless.length-1;B>=0;B--){const P=x.pathless[B];u.push({node:P,index:_,skipped:S,depth:T,statics:N,dynamics:k,optionals:C,extract:j,rawParams:A,parsedParams:L})}}}if(g&&h)return Co(h,g)?g:h;if(g)return g;if(h)return h;if(i&&m){let y=m.index;for(let _=0;_<m.index;_++)y+=t[_].length;const x=y===e.length?"/":e.slice(y);return(p=m.rawParams)!=null||(m.rawParams={}),m.rawParams["**"]=decodeURIComponent(x),m}return null}function nm(e,t,n){try{const[i,r]=h_(e,t,n);n.rawParams=i,n.extract=r;const c=n.node.parse(i);return n.parsedParams=Object.assign({},n.parsedParams,c),!0}catch(i){return null}}function Co(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===Zs)>(e.node.kind===Zs)||t.node.kind===Zs==(e.node.kind===Zs)&&t.depth>e.depth))):!0}function qu(e){return Ip(e.filter(t=>t!==void 0).join("/"))}function Ip(e){return e.replace(/\/{2,}/g,"/")}function m_(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Mi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function p_(e){return Mi(m_(e))}function td(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function tE(e,t,n){return td(e,n)===td(t,n)}function nE({base:e,to:t,trailingSlash:n="never",cache:i}){const r=t.startsWith("/"),c=!r&&t===".";let o;if(i){o=r?t:c?e:e+"\0"+t;const p=i.get(o);if(p)return p}let u;if(c)u=e.split("/");else if(r)u=t.split("/");else{for(u=e.split("/");u.length>1&&Yo(u)==="";)u.pop();const p=t.split("/");for(let y=0,x=p.length;y<x;y++){const _=p[y];_===""?y?y===x-1&&u.push(_):u=[_]:_===".."?u.pop():_==="."||u.push(_)}}u.length>1&&(Yo(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));let h,m="";for(let p=0;p<u.length;p++){p>0&&(m+="/");const y=u[p];if(!y)continue;h=Op(y,0,h);const x=h[0];if(x===_l){m+=y;continue}const _=h[5],S=y.substring(0,h[1]),w=y.substring(h[4],_),N=y.substring(h[2],h[3]);x===hr?m+=S||w?`${S}{$${N}}${w}`:`$${N}`:x===mr?m+=S||w?`${S}{$}${w}`:"$":m+=`${S}{-$${N}}${w}`}m=Ip(m);const g=m||"/";return o&&i&&i.set(o,g),g}function aE(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),n=Array.from(t.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),i=new RegExp(n,"g");return r=>r.replace(i,c=>{var o;return(o=t.get(c))!=null?o:c})}function am(e,t,n){const i=t[e];return typeof i!="string"?i:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(i)?i:i.split("/").map(r=>q0(r,n)).join("/"):q0(i,n)}function im(r){var c=r,{path:e,params:t,decoder:n}=c,i=pe(c,["path","params","decoder"]);var x,_;let o=!1;const u={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:u,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:u,isMissingParams:o};const h=e.length;let m=0,g,p="";for(;m<h;){const S=m;g=Op(e,S,g);const w=g[5];if(m=w+1,S===w)continue;const N=g[0];if(N===_l){p+="/"+e.substring(S,w);continue}if(N===mr){const k=t._splat;u._splat=k,u["*"]=k;const C=e.substring(S,g[1]),j=e.substring(g[4],w);if(!k){o=!0,(C||j)&&(p+="/"+C+j);continue}const A=am("_splat",t,n);p+="/"+C+A+j;continue}if(N===hr){const k=e.substring(g[2],g[3]);!o&&!(k in t)&&(o=!0),u[k]=t[k];const C=e.substring(S,g[1]),j=e.substring(g[4],w),A=(x=am(k,t,n))!=null?x:"undefined";p+="/"+C+A+j;continue}if(N===Ko){const k=e.substring(g[2],g[3]),C=t[k];if(C==null)continue;u[k]=C;const j=e.substring(S,g[1]),A=e.substring(g[4],w),L=(_=am(k,t,n))!=null?_:"";p+="/"+j+L+A;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:u,interpolatedPath:p||"/",isMissingParams:o}}function q0(e,t){var i;const n=encodeURIComponent(e);return(i=t==null?void 0:t(n))!=null?i:n}function na(e){return!!(e!=null&&e.isNotFound)}function iE(){try{if(typeof window!="undefined"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch(e){}}const $m="tsr-scroll-restoration-v1_3",sE=(e,t)=>{let n;return(...i)=>{n||(n=setTimeout(()=>{e(...i),n=null},t))}};function rE(){const e=iE();if(!e)return null;const t=e.getItem($m);let n=t?JSON.parse(t):{};return{state:n,set:i=>{n=bs(i,n)||n;try{e.setItem($m,JSON.stringify(n))}catch(r){console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Eu=rE(),lE=e=>e.state.__TSR_key||e.href;function oE(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let nd=!1;function cE({storageKey:e,key:t,behavior:n,shouldScrollRestoration:i,scrollToTopSelectors:r,location:c}){var m,g,p;let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(y){console.error(y);return}const u=t||((m=window.history.state)==null?void 0:m.__TSR_key),h=o[u];nd=!0;e:{if(i&&h&&Object.keys(h).length>0){for(const _ in h){const S=h[_];if(_==="window")window.scrollTo({top:S.scrollY,left:S.scrollX,behavior:n});else if(_){const w=document.querySelector(_);w&&(w.scrollLeft=S.scrollX,w.scrollTop=S.scrollY)}}break e}const y=(c!=null?c:window.location).hash.split("#",2)[1];if(y){const _=(p=(g=window.history.state)==null?void 0:g.__hashScrollIntoViewOptions)!=null?p:!0;if(_){const S=document.getElementById(y);S&&S.scrollIntoView(_)}break e}const x={top:0,left:0,behavior:n};if(window.scrollTo(x),r)for(const _ of r){if(_==="window")continue;const S=typeof _=="function"?_():document.querySelector(_);S&&S.scrollTo(x)}}nd=!1}function uE(e,t){var c;if(!Eu||(((c=e.options.scrollRestoration)!=null?c:!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Eu))return;e.isScrollRestorationSetup=!0,nd=!1;const i=e.options.getScrollRestorationKey||lE;window.history.scrollRestoration="manual";const r=o=>{if(nd||!e.isScrollRestoring)return;let u="";if(o.target===document||o.target===window)u="window";else{const m=o.target.getAttribute("data-scroll-restoration-id");m?u=`[data-scroll-restoration-id="${m}"]`:u=oE(o.target)}const h=i(e.state.location);Eu.set(m=>{const g=m[h]||(m[h]={}),p=g[u]||(g[u]={});if(u==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(u){const y=document.querySelector(u);y&&(p.scrollX=y.scrollLeft||0,p.scrollY=y.scrollTop||0)}return m})};typeof document!="undefined"&&document.addEventListener("scroll",sE(r,100),!0),e.subscribe("onRendered",o=>{const u=i(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(cE({storageKey:$m,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Eu.set(h=>(h[u]||(h[u]={}),h)))})}function dE(e){var t;if(typeof document!="undefined"&&document.querySelector){const n=(t=e.state.location.state.__hashScrollIntoViewOptions)!=null?t:!0;if(n&&e.state.location.hash!==""){const i=document.getElementById(e.state.location.hash);i&&i.scrollIntoView(n)}}}function fE(e,t=String){const n=new URLSearchParams;for(const i in e){const r=e[i];r!==void 0&&n.set(i,t(r))}return n.toString()}function sm(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function hE(e){const t=new URLSearchParams(e),n={};for(const[i,r]of t.entries()){const c=n[i];c==null?n[i]=sm(r):Array.isArray(c)?c.push(sm(r)):n[i]=[c,sm(r)]}return n}const mE=gE(JSON.parse),pE=yE(JSON.stringify,JSON.parse);function gE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=hE(t);for(const i in n){const r=n[i];if(typeof r=="string")try{n[i]=e(r)}catch(c){}}return n}}function yE(e,t){const n=typeof t=="function";function i(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch(c){}else if(n&&typeof r=="string")try{return t(r),e(r)}catch(c){}return r}return r=>{const c=fE(r,i);return c?`?${c}`:""}}const xa="__root__";function vE(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&Wu(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${d_.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch(i){}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 Sa(e){return e instanceof Response&&!!e.options}const Vu=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},gd=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),ll=(e,t,n=!0)=>{var c;const i=R({},(c=e.router.options.context)!=null?c:{}),r=n?t:t-1;for(let o=0;o<=r;o++){const u=e.matches[o];if(!u)continue;const h=e.router.getMatch(u.id);h&&Object.assign(i,h.__routeContext,h.__beforeLoadContext)}return i},g_=(e,t)=>{var r,c,o;const n=(c=e.router.routesById[(r=t.routeId)!=null?r:""])!=null?c:e.router.routeTree;!n.options.notFoundComponent&&((o=e.router.options)!=null&&o.defaultNotFoundComponent)&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),Ri(n.options.notFoundComponent);const i=e.matches.find(u=>u.routeId===n.id);Ri(i,"Could not find match for route: "+n.id),e.updateMatch(i.id,u=>V(R({},u),{status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,g_(e,t))},_s=(e,t,n)=>{var i,r,c;if(!(!Sa(n)&&!na(n))){if(Sa(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){(i=t._nonReactive.beforeLoadPromise)==null||i.resolve(),(r=t._nonReactive.loaderPromise)==null||r.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const o=Sa(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,u=>V(R({},u),{status:o,context:ll(e,t.index),isFetching:!1,error:n})),na(n)&&!n.routeId&&(n.routeId=t.routeId),(c=t._nonReactive.loadPromise)==null||c.resolve()}throw Sa(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(g_(e,n),n)}},y_=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,jo=(e,t,n,i)=>{var u,h,m;const{id:r,routeId:c}=e.matches[t],o=e.router.looseRoutesById[c];if(n instanceof Promise)throw n;n.routerCode=i,(u=e.firstBadMatchIndex)!=null||(e.firstBadMatchIndex=t),_s(e,e.router.getMatch(r),n);try{(m=(h=o.options).onError)==null||m.call(h,n)}catch(g){n=g,_s(e,e.router.getMatch(r),n)}e.updateMatch(r,g=>{var p,y;return(p=g._nonReactive.beforeLoadPromise)==null||p.resolve(),g._nonReactive.beforeLoadPromise=void 0,(y=g._nonReactive.loadPromise)==null||y.resolve(),V(R({},g),{error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})})},v_=(e,t,n,i)=>{var o,u,h;if(i._nonReactive.pendingTimeout!==void 0)return;const r=(o=n.options.pendingMs)!=null?o:e.router.options.defaultPendingMs;if(!!(e.onReady&&!gd(e,t)&&(n.options.loader||n.options.beforeLoad||__(n))&&typeof r=="number"&&r!==1/0&&((h=n.options.pendingComponent)!=null?h:(u=e.router.options)!=null&&u.defaultPendingComponent))){const m=setTimeout(()=>{Vu(e)},r);i._nonReactive.pendingTimeout=m}},xE=(e,t,n)=>{const i=e.router.getMatch(t);if(!i._nonReactive.beforeLoadPromise&&!i._nonReactive.loaderPromise)return;v_(e,t,n,i);const r=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&_s(e,c,c.error)};return i._nonReactive.beforeLoadPromise?i._nonReactive.beforeLoadPromise.then(r):r()},bE=(e,t,n,i)=>{const r=e.router.getMatch(t),c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=bl(()=>{c==null||c.resolve()});const{paramsError:o,searchError:u}=r;o&&jo(e,n,o,"PARSE_PARAMS"),u&&jo(e,n,u,"VALIDATE_SEARCH"),v_(e,t,i,r);const h=new AbortController;let m=!1;const g=()=>{m||(m=!0,e.updateMatch(t,j=>V(R({},j),{isFetching:"beforeLoad",fetchCount:j.fetchCount+1,abortController:h})))},p=()=>{var j;(j=r._nonReactive.beforeLoadPromise)==null||j.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>V(R({},A),{isFetching:!1}))};if(!i.options.beforeLoad){Uo(()=>{g(),p()});return}r._nonReactive.beforeLoadPromise=bl();const y=R(R({},ll(e,n,!1)),r.__routeContext),{search:x,params:_,cause:S}=r,w=gd(e,t),N=R({search:x,abortController:h,params:_,preload:w,context:y,location:e.location,navigate:j=>e.router.navigate(V(R({},j),{_fromLocation:e.location})),buildLocation:e.router.buildLocation,cause:w?"preload":S,matches:e.matches,routeId:i.id},e.router.options.additionalContext),k=j=>{if(j===void 0){Uo(()=>{g(),p()});return}(Sa(j)||na(j))&&(g(),jo(e,n,j,"BEFORE_LOAD")),Uo(()=>{g(),e.updateMatch(t,A=>V(R({},A),{__beforeLoadContext:j})),p()})};let C;try{if(C=i.options.beforeLoad(N),rl(C))return g(),C.catch(j=>{jo(e,n,j,"BEFORE_LOAD")}).then(k)}catch(j){g(),jo(e,n,j,"BEFORE_LOAD")}k(C)},_E=(e,t)=>{const{id:n,routeId:i}=e.matches[t],r=e.router.looseRoutesById[i],c=()=>u(),o=()=>bE(e,n,t,r),u=()=>{if(y_(e,n))return;const h=xE(e,n,r);return rl(h)?h.then(o):o()};return c()},SE=(e,t,n)=>{var c,o,u,h,m,g;const i=e.router.getMatch(t);if(!i||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:i,params:i.params,loaderData:i.loaderData};return Promise.all([(o=(c=n.options).head)==null?void 0:o.call(c,r),(h=(u=n.options).scripts)==null?void 0:h.call(u,r),(g=(m=n.options).headers)==null?void 0:g.call(m,r)]).then(([p,y,x])=>{const _=p==null?void 0:p.meta,S=p==null?void 0:p.links,w=p==null?void 0:p.scripts,N=p==null?void 0:p.styles;return{meta:_,links:S,headScripts:w,headers:x,scripts:y,styles:N}})},x_=(e,t,n,i)=>{const r=e.matchPromises[n-1],{params:c,loaderDeps:o,abortController:u,cause:h}=e.router.getMatch(t),m=ll(e,n),g=gd(e,t);return R({params:c,deps:o,preload:!!g,parentMatchPromise:r,abortController:u,context:m,location:e.location,navigate:p=>e.router.navigate(V(R({},p),{_fromLocation:e.location})),cause:g?"preload":h,route:i},e.router.options.additionalContext)},V0=(e,t,n,i)=>Ge(null,null,function*(){var r,c,o,u,h,m,g;try{const p=e.router.getMatch(t);try{(!(Wh!=null?Wh:e.router.isServer)||p.ssr===!0)&&b_(i);const y=(c=(r=i.options).loader)==null?void 0:c.call(r,x_(e,t,n,i)),x=i.options.loader&&rl(y);if(!!(x||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||p._nonReactive.minPendingPromise)&&e.updateMatch(t,w=>V(R({},w),{isFetching:"loader"})),i.options.loader){const w=x?yield y:y;_s(e,e.router.getMatch(t),w),w!==void 0&&e.updateMatch(t,N=>V(R({},N),{loaderData:w}))}i._lazyPromise&&(yield i._lazyPromise);const S=p._nonReactive.minPendingPromise;S&&(yield S),i._componentsPromise&&(yield i._componentsPromise),e.updateMatch(t,w=>V(R({},w),{error:void 0,context:ll(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(y){let x=y;if((x==null?void 0:x.name)==="AbortError"){if(p.abortController.signal.aborted){(o=p._nonReactive.loaderPromise)==null||o.resolve(),p._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,S=>V(R({},S),{status:S.status==="pending"?"success":S.status,isFetching:!1,context:ll(e,n)}));return}const _=p._nonReactive.minPendingPromise;_&&(yield _),na(y)&&(yield(h=(u=i.options.notFoundComponent)==null?void 0:u.preload)==null?void 0:h.call(u)),_s(e,e.router.getMatch(t),y);try{(g=(m=i.options).onError)==null||g.call(m,y)}catch(S){x=S,_s(e,e.router.getMatch(t),S)}e.updateMatch(t,S=>V(R({},S),{error:x,context:ll(e,n),status:"error",isFetching:!1}))}}catch(p){const y=e.router.getMatch(t);y&&(y._nonReactive.loaderPromise=void 0),_s(e,y,p)}}),wE=(e,t)=>Ge(null,null,function*(){var g,p;function n(y,x,_,S){return Ge(this,null,function*(){var L,z,F,D;const w=Date.now()-x.updatedAt,N=y?(z=(L=S.options.preloadStaleTime)!=null?L:e.router.options.defaultPreloadStaleTime)!=null?z:3e4:(D=(F=S.options.staleTime)!=null?F:e.router.options.defaultStaleTime)!=null?D:0,k=S.options.shouldReload,C=typeof k=="function"?k(x_(e,i,t,S)):k,{status:j,invalid:A}=_;c=j==="success"&&(A||(C!=null?C:w>N)),y&&S.options.preload===!1||(c&&!e.sync?(o=!0,Ge(null,null,function*(){var T,B;try{yield V0(e,i,t,S);const P=e.router.getMatch(i);(T=P._nonReactive.loaderPromise)==null||T.resolve(),(B=P._nonReactive.loadPromise)==null||B.resolve(),P._nonReactive.loaderPromise=void 0}catch(P){Sa(P)&&(yield e.router.navigate(P.options))}})):(j!=="success"||c&&e.sync)&&(yield V0(e,i,t,S)))})}const{id:i,routeId:r}=e.matches[t];let c=!1,o=!1;const u=e.router.looseRoutesById[r];if(!y_(e,i)){const y=e.router.getMatch(i),x=gd(e,i);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!e.sync&&!y.preload)return y;yield y._nonReactive.loaderPromise;const _=e.router.getMatch(i),S=_._nonReactive.error||_.error;S&&_s(e,_,S),_.status==="pending"&&(yield n(x,y,_,u))}else{const _=x&&!e.router.state.matches.some(w=>w.id===i),S=e.router.getMatch(i);S._nonReactive.loaderPromise=bl(),_!==S.preload&&e.updateMatch(i,w=>V(R({},w),{preload:_})),yield n(x,y,S,u)}}const h=e.router.getMatch(i);o||((g=h._nonReactive.loaderPromise)==null||g.resolve(),(p=h._nonReactive.loadPromise)==null||p.resolve()),clearTimeout(h._nonReactive.pendingTimeout),h._nonReactive.pendingTimeout=void 0,o||(h._nonReactive.loaderPromise=void 0),h._nonReactive.dehydrated=void 0;const m=o?h.isFetching:!1;return m!==h.isFetching||h.invalid!==!1?(e.updateMatch(i,y=>V(R({},y),{isFetching:m,invalid:!1})),e.router.getMatch(i)):h});function G0(e){return Ge(this,null,function*(){var n;const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(i=>i._forcePending)&&Vu(t);try{for(let h=0;h<t.matches.length;h++){const m=_E(t,h);rl(m)&&(yield m)}const i=(n=t.firstBadMatchIndex)!=null?n:t.matches.length;for(let h=0;h<i;h++)t.matchPromises.push(wE(t,h));const c=(yield Promise.allSettled(t.matchPromises)).filter(h=>h.status==="rejected").map(h=>h.reason);let o;for(const h of c){if(Sa(h))throw h;!o&&na(h)&&(o=h)}for(const h of t.matches){const{id:m,routeId:g}=h,p=t.router.looseRoutesById[g];try{const y=SE(t,m,p);if(y){const x=yield y;t.updateMatch(m,_=>R(R({},_),x))}}catch(y){console.error(`Error executing head for route ${g}:`,y)}}if(o)throw o;const u=Vu(t);rl(u)&&(yield u)}catch(i){if(na(i)&&!t.preload){const r=Vu(t);throw rl(r)&&(yield r),i}if(Sa(i))throw i}return t.matches})}function b_(e){return Ge(this,null,function*(){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const r=t.options,{id:n}=r,i=pe(r,["id"]);Object.assign(e.options,i),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{var i;const n=[];for(const r of S_){const c=(i=e.options[r])==null?void 0:i.preload;c&&n.push(c())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise})}function __(e){var t;for(const n of S_)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const S_=["component","errorComponent","pendingComponent","notFoundComponent"];function NE(e){return{input:({url:t})=>{for(const n of e)t=qm(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=w_(e[n],t);return t}}}function CE(e){const t=p_(e.basepath),n=`/${t}`,i=`${n}/`,r=e.caseSensitive?n:n.toLowerCase(),c=e.caseSensitive?i:i.toLowerCase();return{input:({url:o})=>{const u=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return u===r?o.pathname="/":u.startsWith(c)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=qu(["/",t,o.pathname]),o)}}function qm(e,t){var i;const n=(i=e==null?void 0:e.input)==null?void 0:i.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function w_(e,t){var i;const n=(i=e==null?void 0:e.output)==null?void 0:i.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function ur(e){const t=e.resolvedLocation,n=e.location,i=(t==null?void 0:t.pathname)!==n.pathname,r=(t==null?void 0:t.href)!==n.href,c=(t==null?void 0:t.hash)!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:i,hrefChanged:r,hashChanged:c}}class jE{constructor(t){var n,i,r,c;this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=o=>o(),this.update=o=>{var w,N,k,C,j;o.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const u=this.options,h=(N=(w=this.basepath)!=null?w:u==null?void 0:u.basepath)!=null?N:"/",m=this.basepath===void 0,g=u==null?void 0:u.rewrite;if(this.options=R(R({},u),o),this.isServer=(k=this.options.isServer)!=null?k:typeof document=="undefined",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=aE(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=u_()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let A;this.resolvePathCache=ed(1e3),A=this.buildRouteTree(),this.setRoutes(A)}!this.__store&&this.latestLocation&&(this.__store=new zj(kE(this.latestLocation),{onUpdate:()=>{this.__store.state=V(R({},this.state),{cachedMatches:this.state.cachedMatches.filter(A=>!["redirected"].includes(A.status))})}}),uE(this));let p=!1;const y=(C=this.options.basepath)!=null?C:"/",x=this.options.rewrite;if(m||h!==y||g!==x){this.basepath=y;const A=[],L=p_(y);L&&L!=="/"&&A.push(CE({basepath:y})),x&&A.push(x),this.rewrite=A.length===0?void 0:A.length===1?A[0]:NE(A),this.history&&this.updateLatestLocation(),p=!0}p&&this.__store&&(this.__store.state=V(R({},this.state),{location:this.latestLocation})),typeof window!="undefined"&&"CSS"in window&&typeof((j=window.CSS)==null?void 0:j.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const o=Zj(this.routeTree,this.options.caseSensitive,(u,h)=>{u.init({originalIndex:h})});return this.options.routeMasks&&Gj(this.options.routeMasks,o.processedTree),o},this.subscribe=(o,u)=>{const h={eventType:o,fn:u};return this.subscribers.add(h),()=>{this.subscribers.delete(h)}},this.emit=o=>{this.subscribers.forEach(u=>{u.eventType===o.type&&u.fn(o)})},this.parseLocation=(o,u)=>{const h=({pathname:y,search:x,hash:_,href:S,state:w})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(y)){const L=this.options.parseSearch(x),z=this.options.stringifySearch(L);return{href:y+z+_,publicHref:S,pathname:No(y).path,external:!1,searchStr:z,search:ta(u==null?void 0:u.search,L),hash:No(_.slice(1)).path,state:ta(u==null?void 0:u.state,w)}}const N=new URL(S,this.origin),k=qm(this.rewrite,N),C=this.options.parseSearch(k.search),j=this.options.stringifySearch(C);return k.search=j,{href:k.href.replace(k.origin,""),publicHref:S,pathname:No(k.pathname).path,external:!!this.rewrite&&k.origin!==this.origin,searchStr:j,search:ta(u==null?void 0:u.search,C),hash:No(k.hash.slice(1)).path,state:ta(u==null?void 0:u.state,w)}},m=h(o),{__tempLocation:g,__tempKey:p}=m.state;if(g&&(!p||p===this.tempLocationKey)){const y=h(g);return y.state.key=m.state.key,y.state.__TSR_key=m.state.__TSR_key,delete y.state.__tempLocation,V(R({},y),{maskedLocation:m})}return m},this.resolvePathWithBase=(o,u)=>nE({base:o,to:Ip(u),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(o,u,h)=>typeof o=="string"?this.matchRoutesInternal({pathname:o,search:u},h):this.matchRoutesInternal(o,u),this.getMatchedRoutes=o=>ME({pathname:o,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=o=>{const u=this.getMatch(o);u&&(u.abortController.abort(),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{var m;const o=this.state.matches.filter(g=>g.status==="pending"),u=this.state.matches.filter(g=>g.isFetching==="loader");new Set([...(m=this.state.pendingMatches)!=null?m:[],...o,...u]).forEach(g=>{this.cancelMatch(g.id)})},this.buildLocation=o=>{const u=(m={})=>{var Q,G,W,O,se;const g=m._fromLocation||this.pendingBuiltLocation||this.latestLocation,p=this.matchRoutesLightweight(g);m.from;const y=m.unsafeRelative==="path"?g.pathname:(Q=m.from)!=null?Q:p.fullPath,x=this.resolvePathWithBase(y,"."),_=p.search,S=R({},p.params),w=m.to?this.resolvePathWithBase(x,`${m.to}`):this.resolvePathWithBase(x,"."),N=m.params===!1||m.params===null?{}:((G=m.params)!=null?G:!0)===!0?S:Object.assign(S,bs(m.params,S)),k=im({path:w,params:N,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,C=this.getMatchedRoutes(k);let j=C.matchedRoutes;(C.foundRoute?C.foundRoute.path!=="/"&&C.routeParams["**"]:Mi(k))&&this.options.notFoundRoute&&(j=[...j,this.options.notFoundRoute]);let L=!1;if(Object.keys(N).length>0)for(const ue of j){const I=(O=(W=ue.options.params)==null?void 0:W.stringify)!=null?O:ue.options.stringifyParams;I&&(L=!0,Object.assign(N,I(N)))}const z=o.leaveParams?w:No(L?im({path:w,params:N,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:k).path;let F=_;if(o._includeValidateSearch&&((se=this.options.search)!=null&&se.strict)){const ue={};j.forEach(I=>{if(I.options.validateSearch)try{Object.assign(ue,Gu(I.options.validateSearch,R(R({},ue),F)))}catch(ie){}}),F=ue}F=TE({search:F,dest:m,destRoutes:j,_includeValidateSearch:o._includeValidateSearch}),F=ta(_,F);const D=this.options.stringifySearch(F),T=m.hash===!0?g.hash:m.hash?bs(m.hash,g.hash):void 0,B=T?`#${T}`:"";let P=m.state===!0?g.state:m.state?bs(m.state,g.state):{};P=ta(g.state,P);const K=`${z}${D}${B}`;let H,q,$=!1;if(this.rewrite){const ue=new URL(K,this.origin),I=w_(this.rewrite,ue);H=ue.href.replace(ue.origin,""),I.origin!==this.origin?(q=I.href,$=!0):q=I.pathname+I.search+I.hash}else H=$j(K),q=H;return{publicHref:q,href:H,pathname:z,search:F,searchStr:D,state:P,hash:T!=null?T:"",external:$,unmaskOnReload:m.unmaskOnReload}},h=(m={},g)=>{const p=u(m);let y=g?u(g):void 0;if(!y){const _={};if(this.options.routeMasks){const S=Yj(p.pathname,this.processedTree);if(S){Object.assign(_,S.rawParams);const x=S.route,{from:w,params:N}=x,k=pe(x,["from","params"]),C=N===!1||N===null?{}:(N!=null?N:!0)===!0?_:Object.assign(_,bs(N,_));g=V(R({from:o.from},k),{params:C}),y=u(g)}}}return y&&(p.maskedLocation=y),p};return o.mask?h(o,R({from:o.from},o.mask)):h(o)},this.commitLocation=m=>Ge(this,null,function*(){var g=m,{viewTransition:o,ignoreBlocker:u}=g,h=pe(g,["viewTransition","ignoreBlocker"]);var S,w,N,k;const p=()=>{const C=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];C.forEach(A=>{h.state[A]=this.latestLocation.state[A]});const j=cr(h.state,this.latestLocation.state);return C.forEach(A=>{delete h.state[A]}),j},y=Mi(this.latestLocation.href)===Mi(h.href),x=this.commitLocationPromise;if(this.commitLocationPromise=bl(()=>{x==null||x.resolve()}),y&&p())this.load();else{let _=h,{maskedLocation:C,hashScrollIntoView:j}=_,A=pe(_,["maskedLocation","hashScrollIntoView"]);C&&(A=V(R({},C),{state:V(R({},C.state),{__tempKey:void 0,__tempLocation:V(R({},A),{search:A.searchStr,state:V(R({},A.state),{__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0})})})}),(w=(S=A.unmaskOnReload)!=null?S:this.options.unmaskOnReload)!=null&&w&&(A.state.__tempKey=this.tempLocationKey)),A.state.__hashScrollIntoViewOptions=(N=j!=null?j:this.options.defaultHashScrollIntoView)!=null?N:!0,this.shouldViewTransition=o,this.history[h.replace?"replace":"push"](A.publicHref,A.state,{ignoreBlocker:u})}return this.resetNextScroll=(k=h.resetScroll)!=null?k:!0,this.history.subscribers.size||this.load(),this.commitLocationPromise}),this.buildAndCommitLocation=(x={})=>{var _=x,{replace:o,resetScroll:u,hashScrollIntoView:h,viewTransition:m,ignoreBlocker:g,href:p}=_,y=pe(_,["replace","resetScroll","hashScrollIntoView","viewTransition","ignoreBlocker","href"]);if(p){const N=this.history.location.state.__TSR_index,k=Go(p,{__TSR_index:o?N:N+1}),C=new URL(k.pathname,this.origin),j=qm(this.rewrite,C);y.to=j.pathname,y.search=this.options.parseSearch(k.search),y.hash=k.hash.slice(1)}const S=this.buildLocation(V(R({},y),{_includeValidateSearch:!0}));this.pendingBuiltLocation=S;const w=this.commitLocation(V(R({},S),{viewTransition:m,replace:o,resetScroll:u,hashScrollIntoView:h,ignoreBlocker:g}));return Promise.resolve().then(()=>{this.pendingBuiltLocation===S&&(this.pendingBuiltLocation=void 0)}),w},this.navigate=p=>Ge(this,null,function*(){var y=p,{to:o,reloadDocument:u,href:h,publicHref:m}=y,g=pe(y,["to","reloadDocument","href","publicHref"]);var _,S;let x=!1;if(h)try{new URL(`${h}`),x=!0}catch(w){}if(x&&!u&&(u=!0),u){if(o!==void 0||!h){const N=this.buildLocation(R({to:o},g));h=h!=null?h:N.publicHref,m=m!=null?m:N.publicHref}const w=!x&&m?m:h;if(Wu(w))return Promise.resolve();if(!g.ignoreBlocker){const N=this.history,k=(S=(_=N.getBlockers)==null?void 0:_.call(N))!=null?S:[];for(const C of k)if(C!=null&&C.blockerFn&&(yield C.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"})))return Promise.resolve()}return g.replace?window.location.replace(w):window.location.href=w,Promise.resolve()}return this.buildAndCommitLocation(V(R({},g),{href:h,to:o,_isNavigate:!0}))}),this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const o=this.matchRoutes(this.latestLocation);this.__store.setState(u=>V(R({},u),{status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:o,cachedMatches:u.cachedMatches.filter(h=>!o.some(m=>m.id===h.id))}))},this.load=o=>Ge(this,null,function*(){let u,h,m;for(m=new Promise(p=>{this.startTransition(()=>Ge(this,null,function*(){var y;try{this.beforeLoad();const x=this.latestLocation,_=this.state.resolvedLocation;this.state.redirect||this.emit(R({type:"onBeforeNavigate"},ur({resolvedLocation:_,location:x}))),this.emit(R({type:"onBeforeLoad"},ur({resolvedLocation:_,location:x}))),yield G0({router:this,sync:o==null?void 0:o.sync,matches:this.state.pendingMatches,location:x,updateMatch:this.updateMatch,onReady:()=>Ge(this,null,function*(){this.startTransition(()=>{this.startViewTransition(()=>Ge(this,null,function*(){let S=[],w=[],N=[];Uo(()=>{this.__store.setState(k=>{const C=k.matches,j=k.pendingMatches||k.matches;return S=C.filter(A=>!j.some(L=>L.id===A.id)),w=j.filter(A=>!C.some(L=>L.id===A.id)),N=j.filter(A=>C.some(L=>L.id===A.id)),V(R({},k),{isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...k.cachedMatches,...S.filter(A=>A.status!=="error"&&A.status!=="notFound")]})}),this.clearExpiredCache()}),[[S,"onLeave"],[w,"onEnter"],[N,"onStay"]].forEach(([k,C])=>{k.forEach(j=>{var A,L;(L=(A=this.looseRoutesById[j.routeId].options)[C])==null||L.call(A,j)})})}))})})})}catch(x){Sa(x)?(u=x,this.navigate(V(R({},u.options),{replace:!0,ignoreBlocker:!0}))):na(x)&&(h=x),this.__store.setState(_=>V(R({},_),{statusCode:u?u.status:h?404:_.matches.some(S=>S.status==="error")?500:200,redirect:u}))}this.latestLoadPromise===m&&((y=this.commitLocationPromise)==null||y.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),p()}))}),this.latestLoadPromise=m,yield m;this.latestLoadPromise&&m!==this.latestLoadPromise;)yield this.latestLoadPromise;let g;this.hasNotFoundMatch()?g=404:this.__store.state.matches.some(p=>p.status==="error")&&(g=500),g!==void 0&&this.__store.setState(p=>V(R({},p),{statusCode:g}))}),this.startViewTransition=o=>{var h;const u=(h=this.shouldViewTransition)!=null?h:this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,u&&typeof document!="undefined"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let m;if(typeof u=="object"&&this.isViewTransitionTypesSupported){const g=this.latestLocation,p=this.state.resolvedLocation,y=typeof u.types=="function"?u.types(ur({resolvedLocation:p,location:g})):u.types;if(y===!1){o();return}m={update:o,types:y}}else m=o;document.startViewTransition(m)}else o()},this.updateMatch=(o,u)=>{this.startTransition(()=>{var m;const h=(m=this.state.pendingMatches)!=null&&m.some(g=>g.id===o)?"pendingMatches":this.state.matches.some(g=>g.id===o)?"matches":this.state.cachedMatches.some(g=>g.id===o)?"cachedMatches":"";h&&this.__store.setState(g=>{var p;return V(R({},g),{[h]:(p=g[h])==null?void 0:p.map(y=>y.id===o?u(y):y)})})})},this.getMatch=o=>{var h,m,g;const u=p=>p.id===o;return(g=(m=this.state.cachedMatches.find(u))!=null?m:(h=this.state.pendingMatches)==null?void 0:h.find(u))!=null?g:this.state.matches.find(u)},this.invalidate=o=>{const u=h=>{var m,g;return(g=(m=o==null?void 0:o.filter)==null?void 0:m.call(o,h))==null||g?R(V(R({},h),{invalid:!0}),o!=null&&o.forcePending||h.status==="error"||h.status==="notFound"?{status:"pending",error:void 0}:void 0):h};return this.__store.setState(h=>{var m;return V(R({},h),{matches:h.matches.map(u),cachedMatches:h.cachedMatches.map(u),pendingMatches:(m=h.pendingMatches)==null?void 0:m.map(u)})}),this.shouldViewTransition=!1,this.load({sync:o==null?void 0:o.sync})},this.getParsedLocationHref=o=>o.publicHref||"/",this.resolveRedirect=o=>{var h;const u=o.headers.get("Location");if(!o.options.href||o.options._builtLocation){const m=(h=o.options._builtLocation)!=null?h:this.buildLocation(o.options),g=this.getParsedLocationHref(m);o.options.href=g,o.headers.set("Location",g)}else if(u)try{const m=new URL(u);if(this.origin&&m.origin===this.origin){const g=m.pathname+m.search+m.hash;o.options.href=g,o.headers.set("Location",g)}}catch(m){}return o.headers.get("Location")||o.headers.set("Location",o.options.href),o},this.clearCache=o=>{const u=o==null?void 0:o.filter;u!==void 0?this.__store.setState(h=>V(R({},h),{cachedMatches:h.cachedMatches.filter(m=>!u(m))})):this.__store.setState(h=>V(R({},h),{cachedMatches:[]}))},this.clearExpiredCache=()=>{const o=u=>{var y,x,_;const h=this.looseRoutesById[u.routeId];if(!h.options.loader)return!0;const m=(_=u.preload?(y=h.options.preloadGcTime)!=null?y:this.options.defaultPreloadGcTime:(x=h.options.gcTime)!=null?x:this.options.defaultGcTime)!=null?_:300*1e3;return u.status==="error"?!0:Date.now()-u.updatedAt>=m};this.clearCache({filter:o})},this.loadRouteChunk=b_,this.preloadRoute=o=>Ge(this,null,function*(){var p;const u=this.buildLocation(o);let h=this.matchRoutes(u,{throwOnError:!0,preload:!0,dest:o});const m=new Set([...this.state.matches,...(p=this.state.pendingMatches)!=null?p:[]].map(y=>y.id)),g=new Set([...m,...this.state.cachedMatches.map(y=>y.id)]);Uo(()=>{h.forEach(y=>{g.has(y.id)||this.__store.setState(x=>V(R({},x),{cachedMatches:[...x.cachedMatches,y]}))})});try{return h=yield G0({router:this,matches:h,location:u,preload:!0,updateMatch:(y,x)=>{m.has(y)?h=h.map(_=>_.id===y?x(_):_):this.updateMatch(y,x)}}),h}catch(y){if(Sa(y))return y.options.reloadDocument?void 0:yield this.preloadRoute(V(R({},y.options),{_fromLocation:u}));na(y)||console.error(y);return}}),this.matchRoute=(o,u)=>{var x,_,S;const h=V(R({},o),{to:o.to?this.resolvePathWithBase(o.from||"",o.to):void 0,params:o.params||{},leaveParams:!0}),m=this.buildLocation(h);if(u!=null&&u.pending&&this.state.status!=="pending")return!1;const p=((u==null?void 0:u.pending)===void 0?!this.state.isLoading:u.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,y=Kj(m.pathname,(x=u==null?void 0:u.caseSensitive)!=null?x:!1,(_=u==null?void 0:u.fuzzy)!=null?_:!1,p.pathname,this.processedTree);return!y||o.params&&!cr(y.rawParams,o.params,{partial:!0})?!1:(S=u==null?void 0:u.includeSearch)==null||S?cr(p.search,m.search,{partial:!0})?y.rawParams:!1:y.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(o=>o.status==="notFound"||o.globalNotFound),this.update(V(R({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0},t),{caseSensitive:(n=t.caseSensitive)!=null?n:!1,notFoundMode:(i=t.notFoundMode)!=null?i:"fuzzy",stringifySearch:(r=t.stringifySearch)!=null?r:pE,parseSearch:(c=t.parseSearch)!=null?c:mE})),typeof document!="undefined"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:i}){this.routesById=t,this.routesByPath=n,this.processedTree=i;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(t){var r,c,o;return(t==null?void 0:t.id)?(o=(c=t.context)!=null?c:this.options.context)!=null?o:void 0:(r=this.options.context)!=null?r:void 0}matchRoutesInternal(t,n){var y,x,_,S,w,N,k,C,j,A;const i=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:c,parsedParams:o}=i;let{matchedRoutes:u}=i,h=!1;(r?r.path!=="/"&&c["**"]:Mi(t.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:h=!0);const m=h?AE(this.options.notFoundMode,u):void 0,g=new Array(u.length),p=new Map(this.state.matches.map(L=>[L.routeId,L]));for(let L=0;L<u.length;L++){const z=u[L],F=g[L-1];let D,T,B;{const ie=(y=F==null?void 0:F.search)!=null?y:t.search,ye=(x=F==null?void 0:F._strictSearch)!=null?x:void 0;try{const xe=(_=Gu(z.options.validateSearch,R({},ie)))!=null?_:void 0;D=R(R({},ie),xe),T=R(R({},ye),xe),B=void 0}catch(xe){let Ce=xe;if(xe instanceof ad||(Ce=new ad(xe.message,{cause:xe})),n!=null&&n.throwOnError)throw Ce;D=ie,T={},B=Ce}}const P=(N=(w=(S=z.options).loaderDeps)==null?void 0:w.call(S,{search:D}))!=null?N:"",K=P?JSON.stringify(P):"",{interpolatedPath:H,usedParams:q}=im({path:z.fullPath,params:c,decoder:this.pathParamsDecoder,server:this.isServer}),$=z.id+H+K,Q=this.getMatch($),G=p.get(z.id),W=(k=Q==null?void 0:Q._strictParams)!=null?k:q;let O;if(!Q)try{Y0(z,q,o,W)}catch(ie){if(na(ie)||Sa(ie)?O=ie:O=new EE(ie.message,{cause:ie}),n!=null&&n.throwOnError)throw O}Object.assign(c,W);const se=G?"stay":"enter";let ue;if(Q)ue=V(R({},Q),{cause:se,params:(C=G==null?void 0:G.params)!=null?C:c,_strictParams:W,search:ta(G?G.search:Q.search,D),_strictSearch:T});else{const ie=z.options.loader||z.options.beforeLoad||z.lazyFn||__(z)?"pending":"success";ue={id:$,ssr:z.options.ssr,index:L,routeId:z.id,params:(j=G==null?void 0:G.params)!=null?j:c,_strictParams:W,pathname:H,updatedAt:Date.now(),search:G?ta(G.search,D):D,_strictSearch:T,searchError:void 0,status:ie,isFetching:!1,error:void 0,paramsError:O,__routeContext:void 0,_nonReactive:{loadPromise:bl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:se,loaderDeps:G?ta(G.loaderDeps,P):P,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:z.options.staticData||{},fullPath:z.fullPath}}n!=null&&n.preload||(ue.globalNotFound=m===z.id),ue.searchError=B;const I=this.getParentContext(F);ue.context=R(R(R({},I),ue.__routeContext),ue.__beforeLoadContext),g[L]=ue}for(let L=0;L<g.length;L++){const z=g[L],F=this.looseRoutesById[z.routeId],D=this.getMatch(z.id),T=p.get(z.routeId);if(z.params=T?ta(T.params,c):c,!D){const B=g[L-1],P=this.getParentContext(B);if(F.options.context){const K={deps:z.loaderDeps,params:z.params,context:P!=null?P:{},location:t,navigate:H=>this.navigate(V(R({},H),{_fromLocation:t})),buildLocation:this.buildLocation,cause:z.cause,abortController:z.abortController,preload:!!z.preload,matches:g,routeId:F.id};z.__routeContext=(A=F.options.context(K))!=null?A:void 0}z.context=R(R(R({},P),z.__routeContext),z.__beforeLoadContext)}}return g}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:i,parsedParams:r}=this.getMatchedRoutes(t.pathname),c=Yo(n),o=R({},t.search);for(const g of n)try{Object.assign(o,Gu(g.options.validateSearch,o))}catch(p){}const u=Yo(this.state.matches),h=u&&u.routeId===c.id&&t.pathname===this.state.location.pathname;let m;if(h)m=u.params;else{const g=R({},i);for(const p of n)try{Y0(p,i,r!=null?r:{},g)}catch(y){}m=g}return{matchedRoutes:n,fullPath:c.fullPath,search:o,params:m}}}class ad extends Error{}class EE extends Error{}function kE(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Gu(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new ad("Async validation not supported");if(n.issues)throw new ad(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 ME({pathname:e,routesById:t,processedTree:n}){const i={},r=Mi(e);let c,o;const u=Xj(r,n,!0);return u&&(c=u.route,Object.assign(i,u.rawParams),o=Object.assign({},u.parsedParams)),{matchedRoutes:(u==null?void 0:u.branch)||[t[xa]],routeParams:i,foundRoute:c,parsedParams:o}}function TE({search:e,dest:t,destRoutes:n,_includeValidateSearch:i}){return RE(n)(e,t,i!=null?i:!1)}function RE(e){var r;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const c of e){if("search"in c.options)(r=c.options.search)!=null&&r.middlewares&&t.middlewares.push(...c.options.search.middlewares);else if(c.options.preSearchFilters||c.options.postSearchFilters){const o=({search:u,next:h})=>{let m=u;"preSearchFilters"in c.options&&c.options.preSearchFilters&&(m=c.options.preSearchFilters.reduce((p,y)=>y(p),u));const g=h(m);return"postSearchFilters"in c.options&&c.options.postSearchFilters?c.options.postSearchFilters.reduce((p,y)=>y(p),g):g};t.middlewares.push(o)}if(c.options.validateSearch){const o=({search:u,next:h})=>{var g;const m=h(u);if(!t._includeValidateSearch)return m;try{return R(R({},m),(g=Gu(c.options.validateSearch,m))!=null?g:void 0)}catch(p){return m}};t.middlewares.push(o)}}const n=({search:c})=>{const o=t.dest;return o.search?o.search===!0?c:bs(o.search,c):{}};t.middlewares.push(n);const i=(c,o,u)=>{if(c>=u.length)return o;const h=u[c];return h({search:o,next:g=>i(c+1,g,u)})};return function(o,u,h){return t.dest=u,t._includeValidateSearch=h,i(0,o,t.middlewares)}}function AE(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.children)return i.id}return xa}function Y0(e,t,n,i){var c,o;const r=(o=(c=e.options.params)==null?void 0:c.parse)!=null?o:e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const u in t)u in n&&(i[u]=n[u]);else{const u=r(i);Object.assign(i,u)}}const LE="Error preloading route! ☝️";class N_{constructor(t){if(this.init=n=>{var m,g;this.originalIndex=n.originalIndex;const i=this.options,r=!(i!=null&&i.path)&&!(i!=null&&i.id);this.parentRoute=(g=(m=this.options).getParentRoute)==null?void 0:g.call(m),r?this._path=xa:this.parentRoute||Ri(!1);let c=r?xa:i==null?void 0:i.path;c&&c!=="/"&&(c=m_(c));const o=(i==null?void 0:i.id)||c;let u=r?xa:qu([this.parentRoute.id===xa?"":this.parentRoute.id,o]);c===xa&&(c="/"),u!==xa&&(u=qu(["/",u]));const h=u===xa?"/":qu([this.parentRoute.fullPath,c]);this._path=c,this._id=u,this._fullPath=h,this._to=Mi(h)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>vE(R({from:this.fullPath},n)),this.options=t||{},this.isRoot=!(t!=null&&t.getParentRoute),t!=null&&t.id&&(t!=null&&t.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class DE extends N_{constructor(t){super(t)}}const ku=typeof window!="undefined"?M.useLayoutEffect:M.useEffect;function rm(e){const t=M.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function OE(e,t,n={},i={}){M.useEffect(()=>{if(!e.current||i.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([c])=>{t(c)},n);return r.observe(e.current),()=>{r.disconnect()}},[t,n,i.disabled,e])}function zE(e){const t=M.useRef(null);return M.useImperativeHandle(e,()=>t.current,[]),t}function Bp(e){var n;const t=(n=e.errorComponent)!=null?n:Up;return d.jsx(IE,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:i,reset:r})=>i?M.createElement(t,{error:i,reset:r}):e.children})}class IE extends M.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Up({error:e}){const[t,n]=M.useState(!1);return d.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[d.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),d.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(i=>!i),children:t?"Hide Error":"Show Error"})]}),d.jsx("div",{style:{height:".25rem"}}),t?d.jsx("div",{children:d.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?d.jsx("code",{children:e.message}):null})}):null]})}function BE({children:e,fallback:t=null}){return C_()?d.jsx(re.Fragment,{children:e}):d.jsx(re.Fragment,{children:t})}function C_(){return re.useSyncExternalStore(UE,()=>!0,()=>!1)}function UE(){return()=>{}}var lm={exports:{}},om={},cm={exports:{}},um={};/**
34
- * @license React
35
- * use-sync-external-store-shim.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var K0;function FE(){if(K0)return um;K0=1;var e=Lp();function t(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,r=e.useEffect,c=e.useLayoutEffect,o=e.useDebugValue;function u(p,y){var x=y(),_=i({inst:{value:x,getSnapshot:y}}),S=_[0].inst,w=_[1];return c(function(){S.value=x,S.getSnapshot=y,h(S)&&w({inst:S})},[p,x,y]),r(function(){return h(S)&&w({inst:S}),p(function(){h(S)&&w({inst:S})})},[p]),o(x),x}function h(p){var y=p.getSnapshot;p=p.value;try{var x=y();return!n(p,x)}catch(_){return!0}}function m(p,y){return y()}var g=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?m:u;return um.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,um}var X0;function HE(){return X0||(X0=1,cm.exports=FE()),cm.exports}/**
42
- * @license React
43
- * use-sync-external-store-shim/with-selector.production.js
44
- *
45
- * Copyright (c) Meta Platforms, Inc. and affiliates.
46
- *
47
- * This source code is licensed under the MIT license found in the
48
- * LICENSE file in the root directory of this source tree.
49
- */var Q0;function PE(){if(Q0)return om;Q0=1;var e=Lp(),t=HE();function n(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var i=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,c=e.useRef,o=e.useEffect,u=e.useMemo,h=e.useDebugValue;return om.useSyncExternalStoreWithSelector=function(m,g,p,y,x){var _=c(null);if(_.current===null){var S={hasValue:!1,value:null};_.current=S}else S=_.current;_=u(function(){function N(L){if(!k){if(k=!0,C=L,L=y(L),x!==void 0&&S.hasValue){var z=S.value;if(x(z,L))return j=z}return j=L}if(z=j,i(C,L))return z;var F=y(L);return x!==void 0&&x(z,F)?(C=L,z):(C=L,j=F)}var k=!1,C,j,A=p===void 0?null:p;return[function(){return N(g())},A===null?void 0:function(){return N(A())}]},[g,p,y,x]);var w=r(m,_[0],_[1]);return o(function(){S.hasValue=!0,S.value=w},[w]),h(w),w},om}var Z0;function $E(){return Z0||(Z0=1,lm.exports=PE()),lm.exports}var qE=$E();function VE(e,t=i=>i,n={}){var c;const i=(c=n.equal)!=null?c:GE;return qE.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,i)}function GE(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[i,r]of e)if(!t.has(i)||!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=J0(e);if(n.length!==J0(t).length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!Object.is(e[n[i]],t[n[i]]))return!1;return!0}function J0(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const dm=M.createContext(null);function j_(){return typeof document=="undefined"?dm:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=dm,dm)}function Na(e){var n;const t=M.useContext(j_());return(n=e==null?void 0:e.warn)==null,t}function wa(e){const t=Na({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,i=M.useRef(void 0);return VE(n.__store,r=>{var c;if(e!=null&&e.select){if((c=e.structuralSharing)!=null?c:n.options.defaultStructuralSharing){const o=ta(i.current,e.select(r));return i.current=o,o}return e.select(r)}return r})}const yd=M.createContext(void 0),YE=M.createContext(void 0);function Ja(e){const t=M.useContext(e.from?YE:yd);return wa({select:i=>{var c;const r=i.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(Ri(!(((c=e.shouldThrow)==null||c)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function Fp(e){return Ja({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Hp(e){const i=e,{select:t}=i,n=pe(i,["select"]);return Ja(V(R({},n),{select:r=>t?t(r.loaderDeps):r.loaderDeps}))}function vd(e){return Ja({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 lc(e){return Ja({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Pp(e){const t=Na();return M.useCallback(n=>{var i;return t.navigate(V(R({},n),{from:(i=n.from)!=null?i:e==null?void 0:e.from}))},[e==null?void 0:e.from,t])}var KE=l_();function XE(e,t){var de,Oe,nt;const n=Na(),i=zE(t),ce=e,{activeProps:r,inactiveProps:c,activeOptions:o,to:u,preload:h,preloadDelay:m,hashScrollIntoView:g,replace:p,startTransition:y,resetScroll:x,viewTransition:_,children:S,target:w,disabled:N,style:k,className:C,onClick:j,onFocus:A,onMouseEnter:L,onMouseLeave:z,onTouchStart:F,ignoreBlocker:D,params:T,search:B,hash:P,state:K,mask:H,reloadDocument:q,unsafeRelative:$,from:Q,_fromLocation:G}=ce,W=pe(ce,["activeProps","inactiveProps","activeOptions","to","preload","preloadDelay","hashScrollIntoView","replace","startTransition","resetScroll","viewTransition","children","target","disabled","style","className","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","ignoreBlocker","params","search","hash","state","mask","reloadDocument","unsafeRelative","from","_fromLocation"]),O=C_(),se=wa({select:Te=>Te.location.search,structuralSharing:!0}),ue=e.from,I=M.useMemo(()=>V(R({},e),{from:ue}),[n,se,ue,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ie=M.useMemo(()=>n.buildLocation(R({},I)),[n,I]),ye=ie.maskedLocation?ie.maskedLocation.publicHref:ie.publicHref,xe=ie.maskedLocation?ie.maskedLocation.external:ie.external,Ce=M.useMemo(()=>tk(ye,xe,n.history,N),[N,xe,ye,n.history]),Se=M.useMemo(()=>{if(Ce!=null&&Ce.external)return Wu(Ce.href)?void 0:Ce.href;if(!nk(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),Wu(u)?void 0:u}catch(_t){}},[u,Ce]),Pe=wa({select:Te=>{var _t;if(Se)return!1;if(o!=null&&o.exact){if(!tE(Te.location.pathname,ie.pathname,n.basepath))return!1}else{const Et=td(Te.location.pathname,n.basepath),Ie=td(ie.pathname,n.basepath);if(!(Et.startsWith(Ie)&&(Et.length===Ie.length||Et[Ie.length]==="/")))return!1}return((_t=o==null?void 0:o.includeSearch)==null||_t)&&!cr(Te.location.search,ie.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?O&&Te.location.hash===ie.hash:!0}}),vt=Pe?(de=bs(r,{}))!=null?de:QE:fm,mt=Pe?fm:(Oe=bs(c,{}))!=null?Oe:fm,Ut=[C,vt.className,mt.className].filter(Boolean).join(" "),rt=(k||vt.style||mt.style)&&R(R(R({},k),vt.style),mt.style),[$e,Ue]=M.useState(!1),xt=M.useRef(!1),ke=e.reloadDocument||Se?!1:h!=null?h:n.options.defaultPreload,ft=(nt=m!=null?m:n.options.defaultPreloadDelay)!=null?nt:0,Me=M.useCallback(()=>{n.preloadRoute(R({},I)).catch(Te=>{console.warn(Te),console.warn(LE)})},[n,I]),$n=M.useCallback(Te=>{Te!=null&&Te.isIntersecting&&Me()},[Me]);OE(i,$n,ek,{disabled:!!N||ke!=="viewport"}),M.useEffect(()=>{xt.current||!N&&ke==="render"&&(Me(),xt.current=!0)},[N,Me,ke]);const yn=Te=>{const _t=Te.currentTarget.getAttribute("target"),Et=w!==void 0?w:_t;if(!N&&!ak(Te)&&!Te.defaultPrevented&&(!Et||Et==="_self")&&Te.button===0){Te.preventDefault(),KE.flushSync(()=>{Ue(!0)});const Ie=n.subscribe("onResolved",()=>{Ie(),Ue(!1)});n.navigate(V(R({},I),{replace:p,resetScroll:x,hashScrollIntoView:g,startTransition:y,viewTransition:_,ignoreBlocker:D}))}};if(Se)return R(R(R(R(R(R(R(R(R(R(V(R({},W),{ref:i,href:Se}),S&&{children:S}),w&&{target:w}),N&&{disabled:N}),k&&{style:k}),C&&{className:C}),j&&{onClick:j}),A&&{onFocus:A}),L&&{onMouseEnter:L}),z&&{onMouseLeave:z}),F&&{onTouchStart:F});const wn=Te=>{N||ke&&Me()},Ca=wn,Rt=Te=>{if(!(N||!ke))if(!ft)Me();else{const _t=Te.target;if(Eo.has(_t))return;const Et=setTimeout(()=>{Eo.delete(_t),Me()},ft);Eo.set(_t,Et)}},za=Te=>{if(N||!ke||!ft)return;const _t=Te.target,Et=Eo.get(_t);Et&&(clearTimeout(Et),Eo.delete(_t))};return R(R(R(R(R(V(R(R(R({},W),vt),mt),{href:Ce==null?void 0:Ce.href,ref:i,onClick:ko([j,yn]),onFocus:ko([A,wn]),onMouseEnter:ko([L,Rt]),onMouseLeave:ko([z,za]),onTouchStart:ko([F,Ca]),disabled:!!N,target:w}),rt&&{style:rt}),Ut&&{className:Ut}),N&&ZE),Pe&&JE),O&&$e&&WE)}const fm={},QE={className:"active"},ZE={role:"link","aria-disabled":!0},JE={"data-status":"active","aria-current":"page"},WE={"data-transitioning":"transitioning"},Eo=new WeakMap,ek={rootMargin:"100px"},ko=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function tk(e,t,n,i){if(!i)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function nk(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const E_=M.forwardRef((e,t)=>{const u=e,{_asChild:n}=u,i=pe(u,["_asChild"]),h=XE(i,t),{type:r}=h,c=pe(h,["type"]),o=typeof i.children=="function"?i.children({isActive:c["data-status"]==="active"}):i.children;if(!n){const m=c,{disabled:g}=m,p=pe(m,["disabled"]);return M.createElement("a",p,o)}return M.createElement(n,c,o)});function ak(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class ik extends N_{constructor(t){super(t),this.useMatch=n=>Ja({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Ja(V(R({},n),{from:this.id,select:i=>n!=null&&n.select?n.select(i.context):i.context})),this.useSearch=n=>lc({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>vd({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Hp(V(R({},n),{from:this.id})),this.useLoaderData=n=>Fp(V(R({},n),{from:this.id})),this.useNavigate=()=>Pp({from:this.fullPath}),this.Link=re.forwardRef((n,i)=>d.jsx(E_,R({ref:i,from:this.fullPath},n))),this.$$typeof=Symbol.for("react.memo")}}function $p(e){return new ik(e)}class sk extends DE{constructor(t){super(t),this.useMatch=n=>Ja({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Ja(V(R({},n),{from:this.id,select:i=>n!=null&&n.select?n.select(i.context):i.context})),this.useSearch=n=>lc({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>vd({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Hp(V(R({},n),{from:this.id})),this.useLoaderData=n=>Fp(V(R({},n),{from:this.id})),this.useNavigate=()=>Pp({from:this.fullPath}),this.Link=re.forwardRef((n,i)=>d.jsx(E_,R({ref:i,from:this.fullPath},n))),this.$$typeof=Symbol.for("react.memo")}}function rk(e){return new sk(e)}function W0(e){return typeof e=="object"?new ex(e,{silent:!0}).createRoute(e):new ex(e,{silent:!0}).createRoute}class ex{constructor(t,n){this.path=t,this.createRoute=i=>{this.silent;const r=$p(i);return r.isRoot=!1,r},this.silent=n==null?void 0:n.silent}}class tx{constructor(t){this.useMatch=n=>Ja({select:n==null?void 0:n.select,from:this.options.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Ja({from:this.options.id,select:i=>n!=null&&n.select?n.select(i.context):i.context}),this.useSearch=n=>lc({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.options.id}),this.useParams=n=>vd({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Hp(V(R({},n),{from:this.options.id})),this.useLoaderData=n=>Fp(V(R({},n),{from:this.options.id})),this.useNavigate=()=>{const n=Na();return Pp({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function nx(e){return typeof e=="object"?new tx(e):t=>new tx(R({id:e},t))}function lk(){const e=Na(),t=M.useRef({router:e,mounted:!1}),[n,i]=M.useState(!1),{hasPendingMatches:r,isLoading:c}=wa({select:p=>({isLoading:p.isLoading,hasPendingMatches:p.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),o=rm(c),u=c||n||r,h=rm(u),m=c||r,g=rm(m);return e.startTransition=p=>{i(!0),M.startTransition(()=>{p(),i(!1)})},M.useEffect(()=>{const p=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Mi(e.latestLocation.publicHref)!==Mi(y.publicHref)&&e.commitLocation(V(R({},y),{replace:!0})),()=>{p()}},[e,e.history]),ku(()=>{if(typeof window!="undefined"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},Ge(null,null,function*(){try{yield e.load()}catch(y){console.error(y)}})},[e]),ku(()=>{o&&!c&&e.emit(R({type:"onLoad"},ur(e.state)))},[o,e,c]),ku(()=>{g&&!m&&e.emit(R({type:"onBeforeRouteMount"},ur(e.state)))},[m,g,e]),ku(()=>{if(h&&!u){const p=ur(e.state);e.emit(R({type:"onResolved"},p)),e.__store.setState(y=>V(R({},y),{status:"idle",resolvedLocation:y.location})),p.hrefChanged&&dE(e)}},[u,h,e]),null}function ok(e){const t=wa({select:n=>`not-found-${n.location.pathname}-${n.status}`});return d.jsx(Bp,{getResetKey:()=>t,onCatch:(n,i)=>{var r;if(na(n))(r=e.onCatch)==null||r.call(e,n,i);else throw n},errorComponent:({error:n})=>{var i;if(na(n))return(i=e.fallback)==null?void 0:i.call(e,n);throw n},children:e.children})}function ck(){return d.jsx("p",{children:"Not Found"})}function il(e){return d.jsx(d.Fragment,{children:e.children})}function k_(e,t,n){return t.options.notFoundComponent?d.jsx(t.options.notFoundComponent,R({},n)):e.options.defaultNotFoundComponent?d.jsx(e.options.defaultNotFoundComponent,R({},n)):d.jsx(ck,{})}function uk(){return Na().isScrollRestoring,null}const M_=M.memo(function({matchId:t}){var S,w,N,k,C,j,A,L,z;const n=Na(),i=wa({select:F=>{var B;const D=F.matches.findIndex(P=>P.id===t),T=F.matches[D];return Ri(T),{routeId:T.routeId,ssr:T.ssr,_displayPending:T._displayPending,resetKey:F.loadedAt,parentRouteId:(B=F.matches[D-1])==null?void 0:B.routeId}},structuralSharing:!0}),r=n.routesById[i.routeId],c=(S=r.options.pendingComponent)!=null?S:n.options.defaultPendingComponent,o=c?d.jsx(c,{}):null,u=(w=r.options.errorComponent)!=null?w:n.options.defaultErrorComponent,h=(N=r.options.onCatch)!=null?N:n.options.defaultOnCatch,m=r.isRoot?(C=r.options.notFoundComponent)!=null?C:(k=n.options.notFoundRoute)==null?void 0:k.options.component:r.options.notFoundComponent,g=i.ssr===!1||i.ssr==="data-only",p=(!r.isRoot||r.options.wrapInSuspense||g)&&((L=(j=r.options.wrapInSuspense)!=null?j:c)!=null?L:(A=r.options.errorComponent)!=null&&A.preload||g)?M.Suspense:il,y=u?Bp:il,x=m?ok:il,_=r.isRoot&&(z=r.options.shellComponent)!=null?z:il;return d.jsxs(_,{children:[d.jsx(yd.Provider,{value:t,children:d.jsx(p,{fallback:o,children:d.jsx(y,{getResetKey:()=>i.resetKey,errorComponent:u||Up,onCatch:(F,D)=>{if(na(F))throw F;h==null||h(F,D)},children:d.jsx(x,{fallback:F=>{if(!m||F.routeId&&F.routeId!==i.routeId||!F.routeId&&!r.isRoot)throw F;return M.createElement(m,F)},children:g||i._displayPending?d.jsx(BE,{fallback:o,children:d.jsx(ax,{matchId:t})}):d.jsx(ax,{matchId:t})})})})}),i.parentRouteId===xa&&n.options.scrollRestoration?d.jsxs(d.Fragment,{children:[d.jsx(dk,{}),d.jsx(uk,{})]}):null]})});function dk(){const e=Na(),t=M.useRef(void 0);return d.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit(R({type:"onRendered"},ur(e.state))),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const ax=M.memo(function({matchId:t}){var h,m,g,p,y;const n=Na(),{match:i,key:r,routeId:c}=wa({select:x=>{var C;const _=x.matches.find(j=>j.id===t),S=_.routeId,w=(C=n.routesById[S].options.remountDeps)!=null?C:n.options.defaultRemountDeps,N=w==null?void 0:w({routeId:S,loaderDeps:_.loaderDeps,params:_._strictParams,search:_._strictSearch});return{key:N?JSON.stringify(N):void 0,routeId:S,match:{id:_.id,status:_.status,error:_.error,invalid:_.invalid,_forcePending:_._forcePending,_displayPending:_._displayPending}}},structuralSharing:!0}),o=n.routesById[c],u=M.useMemo(()=>{var _;const x=(_=o.options.component)!=null?_:n.options.defaultComponent;return x?d.jsx(x,{},r):d.jsx(T_,{})},[r,o.options.component,n.options.defaultComponent]);if(i._displayPending)throw(h=n.getMatch(i.id))==null?void 0:h._nonReactive.displayPendingPromise;if(i._forcePending)throw(m=n.getMatch(i.id))==null?void 0:m._nonReactive.minPendingPromise;if(i.status==="pending"){const x=(g=o.options.pendingMinMs)!=null?g:n.options.defaultPendingMinMs;if(x){const _=n.getMatch(i.id);if(_&&!_._nonReactive.minPendingPromise){const S=bl();_._nonReactive.minPendingPromise=S,setTimeout(()=>{S.resolve(),_._nonReactive.minPendingPromise=void 0},x)}}throw(p=n.getMatch(i.id))==null?void 0:p._nonReactive.loadPromise}if(i.status==="notFound")return Ri(na(i.error)),k_(n,o,i.error);if(i.status==="redirected")throw Ri(Sa(i.error)),(y=n.getMatch(i.id))==null?void 0:y._nonReactive.loadPromise;if(i.status==="error")throw i.error;return u}),T_=M.memo(function(){const t=Na(),n=M.useContext(yd),i=wa({select:m=>{var g;return(g=m.matches.find(p=>p.id===n))==null?void 0:g.routeId}}),r=t.routesById[i],c=wa({select:m=>{const p=m.matches.find(y=>y.id===n);return Ri(p),p.globalNotFound}}),o=wa({select:m=>{var y;const g=m.matches,p=g.findIndex(x=>x.id===n);return(y=g[p+1])==null?void 0:y.id}}),u=t.options.defaultPendingComponent?d.jsx(t.options.defaultPendingComponent,{}):null;if(c)return k_(t,r,void 0);if(!o)return null;const h=d.jsx(M_,{matchId:o});return i===xa?d.jsx(M.Suspense,{fallback:u,children:h}):h});function fk(){var o;const e=Na(),n=(o=e.routesById[xa].options.pendingComponent)!=null?o:e.options.defaultPendingComponent,i=n?d.jsx(n,{}):null,r=typeof document!="undefined"&&e.ssr?il:M.Suspense,c=d.jsxs(r,{fallback:i,children:[d.jsx(lk,{}),d.jsx(hk,{})]});return e.options.InnerWrap?d.jsx(e.options.InnerWrap,{children:c}):c}function hk(){const e=Na(),t=wa({select:r=>{var c;return(c=r.matches[0])==null?void 0:c.id}}),n=wa({select:r=>r.loadedAt}),i=t?d.jsx(M_,{matchId:t}):null;return d.jsx(yd.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?i:d.jsx(Bp,{getResetKey:()=>n,errorComponent:Up,onCatch:r=>{r.message||r.toString()},children:i})})}const mk=e=>new pk(e);class pk extends jE{constructor(t){super(t)}}typeof globalThis!="undefined"?(globalThis.createFileRoute=W0,globalThis.createLazyFileRoute=nx):typeof window!="undefined"&&(window.createFileRoute=W0,window.createLazyFileRoute=nx);function gk(i){var r=i,{router:e,children:t}=r,n=pe(r,["router","children"]);Object.keys(n).length>0&&e.update(V(R(R({},e.options),n),{context:R(R({},e.options.context),n.context)}));const c=j_(),o=d.jsx(c.Provider,{value:e,children:t});return e.options.Wrap?d.jsx(e.options.Wrap,{children:o}):o}function yk(n){var i=n,{router:e}=i,t=pe(i,["router"]);return d.jsx(gk,V(R({router:e},t),{children:d.jsx(fk,{})}))}var El=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(){}},vk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ds,Ap,Qb,xk=(Qb=class{constructor(){Be(this,ds,vk);Be(this,Ap,!1)}setTimeoutProvider(e){je(this,ds,e)}setTimeout(e,t){return X(this,ds).setTimeout(e,t)}clearTimeout(e){X(this,ds).clearTimeout(e)}setInterval(e,t){return X(this,ds).setInterval(e,t)}clearInterval(e){X(this,ds).clearInterval(e)}},ds=new WeakMap,Ap=new WeakMap,Qb),Ws=new xk;function bk(e){setTimeout(e,0)}var pr=typeof window=="undefined"||"Deno"in globalThis;function En(){}function _k(e,t){return typeof e=="function"?e(t):e}function Vm(e){return typeof e=="number"&&e>=0&&e!==1/0}function R_(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ns(e,t){return typeof e=="function"?e(t):e}function ba(e,t){return typeof e=="function"?e(t):e}function ix(e,t){const{type:n="all",exact:i,fetchStatus:r,predicate:c,queryKey:o,stale:u}=e;if(o){if(i){if(t.queryHash!==qp(o,t.options))return!1}else if(!Xo(t.queryKey,o))return!1}if(n!=="all"){const h=t.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||r&&r!==t.state.fetchStatus||c&&!c(t))}function sx(e,t){const{exact:n,status:i,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(n){if(gr(t.options.mutationKey)!==gr(c))return!1}else if(!Xo(t.options.mutationKey,c))return!1}return!(i&&t.state.status!==i||r&&!r(t))}function qp(e,t){return((t==null?void 0:t.queryKeyHashFn)||gr)(e)}function gr(e){return JSON.stringify(e,(t,n)=>Gm(n)?Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{}):n)}function Xo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Xo(e[n],t[n])):!1}var Sk=Object.prototype.hasOwnProperty;function A_(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=rx(e)&&rx(t);if(!i&&!(Gm(e)&&Gm(t)))return t;const c=(i?e:Object.keys(e)).length,o=i?t:Object.keys(t),u=o.length,h=i?new Array(u):{};let m=0;for(let g=0;g<u;g++){const p=i?g:o[g],y=e[p],x=t[p];if(y===x){h[p]=y,(i?g<c:Sk.call(e,p))&&m++;continue}if(y===null||x===null||typeof y!="object"||typeof x!="object"){h[p]=x;continue}const _=A_(y,x,n+1);h[p]=_,_===y&&m++}return c===u&&m===c?e:h}function id(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 rx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Gm(e){if(!lx(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!lx(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function lx(e){return Object.prototype.toString.call(e)==="[object Object]"}function wk(e){return new Promise(t=>{Ws.setTimeout(t,e)})}function Ym(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?A_(e,t):t}function Nk(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function Ck(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var Vp=Symbol();function L_(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Vp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gp(e,t){return typeof e=="function"?e(...t):!!e}function jk(e,t,n){let i=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r!=null||(r=t()),i||(i=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),e}var er,fs,ol,Zb,Ek=(Zb=class extends El{constructor(){super();Be(this,er);Be(this,fs);Be(this,ol);je(this,ol,t=>{if(!pr&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){X(this,fs)||this.setEventListener(X(this,ol))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,fs))==null||t.call(this),je(this,fs,void 0))}setEventListener(t){var n;je(this,ol,t),(n=X(this,fs))==null||n.call(this),je(this,fs,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){X(this,er)!==t&&(je(this,er,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof X(this,er)=="boolean"?X(this,er):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},er=new WeakMap,fs=new WeakMap,ol=new WeakMap,Zb),Yp=new Ek;function Km(){let e,t;const n=new Promise((r,c)=>{e=r,t=c});n.status="pending",n.catch(()=>{});function i(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{i({status:"fulfilled",value:r}),e(r)},n.reject=r=>{i({status:"rejected",reason:r}),t(r)},n}var kk=bk;function Mk(){let e=[],t=0,n=u=>{u()},i=u=>{u()},r=kk;const c=u=>{t?e.push(u):r(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&r(()=>{i(()=>{u.forEach(h=>{n(h)})})})};return{batch:u=>{let h;t++;try{h=u()}finally{t--,t||o()}return h},batchCalls:u=>(...h)=>{c(()=>{u(...h)})},schedule:c,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{r=u}}}var rn=Mk(),cl,hs,ul,Jb,Tk=(Jb=class extends El{constructor(){super();Be(this,cl,!0);Be(this,hs);Be(this,ul);je(this,ul,t=>{if(!pr&&window.addEventListener){const n=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}})}onSubscribe(){X(this,hs)||this.setEventListener(X(this,ul))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,hs))==null||t.call(this),je(this,hs,void 0))}setEventListener(t){var n;je(this,ul,t),(n=X(this,hs))==null||n.call(this),je(this,hs,t(this.setOnline.bind(this)))}setOnline(t){X(this,cl)!==t&&(je(this,cl,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return X(this,cl)}},cl=new WeakMap,hs=new WeakMap,ul=new WeakMap,Jb),sd=new Tk;function Rk(e){return Math.min(1e3*Nu(2,e),3e4)}function D_(e){return(e!=null?e:"online")==="online"?sd.isOnline():!0}var Xm=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function O_(e){let t=!1,n=0,i;const r=Km(),c=()=>r.status!=="pending",o=S=>{var w;if(!c()){const N=new Xm(S);y(N),(w=e.onCancel)==null||w.call(e,N)}},u=()=>{t=!0},h=()=>{t=!1},m=()=>Yp.isFocused()&&(e.networkMode==="always"||sd.isOnline())&&e.canRun(),g=()=>D_(e.networkMode)&&e.canRun(),p=S=>{c()||(i==null||i(),r.resolve(S))},y=S=>{c()||(i==null||i(),r.reject(S))},x=()=>new Promise(S=>{var w;i=N=>{(c()||m())&&S(N)},(w=e.onPause)==null||w.call(e)}).then(()=>{var S;i=void 0,c()||(S=e.onContinue)==null||S.call(e)}),_=()=>{if(c())return;let S;const w=n===0?e.initialPromise:void 0;try{S=w!=null?w:e.fn()}catch(N){S=Promise.reject(N)}Promise.resolve(S).then(p).catch(N=>{var L,z,F;if(c())return;const k=(L=e.retry)!=null?L:pr?0:3,C=(z=e.retryDelay)!=null?z:Rk,j=typeof C=="function"?C(n,N):C,A=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,N);if(t||!A){y(N);return}n++,(F=e.onFail)==null||F.call(e,n,N),wk(j).then(()=>m()?void 0:x()).then(()=>{t?y(N):_()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(i==null||i(),r),cancelRetry:u,continueRetry:h,canStart:g,start:()=>(g()?_():x().then(_),r)}}var tr,Wb,z_=(Wb=class{constructor(){Be(this,tr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vm(this.gcTime)&&je(this,tr,Ws.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e!=null?e:pr?1/0:300*1e3)}clearGcTimeout(){X(this,tr)&&(Ws.clearTimeout(X(this,tr)),je(this,tr,void 0))}},tr=new WeakMap,Wb),nr,dl,va,ar,dn,nc,ir,Ra,Ni,e_,Ak=(e_=class extends z_{constructor(t){var n;super();Be(this,Ra);Be(this,nr);Be(this,dl);Be(this,va);Be(this,ar);Be(this,dn);Be(this,nc);Be(this,ir);je(this,ir,!1),je(this,nc,t.defaultOptions),this.setOptions(t.options),this.observers=[],je(this,ar,t.client),je(this,va,X(this,ar).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,je(this,nr,cx(this.options)),this.state=(n=t.state)!=null?n:X(this,nr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=X(this,dn))==null?void 0:t.promise}setOptions(t){if(this.options=R(R({},X(this,nc)),t),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=cx(this.options);n.data!==void 0&&(this.setState(ox(n.data,n.dataUpdatedAt)),je(this,nr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&X(this,va).remove(this)}setData(t,n){const i=Ym(this.state.data,t,this.options);return We(this,Ra,Ni).call(this,{data:i,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),i}setState(t,n){We(this,Ra,Ni).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var i,r;const n=(i=X(this,dn))==null?void 0:i.promise;return(r=X(this,dn))==null||r.cancel(t),n?n.then(En).catch(En):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(X(this,nr))}isActive(){return this.observers.some(t=>ba(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ns(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:!R_(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,dn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,dn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),X(this,va).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(X(this,dn)&&(X(this,ir)?X(this,dn).cancel({revert:!0}):X(this,dn).cancelRetry()),this.scheduleGc()),X(this,va).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||We(this,Ra,Ni).call(this,{type:"invalidate"})}fetch(t,n){return Ge(this,null,function*(){var h,m,g,p,y,x,_,S,w,N,k,C;if(this.state.fetchStatus!=="idle"&&((h=X(this,dn))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(X(this,dn))return X(this,dn).continueRetry(),X(this,dn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const j=this.observers.find(A=>A.options.queryFn);j&&this.setOptions(j.options)}const i=new AbortController,r=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(je(this,ir,!0),i.signal)})},c=()=>{const j=L_(this.options,n),L=(()=>{const z={client:X(this,ar),queryKey:this.queryKey,meta:this.meta};return r(z),z})();return je(this,ir,!1),this.options.persister?this.options.persister(j,L,this):j(L)},u=(()=>{const j={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:X(this,ar),state:this.state,fetchFn:c};return r(j),j})();(m=this.options.behavior)==null||m.onFetch(u,this),je(this,dl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=u.fetchOptions)==null?void 0:g.meta))&&We(this,Ra,Ni).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),je(this,dn,O_({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:j=>{j instanceof Xm&&j.revert&&this.setState(V(R({},X(this,dl)),{fetchStatus:"idle"})),i.abort()},onFail:(j,A)=>{We(this,Ra,Ni).call(this,{type:"failed",failureCount:j,error:A})},onPause:()=>{We(this,Ra,Ni).call(this,{type:"pause"})},onContinue:()=>{We(this,Ra,Ni).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const j=yield X(this,dn).start();if(j===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(j),(x=(y=X(this,va).config).onSuccess)==null||x.call(y,j,this),(S=(_=X(this,va).config).onSettled)==null||S.call(_,j,this.state.error,this),j}catch(j){if(j instanceof Xm){if(j.silent)return X(this,dn).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw We(this,Ra,Ni).call(this,{type:"error",error:j}),(N=(w=X(this,va).config).onError)==null||N.call(w,j,this),(C=(k=X(this,va).config).onSettled)==null||C.call(k,this.state.data,j,this),j}finally{this.scheduleGc()}})}},nr=new WeakMap,dl=new WeakMap,va=new WeakMap,ar=new WeakMap,dn=new WeakMap,nc=new WeakMap,ir=new WeakMap,Ra=new WeakSet,Ni=function(t){const n=i=>{var r;switch(t.type){case"failed":return V(R({},i),{fetchFailureCount:t.failureCount,fetchFailureReason:t.error});case"pause":return V(R({},i),{fetchStatus:"paused"});case"continue":return V(R({},i),{fetchStatus:"fetching"});case"fetch":return V(R(R({},i),I_(i.data,this.options)),{fetchMeta:(r=t.meta)!=null?r:null});case"success":const c=R(V(R(R({},i),ox(t.data,t.dataUpdatedAt)),{dataUpdateCount:i.dataUpdateCount+1}),!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null});return je(this,dl,t.manual?c:void 0),c;case"error":const o=t.error;return V(R({},i),{error:o,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0});case"invalidate":return V(R({},i),{isInvalidated:!0});case"setState":return R(R({},i),t.state)}};this.state=n(this.state),rn.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),X(this,va).notify({query:this,type:"updated",action:t})})},e_);function I_(e,t){return R({fetchFailureCount:0,fetchFailureReason:null,fetchStatus:D_(t.networkMode)?"fetching":"paused"},e===void 0&&{error:null,status:"pending"})}function ox(e,t){return{data:e,dataUpdatedAt:t!=null?t:Date.now(),error:null,isInvalidated:!1,status:"success"}}function cx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i!=null?i:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var In,ut,ac,jn,sr,fl,Ci,ms,ic,hl,ml,rr,lr,ps,pl,St,Lo,Qm,Zm,Jm,Wm,ep,tp,np,B_,t_,Lk=(t_=class extends El{constructor(t,n){super();Be(this,St);Be(this,In);Be(this,ut);Be(this,ac);Be(this,jn);Be(this,sr);Be(this,fl);Be(this,Ci);Be(this,ms);Be(this,ic);Be(this,hl);Be(this,ml);Be(this,rr);Be(this,lr);Be(this,ps);Be(this,pl,new Set);this.options=n,je(this,In,t),je(this,ms,null),je(this,Ci,Km()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,ut).addObserver(this),ux(X(this,ut),this.options)?We(this,St,Lo).call(this):this.updateResult(),We(this,St,Wm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ap(X(this,ut),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ap(X(this,ut),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,We(this,St,ep).call(this),We(this,St,tp).call(this),X(this,ut).removeObserver(this)}setOptions(t){const n=this.options,i=X(this,ut);if(this.options=X(this,In).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ba(this.options.enabled,X(this,ut))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");We(this,St,np).call(this),X(this,ut).setOptions(this.options),n._defaulted&&!id(this.options,n)&&X(this,In).getQueryCache().notify({type:"observerOptionsUpdated",query:X(this,ut),observer:this});const r=this.hasListeners();r&&dx(X(this,ut),i,this.options,n)&&We(this,St,Lo).call(this),this.updateResult(),r&&(X(this,ut)!==i||ba(this.options.enabled,X(this,ut))!==ba(n.enabled,X(this,ut))||Ns(this.options.staleTime,X(this,ut))!==Ns(n.staleTime,X(this,ut)))&&We(this,St,Qm).call(this);const c=We(this,St,Zm).call(this);r&&(X(this,ut)!==i||ba(this.options.enabled,X(this,ut))!==ba(n.enabled,X(this,ut))||c!==X(this,ps))&&We(this,St,Jm).call(this,c)}getOptimisticResult(t){const n=X(this,In).getQueryCache().build(X(this,In),t),i=this.createResult(n,t);return Ok(this,i)&&(je(this,jn,i),je(this,fl,this.options),je(this,sr,X(this,ut).state)),i}getCurrentResult(){return X(this,jn)}trackResult(t,n){return new Proxy(t,{get:(i,r)=>(this.trackProp(r),n==null||n(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&X(this,Ci).status==="pending"&&X(this,Ci).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,r))})}trackProp(t){X(this,pl).add(t)}getCurrentQuery(){return X(this,ut)}refetch(n={}){var t=pe(n,[]);return this.fetch(R({},t))}fetchOptimistic(t){const n=X(this,In).defaultQueryOptions(t),i=X(this,In).getQueryCache().build(X(this,In),n);return i.fetch().then(()=>this.createResult(i,n))}fetch(t){var n;return We(this,St,Lo).call(this,V(R({},t),{cancelRefetch:(n=t.cancelRefetch)!=null?n:!0})).then(()=>(this.updateResult(),X(this,jn)))}createResult(t,n){var D;const i=X(this,ut),r=this.options,c=X(this,jn),o=X(this,sr),u=X(this,fl),m=t!==i?t.state:X(this,ac),{state:g}=t;let p=R({},g),y=!1,x;if(n._optimisticResults){const T=this.hasListeners(),B=!T&&ux(t,n),P=T&&dx(t,i,n,r);(B||P)&&(p=R(R({},p),I_(g.data,t.options))),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:_,errorUpdatedAt:S,status:w}=p;x=p.data;let N=!1;if(n.placeholderData!==void 0&&x===void 0&&w==="pending"){let T;c!=null&&c.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(T=c.data,N=!0):T=typeof n.placeholderData=="function"?n.placeholderData((D=X(this,ml))==null?void 0:D.state.data,X(this,ml)):n.placeholderData,T!==void 0&&(w="success",x=Ym(c==null?void 0:c.data,T,n),y=!0)}if(n.select&&x!==void 0&&!N)if(c&&x===(o==null?void 0:o.data)&&n.select===X(this,ic))x=X(this,hl);else try{je(this,ic,n.select),x=n.select(x),x=Ym(c==null?void 0:c.data,x,n),je(this,hl,x),je(this,ms,null)}catch(T){je(this,ms,T)}X(this,ms)&&(_=X(this,ms),x=X(this,hl),S=Date.now(),w="error");const k=p.fetchStatus==="fetching",C=w==="pending",j=w==="error",A=C&&k,L=x!==void 0,F={status:w,fetchStatus:p.fetchStatus,isPending:C,isSuccess:w==="success",isError:j,isInitialLoading:A,isLoading:A,data:x,dataUpdatedAt:p.dataUpdatedAt,error:_,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>m.dataUpdateCount||p.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!C,isLoadingError:j&&!L,isPaused:p.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:j&&L,isStale:Kp(t,n),refetch:this.refetch,promise:X(this,Ci),isEnabled:ba(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const T=F.data!==void 0,B=F.status==="error"&&!T,P=q=>{B?q.reject(F.error):T&&q.resolve(F.data)},K=()=>{const q=je(this,Ci,F.promise=Km());P(q)},H=X(this,Ci);switch(H.status){case"pending":t.queryHash===i.queryHash&&P(H);break;case"fulfilled":(B||F.data!==H.value)&&K();break;case"rejected":(!B||F.error!==H.reason)&&K();break}}return F}updateResult(){const t=X(this,jn),n=this.createResult(X(this,ut),this.options);if(je(this,sr,X(this,ut).state),je(this,fl,this.options),X(this,sr).data!==void 0&&je(this,ml,X(this,ut)),id(n,t))return;je(this,jn,n);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,c=typeof r=="function"?r():r;if(c==="all"||!c&&!X(this,pl).size)return!0;const o=new Set(c!=null?c:X(this,pl));return this.options.throwOnError&&o.add("error"),Object.keys(X(this,jn)).some(u=>{const h=u;return X(this,jn)[h]!==t[h]&&o.has(h)})};We(this,St,B_).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&We(this,St,Wm).call(this)}},In=new WeakMap,ut=new WeakMap,ac=new WeakMap,jn=new WeakMap,sr=new WeakMap,fl=new WeakMap,Ci=new WeakMap,ms=new WeakMap,ic=new WeakMap,hl=new WeakMap,ml=new WeakMap,rr=new WeakMap,lr=new WeakMap,ps=new WeakMap,pl=new WeakMap,St=new WeakSet,Lo=function(t){We(this,St,np).call(this);let n=X(this,ut).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(En)),n},Qm=function(){We(this,St,ep).call(this);const t=Ns(this.options.staleTime,X(this,ut));if(pr||X(this,jn).isStale||!Vm(t))return;const i=R_(X(this,jn).dataUpdatedAt,t)+1;je(this,rr,Ws.setTimeout(()=>{X(this,jn).isStale||this.updateResult()},i))},Zm=function(){var t;return(t=typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,ut)):this.options.refetchInterval)!=null?t:!1},Jm=function(t){We(this,St,tp).call(this),je(this,ps,t),!(pr||ba(this.options.enabled,X(this,ut))===!1||!Vm(X(this,ps))||X(this,ps)===0)&&je(this,lr,Ws.setInterval(()=>{(this.options.refetchIntervalInBackground||Yp.isFocused())&&We(this,St,Lo).call(this)},X(this,ps)))},Wm=function(){We(this,St,Qm).call(this),We(this,St,Jm).call(this,We(this,St,Zm).call(this))},ep=function(){X(this,rr)&&(Ws.clearTimeout(X(this,rr)),je(this,rr,void 0))},tp=function(){X(this,lr)&&(Ws.clearInterval(X(this,lr)),je(this,lr,void 0))},np=function(){const t=X(this,In).getQueryCache().build(X(this,In),this.options);if(t===X(this,ut))return;const n=X(this,ut);je(this,ut,t),je(this,ac,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},B_=function(t){rn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(X(this,jn))}),X(this,In).getQueryCache().notify({query:X(this,ut),type:"observerResultsUpdated"})})},t_);function Dk(e,t){return ba(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ux(e,t){return Dk(e,t)||e.state.data!==void 0&&ap(e,t,t.refetchOnMount)}function ap(e,t,n){if(ba(t.enabled,e)!==!1&&Ns(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&Kp(e,t)}return!1}function dx(e,t,n,i){return(e!==t||ba(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Kp(e,n)}function Kp(e,t){return ba(t.enabled,e)!==!1&&e.isStaleByTime(Ns(t.staleTime,e))}function Ok(e,t){return!id(e.getCurrentResult(),t)}function fx(e){return{onFetch:(t,n)=>{var g,p,y,x,_;const i=t.options,r=(y=(p=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:p.fetchMore)==null?void 0:y.direction,c=((x=t.state.data)==null?void 0:x.pages)||[],o=((_=t.state.data)==null?void 0:_.pageParams)||[];let u={pages:[],pageParams:[]},h=0;const m=()=>Ge(null,null,function*(){var C;let S=!1;const w=j=>{jk(j,()=>t.signal,()=>S=!0)},N=L_(t.options,t.fetchOptions),k=(j,A,L)=>Ge(null,null,function*(){if(S)return Promise.reject();if(A==null&&j.pages.length)return Promise.resolve(j);const F=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:A,direction:L?"backward":"forward",meta:t.options.meta};return w(P),P})(),D=yield N(F),{maxPages:T}=t.options,B=L?Ck:Nk;return{pages:B(j.pages,D,T),pageParams:B(j.pageParams,A,T)}});if(r&&c.length){const j=r==="backward",A=j?zk:hx,L={pages:c,pageParams:o},z=A(i,L);u=yield k(L,z,j)}else{const j=e!=null?e:c.length;do{const A=h===0?(C=o[0])!=null?C:i.initialPageParam:hx(i,u);if(h>0&&A==null)break;u=yield k(u,A),h++}while(h<j)}return u});t.options.persister?t.fetchFn=()=>{var S,w;return(w=(S=t.options).persister)==null?void 0:w.call(S,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=m}}}function hx(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function zk(e,{pages:t,pageParams:n}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n):void 0}var sc,Ya,xn,or,Ka,cs,n_,Ik=(n_=class extends z_{constructor(t){super();Be(this,Ka);Be(this,sc);Be(this,Ya);Be(this,xn);Be(this,or);je(this,sc,t.client),this.mutationId=t.mutationId,je(this,xn,t.mutationCache),je(this,Ya,[]),this.state=t.state||U_(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){X(this,Ya).includes(t)||(X(this,Ya).push(t),this.clearGcTimeout(),X(this,xn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){je(this,Ya,X(this,Ya).filter(n=>n!==t)),this.scheduleGc(),X(this,xn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,Ya).length||(this.state.status==="pending"?this.scheduleGc():X(this,xn).remove(this))}continue(){var t,n;return(n=(t=X(this,or))==null?void 0:t.continue())!=null?n:this.execute(this.state.variables)}execute(t){return Ge(this,null,function*(){var o,u,h,m,g,p,y,x,_,S,w,N,k,C,j,A,L,z,F;const n=()=>{We(this,Ka,cs).call(this,{type:"continue"})},i={client:X(this,sc),meta:this.options.meta,mutationKey:this.options.mutationKey};je(this,or,O_({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(D,T)=>{We(this,Ka,cs).call(this,{type:"failed",failureCount:D,error:T})},onPause:()=>{We(this,Ka,cs).call(this,{type:"pause"})},onContinue:n,retry:(o=this.options.retry)!=null?o:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>X(this,xn).canRun(this)}));const r=this.state.status==="pending",c=!X(this,or).canStart();try{if(r)n();else{We(this,Ka,cs).call(this,{type:"pending",variables:t,isPaused:c}),X(this,xn).config.onMutate&&(yield X(this,xn).config.onMutate(t,this,i));const T=yield(h=(u=this.options).onMutate)==null?void 0:h.call(u,t,i);T!==this.state.context&&We(this,Ka,cs).call(this,{type:"pending",context:T,variables:t,isPaused:c})}const D=yield X(this,or).start();return yield(g=(m=X(this,xn).config).onSuccess)==null?void 0:g.call(m,D,t,this.state.context,this,i),yield(y=(p=this.options).onSuccess)==null?void 0:y.call(p,D,t,this.state.context,i),yield(_=(x=X(this,xn).config).onSettled)==null?void 0:_.call(x,D,null,this.state.variables,this.state.context,this,i),yield(w=(S=this.options).onSettled)==null?void 0:w.call(S,D,null,t,this.state.context,i),We(this,Ka,cs).call(this,{type:"success",data:D}),D}catch(D){try{yield(k=(N=X(this,xn).config).onError)==null?void 0:k.call(N,D,t,this.state.context,this,i)}catch(T){Promise.reject(T)}try{yield(j=(C=this.options).onError)==null?void 0:j.call(C,D,t,this.state.context,i)}catch(T){Promise.reject(T)}try{yield(L=(A=X(this,xn).config).onSettled)==null?void 0:L.call(A,void 0,D,this.state.variables,this.state.context,this,i)}catch(T){Promise.reject(T)}try{yield(F=(z=this.options).onSettled)==null?void 0:F.call(z,void 0,D,t,this.state.context,i)}catch(T){Promise.reject(T)}throw We(this,Ka,cs).call(this,{type:"error",error:D}),D}finally{X(this,xn).runNext(this)}})}},sc=new WeakMap,Ya=new WeakMap,xn=new WeakMap,or=new WeakMap,Ka=new WeakSet,cs=function(t){const n=i=>{switch(t.type){case"failed":return V(R({},i),{failureCount:t.failureCount,failureReason:t.error});case"pause":return V(R({},i),{isPaused:!0});case"continue":return V(R({},i),{isPaused:!1});case"pending":return V(R({},i),{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 V(R({},i),{data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1});case"error":return V(R({},i),{data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"})}};this.state=n(this.state),rn.batch(()=>{X(this,Ya).forEach(i=>{i.onMutationUpdate(t)}),X(this,xn).notify({mutation:this,type:"updated",action:t})})},n_);function U_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ji,Aa,rc,a_,Bk=(a_=class extends El{constructor(t={}){super();Be(this,ji);Be(this,Aa);Be(this,rc);this.config=t,je(this,ji,new Set),je(this,Aa,new Map),je(this,rc,0)}build(t,n,i){const r=new Ik({client:t,mutationCache:this,mutationId:++Cu(this,rc)._,options:t.defaultMutationOptions(n),state:i});return this.add(r),r}add(t){X(this,ji).add(t);const n=Mu(t);if(typeof n=="string"){const i=X(this,Aa).get(n);i?i.push(t):X(this,Aa).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(X(this,ji).delete(t)){const n=Mu(t);if(typeof n=="string"){const i=X(this,Aa).get(n);if(i)if(i.length>1){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}else i[0]===t&&X(this,Aa).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Mu(t);if(typeof n=="string"){const i=X(this,Aa).get(n),r=i==null?void 0:i.find(c=>c.state.status==="pending");return!r||r===t}else return!0}runNext(t){var i,r;const n=Mu(t);if(typeof n=="string"){const c=(i=X(this,Aa).get(n))==null?void 0:i.find(o=>o!==t&&o.state.isPaused);return(r=c==null?void 0:c.continue())!=null?r:Promise.resolve()}else return Promise.resolve()}clear(){rn.batch(()=>{X(this,ji).forEach(t=>{this.notify({type:"removed",mutation:t})}),X(this,ji).clear(),X(this,Aa).clear()})}getAll(){return Array.from(X(this,ji))}find(t){const n=R({exact:!0},t);return this.getAll().find(i=>sx(n,i))}findAll(t={}){return this.getAll().filter(n=>sx(t,n))}notify(t){rn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return rn.batch(()=>Promise.all(t.map(n=>n.continue().catch(En))))}},ji=new WeakMap,Aa=new WeakMap,rc=new WeakMap,a_);function Mu(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ei,gs,Bn,ki,Ti,Yu,ip,i_,Uk=(i_=class extends El{constructor(n,i){super();Be(this,Ti);Be(this,Ei);Be(this,gs);Be(this,Bn);Be(this,ki);je(this,Ei,n),this.setOptions(i),this.bindMethods(),We(this,Ti,Yu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var r;const i=this.options;this.options=X(this,Ei).defaultMutationOptions(n),id(this.options,i)||X(this,Ei).getMutationCache().notify({type:"observerOptionsUpdated",mutation:X(this,Bn),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&gr(i.mutationKey)!==gr(this.options.mutationKey)?this.reset():((r=X(this,Bn))==null?void 0:r.state.status)==="pending"&&X(this,Bn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=X(this,Bn))==null||n.removeObserver(this)}onMutationUpdate(n){We(this,Ti,Yu).call(this),We(this,Ti,ip).call(this,n)}getCurrentResult(){return X(this,gs)}reset(){var n;(n=X(this,Bn))==null||n.removeObserver(this),je(this,Bn,void 0),We(this,Ti,Yu).call(this),We(this,Ti,ip).call(this)}mutate(n,i){var r;return je(this,ki,i),(r=X(this,Bn))==null||r.removeObserver(this),je(this,Bn,X(this,Ei).getMutationCache().build(X(this,Ei),this.options)),X(this,Bn).addObserver(this),X(this,Bn).execute(n)}},Ei=new WeakMap,gs=new WeakMap,Bn=new WeakMap,ki=new WeakMap,Ti=new WeakSet,Yu=function(){var i,r;const n=(r=(i=X(this,Bn))==null?void 0:i.state)!=null?r:U_();je(this,gs,V(R({},n),{isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset}))},ip=function(n){rn.batch(()=>{var i,r,c,o,u,h,m,g;if(X(this,ki)&&this.hasListeners()){const p=X(this,gs).variables,y=X(this,gs).context,x={client:X(this,Ei),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(r=(i=X(this,ki)).onSuccess)==null||r.call(i,n.data,p,y,x)}catch(_){Promise.reject(_)}try{(o=(c=X(this,ki)).onSettled)==null||o.call(c,n.data,null,p,y,x)}catch(_){Promise.reject(_)}}else if((n==null?void 0:n.type)==="error"){try{(h=(u=X(this,ki)).onError)==null||h.call(u,n.error,p,y,x)}catch(_){Promise.reject(_)}try{(g=(m=X(this,ki)).onSettled)==null||g.call(m,void 0,n.error,p,y,x)}catch(_){Promise.reject(_)}}}this.listeners.forEach(p=>{p(X(this,gs))})})},i_),Xa,s_,Fk=(s_=class extends El{constructor(t={}){super();Be(this,Xa);this.config=t,je(this,Xa,new Map)}build(t,n,i){var u;const r=n.queryKey,c=(u=n.queryHash)!=null?u:qp(r,n);let o=this.get(c);return o||(o=new Ak({client:t,queryKey:r,queryHash:c,options:t.defaultQueryOptions(n),state:i,defaultOptions:t.getQueryDefaults(r)}),this.add(o)),o}add(t){X(this,Xa).has(t.queryHash)||(X(this,Xa).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=X(this,Xa).get(t.queryHash);n&&(t.destroy(),n===t&&X(this,Xa).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){rn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,Xa).get(t)}getAll(){return[...X(this,Xa).values()]}find(t){const n=R({exact:!0},t);return this.getAll().find(i=>ix(n,i))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(i=>ix(t,i)):n}notify(t){rn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){rn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){rn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xa=new WeakMap,s_),Gt,ys,vs,gl,yl,xs,vl,xl,r_,Hk=(r_=class{constructor(e={}){Be(this,Gt);Be(this,ys);Be(this,vs);Be(this,gl);Be(this,yl);Be(this,xs);Be(this,vl);Be(this,xl);je(this,Gt,e.queryCache||new Fk),je(this,ys,e.mutationCache||new Bk),je(this,vs,e.defaultOptions||{}),je(this,gl,new Map),je(this,yl,new Map),je(this,xs,0)}mount(){Cu(this,xs)._++,X(this,xs)===1&&(je(this,vl,Yp.subscribe(e=>Ge(this,null,function*(){e&&(yield this.resumePausedMutations(),X(this,Gt).onFocus())}))),je(this,xl,sd.subscribe(e=>Ge(this,null,function*(){e&&(yield this.resumePausedMutations(),X(this,Gt).onOnline())}))))}unmount(){var e,t;Cu(this,xs)._--,X(this,xs)===0&&((e=X(this,vl))==null||e.call(this),je(this,vl,void 0),(t=X(this,xl))==null||t.call(this),je(this,xl,void 0))}isFetching(e){return X(this,Gt).findAll(V(R({},e),{fetchStatus:"fetching"})).length}isMutating(e){return X(this,ys).findAll(V(R({},e),{status:"pending"})).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,Gt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=X(this,Gt).build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ns(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return X(this,Gt).findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),r=X(this,Gt).get(i.queryHash),c=r==null?void 0:r.state.data,o=_k(t,c);if(o!==void 0)return X(this,Gt).build(this,i).setData(o,V(R({},n),{manual:!0}))}setQueriesData(e,t,n){return rn.batch(()=>X(this,Gt).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,Gt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=X(this,Gt);rn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=X(this,Gt);return rn.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(R({type:"active"},e),t)))}cancelQueries(e,t={}){const n=R({revert:!0},t),i=rn.batch(()=>X(this,Gt).findAll(e).map(r=>r.cancel(n)));return Promise.all(i).then(En).catch(En)}invalidateQueries(e,t={}){return rn.batch(()=>{var n,i;return X(this,Gt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries(V(R({},e),{type:(i=(n=e==null?void 0:e.refetchType)!=null?n:e==null?void 0:e.type)!=null?i:"active"}),t)})}refetchQueries(e,t={}){var r;const n=V(R({},t),{cancelRefetch:(r=t.cancelRefetch)!=null?r:!0}),i=rn.batch(()=>X(this,Gt).findAll(e).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let o=c.fetch(void 0,n);return n.throwOnError||(o=o.catch(En)),c.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(i).then(En)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=X(this,Gt).build(this,t);return n.isStaleByTime(Ns(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(En).catch(En)}fetchInfiniteQuery(e){return e.behavior=fx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(En).catch(En)}ensureInfiniteQueryData(e){return e.behavior=fx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return sd.isOnline()?X(this,ys).resumePausedMutations():Promise.resolve()}getQueryCache(){return X(this,Gt)}getMutationCache(){return X(this,ys)}getDefaultOptions(){return X(this,vs)}setDefaultOptions(e){je(this,vs,e)}setQueryDefaults(e,t){X(this,gl).set(gr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,gl).values()],n={};return t.forEach(i=>{Xo(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){X(this,yl).set(gr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,yl).values()],n={};return t.forEach(i=>{Xo(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t=V(R(R(R({},X(this,vs).queries),this.getQueryDefaults(e.queryKey)),e),{_defaulted:!0});return t.queryHash||(t.queryHash=qp(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===Vp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:V(R(R(R({},X(this,vs).mutations),(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey)),e),{_defaulted:!0})}clear(){X(this,Gt).clear(),X(this,ys).clear()}},Gt=new WeakMap,ys=new WeakMap,vs=new WeakMap,gl=new WeakMap,yl=new WeakMap,xs=new WeakMap,vl=new WeakMap,xl=new WeakMap,r_),F_=M.createContext(void 0),kl=e=>{const t=M.useContext(F_);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Pk=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(F_.Provider,{value:e,children:t})),H_=M.createContext(!1),$k=()=>M.useContext(H_);H_.Provider;function qk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Vk=M.createContext(qk()),Gk=()=>M.useContext(Vk),Yk=(e,t,n)=>{const i=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Gp(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},Kk=e=>{M.useEffect(()=>{e.clearReset()},[e])},Xk=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(r&&e.data===void 0||Gp(n,[e.error,i])),Qk=e=>{if(e.suspense){const n=r=>r==="static"?r:Math.max(r!=null?r:1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...r)=>n(i(...r)):n(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Zk=(e,t)=>e.isLoading&&e.isFetching&&!t,Jk=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,mx=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Wk(e,t,n){var y,x,_,S;const i=$k(),r=Gk(),c=kl(),o=c.defaultQueryOptions(e);(x=(y=c.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||x.call(y,o);const u=c.getQueryCache().get(o.queryHash);o._optimisticResults=i?"isRestoring":"optimistic",Qk(o),Yk(o,r,u),Kk(r);const h=!c.getQueryCache().get(o.queryHash),[m]=M.useState(()=>new t(c,o)),g=m.getOptimisticResult(o),p=!i&&e.subscribed!==!1;if(M.useSyncExternalStore(M.useCallback(w=>{const N=p?m.subscribe(rn.batchCalls(w)):En;return m.updateResult(),N},[m,p]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),M.useEffect(()=>{m.setOptions(o)},[o,m]),Jk(o,g))throw mx(o,m,r);if(Xk({result:g,errorResetBoundary:r,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw g.error;if((S=(_=c.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||S.call(_,o,g),o.experimental_prefetchInRender&&!pr&&Zk(g,i)){const w=h?mx(o,m,r):u==null?void 0:u.promise;w==null||w.catch(En).finally(()=>{m.updateResult()})}return o.notifyOnChangeProps?g:m.trackResult(g)}function Ml(e,t){return Wk(e,Lk)}function xd(e,t){const n=kl(),[i]=M.useState(()=>new Uk(n,e));M.useEffect(()=>{i.setOptions(e)},[i,e]);const r=M.useSyncExternalStore(M.useCallback(o=>i.subscribe(rn.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),c=M.useCallback((o,u)=>{i.mutate(o,u).catch(En)},[i]);if(r.error&&Gp(i.options.throwOnError,[r.error]))throw r.error;return V(R({},r),{mutate:c,mutateAsync:r.mutate})}const eM="dr_auth_token";function tM(){const e=window.fetch;window.fetch=function(...t){const[n,i]=t,r=typeof window!="undefined"?localStorage.getItem(eM):null,c=i||{};if(r&&!c.headers)c.headers={Authorization:`Bearer ${r}`};else if(r&&c.headers){const o=c.headers;o.Authorization||(o.Authorization=`Bearer ${r}`)}return e(n,c)},console.log("[FetchInterceptor] Installed - will add Authorization header to all requests")}var nM={};class aM{constructor(t){Ct(this,"baseUrl");Ct(this,"token",null);this.baseUrl=t,this.loadToken()}loadToken(){typeof window!="undefined"&&(this.token=localStorage.getItem("dr_auth_token"))}setToken(t){this.token=t}getBaseUrl(){return this.baseUrl}getHeaders(){const t={"Content-Type":"application/json"};return this.token&&(t.Authorization=`Bearer ${this.token}`),t}gethealth(){return Ge(this,null,function*(){const i=`${this.getBaseUrl()}/health`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(i,r);if(!c.ok){const o=yield c.text();throw new Error(`GET /health failed: ${c.status} ${o}`)}return c.json()})}getapimodel(){return Ge(this,null,function*(){const i=`${this.getBaseUrl()}/api/model`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(i,r);if(!c.ok){const o=yield c.text();throw new Error(`GET /api/model failed: ${c.status} ${o}`)}return c.json()})}getapilayerslayerName(t){return Ge(this,null,function*(){const n=this.getBaseUrl(),i=`/api/layers/${encodeURIComponent(t)}`,r=`${n}${i}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/layers/:layerName failed: ${o.status} ${u}`)}return o.json()})}getapispec(){return Ge(this,null,function*(){const i=`${this.getBaseUrl()}/api/spec`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(i,r);if(!c.ok){const o=yield c.text();throw new Error(`GET /api/spec failed: ${c.status} ${o}`)}return c.json()})}getapiannotations(t){return Ge(this,null,function*(){const n=this.getBaseUrl(),i="/api/annotations",r=new URLSearchParams;t&&Object.entries(t).forEach(([h,m])=>{m!=null&&r.append(h,m)});const c=r.toString()?`${n}${i}?${r.toString()}`:`${n}${i}`,o={method:"GET",headers:this.getHeaders(),credentials:"include"},u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`GET /api/annotations failed: ${u.status} ${h}`)}return u.json()})}postapiannotations(t){return Ge(this,null,function*(){const r=`${this.getBaseUrl()}/api/annotations`,c={method:"POST",headers:this.getHeaders(),credentials:"include"};t&&(c.body=JSON.stringify(t));const o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`POST /api/annotations failed: ${o.status} ${u}`)}return o.json()})}getapiannotationsannotationId(t){return Ge(this,null,function*(){const n=this.getBaseUrl(),i=`/api/annotations/${encodeURIComponent(t)}`,r=`${n}${i}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/annotations/:annotationId failed: ${o.status} ${u}`)}return o.json()})}putapiannotationsannotationId(t,n){return Ge(this,null,function*(){const i=this.getBaseUrl(),r=`/api/annotations/${encodeURIComponent(t)}`,c=`${i}${r}`,o={method:"PUT",headers:this.getHeaders(),credentials:"include"};n&&(o.body=JSON.stringify(n));const u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`PUT /api/annotations/:annotationId failed: ${u.status} ${h}`)}return u.json()})}patchapiannotationsannotationId(t,n){return Ge(this,null,function*(){const i=this.getBaseUrl(),r=`/api/annotations/${encodeURIComponent(t)}`,c=`${i}${r}`,o={method:"PATCH",headers:this.getHeaders(),credentials:"include"};n&&(o.body=JSON.stringify(n));const u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`PATCH /api/annotations/:annotationId failed: ${u.status} ${h}`)}return u.json()})}deleteapiannotationsannotationId(t){return Ge(this,null,function*(){const n=this.getBaseUrl(),i=`/api/annotations/${encodeURIComponent(t)}`,r=`${n}${i}`,c={method:"DELETE",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`DELETE /api/annotations/:annotationId failed: ${o.status} ${u}`)}if(o.status!==204)return o.json()})}getapiannotationsannotationIdreplies(t){return Ge(this,null,function*(){const n=this.getBaseUrl(),i=`/api/annotations/${encodeURIComponent(t)}/replies`,r=`${n}${i}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/annotations/:annotationId/replies failed: ${o.status} ${u}`)}return o.json()})}postapiannotationsannotationIdreplies(t,n){return Ge(this,null,function*(){const i=this.getBaseUrl(),r=`/api/annotations/${encodeURIComponent(t)}/replies`,c=`${i}${r}`,o={method:"POST",headers:this.getHeaders(),credentials:"include"};n&&(o.body=JSON.stringify(n));const u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`POST /api/annotations/:annotationId/replies failed: ${u.status} ${h}`)}return u.json()})}getapichangesets(){return Ge(this,null,function*(){const i=`${this.getBaseUrl()}/api/changesets`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(i,r);if(!c.ok){const o=yield c.text();throw new Error(`GET /api/changesets failed: ${c.status} ${o}`)}return c.json()})}getapichangesetschangesetId(t){return Ge(this,null,function*(){const n=this.getBaseUrl(),i=`/api/changesets/${encodeURIComponent(t)}`,r=`${n}${i}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/changesets/:changesetId failed: ${o.status} ${u}`)}return o.json()})}}let hm=null;function vr(e){if(!hm){const t=typeof window!="undefined"?window.location.origin:nM.API_URL||"http://localhost:8080";hm=new aM(t)}return hm}const bd=vr();function iM(e){return Ml({queryKey:["getapimodel"],queryFn:()=>bd.getapimodel()})}function sM(e){return Ml({queryKey:["getapispec"],queryFn:()=>bd.getapispec()})}function rM(e){return Ml({queryKey:["getapichangesets"],queryFn:()=>bd.getapichangesets()})}function lM(e,t){return Ml(R({queryKey:["getapichangesetschangesetId",e],queryFn:()=>bd.getapichangesetschangesetId(e)},t))}function oM(){return new Hk({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*10,retry:1},mutations:{retry:0}}})}const Fo="dr_auth_token";function px(){if(typeof window=="undefined")return null;const e=localStorage.getItem(Fo);if(e)return console.log("[Auth] Token loaded from localStorage"),e;const t=cM();return t?(console.log("[Auth] Token loaded from cookie"),t):(console.log("[Auth] No token found - running in development mode"),null)}function cM(){if(typeof document=="undefined")return null;const e=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith(`${Fo}=`));if(!e)return null;try{return decodeURIComponent(e.split("=")[1]||"")}catch(t){return e.split("=")[1]||null}}const Xp=md((e,t)=>({token:px(),isAuthenticated:!!px(),setToken:n=>{typeof window!="undefined"&&(n?localStorage.setItem(Fo,n):localStorage.removeItem(Fo)),e({token:n,isAuthenticated:!!n}),console.log("[Auth] Token updated:",n?"present":"cleared")},clearToken:()=>{typeof window!="undefined"&&localStorage.removeItem(Fo),e({token:null,isAuthenticated:!1}),console.log("[Auth] Token cleared from store and localStorage")},getAuthHeaders:()=>{const{token:n}=t();return n?{Authorization:`Bearer ${n}`}:{}},getAuthQueryParams:()=>{const{token:n}=t();return n?{token:n}:{}}}));function uM(){const e=lc({strict:!1}),t=Xp(n=>n.setToken);return M.useEffect(()=>{const n=e==null?void 0:e.token,i=window.location.hash.slice(1)||"/model/graph";n&&(console.log("[AuthRoute] Storing token in localStorage"),localStorage.setItem("dr_auth_token",n),t(n),console.log("[AuthRoute] Updated authStore with new token")),window.location.hash=i},[e==null?void 0:e.token,t]),d.jsx("div",{className:"flex items-center justify-center h-screen",children:d.jsx("p",{className:"text-gray-500","data-testid":"auth-loading",children:"Authenticating..."})})}const dM={dashboard:"M3 3 L10 3 L10 10 L3 10 Z M14 3 L21 3 L21 10 L14 10 Z M14 14 L21 14 L21 21 L14 21 Z M3 14 L10 14 L10 21 L3 21 Z",schema:"M3 12 L9 6 L21 6 M3 12 L9 18 L21 18 M3 12 C4.7 12 6 10.3 6 8 C6 5.7 4.7 4 3 4 C1.3 4 0 5.7 0 8 C0 10.3 1.3 12 3 12 M21 6 C22.7 6 24 4.3 24 2 C24 0.3 22.7 0 21 0 C19.3 0 18 0.3 18 2 C18 4.3 19.3 6 21 6 M21 18 C22.7 18 24 16.3 24 14 C24 12.3 22.7 11 21 11 C19.3 11 18 12.3 18 14 C18 16.3 19.3 18 21 18",data:"M12 5 C18.6 5 24 6.3 24 8 L24 8 L24 16 C24 17.7 18.6 19 12 19 C5.4 19 0 17.7 0 16 L0 8 C0 6.3 5.4 5 12 5 M3 5 L3 14 L21 14 L21 5 M3 11 L3 19 L21 19 L21 11",pipeline:"M2 12 L6 12 L6 6 L18 6 L18 12 L22 12 M8 12 L16 12 M12 9 L15 12 L12 15",graph:"M6 10 C8.8 10 11 7.8 11 5 C11 2.2 8.8 0 6 0 C3.2 0 1 2.2 1 5 C1 7.8 3.2 10 6 10 M18 10 C20.8 10 23 7.8 23 5 C23 2.2 20.8 0 18 0 C15.2 0 13 2.2 13 5 C13 7.8 15.2 10 18 10 M12 18 C14.8 18 17 15.8 17 13 C17 10.2 14.8 8 12 8 C9.2 8 7 10.2 7 13 C7 15.8 9.2 18 12 18 M8 8 L16 16 M16 8 L8 16 M12 9 L12 15",search:"M10.6 14.8 C14.2 14.8 17.2 11.5 17.2 7.4 C17.2 3 14.2 0 10.6 0 C6.9 0 3 3 3 7.4 C3 11.5 6.9 14.8 10.6 14.8 M19.8 19.2 L16.7 16.3",bell:"M6.55 9.7 C6.55 3.7 11.15 0 11.15 0 C11.15 0 15.75 3.7 15.75 9.7 C15.75 12 17.25 13.4 17.25 13.4 L4.6 13.4 C4.6 13.4 6.55 12 6.55 9.7 M9.4 19.4 C9.73 19.8 10.8 20.1 10.95 20.1 C11.1 20.1 12.18 19.8 12.5 19.4",plus:"M12 5 L12 19 M5 12 L19 12",check:"M2 12 L8 18 L22 4",x:"M3 3 L21 21 M21 3 L3 21",chevronDown:"M6 9 L12 15 L18 9",chevronUp:"M18 15 L12 9 L6 15",chevronLeft:"M15 6 L9 12 L15 18",chevronRight:"M9 6 L15 12 L9 18",menu:"M3 6 L21 6 M3 12 L21 12 M3 18 L21 18",settings:"M12 1.5 C12.4 1.5 12.7 1.8 12.7 2.2 L12.7 4 C14.2 4.4 15.6 5.3 16.7 6.6 L18 5.4 C18.4 5.1 19 5.1 19.3 5.4 C19.7 5.7 19.7 6.3 19.3 6.6 L18 7.8 C19.2 8.9 20.2 10.3 20.6 12 L22.4 12 C22.9 12 23.2 12.3 23.2 12.8 C23.2 13.3 22.9 13.6 22.4 13.6 L20.6 13.6 C20.2 15.3 19.2 16.7 18 17.8 L19.3 19 C19.7 19.3 19.7 19.9 19.3 20.2 C19 20.5 18.4 20.5 18 20.2 L16.7 19 C15.6 20.3 14.2 21.2 12.7 21.6 L12.7 23.4 C12.7 23.8 12.4 24.1 12 24.1 C11.6 24.1 11.3 23.8 11.3 23.4 L11.3 21.6 C9.8 21.2 8.4 20.3 7.3 19 L6 20.2 C5.6 20.5 5 20.5 4.7 20.2 C4.3 19.9 4.3 19.3 4.7 19 L6 17.8 C4.8 16.7 3.8 15.3 3.4 13.6 L1.6 13.6 C1.1 13.6 0.8 13.3 0.8 12.8 C0.8 12.3 1.1 12 1.6 12 L3.4 12 C3.8 10.3 4.8 8.9 6 7.8 L4.7 6.6 C4.3 6.3 4.3 5.7 4.7 5.4 C5 5.1 5.6 5.1 6 5.4 L7.3 6.6 C8.4 5.3 9.8 4.4 11.3 4 L11.3 2.2 C11.3 1.8 11.6 1.5 12 1.5 Z M12 8.5 C10.6 8.5 9.5 9.6 9.5 11 C9.5 12.4 10.6 13.5 12 13.5 C13.4 13.5 14.5 12.4 14.5 11 C14.5 9.6 13.4 8.5 12 8.5 Z",alert:"M12 2 L2 20 L22 20 Z M12 9 L12 13 M12 17 L12.01 17",trash:"M3 6 L3 20 C3 21.1 3.9 22 5 22 L19 22 C20.1 22 21 21.1 21 20 L21 6 M1 6 L23 6 M7 6 L7 4 C7 2.9 7.9 2 9 2 L15 2 C16.1 2 17 2.9 17 4 L17 6 M9 11 L9 17 M15 11 L15 17",edit:"M3 17.25 L3 21 L6.75 21 L17.81 9.94 L14.06 6.19 Z M20.71 7.04 C21.1 6.65 21.1 6.02 20.71 5.63 L18.37 3.29 C17.98 2.9 17.35 2.9 16.96 3.29 L15.12 5.12 L18.87 8.87 Z",download:"M12 2 L12 13 M5 10 L12 17 L19 10",upload:"M12 22 L12 11 M5 14 L12 7 L19 14",eye:"M12 5 C7 5 2.73 8.11 1 12.46 C2.73 16.89 7 20 12 20 C17 20 21.27 16.89 23 12.46 C21.27 8.11 17 5 12 5 Z M12 16 C14.2 16 16 14.2 16 12 C16 9.8 14.2 8 12 8 C9.8 8 8 9.8 8 12 C8 14.2 9.8 16 12 16 Z",eyeOff:"M12 5.69 C8.5 5.69 5.2 7.6 3.2 10.4 M21 19 L2 2 M9.88 9.88 C9.4 10.5 9 11.2 9 12 C9 14.21 10.79 16 13 16 C13.8 16 14.5 15.6 15.12 15.12 M18.8 10.4 C20.8 7.6 17.5 5.69 12 5.69",clock:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M12 20 C7.58 20 4 16.42 4 12 C4 7.58 7.58 4 12 4 C16.42 4 20 7.58 20 12 C20 16.42 16.42 20 12 20 Z M13 7 L11 7 L11 13 L16.25 15.85 L17 14.32 L13 12 Z",calendar:"M5 2 L5 4 L19 4 L19 2 M3 4 L3 20 C3 21.1 3.9 22 5 22 L19 22 C20.1 22 21 21.1 21 20 L21 4 M7 11 L7 13 L9 13 L9 11 L7 11 Z M12 11 L12 13 L14 13 L14 11 L12 11 Z M17 11 L17 13 L19 13 L19 11 L17 11 Z",filter:"M3 6 L21 6 L18 13 L18 20 L6 20 L6 13 Z",link:"M10 11 C10.8 10.3 12 10.2 12.7 10.2 L20 10.2 C21 10.2 21.8 11 21.8 12 L21.8 19 C21.8 20 21 20.8 20 20.8 L12.7 20.8 C11.7 20.8 10.9 20 10.9 19 L10.9 12 C10.9 11.9 10.91 11.8 10.92 11.7 M7 11 C7.8 10.3 6.5 10.2 5.8 10.2 L1 10.2 C0.1 10.2 0.2 11 0.2 12 L0.2 19 C0.2 20 0.9 20.8 1.8 20.8 L5.8 20.8 C6.8 20.8 7.6 20 7.6 19 L7.6 12 C7.6 11.9 7.59 11.8 7.58 11.7",lock:"M7 10 L7 7 C7 4.24 9.24 2 12 2 C14.76 2 17 4.24 17 7 L17 10 M5 10 L19 10 L19 20 C19 21.1 18.1 22 17 22 L7 22 C5.9 22 5 21.1 5 20 Z",unlock:"M7 10 L19 10 L19 20 C19 21.1 18.1 22 17 22 L7 22 C5.9 22 5 21.1 5 20 L5 10 L5 7 C5 4.24 7.24 2 10 2 C12.76 2 15 4.24 15 7 L13 7 C13 5.34 11.66 4 10 4 C8.34 4 7 5.34 7 7 Z",user:"M12 12 C13.66 12 15 10.66 15 9 C15 7.34 13.66 6 12 6 C10.34 6 9 7.34 9 9 C9 10.66 10.34 12 12 12 Z M12 22 C16.42 22 21 20 21 16 L21 14 C21 11.79 19.21 10 17 10 L7 10 C4.79 10 3 11.79 3 14 L3 16 C3 20 7.58 22 12 22 Z",copy:"M16 1 L4 1 C2.9 1 2 1.9 2 3 L2 17 L4 17 L4 3 L16 3 Z M20 5 L8 5 C6.9 5 6 5.9 6 7 L6 21 C6 22.1 6.9 23 8 23 L20 23 C21.1 23 22 22.1 22 21 L22 7 C22 5.9 21.1 5 20 5 Z",info:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M13 17 L11 17 L11 11 L13 11 Z M13 9 L11 9 L11 7 L13 7 Z",help:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M13 19 L11 19 L11 17 L13 17 Z M15.07 10.25 C14.29 11.29 13.5 12 13 12.9 L13 14 L11 14 L11 13 C11 11.52 11.79 10.29 12.93 9.07 C13.62 8.29 14.29 7.5 14.29 6.5 C14.29 5.42 13.47 4.6 12.4 4.6 C11.4 4.6 10.6 5.36 10.6 6.3 L8.6 6.2 C8.72 4.5 10.09 3.1 12.4 3.1 C14.84 3.1 16.3 4.5 16.3 6.42 C16.3 7.8 15.66 8.9 15.07 10.25 Z",spinner:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 M12 2 C6.48 2 2 6.48 2 12",loading:"M12 2 C6.48 2 2 6.48 2 12",moreVertical:"M12 8 C13.1 8 14 7.1 14 6 C14 4.9 13.1 4 12 4 C10.9 4 10 4.9 10 6 C10 7.1 10.9 8 12 8 Z M12 14 C13.1 14 14 13.1 14 12 C14 10.9 13.1 10 12 10 C10.9 10 10 10.9 10 12 C10 13.1 10.9 14 12 14 Z M12 20 C13.1 20 14 19.1 14 18 C14 16.9 13.1 16 12 16 C10.9 16 10 16.9 10 18 C10 19.1 10.9 20 12 20 Z",moreHorizontal:"M6 10 C4.9 10 4 10.9 4 12 C4 13.1 4.9 14 6 14 C7.1 14 8 13.1 8 12 C8 10.9 7.1 10 6 10 Z M18 10 C16.9 10 16 10.9 16 12 C16 13.1 16.9 14 18 14 C19.1 14 20 13.1 20 12 C20 10.9 19.1 10 18 10 Z M12 10 C10.9 10 10 10.9 10 12 C10 13.1 10.9 14 12 14 C13.1 14 14 13.1 14 12 C14 10.9 13.1 10 12 10 Z",reload:"M7 7 C4.24 7 2 9.24 2 12 C2 14.56 3.68 16.73 6 17.73 L6 15.95 C4.29 15.16 3 13.32 3 11.13 C3 8.82 4.82 7 7 7 Z M17 7 C19.76 7 22 9.24 22 12 C22 14.13 20.71 15.97 18.7 16.76 L18.7 18.54 C21.32 17.54 23 15.56 23 13 C23 10.24 20.76 8 18 8 Z M11.5 5 L14.5 8 L8.5 8 Z M8.5 16 L14.5 16 L11.5 19 Z",arrowRight:"M5 12 L19 12 M13 6 L19 12 L13 18",arrowLeft:"M19 12 L5 12 M11 6 L5 12 L11 18",arrowUp:"M12 19 L12 5 M6 11 L12 5 L18 11",arrowDown:"M12 5 L12 19 M6 13 L12 19 L18 13",star:"M12 2 L15.09 10.26 L24 10.26 L17.55 15.13 L19.64 23.39 L12 18.53 L4.36 23.39 L6.45 15.13 L0 10.26 L8.91 10.26 Z",heart:"M20.84 4.61 C20.02 3.78 18.98 3.37 17.93 3.37 C16.88 3.37 15.84 3.78 15.02 4.61 L12 7.63 L8.98 4.61 C7.30 2.92 4.71 2.92 3.02 4.61 C1.33 6.30 1.33 8.88 3.02 10.57 L12 19.58 L20.99 10.57 C22.68 8.88 22.68 6.30 20.84 4.61 Z",palette:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M7 12 C8.1 12 9 11.1 9 10 C9 8.9 8.1 8 7 8 C5.9 8 5 8.9 5 10 C5 11.1 5.9 12 7 12 Z M17 12 C18.1 12 19 11.1 19 10 C19 8.9 18.1 8 17 8 C15.9 8 15 8.9 15 10 C15 11.1 15.9 12 17 12 Z M12 17 C10.9 17 10 16.1 10 15 C10 13.9 10.9 13 12 13 C13.1 13 14 13.9 14 15 C14 16.1 13.1 17 12 17 Z M7 17 C5.9 17 5 16.1 5 15 C5 13.9 5.9 13 7 13 C8.1 13 9 13.9 9 15 C9 16.1 8.1 17 7 17 Z M17 17 C15.9 17 15 16.1 15 15 C15 13.9 15.9 13 17 13 C18.1 13 19 13.9 19 15 C19 16.1 18.1 17 17 17 Z",component:"M5 3 L19 3 L19 9 L5 9 Z M5 11 L19 11 L19 17 L5 17 Z M3 20 L21 20",table:"M3 4 L21 4 M3 4 L3 20 L21 20 L21 4 M3 8 L21 8 M3 12 L21 12 M3 16 L21 16 M8 4 L8 20 M13 4 L13 20 M18 4 L18 20",layout:"M3 3 L21 3 L21 21 L3 21 Z M3 8 L21 8 M3 3 L3 21 M8 8 L8 21",moon:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z",sun:"M12 3v2M12 19v2M5.64 5.64l1.42 1.42M16.95 16.95l1.41 1.41M3 12h2M19 12h2M5.64 18.36l1.41-1.41M16.95 7.05l1.41-1.41M12 7a5 5 0 1 0 0 10A5 5 0 0 0 12 7z","bar-chart":"M3 3 L3 20 L21 20 M5 16 L5 9 M12 16 L12 5 M19 16 L19 8","trending-up":"M23 6 L13.5 15.5 M23 6 L23 13 L16 13 M1 23 L6.5 17.5 L13 24 L23 6","trending-down":"M23 18 L13.5 8.5 M23 18 L23 11 L16 11 M1 1 L6.5 6.5 L13 0 L23 18",send:"M16 8 L2 5 L9.5 12 L2 19 L16 16 M7 12 L16 12",bot:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M7 8 L7 10 L9 10 L9 8 Z M15 8 L15 10 L17 10 L17 8 Z M9 14 L15 14 M12 14 L12 18",paperclip:"M12.5 2 C9.46 2 7 4.46 7 7.5 C7 10.54 9.46 13 12.5 13 L18 13 C18.55 13 19 12.55 19 12 C19 11.45 18.55 11 18 11 L12.5 11 C10.57 11 9 9.43 9 7.5 C9 5.57 10.57 4 12.5 4 C14.43 4 16 5.57 16 7.5 L16 15 C16 18.31 13.31 21 10 21 C6.69 21 4 18.31 4 15 L4 7 C4 5.9 4.9 5 6 5 C7.1 5 8 5.9 8 7 L8 15 C8 16.1 8.9 17 10 17 C11.1 17 12 16.1 12 15 L12 7.5","pie-chart":"M21.21 15.89 L12 12 L12 2.69 A10 10 0 0 1 21.21 15.89 M12 12 L5.5 5.5 A10 10 0 0 0 2 12 M2 12 A10 10 0 0 0 12 22 A10 10 0 0 0 12 12",slash:"M21 3 L3 21",file:"M14 2 L6 2 C4.9 2 4 2.9 4 4 L4 20 C4 21.1 4.9 22 6 22 L18 22 C19.1 22 20 21.1 20 20 L20 8 Z M14 2 L14 8 L20 8 M16 13 L8 13 M16 17 L8 17 M10 9 L8 9",zap:"M13 2 L3 14 L12 14 L11 22 L21 10 L12 10 Z",hardDrive:"M22 12 L2 12 M2 9 C2 7.9 2.9 7 4 7 L20 7 C21.1 7 22 7.9 22 9 L22 19 C22 20.1 21.1 21 20 21 L4 21 C2.9 21 2 20.1 2 19 Z M6 17 L6.01 17",folder:"M20 20 C21.1 20 22 19.1 22 18 L22 8 C22 6.9 21.1 6 20 6 L12.1 6 C11.43 6 10.8 5.68 10.41 5.13 L9.6 3.9 C9.22 3.34 8.59 3 7.93 3 L4 3 C2.9 3 2 3.9 2 5 L2 18 C2 19.1 2.9 20 4 20 Z",tag:"M12.59 2.59 C12.21 2.21 11.7 2 11.17 2 L4 2 C2.9 2 2 2.9 2 4 L2 11.17 C2 11.7 2.21 12.21 2.59 12.59 L11.29 21.29 C12.07 22.07 13.34 22.07 14.12 21.29 L20.7 14.71 C21.48 13.93 21.48 12.66 20.7 11.88 Z M7.5 7.5 L7.51 7.5",gitBranch:"M6 3 L6 15 M6 6 C7.66 6 9 4.66 9 3 C9 1.34 7.66 0 6 0 C4.34 0 3 1.34 3 3 C3 4.66 4.34 6 6 6 Z M6 24 C7.66 24 9 22.66 9 21 C9 19.34 7.66 18 6 18 C4.34 18 3 19.34 3 21 C3 22.66 4.34 24 6 24 Z M18 9 C19.66 9 21 7.66 21 6 C21 4.34 19.66 3 18 3 C16.34 3 15 4.34 15 6 C15 7.66 16.34 9 18 9 Z M18 9 C18 13 15 15 9 15",image:"M3 3 L21 3 L21 21 L3 21 Z M8.5 10 C9.6 10 10.5 9.1 10.5 8 C10.5 6.9 9.6 6 8.5 6 C7.4 6 6.5 6.9 6.5 8 C6.5 9.1 7.4 10 8.5 10 Z M21 15 L16 10 L5 21",code:"M9 18 L3 12 L9 6 M15 6 L21 12 L15 18",map:"M9 3 L3 5 L3 19 L9 17 M9 3 L15 5 M9 3 L9 17 M15 5 L21 3 L21 17 L15 19 M15 5 L15 19 M9 17 L15 19",sparkles:"M12 2 L14 9 L21 11 L14 13 L12 20 L10 13 L3 11 L10 9 Z M19 3 L20 5.5 L22.5 6.5 L20 7.5 L19 10 L18 7.5 L15.5 6.5 L18 5.5 Z",share:"M18 8 C19.66 8 21 6.66 21 5 C21 3.34 19.66 2 18 2 C16.34 2 15 3.34 15 5 C15 6.66 16.34 8 18 8 Z M6 15 C7.66 15 9 13.66 9 12 C9 10.34 7.66 9 6 9 C4.34 9 3 10.34 3 12 C3 13.66 4.34 15 6 15 Z M18 22 C19.66 22 21 20.66 21 19 C21 17.34 19.66 16 18 16 C16.34 16 15 17.34 15 19 C15 20.66 16.34 22 18 22 Z M8.59 13.51 L15.42 17.49 M15.41 6.51 L8.59 10.49",ellipsis:"M6 12 C6 13.1 5.1 14 4 14 C2.9 14 2 13.1 2 12 C2 10.9 2.9 10 4 10 C5.1 10 6 10.9 6 12 Z M14 12 C14 13.1 13.1 14 12 14 C10.9 14 10 13.1 10 12 C10 10.9 10.9 10 12 10 C13.1 10 14 10.9 14 12 Z M22 12 C22 13.1 21.1 14 20 14 C18.9 14 18 13.1 18 12 C18 10.9 18.9 10 20 10 C21.1 10 22 10.9 22 12 Z",zoomIn:"M11 3 C15.42 3 19 6.58 19 11 C19 15.42 15.42 19 11 19 C6.58 19 3 15.42 3 11 C3 6.58 6.58 3 11 3 M21 21 L16.65 16.65 M11 8 L11 14 M8 11 L14 11",zoomOut:"M11 3 C15.42 3 19 6.58 19 11 C19 15.42 15.42 19 11 19 C6.58 19 3 15.42 3 11 C3 6.58 6.58 3 11 3 M21 21 L16.65 16.65 M8 11 L14 11",maximize:"M3 8 L3 3 L8 3 M16 3 L21 3 L21 8 M21 16 L21 21 L16 21 M8 21 L3 21 L3 16",fullscreen:"M15 3 L21 3 L21 9 M9 21 L3 21 L3 15 M21 3 L14 10 M3 21 L10 14",fullscreenExit:"M20 10 L14 10 L14 4 M4 14 L10 14 L10 20 M14 10 L21 3 M10 14 L3 21",orbit:"M21 12 C21 9.52 16.97 7.5 12 7.5 C7.03 7.5 3 9.52 3 12 C3 14.48 7.03 16.5 12 16.5 C16.97 16.5 21 14.48 21 12 M22.8 12 C22.8 13 22 13.8 21 13.8 C20 13.8 19.2 13 19.2 12 C19.2 11 20 10.2 21 10.2 C22 10.2 22.8 11 22.8 12"},Ee=re.forwardRef((o,c)=>{var u=o,{name:e,size:t=24,className:n="","aria-label":i}=u,r=pe(u,["name","size","className","aria-label"]);const h=dM[e];return h?d.jsx("svg",V(R({ref:c,viewBox:"0 0 24 24",width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":i?void 0:!0,"aria-label":i,className:n},r),{children:d.jsx("path",{d:h})})):(console.warn(`Icon "${e}" does not exist in ICONS map`),null)});Ee.displayName="Icon";function fM(e){return e.split(" ").slice(0,2).map(t=>t[0]).join("").toUpperCase()}const Do={amber:"linear-gradient(135deg, rgb(var(--accent-primary)), rgb(var(--accent-primary-deep)))",emerald:"linear-gradient(135deg, rgb(var(--status-emerald)), rgb(var(--semantic-emerald-fg)))",rose:"linear-gradient(135deg, rgb(var(--status-rose)), rgb(var(--status-rose-deep)))",cyan:"linear-gradient(135deg, rgb(var(--status-cyan)), rgb(var(--status-cyan-deep)))",violet:"linear-gradient(135deg, rgb(var(--status-violet)), rgb(var(--semantic-violet-fg)))",neutral:"linear-gradient(135deg, rgb(var(--status-neutral)), rgb(var(--semantic-neutral-fg)))"},gx=Object.keys(Do);function hM(e){let t=0;for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);t=(t<<5)-t+i,t=t&t}return Math.abs(t)}function mM(e){const t=hM(e)%gx.length;return gx[t]}function pM(e,t){if(e&&e in Do)return Do[e];if(e)return e;if(t){const n=mM(t);return Do[n]}return Do.amber}const gM=re.forwardRef((p,g)=>{var y=p,{name:e,src:t,size:n="md",shape:i="circle",status:r,color:c,decorative:o,className:u="",style:h}=y,m=pe(y,["name","src","size","shape","status","color","decorative","className","style"]);const[x,_]=M.useState(!1),S=fM(e),w=!t||x,N=["avatar",`avatar--${n}`,`avatar--${i}`,u].filter(Boolean).join(" "),k=w?{background:pM(c,e)}:{display:"none"},C=w?{display:"none"}:{};return d.jsxs("div",V(R({ref:g,className:N,style:h,role:o?void 0:"img","aria-label":o?void 0:r?`${e} (${r})`:e,"aria-hidden":o?"true":void 0},m),{children:[d.jsx("div",{className:"avatar__initials",style:k,children:S}),t&&d.jsx("img",{className:"avatar__image",src:t,alt:"",onError:()=>_(!0),style:C}),r&&d.jsx("div",{className:`avatar__status avatar__status--${r}`,"aria-label":r})]}))});gM.displayName="Avatar";const _n=re.forwardRef((h,u)=>{var m=h,{variant:e="primary",size:t="md",icon:n,className:i="",disabled:r,type:c="button"}=m,o=pe(m,["variant","size","icon","className","disabled","type"]);const g=["btn",`btn--${e}`,`btn--${t}`,n?"btn--icon":"",i].filter(Boolean).join(" ");return d.jsx("button",R({ref:u,type:c,disabled:r,className:g},o))});_n.displayName="Button";const Hn=re.forwardRef((o,c)=>{var u=o,{variant:e="neutral",form:t="default",className:n="",children:i}=u,r=pe(u,["variant","form","className","children"]);const h=["chip",`chip--${t}`,t==="default"&&`chip--${e}`,n].filter(Boolean).join(" ");return d.jsxs("span",V(R({ref:c,className:h},r),{children:[t==="default"&&d.jsx("span",{className:"chip__dot"}),t==="env"&&d.jsx("span",{className:"chip__dot chip__dot--env"}),i]}))});Hn.displayName="Chip";const Qp=re.forwardRef((c,r)=>{var o=c,{color:e="cyan",pulse:t=!1,className:n=""}=o,i=pe(o,["color","pulse","className"]);const u=["badge",`badge--${e}`,t&&"badge--pulse",n].filter(Boolean).join(" ");return d.jsx("span",R({ref:r,className:u},i))});Qp.displayName="Badge";const P_=re.forwardRef((o,c)=>{var u=o,{color:e="cyan",pulse:t=!1,className:n="",role:i="img"}=u,r=pe(u,["color","pulse","className","role"]);const h=["status-badge",`status-badge--${e}`,t&&"status-badge--pulse",n].filter(Boolean).join(" ");return d.jsx("div",R({ref:c,role:i,className:h},r))});P_.displayName="StatusBadge";const Qo=re.forwardRef((c,r)=>{var o=c,{mono:e=!1,error:t=!1,className:n=""}=o,i=pe(o,["mono","error","className"]);const u=["text-input",e&&"text-input--mono",t&&"text-input--error",n].filter(Boolean).join(" ");return d.jsx("input",R({type:"text",ref:r,className:u},i))});Qo.displayName="TextInput";const Zp=re.forwardRef((c,r)=>{var o=c,{mono:e=!1,error:t=!1,className:n=""}=o,i=pe(o,["mono","error","className"]);const u=["text-area",e&&"text-area--mono",t&&"text-area--error",n].filter(Boolean).join(" ");return d.jsx("textarea",R({ref:r,className:u},i))});Zp.displayName="TextArea";const yM=re.forwardRef((c,r)=>{var o=c,{mono:e=!1,error:t=!1,className:n=""}=o,i=pe(o,["mono","error","className"]);const u=["number-input",e&&"number-input--mono",t&&"number-input--error",n].filter(Boolean).join(" ");return d.jsx("input",R({ref:r,type:"number",className:u},i))});yM.displayName="NumberInput";const vM="[data-dropdown-item]:not([data-disabled])";function _d({triggerRef:e,panelRef:t,isOpen:n,onClose:i,itemSelector:r=vM,restoreFocus:c=!0}){const[o,u]=M.useState(null),h=M.useRef(!1),m=M.useCallback(()=>{const g=t.current;return g?Array.from(g.querySelectorAll(r)).map(p=>p.getAttribute("data-dropdown-item")).filter(p=>p!==null&&p.length>0):[]},[t,r]);return M.useEffect(()=>{var g;if(n&&!h.current){h.current=!0;const p=m();u(y=>{var x;return y&&p.includes(y)?y:(x=p[0])!=null?x:null})}else!n&&h.current&&(h.current=!1,u(null),c&&((g=e.current)==null||g.focus()))},[n,m,c,e]),M.useEffect(()=>{if(!n)return;const g=y=>{const x=y.target,_=e.current,S=t.current;_!=null&&_.contains(x)||S!=null&&S.contains(x)||i()},p=y=>{y.key==="Escape"&&(y.preventDefault(),i())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",p)}},[n,i,e,t]),M.useEffect(()=>{if(!n)return;const g=e.current,p=t.current,y=x=>{var _;const S=m();if(S.length===0)return;const w=S.indexOf(o!=null?o:""),N=S.length-1,k=(_=x.target)==null?void 0:_.hasAttribute("data-dropdown-item");switch(x.key){case"ArrowDown":{x.preventDefault();const C=w<N?w+1:0;u(S[C]);break}case"ArrowUp":{x.preventDefault();const C=w>0?w-1:N;u(S[C]);break}case"Tab":{if(!k)return;x.preventDefault();const C=x.shiftKey?-1:1,j=(w+C+S.length)%S.length;u(S[j]);break}case"Home":{x.preventDefault(),u(S[0]);break}case"End":{x.preventDefault(),u(S[N]);break}}};return g==null||g.addEventListener("keydown",y),p==null||p.addEventListener("keydown",y),()=>{g==null||g.removeEventListener("keydown",y),p==null||p.removeEventListener("keydown",y)}},[n,o,m,e,t]),{focusedValue:o,setFocusedValue:u}}const Sd=(e="bottom-start")=>`dropdown-panel--placement-${e}`,$_=M.createContext(void 0);function q_(e){const t=M.useContext($_);if(!t)throw new Error(`${e} must be used inside <Select>`);return t}const V_=re.forwardRef((e,t)=>{var ue;const{placeholder:n="Select…",error:i=!1,disabled:r=!1,id:c,name:o,className:u="",ariaLabel:h,children:m,placement:g="bottom-start"}=e,p=e["data-testid"],y=e.multiple?"multi":"single",x=y==="single"&&e.value!==void 0,_=y==="multi"&&e.values!==void 0,[S,w]=M.useState(y==="single"&&(ue=e.defaultValue)!=null?ue:""),[N,k]=M.useState(()=>{var I;return new Set(y==="multi"?(I=e.defaultValues)!=null?I:[]:[])}),C=M.useMemo(()=>{var I,ie;if(y==="single"){const ye=x?(I=e.value)!=null?I:"":S;return ye?new Set([ye]):new Set}return _?new Set((ie=e.values)!=null?ie:[]):N},[y,x,_,e.value,e.values,S,N]),[j,A]=M.useState(!1),L=M.useRef(null),z=M.useRef(null),F=M.useRef(null),[D,T]=M.useState(new Map),B=M.useCallback((I,ie)=>(T(ye=>{if(ye.get(I)===ie)return ye;const xe=new Map(ye);return xe.set(I,ie),xe}),()=>{T(ye=>{if(!ye.has(I))return ye;const xe=new Map(ye);return xe.delete(I),xe})}),[]),P=M.useCallback(I=>{r||A(I)},[r]),K=M.useCallback(()=>A(!1),[]),{focusedValue:H,setFocusedValue:q}=_d({triggerRef:L,panelRef:z,isOpen:j,onClose:K});M.useEffect(()=>{if(j&&C.size>0&&!H){const I=C.values().next().value;I&&q(I)}},[j,C,H,q]);const $=M.useCallback(I=>{var ie,ye;if(y==="single")x||w(I),(ie=e.onChange)==null||ie.call(e,I),A(!1);else{const xe=new Set(C);xe.has(I)?xe.delete(I):xe.add(I),_||k(xe),(ye=e.onValuesChange)==null||ye.call(e,Array.from(xe))}},[y,x,_,C,e]),Q={mode:y,isOpen:j,onOpenChange:P,selectedValues:C,onValueChange:$,focusedValue:H,setFocusedValue:q,registerItem:B,panelRef:z},G=M.useMemo(()=>{var xe,Ce;if(C.size===0)return d.jsx("span",{className:"select__placeholder",children:n});if(y==="single"){const Se=C.values().next().value;return d.jsx("span",{className:"select__value",children:(xe=D.get(Se))!=null?xe:Se})}const I=Array.from(C),ie=I[0],ye=(Ce=D.get(ie))!=null?Ce:ie;return I.length===1?d.jsx("span",{className:"select__value",children:ye}):d.jsxs("span",{className:"select__value",children:[ye," ",d.jsxs("span",{className:"select__value-count",children:["+",I.length-1]})]})},[C,D,y,n]),W=I=>{j||(I.key==="ArrowDown"||I.key==="ArrowUp"||I.key==="Enter"||I.key===" ")&&(I.preventDefault(),P(!0))},O=o&&C.size>0?Array.from(C).map(I=>d.jsx("input",{type:"hidden",name:o,value:I},I)):null,se=I=>{L.current=I,typeof t=="function"?t(I):t&&(t.current=I)};return d.jsx($_.Provider,{value:Q,children:d.jsxs("div",{ref:F,className:["select",i&&"select--error",r&&"select--disabled",u].filter(Boolean).join(" "),"data-testid":p,children:[d.jsxs("button",{ref:se,id:c,type:"button",className:"select__trigger","aria-haspopup":"listbox","aria-expanded":j,"aria-invalid":i||void 0,"aria-label":h,disabled:r,onClick:()=>P(!j),onKeyDown:W,children:[G,d.jsx(Ee,{name:"chevronDown",size:14,className:`select__chevron ${j?"select__chevron--open":""}`})]}),O,d.jsx("div",{ref:z,role:"listbox","aria-multiselectable":y==="multi"?!0:void 0,className:`dropdown-panel ${Sd(g)} select__panel`,hidden:!j,children:m})]})})});V_.displayName="Select";function xM({value:e,icon:t,description:n,disabled:i=!1,children:r}){const{selectedValues:c,onValueChange:o,focusedValue:u,setFocusedValue:h,registerItem:m,mode:g}=q_("Select.Item"),p=M.useRef(null),y=c.has(e),x=u===e;return M.useEffect(()=>m(e,r),[e,r,m]),M.useEffect(()=>{var _;x&&((_=p.current)==null||_.focus())},[x]),d.jsxs("button",{ref:p,type:"button",role:"option","aria-selected":y,tabIndex:x?0:-1,"data-dropdown-item":e,"data-disabled":i||void 0,disabled:i,onClick:()=>o(e),onMouseEnter:()=>!i&&h(e),className:["dropdown-item",y&&"dropdown-item--selected",x&&"dropdown-item--focused",i&&"dropdown-item--disabled"].filter(Boolean).join(" "),children:[t?d.jsx("span",{className:"dropdown-item__leading",children:d.jsx(Ee,{name:t,size:16})}):null,d.jsxs("span",{className:"dropdown-item__body",children:[d.jsx("span",{className:"dropdown-item__label",children:r}),n&&d.jsx("span",{className:"dropdown-item__description",children:n})]}),g==="single"&&y&&d.jsx("span",{className:"dropdown-item__trailing",children:d.jsx(Ee,{name:"check",size:14})})]})}function bM({value:e,description:t,disabled:n=!1,children:i}){const{selectedValues:r,onValueChange:c,focusedValue:o,setFocusedValue:u,registerItem:h}=q_("Select.CheckboxItem"),m=M.useRef(null),g=r.has(e),p=o===e;return M.useEffect(()=>h(e,i),[e,i,h]),M.useEffect(()=>{var y;p&&((y=m.current)==null||y.focus())},[p]),d.jsxs("button",{ref:m,type:"button",role:"option","aria-selected":g,tabIndex:p?0:-1,"data-dropdown-item":e,"data-disabled":n||void 0,disabled:n,onClick:()=>c(e),onMouseEnter:()=>!n&&u(e),className:["dropdown-item",p&&"dropdown-item--focused",n&&"dropdown-item--disabled"].filter(Boolean).join(" "),children:[d.jsx("span",{className:"dropdown-item__leading",children:d.jsx("input",{type:"checkbox",className:"dropdown-item__checkbox",checked:g,readOnly:!0,tabIndex:-1,"aria-hidden":"true"})}),d.jsxs("span",{className:"dropdown-item__body",children:[d.jsx("span",{className:"dropdown-item__label",children:i}),t&&d.jsx("span",{className:"dropdown-item__description",children:t})]})]})}function _M(){return d.jsx("div",{role:"separator",className:"dropdown-separator"})}function SM({children:e}){return d.jsx("div",{className:"dropdown-section-title",children:e})}const rd=Object.assign(V_,{Item:xM,CheckboxItem:bM,Separator:_M,SectionTitle:SM}),wM=re.forwardRef((c,r)=>{var o=c,{indeterminate:e=!1,className:t="","aria-checked":n}=o,i=pe(o,["indeterminate","className","aria-checked"]);const u=re.useRef(null),h=re.useCallback(g=>{u.current=g,typeof r=="function"?r(g):r&&(r.current=g)},[r]);re.useEffect(()=>{u.current&&(u.current.indeterminate=e)},[e]);const m=["tri-state",e&&"tri-state--indeterminate",t].filter(Boolean).join(" ");return d.jsx("input",V(R({ref:h,type:"checkbox",className:m},i),{"aria-checked":n!=null?n:e?"mixed":i.checked!==void 0?!!i.checked:void 0}))});wM.displayName="TriState";const NM=re.forwardRef((p,g)=>{var y=p,{label:e,htmlFor:t,required:n=!1,disabled:i=!1,error:r,errorId:c,hint:o,children:u,className:h=""}=y,m=pe(y,["label","htmlFor","required","disabled","error","errorId","hint","children","className"]);const x=["field",i?"field--disabled":"",h].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:g,className:x},m),{children:[e&&d.jsxs("label",{className:"field__label",htmlFor:t,children:[d.jsx("span",{children:e}),n&&d.jsx("span",{className:"field__required",children:"*"}),o&&d.jsx("span",{className:"field__hint",children:o})]}),d.jsx("div",{className:"field__input",children:u}),r&&d.jsx("div",{className:"field__error",id:c,children:r})]}))});NM.displayName="Field";const Zo={emerald:"rgb(16 185 129)",amber:"rgb(245 158 11)",rose:"rgb(244 63 94)",cyan:"rgb(34 211 238)",violet:"rgb(139 92 246)",neutral:"rgb(var(--canvas-fg-2))"};function CM(e){return e in Zo?Zo[e]:e}function jM(e){return e.map(([t,n],i)=>(i?"L":"M")+t.toFixed(2)+","+n.toFixed(2)).join(" ")}const Jp=re.forwardRef((g,m)=>{var p=g,{data:e,width:t=88,height:n=28,color:i="emerald",area:r=!0,label:c,className:o="",style:u}=p,h=pe(p,["data","width","height","color","area","label","className","style"]);const y=re.useId(),x=re.useMemo(()=>{if(!e||e.length<2)return null;const N=Math.min(...e),k=Math.max(...e),C=e.map((L,z)=>[z/(e.length-1)*t,n-2-(L-N)/(k-N||1)*(n-4)]),j=jM(C),A=`${j} L${t},${n} L0,${n} Z`;return{line:j,fill:A}},[e,t,n]);if(!x)return null;const _=CM(String(i)),{line:S,fill:w}=x;return d.jsxs("svg",V(R({ref:m,role:"img","aria-label":c!=null?c:"trend sparkline",width:t,height:n,viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"none",style:R({display:"block"},u),className:o},h),{children:[r&&d.jsx("defs",{children:d.jsxs("linearGradient",{id:y,x1:"0",y1:"0",x2:"0",y2:"1",children:[d.jsx("stop",{offset:"0%",stopColor:_,stopOpacity:"0.22"}),d.jsx("stop",{offset:"100%",stopColor:_,stopOpacity:"0"})]})}),r&&d.jsx("path",{d:w,fill:`url(#${y})`}),d.jsx("path",{d:S,stroke:_,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})]}))});Jp.displayName="Sparkline";const Ku=re.forwardRef((y,p)=>{var x=y,{label:e="",value:t="",delta:n,color:i="cyan",icon:r,sparkData:c,meta:o,metaIcon:u,className:h="","aria-label":m}=x,g=pe(x,["label","value","delta","color","icon","sparkData","meta","metaIcon","className","aria-label"]);const _=["stat-tile",`stat-tile--${i}`,h].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:p,className:_,"aria-label":m!=null?m:`${e}: ${t}`},g),{children:[d.jsxs("div",{className:"stat-tile__header",children:[d.jsx("div",{className:"stat-tile__label",children:e}),r&&d.jsx(Ee,{name:r,size:14,"aria-hidden":"true"})]}),d.jsx("div",{className:"stat-tile__value",children:t}),(n||o)&&d.jsxs("div",{className:"stat-tile__footer",children:[n&&d.jsxs("span",{className:`stat-tile__delta stat-tile__delta--${n.direction||"up"}`,children:[d.jsxs("span",{className:"stat-tile__delta-value",children:[n.direction==="down"?"−":"+",Math.abs(n.value)]}),n.label&&d.jsx("span",{className:"stat-tile__delta-label",children:n.label})]}),o&&d.jsxs("div",{className:"stat-tile__meta",children:[u&&d.jsx(Ee,{name:u,size:12,"aria-hidden":"true"}),d.jsx("span",{className:"stat-tile__meta-text",children:o})]})]}),c&&d.jsx("div",{className:"stat-tile__sparkline",children:d.jsx(Jp,{data:c,width:88,height:28,color:i||"cyan"})})]}))});Ku.displayName="StatTile";const EM=re.forwardRef((c,r)=>{var o=c,{columns:e=4,className:t="",children:n}=o,i=pe(o,["columns","className","children"]);const u=["stat-grid",`stat-grid--cols-${e}`,t].filter(Boolean).join(" ");return d.jsx("div",V(R({ref:r,className:u},i),{children:n}))});EM.displayName="StatGrid";const aa=re.forwardRef((c,r)=>{var o=c,{className:e="",children:t,tone:n="amber"}=o,i=pe(o,["className","children","tone"]);const u=["version-pill",`version-pill--${n}`,e].filter(Boolean).join(" ");return d.jsx("span",V(R({ref:r,className:u},i),{children:t}))});aa.displayName="VersionPill";const Ss=re.forwardRef((u,o)=>{var h=u,{value:e,onChange:t,options:n,disabled:i=!1,className:r=""}=h,c=pe(h,["value","onChange","options","disabled","className"]);const m=["segmented-control",i?"segmented-control--disabled":"",r].filter(Boolean).join(" "),g=M.useRef([]),p=M.useCallback((_,S)=>{var w;const N=n.map((j,A)=>j.disabled?null:A).filter(j=>j!==null),k=N.indexOf(S);let C;_.key==="ArrowRight"||_.key==="ArrowDown"?(_.preventDefault(),C=N[(k+1)%N.length]):(_.key==="ArrowLeft"||_.key==="ArrowUp")&&(_.preventDefault(),C=N[(k-1+N.length)%N.length]),C!==void 0&&((w=g.current[C])==null||w.focus(),t(n[C].value))},[n,t]),y=n.some(_=>_.value===e),x=n.findIndex(_=>!_.disabled);return d.jsx("div",V(R({ref:o,className:m,role:"radiogroup"},c),{children:n.map((_,S)=>{const w=e===_.value,N=w||!y&&S===x?0:-1;return d.jsx("button",{ref:k=>{g.current[S]=k},className:`segmented-control__segment ${w?"segmented-control__segment--active":""}`,onClick:()=>!i&&!_.disabled&&t(_.value),onKeyDown:k=>p(k,S),type:"button",role:"radio","aria-checked":w,disabled:i||_.disabled,tabIndex:N,children:_.label},_.value)})}))});Ss.displayName="SegmentedControl";const kM=re.forwardRef((y,p)=>{var x=y,{columns:e,data:t,rowKey:n,selectable:i=!1,selectedRows:r=[],onSelectRows:c,onRowClick:o,onSort:u,emptyState:h,className:m=""}=x,g=pe(x,["columns","data","rowKey","selectable","selectedRows","onSelectRows","onRowClick","onSort","emptyState","className"]);const[_,S]=M.useState(null),[w,N]=M.useState("asc"),k=M.useRef(null),C=t.length>0&&r.length===t.length,j=r.length>0&&r.length<t.length;M.useEffect(()=>{k.current&&(k.current.indeterminate=j)},[j]);const A=(B,P)=>typeof n=="function"?n(B,P):B[n],L=()=>{C?c==null||c([]):c==null||c(t.map((B,P)=>A(B,P)))},z=B=>{r.includes(B)?c==null||c(r.filter(P=>P!==B)):c==null||c([...r,B])},F=B=>{_===B?w==="asc"?(N("desc"),u==null||u(B,"desc")):(S(null),u==null||u(B,null)):(S(B),N("asc"),u==null||u(B,"asc"))},D=(B,P)=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),F(P))},T=["table",m].filter(Boolean).join(" ");return d.jsxs("table",V(R({ref:p,className:T},g),{children:[d.jsx("thead",{className:"table__head",children:d.jsxs("tr",{className:"table__row",children:[i&&d.jsx("th",{className:"table__header table__header--checkbox",style:{width:"30px"},children:d.jsx("input",{ref:k,type:"checkbox",className:"table__checkbox",checked:C,onChange:L,"aria-label":"Select all rows"})}),e.map(B=>{const P=String(B.key),K=_===P,H=K?w==="asc"?"ascending":"descending":B.sortable?"none":void 0;return d.jsx("th",{className:`table__header ${B.sortable?"table__header--sortable":""}`,style:{width:B.width},"aria-sort":H,tabIndex:B.sortable?0:void 0,onClick:()=>B.sortable&&F(P),onKeyDown:B.sortable?q=>D(q,P):void 0,children:d.jsxs("div",{className:"table__header-content",children:[B.label,K&&d.jsx(Ee,{name:w==="asc"?"chevronUp":"chevronDown",size:14,className:"table__sort-icon"})]})},P)})]})}),d.jsx("tbody",{className:"table__body",children:t.length===0&&h?d.jsx("tr",{className:"table__row",children:d.jsx("td",{className:"table__cell table__cell--empty",colSpan:e.length+(i?1:0),children:h})}):t.map((B,P)=>{const K=A(B,P),H=r.includes(K),q=!!o;return d.jsxs("tr",{"data-row-key":K,className:["table__row",H?"table__row--selected":"",q?"table__row--clickable":""].filter(Boolean).join(" "),onClick:q?()=>o(B,K):void 0,onKeyDown:q?$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),o(B,K))}:void 0,tabIndex:q?0:void 0,children:[i&&d.jsx("td",{className:"table__cell table__cell--checkbox",children:d.jsx("input",{type:"checkbox",className:"table__checkbox",checked:H,"aria-label":`Select row ${K}`,onChange:()=>z(K),onClick:$=>$.stopPropagation()})}),e.map($=>d.jsx("td",{className:"table__cell",children:$.render?$.render(B[$.key],B,P):B[$.key]},`${K}-${String($.key)}`))]},K)})})]}))});kM.displayName="Table";const Jo=re.forwardRef((g,m)=>{var p=g,{icon:e,label:t,count:n,active:i=!1,depth:r=0,onClick:c,className:o="",type:u="button"}=p,h=pe(p,["icon","label","count","active","depth","onClick","className","type"]);const y=["nav-item",i&&"nav-item--active",r===1&&"nav-item--depth-1",o].filter(Boolean).join(" ");return d.jsxs("button",V(R({ref:m,type:u,className:y,onClick:c,"aria-current":i?"page":void 0},h),{children:[r===0&&e&&d.jsx(Ee,{name:e,size:16,className:"nav-item__icon"}),d.jsx("span",{className:"nav-item__label",children:t}),n!==void 0&&d.jsx("span",{className:"nav-item__count",children:n})]}))});Jo.displayName="NavItem";const Wp=re.forwardRef((h,u)=>{var m=h,{title:e,version:t,collapsed:n=!1,action:i,className:r="","aria-label":c}=m,o=pe(m,["title","version","collapsed","action","className","aria-label"]);const g=["app-title",n&&"app-title--collapsed",r].filter(Boolean).join(" "),p=c!=null?c:t?`${e} ${t}`:e;return d.jsxs("div",V(R({ref:u,className:g,"aria-label":p,role:"banner"},o),{children:[d.jsx("div",{className:"app-title__mark","aria-hidden":"true"}),!n&&d.jsxs("div",{className:"app-title__text",children:[d.jsx("div",{className:"app-title__name",children:e}),t&&d.jsx("span",{className:"app-title__version",children:t})]}),i&&d.jsx("div",{className:"app-title__action",children:i})]}))});Wp.displayName="AppTitle";const G_=re.forwardRef((_,x)=>{var S=_,{sections:e,activeItemId:t,collapsed:n=!1,onCollapse:i,onSelectItem:r,defaultExpandedIds:c,expandedIds:o,onExpandedChange:u,showCollapseToggle:h=!0,appTitle:m,footer:g,className:p=""}=S,y=pe(S,["sections","activeItemId","collapsed","onCollapse","onSelectItem","defaultExpandedIds","expandedIds","onExpandedChange","showCollapseToggle","appTitle","footer","className"]);var z;const w=o!==void 0,[N,k]=M.useState(()=>new Set(c)),C=w?new Set(o):N,j=F=>{const D=new Set(C);D.has(F)?D.delete(F):D.add(F),w||k(D),u==null||u(Array.from(D))},A=["sidebar",n&&"sidebar--collapsed",p].filter(Boolean).join(" "),L=d.jsx("button",{type:"button",className:"sidebar__toggle",onClick:()=>i==null?void 0:i(!n),"aria-label":n?"Expand sidebar":"Collapse sidebar",children:d.jsx(Ee,{name:n?"chevronRight":"chevronLeft",size:16})});return d.jsxs("div",V(R({ref:x,className:A},y),{children:[m?d.jsxs(d.Fragment,{children:[d.jsx(Wp,V(R({},m),{collapsed:n,action:n?m.action:(z=m.action)!=null?z:L})),n&&L]}):h&&L,d.jsx("nav",{className:"sidebar__nav","aria-label":"Sidebar navigation",children:e.map(F=>d.jsxs("div",{className:"sidebar__section",children:[!n&&d.jsx("div",{className:"sidebar__section-title",children:F.title}),d.jsx("div",{className:"sidebar__items",children:F.items.map(D=>{const T=D.children&&D.children.length>0,B=C.has(D.id),P=t===D.id;return d.jsxs(re.Fragment,{children:[d.jsxs("button",{type:"button",className:`sidebar__item ${P?"sidebar__item--active":""}`,onClick:()=>{T?j(D.id):r==null||r(D.id)},title:n?D.label:void 0,"aria-current":P?"page":void 0,"aria-expanded":T?B:void 0,children:[D.icon&&d.jsx(Ee,{name:D.icon,size:18,className:"sidebar__item-icon"}),!n&&d.jsx("span",{className:"sidebar__item-label",children:D.label}),!n&&D.count!==void 0&&d.jsx("span",{className:"sidebar__item-count",children:D.count}),!n&&T&&d.jsx(Ee,{name:"chevronRight",size:14,className:`sidebar__item-chevron ${B?"sidebar__item-chevron--open":""}`})]}),!n&&T&&B&&D.children.map(K=>d.jsxs("button",{type:"button",className:`sidebar__item sidebar__item--child ${t===K.id?"sidebar__item--active":""}`,onClick:()=>r==null?void 0:r(K.id),"aria-current":t===K.id?"page":void 0,children:[d.jsx("span",{className:"sidebar__item-label",children:K.label}),K.count!==void 0&&d.jsx("span",{className:"sidebar__item-count",children:K.count})]},K.id))]},D.id)})})]},F.title))}),g&&d.jsx("div",{className:"sidebar__footer",children:g})]}))});G_.displayName="Sidebar";const Y_=re.forwardRef((m,h)=>{var g=m,{breadcrumbs:e,searchPlaceholder:t="Search…",onSearch:n,leadingContent:i,searchHint:r,children:c,className:o=""}=g,u=pe(g,["breadcrumbs","searchPlaceholder","onSearch","leadingContent","searchHint","children","className"]);const p=["topbar",o].filter(Boolean).join(" "),y=e?e.length-1:-1;return d.jsxs("div",V(R({ref:h,className:p},u),{children:[i&&d.jsx("div",{className:"topbar__leading",children:i}),d.jsx("div",{className:"topbar__breadcrumbs",children:e&&e.length>0&&d.jsx("nav",{className:"breadcrumbs","aria-label":"Breadcrumb",children:e.map((x,_)=>d.jsxs(re.Fragment,{children:[_>0&&d.jsx("span",{className:"breadcrumbs__separator","aria-hidden":"true",children:"/"}),x.href?d.jsx("a",{href:x.href,className:"breadcrumbs__link","aria-current":_===y?"page":void 0,children:x.label}):x.onClick?d.jsx("button",{type:"button",className:"breadcrumbs__link breadcrumbs__link--button",onClick:x.onClick,"aria-current":_===y?"page":void 0,children:x.label}):d.jsx("span",{className:"breadcrumbs__link breadcrumbs__link--static","aria-current":_===y?"page":void 0,children:x.label})]},_))})}),d.jsxs("div",{className:"topbar__actions",children:[n&&d.jsxs("div",{className:"topbar__search-wrap",children:[d.jsx("input",{type:"search",placeholder:t,"aria-label":t,className:"topbar__search",onChange:x=>n(x.target.value)}),r&&d.jsx("span",{className:"topbar__search-hint",children:r})]}),c]})]}))});Y_.displayName="Topbar";const MM=re.forwardRef((o,c)=>{var u=o,{tabs:e=[],activeTabId:t="",onSelectTab:n,className:i=""}=u,r=pe(u,["tabs","activeTabId","onSelectTab","className"]);const h=["tab-bar",i].filter(Boolean).join(" "),m=M.useRef([]),g=M.useCallback((p,y)=>{var x;const _=e.map((N,k)=>N.disabled?-1:k).filter(N=>N!==-1),S=_.indexOf(y);let w;p.key==="ArrowRight"?w=_[(S+1)%_.length]:p.key==="ArrowLeft"?w=_[(S-1+_.length)%_.length]:p.key==="Home"?w=_[0]:p.key==="End"&&(w=_[_.length-1]),w!==void 0&&(p.preventDefault(),(x=m.current[w])==null||x.focus(),n==null||n(e[w].id))},[e,n]);return d.jsx("div",V(R({ref:c,className:h,role:"tablist"},r),{children:d.jsx("div",{className:"tab-bar__tabs",children:e.map((p,y)=>d.jsxs("button",{type:"button",ref:x=>{m.current[y]=x},role:"tab","aria-selected":t===p.id,"aria-disabled":p.disabled,tabIndex:p.disabled?-1:t===p.id?0:-1,className:["tab-bar__tab",t===p.id?"tab-bar__tab--active":"",p.disabled?"tab-bar__tab--disabled":""].filter(Boolean).join(" "),onClick:()=>!p.disabled&&(n==null?void 0:n(p.id)),onKeyDown:x=>g(x,y),children:[d.jsx("span",{className:"tab-bar__tab-label",children:p.label}),p.count!==void 0&&d.jsx(Hn,{form:"id-tag",children:p.count})]},p.id))})}))});MM.displayName="TabBar";const K_=re.forwardRef((h,u)=>{var m=h,{left:e,center:t,right:n,className:i="",role:r="banner","aria-label":c="Application titlebar"}=m,o=pe(m,["left","center","right","className","role","aria-label"]);const g=["titlebar",i].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:u,className:g,role:r,"aria-label":c},o),{children:[e&&d.jsx("div",{className:"titlebar__slot titlebar__slot--left",children:e}),t&&d.jsx("div",{className:"titlebar__slot titlebar__slot--center",children:t}),n&&d.jsx("div",{className:"titlebar__slot titlebar__slot--right",children:n})]}))});K_.displayName="Titlebar";const TM=e=>typeof e=="object"&&e!==null&&"kind"in e,RM=e=>e.map((t,n)=>{switch(t.kind){case"divider":return d.jsx("div",{className:"statusbar__divider"},n);case"pulse":return d.jsxs("div",{className:"statusbar__item statusbar__item--pulse",children:[d.jsx("div",{className:`statusbar__pulse statusbar__pulse--${t.tone}`}),t.mono?d.jsx("span",{className:"statusbar__label statusbar__label--mono",children:t.label}):d.jsx("span",{className:"statusbar__label",children:t.label})]},n);case"icon":return d.jsxs("div",{className:`statusbar__item ${t.mono?"statusbar__item--mono":""}`,"aria-label":t.label,children:[d.jsx(Ee,{name:t.icon,size:14}),t.label&&d.jsx("span",{className:"statusbar__label",children:t.label})]},n);default:return t}}),eg=re.forwardRef((o,c)=>{var u=o,{left:e,center:t,right:n,className:i=""}=u,r=pe(u,["left","center","right","className"]);const h=["statusbar",i].filter(Boolean).join(" "),m=g=>g?Array.isArray(g)&&g.length>0&&TM(g[0])?RM(g):g:null;return d.jsxs("div",V(R({ref:c,role:"status",className:h},r),{children:[e&&d.jsx("div",{className:"statusbar__slot statusbar__slot--left statusbar__left",children:m(e)}),t&&d.jsx("div",{className:"statusbar__slot statusbar__slot--center",children:m(t)}),n&&d.jsx("div",{className:"statusbar__slot statusbar__slot--right statusbar__right",children:m(n)})]}))});eg.displayName="Statusbar";const AM=re.forwardRef((m,h)=>{var g=m,{titlebar:e,appTitle:t,topbar:n,sidebar:i,statusbar:r,children:c,className:o=""}=g,u=pe(g,["titlebar","appTitle","topbar","sidebar","statusbar","children","className"]);const p=["shell-layout",o].filter(Boolean).join(" "),B=e!=null?e:{},{hide:y}=B,x=pe(B,["hide"]),_=e&&!e.hide,P=t!=null?t:{},{hide:S}=P,w=pe(P,["hide"]),N=t&&!t.hide,K=n!=null?n:{},{hide:k}=K,C=pe(K,["hide"]),j=n&&!n.hide,H=i!=null?i:{},{hide:A}=H,L=pe(H,["hide"]),z=i&&!i.hide,q=r!=null?r:{},{hide:F}=q,D=pe(q,["hide"]),T=r&&!r.hide;return d.jsxs("div",V(R({ref:h,className:p},u),{children:[_&&d.jsx(K_,R({},x)),d.jsxs("div",{className:"shell-layout__main",children:[z?d.jsx("div",{className:"shell-layout__sidebar-col",children:d.jsx(G_,V(R({},L),{appTitle:N?w:L.appTitle}))}):N?d.jsx(Wp,R({},w)):null,d.jsxs("div",{className:"shell-layout__content",children:[j&&d.jsx(Y_,R({},C)),d.jsx("main",{className:"shell-layout__canvas",children:c})]})]}),T&&d.jsx(eg,R({},D))]}))});AM.displayName="ShellLayout";const LM=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'];function wd(e,t,n){var c;const i=M.useRef(null),r=(c=n==null?void 0:n.mode)!=null?c:"modal";M.useEffect(()=>{if(!t||!e.current)return;i.current=document.activeElement;const o=()=>e.current?Array.from(e.current.querySelectorAll(LM.join(","))):[],u=m=>{if(m.key!=="Tab")return;const g=o();if(g.length===0)return;const p=g[0],y=g[g.length-1];m.shiftKey?document.activeElement===p&&(m.preventDefault(),y.focus()):document.activeElement===y&&(m.preventDefault(),p.focus())},h=o();return h.length>0&&r==="modal"&&h[0].focus(),e.current.addEventListener("keydown",u),()=>{var m;(m=e.current)==null||m.removeEventListener("keydown",u);const g=i.current;g&&document.body.contains(g)&&g.focus()}},[e,t,r])}let Tu=0,Ru=null;function tg(e){M.useEffect(()=>{if(e)return Tu===0&&(Ru=document.body.style.overflow,document.body.style.overflow="hidden"),Tu++,()=>{Tu--,Tu===0&&Ru!==null&&(document.body.style.overflow=Ru,Ru=null)}},[e])}const ng=re.forwardRef((p,g)=>{var y=p,{isOpen:e,onClose:t,title:n,subtitle:i,children:r,footer:c,hintFooter:o,size:u="md",className:h=""}=y,m=pe(y,["isOpen","onClose","title","subtitle","children","footer","hintFooter","size","className"]);const x=re.useId(),_=M.useRef(null),S=M.useRef(null);M.useImperativeHandle(g,()=>S.current),wd(S,e),tg(e),M.useEffect(()=>{const N=k=>{k.key==="Escape"&&e&&t()};if(e)return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[e,t]);const w=N=>{N.target===_.current&&t()};return e?d.jsx("div",{ref:_,className:"modal-backdrop",onClick:w,children:d.jsxs("div",V(R({ref:S,className:["modal",`modal--${u}`,h].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-labelledby":n?x:void 0},m),{children:[n&&d.jsxs("div",{className:"modal__header",children:[d.jsxs("div",{className:"modal__header-text",children:[d.jsx("div",{id:x,className:"modal__title",children:n}),i&&d.jsx("div",{className:"modal__subtitle",children:i})]}),d.jsx("button",{type:"button",className:"modal__close",onClick:t,"aria-label":"Close dialog",children:d.jsx(Ee,{name:"x",size:14})})]}),d.jsx("div",{className:"modal__body",children:r}),c&&d.jsx("div",{className:"modal__footer",children:c}),o&&d.jsx("div",{className:"modal__foot-hint",children:o})]}))}):null});ng.displayName="Modal";const X_=re.forwardRef(({isOpen:e,onClose:t,onConfirm:n,title:i,subtitle:r,message:c,confirmLabel:o="Confirm",cancelLabel:u="Cancel",variant:h="danger"},m)=>d.jsxs(ng,{ref:m,isOpen:e,onClose:t,title:i,subtitle:r,children:[d.jsx("div",{className:"confirm-dialog__message",children:c}),d.jsxs("div",{className:"confirm-dialog__footer",children:[d.jsx(_n,{variant:"ghost",size:"sm",onClick:t,children:u}),d.jsx(_n,{variant:h,size:"sm",onClick:n,children:o})]})]}));X_.displayName="ConfirmDialog";function mm({icon:e,title:t,description:n,onClick:i}){return d.jsxs("button",{type:"button",className:"workspace-switcher-dialog__action-tile",onClick:i,children:[d.jsx("div",{className:"workspace-switcher-dialog__action-icon",children:d.jsx(Ee,{name:e,size:20})}),d.jsx("div",{className:"workspace-switcher-dialog__action-title",children:t}),d.jsx("div",{className:"workspace-switcher-dialog__action-desc",children:n})]})}const DM=re.forwardRef(({isOpen:e,onClose:t,title:n="Switch Workspace",current:i,recent:r=[],onOpenFolder:c,onNewWorkspace:o,onCloneFromGit:u,onPickRecent:h},m)=>d.jsx(ng,{ref:m,isOpen:e,onClose:t,title:n,size:"lg",children:d.jsxs("div",{className:"workspace-switcher-dialog__content",children:[(c||o||u)&&d.jsxs("div",{className:"workspace-switcher-dialog__tiles",children:[c&&d.jsx(mm,{icon:"folder",title:"Open folder…",description:"Point to an existing workspace directory",onClick:c}),o&&d.jsx(mm,{icon:"plus",title:"New workspace…",description:"Initialize a fresh local workspace",onClick:o}),u&&d.jsx(mm,{icon:"gitBranch",title:"Clone from git…",description:"Pull a workspace from a remote repository",onClick:u})]}),r.length>0&&d.jsxs("div",{className:"workspace-switcher-dialog__recent",children:[d.jsx("div",{className:"workspace-switcher-dialog__recent-header",children:"Recent"}),d.jsx("div",{className:"workspace-switcher-dialog__recent-list",children:r.map(g=>{const p=(i==null?void 0:i.id)===g.id;return d.jsxs("button",{type:"button",className:`workspace-switcher-dialog__recent-item ${p?"workspace-switcher-dialog__recent-item--current":""}`,"aria-current":p?!0:void 0,onClick:()=>h(g),children:[d.jsxs("div",{className:"workspace-switcher-dialog__recent-main",children:[d.jsx("span",{className:"workspace-switcher-dialog__recent-name",children:g.name}),p&&d.jsx("span",{className:"workspace-switcher-dialog__open-badge",children:"open"})]}),d.jsxs("div",{className:"workspace-switcher-dialog__recent-meta",children:[g.path&&d.jsx("span",{className:"workspace-switcher-dialog__recent-path",children:g.path}),(g.classCount!=null||g.individualCount!=null)&&d.jsxs("span",{className:"workspace-switcher-dialog__recent-stats",children:[g.classCount!=null&&`${g.classCount} cls`,g.classCount!=null&&g.individualCount!=null&&" · ",g.individualCount!=null&&`${g.individualCount} ind`]})]})]},g.id)})})]})]})}));DM.displayName="WorkspaceSwitcherDialog";const Q_=M.createContext(void 0);function Nd(){const e=M.useContext(Q_);if(!e)throw new Error("FilterDropdown components must be used within FilterDropdown");return e}const Z_=re.forwardRef(({mode:e="checkbox",children:t,onChange:n,className:i="",defaultValue:r,value:c,placement:o="bottom-start"},u)=>{const[h,m]=M.useState(!1),g=c!==void 0,[p,y]=M.useState(new Set(r!=null?r:[])),x=g?new Set(c):p,_=M.useRef(null),S=M.useRef(null),w=M.useRef(null),N=M.useCallback(()=>m(!1),[]),{focusedValue:k,setFocusedValue:C}=_d({triggerRef:_,panelRef:S,isOpen:h,onClose:N}),j=M.useCallback(z=>{m(z)},[]),A=M.useCallback((z,F)=>{const D=new Set(x);F?(e==="radio"&&D.clear(),D.add(z)):D.delete(z),g||y(D),n==null||n(Array.from(D)),e==="radio"&&F&&m(!1)},[x,e,n,g]),L={isOpen:h,onOpenChange:j,mode:e,selectedValues:x,onValueChange:A,focusedValue:k,setFocusedValue:C,triggerRef:_,panelRef:S,placement:o};return d.jsx(Q_.Provider,{value:L,children:d.jsx("div",{ref:z=>{w.current=z,typeof u=="function"?u(z):u&&(u.current=z)},className:`filter-dropdown ${i}`.trim(),children:t})})});Z_.displayName="FilterDropdown";function OM(i){var r=i,{label:e,summary:t}=r,n=pe(r,["label","summary"]);const{isOpen:c,onOpenChange:o,triggerRef:u,mode:h}=Nd();return d.jsxs("button",V(R({ref:u,type:"button"},n),{className:"filter-dropdown__trigger",onClick:()=>o(!c),"aria-haspopup":h==="radio"?"dialog":"listbox","aria-expanded":c,children:[d.jsx("span",{className:"filter-dropdown__label",children:e}),d.jsx("span",{className:"filter-dropdown__summary",children:t}),d.jsx(Ee,{name:"chevronDown",size:14,className:`filter-dropdown__chevron ${c?"filter-dropdown__chevron--open":""}`})]}))}function zM(r){var c=r,{children:e,className:t="",style:n}=c,i=pe(c,["children","className","style"]);const{isOpen:o,mode:u,panelRef:h,placement:m}=Nd();return d.jsx("div",V(R({ref:h,className:`dropdown-panel ${Sd(m)} filter-dropdown__panel ${t}`.trim(),role:u==="checkbox"?"listbox":"radiogroup","aria-multiselectable":u==="checkbox"?!0:void 0,hidden:!o,style:o?n:void 0},i),{children:e}))}function IM({title:e,children:t}){return d.jsxs("div",{className:"dropdown-section",children:[e&&d.jsx("div",{className:"dropdown-section-title",children:e}),d.jsx("div",{className:"filter-dropdown__section-content",children:t})]})}function BM({value:e,label:t,description:n}){const{selectedValues:i,onValueChange:r,focusedValue:c,setFocusedValue:o,mode:u}=Nd(),h=M.useRef(null),m=i.has(e),g=c===e;return M.useEffect(()=>{var p;g&&((p=h.current)==null||p.focus())},[g]),d.jsxs("button",{ref:h,type:"button",role:u==="checkbox"?"option":void 0,"aria-selected":m,tabIndex:g?0:-1,"data-dropdown-item":e,onClick:()=>r(e,!m),onMouseEnter:()=>o(e),className:["dropdown-item",g&&"dropdown-item--focused"].filter(Boolean).join(" "),children:[d.jsx("span",{className:"dropdown-item__leading",children:d.jsx("input",{type:"checkbox",className:"dropdown-item__checkbox",checked:m,readOnly:!0,tabIndex:-1,"aria-hidden":"true"})}),d.jsxs("span",{className:"dropdown-item__body",children:[d.jsx("span",{className:"dropdown-item__label",children:t}),n&&d.jsx("span",{className:"dropdown-item__description",children:n})]})]})}function UM({value:e,label:t,description:n}){const{selectedValues:i,onValueChange:r,focusedValue:c,setFocusedValue:o}=Nd(),u=M.useRef(null),h=i.has(e),m=c===e;return M.useEffect(()=>{var g;m&&((g=u.current)==null||g.focus())},[m]),d.jsxs("button",{ref:u,type:"button",role:"radio","aria-checked":h,tabIndex:m?0:-1,"data-dropdown-item":e,onClick:()=>r(e,!0),onMouseEnter:()=>o(e),className:["dropdown-item",m&&"dropdown-item--focused"].filter(Boolean).join(" "),children:[d.jsx("span",{className:"dropdown-item__leading",children:d.jsx("input",{type:"radio",className:"dropdown-item__radio",checked:h,readOnly:!0,tabIndex:-1,"aria-hidden":"true"})}),d.jsxs("span",{className:"dropdown-item__body",children:[d.jsx("span",{className:"dropdown-item__label",children:t}),n&&d.jsx("span",{className:"dropdown-item__description",children:n})]})]})}Object.assign(Z_,{Trigger:OM,Panel:zM,Section:IM,Checkbox:BM,Radio:UM});const FM={success:"check",error:"x",warning:"alert",info:"info"},HM={success:"emerald",error:"rose",warning:"amber",info:"cyan"},J_=re.forwardRef((g,m)=>{var p=g,{isOpen:e,onClose:t,title:n,subtitle:i,variant:r="info",icon:c,duration:o=4e3,className:u=""}=p,h=pe(p,["isOpen","onClose","title","subtitle","variant","icon","duration","className"]);if(M.useEffect(()=>{if(e&&o){const _=setTimeout(t,o);return()=>clearTimeout(_)}},[e,o,t]),!e)return null;const y=c||FM[r],x=HM[r];return d.jsxs("div",V(R({ref:m,className:["toast",`toast--${r}`,u].filter(Boolean).join(" "),role:r==="error"||r==="warning"?"alert":"status","aria-live":r==="error"||r==="warning"?"assertive":"polite","aria-atomic":"true"},h),{children:[d.jsx("div",{className:`toast__icon toast__icon--${x}`,children:d.jsx(Ee,{name:y,size:12})}),d.jsxs("div",{className:"toast__content",children:[n&&d.jsx("div",{className:"toast__title",children:n}),i&&d.jsx("div",{className:"toast__subtitle",children:i})]}),d.jsx("button",{type:"button",className:"toast__close",onClick:t,"aria-label":"Dismiss notification",children:d.jsx(Ee,{name:"x",size:14})})]}))});J_.displayName="Toast";const PM=re.forwardRef(({isOpen:e,onClose:t,commands:n=[],placeholder:i="Search commands…",emptyMessage:r="No commands found"},c)=>{const[o,u]=M.useState(""),[h,m]=M.useState(0),g=M.useRef(null),p=M.useRef(null),y=re.useId(),x=re.useId();M.useImperativeHandle(c,()=>p.current),wd(p,e),tg(e);const _=M.useMemo(()=>{const N=o.toLowerCase();return n.filter(k=>{var j;var C;return k.label.toLowerCase().includes(N)||((j=(C=k.description)==null?void 0:C.toLowerCase().includes(N))!=null?j:!1)})},[n,o]),S=M.useMemo(()=>{const N=[],k=new Map;return _.forEach((C,j)=>{k.has(C.group)||(k.set(C.group,[]),N.push(C.group)),k.get(C.group).push({cmd:C,index:j})}),N.map(C=>({name:C,items:k.get(C)}))},[_]);M.useEffect(()=>{e?setTimeout(()=>{var N;return(N=g.current)==null?void 0:N.focus()},0):(u(""),m(0))},[e]),M.useEffect(()=>{const N=k=>{e&&(k.key==="Escape"?t():k.key==="ArrowDown"?(k.preventDefault(),_.length>0&&m(C=>(C+1)%_.length)):k.key==="ArrowUp"?(k.preventDefault(),_.length>0&&m(C=>(C-1+_.length)%_.length)):k.key==="Enter"&&(k.preventDefault(),_[h]&&(_[h].onSelect(),t(),u(""))))};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[e,t,_,h]);const w=N=>{N.target===N.currentTarget&&t()};return e?d.jsx("div",{ref:p,className:"command-palette-backdrop",onClick:w,children:d.jsxs("div",{className:"command-palette",role:"dialog","aria-modal":"true","aria-labelledby":x,children:[d.jsx("span",{id:x,className:"command-palette__sr-title",children:"Command palette"}),d.jsxs("div",{className:"command-palette__header",children:[d.jsx(Ee,{name:"search",size:16}),d.jsx("input",{ref:g,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":!0,"aria-controls":y,"aria-activedescendant":_[h]?`${y}-${_[h].id}`:void 0,"aria-label":i,className:"command-palette__input",placeholder:i,value:o,onChange:N=>{u(N.target.value),m(0)}})]}),d.jsx("div",{id:y,role:"listbox",className:"command-palette__list",children:_.length===0?d.jsx("div",{className:"command-palette__empty",children:r}):S.map(N=>{var k;return d.jsxs("div",{className:"command-palette__group",role:"group",children:[N.name&&d.jsx("div",{className:"command-palette__group-header","aria-hidden":"true",children:N.name}),N.items.map(({cmd:C,index:j})=>d.jsxs("button",{type:"button",id:`${y}-${C.id}`,role:"option","aria-selected":j===h,className:["command-palette__item",j===h&&"command-palette__item--selected"].filter(Boolean).join(" "),onClick:()=>{C.onSelect(),t(),u("")},children:[C.icon&&d.jsx(Ee,{name:C.icon,size:16}),d.jsxs("div",{className:"command-palette__item-content",children:[d.jsx("div",{className:"command-palette__item-label",children:C.label}),C.description&&d.jsx("div",{className:"command-palette__item-description",children:C.description})]})]},C.id))]},(k=N.name)!=null?k:"__ungrouped")})})]})}):null});PM.displayName="CommandPalette";const W_=re.forwardRef((g,m)=>{var p=g,{title:e,subtitle:t,headerAction:n,footer:i,bordered:r=!0,noPadding:c=!1,className:o="",children:u}=p,h=pe(p,["title","subtitle","headerAction","footer","bordered","noPadding","className","children"]);const y=["panel",!r&&"panel--no-border",o].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:m,className:y},h),{children:[(e||t||n)&&d.jsxs("div",{className:"panel__header",children:[d.jsxs("div",{className:"panel__header-left",children:[e&&d.jsx("div",{className:"panel__title",children:e}),t&&d.jsx("div",{className:"panel__subtitle",children:t})]}),n&&d.jsx("div",{className:"panel__header-action",children:n})]}),u!=null&&d.jsx("div",{className:c?"panel__body panel__body--no-padding":"panel__body",children:u}),i&&d.jsx("div",{className:"panel__footer",children:i})]}))});W_.displayName="Panel";const $M=re.forwardRef((m,h)=>{var g=m,{isOpen:e,onClose:t,title:n,position:i="right",width:r="320px",children:c,className:o=""}=g,u=pe(g,["isOpen","onClose","title","position","width","children","className"]);const p=re.useId(),y=M.useRef(null);M.useImperativeHandle(h,()=>y.current),wd(y,e),tg(e),M.useEffect(()=>{const _=S=>{S.key==="Escape"&&e&&t()};if(e)return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[e,t]);const x=_=>{_.target===_.currentTarget&&t()};return e?d.jsx("div",{className:"drawer-backdrop",onClick:x,children:d.jsxs("div",V(R({ref:y,className:["drawer",`drawer--${i}`,o].filter(Boolean).join(" "),style:{width:r},role:"dialog","aria-modal":"true","aria-labelledby":n?p:void 0},u),{children:[d.jsxs("div",{className:["drawer__header",n?"":"drawer__header--no-title"].filter(Boolean).join(" "),children:[n&&d.jsx("h2",{id:p,className:"drawer__title",children:n}),d.jsx("button",{type:"button",className:"drawer__close",onClick:t,"aria-label":"Close drawer",children:d.jsx(Ee,{name:"x",size:14})})]}),d.jsx("div",{className:"drawer__body",children:c})]}))}):null});$M.displayName="Drawer";const qM=re.forwardRef((y,p)=>{var x=y,{direction:e="horizontal",initialSplitPercent:t=50,splitPercent:n,onSplitChange:i,minSize:r=200,maxSize:c=800,first:o,second:u,dividerLabel:h,className:m=""}=x,g=pe(x,["direction","initialSplitPercent","splitPercent","onSplitChange","minSize","maxSize","first","second","dividerLabel","className"]);const[_,S]=M.useState(t),w=M.useRef(null),N=n!==void 0,k=N?n:_,C=M.useCallback((D,T)=>{const B=r/T*100,P=c/T*100;return Math.max(B,Math.min(D,P))},[r,c]),j=M.useCallback(D=>{N||S(D),i==null||i(D)},[N,i]),A=M.useCallback(D=>T=>{D.forEach(B=>{typeof B=="function"?B(T):B&&(B.current=T)})},[]),L=M.useCallback(()=>{const D=B=>{if(!w.current)return;const P=w.current.getBoundingClientRect(),K=e==="horizontal",H=K?B.clientX-P.left:B.clientY-P.top,q=K?P.width:P.height,$=H/q*100;j(C($,q))},T=()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",T)};document.addEventListener("mousemove",D),document.addEventListener("mouseup",T)},[e,C,j]),z=M.useCallback(D=>{if(!w.current)return;const T=D.shiftKey?10:2,B=e==="horizontal",P=w.current.getBoundingClientRect(),K=B?P.width:P.height;D.key==="ArrowLeft"||D.key==="ArrowUp"?(D.preventDefault(),j(C(k-T,K))):(D.key==="ArrowRight"||D.key==="ArrowDown")&&(D.preventDefault(),j(C(k+T,K)))},[e,k,C,j]),F=["split-pane",`split-pane--${e}`,m].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:A([w,p]),className:F},g),{children:[d.jsx("div",{className:"split-pane__first",style:e==="horizontal"?{width:`${k}%`}:{height:`${k}%`},children:o}),d.jsx("div",{role:"separator","aria-orientation":e==="horizontal"?"vertical":"horizontal","aria-valuenow":Math.round(k),"aria-valuemin":0,"aria-valuemax":100,"aria-label":h!=null?h:e==="horizontal"?"Horizontal divider":"Vertical divider",tabIndex:0,className:`split-pane__divider split-pane__divider--${e}`,onMouseDown:L,onKeyDown:z}),d.jsx("div",{className:"split-pane__second",style:e==="horizontal"?{width:`${100-k}%`}:{height:`${100-k}%`},children:u})]}))});qM.displayName="SplitPane";const eS=M.createContext(void 0),tS=()=>{const e=M.useContext(eS);if(!e)throw new Error("InspectorPanel.Section must be used within an InspectorPanel");return e},nS=re.forwardRef((u,o)=>{var h=u,{title:e,count:t,actions:n,children:i,className:r=""}=h,c=pe(h,["title","count","actions","children","className"]);tS();const m=["inspector-panel__section",r].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:o,className:m},c),{children:[d.jsxs("div",{className:"inspector-panel__section-header",children:[d.jsxs("div",{className:"inspector-panel__section-title",children:[d.jsx("span",{children:e}),t!==void 0&&d.jsxs("span",{className:"inspector-panel__section-count",children:["· ",t]})]}),n&&d.jsx("div",{className:"inspector-panel__section-actions",children:n})]}),i&&d.jsx("div",{className:"inspector-panel__section-content",children:i})]}))});nS.displayName="InspectorPanel.Section";const aS=re.forwardRef((m,h)=>{var g=m,{title:e,count:t,actionIcon:n,actionLabel:i,onAction:r,rows:c,className:o=""}=g,u=pe(g,["title","count","actionIcon","actionLabel","onAction","rows","className"]);tS();const p=["inspector-panel__property-section",o].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:h,className:p},u),{children:[d.jsxs("div",{className:"inspector-panel__property-section-header",children:[d.jsx("span",{className:"inspector-panel__property-section-title",children:e}),t!==void 0&&d.jsx("span",{className:"inspector-panel__property-section-count",children:t}),r&&d.jsx("button",{className:"inspector-panel__property-section-action",onClick:r,type:"button","aria-label":i,children:n})]}),c.length>0&&d.jsx("div",{className:"inspector-panel__property-rows",children:c.map(y=>d.jsxs("div",{className:"inspector-panel__property-row",children:[d.jsx("span",{className:"inspector-panel__property-key",children:y.key}),d.jsx("span",{className:"inspector-panel__property-value",children:y.value}),y.usageCount!==void 0&&d.jsxs("span",{className:"inspector-panel__property-usage",children:["used ",y.usageCount]})]},y.key))})]}))});aS.displayName="InspectorPanel.PropertySection";const iS=re.forwardRef((m,h)=>{var g=m,{eyebrow:e="",title:t,id:n,version:i,actions:r,children:c,className:o=""}=g,u=pe(g,["eyebrow","title","id","version","actions","children","className"]);const p=["inspector-panel",o].filter(Boolean).join(" ");return d.jsx(eS.Provider,{value:!0,children:d.jsxs("div",V(R({ref:h,className:p},u),{children:[d.jsxs("div",{className:"inspector-panel__head",children:[e&&d.jsx("div",{className:"inspector-panel__eyebrow",children:e}),d.jsx("div",{className:"inspector-panel__title",children:t}),d.jsxs("div",{className:"inspector-panel__id-version",children:[d.jsx("span",{className:"inspector-panel__id",children:n}),i!==void 0&&d.jsx(aa,{children:i})]}),r&&d.jsx("div",{className:"inspector-panel__actions",children:r})]}),d.jsx("div",{className:"inspector-panel__body",children:c})]}))})});iS.displayName="InspectorPanel";Object.assign(iS,{Section:nS,PropertySection:aS});const VM=re.forwardRef((o,c)=>{var u=o,{rows:e=[],keyWidth:t,className:n="",style:i}=u,r=pe(u,["rows","keyWidth","className","style"]);const h=["kv-grid",n].filter(Boolean).join(" "),m=t?V(R({},i),{gridTemplateColumns:`${typeof t=="number"?`${t}px`:t} 1fr`}):i;return d.jsx("dl",V(R({ref:c,className:h,style:m},r),{children:e.map(g=>d.jsxs(re.Fragment,{children:[d.jsx("dt",{className:"kv-grid__key",children:g.key}),d.jsx("dd",{className:"kv-grid__value",children:g.value})]},g.key))}))});VM.displayName="KVGrid";const GM=re.forwardRef((h,u)=>{var m=h,{label:e,width:t,height:n,viewBox:i,className:r="",children:c}=m,o=pe(m,["label","width","height","viewBox","className","children"]);return d.jsx("svg",V(R({ref:u,role:"img","aria-label":e,width:t,height:n,viewBox:i,className:r,style:{display:"block"}},o),{children:c}))});GM.displayName="ChartWrapper";const Sl=["#22D3EE","#10B981","#F59E0B","#818CF8","#8B5CF6","#F43F5E"],yx=Sl,ks={light:{fg1:"#0B1220",fg2:"#475569",fg3:"#64748B",fg4:"#94A3B8",grid:"#EEF1F4",border:"#E5E9EE",card:"#FFFFFF",inset:"#F7F9FB"},dark:{fg1:"#E2E8F0",fg2:"#94A3B8",fg3:"#64748B",fg4:"#475569",grid:"#1B2949",border:"#243763",card:"#1B2949",inset:"#13203A"}};function js(e){return Math.abs(e)>=1e3?(e/1e3).toFixed(1)+"k":Number.isInteger(e)?String(e):e.toFixed(1)}const vx="#F59E0B",YM="#B45309",KM="#1B2949",XM="#2A3A5C",QM="#E6EDF3",ZM="#A6B1BD",JM=re.forwardRef((k,N)=>{var C=k,{series:e,colors:t,xLabels:n,width:i=480,height:r=200,area:c=!1,axes:o=!1,grid:u=!1,ticks:h=4,threshold:m,markers:g,tooltip:p=!1,tone:y="light",padding:x,className:_="",style:S}=C,w=pe(C,["series","colors","xLabels","width","height","area","axes","grid","ticks","threshold","markers","tooltip","tone","padding","className","style"]);var I;const j=ks[y],A=re.useId(),L=t!=null?t:e.length===1?[Sl[0]]:Sl,z=R({top:8,right:p?12:8,bottom:o?22:6,left:o?30:6},x),F=i-z.left-z.right,D=r-z.top-z.bottom,T=e.flat();if(T.length===0)return null;let B=Math.min(...T),P=Math.max(...T);const K=P-B||1;B-=K*.08,P+=K*.08,m&&(B=Math.min(B,m.value),P=Math.max(P,m.value));const H=Math.max(...e.map(ie=>ie.length)),q=ie=>z.left+(H<=1?F/2:ie/(H-1)*F),$=ie=>z.top+D-(ie-B)/(P-B)*D,Q=[];for(let ie=0;ie<=h;ie++)Q.push(B+ie/h*(P-B));const[G,W]=re.useState(null);function O(ie){const ye=ie.currentTarget.getBoundingClientRect(),xe=(ie.clientX-ye.left)/ye.width*i,Ce=Math.max(0,Math.min(H-1,Math.round((xe-z.left)/F*(H-1))));W(Ce)}function se(ie){return ie.map(([ye,xe],Ce)=>(Ce?"L":"M")+ye.toFixed(2)+","+xe.toFixed(2)).join(" ")}const ue=e.map(ie=>ie.map((ye,xe)=>[q(xe),$(ye)]));return d.jsxs("svg",V(R({ref:N,width:i,height:r,viewBox:`0 0 ${i} ${r}`,className:_,role:"img","aria-label":(I=w["aria-label"])!=null?I:"Line chart",style:R({display:"block",cursor:p?"crosshair":"default"},S),onMouseMove:p?O:void 0,onMouseLeave:p?()=>W(null):void 0},w),{children:[u&&Q.map((ie,ye)=>d.jsx("line",{x1:z.left,x2:i-z.right,y1:$(ie),y2:$(ie),stroke:j.grid,strokeWidth:"1"},"g"+ye)),o&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:z.left,x2:z.left,y1:z.top,y2:z.top+D,stroke:j.border,strokeWidth:"1"}),d.jsx("line",{x1:z.left,x2:i-z.right,y1:z.top+D,y2:z.top+D,stroke:j.border,strokeWidth:"1"}),Q.map((ie,ye)=>d.jsx("text",{x:z.left-6,y:$(ie)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:j.fg3,children:js(ie)},"yt"+ye)),n&&n.map((ie,ye)=>d.jsx("text",{x:q(ye),y:z.top+D+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:j.fg3,children:ie},"xt"+ye))]}),m&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:z.left,x2:i-z.right,y1:$(m.value),y2:$(m.value),stroke:j.fg3,strokeWidth:"1",strokeDasharray:"3 3"}),m.label&&d.jsx("text",{x:i-z.right-4,y:$(m.value)-4,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:j.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:m.label})]}),g&&g.map((ie,ye)=>d.jsxs("g",{children:[d.jsx("line",{x1:q(ie.x),x2:q(ie.x),y1:z.top-2,y2:z.top+D,stroke:vx,strokeWidth:"1",strokeDasharray:"2 2"}),d.jsx("circle",{cx:q(ie.x),cy:z.top+4,r:"3",fill:vx}),ie.label&&d.jsx("text",{x:q(ie.x)+6,y:z.top+7,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:YM,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:ie.label})]},"mk"+ye)),ue.map((ie,ye)=>{const xe=L[ye%L.length],Ce=se(ie),Se=`${Ce} L${ie[ie.length-1][0].toFixed(2)},${z.top+D} L${ie[0][0].toFixed(2)},${z.top+D} Z`,Pe=`${A}-lg${ye}`;return d.jsxs("g",{children:[c&&d.jsxs(d.Fragment,{children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:Pe,x1:"0",y1:"0",x2:"0",y2:"1",children:[d.jsx("stop",{offset:"0%",stopColor:xe,stopOpacity:"0.22"}),d.jsx("stop",{offset:"100%",stopColor:xe,stopOpacity:"0"})]})}),d.jsx("path",{d:Se,fill:`url(#${Pe})`})]}),d.jsx("path",{d:Ce,stroke:xe,strokeWidth:p?1.75:1.5,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})]},"s"+ye)}),p&&G!==null&&(()=>{const ie=18+e.length*16;let ye=q(G)+10;ye+132>i-4&&(ye=q(G)-132-10);const xe=z.top+4;return d.jsxs("g",{children:[d.jsx("line",{x1:q(G),x2:q(G),y1:z.top,y2:z.top+D,stroke:j.fg3,strokeWidth:"1",strokeDasharray:"2 3"}),e.map((Ce,Se)=>Ce[G]!=null&&d.jsx("circle",{cx:q(G),cy:$(Ce[G]),r:"3",fill:j.card,stroke:L[Se%L.length],strokeWidth:"1.75"},"h"+Se)),d.jsx("rect",{x:ye,y:xe,width:132,height:ie,rx:"6",fill:KM,stroke:XM}),d.jsx("text",{x:ye+9,y:xe+13,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:ZM,style:{textTransform:"uppercase",letterSpacing:"0.10em"},children:n?n[G]:`t${G}`}),e.map((Ce,Se)=>d.jsxs("g",{children:[d.jsx("rect",{x:ye+9,y:xe+22+Se*16,width:"6",height:"6",rx:"1",fill:L[Se%L.length]}),d.jsx("text",{x:ye+20,y:xe+28+Se*16,fontFamily:"JetBrains Mono, monospace",fontSize:"10.5",fill:QM,children:Ce[G]!=null?js(Ce[G]):"—"})]},"tt"+Se))]})})()]}))});JM.displayName="LineChart";const WM=re.forwardRef((x,y)=>{var _=x,{series:e,xLabels:t=[],yMin:n,yMax:i,yTickCount:r=5,legend:c=!1,width:o=400,height:u=200,tone:h="light",ariaLabel:m,className:g=""}=_,p=pe(_,["series","xLabels","yMin","yMax","yTickCount","legend","width","height","tone","ariaLabel","className"]);const S=ks[h],w=Q=>d.jsx("div",V(R({ref:y,className:g,style:{width:o,height:u,display:"flex",alignItems:"center",justifyContent:"center",color:S.fg3,fontSize:"12px"}},p),{children:Q}));if(!e||e.length===0)return w("No data");let N=1/0,k=-1/0,C=0;if(e.forEach(Q=>{if(Q.data&&Q.data.length>0){Q.data.length>C&&(C=Q.data.length);for(let G=0;G<Q.data.length;G++){const W=Q.data[G];W<N&&(N=W),W>k&&(k=W)}}}),C===0)return w("No data");const j=isFinite(N)&&isFinite(k),A=n!==void 0?n:j?Math.min(0,N):0,L=(i!==void 0?i:j?k:1)-A||1,z={top:8,right:10,bottom:22,left:36},F=o-z.left-z.right,D=u-z.top-z.bottom,T=Q=>z.top+D-(Q-A)/L*D,B=T(Math.max(A,0)),P=Array.from({length:r},(Q,G)=>{const W=r===1?1:r-1,O=A+L*G/W;return{value:O,y:T(O)}}),K=F/C,H=K*.18,q=Math.max(1,(K-H*2)/e.length),$=(Q,G)=>Q.color?Zo[Q.color]:yx[G%yx.length];return d.jsxs("div",V(R({ref:y,style:{display:"flex",flexDirection:"column",gap:"8px"},className:g},p),{children:[d.jsxs("svg",{role:"img","aria-label":m!=null?m:e.map(Q=>Q.name).join(", "),width:o,height:u,viewBox:`0 0 ${o} ${u}`,style:{display:"block"},children:[m&&d.jsx("title",{children:m}),P.map((Q,G)=>d.jsxs("g",{children:[d.jsx("line",{x1:z.left,x2:o-z.right,y1:Q.y,y2:Q.y,stroke:S.grid,strokeWidth:"1"}),d.jsx("text",{x:z.left-6,y:Q.y+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:js(Q.value)})]},`y-${G}`)),d.jsx("line",{x1:z.left,x2:z.left,y1:z.top,y2:z.top+D,stroke:S.border,strokeWidth:"1"}),d.jsx("line",{x1:z.left,x2:o-z.right,y1:z.top+D,y2:z.top+D,stroke:S.border,strokeWidth:"1"}),e.map((Q,G)=>{const W=$(Q,G);return d.jsx("g",{children:Q.data.map((O,se)=>{const ue=z.left+se*K+H+G*q,I=T(O),ie=Math.min(I,B),ye=Math.abs(B-I);return d.jsx("rect",{x:ue,y:ie,width:Math.max(1,q-1),height:Math.max(0,ye),fill:W,rx:"1"},`bar-${G}-${se}`)})},`series-${G}`)}),t.map((Q,G)=>d.jsx("text",{x:z.left+(G+.5)*K,y:z.top+D+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:Q},`x-${G}`))]}),c&&d.jsx("div",{style:{display:"flex",gap:"12px",fontSize:"12px",flexWrap:"wrap",color:S.fg2},children:e.map((Q,G)=>d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[d.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"1px",backgroundColor:$(Q,G)}}),d.jsx("span",{children:Q.name})]},`legend-${G}`))})]}))});WM.displayName="BarChart";const eT=re.forwardRef((S,_)=>{var w=S,{values:e,xLabels:t,color:n,width:i=480,height:r=200,axes:c=!1,grid:o=!1,ticks:u=4,threshold:h,tone:m="light",label:g,className:p="",style:y}=w,x=pe(w,["values","xLabels","color","width","height","axes","grid","ticks","threshold","tone","label","className","style"]);const N=ks[m],k=n!=null?n:Sl[2],C={top:8,right:8,bottom:c?22:6,left:c?30:6},j=i-C.left-C.right,A=r-C.top-C.bottom;if(!e||e.length===0)return null;const L=Math.max(...e,h?h.value:0),z=e.length,F=Math.max(2,j/z*.22),D=(j-F*(z-1))/z,T=P=>C.top+A-P/(L||1)*A,B=[];for(let P=0;P<=u;P++)B.push(P/u*L);return d.jsxs("svg",V(R({ref:_,role:"img","aria-label":g,width:i,height:r,viewBox:`0 0 ${i} ${r}`,className:p,style:R({display:"block"},y)},x),{children:[o&&B.map((P,K)=>d.jsx("line",{x1:C.left,x2:i-C.right,y1:T(P),y2:T(P),stroke:N.grid,strokeWidth:"1"},"g"+K)),c&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:C.left,x2:C.left,y1:C.top,y2:C.top+A,stroke:N.border,strokeWidth:"1"}),d.jsx("line",{x1:C.left,x2:i-C.right,y1:C.top+A,y2:C.top+A,stroke:N.border,strokeWidth:"1"}),B.map((P,K)=>d.jsx("text",{x:C.left-6,y:T(P)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:N.fg3,children:js(P)},"yt"+K))]}),e.map((P,K)=>{const H=C.left+K*(D+F),q=T(P);return d.jsxs("g",{children:[d.jsx("rect",{x:H,y:q,width:D,height:C.top+A-q,fill:k,rx:"1"}),c&&t&&t[K]!==void 0&&d.jsx("text",{x:H+D/2,y:C.top+A+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:N.fg3,children:t[K]})]},K)}),h&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:C.left,x2:i-C.right,y1:T(h.value),y2:T(h.value),stroke:N.fg3,strokeWidth:"1",strokeDasharray:"3 3"}),h.label&&d.jsx("text",{x:i-C.right-4,y:T(h.value)-4,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:N.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:h.label})]})]}))});eT.displayName="BarV";const tT="#22D3EE",nT=re.forwardRef((y,p)=>{var x=y,{items:e,width:t=320,height:n=200,tone:i="light",showValues:r=!0,valueFormat:c,maxValue:o,label:u,className:h="",style:m}=x,g=pe(x,["items","width","height","tone","showValues","valueFormat","maxValue","label","className","style"]);const _=ks[i],S={top:4,right:36,bottom:4,left:92},w=t-S.left-S.right,N=n-S.top-S.bottom;if(!e||e.length===0)return null;const k=o!=null?o:Math.max(...e.map(L=>L.value)),C=N/e.length,j=Math.min(C*.62,14),A=c!=null?c:js;return d.jsx("svg",V(R({ref:p,role:"img","aria-label":u!=null?u:"Horizontal bar chart",width:t,height:n,viewBox:`0 0 ${t} ${n}`,className:h,style:R({display:"block"},m)},g),{children:e.map((L,z)=>{var B;const F=S.top+z*C+(C-j)/2,D=L.value/(k||1)*w,T=(B=L.color)!=null?B:tT;return d.jsxs("g",{children:[d.jsx("text",{x:S.left-10,y:F+j*.78,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:_.fg2,children:L.label}),d.jsx("rect",{x:S.left,y:F,width:w,height:j,fill:_.inset,rx:"2"}),d.jsx("rect",{x:S.left,y:F,width:D,height:j,fill:T,rx:"2"}),r&&d.jsx("text",{x:S.left+D+6,y:F+j*.78,fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:_.fg2,fontWeight:"500",children:A(L.value)})]},L.label)})}))});nT.displayName="BarH";const aT=re.forwardRef((S,_)=>{var w=S,{stacks:e,colors:t,width:n=480,height:i=200,axes:r=!1,grid:c=!1,ticks:o=4,normalized:u=!1,tone:h="light",label:m="Stacked bar chart",stackLabel:g,className:p="",style:y}=w,x=pe(w,["stacks","colors","width","height","axes","grid","ticks","normalized","tone","label","stackLabel","className","style"]);const N=ks[h],k=t!=null?t:Sl,C={top:g?24:8,right:8,bottom:r?22:6,left:r?30:6},j=n-C.left-C.right,A=i-C.top-C.bottom;if(!e||e.length===0)return null;const L=e.map(H=>H.parts.reduce((q,$)=>isNaN(q)||isNaN($)?NaN:q+$,0)),z=L.filter(H=>!isNaN(H)),F=u?1:z.length>0?Math.max(...z):1,D=e.length,T=Math.max(2,j/D*.22),B=(j-T*(D-1))/D,P=[];for(let H=0;H<=o;H++)P.push(H/o*F);const K=H=>C.top+A-H/(F||1)*A;return d.jsxs("svg",V(R({ref:_,role:"img","aria-label":m,width:n,height:i,viewBox:`0 0 ${n} ${i}`,className:p,style:R({display:"block"},y)},x),{children:[c&&P.map((H,q)=>d.jsx("line",{x1:C.left,x2:n-C.right,y1:K(H),y2:K(H),stroke:N.grid,strokeWidth:"1"},"g"+q)),r&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:C.left,x2:C.left,y1:C.top,y2:C.top+A,stroke:N.border,strokeWidth:"1"}),d.jsx("line",{x1:C.left,x2:n-C.right,y1:C.top+A,y2:C.top+A,stroke:N.border,strokeWidth:"1"}),P.map((H,q)=>d.jsx("text",{x:C.left-6,y:K(H)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:N.fg3,children:u?`${Math.round(H*100)}%`:js(H)},"yt"+q))]}),e.map((H,q)=>{const $=C.left+q*(B+T),Q=!isNaN(L[q])&&L[q]>0?L[q]:Math.max(...z,1);let G=0;return d.jsxs("g",{children:[H.parts.map((W,O)=>{if(isNaN(W))return null;const se=(u?W/Q:W)/(F||1)*A,ue=C.top+A-G-se;return G+=se,d.jsx("rect",{x:$,y:ue,width:B,height:se,fill:k[O%k.length]},O)}),g&&!isNaN(L[q])&&d.jsx("text",{x:$+B/2,y:C.top+A-G-6,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:N.fg3,children:g==="total"?js(L[q]):g(H)}),r&&d.jsx("text",{x:$+B/2,y:C.top+A+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:N.fg3,children:H.label})]},q)})]}))});aT.displayName="StackedBar";const iT=re.forwardRef((_,x)=>{var S=_,{slices:e,colors:t,width:n=160,height:i=160,thickness:r=14,gap:c=.03,centerValue:o,centerLabel:u,"aria-label":h,tone:m="light",className:g="",style:p}=S,y=pe(S,["slices","colors","width","height","thickness","gap","centerValue","centerLabel","aria-label","tone","className","style"]);const w=ks[m],N=t!=null?t:Sl;if(!e||e.length===0)return null;const k=n/2,C=i/2,j=Math.min(n,i)/2-4,A=j-r,L=e.reduce((K,H)=>K+H.value,0)||1;function z(K,H){const q=Math.cos(K),$=Math.sin(K),Q=Math.cos(H),G=Math.sin(H),W=H-K>Math.PI?1:0;return[`M ${k+j*q} ${C+j*$}`,`A ${j} ${j} 0 ${W} 1 ${k+j*Q} ${C+j*G}`,`L ${k+A*Q} ${C+A*G}`,`A ${A} ${A} 0 ${W} 0 ${k+A*q} ${C+A*$}`,"Z"].join(" ")}const F=e.length>1?c:0;let D=-Math.PI/2;const T=e.map((K,H)=>{var G;const q=K.value/L*Math.PI*2,$=D+F/2;let Q=D+q-F/2;return Q-$>=Math.PI*2-1e-6&&(Q=$+Math.PI*2-1e-6),Q<=$&&(Q=$+1e-4),D+=q,{d:z($,Q),color:(G=K.color)!=null?G:N[H%N.length]}}),B=Math.min(n,i)*.22,P=C+Math.min(n,i)*.18;return d.jsxs("svg",V(R({ref:x,role:"img","aria-label":h!=null?h:"Donut chart",width:n,height:i,viewBox:`0 0 ${n} ${i}`,className:g,style:R({display:"block"},p)},y),{children:[T.map((K,H)=>d.jsx("path",{d:K.d,fill:K.color},H)),o!=null&&d.jsx("text",{x:k,y:C+1,textAnchor:"middle",fontFamily:"Inter, sans-serif",fontSize:B,fontWeight:"700",fill:w.fg1,style:{letterSpacing:"-0.02em",fontVariantNumeric:"tabular-nums"},children:o}),u!=null&&d.jsx("text",{x:k,y:P,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:w.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:u})]}))});iT.displayName="Donut";const sT=re.forwardRef((w,S)=>{var N=w,{data:e,baseColor:t="#10B981",xLabels:n,yLabels:i,width:r=480,height:c=120,axes:o=!1,tone:u="light",showValues:h=!1,valueFormat:m,cellMark:g,ariaLabel:p,className:y="",style:x}=N,_=pe(N,["data","baseColor","xLabels","yLabels","width","height","axes","tone","showValues","valueFormat","cellMark","ariaLabel","className","style"]);const k=ks[u];if(!e||e.length===0)return null;const C=e.length,j=e[0].length,A={top:4,right:8,bottom:o?18:4,left:o?28:4},L=(r-A.left-A.right)/j,z=(c-A.top-A.bottom)/C,F=e.flat().filter(q=>q!=null&&!isNaN(q)),D=F.length?Math.min(...F):0,T=F.length?Math.max(...F):1,B=t.replace("#",""),P=m!=null?m:js;function K(q){if(q==null||isNaN(q))return k.inset;const $=(q-D)/(T-D||1),Q=Math.round((.12+$*.88)*255).toString(16).padStart(2,"0");return`#${B}${Q}`}function H(q){return(q-D)/(T-D||1)>.55?"#FFFFFF":k.fg1}return d.jsxs("svg",V(R({ref:S,role:"img","aria-label":p!=null?p:"Heatmap",width:r,height:c,viewBox:`0 0 ${r} ${c}`,className:y,style:R({display:"block"},x)},_),{children:[p&&d.jsx("title",{children:p}),e.map((q,$)=>q.map((Q,G)=>{const W=A.left+G*L+1,O=A.top+$*z+1,se=W+(L-2)/2,ue=O+(z-2)/2,I=g==null?void 0:g($,G,Q!=null&&!isNaN(Q)?Q:null);return d.jsxs("g",{children:[d.jsx("rect",{x:W,y:O,width:Math.max(0,L-2),height:Math.max(0,z-2),fill:K(Q),rx:"2"}),h&&Q!=null&&!isNaN(Q)&&d.jsx("text",{x:se,y:ue+3.5,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:H(Q),children:P(Q)}),I&&d.jsx("g",{transform:`translate(${se}, ${ue})`,children:I})]},`${$}-${G}`)})),o&&i&&i.map((q,$)=>d.jsx("text",{x:A.left-6,y:A.top+$*z+z/2+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:k.fg3,children:q},"y"+$)),o&&n&&n.map((q,$)=>d.jsx("text",{x:A.left+$*L+L/2,y:c-A.bottom+12,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:k.fg3,children:q},"x"+$))]}))});sT.displayName="Heatmap";const rT="#B45309",pm={ok:"#10B981",warn:"#F59E0B",error:"#F43F5E",idle:"",info:"#22D3EE"},lT=re.forwardRef((x,y)=>{var _=x,{tracks:e,range:t=[0,100],width:n=480,height:i=160,axes:r=!1,xLabels:c,marker:o,tone:u="light","aria-label":h,className:m="",style:g}=_,p=pe(_,["tracks","range","width","height","axes","xLabels","marker","tone","aria-label","className","style"]);const S=ks[u];if(!e||e.length===0)return null;const w={top:6,right:8,bottom:r?22:6,left:92},N=n-w.left-w.right,k=i-w.top-w.bottom,C=k/e.length,j=Math.min(C*.6,14),A=z=>w.left+(z-t[0])/(t[1]-t[0]||1)*N;function L(z){var F;return z==="idle"?S.border:(F=pm[z])!=null?F:z}return d.jsxs("svg",V(R({ref:y,role:"img","aria-label":h,width:n,height:i,viewBox:`0 0 ${n} ${i}`,className:m,style:R({display:"block"},g)},p),{children:[e.map((z,F)=>{const D=w.top+F*C+(C-j)/2;return d.jsxs("g",{children:[d.jsx("text",{x:w.left-10,y:D+j*.78,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:S.fg2,children:z.label}),d.jsx("rect",{x:w.left,y:D,width:N,height:j,fill:S.inset,rx:"2"}),z.segments.map((T,B)=>d.jsx("rect",{x:A(T.start),y:D,width:Math.max(2,A(T.end)-A(T.start)),height:j,fill:L(T.kind),rx:"2"},B))]},F)}),r&&c&&c.map((z,F)=>d.jsx("text",{x:w.left+F/(c.length-1)*N,y:w.top+k+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:z},"x"+F)),o&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:A(o.x),x2:A(o.x),y1:w.top-2,y2:w.top+k+2,stroke:pm.warn,strokeWidth:"1",strokeDasharray:"2 2"}),d.jsx("circle",{cx:A(o.x),cy:w.top-2,r:"3",fill:pm.warn}),o.label&&d.jsx("text",{x:A(o.x)+6,y:w.top+2,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:rT,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:o.label})]})]}))});lT.displayName="StatusTimeline";const ag=re.forwardRef((u,o)=>{var h=u,{percent:e,color:t="emerald",height:n=6,label:i,className:r=""}=h,c=pe(h,["percent","color","height","label","className"]);const m=Number.isNaN(e)?0:Math.min(Math.max(e,0),100),g=`progress-bar--${t}`;return d.jsx("div",V(R({ref:o,className:`progress-bar ${g} ${r}`.trim(),style:{height:`${n}px`},role:"progressbar","aria-valuenow":m,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},c),{children:d.jsx("div",{className:"progress-bar__fill",style:{width:`${m}%`}})}))});ag.displayName="ProgressBar";const oT=re.forwardRef((p,g)=>{var y=p,{label:e,value:t,unit:n,percent:i,sparklineData:r=[],color:c="emerald",progressLabel:o,className:u="","aria-label":h}=y,m=pe(y,["label","value","unit","percent","sparklineData","color","progressLabel","className","aria-label"]);return d.jsxs("div",V(R({ref:g,role:"row","aria-label":h!=null?h:e,className:`metric-row ${u}`.trim()},m),{children:[d.jsx("div",{className:"metric-row__label",children:e}),d.jsx("div",{className:"metric-row__progress",children:d.jsx(ag,{percent:i,color:c,height:6,label:o!=null?o:e})}),d.jsx("div",{className:"metric-row__sparkline",children:d.jsx(Jp,{data:r,width:60,height:18,color:c})}),d.jsxs("div",{className:"metric-row__value",children:[t,n&&d.jsx("span",{className:"metric-row__unit",children:n})]})]}))});oT.displayName="MetricRow";const ig=re.forwardRef((h,u)=>{var m=h,{eyebrow:e,title:t,idChip:n,subtitle:i,actions:r,className:c=""}=m,o=pe(m,["eyebrow","title","idChip","subtitle","actions","className"]);const g=["page-header",c].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:u,className:g,role:"banner"},o),{children:[d.jsxs("div",{className:"page-header__text",children:[e&&d.jsx("div",{className:"page-header__eyebrow","data-testid":"page-header-eyebrow",children:e}),d.jsxs("h1",{className:"page-header__title","data-testid":"page-header-title",children:[t,n&&d.jsx(Hn,{form:"id-tag",className:"page-header__id-chip","data-testid":"page-header-id-chip",children:n})]}),i&&d.jsx("div",{className:"page-header__subtitle","data-testid":"page-header-subtitle",children:i})]}),r&&d.jsx("div",{className:"page-header__actions","data-testid":"page-header-actions",children:r})]}))});ig.displayName="PageHeader";const cT=re.forwardRef((x,y)=>{var _=x,{filters:e=[],value:t,defaultValue:n="",onSearchChange:i,onFilterRemove:r,onClearAll:c,searchPlaceholder:o="Search...",children:u,showingCount:h,totalCount:m,className:g=""}=_,p=pe(_,["filters","value","defaultValue","onSearchChange","onFilterRemove","onClearAll","searchPlaceholder","children","showingCount","totalCount","className"]);const S=t!==void 0,[w,N]=M.useState(n),k=S?t:w,C=z=>{const F=z.target.value;S||N(F),i==null||i(F)},j=()=>{S||N(""),c==null||c()},A=["filter-bar",g].filter(Boolean).join(" "),L=re.Children.count(u)>0;return d.jsxs("div",V(R({ref:y,className:A,"data-testid":"filter-bar"},p),{children:[d.jsxs("div",{className:"filter-bar__controls",children:[d.jsxs("div",{className:"filter-bar__search-wrapper",role:"search",children:[d.jsx(Ee,{name:"search",size:16,className:"filter-bar__search-icon"}),d.jsx("input",{type:"text","aria-label":"Search",placeholder:o,value:k,onChange:C,className:"filter-bar__search-input","data-testid":"filter-bar-search"})]}),L&&d.jsx("div",{className:"filter-bar__children",children:u}),h!==void 0&&m!==void 0&&d.jsxs("div",{className:"filter-bar__caption",children:["Showing ",h," of ",m]})]}),e.length>0&&d.jsxs("div",{className:"filter-bar__chips","data-testid":"filter-bar-chips",children:[c&&d.jsx("button",{type:"button",className:"filter-bar__clear-all",onClick:j,"data-testid":"filter-bar-clear-all",children:"Clear all"}),e.map(z=>d.jsxs(Hn,{variant:"neutral",className:"filter-bar__chip","data-testid":`filter-chip-${z.id}`,children:[d.jsx("span",{className:"filter-bar__chip-label",children:z.label}),d.jsx("button",{type:"button",className:"filter-bar__chip-close",onClick:()=>r==null?void 0:r(z.id),"aria-label":`Remove ${z.label} filter`,"data-testid":`filter-chip-close-${z.id}`,children:d.jsx(Ee,{name:"x",size:14})})]},z.id))]})]}))});cT.displayName="FilterBar";const sS=e=>{const t=typeof e=="string"?new Date(e):e,n=new Date().getTime()-t.getTime();if(Number.isNaN(n))return"";const i=Math.floor(n/6e4),r=Math.floor(n/36e5),c=Math.floor(n/864e5);return i<1?"just now":i<60?`${i}m ago`:r<24?`${r}h ago`:c<7?`${c}d ago`:t.toLocaleDateString()},uT=e=>{const t=typeof e=="string"?new Date(e):e;if(Number.isNaN(t.getTime()))return"";const n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),r=String(t.getSeconds()).padStart(2,"0");return`${n}:${i}:${r}`},wl=(e,t)=>{const n=typeof e=="string"?new Date(e):e,i=typeof t=="string"?new Date(t):t;return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate()},rS=e=>wl(e,new Date),Nl=(e,t=0)=>{const n=typeof e=="string"?new Date(e):new Date(e);let i=n.getDay()-t;i<0&&(i+=7);const r=new Date(n);r.setDate(n.getDate()-i);const c=[];for(let o=0;o<7;o++){const u=new Date(r);u.setDate(r.getDate()+o),c.push(u)}return c},dT=8,lS=(e,t=0)=>{const n=typeof e=="string"?new Date(e):e;if(Number.isNaN(n.getTime()))return[];const i=new Date(n.getFullYear(),n.getMonth(),1),r=Nl(i,t),c=[];let o=new Date(r[0]);for(;c.length<dT;){const u=Nl(o,t);c.push(u);const h=u[u.length-1];if(h.getMonth()>n.getMonth()||h.getFullYear()>n.getFullYear())break;o=new Date(h),o.setDate(o.getDate()+1)}return c},fT=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"long",year:"numeric"}),sp=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"short",day:"numeric"}),hT=(e,t)=>{const n=Nl(e,t),i=sp(n[0]),r=sp(n[6]);return`${i} – ${r}`},mT={create:"emerald",update:"cyan",delete:"rose",run:"amber"},pT=re.forwardRef((c,r)=>{var o=c,{events:e=[],emptyState:t="No activity recorded",className:n=""}=o,i=pe(o,["events","emptyState","className"]);const u=["activity-timeline",n].filter(Boolean).join(" ");return e.length===0?d.jsx("div",V(R({ref:r,className:u,"data-testid":"activity-timeline"},i),{children:d.jsx("div",{className:"activity-timeline__empty","data-testid":"activity-timeline-empty",children:t})})):d.jsx("div",V(R({ref:r,className:u,"data-testid":"activity-timeline"},i),{children:d.jsx("div",{className:"activity-timeline__list",children:e.map(h=>d.jsxs("div",V(R(R({className:["activity-timeline__event",h.onClick?"activity-timeline__event--clickable":""].filter(Boolean).join(" "),"data-testid":`activity-event-${h.id}`},h.kind&&{"data-kind":h.kind}),h.onClick&&{role:"button",tabIndex:0,onClick:()=>h.onClick(h),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),h.onClick(h))}}),{children:[d.jsx("div",{className:"activity-timeline__dot-container",children:h.dotColor?d.jsx("div",{className:"activity-timeline__dot--custom",style:{backgroundColor:Zo[h.dotColor]},"data-testid":`activity-dot-custom-${h.id}`}):d.jsx(Qp,{color:mT[h.type],className:"activity-timeline__dot","data-testid":`activity-dot-${h.type}`})}),d.jsxs("div",{className:"activity-timeline__content",children:[d.jsxs("div",{className:"activity-timeline__header",children:[h.kind&&d.jsx("span",{className:"activity-timeline__kind-label","data-testid":`activity-kind-tag-${h.id}`,children:h.kindLabel||h.kind}),d.jsx("div",{className:"activity-timeline__subject","data-testid":"activity-subject",children:h.headline||h.subject})]}),h.meta&&d.jsx("div",{className:"activity-timeline__meta","data-testid":"activity-meta",children:h.meta})]}),d.jsx("div",{className:"activity-timeline__timestamp","data-testid":"activity-timestamp",children:sS(h.timestamp)})]}),h.id))})}))});pT.displayName="ActivityTimeline";const gT=re.forwardRef((h,u)=>{var m=h,{entries:e=[],selectedId:t,onSelect:n,order:i="newest-first",emptyState:r="No versions available",className:c=""}=m,o=pe(m,["entries","selectedId","onSelect","order","emptyState","className"]);const g=M.useRef(null),p=re.useMemo(()=>{const w=[...e];return i==="oldest-first"?w.reverse():w},[e,i]),y=p.findIndex(w=>w.id===t),x=w=>{n&&(w.key==="ArrowUp"?(w.preventDefault(),y>0&&n(p[y-1].id)):w.key==="ArrowDown"?(w.preventDefault(),y<p.length-1&&n(p[y+1].id)):(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),y>=0&&n(p[y].id)))};M.useEffect(()=>{if(y>=0&&g.current&&t){const w=g.current.querySelector(`[data-version-id="${CSS.escape(t)}"]`);w&&w.scrollIntoView({block:"nearest"})}},[t,y]);const _=["version-timeline",c].filter(Boolean).join(" ");if(p.length===0)return d.jsx("div",V(R({ref:u,className:_,"data-testid":"version-timeline"},o),{children:d.jsx("div",{className:"version-timeline__empty","data-testid":"version-timeline-empty",children:r})}));const S=p.length>1;return d.jsx("div",V(R({ref:u,className:_,"data-testid":"version-timeline",role:"listbox",tabIndex:0,onKeyDown:x},o),{children:d.jsx("div",{className:"version-timeline__list",ref:g,children:p.map((w,N)=>d.jsxs("div",V(R({className:["version-timeline__entry",t===w.id?"version-timeline__entry--selected":"",n?"version-timeline__entry--clickable":""].filter(Boolean).join(" "),"data-version-id":w.id,"data-testid":`version-entry-${w.id}`,role:"option","aria-selected":t===w.id},n&&{onClick:()=>n(w.id),tabIndex:0}),{children:[d.jsxs("div",{className:"version-timeline__rail",children:[S&&N<p.length-1&&d.jsx("div",{className:"version-timeline__connector"}),d.jsx("div",{className:["version-timeline__dot",w.head?"version-timeline__dot--head":"version-timeline__dot--hollow"].filter(Boolean).join(" "),"data-testid":`version-dot-${w.id}`})]}),d.jsxs("div",{className:"version-timeline__content",children:[d.jsxs("div",{className:"version-timeline__header",children:[d.jsx(aa,{tone:"amber",className:"version-timeline__pill",children:w.label}),w.head&&d.jsx(Hn,{variant:"amber",form:"default",className:"version-timeline__head-chip","data-testid":`version-head-${w.id}`,children:"head"})]}),w.headline&&d.jsx("div",{className:"version-timeline__headline","data-testid":`version-headline-${w.id}`,children:w.headline}),w.transition?d.jsxs("div",{className:"version-timeline__transition","data-testid":`version-transition-${w.id}`,children:[d.jsx("span",{className:"version-timeline__transition-label",children:w.transition.from}),d.jsx("span",{className:"version-timeline__transition-arrow",children:"→"}),d.jsx("span",{className:"version-timeline__transition-label",children:w.transition.to})]}):w.stats?d.jsxs("div",{className:"version-timeline__stats","data-testid":`version-stats-${w.id}`,children:[w.stats.added!==void 0&&d.jsxs("span",{className:"version-timeline__stat version-timeline__stat--added",children:[d.jsxs("span",{className:"version-timeline__stat-symbol",children:["+",w.stats.added]}),d.jsxs("span",{className:"version-timeline__stat-label","aria-label":`${w.stats.added} added`,children:[w.stats.added," added"]})]}),w.stats.removed!==void 0&&d.jsxs("span",{className:"version-timeline__stat version-timeline__stat--removed",children:[d.jsxs("span",{className:"version-timeline__stat-symbol",children:["−",w.stats.removed]}),d.jsxs("span",{className:"version-timeline__stat-label","aria-label":`${w.stats.removed} removed`,children:[w.stats.removed," removed"]})]}),w.stats.kept!==void 0&&d.jsxs("span",{className:"version-timeline__stat version-timeline__stat--kept",children:[d.jsxs("span",{className:"version-timeline__stat-symbol",children:["∩",w.stats.kept]}),d.jsxs("span",{className:"version-timeline__stat-label","aria-label":`${w.stats.kept} kept`,children:[w.stats.kept," kept"]})]})]}):null]}),d.jsx("div",{className:"version-timeline__timestamp","data-testid":`version-timestamp-${w.id}`,children:sS(w.timestamp)})]}),w.id))})}))});gT.displayName="VersionTimeline";const sg=({itemCount:e,itemHeight:t,containerHeight:n,overscan:i=5})=>{const r=M.useRef(null),c=M.useRef(null),[o,u]=M.useState([0,Math.ceil(n/t)]);return M.useEffect(()=>{const h=r.current,m=c.current;if(!h||!m)return;const g=()=>{const p=m.getBoundingClientRect(),y=h.getBoundingClientRect().top-p.top,x=Math.max(0,Math.floor(y/t)-i),_=Math.min(e,Math.ceil((y+n)/t)+i);u(S=>S[0]===x&&S[1]===_?S:[x,_])};return h.addEventListener("scroll",g,{passive:!0}),g(),()=>{h.removeEventListener("scroll",g)}},[e,t,n,i]),{visibleRange:o,containerRef:r,sentinelRef:c}},tl=28,yT=400,oS=re.forwardRef((u,o)=>{var h=u,{added:e=[],removed:t=[],kept:n=[],maxVisible:i=10,className:r=""}=h,c=pe(h,["added","removed","kept","maxVisible","className"]);const[m,g]=M.useState(!1),p=e.length>0||t.length>0||n.length>0,y=n.length>i&&!m,x=m?n:n.slice(0,i),_=n.length-x.length,S=Math.max(e.length,t.length,y?i+1:n.length),{visibleRange:w,containerRef:N,sentinelRef:k}=sg({itemCount:S,itemHeight:tl,containerHeight:yT}),[C,j]=w,A=["hash-set-diff",r].filter(Boolean).join(" ");return p?d.jsxs("div",V(R({ref:o,className:A,role:"table"},c),{children:[d.jsxs("div",{className:"hash-set-diff__header",role:"row",children:[d.jsxs("div",{className:"hash-set-diff__column hash-set-diff__column--added",role:"cell",children:[d.jsx(aa,{tone:"emerald",className:"hash-set-diff__pill",children:"Added"}),d.jsx("span",{className:"hash-set-diff__count",children:e.length})]}),d.jsxs("div",{className:"hash-set-diff__column hash-set-diff__column--removed",role:"cell",children:[d.jsx(aa,{tone:"rose",className:"hash-set-diff__pill",children:"Removed"}),d.jsx("span",{className:"hash-set-diff__count",children:t.length})]}),d.jsxs("div",{className:"hash-set-diff__column hash-set-diff__column--kept",role:"cell",children:[d.jsx(aa,{className:"hash-set-diff__pill",children:"Kept"}),d.jsx("span",{className:"hash-set-diff__count",children:n.length})]})]}),d.jsx("div",{className:"hash-set-diff__viewport",ref:N,children:d.jsxs("div",{className:"hash-set-diff__content",style:{height:S*tl,position:"relative"},children:[d.jsx("div",{ref:k,style:{position:"absolute",top:0,left:0,width:"1px",height:`${S*tl}px`,visibility:"hidden",pointerEvents:"none"}}),d.jsx("div",{style:{height:C*tl}}),Array.from({length:Math.min(j-C,S-C)}).map((L,z)=>{const F=C+z,D=F<e.length?e[F]:null,T=F<t.length?t[F]:null;let B=null,P=!1;return y&&F===i?P=!0:F<x.length&&(B=x[F]),d.jsxs("div",{className:"hash-set-diff__row",style:{height:tl},role:"row",children:[d.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--added",role:"cell",children:D&&d.jsx("div",{className:"hash-set-diff__item",children:D})}),d.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--removed",role:"cell",children:T&&d.jsx("div",{className:"hash-set-diff__item",children:T})}),d.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--kept",role:"cell",children:P?d.jsxs("button",{type:"button",className:"hash-set-diff__expand-button",onClick:()=>g(!0),"aria-label":`Show ${_} more kept items`,children:["… ",_," more carried forward"]}):B&&d.jsx("div",{className:"hash-set-diff__item",children:B})})]},F)}),d.jsx("div",{style:{height:Math.max(0,(S-j)*tl)}})]})})]})):d.jsx("div",V(R({ref:o,className:A},c),{children:d.jsx("div",{className:"hash-set-diff__empty",children:"No changes between these versions"})}))});oS.displayName="HashSetDiff";const nl=24,vT=500,rg=re.forwardRef((r,i)=>{var c=r,{lines:e=[],className:t=""}=c,n=pe(c,["lines","className"]);const{visibleRange:o,containerRef:u,sentinelRef:h}=sg({itemCount:e.length,itemHeight:nl,containerHeight:vT}),[m,g]=o,p=["side-by-side-diff",t].filter(Boolean).join(" ");return e.length>0?d.jsxs("div",V(R({ref:i,className:p,role:"table"},n),{children:[d.jsxs("div",{className:"side-by-side-diff__header",role:"row",children:[d.jsx("div",{className:"side-by-side-diff__gutter",role:"cell"}),d.jsx("div",{role:"cell",className:"side-by-side-diff__header-cell",children:d.jsx(aa,{tone:"emerald",className:"side-by-side-diff__pill side-by-side-diff__pill--added",children:"Version 2 (Added)"})}),d.jsx("div",{role:"cell",className:"side-by-side-diff__header-cell",children:d.jsx(aa,{tone:"rose",className:"side-by-side-diff__pill side-by-side-diff__pill--removed",children:"Version 1 (Removed)"})})]}),d.jsx("div",{className:"side-by-side-diff__viewport",ref:u,children:d.jsxs("div",{className:"side-by-side-diff__content",style:{height:e.length*nl,position:"relative"},children:[d.jsx("div",{ref:h,style:{position:"absolute",top:0,left:0,width:"1px",height:`${e.length*nl}px`,visibility:"hidden",pointerEvents:"none"}}),d.jsx("div",{style:{height:m*nl}}),e.slice(m,g).map((y,x)=>{const _=m+x,S=y.type==="hunk",w=y.type==="added",N=y.type==="removed";return d.jsx("div",{className:["side-by-side-diff__row",`side-by-side-diff__row--${y.type}`].filter(Boolean).join(" "),style:{height:nl},role:"row",children:S?d.jsx("div",{className:"side-by-side-diff__hunk",role:"cell",children:y.content}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:["side-by-side-diff__gutter",w&&"side-by-side-diff__gutter--added",N&&"side-by-side-diff__gutter--removed"].filter(Boolean).join(" "),role:"cell",children:d.jsx("span",{className:"sr-only",children:w?"added":N?"removed":""})}),d.jsx("div",{className:["side-by-side-diff__line",w&&"side-by-side-diff__line--added",N&&"side-by-side-diff__line--removed"].filter(Boolean).join(" "),role:"cell",children:d.jsx("span",{className:"side-by-side-diff__content",children:y.content})})]})},_)}),d.jsx("div",{style:{height:Math.max(0,(e.length-g)*nl)}})]})})]})):d.jsx("div",V(R({ref:i,className:p},n),{children:d.jsx("div",{className:"side-by-side-diff__empty",children:"No changes between these versions"})}))});rg.displayName="SideBySideDiff";const lg=M.createContext(null),cS=re.forwardRef((o,c)=>{var u=o,{mode:e="hash-set",onModeChange:t,children:n,className:i=""}=u,r=pe(u,["mode","onModeChange","children","className"]);const[h,m]=M.useState(e);M.useEffect(()=>{m(e)},[e]);const g=x=>{m(x),t==null||t(x)},p=x=>{var _,S,w,N,k;const C=Array.from(((_=x.currentTarget.closest('[role="tablist"]'))==null?void 0:_.querySelectorAll('[role="tab"]'))||[]),j=C.indexOf(x.currentTarget);if(x.key==="ArrowLeft"){x.preventDefault();const A=j>0?j-1:C.length-1;(S=C[A])==null||S.focus()}else if(x.key==="ArrowRight"){x.preventDefault();const A=j<C.length-1?j+1:0;(w=C[A])==null||w.focus()}else x.key==="Home"?(x.preventDefault(),(N=C[0])==null||N.focus()):x.key==="End"&&(x.preventDefault(),(k=C[C.length-1])==null||k.focus())},y=["diff-viewer",i].filter(Boolean).join(" ");return d.jsx(lg.Provider,{value:h,children:d.jsxs("div",V(R({ref:c,className:y,role:"region","aria-label":"Diff Viewer","data-testid":"diff-viewer"},r),{children:[d.jsxs("div",{className:"diff-viewer__header",role:"tablist",children:[d.jsx("button",{type:"button",id:"diff-viewer-hash-set-tab",role:"tab","aria-selected":h==="hash-set","aria-controls":"diff-viewer-hash-set-panel",className:["diff-viewer__tab",h==="hash-set"&&"diff-viewer__tab--active"].filter(Boolean).join(" "),onClick:()=>g("hash-set"),onKeyDown:p,children:"Hash Set"}),d.jsx("button",{type:"button",id:"diff-viewer-side-by-side-tab",role:"tab","aria-selected":h==="side-by-side","aria-controls":"diff-viewer-side-by-side-panel",className:["diff-viewer__tab",h==="side-by-side"&&"diff-viewer__tab--active"].filter(Boolean).join(" "),onClick:()=>g("side-by-side"),onKeyDown:p,children:"Side by Side"})]}),d.jsxs("div",{className:"diff-viewer__content","data-testid":"diff-viewer-content",children:[h==="hash-set"&&d.jsx("div",{id:"diff-viewer-hash-set-panel",role:"tabpanel","aria-labelledby":"diff-viewer-hash-set-tab",className:"diff-viewer__panel diff-viewer__panel--hash-set",children:n}),h==="side-by-side"&&d.jsx("div",{id:"diff-viewer-side-by-side-panel",role:"tabpanel","aria-labelledby":"diff-viewer-side-by-side-tab",className:"diff-viewer__panel diff-viewer__panel--side-by-side",children:n})]})]}))})});cS.displayName="DiffViewer";function uS(h){var m=h,{added:e,removed:t,kept:n,maxVisible:i,label:r="Changes",labelTone:c="amber",className:o=""}=m,u=pe(m,["added","removed","kept","maxVisible","label","labelTone","className"]);return M.useContext(lg)!=="hash-set"?null:d.jsxs("div",V(R({className:["diff-viewer-hash-set",o].filter(Boolean).join(" ")},u),{children:[r&&d.jsx("div",{className:"diff-viewer-hash-set__header",children:d.jsx(aa,{tone:c,className:"diff-viewer-hash-set__label",children:r})}),d.jsx(oS,{added:e,removed:t,kept:n,maxVisible:i})]}))}uS.displayName="DiffViewerHashSet";function dS(u){var h=u,{lines:e,addedLabel:t="Version 2 (Added)",removedLabel:n="Version 1 (Removed)",addedLabelTone:i="emerald",removedLabelTone:r="rose",className:c=""}=h,o=pe(h,["lines","addedLabel","removedLabel","addedLabelTone","removedLabelTone","className"]);return M.useContext(lg)!=="side-by-side"?null:d.jsxs("div",V(R({className:["diff-viewer-side-by-side",c].filter(Boolean).join(" ")},o),{children:[(t||n)&&d.jsx("div",{className:"diff-viewer-side-by-side__header",children:d.jsxs("div",{className:"diff-viewer-side-by-side__labels",children:[t&&d.jsx(aa,{tone:i,className:"diff-viewer-side-by-side__label",children:t}),n&&d.jsx(aa,{tone:r,className:"diff-viewer-side-by-side__label",children:n})]})}),d.jsx(rg,{lines:e})]}))}dS.displayName="DiffViewerSideBySide";Object.assign(cS,{HashSet:uS,SideBySide:dS});const xT={error:"rose",warn:"amber",info:"cyan",success:"emerald"},bT=re.forwardRef((c,r)=>{var o=c,{alerts:e=[],onDismiss:t,className:n=""}=o,i=pe(o,["alerts","onDismiss","className"]);const u=["alert-strip",n].filter(Boolean).join(" ");return e.length===0?null:d.jsx("div",V(R({ref:r,className:u,"data-testid":"alert-strip"},i),{children:e.map(h=>d.jsxs("div",{className:"alert-strip__alert","data-testid":`alert-${h.id}`,children:[d.jsx(Qp,{color:xT[h.severity],"data-testid":`alert-severity-${h.severity}`}),d.jsx("div",{className:"alert-strip__message","data-testid":"alert-message",children:h.message}),t&&d.jsx("button",{type:"button",className:"alert-strip__dismiss",onClick:()=>t(h.id),"aria-label":`Dismiss alert: ${h.message}`,"data-testid":`alert-dismiss-${h.id}`,children:d.jsx(Ee,{name:"x",size:16})})]},h.id))}))});bT.displayName="AlertStrip";const fS=re.forwardRef((o,c)=>{var u=o,{icon:e,title:t,description:n,className:i=""}=u,r=pe(u,["icon","title","description","className"]);const h=["quick-access-tile",i].filter(Boolean).join(" ");return d.jsxs("button",V(R({ref:c,type:"button",className:h,"data-testid":"quick-access-tile"},r),{children:[d.jsx("div",{className:"quick-access-tile__icon",children:d.jsx(Ee,{name:e,size:16})}),d.jsxs("div",{className:"quick-access-tile__body",children:[d.jsx("div",{className:"quick-access-tile__title",children:t}),n&&d.jsx("div",{className:"quick-access-tile__description",children:n})]}),d.jsx(Ee,{name:"chevronRight",size:13,className:"quick-access-tile__chev"})]}))});fS.displayName="QuickAccessTile";const _T=re.forwardRef((o,c)=>{var u=o,{tiles:e,onAction:t,columns:n=4,className:i=""}=u,r=pe(u,["tiles","onAction","columns","className"]);const h=["quick-access-grid",i].filter(Boolean).join(" ");return d.jsx("div",V(R({ref:c,className:h,style:{"--qa-columns":n},"data-testid":"quick-access-grid"},r),{children:e.map(m=>d.jsx(fS,{icon:m.icon,title:m.title,description:m.description,onClick:()=>t==null?void 0:t(m.id),"data-testid":`quick-access-tile-${m.id}`},m.id))}))});_T.displayName="QuickAccessGrid";const ST=re.forwardRef((g,m)=>{var p=g,{icon:e,title:t,description:n,summary:i=[],onClick:r,className:c="",disabled:o,type:u="button"}=p,h=pe(p,["icon","title","description","summary","onClick","className","disabled","type"]);const y=["config-tile",o&&"config-tile--disabled",c].filter(Boolean).join(" ");return d.jsxs("button",V(R({ref:m,type:u,className:y,onClick:r,disabled:o,"data-testid":"config-tile"},h),{children:[d.jsx("div",{className:"config-tile__icon",children:d.jsx(Ee,{name:e,size:24})}),d.jsxs("div",{className:"config-tile__content",children:[d.jsx("div",{className:"config-tile__title",children:t}),n&&d.jsx("div",{className:"config-tile__description",children:n}),i.length>0&&d.jsx("div",{className:"config-tile__summary",children:i.map((x,_)=>d.jsxs(re.Fragment,{children:[d.jsx("div",{className:"config-tile__summary-key",children:x.label}),d.jsx("div",{className:"config-tile__summary-value",children:x.value})]},_))})]}),d.jsx("div",{className:"config-tile__chevron",children:d.jsx(Ee,{name:"chevronRight",size:16})})]}))});ST.displayName="ConfigTile";const wT=e=>/^https?:\/\//.test(e)||e.startsWith("/"),hS=re.forwardRef((p,g)=>{var y=p,{role:e,senderName:t,timestamp:n,body:i,avatar:r,badge:c,toolBlock:o,thinkingBlock:u,className:h=""}=y,m=pe(y,["role","senderName","timestamp","body","avatar","badge","toolBlock","thinkingBlock","className"]);const x=r&&wT(r)?d.jsx("img",{src:r,alt:t,className:"chat-message__avatar-img"}):r||t.slice(0,2).toUpperCase();return d.jsxs("div",V(R({ref:g,className:["chat-message",`chat-message--${e}`,h].filter(Boolean).join(" "),"data-testid":`chat-message-${e}`},m),{children:[d.jsx("div",{className:"chat-message__avatar",children:x}),d.jsxs("div",{className:"chat-message__content",children:[d.jsxs("div",{className:"chat-message__meta",children:[d.jsx("span",{className:"chat-message__sender",children:t}),c&&d.jsx("span",{className:"chat-message__badge",children:c}),d.jsx("span",{className:"chat-message__timestamp",children:n})]}),d.jsx("div",{className:"chat-message__body",children:i}),u&&d.jsx(pS,{content:u.content}),o&&d.jsx(mS,{name:o.name,status:o.status,output:o.output})]})]}))});hS.displayName="ChatMessage";const mS=re.forwardRef((h,u)=>{var m=h,{name:e,status:t,output:n=[],defaultCollapsed:i=!1,onToggleCollapsed:r,className:c=""}=m,o=pe(m,["name","status","output","defaultCollapsed","onToggleCollapsed","className"]);const[g,p]=re.useState(i),y=re.useId(),x=re.useCallback(()=>{const S=!g;p(S),r==null||r(S)},[g,r]),_=t==="running"?"amber":t==="success"?"emerald":"rose";return d.jsxs("div",V(R({ref:u,className:["tool-block",c].filter(Boolean).join(" "),"data-testid":"tool-block"},o),{children:[d.jsxs("button",{type:"button",className:"tool-block__header",onClick:x,"aria-expanded":!g,"aria-controls":n.length>0?y:void 0,children:[d.jsx(Ee,{name:g?"chevronRight":"chevronDown",size:12,className:"tool-block__toggle-icon"}),d.jsx("span",{className:"tool-block__name",children:e}),d.jsx("span",{className:`tool-block__status tool-block__status--${_}`,children:t==="running"?"running":t==="success"?"success":"error"})]}),!g&&n.length>0&&d.jsx("div",{id:y,className:"tool-block__output",children:n.map((S,w)=>d.jsxs("div",{className:"tool-block__output-row",children:[S.key&&d.jsx("span",{className:"tool-block__key",children:S.key}),d.jsx("span",{className:"tool-block__value",children:S.value})]},w))})]}))});mS.displayName="ToolBlock";const pS=re.forwardRef((u,o)=>{var h=u,{content:e,label:t="thinking",defaultCollapsed:n=!1,onToggleCollapsed:i,className:r=""}=h,c=pe(h,["content","label","defaultCollapsed","onToggleCollapsed","className"]);const[m,g]=re.useState(n),p=re.useId(),y=re.useCallback(()=>{const x=!m;g(x),i==null||i(x)},[m,i]);return d.jsxs("div",V(R({ref:o,className:["thinking-block",r].filter(Boolean).join(" "),"data-testid":"thinking-block"},c),{children:[d.jsxs("button",{type:"button",className:"thinking-block__header",onClick:y,"aria-expanded":!m,"aria-controls":m?void 0:p,children:[d.jsx(Ee,{name:m?"chevronRight":"chevronDown",size:12,className:"thinking-block__toggle-icon"}),d.jsx("span",{className:"thinking-block__label",children:t})]}),!m&&d.jsx("div",{id:p,className:"thinking-block__content",children:e})]}))});pS.displayName="ThinkingBlock";const NT=re.forwardRef((r,i)=>{var c=r,{label:e,className:t=""}=c,n=pe(c,["label","className"]);return d.jsxs("div",V(R({ref:i,role:"separator","aria-label":e,className:["chat-divider",t].filter(Boolean).join(" "),"data-testid":"chat-divider"},n),{children:[d.jsx("span",{className:"chat-divider__line"}),d.jsx("span",{className:"chat-divider__label","aria-hidden":"true",children:e}),d.jsx("span",{className:"chat-divider__line"})]}))});NT.displayName="ChatDivider";const gS=re.forwardRef((u,o)=>{var h=u,{suggestions:e,onSelect:t,selected:n,className:i="","aria-label":r="Suggestions"}=h,c=pe(h,["suggestions","onSelect","selected","className","aria-label"]);if(!e||e.length===0)return null;const m=n!==void 0;return d.jsx("div",V(R({ref:o,role:"group","aria-label":r,className:["chat-suggestions",i].filter(Boolean).join(" "),"data-testid":"chat-suggestions"},c),{children:e.map(g=>{const p=g===n,y=m&&!p;return d.jsx("button",{className:["chat-suggestions__pill",p?"chat-suggestions__pill--selected":"",y?"chat-suggestions__pill--disabled":""].filter(Boolean).join(" "),onClick:()=>!y&&t(g),type:"button",disabled:y,"aria-pressed":p,children:g},g)})}))});gS.displayName="ChatSuggestions";const CT=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`id-${Math.random().toString(36).slice(2,11)}-${Date.now()}`,yS=re.forwardRef((w,S)=>{var N=w,{placeholder:e="Type a message...",value:t,onChange:n,onSubmit:i,onContextChange:r,onAttachmentChange:c,scopeLabel:o,contextItems:u=[],attachments:h=[],disabled:m=!1,loading:g=!1,label:p="Message",accept:y,className:x}=N,_=pe(N,["placeholder","value","onChange","onSubmit","onContextChange","onAttachmentChange","scopeLabel","contextItems","attachments","disabled","loading","label","accept","className"]);const k=M.useRef(null),C=M.useRef(null);M.useEffect(()=>{if(k.current){k.current.style.height="auto";const D=Math.min(k.current.scrollHeight,200);k.current.style.height=`${D}px`}},[t]);const j=D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),t.trim()&&!m&&!g&&i(t,u))},A=()=>{t.trim()&&!m&&!g&&i(t,u)},L=D=>{const T=u.filter(B=>B.id!==D);r==null||r(T)},z=D=>{if(!D.target.files)return;const T=Array.from(D.target.files).map(P=>({id:CT(),name:P.name,size:P.size})),B=[...h,...T];c==null||c(B),C.current&&(C.current.value="")},F=D=>{const T=h.filter(B=>B.id!==D);c==null||c(T)};return d.jsxs("div",V(R({ref:S,className:["chat-composer",m&&"chat-composer--disabled",x].filter(Boolean).join(" ")},_),{children:[d.jsxs("div",{className:"chat-composer__tools",children:[o&&d.jsxs("span",{className:"chat-composer__scope",children:["talking to ",d.jsx("b",{children:o})]}),u.map(D=>d.jsxs("div",{className:"chat-composer__context-pill",children:[d.jsx("span",{className:"chat-composer__context-label",children:D.label}),d.jsx("button",{className:"chat-composer__context-remove",onClick:()=>L(D.id),"aria-label":`Remove ${D.label}`,type:"button",children:d.jsx(Ee,{name:"x",size:10})})]},D.id)),h.map(D=>d.jsxs("div",{className:"chat-composer__attachment-pill",children:[d.jsx(Ee,{name:"paperclip",size:10}),d.jsx("span",{className:"chat-composer__attachment-label",children:D.name}),d.jsx("button",{className:"chat-composer__attachment-remove",onClick:()=>F(D.id),"aria-label":`Remove ${D.name}`,type:"button",children:d.jsx(Ee,{name:"x",size:10})})]},D.id))]}),d.jsxs("div",{className:"chat-composer__input-wrapper",children:[d.jsx("textarea",{ref:k,className:"chat-composer__input",placeholder:e,value:t,onChange:D=>n(D.target.value),onKeyDown:j,rows:2,disabled:m,"aria-label":p}),d.jsxs("div",{className:"chat-composer__footer",children:[d.jsx("div",{className:"chat-composer__footer-start",children:d.jsxs("span",{className:"chat-composer__hint",children:[d.jsx("b",{children:"↵"})," send · ",d.jsx("b",{children:"⇧↵"})," newline"]})}),d.jsxs("div",{className:"chat-composer__footer-end",children:[d.jsx("input",{ref:C,type:"file",multiple:!0,accept:y,onChange:z,className:"chat-composer__file-input","aria-label":"Attach files"}),d.jsx("button",{className:"chat-composer__attach-button",onClick:()=>{var D;return(D=C.current)==null?void 0:D.click()},type:"button","aria-label":"Attach files",disabled:m,children:d.jsx(Ee,{name:"paperclip",size:12})}),d.jsxs(_n,{variant:"primary",size:"sm",onClick:A,disabled:!t.trim()||m||g,children:[d.jsx(Ee,{name:"send",size:12}),"send"]})]})]})]})]}))});yS.displayName="ChatComposer";const vS=re.forwardRef((m,h)=>{var g=m,{children:e,bots:t=[],activeBotId:n,onBotChange:i,autoScroll:r=!0,composer:c,className:o=""}=g,u=pe(g,["children","bots","activeBotId","onBotChange","autoScroll","composer","className"]);const p=M.useRef(null);return M.useEffect(()=>{r&&p.current&&(p.current.scrollTop=p.current.scrollHeight)},[e,r]),d.jsxs("div",V(R({ref:h,className:["chat-container",o].filter(Boolean).join(" ")},u),{children:[t&&t.length>0&&d.jsx("div",{className:"chat-container__bot-tabs",role:"group","aria-label":"Bot tabs",children:t.map(y=>d.jsxs("button",{type:"button",className:["chat-container__bot-tab",n===y.id&&"chat-container__bot-tab--active"].filter(Boolean).join(" "),onClick:()=>i==null?void 0:i(y.id),"aria-pressed":n===y.id,"aria-label":`${y.label} — ${y.role}`,children:[d.jsxs("span",{className:"chat-container__bot-label",children:[d.jsx("span",{className:["chat-container__bot-status",`chat-container__bot-status--${y.status}`].filter(Boolean).join(" ")}),y.label]}),d.jsx("span",{className:"chat-container__bot-role",children:y.role})]},y.id))}),d.jsx("div",{ref:p,className:"chat-container__thread",role:"log","aria-live":"polite","aria-atomic":"false",children:d.jsx("div",{className:"chat-container__messages",children:e})}),c]}))});vS.displayName="ChatContainer";function jT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ET=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,MT={};function xx(e,t){return(MT.jsx?kT:ET).test(e)}const TT=/[ \t\n\f\r]/g;function RT(e){return typeof e=="object"?e.type==="text"?bx(e.value):!1:bx(e)}function bx(e){return e.replace(TT,"")===""}class oc{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}oc.prototype.normal={};oc.prototype.property={};oc.prototype.space=void 0;function xS(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new oc(n,i,t)}function rp(e){return e.toLowerCase()}class Pn{constructor(t,n){this.attribute=n,this.property=t}}Pn.prototype.attribute="";Pn.prototype.booleanish=!1;Pn.prototype.boolean=!1;Pn.prototype.commaOrSpaceSeparated=!1;Pn.prototype.commaSeparated=!1;Pn.prototype.defined=!1;Pn.prototype.mustUseProperty=!1;Pn.prototype.number=!1;Pn.prototype.overloadedBoolean=!1;Pn.prototype.property="";Pn.prototype.spaceSeparated=!1;Pn.prototype.space=void 0;let AT=0;const Ke=xr(),Wt=xr(),lp=xr(),be=xr(),Lt=xr(),dr=xr(),ea=xr();function xr(){return Nu(2,++AT)}const op=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:Wt,commaOrSpaceSeparated:ea,commaSeparated:dr,number:be,overloadedBoolean:lp,spaceSeparated:Lt},Symbol.toStringTag,{value:"Module"})),gm=Object.keys(op);class og extends Pn{constructor(t,n,i,r){let c=-1;if(super(t,n),_x(this,"space",r),typeof i=="number")for(;++c<gm.length;){const o=gm[c];_x(this,gm[c],(i&op[o])===op[o])}}}og.prototype.defined=!0;function _x(e,t,n){n&&(e[t]=n)}function Tl(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const c=new og(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(c.mustUseProperty=!0),t[i]=c,n[rp(i)]=i,n[rp(c.attribute)]=i}return new oc(t,n,e.space)}const bS=Tl({properties:{ariaActiveDescendant:null,ariaAtomic:Wt,ariaAutoComplete:null,ariaBusy:Wt,ariaChecked:Wt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:Lt,ariaCurrent:null,ariaDescribedBy:Lt,ariaDetails:null,ariaDisabled:Wt,ariaDropEffect:Lt,ariaErrorMessage:null,ariaExpanded:Wt,ariaFlowTo:Lt,ariaGrabbed:Wt,ariaHasPopup:null,ariaHidden:Wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Lt,ariaLevel:be,ariaLive:null,ariaModal:Wt,ariaMultiLine:Wt,ariaMultiSelectable:Wt,ariaOrientation:null,ariaOwns:Lt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Wt,ariaReadOnly:Wt,ariaRelevant:null,ariaRequired:Wt,ariaRoleDescription:Lt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Wt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function _S(e,t){return t in e?e[t]:t}function SS(e,t){return _S(e,t.toLowerCase())}const LT=Tl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:dr,acceptCharset:Lt,accessKey:Lt,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alpha:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:Lt,autoFocus:Ke,autoPlay:Ke,blocking:Lt,capture:null,charSet:null,checked:Ke,cite:null,className:Lt,closedBy:null,colorSpace:null,cols:be,colSpan:be,command:null,commandFor:null,content:null,contentEditable:Wt,controls:Ke,controlsList:Lt,coords:be|dr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:lp,draggable:Wt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:Lt,height:be,hidden:lp,high:be,href:null,hrefLang:null,htmlFor:Lt,httpEquiv:Lt,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:Lt,itemRef:Lt,itemScope:Ke,itemType:Lt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ke,optimum:be,pattern:null,ping:Lt,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:Lt,required:Ke,reversed:Ke,rows:be,rowSpan:be,sandbox:Lt,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootCustomElementRegistry:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shadowRootSerializable:Ke,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Wt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:Wt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Lt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Wt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ke,disablePictureInPicture:Ke,disableRemotePlayback:Ke,exportParts:dr,part:Lt,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:SS}),DT=Tl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ea,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:Lt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:dr,g2:dr,glyphName:dr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:ea,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Lt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ea,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ea,rev:ea,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ea,requiredFeatures:ea,requiredFonts:ea,requiredFormats:ea,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:ea,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ea,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ea,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:_S}),wS=Tl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),NS=Tl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:SS}),CS=Tl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),OT={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},zT=/[A-Z]/g,Sx=/-[a-z]/g,IT=/^data[-\w.:]+$/i;function BT(e,t){const n=rp(t);let i=t,r=Pn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&IT.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(Sx,FT);i="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!Sx.test(c)){let o=c.replace(zT,UT);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=og}return new r(i,t)}function UT(e){return"-"+e.toLowerCase()}function FT(e){return e.charAt(1).toUpperCase()}const HT=xS([bS,LT,wS,NS,CS],"html"),cg=xS([bS,DT,wS,NS,CS],"svg");function PT(e){return e.join(" ").trim()}var ld=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ug={},wx=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,$T=/\n/g,qT=/^\s*/,VT=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,GT=/^:\s*/,YT=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,KT=/^[;\s]*/,XT=/^\s+|\s+$/g,QT=`
50
- `,Nx="/",Cx="*",Qs="",ZT="comment",JT="declaration";function WT(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,i=1;function r(_){var S=_.match($T);S&&(n+=S.length);var w=_.lastIndexOf(QT);i=~w?_.length-w:i+_.length}function c(){var _={line:n,column:i};return function(S){return S.position=new o(_),m(),S}}function o(_){this.start=_,this.end={line:n,column:i},this.source=t.source}o.prototype.content=e;function u(_){var S=new Error(t.source+":"+n+":"+i+": "+_);if(S.reason=_,S.filename=t.source,S.line=n,S.column=i,S.source=e,!t.silent)throw S}function h(_){var S=_.exec(e);if(S){var w=S[0];return r(w),e=e.slice(w.length),S}}function m(){h(qT)}function g(_){var S;for(_=_||[];S=p();)S!==!1&&_.push(S);return _}function p(){var _=c();if(!(Nx!=e.charAt(0)||Cx!=e.charAt(1))){for(var S=2;Qs!=e.charAt(S)&&(Cx!=e.charAt(S)||Nx!=e.charAt(S+1));)++S;if(S+=2,Qs===e.charAt(S-1))return u("End of comment missing");var w=e.slice(2,S-2);return i+=2,r(w),e=e.slice(S),i+=2,_({type:ZT,comment:w})}}function y(){var _=c(),S=h(VT);if(S){if(p(),!h(GT))return u("property missing ':'");var w=h(YT),N=_({type:JT,property:jx(S[0].replace(wx,Qs)),value:w?jx(w[0].replace(wx,Qs)):Qs});return h(KT),N}}function x(){var _=[];g(_);for(var S;S=y();)S!==!1&&(_.push(S),g(_));return _}return m(),x()}function jx(e){return e?e.replace(XT,Qs):Qs}var eR=WT,tR=ld&&ld.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ug,"__esModule",{value:!0});ug.default=aR;const nR=tR(eR);function aR(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,nR.default)(e),r=typeof t=="function";return i.forEach(c=>{if(c.type!=="declaration")return;const{property:o,value:u}=c;r?t(o,u,c):u&&(n=n||{},n[o]=u)}),n}var Cd={};Object.defineProperty(Cd,"__esModule",{value:!0});Cd.camelCase=void 0;var iR=/^--[a-zA-Z0-9_-]+$/,sR=/-([a-z])/g,rR=/^[^-]+$/,lR=/^-(webkit|moz|ms|o|khtml)-/,oR=/^-(ms)-/,cR=function(e){return!e||rR.test(e)||iR.test(e)},uR=function(e,t){return t.toUpperCase()},Ex=function(e,t){return"".concat(t,"-")},dR=function(e,t){return t===void 0&&(t={}),cR(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(oR,Ex):e=e.replace(lR,Ex),e.replace(sR,uR))};Cd.camelCase=dR;var fR=ld&&ld.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},hR=fR(ug),mR=Cd;function cp(e,t){var n={};return!e||typeof e!="string"||(0,hR.default)(e,function(i,r){i&&r&&(n[(0,mR.camelCase)(i,t)]=r)}),n}cp.default=cp;var pR=cp;const gR=jS(pR),ES=kS("end"),dg=kS("start");function kS(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function yR(e){const t=dg(e),n=ES(e);if(t&&n)return{start:t,end:n}}function Ho(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?kx(e.position):"start"in e||"end"in e?kx(e):"line"in e||"column"in e?up(e):""}function up(e){return Mx(e&&e.line)+":"+Mx(e&&e.column)}function kx(e){return up(e&&e.start)+"-"+up(e&&e.end)}function Mx(e){return e&&typeof e=="number"?e:1}class Sn extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",c={},o=!1;if(n&&("line"in n&&"column"in n?c={place:n}:"start"in n&&"end"in n?c={place:n}:"type"in n?c={ancestors:[n],place:n.position}:c=R({},n)),typeof t=="string"?r=t:!c.cause&&t&&(o=!0,r=t.message,c.cause=t),!c.ruleId&&!c.source&&typeof i=="string"){const h=i.indexOf(":");h===-1?c.ruleId=i:(c.source=i.slice(0,h),c.ruleId=i.slice(h+1))}if(!c.place&&c.ancestors&&c.ancestors){const h=c.ancestors[c.ancestors.length-1];h&&(c.place=h.position)}const u=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=u?u.line:void 0,this.name=Ho(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=o&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Sn.prototype.file="";Sn.prototype.name="";Sn.prototype.reason="";Sn.prototype.message="";Sn.prototype.stack="";Sn.prototype.column=void 0;Sn.prototype.line=void 0;Sn.prototype.ancestors=void 0;Sn.prototype.cause=void 0;Sn.prototype.fatal=void 0;Sn.prototype.place=void 0;Sn.prototype.ruleId=void 0;Sn.prototype.source=void 0;const fg={}.hasOwnProperty,vR=new Map,xR=/[A-Z]/g,bR=new Set(["table","tbody","thead","tfoot","tr"]),_R=new Set(["td","th"]),MS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function SR(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=TR(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=MR(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?cg:HT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},c=TS(r,e,void 0);return c&&typeof c!="string"?c:r.create(e,r.Fragment,{children:c||void 0},void 0)}function TS(e,t,n){if(t.type==="element")return wR(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return NR(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return jR(e,t,n);if(t.type==="mdxjsEsm")return CR(e,t);if(t.type==="root")return ER(e,t,n);if(t.type==="text")return kR(e,t)}function wR(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=cg,e.schema=r),e.ancestors.push(t);const c=AS(e,t.tagName,!1),o=RR(e,t);let u=mg(e,t);return bR.has(t.tagName)&&(u=u.filter(function(h){return typeof h=="string"?!RT(h):!0})),RS(e,o,c,t),hg(o,u),e.ancestors.pop(),e.schema=i,e.create(t,c,o,n)}function NR(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Wo(e,t.position)}function CR(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Wo(e,t.position)}function jR(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=cg,e.schema=r),e.ancestors.push(t);const c=t.name===null?e.Fragment:AS(e,t.name,!0),o=AR(e,t),u=mg(e,t);return RS(e,o,c,t),hg(o,u),e.ancestors.pop(),e.schema=i,e.create(t,c,o,n)}function ER(e,t,n){const i={};return hg(i,mg(e,t)),e.create(t,e.Fragment,i,n)}function kR(e,t){return t.value}function RS(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function hg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function MR(e,t,n){return i;function i(r,c,o,u){const h=Array.isArray(o.children)?n:t;return u?h(c,o,u):h(c,o)}}function TR(e,t){return n;function n(i,r,c,o){const u=Array.isArray(c.children),h=dg(i);return t(r,c,o,u,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function RR(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&fg.call(t.properties,r)){const c=LR(e,r,t.properties[r]);if(c){const[o,u]=c;e.tableCellAlignToStyle&&o==="align"&&typeof u=="string"&&_R.has(t.tagName)?i=u:n[o]=u}}if(i){const c=n.style||(n.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function AR(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const r=i.data.estree.body[0];r.type;const c=r.expression;c.type;const o=c.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Wo(e,t.position);else{const r=i.name;let c;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const o=i.value.data.estree.body[0];o.type,c=e.evaluater.evaluateExpression(o.expression)}else Wo(e,t.position);else c=i.value===null?!0:i.value;n[r]=c}return n}function mg(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:vR;for(;++i<t.children.length;){const c=t.children[i];let o;if(e.passKeys){const h=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(h){const m=r.get(h)||0;o=h+"-"+m,r.set(h,m+1)}}const u=TS(e,c,o);u!==void 0&&n.push(u)}return n}function LR(e,t,n){const i=BT(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?jT(n):PT(n)),i.property==="style"){let r=typeof n=="object"?n:DR(e,String(n));return e.stylePropertyNameCase==="css"&&(r=OR(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&i.space?OT[i.property]||i.property:i.attribute,n]}}function DR(e,t){try{return gR(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,r=new Sn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=MS+"#cannot-parse-style-attribute",r}}function AS(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let c=-1,o;for(;++c<r.length;){const u=xx(r[c])?{type:"Identifier",name:r[c]}:{type:"Literal",value:r[c]};o=o?{type:"MemberExpression",object:o,property:u,computed:!!(c&&u.type==="Literal"),optional:!1}:u}i=o}else i=xx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const r=i.value;return fg.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(i);Wo(e)}function Wo(e,t){const n=new Sn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=MS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function OR(e){const t={};let n;for(n in e)fg.call(e,n)&&(t[zR(n)]=e[n]);return t}function zR(e){let t=e.replace(xR,IR);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function IR(e){return"-"+e.toLowerCase()}const ym={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},BR={};function pg(e,t){const n=BR,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return LS(e,i,r)}function LS(e,t,n){if(UR(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Tx(e.children,t,n)}return Array.isArray(e)?Tx(e,t,n):""}function Tx(e,t,n){const i=[];let r=-1;for(;++r<e.length;)i[r]=LS(e[r],t,n);return i.join("")}function UR(e){return!!(e&&typeof e=="object")}const Rx=document.createElement("i");function gg(e){const t="&"+e+";";Rx.innerHTML=t;const n=Rx.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ia(e,t,n,i){const r=e.length;let c=0,o;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);c<i.length;)o=i.slice(c,c+1e4),o.unshift(t,0),e.splice(...o),c+=1e4,t+=1e4}function _a(e,t){return e.length>0?(ia(e,e.length,0,t),e):t}const Ax={}.hasOwnProperty;function DS(e){const t={};let n=-1;for(;++n<e.length;)FR(t,e[n]);return t}function FR(e,t){let n;for(n in t){const i=(Ax.call(e,n)?e[n]:void 0)||(e[n]={}),r=t[n];let c;if(r)for(c in r){Ax.call(i,c)||(i[c]=[]);const o=r[c];HR(i[c],Array.isArray(o)?o:o?[o]:[])}}}function HR(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);ia(e,0,0,i)}function OS(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function La(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=Ms(/[A-Za-z]/),bn=Ms(/[\dA-Za-z]/),PR=Ms(/[#-'*+\--9=?A-Z^-~]/);function od(e){return e!==null&&(e<32||e===127)}const dp=Ms(/\d/),$R=Ms(/[\dA-Fa-f]/),qR=Ms(/[!-/:-@[-`{-~]/);function qe(e){return e!==null&&e<-2}function Dt(e){return e!==null&&(e<0||e===32)}function st(e){return e===-2||e===-1||e===32}const jd=Ms(new RegExp("\\p{P}|\\p{S}","u")),yr=Ms(/\s/);function Ms(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Rl(e){const t=[];let n=-1,i=0,r=0;for(;++n<e.length;){const c=e.charCodeAt(n);let o="";if(c===37&&bn(e.charCodeAt(n+1))&&bn(e.charCodeAt(n+2)))r=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(o=String.fromCharCode(c));else if(c>55295&&c<57344){const u=e.charCodeAt(n+1);c<56320&&u>56319&&u<57344?(o=String.fromCharCode(c,u),r=1):o="�"}else o=String.fromCharCode(c);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+r+1,o=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function dt(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let c=0;return o;function o(h){return st(h)?(e.enter(n),u(h)):t(h)}function u(h){return st(h)&&c++<r?(e.consume(h),u):(e.exit(n),t(h))}}const VR={tokenize:GR};function GR(e){const t=e.attempt(this.parser.constructs.contentInitial,i,r);let n;return t;function i(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),dt(e,t,"linePrefix")}function r(u){return e.enter("paragraph"),c(u)}function c(u){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,o(u)}function o(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return qe(u)?(e.consume(u),e.exit("chunkText"),c):(e.consume(u),o)}}const YR={tokenize:KR},Lx={tokenize:XR};function KR(e){const t=this,n=[];let i=0,r,c,o;return u;function u(C){if(i<n.length){const j=n[i];return t.containerState=j[1],e.attempt(j[0].continuation,h,m)(C)}return m(C)}function h(C){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&k();const j=t.events.length;let A=j,L;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){L=t.events[A][1].end;break}N(i);let z=j;for(;z<t.events.length;)t.events[z][1].end=R({},L),z++;return ia(t.events,A+1,0,t.events.slice(j)),t.events.length=z,m(C)}return u(C)}function m(C){if(i===n.length){if(!r)return y(C);if(r.currentConstruct&&r.currentConstruct.concrete)return _(C);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Lx,g,p)(C)}function g(C){return r&&k(),N(i),y(C)}function p(C){return t.parser.lazy[t.now().line]=i!==n.length,o=t.now().offset,_(C)}function y(C){return t.containerState={},e.attempt(Lx,x,_)(C)}function x(C){return i++,n.push([t.currentConstruct,t.containerState]),y(C)}function _(C){if(C===null){r&&k(),N(0),e.consume(C);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:c}),S(C)}function S(C){if(C===null){w(e.exit("chunkFlow"),!0),N(0),e.consume(C);return}return qe(C)?(e.consume(C),w(e.exit("chunkFlow")),i=0,t.interrupt=void 0,u):(e.consume(C),S)}function w(C,j){const A=t.sliceStream(C);if(j&&A.push(null),C.previous=c,c&&(c.next=C),c=C,r.defineSkip(C.start),r.write(A),t.parser.lazy[C.start.line]){let L=r.events.length;for(;L--;)if(r.events[L][1].start.offset<o&&(!r.events[L][1].end||r.events[L][1].end.offset>o))return;const z=t.events.length;let F=z,D,T;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(D){T=t.events[F][1].end;break}D=!0}for(N(i),L=z;L<t.events.length;)t.events[L][1].end=R({},T),L++;ia(t.events,F+1,0,t.events.slice(z)),t.events.length=L}}function N(C){let j=n.length;for(;j-- >C;){const A=n[j];t.containerState=A[1],A[0].exit.call(t,e)}n.length=C}function k(){r.write([null]),c=void 0,r=void 0,t.containerState._closeFlow=void 0}}function XR(e,t,n){return dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cl(e){if(e===null||Dt(e)||yr(e))return 1;if(jd(e))return 2}function Ed(e,t,n){const i=[];let r=-1;for(;++r<e.length;){const c=e[r].resolveAll;c&&!i.includes(c)&&(t=c(t,n),i.push(c))}return t}const fp={name:"attention",resolveAll:QR,tokenize:ZR};function QR(e,t){let n=-1,i,r,c,o,u,h,m,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p=R({},e[i][1].end),y=R({},e[n][1].start);Dx(p,-h),Dx(y,h),o={type:h>1?"strongSequence":"emphasisSequence",start:p,end:R({},e[i][1].end)},u={type:h>1?"strongSequence":"emphasisSequence",start:R({},e[n][1].start),end:y},c={type:h>1?"strongText":"emphasisText",start:R({},e[i][1].end),end:R({},e[n][1].start)},r={type:h>1?"strong":"emphasis",start:R({},o.start),end:R({},u.end)},e[i][1].end=R({},o.start),e[n][1].start=R({},u.end),m=[],e[i][1].end.offset-e[i][1].start.offset&&(m=_a(m,[["enter",e[i][1],t],["exit",e[i][1],t]])),m=_a(m,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",c,t]]),m=_a(m,Ed(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),m=_a(m,[["exit",c,t],["enter",u,t],["exit",u,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=_a(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,ia(e,i-1,n-i+3,m),n=i+m.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function ZR(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=Cl(i);let c;return o;function o(h){return c=h,e.enter("attentionSequence"),u(h)}function u(h){if(h===c)return e.consume(h),u;const m=e.exit("attentionSequence"),g=Cl(h),p=!g||g===2&&r||n.includes(h),y=!r||r===2&&g||n.includes(i);return m._open=!!(c===42?p:p&&(r||!y)),m._close=!!(c===42?y:y&&(g||!p)),t(h)}}function Dx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const JR={name:"autolink",tokenize:WR};function WR(e,t,n){let i=0;return r;function r(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(x){return kn(x)?(e.consume(x),o):x===64?n(x):m(x)}function o(x){return x===43||x===45||x===46||bn(x)?(i=1,u(x)):m(x)}function u(x){return x===58?(e.consume(x),i=0,h):(x===43||x===45||x===46||bn(x))&&i++<32?(e.consume(x),u):(i=0,m(x))}function h(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||od(x)?n(x):(e.consume(x),h)}function m(x){return x===64?(e.consume(x),g):PR(x)?(e.consume(x),m):n(x)}function g(x){return bn(x)?p(x):n(x)}function p(x){return x===46?(e.consume(x),i=0,g):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):y(x)}function y(x){if((x===45||bn(x))&&i++<63){const _=x===45?y:p;return e.consume(x),_}return n(x)}}const cc={partial:!0,tokenize:eA};function eA(e,t,n){return i;function i(c){return st(c)?dt(e,r,"linePrefix")(c):r(c)}function r(c){return c===null||qe(c)?t(c):n(c)}}const zS={continuation:{tokenize:nA},exit:aA,name:"blockQuote",tokenize:tA};function tA(e,t,n){const i=this;return r;function r(o){if(o===62){const u=i.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),c}return n(o)}function c(o){return st(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function nA(e,t,n){const i=this;return r;function r(o){return st(o)?dt(e,c,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):c(o)}function c(o){return e.attempt(zS,t,n)(o)}}function aA(e){e.exit("blockQuote")}const IS={name:"characterEscape",tokenize:iA};function iA(e,t,n){return i;function i(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),r}function r(c){return qR(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(c)}}const BS={name:"characterReference",tokenize:sA};function sA(e,t,n){const i=this;let r=0,c,o;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,o=bn,g(p))}function m(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,o=$R,g):(e.enter("characterReferenceValue"),c=7,o=dp,g(p))}function g(p){if(p===59&&r){const y=e.exit("characterReferenceValue");return o===bn&&!gg(i.sliceSerialize(y))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&r++<c?(e.consume(p),g):n(p)}}const Ox={partial:!0,tokenize:lA},zx={concrete:!0,name:"codeFenced",tokenize:rA};function rA(e,t,n){const i=this,r={partial:!0,tokenize:A};let c=0,o=0,u;return h;function h(L){return m(L)}function m(L){const z=i.events[i.events.length-1];return c=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,u=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(L)}function g(L){return L===u?(o++,e.consume(L),g):o<3?n(L):(e.exit("codeFencedFenceSequence"),st(L)?dt(e,p,"whitespace")(L):p(L))}function p(L){return L===null||qe(L)?(e.exit("codeFencedFence"),i.interrupt?t(L):e.check(Ox,S,j)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(L))}function y(L){return L===null||qe(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(L)):st(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),dt(e,x,"whitespace")(L)):L===96&&L===u?n(L):(e.consume(L),y)}function x(L){return L===null||qe(L)?p(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(L))}function _(L){return L===null||qe(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(L)):L===96&&L===u?n(L):(e.consume(L),_)}function S(L){return e.attempt(r,j,w)(L)}function w(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),N}function N(L){return c>0&&st(L)?dt(e,k,"linePrefix",c+1)(L):k(L)}function k(L){return L===null||qe(L)?e.check(Ox,S,j)(L):(e.enter("codeFlowValue"),C(L))}function C(L){return L===null||qe(L)?(e.exit("codeFlowValue"),k(L)):(e.consume(L),C)}function j(L){return e.exit("codeFenced"),t(L)}function A(L,z,F){let D=0;return T;function T(q){return L.enter("lineEnding"),L.consume(q),L.exit("lineEnding"),B}function B(q){return L.enter("codeFencedFence"),st(q)?dt(L,P,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):P(q)}function P(q){return q===u?(L.enter("codeFencedFenceSequence"),K(q)):F(q)}function K(q){return q===u?(D++,L.consume(q),K):D>=o?(L.exit("codeFencedFenceSequence"),st(q)?dt(L,H,"whitespace")(q):H(q)):F(q)}function H(q){return q===null||qe(q)?(L.exit("codeFencedFence"),z(q)):F(q)}}}function lA(e,t,n){const i=this;return r;function r(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),c)}function c(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const vm={name:"codeIndented",tokenize:cA},oA={partial:!0,tokenize:uA};function cA(e,t,n){const i=this;return r;function r(m){return e.enter("codeIndented"),dt(e,c,"linePrefix",5)(m)}function c(m){const g=i.events[i.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?o(m):n(m)}function o(m){return m===null?h(m):qe(m)?e.attempt(oA,o,h)(m):(e.enter("codeFlowValue"),u(m))}function u(m){return m===null||qe(m)?(e.exit("codeFlowValue"),o(m)):(e.consume(m),u)}function h(m){return e.exit("codeIndented"),t(m)}}function uA(e,t,n){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):qe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):dt(e,c,"linePrefix",5)(o)}function c(o){const u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):qe(o)?r(o):n(o)}}const dA={name:"codeText",previous:hA,resolve:fA,tokenize:mA};function fA(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)r===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(r=i):(i===t||e[i][1].type==="lineEnding")&&(e[r][1].type="codeTextData",i!==r+2&&(e[r][1].end=e[i-1][1].end,e.splice(r+2,i-r-2),t-=i-r-2,i=r+2),r=void 0);return e}function hA(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function mA(e,t,n){let i=0,r,c;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),i++,u):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(c=e.enter("codeTextSequence"),r=0,g(p)):qe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(p))}function m(p){return p===null||p===32||p===96||qe(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),m)}function g(p){return p===96?(e.consume(p),r++,g):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(c.type="codeTextData",m(p))}}class pA{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n!=null?n:Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const c=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&Mo(this.left,i),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Mo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Mo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Mo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Mo(this.left,n.reverse())}}}function Mo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function US(e){const t={};let n=-1,i,r,c,o,u,h,m;const g=new pA(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(i=g.get(n),n&&i[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(h=i[1]._tokenizer.events,c=0,c<h.length&&h[c][1].type==="lineEndingBlank"&&(c+=2),c<h.length&&h[c][1].type==="content"))for(;++c<h.length&&h[c][1].type!=="content";)h[c][1].type==="chunkText"&&(h[c][1]._isInFirstContentOfListItem=!0,c++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,gA(g,n)),n=t[n],m=!0);else if(i[1]._container){for(c=n,r=void 0;c--;)if(o=g.get(c),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(r&&(g.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=c);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;r&&(i[1].end=R({},g.get(r)[1].start),u=g.slice(r,n),u.unshift(i),g.splice(r,n-r+1,u))}}return ia(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function gA(e,t){const n=e.get(t)[1],i=e.get(t)[2];let r=t-1;const c=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const u=o.events,h=[],m={};let g,p,y=-1,x=n,_=0,S=0;const w=[S];for(;x;){for(;e.get(++r)[1]!==x;);c.push(r),x._tokenizer||(g=i.sliceStream(x),x.next||g.push(null),p&&o.defineSkip(x.start),x._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(g),x._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=x,x=x.next}for(x=n;++y<u.length;)u[y][0]==="exit"&&u[y-1][0]==="enter"&&u[y][1].type===u[y-1][1].type&&u[y][1].start.line!==u[y][1].end.line&&(S=y+1,w.push(S),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(o.events=[],x?(x._tokenizer=void 0,x.previous=void 0):w.pop(),y=w.length;y--;){const N=u.slice(w[y],w[y+1]),k=c.pop();h.push([k,k+N.length-1]),e.splice(k,2,N)}for(h.reverse(),y=-1;++y<h.length;)m[_+h[y][0]]=_+h[y][1],_+=h[y][1]-h[y][0]-1;return m}const yA={resolve:xA,tokenize:bA},vA={partial:!0,tokenize:_A};function xA(e){return US(e),e}function bA(e,t){let n;return i;function i(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(u)}function r(u){return u===null?c(u):qe(u)?e.check(vA,o,c)(u):(e.consume(u),r)}function c(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function o(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function _A(e,t,n){const i=this;return r;function r(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),dt(e,c,"linePrefix")}function c(o){if(o===null||qe(o))return n(o);const u=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function FS(e,t,n,i,r,c,o,u,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return p;function p(N){return N===60?(e.enter(i),e.enter(r),e.enter(c),e.consume(N),e.exit(c),y):N===null||N===32||N===41||od(N)?n(N):(e.enter(i),e.enter(o),e.enter(u),e.enter("chunkString",{contentType:"string"}),S(N))}function y(N){return N===62?(e.enter(c),e.consume(N),e.exit(c),e.exit(r),e.exit(i),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===62?(e.exit("chunkString"),e.exit(u),y(N)):N===null||N===60||qe(N)?n(N):(e.consume(N),N===92?_:x)}function _(N){return N===60||N===62||N===92?(e.consume(N),x):x(N)}function S(N){return!g&&(N===null||N===41||Dt(N))?(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(i),t(N)):g<m&&N===40?(e.consume(N),g++,S):N===41?(e.consume(N),g--,S):N===null||N===32||N===40||od(N)?n(N):(e.consume(N),N===92?w:S)}function w(N){return N===40||N===41||N===92?(e.consume(N),S):S(N)}}function HS(e,t,n,i,r,c){const o=this;let u=0,h;return m;function m(x){return e.enter(i),e.enter(r),e.consume(x),e.exit(r),e.enter(c),g}function g(x){return u>999||x===null||x===91||x===93&&!h||x===94&&!u&&"_hiddenFootnoteSupport"in o.parser.constructs?n(x):x===93?(e.exit(c),e.enter(r),e.consume(x),e.exit(r),e.exit(i),t):qe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||x===91||x===93||qe(x)||u++>999?(e.exit("chunkString"),g(x)):(e.consume(x),h||(h=!st(x)),x===92?y:p)}function y(x){return x===91||x===92||x===93?(e.consume(x),u++,p):p(x)}}function PS(e,t,n,i,r,c){let o;return u;function u(y){return y===34||y===39||y===40?(e.enter(i),e.enter(r),e.consume(y),e.exit(r),o=y===40?41:y,h):n(y)}function h(y){return y===o?(e.enter(r),e.consume(y),e.exit(r),e.exit(i),t):(e.enter(c),m(y))}function m(y){return y===o?(e.exit(c),h(o)):y===null?n(y):qe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),dt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===o||y===null||qe(y)?(e.exit("chunkString"),m(y)):(e.consume(y),y===92?p:g)}function p(y){return y===o||y===92?(e.consume(y),g):g(y)}}function Po(e,t){let n;return i;function i(r){return qe(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):st(r)?dt(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const SA={name:"definition",tokenize:NA},wA={partial:!0,tokenize:CA};function NA(e,t,n){const i=this;let r;return c;function c(x){return e.enter("definition"),o(x)}function o(x){return HS.call(i,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function u(x){return r=La(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),h):n(x)}function h(x){return Dt(x)?Po(e,m)(x):m(x)}function m(x){return FS(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function g(x){return e.attempt(wA,p,p)(x)}function p(x){return st(x)?dt(e,y,"whitespace")(x):y(x)}function y(x){return x===null||qe(x)?(e.exit("definition"),i.parser.defined.push(r),t(x)):n(x)}}function CA(e,t,n){return i;function i(u){return Dt(u)?Po(e,r)(u):n(u)}function r(u){return PS(e,c,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function c(u){return st(u)?dt(e,o,"whitespace")(u):o(u)}function o(u){return u===null||qe(u)?t(u):n(u)}}const jA={name:"hardBreakEscape",tokenize:EA};function EA(e,t,n){return i;function i(c){return e.enter("hardBreakEscape"),e.consume(c),r}function r(c){return qe(c)?(e.exit("hardBreakEscape"),t(c)):n(c)}}const kA={name:"headingAtx",resolve:MA,tokenize:TA};function MA(e,t){let n=e.length-2,i=3,r,c;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},c={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},ia(e,i,n-i+1,[["enter",r,t],["enter",c,t],["exit",c,t],["exit",r,t]])),e}function TA(e,t,n){let i=0;return r;function r(g){return e.enter("atxHeading"),c(g)}function c(g){return e.enter("atxHeadingSequence"),o(g)}function o(g){return g===35&&i++<6?(e.consume(g),o):g===null||Dt(g)?(e.exit("atxHeadingSequence"),u(g)):n(g)}function u(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||qe(g)?(e.exit("atxHeading"),t(g)):st(g)?dt(e,u,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),u(g))}function m(g){return g===null||g===35||Dt(g)?(e.exit("atxHeadingText"),u(g)):(e.consume(g),m)}}const RA=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ix=["pre","script","style","textarea"],AA={concrete:!0,name:"htmlFlow",resolveTo:OA,tokenize:zA},LA={partial:!0,tokenize:BA},DA={partial:!0,tokenize:IA};function OA(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function zA(e,t,n){const i=this;let r,c,o,u,h;return m;function m(I){return g(I)}function g(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),p}function p(I){return I===33?(e.consume(I),y):I===47?(e.consume(I),c=!0,S):I===63?(e.consume(I),r=3,i.interrupt?t:O):kn(I)?(e.consume(I),o=String.fromCharCode(I),w):n(I)}function y(I){return I===45?(e.consume(I),r=2,x):I===91?(e.consume(I),r=5,u=0,_):kn(I)?(e.consume(I),r=4,i.interrupt?t:O):n(I)}function x(I){return I===45?(e.consume(I),i.interrupt?t:O):n(I)}function _(I){const ie="CDATA[";return I===ie.charCodeAt(u++)?(e.consume(I),u===ie.length?i.interrupt?t:P:_):n(I)}function S(I){return kn(I)?(e.consume(I),o=String.fromCharCode(I),w):n(I)}function w(I){if(I===null||I===47||I===62||Dt(I)){const ie=I===47,ye=o.toLowerCase();return!ie&&!c&&Ix.includes(ye)?(r=1,i.interrupt?t(I):P(I)):RA.includes(o.toLowerCase())?(r=6,ie?(e.consume(I),N):i.interrupt?t(I):P(I)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(I):c?k(I):C(I))}return I===45||bn(I)?(e.consume(I),o+=String.fromCharCode(I),w):n(I)}function N(I){return I===62?(e.consume(I),i.interrupt?t:P):n(I)}function k(I){return st(I)?(e.consume(I),k):T(I)}function C(I){return I===47?(e.consume(I),T):I===58||I===95||kn(I)?(e.consume(I),j):st(I)?(e.consume(I),C):T(I)}function j(I){return I===45||I===46||I===58||I===95||bn(I)?(e.consume(I),j):A(I)}function A(I){return I===61?(e.consume(I),L):st(I)?(e.consume(I),A):C(I)}function L(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),h=I,z):st(I)?(e.consume(I),L):F(I)}function z(I){return I===h?(e.consume(I),h=null,D):I===null||qe(I)?n(I):(e.consume(I),z)}function F(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Dt(I)?A(I):(e.consume(I),F)}function D(I){return I===47||I===62||st(I)?C(I):n(I)}function T(I){return I===62?(e.consume(I),B):n(I)}function B(I){return I===null||qe(I)?P(I):st(I)?(e.consume(I),B):n(I)}function P(I){return I===45&&r===2?(e.consume(I),$):I===60&&r===1?(e.consume(I),Q):I===62&&r===4?(e.consume(I),se):I===63&&r===3?(e.consume(I),O):I===93&&r===5?(e.consume(I),W):qe(I)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(LA,ue,K)(I)):I===null||qe(I)?(e.exit("htmlFlowData"),K(I)):(e.consume(I),P)}function K(I){return e.check(DA,H,ue)(I)}function H(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),q}function q(I){return I===null||qe(I)?K(I):(e.enter("htmlFlowData"),P(I))}function $(I){return I===45?(e.consume(I),O):P(I)}function Q(I){return I===47?(e.consume(I),o="",G):P(I)}function G(I){if(I===62){const ie=o.toLowerCase();return Ix.includes(ie)?(e.consume(I),se):P(I)}return kn(I)&&o.length<8?(e.consume(I),o+=String.fromCharCode(I),G):P(I)}function W(I){return I===93?(e.consume(I),O):P(I)}function O(I){return I===62?(e.consume(I),se):I===45&&r===2?(e.consume(I),O):P(I)}function se(I){return I===null||qe(I)?(e.exit("htmlFlowData"),ue(I)):(e.consume(I),se)}function ue(I){return e.exit("htmlFlow"),t(I)}}function IA(e,t,n){const i=this;return r;function r(o){return qe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),c):n(o)}function c(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function BA(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(cc,t,n)}}const UA={name:"htmlText",tokenize:FA};function FA(e,t,n){const i=this;let r,c,o;return u;function u(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),A):O===63?(e.consume(O),C):kn(O)?(e.consume(O),F):n(O)}function m(O){return O===45?(e.consume(O),g):O===91?(e.consume(O),c=0,_):kn(O)?(e.consume(O),k):n(O)}function g(O){return O===45?(e.consume(O),x):n(O)}function p(O){return O===null?n(O):O===45?(e.consume(O),y):qe(O)?(o=p,Q(O)):(e.consume(O),p)}function y(O){return O===45?(e.consume(O),x):p(O)}function x(O){return O===62?$(O):O===45?y(O):p(O)}function _(O){const se="CDATA[";return O===se.charCodeAt(c++)?(e.consume(O),c===se.length?S:_):n(O)}function S(O){return O===null?n(O):O===93?(e.consume(O),w):qe(O)?(o=S,Q(O)):(e.consume(O),S)}function w(O){return O===93?(e.consume(O),N):S(O)}function N(O){return O===62?$(O):O===93?(e.consume(O),N):S(O)}function k(O){return O===null||O===62?$(O):qe(O)?(o=k,Q(O)):(e.consume(O),k)}function C(O){return O===null?n(O):O===63?(e.consume(O),j):qe(O)?(o=C,Q(O)):(e.consume(O),C)}function j(O){return O===62?$(O):C(O)}function A(O){return kn(O)?(e.consume(O),L):n(O)}function L(O){return O===45||bn(O)?(e.consume(O),L):z(O)}function z(O){return qe(O)?(o=z,Q(O)):st(O)?(e.consume(O),z):$(O)}function F(O){return O===45||bn(O)?(e.consume(O),F):O===47||O===62||Dt(O)?D(O):n(O)}function D(O){return O===47?(e.consume(O),$):O===58||O===95||kn(O)?(e.consume(O),T):qe(O)?(o=D,Q(O)):st(O)?(e.consume(O),D):$(O)}function T(O){return O===45||O===46||O===58||O===95||bn(O)?(e.consume(O),T):B(O)}function B(O){return O===61?(e.consume(O),P):qe(O)?(o=B,Q(O)):st(O)?(e.consume(O),B):D(O)}function P(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),r=O,K):qe(O)?(o=P,Q(O)):st(O)?(e.consume(O),P):(e.consume(O),H)}function K(O){return O===r?(e.consume(O),r=void 0,q):O===null?n(O):qe(O)?(o=K,Q(O)):(e.consume(O),K)}function H(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Dt(O)?D(O):(e.consume(O),H)}function q(O){return O===47||O===62||Dt(O)?D(O):n(O)}function $(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function Q(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),G}function G(O){return st(O)?dt(e,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):W(O)}function W(O){return e.enter("htmlTextData"),o(O)}}const yg={name:"labelEnd",resolveAll:qA,resolveTo:VA,tokenize:GA},HA={tokenize:YA},PA={tokenize:KA},$A={tokenize:XA};function qA(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",t+=r}}return e.length!==n.length&&ia(e,0,e.length,n),e}function VA(e,t){let n=e.length,i=0,r,c,o,u;for(;n--;)if(r=e[n][1],c){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(c=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(o=n);const h={type:e[c][1].type==="labelLink"?"link":"image",start:R({},e[c][1].start),end:R({},e[e.length-1][1].end)},m={type:"label",start:R({},e[c][1].start),end:R({},e[o][1].end)},g={type:"labelText",start:R({},e[c+i+2][1].end),end:R({},e[o-2][1].start)};return u=[["enter",h,t],["enter",m,t]],u=_a(u,e.slice(c+1,c+i+3)),u=_a(u,[["enter",g,t]]),u=_a(u,Ed(t.parser.constructs.insideSpan.null,e.slice(c+i+4,o-3),t)),u=_a(u,[["exit",g,t],e[o-2],e[o-1],["exit",m,t]]),u=_a(u,e.slice(o+1)),u=_a(u,[["exit",h,t]]),ia(e,c,e.length,u),e}function GA(e,t,n){const i=this;let r=i.events.length,c,o;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){c=i.events[r][1];break}return u;function u(y){return c?c._inactive?p(y):(o=i.parser.defined.includes(La(i.sliceSerialize({start:c.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),h):n(y)}function h(y){return y===40?e.attempt(HA,g,o?g:p)(y):y===91?e.attempt(PA,g,o?m:p)(y):o?g(y):p(y)}function m(y){return e.attempt($A,g,p)(y)}function g(y){return t(y)}function p(y){return c._balanced=!0,n(y)}}function YA(e,t,n){return i;function i(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),r}function r(p){return Dt(p)?Po(e,c)(p):c(p)}function c(p){return p===41?g(p):FS(e,o,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return Dt(p)?Po(e,h)(p):g(p)}function u(p){return n(p)}function h(p){return p===34||p===39||p===40?PS(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function m(p){return Dt(p)?Po(e,g)(p):g(p)}function g(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function KA(e,t,n){const i=this;return r;function r(u){return HS.call(i,e,c,o,"reference","referenceMarker","referenceString")(u)}function c(u){return i.parser.defined.includes(La(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function o(u){return n(u)}}function XA(e,t,n){return i;function i(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),r}function r(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),t):n(c)}}const QA={name:"labelStartImage",resolveAll:yg.resolveAll,tokenize:ZA};function ZA(e,t,n){const i=this;return r;function r(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),c}function c(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):t(u)}}const JA={name:"labelStartLink",resolveAll:yg.resolveAll,tokenize:WA};function WA(e,t,n){const i=this;return r;function r(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),c}function c(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const xm={name:"lineEnding",tokenize:eL};function eL(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),dt(e,t,"linePrefix")}}const Xu={name:"thematicBreak",tokenize:tL};function tL(e,t,n){let i=0,r;return c;function c(m){return e.enter("thematicBreak"),o(m)}function o(m){return r=m,u(m)}function u(m){return m===r?(e.enter("thematicBreakSequence"),h(m)):i>=3&&(m===null||qe(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===r?(e.consume(m),i++,h):(e.exit("thematicBreakSequence"),st(m)?dt(e,u,"whitespace")(m):u(m))}}const zn={continuation:{tokenize:sL},exit:lL,name:"list",tokenize:iL},nL={partial:!0,tokenize:oL},aL={partial:!0,tokenize:rL};function iL(e,t,n){const i=this,r=i.events[i.events.length-1];let c=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return u;function u(x){const _=i.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!i.containerState.marker||x===i.containerState.marker:dp(x)){if(i.containerState.type||(i.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Xu,n,m)(x):m(x);if(!i.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(x)}return n(x)}function h(x){return dp(x)&&++o<10?(e.consume(x),h):(!i.interrupt||o<2)&&(i.containerState.marker?x===i.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),m(x)):n(x)}function m(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||x,e.check(cc,i.interrupt?n:g,e.attempt(nL,y,p))}function g(x){return i.containerState.initialBlankLine=!0,c++,y(x)}function p(x){return st(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),y):n(x)}function y(x){return i.containerState.size=c+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function sL(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(cc,r,c);function r(u){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,dt(e,t,"listItemIndent",i.containerState.size+1)(u)}function c(u){return i.containerState.furtherBlankLines||!st(u)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(u)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(aL,t,o)(u))}function o(u){return i.containerState._closeFlow=!0,i.interrupt=void 0,dt(e,e.attempt(zn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function rL(e,t,n){const i=this;return dt(e,r,"listItemIndent",i.containerState.size+1);function r(c){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(c):n(c)}}function lL(e){e.exit(this.containerState.type)}function oL(e,t,n){const i=this;return dt(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(c){const o=i.events[i.events.length-1];return!st(c)&&o&&o[1].type==="listItemPrefixWhitespace"?t(c):n(c)}}const Bx={name:"setextUnderline",resolveTo:cL,tokenize:uL};function cL(e,t){let n=e.length,i,r,c;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!c&&e[n][1].type==="definition"&&(c=n);const o={type:"setextHeading",start:R({},e[i][1].start),end:R({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",c?(e.splice(r,0,["enter",o,t]),e.splice(c+1,0,["exit",e[i][1],t]),e[i][1].end=R({},e[c][1].end)):e[i][1]=o,e.push(["exit",o,t]),e}function uL(e,t,n){const i=this;let r;return c;function c(m){let g=i.events.length,p;for(;g--;)if(i.events[g][1].type!=="lineEnding"&&i.events[g][1].type!=="linePrefix"&&i.events[g][1].type!=="content"){p=i.events[g][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||p)?(e.enter("setextHeadingLine"),r=m,o(m)):n(m)}function o(m){return e.enter("setextHeadingLineSequence"),u(m)}function u(m){return m===r?(e.consume(m),u):(e.exit("setextHeadingLineSequence"),st(m)?dt(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||qe(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const dL={tokenize:fL};function fL(e){const t=this,n=e.attempt(cc,i,e.attempt(this.parser.constructs.flowInitial,r,dt(e,e.attempt(this.parser.constructs.flow,r,e.attempt(yA,r)),"linePrefix")));return n;function i(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const hL={resolveAll:qS()},mL=$S("string"),pL=$S("text");function $S(e){return{resolveAll:qS(e==="text"?gL:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],c=n.attempt(r,o,u);return o;function o(g){return m(g)?c(g):u(g)}function u(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),h}function h(g){return m(g)?(n.exit("data"),c(g)):(n.consume(g),h)}function m(g){if(g===null)return!0;const p=r[g];let y=-1;if(p)for(;++y<p.length;){const x=p[y];if(!x.previous||x.previous.call(i,i.previous))return!0}return!1}}}function qS(e){return t;function t(n,i){let r=-1,c;for(;++r<=n.length;)c===void 0?n[r]&&n[r][1].type==="data"&&(c=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==c+2&&(n[c][1].end=n[r-1][1].end,n.splice(c+2,r-c-2),r=c+2),c=void 0);return e?e(n,i):n}}function gL(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],r=t.sliceStream(i);let c=r.length,o=-1,u=0,h;for(;c--;){const m=r[c];if(typeof m=="string"){for(o=m.length;m.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(m===-2)h=!0,u++;else if(m!==-1){c++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const m={type:n===e.length||h||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?o:i.start._bufferIndex+o,_index:i.start._index+c,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:R({},i.end)};i.end=R({},m.start),i.start.offset===i.end.offset?Object.assign(i,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const yL={42:zn,43:zn,45:zn,48:zn,49:zn,50:zn,51:zn,52:zn,53:zn,54:zn,55:zn,56:zn,57:zn,62:zS},vL={91:SA},xL={[-2]:vm,[-1]:vm,32:vm},bL={35:kA,42:Xu,45:[Bx,Xu],60:AA,61:Bx,95:Xu,96:zx,126:zx},_L={38:BS,92:IS},SL={[-5]:xm,[-4]:xm,[-3]:xm,33:QA,38:BS,42:fp,60:[JR,UA],91:JA,92:[jA,IS],93:yg,95:fp,96:dA},wL={null:[fp,hL]},NL={null:[42,95]},CL={null:[]},jL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:NL,contentInitial:vL,disable:CL,document:yL,flow:bL,flowInitial:xL,insideSpan:wL,string:_L,text:SL},Symbol.toStringTag,{value:"Module"}));function EL(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},c=[];let o=[],u=[];const h={attempt:z(A),check:z(L),consume:k,enter:C,exit:j,interrupt:z(L,{interrupt:!0})},m={code:null,containerState:{},defineSkip:S,events:[],now:_,parser:e,previous:null,sliceSerialize:y,sliceStream:x,write:p};let g=t.tokenize.call(m,h);return t.resolveAll&&c.push(t),m;function p(B){return o=_a(o,B),w(),o[o.length-1]!==null?[]:(F(t,0),m.events=Ed(c,m.events,m),m.events)}function y(B,P){return ML(x(B),P)}function x(B){return kL(o,B)}function _(){const{_bufferIndex:B,_index:P,line:K,column:H,offset:q}=i;return{_bufferIndex:B,_index:P,line:K,column:H,offset:q}}function S(B){r[B.line]=B.column,T()}function w(){let B;for(;i._index<o.length;){const P=o[i._index];if(typeof P=="string")for(B=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===B&&i._bufferIndex<P.length;)N(P.charCodeAt(i._bufferIndex));else N(P)}}function N(B){g=g(B)}function k(B){qe(B)?(i.line++,i.column=1,i.offset+=B===-3?2:1,T()):B!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),m.previous=B}function C(B,P){const K=P||{};return K.type=B,K.start=_(),m.events.push(["enter",K,m]),u.push(K),K}function j(B){const P=u.pop();return P.end=_(),m.events.push(["exit",P,m]),P}function A(B,P){F(B,P.from)}function L(B,P){P.restore()}function z(B,P){return K;function K(H,q,$){let Q,G,W,O;return Array.isArray(H)?ue(H):"tokenize"in H?ue([H]):se(H);function se(xe){return Ce;function Ce(Se){const Pe=Se!==null&&xe[Se],vt=Se!==null&&xe.null,mt=[...Array.isArray(Pe)?Pe:Pe?[Pe]:[],...Array.isArray(vt)?vt:vt?[vt]:[]];return ue(mt)(Se)}}function ue(xe){return Q=xe,G=0,xe.length===0?$:I(xe[G])}function I(xe){return Ce;function Ce(Se){return O=D(),W=xe,xe.partial||(m.currentConstruct=xe),xe.name&&m.parser.constructs.disable.null.includes(xe.name)?ye():xe.tokenize.call(P?Object.assign(Object.create(m),P):m,h,ie,ye)(Se)}}function ie(xe){return B(W,O),q}function ye(xe){return O.restore(),++G<Q.length?I(Q[G]):$}}}function F(B,P){B.resolveAll&&!c.includes(B)&&c.push(B),B.resolve&&ia(m.events,P,m.events.length-P,B.resolve(m.events.slice(P),m)),B.resolveTo&&(m.events=B.resolveTo(m.events,m))}function D(){const B=_(),P=m.previous,K=m.currentConstruct,H=m.events.length,q=Array.from(u);return{from:H,restore:$};function $(){i=B,m.previous=P,m.currentConstruct=K,m.events.length=H,u=q,T()}}function T(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function kL(e,t){const n=t.start._index,i=t.start._bufferIndex,r=t.end._index,c=t.end._bufferIndex;let o;if(n===r)o=[e[n].slice(i,c)];else{if(o=e.slice(n,r),i>-1){const u=o[0];typeof u=="string"?o[0]=u.slice(i):o.shift()}c>0&&o.push(e[r].slice(0,c))}return o}function ML(e,t){let n=-1;const i=[];let r;for(;++n<e.length;){const c=e[n];let o;if(typeof c=="string")o=c;else switch(c){case-5:{o="\r";break}case-4:{o=`
51
- `;break}case-3:{o=`\r
52
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&r)continue;o=" ";break}default:o=String.fromCharCode(c)}r=c===-2,i.push(o)}return i.join("")}function TL(e){const t={constructs:DS([jL,...(e||{}).extensions||[]]),content:n(VR),defined:[],document:n(YR),flow:n(dL),lazy:{},string:n(mL),text:n(pL)};return t;function n(i){return r;function r(c){return EL(t,i,c)}}}function RL(e){for(;!US(e););return e}const Ux=/[\0\t\n\r]/g;function AL(){let e=1,t="",n=!0,i;return r;function r(c,o,u){const h=[];let m,g,p,y,x;for(c=t+(typeof c=="string"?c.toString():new TextDecoder(o||void 0).decode(c)),p=0,t="",n&&(c.charCodeAt(0)===65279&&p++,n=void 0);p<c.length;){if(Ux.lastIndex=p,m=Ux.exec(c),y=m&&m.index!==void 0?m.index:c.length,x=c.charCodeAt(y),!m){t=c.slice(p);break}if(x===10&&p===y&&i)h.push(-3),i=void 0;else switch(i&&(h.push(-5),i=void 0),p<y&&(h.push(c.slice(p,y)),e+=y-p),x){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:i=!0,e=1}p=y+1}return u&&(i&&h.push(-5),t&&h.push(t),h.push(null)),h}}const LL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DL(e){return e.replace(LL,OL)}function OL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),r=i===120||i===88;return OS(n.slice(r?2:1),r?16:10)}return gg(n)||e}const VS={}.hasOwnProperty;function zL(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),IL(n)(RL(TL(n).document().write(AL()(e,t,!0))))}function IL(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(Me),autolinkProtocol:D,autolinkEmail:D,atxHeading:c(Ue),blockQuote:c(vt),characterEscape:D,characterReference:D,codeFenced:c(mt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:c(mt,o),codeText:c(Ut,o),codeTextData:D,data:D,codeFlowValue:D,definition:c(rt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:c($e),hardBreakEscape:c(xt),hardBreakTrailing:c(xt),htmlFlow:c(ke,o),htmlFlowData:D,htmlText:c(ke,o),htmlTextData:D,image:c(ft),label:o,link:c(Me),listItem:c(yn),listItemValue:y,listOrdered:c($n,p),listUnordered:c($n),paragraph:c(wn),reference:I,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:c(Ue),strong:c(Ca),thematicBreak:c(za)},exit:{atxHeading:h(),atxHeadingSequence:A,autolink:h(),autolinkEmail:Pe,autolinkProtocol:Se,blockQuote:h(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:xe,characterReference:Ce,codeFenced:h(w),codeFencedFence:S,codeFencedFenceInfo:x,codeFencedFenceMeta:_,codeFlowValue:T,codeIndented:h(N),codeText:h(q),codeTextData:T,data:T,definition:h(),definitionDestinationString:j,definitionLabelString:k,definitionTitleString:C,emphasis:h(),hardBreakEscape:h(P),hardBreakTrailing:h(P),htmlFlow:h(K),htmlFlowData:T,htmlText:h(H),htmlTextData:T,image:h(Q),label:W,labelText:G,lineEnding:B,link:h($),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ie,resourceDestinationString:O,resourceTitleString:se,resource:ue,setextHeading:h(F),setextHeadingLineSequence:z,setextHeadingText:L,strong:h(),thematicBreak:h()}};GS(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(ce){let de={type:"root",children:[]};const Oe={stack:[de],tokenStack:[],config:t,enter:u,exit:m,buffer:o,resume:g,data:n},nt=[];let Te=-1;for(;++Te<ce.length;)if(ce[Te][1].type==="listOrdered"||ce[Te][1].type==="listUnordered")if(ce[Te][0]==="enter")nt.push(Te);else{const _t=nt.pop();Te=r(ce,_t,Te)}for(Te=-1;++Te<ce.length;){const _t=t[ce[Te][0]];VS.call(_t,ce[Te][1].type)&&_t[ce[Te][1].type].call(Object.assign({sliceSerialize:ce[Te][2].sliceSerialize},Oe),ce[Te][1])}if(Oe.tokenStack.length>0){const _t=Oe.tokenStack[Oe.tokenStack.length-1];(_t[1]||Fx).call(Oe,void 0,_t[0])}for(de.position={start:ss(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:ss(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Te=-1;++Te<t.transforms.length;)de=t.transforms[Te](de)||de;return de}function r(ce,de,Oe){let nt=de-1,Te=-1,_t=!1,Et,Ie,pt,Xe;for(;++nt<=Oe;){const Je=ce[nt];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?Te++:Te--,Xe=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(Et&&!Xe&&!Te&&!pt&&(pt=nt),Xe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Xe=void 0}if(!Te&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||Te===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(Et){let Nn=nt;for(Ie=void 0;Nn--;){const ln=ce[Nn];if(ln[1].type==="lineEnding"||ln[1].type==="lineEndingBlank"){if(ln[0]==="exit")continue;Ie&&(ce[Ie][1].type="lineEndingBlank",_t=!0),ln[1].type="lineEnding",Ie=Nn}else if(!(ln[1].type==="linePrefix"||ln[1].type==="blockQuotePrefix"||ln[1].type==="blockQuotePrefixWhitespace"||ln[1].type==="blockQuoteMarker"||ln[1].type==="listItemIndent"))break}pt&&(!Ie||pt<Ie)&&(Et._spread=!0),Et.end=Object.assign({},Ie?ce[Ie][1].start:Je[1].end),ce.splice(Ie||nt,0,["exit",Et,Je[2]]),nt++,Oe++}if(Je[1].type==="listItemPrefix"){const Nn={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};Et=Nn,ce.splice(nt,0,["enter",Nn,Je[2]]),nt++,Oe++,pt=void 0,Xe=!0}}}return ce[de][1]._spread=_t,Oe}function c(ce,de){return Oe;function Oe(nt){u.call(this,ce(nt),nt),de&&de.call(this,nt)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(ce,de,Oe){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([de,Oe||void 0]),ce.position={start:ss(de.start),end:void 0}}function h(ce){return de;function de(Oe){ce&&ce.call(this,Oe),m.call(this,Oe)}}function m(ce,de){const Oe=this.stack.pop(),nt=this.tokenStack.pop();if(nt)nt[0].type!==ce.type&&(de?de.call(this,ce,nt[0]):(nt[1]||Fx).call(this,ce,nt[0]));else throw new Error("Cannot close `"+ce.type+"` ("+Ho({start:ce.start,end:ce.end})+"): it’s not open");Oe.position.end=ss(ce.end)}function g(){return pg(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function y(ce){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ce=this.resume(),de=this.stack[this.stack.length-1];de.lang=ce}function _(){const ce=this.resume(),de=this.stack[this.stack.length-1];de.meta=ce}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const ce=this.resume(),de=this.stack[this.stack.length-1];de.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ce=this.resume(),de=this.stack[this.stack.length-1];de.value=ce.replace(/(\r?\n|\r)$/g,"")}function k(ce){const de=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=de,Oe.identifier=La(this.sliceSerialize(ce)).toLowerCase()}function C(){const ce=this.resume(),de=this.stack[this.stack.length-1];de.title=ce}function j(){const ce=this.resume(),de=this.stack[this.stack.length-1];de.url=ce}function A(ce){const de=this.stack[this.stack.length-1];if(!de.depth){const Oe=this.sliceSerialize(ce).length;de.depth=Oe}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function z(ce){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function D(ce){const de=this.stack[this.stack.length-1].children;let Oe=de[de.length-1];(!Oe||Oe.type!=="text")&&(Oe=Rt(),Oe.position={start:ss(ce.start),end:void 0},de.push(Oe)),this.stack.push(Oe)}function T(ce){const de=this.stack.pop();de.value+=this.sliceSerialize(ce),de.position.end=ss(ce.end)}function B(ce){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=de.children[de.children.length-1];Oe.position.end=ss(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(D.call(this,ce),T.call(this,ce))}function P(){this.data.atHardBreak=!0}function K(){const ce=this.resume(),de=this.stack[this.stack.length-1];de.value=ce}function H(){const ce=this.resume(),de=this.stack[this.stack.length-1];de.value=ce}function q(){const ce=this.resume(),de=this.stack[this.stack.length-1];de.value=ce}function $(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=de,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function Q(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=de,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function G(ce){const de=this.sliceSerialize(ce),Oe=this.stack[this.stack.length-2];Oe.label=DL(de),Oe.identifier=La(de).toLowerCase()}function W(){const ce=this.stack[this.stack.length-1],de=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const nt=ce.children;Oe.children=nt}else Oe.alt=de}function O(){const ce=this.resume(),de=this.stack[this.stack.length-1];de.url=ce}function se(){const ce=this.resume(),de=this.stack[this.stack.length-1];de.title=ce}function ue(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ie(ce){const de=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=de,Oe.identifier=La(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function ye(ce){this.data.characterReferenceType=ce.type}function xe(ce){const de=this.sliceSerialize(ce),Oe=this.data.characterReferenceType;let nt;Oe?(nt=OS(de,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):nt=gg(de);const Te=this.stack[this.stack.length-1];Te.value+=nt}function Ce(ce){const de=this.stack.pop();de.position.end=ss(ce.end)}function Se(ce){T.call(this,ce);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ce)}function Pe(ce){T.call(this,ce);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ce)}function vt(){return{type:"blockquote",children:[]}}function mt(){return{type:"code",lang:null,meta:null,value:""}}function Ut(){return{type:"inlineCode",value:""}}function rt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $e(){return{type:"emphasis",children:[]}}function Ue(){return{type:"heading",depth:0,children:[]}}function xt(){return{type:"break"}}function ke(){return{type:"html",value:""}}function ft(){return{type:"image",title:null,url:"",alt:null}}function Me(){return{type:"link",title:null,url:"",children:[]}}function $n(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function yn(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function wn(){return{type:"paragraph",children:[]}}function Ca(){return{type:"strong",children:[]}}function Rt(){return{type:"text",value:""}}function za(){return{type:"thematicBreak"}}}function ss(e){return{line:e.line,column:e.column,offset:e.offset}}function GS(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?GS(e,i):BL(e,i)}}function BL(e,t){let n;for(n in t)if(VS.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function Fx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ho({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ho({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ho({start:t.start,end:t.end})+") is still open")}function UL(e){const t=this;t.parser=n;function n(i){return zL(i,V(R(R({},t.data("settings")),e),{extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]}))}}function FL(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function HL(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
53
- `}]}function PL(e,t){const n=t.value?t.value+`
54
- `:"",i={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let c={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(c.data={meta:t.meta}),e.patch(t,c),c=e.applyData(t,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(t,c),c}function $L(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qL(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=Rl(i.toLowerCase()),c=e.footnoteOrder.indexOf(i);let o,u=e.footnoteCounts.get(i);u===void 0?(u=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=c+1,u+=1,e.footnoteCounts.set(i,u);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function GL(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function YS(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),c=r[0];c&&c.type==="text"?c.value="["+c.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function KL(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return YS(e,t);const r={src:Rl(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const c={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,c),e.applyData(t,c)}function XL(e,t){const n={src:Rl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function QL(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function ZL(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return YS(e,t);const r={href:Rl(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const c={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,c),e.applyData(t,c)}function JL(e,t){const n={href:Rl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function WL(e,t,n){const i=e.all(t),r=n?eD(n):KS(t),c={},o=[];if(typeof t.checked=="boolean"){const g=i[0];let p;g&&g.type==="element"&&g.tagName==="p"?p=g:(p={type:"element",tagName:"p",properties:{},children:[]},i.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let u=-1;for(;++u<i.length;){const g=i[u];(r||u!==0||g.type!=="element"||g.tagName!=="p")&&o.push({type:"text",value:`
55
- `}),g.type==="element"&&g.tagName==="p"&&!r?o.push(...g.children):o.push(g)}const h=i[i.length-1];h&&(r||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
56
- `});const m={type:"element",tagName:"li",properties:c,children:o};return e.patch(t,m),e.applyData(t,m)}function eD(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=KS(n[i])}return t}function KS(e){const t=e.spread;return t!=null?t:e.children.length>1}function tD(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r<i.length;){const o=i[r];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const c={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,c),e.applyData(t,c)}function nD(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aD(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function iD(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sD(e,t){const n=e.all(t),i=n.shift(),r=[];if(i){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],o),r.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=dg(t.children[1]),h=ES(t.children[t.children.length-1]);u&&h&&(o.position={start:u,end:h}),r.push(o)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,c),e.applyData(t,c)}function rD(e,t,n){const i=n?n.children:void 0,r=(i?i.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,o=c?c.length:t.children.length;let u=-1;const h=[];for(;++u<o;){const g=t.children[u],p={},y=c?c[u]:void 0;y&&(p.align=y);let x={type:"element",tagName:r,properties:p,children:[]};g&&(x.children=e.all(g),e.patch(g,x),x=e.applyData(g,x)),h.push(x)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function lD(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Hx=9,Px=32;function oD(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),r=0;const c=[];for(;i;)c.push($x(t.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return c.push($x(t.slice(r),r>0,!1)),c.join("")}function $x(e,t,n){let i=0,r=e.length;if(t){let c=e.codePointAt(i);for(;c===Hx||c===Px;)i++,c=e.codePointAt(i)}if(n){let c=e.codePointAt(r-1);for(;c===Hx||c===Px;)r--,c=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function cD(e,t){const n={type:"text",value:oD(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function uD(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const dD={blockquote:FL,break:HL,code:PL,delete:$L,emphasis:qL,footnoteReference:VL,heading:GL,html:YL,imageReference:KL,image:XL,inlineCode:QL,linkReference:ZL,link:JL,listItem:WL,list:tD,paragraph:nD,root:aD,strong:iD,table:sD,tableCell:lD,tableRow:rD,text:cD,thematicBreak:uD,toml:Au,yaml:Au,definition:Au,footnoteDefinition:Au};function Au(){}const XS=-1,kd=0,$o=1,cd=2,vg=3,xg=4,bg=5,_g=6,QS=7,ZS=8,fD=typeof self=="object"?self:globalThis,qx=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new fD[e](t)},hD=(e,t)=>{const n=(r,c)=>(e.set(c,r),r),i=r=>{if(e.has(r))return e.get(r);const[c,o]=t[r];switch(c){case kd:case XS:return n(o,r);case $o:{const u=n([],r);for(const h of o)u.push(i(h));return u}case cd:{const u=n({},r);for(const[h,m]of o)u[i(h)]=i(m);return u}case vg:return n(new Date(o),r);case xg:{const{source:u,flags:h}=o;return n(new RegExp(u,h),r)}case bg:{const u=n(new Map,r);for(const[h,m]of o)u.set(i(h),i(m));return u}case _g:{const u=n(new Set,r);for(const h of o)u.add(i(h));return u}case QS:{const{name:u,message:h}=o;return n(qx(u,h),r)}case ZS:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:u}=new Uint8Array(o);return n(new DataView(u),o)}}return n(qx(c,o),r)};return i},Vx=e=>hD(new Map,e)(0),al="",{toString:mD}={},{keys:pD}=Object,To=e=>{const t=typeof e;if(t!=="object"||!e)return[kd,t];const n=mD.call(e).slice(8,-1);switch(n){case"Array":return[$o,al];case"Object":return[cd,al];case"Date":return[vg,al];case"RegExp":return[xg,al];case"Map":return[bg,al];case"Set":return[_g,al];case"DataView":return[$o,n]}return n.includes("Array")?[$o,n]:n.includes("Error")?[QS,n]:[cd,n]},Lu=([e,t])=>e===kd&&(t==="function"||t==="symbol"),gD=(e,t,n,i)=>{const r=(o,u)=>{const h=i.push(o)-1;return n.set(u,h),h},c=o=>{if(n.has(o))return n.get(o);let[u,h]=To(o);switch(u){case kd:{let g=o;switch(h){case"bigint":u=ZS,g=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return r([XS],o)}return r([u,g],o)}case $o:{if(h){let y=o;return h==="DataView"?y=new Uint8Array(o.buffer):h==="ArrayBuffer"&&(y=new Uint8Array(o)),r([h,[...y]],o)}const g=[],p=r([u,g],o);for(const y of o)g.push(c(y));return p}case cd:{if(h)switch(h){case"BigInt":return r([h,o.toString()],o);case"Boolean":case"Number":case"String":return r([h,o.valueOf()],o)}if(t&&"toJSON"in o)return c(o.toJSON());const g=[],p=r([u,g],o);for(const y of pD(o))(e||!Lu(To(o[y])))&&g.push([c(y),c(o[y])]);return p}case vg:return r([u,o.toISOString()],o);case xg:{const{source:g,flags:p}=o;return r([u,{source:g,flags:p}],o)}case bg:{const g=[],p=r([u,g],o);for(const[y,x]of o)(e||!(Lu(To(y))||Lu(To(x))))&&g.push([c(y),c(x)]);return p}case _g:{const g=[],p=r([u,g],o);for(const y of o)(e||!Lu(To(y)))&&g.push(c(y));return p}}const{message:m}=o;return r([u,{name:h,message:m}],o)};return c},Gx=(e,{json:t,lossy:n}={})=>{const i=[];return gD(!(t||n),!!t,new Map,i)(e),i},ud=typeof structuredClone=="function"?((e,t)=>t&&("json"in t||"lossy"in t)?Vx(Gx(e,t)):structuredClone(e)):(e,t)=>Vx(Gx(e,t));function yD(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function vD(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function xD(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||yD,i=e.options.footnoteBackLabel||vD,r=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const g=e.all(m),p=String(m.identifier).toUpperCase(),y=Rl(p.toLowerCase());let x=0;const _=[],S=e.footnoteCounts.get(p);for(;S!==void 0&&++x<=S;){_.length>0&&_.push({type:"text",value:" "});let k=typeof n=="string"?n:n(h,x);typeof k=="string"&&(k={type:"text",value:k}),_.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(h,x),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const w=g[g.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const k=w.children[w.children.length-1];k&&k.type==="text"?k.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(..._)}else g.push(..._);const N={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(g,!0)};e.patch(m,N),u.push(N)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:V(R({},ud(o)),{id:"footnote-label"}),children:[{type:"text",value:r}]},{type:"text",value:`
57
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
58
- `}]}}const Md=(function(e){if(e==null)return wD;if(typeof e=="function")return Td(e);if(typeof e=="object")return Array.isArray(e)?bD(e):_D(e);if(typeof e=="string")return SD(e);throw new Error("Expected function, string, or object as test")});function bD(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Md(e[n]);return Td(i);function i(...r){let c=-1;for(;++c<t.length;)if(t[c].apply(this,r))return!0;return!1}}function _D(e){const t=e;return Td(n);function n(i){const r=i;let c;for(c in e)if(r[c]!==t[c])return!1;return!0}}function SD(e){return Td(t);function t(n){return n&&n.type===e}}function Td(e){return t;function t(n,i,r){return!!(ND(n)&&e.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function wD(){return!0}function ND(e){return e!==null&&typeof e=="object"&&"type"in e}const JS=[],CD=!0,hp=!1,jD="skip";function WS(e,t,n,i){let r;typeof t=="function"&&typeof n!="function"?(i=n,n=t):r=t;const c=Md(r),o=i?-1:1;u(e,void 0,[])();function u(h,m,g){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const x=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(h.type+(x?"<"+x+">":""))+")"})}return y;function y(){let x=JS,_,S,w;if((!t||c(h,m,g[g.length-1]||void 0))&&(x=ED(n(h,g)),x[0]===hp))return x;if("children"in h&&h.children){const N=h;if(N.children&&x[0]!==jD)for(S=(i?N.children.length:-1)+o,w=g.concat(N);S>-1&&S<N.children.length;){const k=N.children[S];if(_=u(k,S,w)(),_[0]===hp)return _;S=typeof _[1]=="number"?_[1]:S+o}}return x}}}function ED(e){return Array.isArray(e)?e:typeof e=="number"?[CD,e]:e==null?JS:[e]}function Sg(e,t,n,i){let r,c,o;typeof t=="function"&&typeof n!="function"?(c=void 0,o=t,r=n):(c=t,o=n,r=i),WS(e,c,u,r);function u(h,m){const g=m[m.length-1],p=g?g.children.indexOf(h):void 0;return o(h,p,g)}}const mp={}.hasOwnProperty,kD={};function MD(e,t){const n=t||kD,i=new Map,r=new Map,c=new Map,o=R(R({},dD),n.handlers),u={all:m,applyData:RD,definitionById:i,footnoteById:r,footnoteCounts:c,footnoteOrder:[],handlers:o,one:h,options:n,patch:TD,wrap:LD};return Sg(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?i:r,y=String(g.identifier).toUpperCase();p.has(y)||p.set(y,g)}}),u;function h(g,p){const y=g.type,x=u.handlers[y];if(mp.call(u.handlers,y)&&x)return x(u,g,p);if(u.options.passThrough&&u.options.passThrough.includes(y)){if("children"in g){const _=g,{children:S}=_,w=pe(_,["children"]),N=ud(w);return N.children=u.all(g),N}return ud(g)}return(u.options.unknownHandler||AD)(u,g,p)}function m(g){const p=[];if("children"in g){const y=g.children;let x=-1;for(;++x<y.length;){const _=u.one(y[x],g);if(_){if(x&&y[x-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=Yx(_.value)),!Array.isArray(_)&&_.type==="element")){const S=_.children[0];S&&S.type==="text"&&(S.value=Yx(S.value))}Array.isArray(_)?p.push(..._):p.push(_)}}}return p}}function TD(e,t){e.position&&(t.position=yR(e))}function RD(e,t){let n=t;if(e&&e.data){const i=e.data.hName,r=e.data.hChildren,c=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const o="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:o}}n.type==="element"&&c&&Object.assign(n.properties,ud(c)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function AD(e,t){const n=t.data||{},i="value"in t&&!(mp.call(n,"hProperties")||mp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function LD(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
59
- `});++i<e.length;)i&&n.push({type:"text",value:`
60
- `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
61
- `}),n}function Yx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Kx(e,t){const n=MD(e,t),i=n.one(e,void 0),r=xD(n),c=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&c.children.push({type:"text",value:`
62
- `},r),c}function DD(e,t){return e&&"run"in e?function(n,i){return Ge(this,null,function*(){const r=Kx(n,R({file:i},t));yield e.run(r,i)})}:function(n,i){return Kx(n,R({file:i},e||t))}}function Xx(e){if(e)throw e}var Qu=Object.prototype.hasOwnProperty,ew=Object.prototype.toString,Qx=Object.defineProperty,Zx=Object.getOwnPropertyDescriptor,Jx=function(e){return typeof Array.isArray=="function"?Array.isArray(e):ew.call(e)==="[object Array]"},Wx=function(e){if(!e||ew.call(e)!=="[object Object]")return!1;var t=Qu.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&Qu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!t&&!n)return!1;var i;for(i in e);return typeof i>"u"||Qu.call(e,i)},eb=function(e,t){Qx&&t.name==="__proto__"?Qx(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},tb=function(e,t){if(t==="__proto__")if(Qu.call(e,t)){if(Zx)return Zx(e,t).value}else return;return e[t]},OD=function e(){var t,n,i,r,c,o,u=arguments[0],h=1,m=arguments.length,g=!1;for(typeof u=="boolean"&&(g=u,u=arguments[1]||{},h=2),(u==null||typeof u!="object"&&typeof u!="function")&&(u={});h<m;++h)if(t=arguments[h],t!=null)for(n in t)i=tb(u,n),r=tb(t,n),u!==r&&(g&&r&&(Wx(r)||(c=Jx(r)))?(c?(c=!1,o=i&&Jx(i)?i:[]):o=i&&Wx(i)?i:{},eb(u,{name:n,newValue:e(g,o,r)})):typeof r<"u"&&eb(u,{name:n,newValue:r}));return u};const bm=jS(OD);function pp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function zD(){const e=[],t={run:n,use:i};return t;function n(...r){let c=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);u(null,...r);function u(h,...m){const g=e[++c];let p=-1;if(h){o(h);return}for(;++p<r.length;)(m[p]===null||m[p]===void 0)&&(m[p]=r[p]);r=m,g?ID(g,u)(...m):o(null,...m)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function ID(e,t){let n;return i;function i(...o){const u=e.length>o.length;let h;u&&o.push(r);try{h=e.apply(this,o)}catch(m){const g=m;if(u&&n)throw g;return r(g)}u||(h&&h.then&&typeof h.then=="function"?h.then(c,r):h instanceof Error?r(h):c(h))}function r(o,...u){n||(n=!0,t(o,...u))}function c(o){r(null,o)}}const Ga={basename:BD,dirname:UD,extname:FD,join:HD,sep:"/"};function BD(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');uc(e);let n=0,i=-1,r=e.length,c;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(c){n=r+1;break}}else i<0&&(c=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,u=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(c){n=r+1;break}}else o<0&&(c=!0,o=r+1),u>-1&&(e.codePointAt(r)===t.codePointAt(u--)?u<0&&(i=r):(u=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function UD(e){if(uc(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function FD(e){uc(e);let t=e.length,n=-1,i=0,r=-1,c=0,o;for(;t--;){const u=e.codePointAt(t);if(u===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),u===46?r<0?r=t:c!==1&&(c=1):r>-1&&(c=-1)}return r<0||n<0||c===0||c===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function HD(...e){let t=-1,n;for(;++t<e.length;)uc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":PD(n)}function PD(e){uc(e);const t=e.codePointAt(0)===47;let n=$D(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function $D(e,t){let n="",i=0,r=-1,c=0,o=-1,u,h;for(;++o<=e.length;){if(o<e.length)u=e.codePointAt(o);else{if(u===47)break;u=47}if(u===47){if(!(r===o-1||c===1))if(r!==o-1&&c===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",i=0):(n=n.slice(0,h),i=n.length-1-n.lastIndexOf("/")),r=o,c=0;continue}}else if(n.length>0){n="",i=0,r=o,c=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),i=o-r-1;r=o,c=0}else u===46&&c>-1?c++:c=-1}return n}function uc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const qD={cwd:VD};function VD(){return"/"}function gp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function GD(e){if(typeof e=="string")e=new URL(e);else if(!gp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return YD(e)}function YD(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}const _m=["history","path","basename","stem","extname","dirname"];class tw{constructor(t){let n;t?gp(t)?n={path:t}:typeof t=="string"||KD(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":qD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<_m.length;){const c=_m[i];c in n&&n[c]!==void 0&&n[c]!==null&&(this[c]=c==="history"?[...n[c]]:n[c])}let r;for(r in n)_m.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?Ga.basename(this.path):void 0}set basename(t){wm(t,"basename"),Sm(t,"basename"),this.path=Ga.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ga.dirname(this.path):void 0}set dirname(t){nb(this.basename,"dirname"),this.path=Ga.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ga.extname(this.path):void 0}set extname(t){if(Sm(t,"extname"),nb(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ga.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){gp(t)&&(t=GD(t)),wm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ga.basename(this.path,this.extname):void 0}set stem(t){wm(t,"stem"),Sm(t,"stem"),this.path=Ga.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const r=this.message(t,n,i);throw r.fatal=!0,r}info(t,n,i){const r=this.message(t,n,i);return r.fatal=void 0,r}message(t,n,i){const r=new Sn(t,n,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Sm(e,t){if(e&&e.includes(Ga.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ga.sep+"`")}function wm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function nb(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function KD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const XD=(function(e){const t=this.constructor.prototype,n=t[e],i=function(){return n.apply(i,arguments)};return Object.setPrototypeOf(i,t),i}),QD={}.hasOwnProperty;class wg extends XD{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zD()}copy(){const t=new wg;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(bm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(jm("data",this.frozen),this.namespace[t]=n,this):QD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(jm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=n.call(t,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Du(t),i=this.parser||this.Parser;return Nm("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Nm("process",this.parser||this.Parser),Cm("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(c,o){const u=Du(t),h=i.parse(u);i.run(h,u,function(g,p,y){if(g||!p||!y)return m(g);const x=p,_=i.stringify(x,y);WD(_)?y.value=_:y.result=_,m(g,y)});function m(g,p){g||!p?o(g):c?c(p):n(void 0,p)}}}processSync(t){let n=!1,i;return this.freeze(),Nm("processSync",this.parser||this.Parser),Cm("processSync",this.compiler||this.Compiler),this.process(t,r),ib("processSync","process",n),i;function r(c,o){n=!0,Xx(c),i=o}}run(t,n,i){ab(t),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?c(void 0,i):new Promise(c);function c(o,u){const h=Du(n);r.run(t,h,m);function m(g,p,y){const x=p||t;g?u(g):o?o(x):i(void 0,x,y)}}}runSync(t,n){let i=!1,r;return this.run(t,n,c),ib("runSync","run",i),r;function c(o,u){Xx(o),r=u,i=!0}}stringify(t,n){this.freeze();const i=Du(n),r=this.compiler||this.Compiler;return Cm("stringify",r),ab(t),r(t,i)}use(t,...n){const i=this.attachers,r=this.namespace;if(jm("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function c(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...p]=m;h(g,p)}else o(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function o(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(m.plugins),m.settings&&(r.settings=bm(!0,r.settings,m.settings))}function u(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const p=m[g];c(p)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let p=-1,y=-1;for(;++p<i.length;)if(i[p][0]===m){y=p;break}if(y===-1)i.push([m,...g]);else if(g.length>0){let[x,..._]=g;const S=i[y][1];pp(S)&&pp(x)&&(x=bm(!0,S,x)),i[y]=[m,x,..._]}}}}const ZD=new wg().freeze();function Nm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function jm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ab(e){if(!pp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ib(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Du(e){return JD(e)?e:new tw(e)}function JD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function WD(e){return typeof e=="string"||e3(e)}function e3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const t3="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",sb=[],rb={allowDangerousHtml:!0},n3=/^(https?|ircs?|mailto|xmpp)$/i,a3=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function i3(e){const t=s3(e),n=r3(e);return l3(t.runSync(t.parse(n),n),e)}function s3(e){const t=e.rehypePlugins||sb,n=e.remarkPlugins||sb,i=e.remarkRehypeOptions?R(R({},e.remarkRehypeOptions),rb):rb;return ZD().use(UL).use(n).use(DD,i).use(t)}function r3(e){const t=e.children||"",n=new tw;return typeof t=="string"&&(n.value=t),n}function l3(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,c=t.disallowedElements,o=t.skipHtml,u=t.unwrapDisallowed,h=t.urlTransform||o3;for(const g of a3)Object.hasOwn(t,g.from)&&""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+t3+g.id;return Sg(e,m),SR(e,{Fragment:d.Fragment,components:r,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function m(g,p,y){if(g.type==="raw"&&y&&typeof p=="number")return o?y.children.splice(p,1):y.children[p]={type:"text",value:g.value},p;if(g.type==="element"){let x;for(x in ym)if(Object.hasOwn(ym,x)&&Object.hasOwn(g.properties,x)){const _=g.properties[x],S=ym[x];(S===null||S.includes(g.tagName))&&(g.properties[x]=h(String(_||""),x,g))}}if(g.type==="element"){let x=n?!n.includes(g.tagName):c?c.includes(g.tagName):!1;if(!x&&i&&typeof p=="number"&&(x=!i(g,p,y)),x&&y&&typeof p=="number")return u&&g.children?y.children.splice(p,1,...g.children):y.children.splice(p,1),p}}}function o3(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||n3.test(e.slice(0,t))?e:""}function lb(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function c3(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function u3(e,t,n){const i=Md((n||{}).ignore||[]),r=d3(t);let c=-1;for(;++c<r.length;)WS(e,"text",o);function o(h,m){let g=-1,p;for(;++g<m.length;){const y=m[g],x=p?p.children:void 0;if(i(y,x?x.indexOf(y):void 0,p))return;p=y}if(p)return u(h,m)}function u(h,m){const g=m[m.length-1],p=r[c][0],y=r[c][1];let x=0;const _=g.children.indexOf(h);let S=!1,w=[];p.lastIndex=0;let N=p.exec(h.value);for(;N;){const k=N.index,C={index:N.index,input:N.input,stack:[...m,h]};let j=y(...N,C);if(typeof j=="string"&&(j=j.length>0?{type:"text",value:j}:void 0),j===!1?p.lastIndex=k+1:(x!==k&&w.push({type:"text",value:h.value.slice(x,k)}),Array.isArray(j)?w.push(...j):j&&w.push(j),x=k+N[0].length,S=!0),!p.global)break;N=p.exec(h.value)}return S?(x<h.value.length&&w.push({type:"text",value:h.value.slice(x)}),g.children.splice(_,1,...w)):w=[h],_+w.length}}function d3(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const r=n[i];t.push([f3(r[0]),h3(r[1])])}return t}function f3(e){return typeof e=="string"?new RegExp(c3(e),"g"):e}function h3(e){return typeof e=="function"?e:function(){return e}}const Em="phrasing",km=["autolink","link","image","label"];function m3(){return{transforms:[_3],enter:{literalAutolink:g3,literalAutolinkEmail:Mm,literalAutolinkHttp:Mm,literalAutolinkWww:Mm},exit:{literalAutolink:b3,literalAutolinkEmail:x3,literalAutolinkHttp:y3,literalAutolinkWww:v3}}}function p3(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Em,notInConstruct:km},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Em,notInConstruct:km},{character:":",before:"[ps]",after:"\\/",inConstruct:Em,notInConstruct:km}]}}function g3(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Mm(e){this.config.enter.autolinkProtocol.call(this,e)}function y3(e){this.config.exit.autolinkProtocol.call(this,e)}function v3(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function x3(e){this.config.exit.autolinkEmail.call(this,e)}function b3(e){this.exit(e)}function _3(e){u3(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,S3],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),w3]],{ignore:["link","linkReference"]})}function S3(e,t,n,i,r){let c="";if(!nw(r)||(/^w/i.test(t)&&(n=t+n,t="",c="http://"),!N3(n)))return!1;const o=C3(n+i);if(!o[0])return!1;const u={type:"link",title:null,url:c+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[u,{type:"text",value:o[1]}]:u}function w3(e,t,n,i){return!nw(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function N3(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function C3(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=lb(e,"(");let c=lb(e,")");for(;i!==-1&&r>c;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),c++;return[e,n]}function nw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||yr(n)||jd(n))&&(!t||n!==47)}aw.peek=D3;function j3(){this.buffer()}function E3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function k3(){this.buffer()}function M3(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function T3(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=La(this.sliceSerialize(e)).toLowerCase(),n.label=t}function R3(e){this.exit(e)}function A3(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=La(this.sliceSerialize(e)).toLowerCase(),n.label=t}function L3(e){this.exit(e)}function D3(){return"["}function aw(e,t,n,i){const r=n.createTracker(i);let c=r.move("[^");const o=n.enter("footnoteReference"),u=n.enter("reference");return c+=r.move(n.safe(n.associationId(e),{after:"]",before:c})),u(),o(),c+=r.move("]"),c}function O3(){return{enter:{gfmFootnoteCallString:j3,gfmFootnoteCall:E3,gfmFootnoteDefinitionLabelString:k3,gfmFootnoteDefinition:M3},exit:{gfmFootnoteCallString:T3,gfmFootnoteCall:R3,gfmFootnoteDefinitionLabelString:A3,gfmFootnoteDefinition:L3}}}function z3(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:aw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,c,o){const u=c.createTracker(o);let h=u.move("[^");const m=c.enter("footnoteDefinition"),g=c.enter("label");return h+=u.move(c.safe(c.associationId(i),{before:h,after:"]"})),g(),h+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),h+=u.move((t?`
63
- `:" ")+c.indentLines(c.containerFlow(i,u.current()),t?iw:I3))),m(),h}}function I3(e,t,n){return t===0?e:iw(e,t,n)}function iw(e,t,n){return(n?"":" ")+e}const B3=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];sw.peek=$3;function U3(){return{canContainEols:["delete"],enter:{strikethrough:H3},exit:{strikethrough:P3}}}function F3(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:B3}],handlers:{delete:sw}}}function H3(e){this.enter({type:"delete",children:[]},e)}function P3(e){this.exit(e)}function sw(e,t,n,i){const r=n.createTracker(i),c=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,V(R({},r.current()),{before:o,after:"~"})),o+=r.move("~~"),c(),o}function $3(){return"~"}function q3(e){return e.length}function V3(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||q3,c=[],o=[],u=[],h=[];let m=0,g=-1;for(;++g<e.length;){const S=[],w=[];let N=-1;for(e[g].length>m&&(m=e[g].length);++N<e[g].length;){const k=G3(e[g][N]);if(n.alignDelimiters!==!1){const C=r(k);w[N]=C,(h[N]===void 0||C>h[N])&&(h[N]=C)}S.push(k)}o[g]=S,u[g]=w}let p=-1;if(typeof i=="object"&&"length"in i)for(;++p<m;)c[p]=ob(i[p]);else{const S=ob(i);for(;++p<m;)c[p]=S}p=-1;const y=[],x=[];for(;++p<m;){const S=c[p];let w="",N="";S===99?(w=":",N=":"):S===108?w=":":S===114&&(N=":");let k=n.alignDelimiters===!1?1:Math.max(1,h[p]-w.length-N.length);const C=w+"-".repeat(k)+N;n.alignDelimiters!==!1&&(k=w.length+k+N.length,k>h[p]&&(h[p]=k),x[p]=k),y[p]=C}o.splice(1,0,y),u.splice(1,0,x),g=-1;const _=[];for(;++g<o.length;){const S=o[g],w=u[g];p=-1;const N=[];for(;++p<m;){const k=S[p]||"";let C="",j="";if(n.alignDelimiters!==!1){const A=h[p]-(w[p]||0),L=c[p];L===114?C=" ".repeat(A):L===99?A%2?(C=" ".repeat(A/2+.5),j=" ".repeat(A/2-.5)):(C=" ".repeat(A/2),j=C):j=" ".repeat(A)}n.delimiterStart!==!1&&!p&&N.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||p)&&N.push(" "),n.alignDelimiters!==!1&&N.push(C),N.push(k),n.alignDelimiters!==!1&&N.push(j),n.padding!==!1&&N.push(" "),(n.delimiterEnd!==!1||p!==m-1)&&N.push("|")}_.push(n.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return _.join(`
64
- `)}function G3(e){return e==null?"":String(e)}function ob(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Y3(e,t,n,i){const r=n.enter("blockquote"),c=n.createTracker(i);c.move("> "),c.shift(2);const o=n.indentLines(n.containerFlow(e,c.current()),K3);return r(),o}function K3(e,t,n){return">"+(n?"":" ")+e}function X3(e,t){return cb(e,t.inConstruct,!0)&&!cb(e,t.notInConstruct,!1)}function cb(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function ub(e,t,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
65
- `&&X3(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
66
- `}function Q3(e,t){const n=String(e);let i=n.indexOf(t),r=i,c=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++c>o&&(o=c):c=1,r=i+t.length,i=n.indexOf(t,r);return o}function Z3(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function J3(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function W3(e,t,n,i){const r=J3(n),c=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(Z3(e,n)){const p=n.enter("codeIndented"),y=n.indentLines(c,eO);return p(),y}const u=n.createTracker(i),h=r.repeat(Math.max(Q3(c,r)+1,3)),m=n.enter("codeFenced");let g=u.move(h);if(e.lang){const p=n.enter(`codeFencedLang${o}`);g+=u.move(n.safe(e.lang,R({before:g,after:" ",encode:["`"]},u.current()))),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${o}`);g+=u.move(" "),g+=u.move(n.safe(e.meta,R({before:g,after:`
67
- `,encode:["`"]},u.current()))),p()}return g+=u.move(`
68
- `),c&&(g+=u.move(c+`
69
- `)),g+=u.move(h),m(),g}function eO(e,t,n){return(n?"":" ")+e}function Ng(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function tO(e,t,n,i){const r=Ng(n),c=r==='"'?"Quote":"Apostrophe",o=n.enter("definition");let u=n.enter("label");const h=n.createTracker(i);let m=h.move("[");return m+=h.move(n.safe(n.associationId(e),R({before:m,after:"]"},h.current()))),m+=h.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,R({before:m,after:">"},h.current()))),m+=h.move(">")):(u=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,R({before:m,after:e.title?" ":`
70
- `},h.current())))),u(),e.title&&(u=n.enter(`title${c}`),m+=h.move(" "+r),m+=h.move(n.safe(e.title,R({before:m,after:r},h.current()))),m+=h.move(r),u()),o(),m}function nO(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ec(e){return"&#x"+e.toString(16).toUpperCase()+";"}function dd(e,t,n){const i=Cl(e),r=Cl(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}rw.peek=aO;function rw(e,t,n,i){const r=nO(n),c=n.enter("emphasis"),o=n.createTracker(i),u=o.move(r);let h=o.move(n.containerPhrasing(e,R({after:r,before:u},o.current())));const m=h.charCodeAt(0),g=dd(i.before.charCodeAt(i.before.length-1),m,r);g.inside&&(h=ec(m)+h.slice(1));const p=h.charCodeAt(h.length-1),y=dd(i.after.charCodeAt(0),p,r);y.inside&&(h=h.slice(0,-1)+ec(p));const x=o.move(r);return c(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},u+h+x}function aO(e,t,n){return n.options.emphasis||"*"}function iO(e,t){let n=!1;return Sg(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,hp}),!!((!e.depth||e.depth<3)&&pg(e)&&(t.options.setext||n))}function sO(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),c=n.createTracker(i);if(iO(e,n)){const g=n.enter("headingSetext"),p=n.enter("phrasing"),y=n.containerPhrasing(e,V(R({},c.current()),{before:`
71
- `,after:`
72
- `}));return p(),g(),y+`
73
- `+(r===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
74
- `))+1))}const o="#".repeat(r),u=n.enter("headingAtx"),h=n.enter("phrasing");c.move(o+" ");let m=n.containerPhrasing(e,R({before:"# ",after:`
75
- `},c.current()));return/^[\t ]/.test(m)&&(m=ec(m.charCodeAt(0))+m.slice(1)),m=m?o+" "+m:o,n.options.closeAtx&&(m+=" "+o),h(),u(),m}lw.peek=rO;function lw(e){return e.value||""}function rO(){return"<"}ow.peek=lO;function ow(e,t,n,i){const r=Ng(n),c=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let u=n.enter("label");const h=n.createTracker(i);let m=h.move("![");return m+=h.move(n.safe(e.alt,R({before:m,after:"]"},h.current()))),m+=h.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,R({before:m,after:">"},h.current()))),m+=h.move(">")):(u=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,R({before:m,after:e.title?" ":")"},h.current())))),u(),e.title&&(u=n.enter(`title${c}`),m+=h.move(" "+r),m+=h.move(n.safe(e.title,R({before:m,after:r},h.current()))),m+=h.move(r),u()),m+=h.move(")"),o(),m}function lO(){return"!"}cw.peek=oO;function cw(e,t,n,i){const r=e.referenceType,c=n.enter("imageReference");let o=n.enter("label");const u=n.createTracker(i);let h=u.move("![");const m=n.safe(e.alt,R({before:h,after:"]"},u.current()));h+=u.move(m+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),R({before:h,after:"]"},u.current()));return o(),n.stack=g,c(),r==="full"||!m||m!==p?h+=u.move(p+"]"):r==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function oO(){return"!"}uw.peek=cO;function uw(e,t,n){let i=e.value||"",r="`",c=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++c<n.unsafe.length;){const o=n.unsafe[c],u=n.compilePattern(o);let h;if(o.atBreak)for(;h=u.exec(i);){let m=h.index;i.charCodeAt(m)===10&&i.charCodeAt(m-1)===13&&m--,i=i.slice(0,m)+" "+i.slice(h.index+1)}}return r+i+r}function cO(){return"`"}function dw(e,t){const n=pg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}fw.peek=uO;function fw(e,t,n,i){const r=Ng(n),c=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let u,h;if(dw(e,n)){const g=n.stack;n.stack=[],u=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,R({before:p,after:">"},o.current()))),p+=o.move(">"),u(),n.stack=g,p}u=n.enter("link"),h=n.enter("label");let m=o.move("[");return m+=o.move(n.containerPhrasing(e,R({before:m,after:"]("},o.current()))),m+=o.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),m+=o.move("<"),m+=o.move(n.safe(e.url,R({before:m,after:">"},o.current()))),m+=o.move(">")):(h=n.enter("destinationRaw"),m+=o.move(n.safe(e.url,R({before:m,after:e.title?" ":")"},o.current())))),h(),e.title&&(h=n.enter(`title${c}`),m+=o.move(" "+r),m+=o.move(n.safe(e.title,R({before:m,after:r},o.current()))),m+=o.move(r),h()),m+=o.move(")"),u(),m}function uO(e,t,n){return dw(e,n)?"<":"["}hw.peek=dO;function hw(e,t,n,i){const r=e.referenceType,c=n.enter("linkReference");let o=n.enter("label");const u=n.createTracker(i);let h=u.move("[");const m=n.containerPhrasing(e,R({before:h,after:"]"},u.current()));h+=u.move(m+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),R({before:h,after:"]"},u.current()));return o(),n.stack=g,c(),r==="full"||!m||m!==p?h+=u.move(p+"]"):r==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function dO(){return"["}function Cg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function fO(e){const t=Cg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function hO(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function mw(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function mO(e,t,n,i){const r=n.enter("list"),c=n.bulletCurrent;let o=e.ordered?hO(n):Cg(n);const u=e.ordered?o==="."?")":".":fO(n);let h=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(h=!0),mw(n)===o&&g){let p=-1;for(;++p<e.children.length;){const y=e.children[p];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(o=u),n.bulletCurrent=o;const m=n.containerFlow(e,i);return n.bulletLastUsed=o,n.bulletCurrent=c,r(),m}function pO(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function gO(e,t,n,i){const r=pO(n);let c=n.bulletCurrent||Cg(n);t&&t.type==="list"&&t.ordered&&(c=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+c);let o=c.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const u=n.createTracker(i);u.move(c+" ".repeat(o-c.length)),u.shift(o);const h=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,u.current()),g);return h(),m;function g(p,y,x){return y?(x?"":" ".repeat(o))+p:(x?c:c+" ".repeat(o-c.length))+p}}function yO(e,t,n,i){const r=n.enter("paragraph"),c=n.enter("phrasing"),o=n.containerPhrasing(e,i);return c(),r(),o}const vO=Md(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function xO(e,t,n,i){return(e.children.some(function(r){return vO(r)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function bO(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}pw.peek=_O;function pw(e,t,n,i){const r=bO(n),c=n.enter("strong"),o=n.createTracker(i),u=o.move(r+r);let h=o.move(n.containerPhrasing(e,R({after:r,before:u},o.current())));const m=h.charCodeAt(0),g=dd(i.before.charCodeAt(i.before.length-1),m,r);g.inside&&(h=ec(m)+h.slice(1));const p=h.charCodeAt(h.length-1),y=dd(i.after.charCodeAt(0),p,r);y.inside&&(h=h.slice(0,-1)+ec(p));const x=o.move(r+r);return c(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},u+h+x}function _O(e,t,n){return n.options.strong||"*"}function SO(e,t,n,i){return n.safe(e.value,i)}function wO(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function NO(e,t,n){const i=(mw(n)+(n.options.ruleSpaces?" ":"")).repeat(wO(n));return n.options.ruleSpaces?i.slice(0,-1):i}const gw={blockquote:Y3,break:ub,code:W3,definition:tO,emphasis:rw,hardBreak:ub,heading:sO,html:lw,image:ow,imageReference:cw,inlineCode:uw,link:fw,linkReference:hw,list:mO,listItem:gO,paragraph:yO,root:xO,strong:pw,text:SO,thematicBreak:NO};function CO(){return{enter:{table:jO,tableData:db,tableHeader:db,tableRow:kO},exit:{codeText:MO,table:EO,tableData:Tm,tableHeader:Tm,tableRow:Tm}}}function jO(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function EO(e){this.exit(e),this.data.inTable=void 0}function kO(e){this.enter({type:"tableRow",children:[]},e)}function Tm(e){this.exit(e)}function db(e){this.enter({type:"tableCell",children:[]},e)}function MO(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,TO));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function TO(e,t){return t==="|"?t:e}function RO(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,c=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
76
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:o,tableCell:h,tableRow:u}};function o(x,_,S,w){return m(g(x,S,w),x.align)}function u(x,_,S,w){const N=p(x,S,w),k=m([N]);return k.slice(0,k.indexOf(`
77
- `))}function h(x,_,S,w){const N=S.enter("tableCell"),k=S.enter("phrasing"),C=S.containerPhrasing(x,V(R({},w),{before:c,after:c}));return k(),N(),C}function m(x,_){return V3(x,{align:_,alignDelimiters:i,padding:n,stringLength:r})}function g(x,_,S){const w=x.children;let N=-1;const k=[],C=_.enter("table");for(;++N<w.length;)k[N]=p(w[N],_,S);return C(),k}function p(x,_,S){const w=x.children;let N=-1;const k=[],C=_.enter("tableRow");for(;++N<w.length;)k[N]=h(w[N],x,_,S);return C(),k}function y(x,_,S){let w=gw.inlineCode(x,_,S);return S.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function AO(){return{exit:{taskListCheckValueChecked:fb,taskListCheckValueUnchecked:fb,paragraph:DO}}}function LO(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:OO}}}function fb(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function DO(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const r=t.children;let c=-1,o;for(;++c<r.length;){const u=r[c];if(u.type==="paragraph"){o=u;break}}o===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function OO(e,t,n,i){const r=e.children[0],c=typeof e.checked=="boolean"&&r&&r.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",u=n.createTracker(i);c&&u.move(o);let h=gw.listItem(e,t,n,R(R({},i),u.current()));return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(g){return g+o}}function zO(){return[m3(),O3(),U3(),CO(),AO()]}function IO(e){return{extensions:[p3(),z3(e),F3(),RO(e),LO()]}}const BO={tokenize:qO,partial:!0},yw={tokenize:VO,partial:!0},vw={tokenize:GO,partial:!0},xw={tokenize:YO,partial:!0},UO={tokenize:KO,partial:!0},bw={name:"wwwAutolink",tokenize:PO,previous:Sw},_w={name:"protocolAutolink",tokenize:$O,previous:ww},Ai={name:"emailAutolink",tokenize:HO,previous:Nw},Wa={};function FO(){return{text:Wa}}let Ys=48;for(;Ys<123;)Wa[Ys]=Ai,Ys++,Ys===58?Ys=65:Ys===91&&(Ys=97);Wa[43]=Ai;Wa[45]=Ai;Wa[46]=Ai;Wa[95]=Ai;Wa[72]=[Ai,_w];Wa[104]=[Ai,_w];Wa[87]=[Ai,bw];Wa[119]=[Ai,bw];function HO(e,t,n){const i=this;let r,c;return o;function o(p){return!yp(p)||!Nw.call(i,i.previous)||jg(i.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return yp(p)?(e.consume(p),u):p===64?(e.consume(p),h):n(p)}function h(p){return p===46?e.check(UO,g,m)(p):p===45||p===95||bn(p)?(c=!0,e.consume(p),h):g(p)}function m(p){return e.consume(p),r=!0,h}function g(p){return c&&r&&kn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function PO(e,t,n){const i=this;return r;function r(o){return o!==87&&o!==119||!Sw.call(i,i.previous)||jg(i.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(BO,e.attempt(yw,e.attempt(vw,c),n),n)(o))}function c(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function $O(e,t,n){const i=this;let r="",c=!1;return o;function o(p){return(p===72||p===104)&&ww.call(i,i.previous)&&!jg(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(kn(p)&&r.length<5)return r+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const y=r.toLowerCase();if(y==="http"||y==="https")return e.consume(p),h}return n(p)}function h(p){return p===47?(e.consume(p),c?m:(c=!0,h)):n(p)}function m(p){return p===null||od(p)||Dt(p)||yr(p)||jd(p)?n(p):e.attempt(yw,e.attempt(vw,g),n)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function qO(e,t,n){let i=0;return r;function r(o){return(o===87||o===119)&&i<3?(i++,e.consume(o),r):o===46&&i===3?(e.consume(o),c):n(o)}function c(o){return o===null?n(o):t(o)}}function VO(e,t,n){let i,r,c;return o;function o(m){return m===46||m===95?e.check(xw,h,u)(m):m===null||Dt(m)||yr(m)||m!==45&&jd(m)?h(m):(c=!0,e.consume(m),o)}function u(m){return m===95?i=!0:(r=i,i=void 0),e.consume(m),o}function h(m){return r||i||!c?n(m):t(m)}}function GO(e,t){let n=0,i=0;return r;function r(o){return o===40?(n++,e.consume(o),r):o===41&&i<n?c(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(xw,t,c)(o):o===null||Dt(o)||yr(o)?t(o):(e.consume(o),r)}function c(o){return o===41&&i++,e.consume(o),r}}function YO(e,t,n){return i;function i(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),i):u===38?(e.consume(u),c):u===93?(e.consume(u),r):u===60||u===null||Dt(u)||yr(u)?t(u):n(u)}function r(u){return u===null||u===40||u===91||Dt(u)||yr(u)?t(u):i(u)}function c(u){return kn(u)?o(u):n(u)}function o(u){return u===59?(e.consume(u),i):kn(u)?(e.consume(u),o):n(u)}}function KO(e,t,n){return i;function i(c){return e.consume(c),r}function r(c){return bn(c)?n(c):t(c)}}function Sw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Dt(e)}function ww(e){return!kn(e)}function Nw(e){return!(e===47||yp(e))}function yp(e){return e===43||e===45||e===46||e===95||bn(e)}function jg(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const XO={tokenize:a4,partial:!0};function QO(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:e4,continuation:{tokenize:t4},exit:n4}},text:{91:{name:"gfmFootnoteCall",tokenize:WO},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ZO,resolveTo:JO}}}}function ZO(e,t,n){const i=this;let r=i.events.length;const c=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const h=i.events[r][1];if(h.type==="labelImage"){o=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return u;function u(h){if(!o||!o._balanced)return n(h);const m=La(i.sliceSerialize({start:o.end,end:i.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function JO(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},u=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",c,t],["enter",o,t],["exit",o,t],["exit",c,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...u),e}function WO(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let c=0,o;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(p){if(c>999||p===93&&!o||p===null||p===91||Dt(p))return n(p);if(p===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return r.includes(La(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Dt(p)||(o=!0),c++,e.consume(p),p===92?g:m}function g(p){return p===91||p===92||p===93?(e.consume(p),c++,m):m(p)}}function e4(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let c,o=0,u;return h;function h(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(_)}function g(_){if(o>999||_===93&&!u||_===null||_===91||Dt(_))return n(_);if(_===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return c=La(i.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Dt(_)||(u=!0),o++,e.consume(_),_===92?p:g}function p(_){return _===91||_===92||_===93?(e.consume(_),o++,g):g(_)}function y(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),r.includes(c)||r.push(c),dt(e,x,"gfmFootnoteDefinitionWhitespace")):n(_)}function x(_){return t(_)}}function t4(e,t,n){return e.check(cc,t,e.attempt(XO,t,n))}function n4(e){e.exit("gfmFootnoteDefinition")}function a4(e,t,n){const i=this;return dt(e,r,"gfmFootnoteDefinitionIndent",5);function r(c){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(c):n(c)}}function i4(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:r,resolveAll:i};return t==null&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(c,o){let u=-1;for(;++u<c.length;)if(c[u][0]==="enter"&&c[u][1].type==="strikethroughSequenceTemporary"&&c[u][1]._close){let h=u;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[u][1].end.offset-c[u][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[u][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[u][1].end)},g={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[u][1].start)},p=[["enter",m,o],["enter",c[h][1],o],["exit",c[h][1],o],["enter",g,o]],y=o.parser.constructs.insideSpan.null;y&&ia(p,p.length,0,Ed(y,c.slice(h+1,u),o)),ia(p,p.length,0,[["exit",g,o],["enter",c[u][1],o],["exit",c[u][1],o],["exit",m,o]]),ia(c,h-1,u-h+3,p),u=h+p.length-2;break}}for(u=-1;++u<c.length;)c[u][1].type==="strikethroughSequenceTemporary"&&(c[u][1].type="data");return c}function r(c,o,u){const h=this.previous,m=this.events;let g=0;return p;function p(x){return h===126&&m[m.length-1][1].type!=="characterEscape"?u(x):(c.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const _=Cl(h);if(x===126)return g>1?u(x):(c.consume(x),g++,y);if(g<2&&!t)return u(x);const S=c.exit("strikethroughSequenceTemporary"),w=Cl(x);return S._open=!w||w===2&&!!_,S._close=!_||_===2&&!!w,o(x)}}}class s4{constructor(){this.map=[]}add(t,n,i){r4(this,t,n,i)}consume(t){if(this.map.sort(function(c,o){return c[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const c of r)t.push(c);r=i.pop()}this.map.length=0}}function r4(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=n,e.map[r][2].push(...i);return}r+=1}e.map.push([t,n,i])}}function l4(e,t){let n=!1;const i=[];for(;t<e.length;){const r=e[t];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const c=i.length-1;i[c]=i[c]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function o4(){return{flow:{null:{name:"table",tokenize:c4,resolveAll:u4}}}}function c4(e,t,n){const i=this;let r=0,c=0,o;return u;function u(T){let B=i.events.length-1;for(;B>-1;){const H=i.events[B][1].type;if(H==="lineEnding"||H==="linePrefix")B--;else break}const P=B>-1?i.events[B][1].type:null,K=P==="tableHead"||P==="tableRow"?L:h;return K===L&&i.parser.lazy[i.now().line]?n(T):K(T)}function h(T){return e.enter("tableHead"),e.enter("tableRow"),m(T)}function m(T){return T===124||(o=!0,c+=1),g(T)}function g(T){return T===null?n(T):qe(T)?c>1?(c=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),x):n(T):st(T)?dt(e,g,"whitespace")(T):(c+=1,o&&(o=!1,r+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,g):(e.enter("data"),p(T)))}function p(T){return T===null||T===124||Dt(T)?(e.exit("data"),g(T)):(e.consume(T),T===92?y:p)}function y(T){return T===92||T===124?(e.consume(T),p):p(T)}function x(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,st(T)?dt(e,_,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):_(T))}function _(T){return T===45||T===58?w(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),S):A(T)}function S(T){return st(T)?dt(e,w,"whitespace")(T):w(T)}function w(T){return T===58?(c+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),N):T===45?(c+=1,N(T)):T===null||qe(T)?j(T):A(T)}function N(T){return T===45?(e.enter("tableDelimiterFiller"),k(T)):A(T)}function k(T){return T===45?(e.consume(T),k):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(T))}function C(T){return st(T)?dt(e,j,"whitespace")(T):j(T)}function j(T){return T===124?_(T):T===null||qe(T)?!o||r!==c?A(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):A(T)}function A(T){return n(T)}function L(T){return e.enter("tableRow"),z(T)}function z(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),z):T===null||qe(T)?(e.exit("tableRow"),t(T)):st(T)?dt(e,z,"whitespace")(T):(e.enter("data"),F(T))}function F(T){return T===null||T===124||Dt(T)?(e.exit("data"),z(T)):(e.consume(T),T===92?D:F)}function D(T){return T===92||T===124?(e.consume(T),F):F(T)}}function u4(e,t){let n=-1,i=!0,r=0,c=[0,0,0,0],o=[0,0,0,0],u=!1,h=0,m,g,p;const y=new s4;for(;++n<e.length;){const x=e[n],_=x[1];x[0]==="enter"?_.type==="tableHead"?(u=!1,h!==0&&(hb(y,t,h,m,g),g=void 0,h=0),m={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},y.add(n,0,[["enter",m,t]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(i=!0,p=void 0,c=[0,0,0,0],o=[0,n+1,0,0],u&&(u=!1,g={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},y.add(n,0,[["enter",g,t]])),r=_.type==="tableDelimiterRow"?2:g?3:1):r&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(i=!1,o[2]===0&&(c[1]!==0&&(o[0]=o[1],p=Ou(y,t,c,r,void 0,p),c=[0,0,0,0]),o[2]=n)):_.type==="tableCellDivider"&&(i?i=!1:(c[1]!==0&&(o[0]=o[1],p=Ou(y,t,c,r,void 0,p)),c=o,o=[c[1],n,0,0])):_.type==="tableHead"?(u=!0,h=n):_.type==="tableRow"||_.type==="tableDelimiterRow"?(h=n,c[1]!==0?(o[0]=o[1],p=Ou(y,t,c,r,n,p)):o[1]!==0&&(p=Ou(y,t,o,r,n,p)),r=0):r&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(o[3]=n)}for(h!==0&&hb(y,t,h,m,g),y.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=l4(t.events,n))}return e}function Ou(e,t,n,i,r,c){const o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(c.end=Object.assign({},sl(t.events,n[0])),e.add(n[0],0,[["exit",c,t]]));const h=sl(t.events,n[1]);if(c={type:o,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",c,t]]),n[2]!==0){const m=sl(t.events,n[2]),g=sl(t.events,n[3]),p={type:u,start:Object.assign({},m),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",p,t]]),i!==2){const y=t.events[n[2]],x=t.events[n[3]];if(y[1].end=Object.assign({},x[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const _=n[2]+1,S=n[3]-n[2]-1;e.add(_,S,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return r!==void 0&&(c.end=Object.assign({},sl(t.events,r)),e.add(r,0,[["exit",c,t]]),c=void 0),c}function hb(e,t,n,i,r){const c=[],o=sl(t.events,n);r&&(r.end=Object.assign({},o),c.push(["exit",r,t])),i.end=Object.assign({},o),c.push(["exit",i,t]),e.add(n+1,0,c)}function sl(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const d4={name:"tasklistCheck",tokenize:h4};function f4(){return{text:{91:d4}}}function h4(e,t,n){const i=this;return r;function r(h){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),c)}function c(h){return Dt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),o):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),o):n(h)}function o(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(h)}function u(h){return qe(h)?t(h):st(h)?e.check({tokenize:m4},t,n)(h):n(h)}}function m4(e,t,n){return dt(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function p4(e){return DS([FO(),QO(),i4(e),o4(),f4()])}const g4={};function y4(e){const t=this,n=e||g4,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),c=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(p4(n)),c.push(zO()),o.push(IO(n))}const Cw=M.memo(({content:e,isStreaming:t=!1,className:n,syntaxHighlighter:i})=>{const r=M.useMemo(()=>({p:({children:o})=>d.jsx("p",{className:"chat-markdown__p",children:o}),h1:({children:o})=>d.jsx("h1",{className:"chat-markdown__h1",children:o}),h2:({children:o})=>d.jsx("h2",{className:"chat-markdown__h2",children:o}),h3:({children:o})=>d.jsx("h3",{className:"chat-markdown__h3",children:o}),ul:({children:o})=>d.jsx("ul",{className:"chat-markdown__ul",children:o}),ol:({children:o})=>d.jsx("ol",{className:"chat-markdown__ol",children:o}),li:({children:o})=>d.jsx("li",{className:"chat-markdown__li",children:o}),blockquote:({children:o})=>d.jsx("blockquote",{className:"chat-markdown__blockquote",children:o}),a:({children:o,href:u})=>d.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"chat-markdown__link",children:o}),table:({children:o})=>d.jsx("div",{className:"chat-markdown__table-wrapper",children:d.jsx("table",{className:"chat-markdown__table",children:o})}),thead:({children:o})=>d.jsx("thead",{className:"chat-markdown__thead",children:o}),tbody:({children:o})=>d.jsx("tbody",{className:"chat-markdown__tbody",children:o}),tr:({children:o})=>d.jsx("tr",{className:"chat-markdown__tr",children:o}),th:({children:o})=>d.jsx("th",{className:"chat-markdown__th",children:o}),td:({children:o})=>d.jsx("td",{className:"chat-markdown__td",children:o}),pre:({children:o})=>d.jsx(d.Fragment,{children:o}),code:({children:o,className:u})=>{const h=/language-(\w+)/.exec(u!=null?u:"");if(!h)return d.jsx("code",{className:"chat-markdown__code-inline",children:o});const m=h[1],g=String(o).replace(/\n$/,"");return i?d.jsx(d.Fragment,{children:i(g,m)}):d.jsx("pre",{className:"chat-markdown__pre",children:d.jsx("code",{className:"chat-markdown__code-block",children:o})})},hr:()=>d.jsx("hr",{className:"chat-markdown__hr"}),strong:({children:o})=>d.jsx("strong",{className:"chat-markdown__strong",children:o}),em:({children:o})=>d.jsx("em",{className:"chat-markdown__em",children:o})}),[i]),c=["chat-markdown",t&&"chat-markdown--streaming",n].filter(Boolean).join(" ");return d.jsx("div",{className:c,"aria-busy":t||void 0,children:d.jsx(i3,{remarkPlugins:[y4],components:r,children:e})})});Cw.displayName="ChatMarkdownContent";const vp=re.forwardRef((y,p)=>{var x=y,{query:e,onQueryChange:t,results:n=[],onSelect:i,onClear:r,placeholder:c="Search entities...",disabled:o=!1,inputId:u,placement:h="bottom-start",className:m}=x,g=pe(x,["query","onQueryChange","results","onSelect","onClear","placeholder","disabled","inputId","placement","className"]);const[_,S]=M.useState(!1),w=M.useRef(null),N=M.useRef(null),k=M.useRef(null),C=re.useId(),j=H=>`${C}-option-${H}`,A=M.useCallback(()=>S(!1),[]),{focusedValue:L,setFocusedValue:z}=_d({triggerRef:w,panelRef:k,isOpen:_,onClose:A,restoreFocus:!1});M.useEffect(()=>{n.length===0?z(null):n.some(H=>H.id===L)||z(n[0].id)},[n,L,z]),M.useEffect(()=>{if(!_)return;const H=q=>{var $;if(q.key!=="Enter"||!(($=w.current)!=null&&$.contains(q.target)))return;const Q=n.find(G=>G.id===L);Q&&(q.preventDefault(),i(Q),S(!1))};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[_,n,L,i]),M.useImperativeHandle(p,()=>N.current);const F=H=>{o||(t(H.target.value),S(!0))},D=()=>{o||e.length>0&&n.length>0&&S(!0)},T=()=>{var H;r(),S(!1),(H=w.current)==null||H.focus()},B=H=>{i(H),S(!1)},P=_&&n.length>0,K=P&&L?j(L):void 0;return d.jsxs("div",V(R({ref:N,className:["entity-picker",o&&"entity-picker--disabled",m].filter(Boolean).join(" ")},g),{children:[d.jsxs("div",{className:"entity-picker__input-wrapper",children:[d.jsx("input",{ref:w,id:u,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":P,"aria-controls":C,"aria-activedescendant":K,className:"entity-picker__input",placeholder:c,value:e,disabled:o,onChange:F,onFocus:D,"data-testid":"entity-picker-input"}),e&&!o&&d.jsx("button",{type:"button",className:"entity-picker__clear",onClick:T,"aria-label":"Clear search","data-testid":"entity-picker-clear",children:d.jsx(Ee,{name:"x",size:16})})]}),P&&d.jsx("div",{ref:k,id:C,role:"listbox",className:`dropdown-panel ${Sd(h)} entity-picker__dropdown`,"data-testid":"entity-picker-dropdown",children:n.map(H=>{const q=H.id===L;return d.jsxs("div",{id:j(H.id),role:"option","aria-selected":q,"data-dropdown-item":H.id,className:["dropdown-item","entity-picker__result",q&&"dropdown-item--focused"].filter(Boolean).join(" "),onMouseEnter:()=>z(H.id),onMouseDown:$=>{$.preventDefault(),B(H)},"data-testid":`entity-picker-result-${H.id}`,children:[H.domain&&H.domainColor&&d.jsx(Hn,{variant:H.domainColor,className:"entity-picker__badge",children:H.domain}),d.jsx("span",{className:"dropdown-item__label entity-picker__label",children:H.label})]},H.id)})})]}))});vp.displayName="EntityPicker";const v4=re.forwardRef((p,g)=>{var y=p,{rows:e,onChange:t,datatypeColumn:n=!1,datatypes:i=["string","number","boolean"],disabled:r=!1,keyPlaceholder:c="Key",valuePlaceholder:o="Value",addLabel:u="Add row",className:h}=y,m=pe(y,["rows","onChange","datatypeColumn","datatypes","disabled","keyPlaceholder","valuePlaceholder","addLabel","className"]);const x=re.useId(),_=re.useRef(0),S=(j,A)=>{t(e.map(L=>L.id===j?V(R({},L),{key:A}):L))},w=(j,A)=>{t(e.map(L=>L.id===j?V(R({},L),{value:A}):L))},N=(j,A)=>{t(e.map(L=>L.id===j?V(R({},L),{datatype:A}):L))},k=j=>{t(e.filter(A=>A.id!==j))},C=()=>{const j=R({id:`${x}-${_.current++}`,key:"",value:""},n&&{datatype:"string"});t([...e,j])};return d.jsxs("div",V(R({ref:g,className:["key-value-editor",n&&"key-value-editor--has-datatype",r&&"key-value-editor--disabled",h].filter(Boolean).join(" "),"data-testid":"key-value-editor"},m),{children:[d.jsxs("div",{className:"key-value-editor__table",children:[d.jsxs("div",{className:"key-value-editor__header",children:[d.jsx("div",{className:"key-value-editor__col key-value-editor__col--key",children:"Key"}),d.jsx("div",{className:"key-value-editor__col key-value-editor__col--value",children:"Value"}),n&&d.jsx("div",{className:"key-value-editor__col key-value-editor__col--datatype",children:"Type"}),d.jsx("div",{className:"key-value-editor__col key-value-editor__col--actions"})]}),e.map(j=>d.jsxs("div",{className:"key-value-editor__row","data-testid":`key-value-row-${j.id}`,children:[d.jsx(Qo,{className:"key-value-editor__input",placeholder:c,value:j.key,onChange:A=>S(j.id,A.target.value),disabled:r,"data-testid":`key-input-${j.id}`}),d.jsx(Qo,{className:"key-value-editor__input",placeholder:o,value:j.value,onChange:A=>w(j.id,A.target.value),disabled:r,"data-testid":`value-input-${j.id}`}),n&&d.jsx(rd,{className:"key-value-editor__input key-value-editor__select",value:j.datatype||"string",onChange:A=>N(j.id,A),disabled:r,"data-testid":`datatype-select-${j.id}`,children:i.map(A=>d.jsx(rd.Item,{value:A,children:A},A))}),d.jsx("button",{type:"button",className:"key-value-editor__remove-btn",onClick:()=>k(j.id),"aria-label":"Remove row",disabled:r,"data-testid":`remove-row-${j.id}`,children:d.jsx(Ee,{name:"trash",size:16})})]},j.id))]}),d.jsxs(_n,{variant:"ghost",size:"sm",className:"key-value-editor__add-btn",onClick:C,disabled:r,"data-testid":"add-row-btn",children:[d.jsx(Ee,{name:"plus",size:16}),u]})]}))});v4.displayName="KeyValueEditor";const x4=re.forwardRef((u,o)=>{var h=u,{items:e,onChange:t,primaryItemId:n,disabled:i=!1,className:r}=h,c=pe(h,["items","onChange","primaryItemId","disabled","className"]);const m=M.useCallback(p=>{if(p>0){const y=[...e];[y[p-1],y[p]]=[y[p],y[p-1]],t(y)}},[e,t]),g=M.useCallback(p=>{if(p<e.length-1){const y=[...e];[y[p],y[p+1]]=[y[p+1],y[p]],t(y)}},[e,t]);return d.jsx("div",V(R({ref:o,className:["ordered-list",i&&"ordered-list--disabled",r].filter(Boolean).join(" "),role:"list","aria-disabled":i||void 0,"data-testid":"ordered-list"},c),{children:e.map((p,y)=>d.jsxs("div",{className:["ordered-list__item",n===p.id&&"ordered-list__item--primary"].filter(Boolean).join(" "),role:"listitem","data-testid":`ordered-item-${p.id}`,children:[d.jsxs("div",{className:"ordered-list__rank",children:[n===p.id&&d.jsx("div",{className:"ordered-list__primary-badge",title:"Primary item",children:d.jsx(Ee,{name:"star",size:10})}),d.jsx("div",{className:"ordered-list__index",children:y+1})]}),d.jsx("span",{className:"ordered-list__label",children:p.label}),d.jsxs("div",{className:"ordered-list__controls",children:[d.jsx(_n,{variant:"ghost",size:"sm",disabled:i||y===0,onClick:()=>m(y),"aria-label":"Move up","data-testid":`move-up-${p.id}`,children:d.jsx(Ee,{name:"arrowUp",size:16})}),d.jsx(_n,{variant:"ghost",size:"sm",disabled:i||y===e.length-1,onClick:()=>g(y),"aria-label":"Move down","data-testid":`move-down-${p.id}`,children:d.jsx(Ee,{name:"arrowDown",size:16})})]})]},p.id))}))});x4.displayName="OrderedList";const b4=re.forwardRef((S,_)=>{var w=S,{value:e,onChange:t,sourceResults:n=[],targetResults:i=[],sourceQuery:r,onSourceQueryChange:c,targetQuery:o,onTargetQueryChange:u,predicates:h=["contains","relates to","depends on","is used by"],onSourceClear:m,onTargetClear:g,disabled:p=!1,className:y}=w,x=pe(w,["value","onChange","sourceResults","targetResults","sourceQuery","onSourceQueryChange","targetQuery","onTargetQueryChange","predicates","onSourceClear","onTargetClear","disabled","className"]);const N=re.useId(),k=`${N}-source`,C=`${N}-predicate`,j=`${N}-target`,A=re.useCallback(F=>{t(V(R({},e),{source:F})),c("")},[t,c,e]),L=re.useCallback(F=>{t(V(R({},e),{target:F})),u("")},[t,u,e]),z=re.useCallback(F=>{t(V(R({},e),{predicate:F}))},[t,e]);return d.jsxs("div",V(R({ref:_,className:["relationship-builder",y].filter(Boolean).join(" "),"data-testid":"relationship-builder"},x),{children:[d.jsxs("div",{className:"relationship-builder__column",children:[d.jsx("label",{htmlFor:k,className:"relationship-builder__label",children:"Source"}),d.jsx(vp,{inputId:k,query:r,onQueryChange:c,results:n,onSelect:A,onClear:m,placeholder:"Search source entity...",disabled:p}),e.source&&d.jsxs("div",{className:"relationship-builder__selected","data-testid":"source-selected",children:[e.source.domain&&d.jsx("span",{className:"relationship-builder__domain",children:e.source.domain}),d.jsx("span",{children:e.source.label})]})]}),d.jsxs("div",{className:"relationship-builder__column",children:[d.jsx("label",{htmlFor:C,className:"relationship-builder__label",children:"Predicate"}),d.jsx(rd,{id:C,value:e.predicate,placeholder:"Select relation type...",onChange:z,disabled:p,"data-testid":"predicate-select",children:h.map(F=>d.jsx(rd.Item,{value:F,children:F},F))})]}),d.jsxs("div",{className:"relationship-builder__column",children:[d.jsx("label",{htmlFor:j,className:"relationship-builder__label",children:"Target"}),d.jsx(vp,{inputId:j,query:o,onQueryChange:u,results:i,onSelect:L,onClear:g,placeholder:"Search target entity...",disabled:p}),e.target&&d.jsxs("div",{className:"relationship-builder__selected","data-testid":"target-selected",children:[e.target.domain&&d.jsx("span",{className:"relationship-builder__domain",children:e.target.domain}),d.jsx("span",{children:e.target.label})]})]})]}))});b4.displayName="RelationshipBuilder";const _4=e=>"type"in e&&e.type==="separator",jw=re.forwardRef((m,h)=>{var g=m,{actions:e,onAction:t,trigger:n,triggerIcon:i="moreVertical",triggerLabel:r="Menu",placement:c="bottom-start",className:o}=g,u=pe(g,["actions","onAction","trigger","triggerIcon","triggerLabel","placement","className"]);const[p,y]=M.useState(!1),x=M.useRef(null),_=M.useRef(null),S=M.useRef(null),w=M.useCallback(()=>y(!1),[]),{focusedValue:N,setFocusedValue:k}=_d({triggerRef:S,panelRef:_,isOpen:p,onClose:w});M.useImperativeHandle(h,()=>x.current);const C=M.useCallback(j=>{t(j),y(!1)},[t]);return d.jsxs("div",V(R({ref:x,className:["row-menu",o].filter(Boolean).join(" "),"data-testid":"row-menu"},u),{children:[d.jsx("button",{ref:S,type:"button",className:"row-menu__trigger",onClick:()=>y(j=>!j),"aria-label":r,"aria-haspopup":"menu","aria-expanded":p,"data-testid":"row-menu-trigger",children:n||d.jsx(Ee,{name:i,size:16})}),p&&d.jsx("div",{ref:_,role:"menu","aria-label":r,className:`dropdown-panel ${Sd(c)} row-menu__dropdown`,"data-testid":"row-menu-dropdown",children:e.map((j,A)=>_4(j)?d.jsx("div",{role:"separator",className:"dropdown-separator","data-testid":`row-menu-separator-${A}`},`separator-${A}`):d.jsx(S4,{action:j,isFocused:N===j.id,onFocus:()=>k(j.id),onClick:()=>C(j.id)},j.id))})]}))});jw.displayName="RowMenu";function S4({action:e,isFocused:t,onFocus:n,onClick:i}){const r=M.useRef(null);return M.useEffect(()=>{var c;t&&((c=r.current)==null||c.focus())},[t]),d.jsxs("button",{ref:r,type:"button",role:"menuitem",tabIndex:t?0:-1,disabled:e.disabled,"data-dropdown-item":e.id,"data-disabled":e.disabled||void 0,onClick:i,onMouseEnter:()=>!e.disabled&&n(),className:["dropdown-item",e.danger&&"dropdown-item--danger",t&&"dropdown-item--focused",e.disabled&&"dropdown-item--disabled"].filter(Boolean).join(" "),"data-testid":`row-menu-action-${e.id}`,children:[e.icon&&d.jsx("span",{className:"dropdown-item__leading",children:d.jsx(Ee,{name:e.icon,size:16})}),d.jsx("span",{className:"dropdown-item__label",children:e.label})]})}const w4={running:"cyan",success:"emerald",idle:"neutral",failed:"rose"},N4=re.forwardRef((y,p)=>{var x=y,{pipeline:e,onRun:t,onCancel:n,onOptions:i,compact:r=!1,selected:c=!1,headerAction:o,footerContent:u,flowLayout:h="fill",className:m}=x,g=pe(x,["pipeline","onRun","onCancel","onOptions","compact","selected","headerAction","footerContent","flowLayout","className"]);const _=w4[e.status];return d.jsxs("div",V(R({ref:p,className:["pipeline-card",r&&"pipeline-card--compact",c&&"pipeline-card--selected",m].filter(Boolean).join(" "),"data-testid":"pipeline-card"},g),{children:[d.jsxs("div",{className:"pipeline-card__head",children:[d.jsxs("div",{className:"pipeline-card__head-top",children:[d.jsxs("div",{className:"pipeline-card__title-group",children:[d.jsx("div",{className:"pipeline-card__name-mono",children:e.name}),e.id&&d.jsx("div",{className:"pipeline-card__id-mono",children:e.id})]}),d.jsxs("div",{className:"pipeline-card__head-right",children:[d.jsxs("div",{className:"pipeline-card__head-chips",children:[d.jsx(Hn,{variant:_,children:e.status}),e.target&&d.jsx(Hn,{variant:"neutral",children:e.target}),e.tags&&e.tags.length>0&&d.jsx("div",{className:"pipeline-card__tags",children:e.tags.map(S=>d.jsx(Hn,{variant:"neutral",children:S},S))})]}),d.jsxs("div",{className:"pipeline-card__head-actions",children:[o,t&&e.status!=="running"&&d.jsx("button",{type:"button",className:"pipeline-card__action-btn",onClick:t,"data-testid":"pipeline-run-btn",children:"Run"}),n&&e.status==="running"&&d.jsx("button",{type:"button",className:"pipeline-card__action-btn pipeline-card__action-btn--cancel",onClick:n,"data-testid":"pipeline-cancel-btn",children:"Cancel"}),i&&d.jsx("button",{type:"button","aria-label":"Pipeline options",className:"pipeline-card__kebab-btn",onClick:i,"data-testid":"pipeline-kebab-btn",children:d.jsx(Ee,{name:"moreVertical",size:16})})]})]})]}),e.description&&d.jsx("p",{className:"pipeline-card__description",children:e.description})]}),d.jsx("div",{className:"pipeline-card__flow","data-layout":h,children:e.flow.map((S,w)=>d.jsxs(re.Fragment,{children:[d.jsxs("div",{className:"pipeline-card__node","data-color":S.color,children:[d.jsx("div",{className:"pipeline-card__icon-tile",children:typeof S.icon=="string"?d.jsx(Ee,{name:S.icon,size:16}):S.icon}),d.jsxs("div",{className:"pipeline-card__node-content",children:[d.jsx("div",{className:"pipeline-card__node-name",children:S.name}),S.label&&d.jsx("div",{className:"pipeline-card__node-label",children:S.label})]})]}),w<e.flow.length-1&&d.jsx("div",{className:"pipeline-card__arrow"})]},S.id))}),d.jsx("div",{className:"pipeline-card__foot",children:u!=null?u:d.jsxs("div",{className:"pipeline-card__foot-row",children:[d.jsxs("div",{className:"pipeline-card__foot-col",children:[d.jsx("div",{className:"pipeline-card__foot-label",children:"LAST RUN"}),d.jsx("div",{className:"pipeline-card__foot-value",children:e.lastRun||"—"})]}),d.jsxs("div",{className:"pipeline-card__foot-col",children:[d.jsx("div",{className:"pipeline-card__foot-label",children:"INGESTED"}),d.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.ingested})]}),d.jsxs("div",{className:"pipeline-card__foot-col",children:[d.jsx("div",{className:"pipeline-card__foot-label",children:"CREATED"}),d.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.created})]}),d.jsxs("div",{className:"pipeline-card__foot-col",children:[d.jsx("div",{className:"pipeline-card__foot-label",children:"UPDATED"}),d.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.updated})]}),d.jsxs("div",{className:["pipeline-card__foot-col",Number(e.recent.errors)>0&&"pipeline-card__foot-col--error"].filter(Boolean).join(" "),children:[d.jsx("div",{className:"pipeline-card__foot-label",children:"ERRORS"}),d.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.errors})]})]})})]}))});N4.displayName="PipelineCard";const C4=e=>{const t=[];let n=0;const i=/`([^`]+)`/g;let r;for(;(r=i.exec(e))!==null;)r.index>n&&t.push(e.substring(n,r.index)),t.push(d.jsx("code",{className:"form-callout__code",children:r[1]},`code-${r.index}`)),n=i.lastIndex;return n<e.length&&t.push(e.substring(n)),t.length>0?t:[e]},j4=re.forwardRef((u,o)=>{var h=u,{variant:e="info",icon:t,children:n,className:i="",role:r}=h,c=pe(h,["variant","icon","children","className","role"]);const m=typeof n=="string"?C4(n):n,g=r!=null?r:e==="error"||e==="warn"?"alert":"note";return d.jsxs("div",V(R({ref:o,className:["form-callout",`form-callout--${e}`,i].filter(Boolean).join(" "),"data-testid":"form-callout",role:g},c),{children:[t&&d.jsx("div",{className:"form-callout__icon",children:d.jsx(Ee,{name:t,size:16})}),d.jsx("div",{className:"form-callout__body",children:m})]}))});j4.displayName="FormCallout";function E4(e,t,n,i,r,c){const o=r-e,u=c-t;if(o===0&&u===0)return{x:e,y:t};const h=Math.abs(o),m=Math.abs(u),g=n/2,p=i/2;if(h*p>m*g){const y=o>0?1:-1;return{x:e+y*g,y:t+u*g/h}}else{const y=u>0?1:-1;return{x:e+o*p/m,y:t+y*p}}}function Rm(e,t,n,i,r,c){const o=e.maxX-e.minX,u=e.maxY-e.minY,h=Math.min(c,Math.max(r,Math.min((t-2*i)/(o||1),(n-2*i)/(u||1)))),m=(e.minX+e.maxX)/2,g=(e.minY+e.maxY)/2;return{zoom:h,panX:t/2-m*h,panY:n/2-g*h}}const Ew=.22;function k4(e,t,n=Ew){const i=t.x-e.x,r=t.y-e.y,c=Math.hypot(i,r),o=-r/(c||1),u=i/(c||1),h=Math.min(80,c*n),m=(e.x+t.x)/2+o*h,g=(e.y+t.y)/2+u*h;return{d:`M ${e.x} ${e.y} Q ${m} ${g} ${t.x} ${t.y}`,mid:{x:(e.x+2*m+t.x)/4,y:(e.y+2*g+t.y)/4},angle:Math.atan2(t.y-g,t.x-m),points:[e,{x:m,y:g},t]}}const mb={left:{x:-1,y:0},right:{x:1,y:0},top:{x:0,y:-1},bottom:{x:0,y:1}};function pb(e,t,n,i,r,c){const o=r-e,u=c-t;if(o===0&&u===0)return{x:0,y:0};const h=Math.abs(o),m=Math.abs(u),g=n/2,p=i/2;return h*p>m*g?{x:o>0?1:-1,y:0}:{x:0,y:u>0?1:-1}}function gb(e,t,n,i,r,c,o){switch(r){case"left":return{x:e-n/2,y:t};case"right":return{x:e+n/2,y:t};case"top":return{x:e,y:t-i/2};case"bottom":return{x:e,y:t+i/2};default:return E4(e,t,n,i,c,o)}}const kw=.22;function M4(e,t,n="auto",i="auto",r=kw,c,o){const u=t.x-e.x,h=t.y-e.y,m=Math.hypot(u,h)||1,g=Math.min(120,m*r),p=-h/m,y=u/m,x=c!=null?c:n==="auto"?{x:p,y}:mb[n],_=o!=null?o:i==="auto"?{x:p,y}:mb[i],S={x:e.x+x.x*g,y:e.y+x.y*g},w={x:t.x+_.x*g,y:t.y+_.y*g},N={x:(e.x+S.x)/2,y:(e.y+S.y)/2},k={x:(S.x+w.x)/2,y:(S.y+w.y)/2},C={x:(w.x+t.x)/2,y:(w.y+t.y)/2},j={x:(N.x+k.x)/2,y:(N.y+k.y)/2},A={x:(k.x+C.x)/2,y:(k.y+C.y)/2},L={x:(j.x+A.x)/2,y:(j.y+A.y)/2};return{d:`M ${e.x} ${e.y} C ${S.x} ${S.y} ${w.x} ${w.y} ${t.x} ${t.y}`,mid:L,angle:Math.atan2(A.y-j.y,A.x-j.x),points:[e,S,w,t]}}function Mw(e,t,n={}){var m,g,p,y;const i=(m=n.sourceAnchor)!=null?m:"auto",r=(g=n.targetAnchor)!=null?g:"auto",c=gb(e.x,e.y,e.width,e.height,i,t.x,t.y),o=gb(t.x,t.y,t.width,t.height,r,e.x,e.y);if(i==="auto"&&r==="auto")return k4(c,o,(p=n.curvature)!=null?p:Ew);const u=i==="auto"?pb(e.x,e.y,e.width,e.height,t.x,t.y):void 0,h=r==="auto"?pb(t.x,t.y,t.width,t.height,e.x,e.y):void 0;return M4(c,o,i,r,(y=n.curvature)!=null?y:kw,u,h)}const T4=6.6,R4=14,A4=18;function Eg(e){return{width:e.length*T4+R4,height:A4}}function L4(e,t,n,i){const r=1-i;return{x:r*r*e.x+2*r*i*t.x+i*i*n.x,y:r*r*e.y+2*r*i*t.y+i*i*n.y}}function D4(e,t,n,i,r){const c=1-r;return{x:c*c*c*e.x+3*c*c*r*t.x+3*c*r*r*n.x+r*r*r*i.x,y:c*c*c*e.y+3*c*c*r*t.y+3*c*r*r*n.y+r*r*r*i.y}}const O4=[.5,.38,.62,.26,.74,.15,.85];function Tw(e,t,n,i=6){const r=e.length>=4?u=>D4(e[0],e[1],e[2],e[3],u):u=>L4(e[0],e[1],e[2],u),c=t.width/2+i,o=t.height/2+i;for(const u of O4){const h=r(u);if(n.every(m=>{const g=m.width/2,p=m.height/2;return Math.abs(h.x-m.x)>=c+g||Math.abs(h.y-m.y)>=o+p}))return h}return r(.5)}const z4=10,I4=100;function B4(e,t){var c,o,u;const n=new Map(e.map((h,m)=>[h,m])),i=e.map(()=>new Map),r=e.map(()=>0);for(const h of t){const m=n.get(h.source),g=n.get(h.target);if(m===void 0||g===void 0)continue;const p=(c=h.weight)!=null?c:1;if(m===g){r[m]+=p;continue}i[m].set(g,((o=i[m].get(g))!=null?o:0)+p),i[g].set(m,((u=i[g].get(m))!=null?u:0)+p)}return{id:[...e],adj:i,selfLoop:r}}function U4(e,t){var h;const n=e.id.length,i=e.adj.map((m,g)=>{let p=2*e.selfLoop[g];for(const y of m.values())p+=y;return p}),r=i.reduce((m,g)=>m+g,0),c=Array.from({length:n},(m,g)=>g),o=[...i];let u=!1;if(r===0)return{comm:c,moved:!1};for(let m=0;m<t;m++){let g=!1;for(let p=0;p<n;p++){const y=c[p];o[y]-=i[p];const x=new Map([[y,0]]);for(const[w,N]of e.adj[p]){const k=c[w];x.set(k,((h=x.get(k))!=null?h:0)+N)}let _=y,S=-1/0;for(const[w,N]of x){const k=N-o[w]*i[p]/r;(k>S||k===S&&w<_)&&(S=k,_=w)}c[p]=_,o[_]+=i[p],_!==y&&(g=!0)}if(g)u=!0;else break}return{comm:c,moved:u}}function F4(e,t,n){var m,g;const i=new Map;for(let p=0;p<e.id.length;p++){const y=t[p];i.has(y)||i.set(y,[]),i.get(y).push(e.id[p])}const r=new Map,c=new Map;for(const[p,y]of i){y.sort();const x=`cluster-L${n}-${y[0]}`;r.set(p,x),c.set(x,y)}const o=[...i.keys()].sort((p,y)=>{const x=r.get(p),_=r.get(y);return x<_?-1:x>_?1:0}),u=new Map(o.map((p,y)=>[p,y])),h={id:o.map(p=>r.get(p)),adj:o.map(()=>new Map),selfLoop:o.map(()=>0)};for(let p=0;p<e.id.length;p++){const y=u.get(t[p]);h.selfLoop[y]+=e.selfLoop[p];for(const[x,_]of e.adj[p]){if(x<=p)continue;const S=u.get(t[x]);y===S?h.selfLoop[y]+=_:(h.adj[y].set(S,((m=h.adj[y].get(S))!=null?m:0)+_),h.adj[S].set(y,((g=h.adj[S].get(y))!=null?g:0)+_))}}return{coarse:h,membersOf:c}}function H4(e,t,n={}){var p,y;const i=(p=n.maxLevels)!=null?p:z4,r=(y=n.maxLocalPasses)!=null?y:I4,c="cluster-root";if(e.length===0)return{id:c,children:[]};let o=new Map,u=B4(e,t),h=0,m=[...e];for(;h<i;){const{comm:x,moved:_}=U4(u,r);if(!_)break;const{coarse:S,membersOf:w}=F4(u,x,h);if(S.id.length===u.id.length)break;const N=new Map;for(const[k,C]of w){const j=C.map(A=>{var L;return(L=o.get(A))!=null?L:{id:A}});N.set(k,{id:k,children:j})}o=N,m=S.id,u=S,h++}const g=m.map(x=>{var _;return(_=o.get(x))!=null?_:{id:x}});return{id:c,children:g}}function P4(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function $4(){return this.eachAfter(P4)}function q4(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function V4(e,t){for(var n=this,i=[n],r,c,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(c=r.length-1;c>=0;--c)i.push(r[c]);return this}function G4(e,t){for(var n=this,i=[n],r=[],c,o,u,h=-1;n=i.pop();)if(r.push(n),c=n.children)for(o=0,u=c.length;o<u;++o)i.push(c[o]);for(;n=r.pop();)e.call(t,n,++h,this);return this}function Y4(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function K4(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function X4(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Q4(e){for(var t=this,n=Z4(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function Z4(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function J4(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function W4(){return Array.from(this)}function e6(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function t6(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*n6(){var e=this,t,n=[e],i,r,c;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,c=i.length;r<c;++r)n.push(i[r]);while(n.length)}function kg(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=s6)):t===void 0&&(t=i6);for(var n=new fd(e),i,r=[n],c,o,u,h;i=r.pop();)if((o=t(i.data))&&(h=(o=Array.from(o)).length))for(i.children=o,u=h-1;u>=0;--u)r.push(c=o[u]=new fd(o[u])),c.parent=i,c.depth=i.depth+1;return n.eachBefore(l6)}function a6(){return kg(this).eachBefore(r6)}function i6(e){return e.children}function s6(e){return Array.isArray(e)?e[1]:null}function r6(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function l6(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function fd(e){this.data=e,this.depth=this.height=0,this.parent=null}fd.prototype=kg.prototype={constructor:fd,count:$4,each:q4,eachAfter:G4,eachBefore:V4,find:Y4,sum:K4,sort:X4,path:Q4,ancestors:J4,descendants:W4,leaves:e6,links:t6,copy:a6,[Symbol.iterator]:n6};function o6(e){return e==null?null:c6(e)}function c6(e){if(typeof e!="function")throw new Error;return e}function yb(){return 0}function u6(e){return function(){return e}}const d6=1664525,f6=1013904223,vb=4294967296;function h6(){let e=1;return()=>(e=(d6*e+f6)%vb)/vb}function m6(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function p6(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function g6(e,t){for(var n=0,i=(e=p6(Array.from(e),t)).length,r=[],c,o;n<i;)c=e[n],o&&Rw(o,c)?++n:(o=v6(r=y6(r,c)),n=0);return o}function y6(e,t){var n,i;if(Am(t,e))return[t];for(n=0;n<e.length;++n)if(zu(t,e[n])&&Am(Oo(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(zu(Oo(e[n],e[i]),t)&&zu(Oo(e[n],t),e[i])&&zu(Oo(e[i],t),e[n])&&Am(Aw(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function zu(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function Rw(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Am(e,t){for(var n=0;n<t.length;++n)if(!Rw(e,t[n]))return!1;return!0}function v6(e){switch(e.length){case 1:return x6(e[0]);case 2:return Oo(e[0],e[1]);case 3:return Aw(e[0],e[1],e[2])}}function x6(e){return{x:e.x,y:e.y,r:e.r}}function Oo(e,t){var n=e.x,i=e.y,r=e.r,c=t.x,o=t.y,u=t.r,h=c-n,m=o-i,g=u-r,p=Math.sqrt(h*h+m*m);return{x:(n+c+h/p*g)/2,y:(i+o+m/p*g)/2,r:(p+r+u)/2}}function Aw(e,t,n){var i=e.x,r=e.y,c=e.r,o=t.x,u=t.y,h=t.r,m=n.x,g=n.y,p=n.r,y=i-o,x=i-m,_=r-u,S=r-g,w=h-c,N=p-c,k=i*i+r*r-c*c,C=k-o*o-u*u+h*h,j=k-m*m-g*g+p*p,A=x*_-y*S,L=(_*j-S*C)/(A*2)-i,z=(S*w-_*N)/A,F=(x*C-y*j)/(A*2)-r,D=(y*N-x*w)/A,T=z*z+D*D-1,B=2*(c+L*z+F*D),P=L*L+F*F-c*c,K=-(Math.abs(T)>1e-6?(B+Math.sqrt(B*B-4*T*P))/(2*T):P/B);return{x:i+L+z*K,y:r+F+D*K,r:K}}function xb(e,t,n){var i=e.x-t.x,r,c,o=e.y-t.y,u,h,m=i*i+o*o;m?(c=t.r+n.r,c*=c,h=e.r+n.r,h*=h,c>h?(r=(m+h-c)/(2*m),u=Math.sqrt(Math.max(0,h/m-r*r)),n.x=e.x-r*i-u*o,n.y=e.y-r*o+u*i):(r=(m+c-h)/(2*m),u=Math.sqrt(Math.max(0,c/m-r*r)),n.x=t.x+r*i-u*o,n.y=t.y+r*o+u*i)):(n.x=t.x+n.r,n.y=t.y)}function bb(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function _b(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,c=(t.y*n.r+n.y*t.r)/i;return r*r+c*c}function Iu(e){this._=e,this.next=null,this.previous=null}function b6(e,t){if(!(c=(e=m6(e)).length))return 0;var n,i,r,c,o,u,h,m,g,p,y;if(n=e[0],n.x=0,n.y=0,!(c>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(c>2))return n.r+i.r;xb(i,n,r=e[2]),n=new Iu(n),i=new Iu(i),r=new Iu(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(h=3;h<c;++h){xb(n._,i._,r=e[h]),r=new Iu(r),m=i.next,g=n.previous,p=i._.r,y=n._.r;do if(p<=y){if(bb(m._,r._)){i=m,n.next=i,i.previous=n,--h;continue e}p+=m._.r,m=m.next}else{if(bb(g._,r._)){n=g,n.next=i,i.previous=n,--h;continue e}y+=g._.r,g=g.previous}while(m!==g.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,o=_b(n);(r=r.next)!==i;)(u=_b(r))<o&&(n=r,o=u);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=g6(n,t),h=0;h<c;++h)n=e[h],n.x-=r.x,n.y-=r.y;return r.r}function _6(e){return Math.sqrt(e.value)}function S6(){var e=null,t=1,n=1,i=yb;function r(c){const o=h6();return c.x=t/2,c.y=n/2,e?c.eachBefore(Sb(e)).eachAfter(Lm(i,.5,o)).eachBefore(wb(1)):c.eachBefore(Sb(_6)).eachAfter(Lm(yb,1,o)).eachAfter(Lm(i,c.r/Math.min(t,n),o)).eachBefore(wb(Math.min(t,n)/(2*c.r))),c}return r.radius=function(c){return arguments.length?(e=o6(c),r):e},r.size=function(c){return arguments.length?(t=+c[0],n=+c[1],r):[t,n]},r.padding=function(c){return arguments.length?(i=typeof c=="function"?c:u6(+c),r):i},r}function Sb(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Lm(e,t,n){return function(i){if(r=i.children){var r,c,o=r.length,u=e(i)*t||0,h;if(u)for(c=0;c<o;++c)r[c].r+=u;if(h=b6(r,n),u)for(c=0;c<o;++c)r[c].r-=u;i.r=h+u}}}function wb(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}const w6=6;function N6(e,t){const{radiusOf:n,padding:i=w6}=t,r=S6().radius(u=>u.children?0:n(u.data.id));typeof i=="function"?r.padding(u=>i(u.depth)):r.padding(i);const c=r(kg(e)),o=new Map;return c.each(u=>{o.set(u.data.id,{x:u.x,y:u.y,r:u.r})}),o}function xp(e,t,n={}){var C,j,A;var i,r;const{iterations:c=300,springLength:o=160,springStrength:u=.04,repulsion:h=8e3,damping:m=.85,centerStrength:g=.005,collisionStrength:p=.3,nodeMargin:y}=n;if(e.length===0)return new Map;const x=L=>y!=null?y:L.width,_=(L,z)=>Math.max(o,(Math.hypot(L.width,L.height)+Math.hypot(z.width,z.height))/2*1.1+(x(L)+x(z))/2),S=new Map(e.map(L=>[L.id,0])),w=new Map(e.map(L=>[L.id,0])),N=new Map(e.map(L=>[L.id,{x:L.x,y:L.y}])),k=new Map(e.map(L=>[L.id,L]));for(let L=0;L<c;L++){for(let z=0;z<e.length;z++)for(let F=z+1;F<e.length;F++){const D=e[z],T=e[F];if(D.pinned&&T.pinned)continue;const B=N.get(D.id),P=N.get(T.id),K=P.x-B.x||.1,H=P.y-B.y||.1,q=Math.max(Math.hypot(K,H),1),$=h/(q*q),Q=K/q*$,G=H/q*$;D.pinned||(S.set(D.id,S.get(D.id)-Q),w.set(D.id,w.get(D.id)-G)),T.pinned||(S.set(T.id,S.get(T.id)+Q),w.set(T.id,w.get(T.id)+G));const W=D.width+x(D),O=T.width+x(T),se=D.height+x(D),ue=T.height+x(T),I=(W+O)/2-Math.abs(K),ie=(se+ue)/2-Math.abs(H);if(I>0&&ie>0){const ye=Math.min(I,ie)*p,xe=K/q*ye,Ce=H/q*ye;D.pinned||(S.set(D.id,S.get(D.id)-xe),w.set(D.id,w.get(D.id)-Ce)),T.pinned||(S.set(T.id,S.get(T.id)+xe),w.set(T.id,w.get(T.id)+Ce))}}for(const z of t){const F=k.get(z.source),D=k.get(z.target);if(!F||!D||F.pinned&&D.pinned)continue;const T=N.get(F.id),B=N.get(D.id),P=B.x-T.x||.1,K=B.y-T.y||.1,H=Math.max(Math.hypot(P,K),1),q=u*(H-_(F,D)),$=P/H*q,Q=K/H*q;F.pinned||(S.set(F.id,S.get(F.id)+$),w.set(F.id,w.get(F.id)+Q)),D.pinned||(S.set(D.id,S.get(D.id)-$),w.set(D.id,w.get(D.id)-Q))}for(const z of e){if(z.pinned)continue;const F=N.get(z.id),D=(C=(i=z.gravityTarget)==null?void 0:i.x)!=null?C:0,T=(j=(r=z.gravityTarget)==null?void 0:r.y)!=null?j:0,B=(A=z.gravityStrength)!=null?A:1,P=(S.get(z.id)-(F.x-D)*g*B)*m,K=(w.get(z.id)-(F.y-T)*g*B)*m;S.set(z.id,P),w.set(z.id,K),N.set(z.id,{x:F.x+P,y:F.y+K})}}return E6(e,t,N,S,w,k,{restLength:_,springStrength:u,damping:m}),N}const C6=40,j6=3,Rd=400,Nb=6;function E6(e,t,n,i,r,c,o){for(let u=0;u<C6;u++){jl(e,n);for(let h=0;h<j6;h++)k6(e,t,n,i,r,c,o)}for(let u=0;u<Rd&&jl(e,n);u++);}function jl(e,t){let n=!1;const i=new Map(e.map(r=>[r.id,{x:0,y:0}]));for(let r=0;r<e.length;r++)for(let c=r+1;c<e.length;c++){const o=e[r],u=e[c];if(o.pinned&&u.pinned)continue;const h=t.get(o.id),m=t.get(u.id),g=m.x-h.x,p=m.y-h.y,y=(o.width+u.width)/2-Math.abs(g),x=(o.height+u.height)/2-Math.abs(p);if(y<=0||x<=0)continue;n=!0;let _=0,S=0;y<x?_=(g>=0?1:-1)*y:S=(p>=0?1:-1)*x;let w=_/2,N=S/2;const k=Math.hypot(w,N);if(k>Nb){const C=Nb/k;w*=C,N*=C}o.pinned?(i.get(u.id).x+=w*2,i.get(u.id).y+=N*2):u.pinned?(i.get(o.id).x-=w*2,i.get(o.id).y-=N*2):(i.get(o.id).x-=w,i.get(o.id).y-=N,i.get(u.id).x+=w,i.get(u.id).y+=N)}for(const r of e){if(r.pinned)continue;const c=i.get(r.id);if(c.x===0&&c.y===0)continue;const o=t.get(r.id);t.set(r.id,{x:o.x+c.x,y:o.y+c.y})}return n}function k6(e,t,n,i,r,c,{restLength:o,springStrength:u,damping:h}){for(const m of t){const g=c.get(m.source),p=c.get(m.target);if(!g||!p||g.pinned&&p.pinned)continue;const y=n.get(g.id),x=n.get(p.id),_=x.x-y.x||.1,S=x.y-y.y||.1,w=Math.max(Math.hypot(_,S),1),N=u*(w-o(g,p)),k=_/w*N,C=S/w*N;g.pinned||(i.set(g.id,i.get(g.id)+k),r.set(g.id,r.get(g.id)+C)),p.pinned||(i.set(p.id,i.get(p.id)-k),r.set(p.id,r.get(p.id)-C))}for(const m of e){if(m.pinned)continue;const g=n.get(m.id),p=i.get(m.id)*h,y=r.get(m.id)*h;i.set(m.id,p),r.set(m.id,y),n.set(m.id,{x:g.x+p,y:g.y+y})}}const M6=1.2,T6=160,R6=160,A6=8e3,L6=8,D6=40,O6=.3,z6=1;function I6(e){const t=n=>n.children?n.children.reduce((i,r)=>i+t(r),0):1;return new Map(e.map(n=>[n.id,t(n)]))}function B6(e){const t=new Map,n=(i,r)=>{if(!i.children){t.set(i.id,r);return}for(const c of i.children)n(c,r)};for(const i of e)n(i,i.id);return t}function U6(e,t,n={}){var B,P,K,H,q,$,Q,G;var i,r,c,o,u,h;if(e.length===0)return{positions:new Map,clusterBoundaries:new Map};const m=new Map(e.map(W=>[W.id,W])),g=H4(e.map(W=>W.id),t),p=W=>{const O=m.get(W);return O?Math.hypot(O.width,O.height)/2:20},y=N6(g,{radiusOf:p,padding:n.clusterPadding}),x=(B=g.children)!=null?B:[],_=B6(x),S=x.map(W=>{const O=y.get(W.id);return{id:W.id,x:O.x,y:O.y,width:O.r*2,height:O.r*2}}),w=new Map,N=[];for(const W of t){const O=_.get(W.source),se=_.get(W.target);if(!O||!se||O===se)continue;const ue=O<se?`${O}\0${se}`:`${se}\0${O}`,I=(P=w.get(ue))!=null?P:0;I>=L6||(w.set(ue,I+1),N.push({source:O,target:se}))}const k=S.reduce((W,O)=>Math.max(W,O.width),0),C=(K=(i=n.macro)==null?void 0:i.springLength)!=null?K:Math.max(k*M6,T6),j=Nu(C/R6,2),A={iterations:(H=(r=n.macro)==null?void 0:r.iterations)!=null?H:300,springLength:C,springStrength:(q=(c=n.macro)==null?void 0:c.springStrength)!=null?q:.04,repulsion:($=(o=n.macro)==null?void 0:o.repulsion)!=null?$:A6*j,damping:(Q=(u=n.macro)==null?void 0:u.damping)!=null?Q:.85,centerStrength:(G=(h=n.macro)==null?void 0:h.centerStrength)!=null?G:.005},L=S.length>0?xp(S,N,A):new Map,z=I6(x),F=e.map(W=>{var Pe;const O=_.get(W.id),se=O?L.get(O):void 0,ue=y.get(W.id),I=O?y.get(O):void 0,ie=se!=null?se:{x:0,y:0},ye=ue&&I?ue.x-I.x:0,xe=ue&&I?ue.y-I.y:0,Ce=O&&(Pe=z.get(O))!=null?Pe:1,Se=Math.min(z6,Math.max(O6,Ce/D6));return V(R({},W),{x:W.pinned?W.x:ie.x+ye,y:W.pinned?W.y:ie.y+xe,gravityTarget:ie,gravityStrength:Se})}),D=xp(F,t,n),T=qo(e,D,_,p);return{positions:D,clusterBoundaries:T}}function qo(e,t,n,i,r=!1){const c=new Map;for(const u of e){const h=n.get(u.id);h&&(c.has(h)||c.set(h,[]),c.get(h).push(u))}const o=new Map;for(const[u,h]of c){let m,g;const p=r?t.get(u):void 0;if(p)m=p.x,g=p.y;else{m=0,g=0;for(const x of h){const _=t.get(x.id);_&&(m+=_.x,g+=_.y)}m/=h.length,g/=h.length}let y=0;for(const x of h){const _=t.get(x.id);_&&(y=Math.max(y,Math.hypot(_.x-m,_.y-g)+i(x.id)))}o.set(u,{x:m,y:g,r:y})}return o}function Mg(e,t){const n=new Set(e),i=new Map,r=new Map;for(const h of t){if(!h.structural||h.source===h.target||!n.has(h.source)||!n.has(h.target)||i.has(h.target))continue;i.set(h.target,h.source);const m=r.get(h.source);m?m.push(h.target):r.set(h.source,[h.target])}const c=e.filter(h=>!i.has(h)),o=new Set,u=h=>{var m;if(!o.has(h)){o.add(h);for(const g of(m=r.get(h))!=null?m:[])u(g)}};c.forEach(u);for(const h of e){if(o.has(h))continue;const m=i.get(h);if(m!==void 0){i.delete(h);const g=r.get(m);g&&r.set(m,g.filter(p=>p!==h))}c.push(h),u(h)}return{parentOf:i,childrenOf:r,roots:c}}function F6(e,t){return e.flatMap(n=>{const i=t.get(n);return i&&i.length>1?i:[n]})}function bp(e,t){var c,o;const n=new Set,i=[...(c=t.get(e))!=null?c:[]];let r=0;for(;r<i.length;){const u=i[r++];n.has(u)||(n.add(u),i.push(...(o=t.get(u))!=null?o:[]))}return n}function Vo(e,t){var n;const i=F6(e,t),r=new Map;for(const c of i){r.set(c,c);for(const o of bp(c,t))r.set(o,c)}for(const c of e){if(r.has(c))continue;const o=(n=t.get(c))==null?void 0:n[0],u=o!==void 0?r.get(o):void 0;u!==void 0&&r.set(c,u)}return{groupHeads:i,leafToGroup:r}}function H6(e,t,n,i,r,c){const o=u=>{var p;const h=(p=t.get(u))!=null?p:[];if(h.length===0)return 0;const m=i(e.get(u));let g=0;for(const y of h){const x=i(e.get(y)),_=m+x*r;g=Math.max(g,_+o(y))}return g};return(u,h)=>{const m=new Map,g=(x,_)=>({x:x*u*Math.cos(_),y:x*h*Math.sin(_)}),p=(x,_,S,w,N)=>{var D;const k=e.get(x),C=k.pinned&&k.x!==void 0&&k.y!==void 0,j=C?k.x:_,A=C?k.y:S;m.set(x,{x:j,y:A});const L=(D=t.get(x))!=null?D:[],z=L.length;if(z===0)return;const F=i(k);L.forEach((T,B)=>{const P=i(e.get(T)),K=F+P*r,H=z%2===0&&N>0?Math.PI/z:0,q=w+2*Math.PI*B/z+H,$=g(K,q);p(T,j+$.x,A+$.y,q,N+1)})},y=n.length;return n.forEach((x,_)=>{const S=i(e.get(x))*r+o(x),w=c+2*Math.PI*_/y,N=g(S,w);p(x,N.x,N.y,w,0)}),m}}function Cb(e,t,n){let i=1/0,r=-1/0,c=1/0,o=-1/0;for(const[m,g]of e){const p=n(t.get(m));i=Math.min(i,g.x-p),r=Math.max(r,g.x+p),c=Math.min(c,g.y-p),o=Math.max(o,g.y+p)}const u=r-i||1,h=o-c||1;return{width:u,height:h,ratio:u/h,area:u*h}}function Tg(e,t,n={}){const{aspectRatio:i}=n;if(i===void 0||i===1||!Number.isFinite(i)||e.length===0)return{x:1,y:1};const r=new Map(e.map(S=>[S.id,S])),c=S=>Math.hypot(S.width,S.height)/2,o=tc(e,t,void 0,V(R({},n),{resolvedAspectScale:{x:1,y:1}})),u=Cb(o,r,c),h=Math.min(8,Math.max(1/8,i)),m=Math.min(8,Math.max(1/8,h/u.ratio)),g=2,p=S=>{const w=Math.pow(m,S),N=tc(e,t,void 0,V(R({},n),{resolvedAspectScale:{x:w,y:1/w}}));return Cb(N,r,c).area/u.area};let y=0,x=1;for(let S=0;S<6;S++){const w=(y+x)/2;p(w)<=g?y=w:x=w}const _=Math.pow(m,y);return{x:_,y:1/_}}function tc(e,t,n,i={}){var F;const{nodeSpread:r=3.2,startAngle:c=-Math.PI/2,homeStrength:o=.18,nodeMargin:u,separateGroups:h=!0,resolvedAspectScale:m}=i;if(e.length===0)return new Map;const g=new Map(e.map(D=>[D.id,D])),p=D=>Math.hypot(D.width,D.height)/2,{childrenOf:y,roots:x}=Mg(e.map(D=>D.id),t),_=H6(g,y,x,p,r,c),{groupHeads:S,leafToGroup:w}=h?Vo(x,y):{groupHeads:[],leafToGroup:new Map},N=m!=null?m:Tg(e,t,i),k=_(N.x,N.y),C=h?_p(g,S,w,k):k,j=new Map;for(const D of e)D.pinned&&D.x!==void 0&&D.y!==void 0?j.set(D.id,{x:D.x,y:D.y}):j.set(D.id,(F=n==null?void 0:n.get(D.id))!=null?F:C.get(D.id));const A=e.map(D=>({id:D.id,width:D.width,height:D.height,pinned:D.pinned,x:0,y:0})),L=u!=null?u:0,z=L===0?A:e.map(D=>({id:D.id,width:D.width+L,height:D.height+L,pinned:D.pinned,x:0,y:0}));jl(z,j);for(const D of e){if(D.pinned)continue;const T=j.get(D.id),B=C.get(D.id);j.set(D.id,{x:T.x+(B.x-T.x)*o,y:T.y+(B.y-T.y)*o})}if(h&&S.length>1){const D=new Set;for(const T of e){if(!T.pinned||T.x===void 0||T.y===void 0)continue;const B=w.get(T.id);B&&D.add(B)}if(D.size>0)return _p(g,S,w,j,D)}return j}function jb(e,t,n={}){const{settleCycles:i=24,separateGroups:r=!0}=n;if(e.length===0)return new Map;const c=Tg(e,t,n),o=V(R({},n),{resolvedAspectScale:c});let u;for(let m=0;m<i;m++)u=tc(e,t,u,o);u||(u=tc(e,t,void 0,o));const h=e.map(m=>({id:m.id,width:m.width,height:m.height,pinned:m.pinned,x:0,y:0}));for(let m=0;m<Rd&&jl(h,u);m++);return r&&(u=P6(e,t,u)),u}function _p(e,t,n,i,r){if(t.length<=1)return i;const c=p=>{const y=e.get(p);return y?Math.hypot(y.width,y.height)/2:20},o=[...e.values()].map(p=>({id:p.id,width:p.width,height:p.height,x:0,y:0})),u=qo(o,i,n,c,!0),h=[...u.entries()].map(([p,y])=>({id:p,x:0,y:0,width:y.r*2,height:y.r*2,pinned:r==null?void 0:r.has(p)})),m=new Map([...u.entries()].map(([p,y])=>[p,{x:y.x,y:y.y}]));for(let p=0;p<Rd&&jl(h,m);p++);const g=new Map(i);for(const[p,y]of u){const x=m.get(p),_=x.x-y.x,S=x.y-y.y;if(!(_===0&&S===0))for(const[w,N]of n){if(N!==p)continue;const k=g.get(w);k&&g.set(w,{x:k.x+_,y:k.y+S})}}return g}function P6(e,t,n){const{childrenOf:i,roots:r}=Mg(e.map(p=>p.id),t),c=new Map(e.map(p=>[p.id,p])),{groupHeads:o,leafToGroup:u}=Vo(r,i),h=new Set;for(const p of e){if(!p.pinned||p.x===void 0||p.y===void 0)continue;const y=u.get(p.id);y&&h.add(y)}const m=_p(c,o,u,n,h.size>0?h:void 0);if(m===n)return n;const g=e.map(p=>({id:p.id,width:p.width,height:p.height,pinned:p.pinned,x:0,y:0}));for(let p=0;p<Rd&&jl(g,m);p++);return m}const $6=.25,q6=4,Eb=.1,Bu=20,kb=.95,Mb=.1,V6=.002,G6=.05,Y6=1,K6=10;function X6(e){const t=e.deltaMode===1?G6:e.deltaMode===2?Y6:V6,n=e.ctrlKey?K6:1;return Math.pow(2,-e.deltaY*t*n)}function Tb(e,t,n,i,r){const c=i/n;return{x:e-c*(e-r.x),y:t-c*(t-r.y)}}function Q6(){return typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Lw({minZoom:e=$6,maxZoom:t=q6,bounds:n,onViewportChange:i,containerRef:r,locked:c=!1}){const[o,u]=M.useState(1),[h,m]=M.useState({x:0,y:0}),g=M.useRef(1),p=M.useRef({x:0,y:0}),y=M.useRef(c);M.useEffect(()=>{y.current=c},[c]);const x=M.useRef(null),_=M.useRef(!1),S=M.useRef(),w=M.useRef(),N=M.useRef(null),k=M.useRef(null),C=M.useRef(null),j=M.useRef(null);M.useEffect(()=>{g.current=o},[o]),M.useEffect(()=>{p.current=h},[h]),M.useEffect(()=>{i==null||i({x:h.x,y:h.y,zoom:o})},[h,o,i]);const A=M.useCallback((G,W)=>{if(!n)return{x:G,y:W};const O=-n.maxX*g.current,se=-n.minX*g.current,ue=-n.maxY*g.current,I=-n.minY*g.current;return{x:Math.max(O,Math.min(se,G)),y:Math.max(ue,Math.min(I,W))}},[n]),L=M.useCallback(G=>{var W;(W=S.current)==null||W.call(S,G)},[]),z=M.useCallback(()=>{var G;(G=w.current)==null||G.call(w)},[]),F=M.useCallback(()=>{_.current||(document.addEventListener("pointermove",L),document.addEventListener("pointerup",z),_.current=!0)},[L,z]),D=M.useCallback(()=>{_.current&&(document.removeEventListener("pointermove",L),document.removeEventListener("pointerup",z),_.current=!1)},[L,z]),T=M.useCallback(G=>{if(!x.current)return;const W=G.clientX-x.current.lastX,O=G.clientY-x.current.lastY,se=performance.now(),ue=Math.max(1,se-x.current.time)/1e3;x.current.vx=W/ue,x.current.vy=O/ue,x.current.time=se,x.current.lastX=G.clientX,x.current.lastY=G.clientY,N.current!==null&&cancelAnimationFrame(N.current),N.current=requestAnimationFrame(()=>{if(!x.current)return;const I=A(x.current.panX+(G.clientX-x.current.x),x.current.panY+(G.clientY-x.current.y));m(I),N.current=null})},[A]),B=M.useCallback(()=>{if(!x.current){D();return}const G=Q6(),W=x.current.vx,O=x.current.vy,se=Math.sqrt(W*W+O*O);if(x.current=null,D(),G||se<Mb)return;let ue=W,I=O,ie=p.current,ye=performance.now();const xe=()=>{const Ce=performance.now(),Se=(Ce-ye)/1e3;if(ye=Ce,ue*=Math.pow(kb,Se*60),I*=Math.pow(kb,Se*60),Math.sqrt(ue*ue+I*I)<Mb){j.current=null;return}ie=A(ie.x+ue*Se,ie.y+I*Se),m(ie),j.current=requestAnimationFrame(xe)};j.current=requestAnimationFrame(xe)},[D,A]),P=M.useCallback(G=>{y.current||(j.current!==null&&(cancelAnimationFrame(j.current),j.current=null),x.current={x:G.clientX,y:G.clientY,lastX:G.clientX,lastY:G.clientY,panX:p.current.x,panY:p.current.y,vx:0,vy:0,time:performance.now()},F())},[F]);M.useEffect(()=>{S.current=T},[T]),M.useEffect(()=>{w.current=B},[B]),M.useEffect(()=>()=>{D(),N.current!==null&&cancelAnimationFrame(N.current),k.current!==null&&cancelAnimationFrame(k.current),C.current!==null&&cancelAnimationFrame(C.current),j.current!==null&&cancelAnimationFrame(j.current)},[D]);const K=M.useCallback(G=>{if(y.current)return;G.preventDefault();const W=G.currentTarget.getBoundingClientRect(),O=G.clientX-W.left,se=G.clientY-W.top;if(!Number.isFinite(O)||!Number.isFinite(se))return;const ue=g.current,I=Math.min(t,Math.max(e,ue*X6(G))),ie=Tb(O,se,ue,I,p.current),ye=A(ie.x,ie.y);k.current!==null&&cancelAnimationFrame(k.current),k.current=requestAnimationFrame(()=>{u(I),m(ye),k.current=null})},[A,e,t]);M.useEffect(()=>{const G=r.current;if(G)return G.addEventListener("wheel",K,{passive:!1}),()=>G.removeEventListener("wheel",K)},[r,K]);const H=M.useCallback(G=>{if(y.current)return;const W=G.key;let O=null,se=null;W==="+"||W==="="?(G.preventDefault(),O=Math.min(t,g.current+Eb)):W==="-"||W==="_"?(G.preventDefault(),O=Math.max(e,g.current-Eb)):W==="ArrowUp"?(G.preventDefault(),se=A(p.current.x,p.current.y+Bu)):W==="ArrowDown"?(G.preventDefault(),se=A(p.current.x,p.current.y-Bu)):W==="ArrowLeft"?(G.preventDefault(),se=A(p.current.x+Bu,p.current.y)):W==="ArrowRight"&&(G.preventDefault(),se=A(p.current.x-Bu,p.current.y)),(O!==null||se!==null)&&(C.current!==null&&cancelAnimationFrame(C.current),C.current=requestAnimationFrame(()=>{O!==null&&u(O),se!==null&&m(se),C.current=null}))},[A,e,t]),q=M.useCallback((G,W,O)=>{const se=Math.min(t,Math.max(e,G)),ue=g.current;if(u(se),W!==void 0&&O!==void 0){const I=Tb(W,O,ue,se,p.current);m(A(I.x,I.y))}},[A,e,t]),$=M.useCallback((G,W)=>{const O=A(G,W);m(O)},[A]),Q=M.useCallback(()=>{u(1),m({x:0,y:0})},[]);return{transform:`matrix(${o}, 0, 0, ${o}, ${h.x}, ${h.y})`,viewport:{x:h.x,y:h.y,zoom:o},bind:{onPointerDown:P,onKeyDown:H,tabIndex:0,role:"region"},zoomTo:q,panTo:$,reset:Q}}const Z6=.15,J6=30;function W6({active:e,nodes:t,edges:n,options:i,onTick:r,initialPositions:c}){const o=M.useRef({nodes:t,edges:n,options:i}),u=M.useRef(r),h=M.useRef(void 0),m=M.useRef(null),g=M.useRef(0);M.useEffect(()=>{o.current={nodes:t,edges:n,options:i}},[t,n,i]),M.useEffect(()=>{u.current=r},[r]);const p=M.useCallback(()=>{const{nodes:_,edges:S,options:w}=o.current,N=h.current,k=tc(_,S,N,w);let C=0;if(N)for(const[j,A]of k){const L=N.get(j);if(!L)continue;const z=Math.hypot(A.x-L.x,A.y-L.y);z>C&&(C=z)}else C=1/0;if(h.current=k,u.current(k),g.current=C<Z6?g.current+1:0,g.current>=J6){m.current=null;return}m.current=requestAnimationFrame(p)},[]),y=M.useCallback(()=>{g.current=0,m.current===null&&e&&(m.current=requestAnimationFrame(p))},[e,p]),x=M.useRef(null);return M.useEffect(()=>{const _=t.map(w=>w.id).sort().join(" "),S=x.current!==null&&x.current!==_;x.current=_,S&&y()},[t,y]),M.useEffect(()=>{if(!e){m.current!==null&&(cancelAnimationFrame(m.current),m.current=null);return}return h.current=c&&c.size>0?new Map(c):void 0,g.current=0,m.current=requestAnimationFrame(p),()=>{m.current!==null&&(cancelAnimationFrame(m.current),m.current=null)}},[e]),{wake:y}}const Dw=M.createContext(null);function Rg(){const e=M.useContext(Dw);if(!e)throw new Error("useGraphCanvas must be used within a GraphCanvas");return e}const Ow=re.forwardRef((_,x)=>{var S=_,{id:e,label:t,kind:n,domainColor:i="default",selected:r=!1,onSelect:c,hasChildren:o=!1,collapsed:u=!1,hiddenDescendantCount:h=0,onToggleCollapse:m,className:g="",style:p}=S,y=pe(S,["id","label","kind","domainColor","selected","onSelect","hasChildren","collapsed","hiddenDescendantCount","onToggleCollapse","className","style"]);const w=["graph-node",r&&"selected",g].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:x,className:w,"data-domain":i,"data-kind":n,onClick:N=>{N.stopPropagation(),c==null||c(e)},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),N.stopPropagation(),c==null||c(e))},role:c?"button":void 0,tabIndex:c?0:void 0,"aria-pressed":c?r:void 0},y),{children:[d.jsx("span",{className:"graph-node__swatch"}),d.jsx("span",{className:"graph-node__label",children:t}),n&&d.jsx("span",{className:"graph-node__kind",children:n}),o&&m&&d.jsxs("button",{type:"button",className:"graph-node__collapse-toggle","aria-label":u?"Expand":"Collapse","aria-expanded":!u,onClick:N=>{N.stopPropagation(),m()},children:[u&&h>0&&d.jsx("span",{className:"graph-node__hidden-badge",children:h}),d.jsx(Ee,{name:u?"chevronRight":"chevronDown",size:12})]})]}))});Ow.displayName="GraphNode";const Rb=1,e5=8,t5=20,n5={default:1.25,hot:1.75,irrelevant:1.25},Dm={default:7,hot:8,irrelevant:7};function a5(e){const t=Number.isFinite(e)?e:0,n=Math.min(100,Math.max(0,t)),i=e5-Rb;return Rb+i*Math.sqrt(n/100)}function i5(e,t,n){return Math.min(e*(n/t),t5)}function s5(e){return Array.isArray(e)?`${e[0]} ${e[1]}`:`${e} ${e}`}function Ag({id:e,d:t,mid:n,label:i,variant:r,weight:c,opacity:o,strokeDash:u,detailedTestIds:h=!1,onSelect:m}){const g=`arrow-${e}`,p=`arrow-rose-${e}`,y=`arrow-cyan-${e}`,x=r==="hot"?`url(#${y})`:r==="irrelevant"?`url(#${p})`:`url(#${g})`,_=c!==void 0?a5(c):void 0,S=n5[r],w=D=>_!==void 0?i5(D,S,_):D,N=_!==void 0?"userSpaceOnUse":void 0,k={};_!==void 0&&(k.strokeWidth=_),o!==void 0&&(k.opacity=o),u!==void 0&&(k.strokeDasharray=s5(u));const C=o!==void 0?{opacity:o}:void 0,j=w(Dm.default),A=w(Dm.irrelevant),L=w(Dm.hot),z=m?D=>{D.stopPropagation(),m(e)}:void 0,F=i?Eg(i):null;return d.jsxs(d.Fragment,{children:[d.jsxs("defs",{children:[d.jsx("marker",{id:g,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:j,markerHeight:j,markerUnits:N,orient:"auto-start-reverse",children:d.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"var(--graph-edge-strong, #94a3b8)",style:C})}),d.jsx("marker",{id:p,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:A,markerHeight:A,markerUnits:N,orient:"auto-start-reverse",children:d.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"rgb(var(--status-rose))",style:C})}),d.jsx("marker",{id:y,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:L,markerHeight:L,markerUnits:N,orient:"auto-start-reverse",children:d.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"rgb(var(--accent-primary))",style:C})})]}),d.jsx("path",{className:"graph-edge__hit",d:t,onClick:z,"data-testid":h?`graph-edge-hit-${e}`:void 0}),d.jsx("path",{className:"graph-edge__line",d:t,markerEnd:x,style:Object.keys(k).length?k:void 0,"data-testid":h?`graph-edge-line-${e}`:void 0}),i&&F&&d.jsxs("g",{className:m?"graph-edge__label graph-edge__label--clickable":"graph-edge__label",transform:`translate(${n.x-F.width/2}, ${n.y-F.height/2})`,onClick:z,children:[d.jsx("rect",{width:F.width,height:F.height,rx:"3",className:"graph-edge__label-bg","data-testid":h?`graph-edge-label-bg-${e}`:void 0}),d.jsx("text",{x:F.width/2,y:F.height/2+3,className:"graph-edge__label-text","data-testid":h?`graph-edge-label-text-${e}`:void 0,children:i})]})]})}Ag.displayName="GraphEdgeShape";const Ab=1.3,zw=re.forwardRef((r,i)=>{var c=r,{position:e="bottom-right",className:t=""}=c,n=pe(c,["position","className"]);const{zoomBy:o,zoomToFit:u,locked:h,setLocked:m,isFullscreen:g,toggleFullscreen:p,layout:y,liveSimulation:x,setLiveSimulation:_}=Rg(),S=M.useCallback(()=>o(Ab),[o]),w=M.useCallback(()=>o(1/Ab),[o]),N=M.useCallback(()=>u(),[u]),k=M.useCallback(()=>m(A=>!A),[m]),C=M.useCallback(()=>_(A=>!A),[_]),j=["graph-toolbar",`graph-toolbar--${e}`,t].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:i,className:j,"data-no-drag":!0},n),{children:[d.jsx("button",{type:"button",className:"graph-toolbar__btn",onClick:S,"aria-label":"Zoom in",children:d.jsx(Ee,{name:"zoomIn",size:16})}),d.jsx("button",{type:"button",className:"graph-toolbar__btn",onClick:w,"aria-label":"Zoom out",children:d.jsx(Ee,{name:"zoomOut",size:16})}),d.jsx("button",{type:"button",className:"graph-toolbar__btn",onClick:N,"aria-label":"Zoom to fit",children:d.jsx(Ee,{name:"maximize",size:16})}),d.jsx("div",{className:"graph-toolbar__divider"}),d.jsx("button",{type:"button",className:"graph-toolbar__btn",onClick:k,"aria-pressed":h,"aria-label":h?"Unlock pan and zoom":"Lock pan and zoom",children:d.jsx(Ee,{name:h?"lock":"unlock",size:16})}),d.jsx("div",{className:"graph-toolbar__divider"}),d.jsx("button",{type:"button",className:"graph-toolbar__btn",onClick:p,"aria-pressed":g,"aria-label":g?"Exit fullscreen":"Fullscreen",children:d.jsx(Ee,{name:g?"fullscreenExit":"fullscreen",size:16})}),y==="galaxy"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"graph-toolbar__divider"}),d.jsx("button",{type:"button",className:"graph-toolbar__btn",onClick:C,"aria-pressed":x,"aria-label":x?"Disable live simulation":"Enable live simulation",children:d.jsx(Ee,{name:"orbit",size:16})})]})]}))});zw.displayName="GraphToolbar";const Si=138,wi=30,r5=.05,l5=8,Lb=3,o5=6;function c5({id:e,sourceId:t,targetId:n,label:i,variant:r="default",weight:c,opacity:o,strokeDash:u,sourceAnchor:h,targetAnchor:m,curvature:g,selected:p,onSelect:y}){const{getNodeRect:x,nodeRects:_}=Rg(),S=M.useMemo(()=>{const k=x(t),C=x(n);if(!k||!C)return null;const j=Mw(k,C,{sourceAnchor:h,targetAnchor:m,curvature:g}),A=i?Tw(j.points,Eg(i),_,o5):j.mid;return V(R({},j),{labelPos:A})},[x,t,n,h,m,g,i,_]);if(!S)return null;const w=["graph-edge",r!=="default"&&`graph-edge--${r}`,p&&"selected"].filter(Boolean).join(" "),N=!!y;return d.jsx("g",{className:w,role:N?"button":"presentation","aria-hidden":N?void 0:!0,"aria-pressed":N?!!p:void 0,"aria-label":N?i?`${i}: ${t} to ${n}`:`${t} to ${n}`:void 0,tabIndex:N?0:void 0,onKeyDown:N?k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),y(e))}:void 0,"data-testid":`graph-edge-${e}`,children:d.jsx(Ag,{id:e,d:S.d,mid:S.labelPos,label:i,variant:r,weight:c,opacity:o,strokeDash:u,onSelect:y})})}const Iw=re.forwardRef((P,B)=>{var K=P,{nodes:e=[],edges:t=[],selectedNodeId:n,onNodeSelect:i,centerOnSelect:r=!1,renderNode:c,layout:o="manual",nodeMargin:u,showClusterBoundaries:h=!0,isStructuralEdge:m,showAllRelations:g=!1,collapsedNodeIds:p,onToggleCollapse:y,fitView:x=!1,fitPadding:_=40,minZoom:S=r5,maxZoom:w=l5,selectedEdgeId:N,onEdgeSelect:k,onBackgroundClick:C,draggable:j=!0,onNodeDragEnd:A,showToolbar:L=!0,toolbarPosition:z="bottom-right",fullscreenContainerRef:F,className:D=""}=K,T=pe(K,["nodes","edges","selectedNodeId","onNodeSelect","centerOnSelect","renderNode","layout","nodeMargin","showClusterBoundaries","isStructuralEdge","showAllRelations","collapsedNodeIds","onToggleCollapse","fitView","fitPadding","minZoom","maxZoom","selectedEdgeId","onEdgeSelect","onBackgroundClick","draggable","onNodeDragEnd","showToolbar","toolbarPosition","fullscreenContainerRef","className"]);const[H,q]=M.useState(new Map),[$,Q]=M.useState(new Map),[G,W]=M.useState(),[O,se]=M.useState(new Map),ue=M.useRef(null),I=M.useCallback(J=>{var _e;const he=ue.current;if(he){if(he.dragging){if(J){const Ae=he.target,tt=ht=>{ht.stopPropagation(),ht.preventDefault()};Ae.addEventListener("click",tt,{capture:!0,once:!0})}const ze=(_e=O.get(he.id))!=null?_e:{x:he.startX,y:he.startY};A==null||A(he.id,ze)}ue.current=null}},[O,A]),ie=M.useRef(I);M.useEffect(()=>{ie.current=I},[I]);const ye=M.useMemo(()=>e.map(J=>J.id).sort().join(" "),[e]),xe=M.useRef(!1);M.useEffect(()=>{if(!xe.current){xe.current=!0;return}const J=ue.current;if(J!=null&&J.dragging)try{J.target.releasePointerCapture(J.pointerId)}catch(he){he instanceof DOMException||console.warn("GraphCanvas: releasePointerCapture failed",he)}ie.current(!1),se(new Map)},[ye]);const[Ce,Se]=M.useState(!1),[Pe,vt]=M.useState(!1),mt=M.useRef(!1),Ut=M.useRef(null),[rt,$e]=M.useState(!1),Ue=rt&&o==="galaxy",xt=M.useRef(Ue);M.useEffect(()=>{xt.current=Ue},[Ue]);const ke=M.useMemo(()=>{const J=t.map(he=>({source:he.sourceId,target:he.targetId,structural:m?m(he):!0}));return Mg(e.map(he=>he.id),J)},[e,t,m]),ft=M.useMemo(()=>{if(!p||p.size===0)return new Set;const J=new Set;for(const he of p)for(const _e of bp(he,ke.childrenOf))J.add(_e);return J},[p,ke]),Me=M.useMemo(()=>ft.size===0?e:e.filter(J=>!ft.has(J.id)),[e,ft]),[$n,yn]=M.useState(new Map),wn=M.useRef(null),Ca=M.useRef({}),Rt=M.useRef(!1),[za,ce]=M.useState(!1),[de,Oe]=M.useState(null),nt=M.useRef(null),Te=M.useMemo(()=>{if(!(o!=="galaxy"||!de||de.height===0))return Math.round(de.width/de.height*20)/20},[o,de]),_t=M.useRef(Te);M.useEffect(()=>{_t.current=Te});const{transform:Et,viewport:Ie,bind:pt,panTo:Xe,zoomTo:Je}=Lw({minZoom:S,maxZoom:w,containerRef:wn,locked:Ce}),Nn=M.useRef(null),ln=M.useCallback(J=>{if(J.target instanceof Element&&J.target.closest(".graph-node, .graph-edge, [data-no-drag]")){Nn.current=null;return}Nn.current={x:J.clientX,y:J.clientY},pt.onPointerDown(J)},[pt]),_r=M.useCallback(J=>{const he=Nn.current;Nn.current=null,!(!he||!C)&&Math.hypot(J.clientX-he.x,J.clientY-he.y)<Lb&&C()},[C]),ei=`grid${M.useId().replace(/:/g,"")}`;M.useLayoutEffect(()=>{const J=new Map;for(const he of Me){const _e=Ca.current[he.id];J.set(he.id,{width:(_e==null?void 0:_e.offsetWidth)||Si,height:(_e==null?void 0:_e.offsetHeight)||wi})}q(J)},[Me,c]),M.useEffect(()=>{if(o!=="force"&&o!=="galaxy"&&o!=="force-clustered"||H.size===0||o==="galaxy"&&xt.current)return;const J=Me.map((he,_e)=>{var tt,ht,Ft,tn;var ze,Ae;return{id:he.id,x:(tt=he.x)!=null?tt:Math.cos(2*Math.PI*_e/Me.length)*120,y:(ht=he.y)!=null?ht:Math.sin(2*Math.PI*_e/Me.length)*120,width:(Ft=(ze=H.get(he.id))==null?void 0:ze.width)!=null?Ft:Si,height:(tn=(Ae=H.get(he.id))==null?void 0:Ae.height)!=null?tn:wi,pinned:he.x!==void 0&&he.y!==void 0}});if(o==="force"){const he=(t!=null?t:[]).map(_e=>({source:_e.sourceId,target:_e.targetId}));Q(xp(J,he,{nodeMargin:u})),yn(new Map)}else if(o==="force-clustered"){const he=(t!=null?t:[]).map(Ae=>({source:Ae.sourceId,target:Ae.targetId})),{positions:_e,clusterBoundaries:ze}=U6(J,he,{nodeMargin:u});Q(_e),yn(ze)}else{const he=(t!=null?t:[]).map(Ae=>({source:Ae.sourceId,target:Ae.targetId,structural:m?m(Ae):!0})),_e=jb(J,he,{nodeMargin:u,aspectRatio:_t.current});Q(_e);const{leafToGroup:ze}=Vo(ke.roots,ke.childrenOf);yn(qo(J,_e,ze,Ae=>{const tt=H.get(Ae);return tt?Math.hypot(tt.width,tt.height)/2:20},!0))}},[Me,t,H,o,u,m,ke]);const Ia=M.useCallback(()=>Me.map(J=>{var ht,Ft,tn,Oi;var he,_e;const ze=O.get(J.id),Ae=(ht=ze==null?void 0:ze.x)!=null?ht:J.x,tt=(Ft=ze==null?void 0:ze.y)!=null?Ft:J.y;return{id:J.id,width:(tn=(he=H.get(J.id))==null?void 0:he.width)!=null?tn:Si,height:(Oi=(_e=H.get(J.id))==null?void 0:_e.height)!=null?Oi:wi,x:Ae,y:tt,pinned:Ae!==void 0&&tt!==void 0}}),[Me,H,O]),ti=M.useMemo(()=>Ue?Ia():[],[Ue,Ia]),en=M.useMemo(()=>Ue?(t!=null?t:[]).map(J=>({source:J.sourceId,target:J.targetId,structural:m?m(J):!0})):[],[Ue,t,m]),sa=M.useMemo(()=>Ue?Me.map(J=>{var ze,Ae;var he,_e;return{id:J.id,width:(ze=(he=H.get(J.id))==null?void 0:he.width)!=null?ze:Si,height:(Ae=(_e=H.get(J.id))==null?void 0:_e.height)!=null?Ae:wi}}):[],[Ue,Me,H]),Mn=M.useMemo(()=>{if(!(!Ue||Te===void 0))return Tg(sa,en,{nodeMargin:u,aspectRatio:Te})},[Ue,sa,en,u,Te]),Ba=M.useMemo(()=>Ue?Vo(ke.roots,ke.childrenOf).leafToGroup:null,[Ue,ke]),Li=M.useCallback(J=>{if(Q(J),!h||!Ba)return;const he=Me.map(_e=>{var tt,ht;var ze,Ae;return{id:_e.id,width:(tt=(ze=H.get(_e.id))==null?void 0:ze.width)!=null?tt:Si,height:(ht=(Ae=H.get(_e.id))==null?void 0:Ae.height)!=null?ht:wi,x:0,y:0}});yn(qo(he,J,Ba,_e=>{const ze=H.get(_e);return ze?Math.hypot(ze.width,ze.height)/2:20},!0))},[h,Ba,Me,H]),{wake:ni}=W6({active:Ue,nodes:ti,edges:en,options:{nodeMargin:u,aspectRatio:Te,resolvedAspectScale:Mn},onTick:Li,initialPositions:$});M.useEffect(()=>{const J=wn.current;if(!J)return;const he=new ResizeObserver(_e=>{const{width:ze,height:Ae}=_e[0].contentRect;ze>0&&Ae>0&&Oe({width:ze,height:Ae})});return he.observe(J),()=>he.disconnect()},[]),M.useEffect(()=>{const J=()=>{var ze;const he=(ze=F==null?void 0:F.current)!=null?ze:wn.current,_e=document.fullscreenElement===he;vt(_e),Ut.current!==null&&(clearTimeout(Ut.current),Ut.current=null),_e?(mt.current=!0,Ut.current=setTimeout(()=>{mt.current=!1,Ut.current=null},500)):mt.current=!1};return document.addEventListener("fullscreenchange",J),()=>{document.removeEventListener("fullscreenchange",J),Ut.current!==null&&clearTimeout(Ut.current)}},[F]);const Ua=M.useCallback(()=>{var tt;var J,he,_e,ze;const Ae=(tt=F==null?void 0:F.current)!=null?tt:wn.current;document.fullscreenElement===Ae?(he=(J=document.exitFullscreen)==null?void 0:J.call(document))==null||he.catch(ht=>{console.warn("GraphCanvas: exitFullscreen() was rejected",ht)}):(ze=(_e=Ae==null?void 0:Ae.requestFullscreen)==null?void 0:_e.call(Ae))==null||ze.catch(ht=>{console.warn("GraphCanvas: requestFullscreen() was rejected for the fullscreenContainerRef (or default root) target",ht)})},[F]),qn=M.useCallback(J=>{var _e;return O.get(J.id)||(J.x!==void 0&&J.y!==void 0?{x:J.x,y:J.y}:(_e=$.get(J.id))!=null?_e:{x:0,y:0})},[O,$]),Fa=M.useCallback(()=>{var Ae;let J=1/0,he=-1/0,_e=1/0,ze=-1/0;for(const tt of Me){const ht=qn(tt),Ft=(Ae=H.get(tt.id))!=null?Ae:{width:Si,height:wi};J=Math.min(J,ht.x-Ft.width/2),he=Math.max(he,ht.x+Ft.width/2),_e=Math.min(_e,ht.y-Ft.height/2),ze=Math.max(ze,ht.y+Ft.height/2)}return Number.isFinite(J)?{minX:J,maxX:he,minY:_e,maxY:ze}:null},[Me,H,qn]);M.useEffect(()=>{if(Rt.current||!de||H.size===0||Me.length===0||(o==="force"||o==="galaxy"||o==="force-clustered")&&$.size===0)return;const J=Fa();if(J)if(Rt.current=!0,ce(!0),x){const he=Rm(J,de.width,de.height,_,S,w);Je(he.zoom),Xe(he.panX,he.panY)}else{const he=(J.minX+J.maxX)/2,_e=(J.minY+J.maxY)/2;Xe(de.width/2-he*Ie.zoom,de.height/2-_e*Ie.zoom)}},[de,H,$,Me,o,Ie.zoom,Xe,Je,x,_,Fa]);const ai=M.useRef(void 0);M.useEffect(()=>{if(!r||!za||Ce||n===ai.current)return;if(!n){ai.current=void 0;return}if(!de)return;const J=Me.find(_e=>_e.id===n);if(!J)return;ai.current=n;const he=qn(J);Xe(de.width/2-he.x*Ie.zoom,de.height/2-he.y*Ie.zoom)},[r,za,n,Ce,de,Me,qn,Ie.zoom,Xe]),M.useEffect(()=>{const J=nt.current;if(nt.current=de,!Rt.current||!J||!de||J.width===de.width&&J.height===de.height)return;const he=(J.width/2-Ie.x)/Ie.zoom,_e=(J.height/2-Ie.y)/Ie.zoom;Xe(de.width/2-he*Ie.zoom,de.height/2-_e*Ie.zoom)},[de,Ie.x,Ie.y,Ie.zoom,Xe]);const ja=M.useRef(void 0);M.useEffect(()=>{var Al,Ll,fc;if(o!=="galaxy"||Te===void 0||ja.current===Te||Ce||H.size===0)return;if(ja.current=Te,xt.current){ni();return}const J=Ia(),he=(t!=null?t:[]).map(Ht=>({source:Ht.sourceId,target:Ht.targetId,structural:m?m(Ht):!0})),_e=jb(J,he,{nodeMargin:u,aspectRatio:Te});Q(_e);const{leafToGroup:ze}=Vo(ke.roots,ke.childrenOf),Ae=Ht=>{const nn=H.get(Ht);return nn?Math.hypot(nn.width,nn.height)/2:20},tt=J.map(Ht=>({id:Ht.id,width:Ht.width,height:Ht.height,x:0,y:0}));yn(qo(tt,_e,ze,Ae,!0));let ht=1/0,Ft=-1/0,tn=1/0,Oi=-1/0;for(const Ht of Me){const nn=(Ll=(Al=O.get(Ht.id))!=null?Al:_e.get(Ht.id))!=null?Ll:{x:0,y:0},vn=(fc=H.get(Ht.id))!=null?fc:{width:Si,height:wi};ht=Math.min(ht,nn.x-vn.width/2),Ft=Math.max(Ft,nn.x+vn.width/2),tn=Math.min(tn,nn.y-vn.height/2),Oi=Math.max(Oi,nn.y+vn.height/2)}if(Number.isFinite(ht)&&de){const Ht={minX:ht,maxX:Ft,minY:tn,maxY:Oi};if(x){const nn=Rm(Ht,de.width,de.height,_,S,w);Je(nn.zoom),Xe(nn.panX,nn.panY)}else{const nn=(Ht.minX+Ht.maxX)/2,vn=(Ht.minY+Ht.maxY)/2;Xe(de.width/2-nn*Ie.zoom,de.height/2-vn*Ie.zoom)}}},[Te,o,Ce]);const Ea=M.useCallback(J=>{const he=Fa();if(!he||!de)return;const _e=Rm(he,de.width,de.height,J!=null?J:_,S,w);Je(_e.zoom),Xe(_e.panX,_e.panY)},[Fa,de,_,S,w,Je,Xe]);M.useEffect(()=>{!mt.current||!de||(mt.current=!1,!Ce&&Ea())},[de,Ea,Ce]);const Di=M.useCallback(J=>{if(!de){Je(Ie.zoom*J);return}Je(Ie.zoom*J,de.width/2,de.height/2)},[de,Ie.zoom,Je]),ii=M.useCallback(J=>{var Ae;const he=Me.find(tt=>tt.id===J);if(!he)return e.some(tt=>tt.id===J)||console.warn(`GraphCanvas: node "${J}" not found`),null;const _e=qn(he),ze=(Ae=H.get(J))!=null?Ae:{width:Si,height:wi};return{x:_e.x,y:_e.y,width:ze.width,height:ze.height}},[e,Me,H,qn]),Ha=M.useCallback((J,he)=>{if(!j)return;J.stopPropagation();const _e=qn(he);ue.current={id:he.id,pointerId:J.pointerId,startClientX:J.clientX,startClientY:J.clientY,startX:_e.x,startY:_e.y,dragging:!1,target:J.currentTarget}},[j,qn]),Vn=M.useCallback(J=>{const he=ue.current;if(!he||he.pointerId!==J.pointerId)return;const _e=J.clientX-he.startClientX,ze=J.clientY-he.startClientY;if(!he.dragging&&Math.hypot(_e,ze)<Lb)return;const Ae=_e/Ie.zoom,tt=ze/Ie.zoom;he.dragging||J.currentTarget.setPointerCapture(J.pointerId),he.dragging=!0;const ht={x:he.startX+Ae,y:he.startY+tt};se(Ft=>{const tn=new Map(Ft);return tn.set(he.id,ht),tn}),ni()},[Ie.zoom,ni]),le=M.useCallback(J=>{const he=ue.current;!he||he.pointerId!==J.pointerId||I(J.type==="pointerup")},[I]);M.useEffect(()=>{if(j)return;const J=ue.current;if(J){if(J.dragging)try{J.target.releasePointerCapture(J.pointerId)}catch(he){he instanceof DOMException||console.warn("GraphCanvas: releasePointerCapture failed",he)}I(!1)}},[j,I]);const we=M.useMemo(()=>Me.map(J=>ii(J.id)).filter(J=>J!==null),[Me,ii]),De=M.useCallback(J=>{var tt,ht;var he;const _e=((tt=(he=ke.childrenOf.get(J))==null?void 0:he.length)!=null?tt:0)>0,ze=(ht=p==null?void 0:p.has(J))!=null?ht:!1,Ae=ze?bp(J,ke.childrenOf).size:0;return{hasChildren:_e,collapsed:ze,hiddenDescendantCount:Ae,onToggleCollapse:y?()=>y(J):void 0}},[ke,p,y]),Ye=M.useCallback((J,he)=>{const _e=De(J.id);return c?c(J,he,_e):d.jsx(Ow,{id:J.id,label:J.label,kind:J.kind,domainColor:J.domainColor,selected:he,onSelect:i,hasChildren:_e.hasChildren,collapsed:_e.collapsed,hiddenDescendantCount:_e.hiddenDescendantCount,onToggleCollapse:_e.onToggleCollapse})},[c,i,De]),$t=M.useMemo(()=>({getNodeRect:ii,nodeRects:we,zoom:Ie.zoom,pan:{x:Ie.x,y:Ie.y},selectedNodeId:n,zoomToFit:Ea,setZoom:Je,zoomBy:Di,setPan:Xe,locked:Ce,setLocked:Se,isFullscreen:Pe,toggleFullscreen:Ua,layout:o,liveSimulation:rt,setLiveSimulation:$e}),[ii,we,Ie,n,Ea,Je,Di,Xe,Ce,Pe,Ua,o,rt]),ra=J=>{typeof B=="function"?B(J):B&&(B.current=J),wn.current=J},on=18*Ie.zoom,fn=(Ie.x%on+on)%on,Gn=(Ie.y%on+on)%on;return d.jsxs("div",V(R({ref:ra,"aria-label":"Graph canvas",className:["graph-canvas",D].filter(Boolean).join(" "),onPointerDown:ln,onPointerUp:_r,onKeyDown:pt.onKeyDown,tabIndex:pt.tabIndex,role:pt.role},T),{children:[d.jsx("div",{className:"graph-measure","aria-hidden":"true",children:Me.map(J=>d.jsx("div",{ref:he=>{Ca.current[J.id]=he},style:{display:"inline-block"},children:Ye(J,!1)},J.id))}),d.jsxs(Dw.Provider,{value:$t,children:[d.jsxs("svg",{className:"graph-svg",width:"100%",height:"100%",style:{position:"absolute",inset:0,overflow:"visible"},children:[d.jsx("defs",{children:d.jsx("pattern",{id:ei,x:fn,y:Gn,width:on,height:on,patternUnits:"userSpaceOnUse",children:d.jsx("circle",{cx:"0",cy:"0",r:Math.min(1,.5*Ie.zoom),className:"graph-grid-dot"})})}),d.jsx("rect",{width:"100%",height:"100%",fill:`url(#${ei})`,className:"graph-grid"}),d.jsxs("g",{className:"graph-viewport","data-testid":"graph-viewport",transform:Et,children:[h&&$n.size>0&&d.jsx("g",{className:"graph-clusters","aria-hidden":"true",children:[...$n.entries()].map(([J,he])=>d.jsx("circle",{className:"graph-cluster-boundary",cx:he.x,cy:he.y,r:he.r},J))}),d.jsx("g",{className:"graph-edges",children:t==null?void 0:t.map(J=>{const he=m?m(J):!0,_e=J.sourceId===G||J.targetId===G||J.sourceId===n||J.targetId===n||J.id===N;return!he&&!g&&!_e?null:d.jsx(c5,{id:J.id,sourceId:J.sourceId,targetId:J.targetId,label:J.label,variant:J.variant,weight:J.weight,opacity:J.opacity,strokeDash:J.strokeDash,sourceAnchor:J.sourceAnchor,targetAnchor:J.targetAnchor,curvature:J.curvature,selected:J.id===N,onSelect:k},J.id)})}),d.jsx("g",{className:"graph-nodes",children:Me.map(J=>{var Ae;const he=qn(J),_e=(Ae=H.get(J.id))!=null?Ae:{width:Si,height:wi},ze=J.id===n;return d.jsx("g",{transform:`translate(${he.x} ${he.y})`,"data-node-id":J.id,"data-testid":`graph-node-${J.id}`,"data-domain":J.domainColor,className:["graph-canvas-node",j&&"draggable",ze&&"selected"].filter(Boolean).join(" "),onPointerEnter:()=>W(J.id),onPointerLeave:()=>W(tt=>tt===J.id?void 0:tt),onPointerDown:j?tt=>Ha(tt,J):void 0,onPointerMove:j?Vn:void 0,onPointerUp:j?le:void 0,onPointerCancel:j?le:void 0,children:d.jsx("foreignObject",{x:-_e.width/2,y:-_e.height/2,width:_e.width,height:_e.height,overflow:"visible",children:Ye(J,ze)})},J.id)})})]})]}),L&&d.jsx(zw,{position:z})]})]}))});Iw.displayName="GraphCanvas";const u5=re.forwardRef((w,S)=>{var N=w,{id:e,sourceId:t,targetId:n,label:i,variant:r="default",weight:c,opacity:o,strokeDash:u,sourceAnchor:h,targetAnchor:m,curvature:g,selected:p=!1,onSelect:y,className:x=""}=N,_=pe(N,["id","sourceId","targetId","label","variant","weight","opacity","strokeDash","sourceAnchor","targetAnchor","curvature","selected","onSelect","className"]);const{getNodeRect:k,nodeRects:C}=Rg(),j=M.useMemo(()=>{const z=k(t),F=k(n);if(!z)return console.warn(`GraphEdge: source node "${t}" not found`),null;if(!F)return console.warn(`GraphEdge: target node "${n}" not found`),null;const D=Mw(z,F,{sourceAnchor:h,targetAnchor:m,curvature:g}),T=i?Tw(D.points,Eg(i),C,6):D.mid;return V(R({},D),{labelPos:T})},[k,t,n,h,m,g,i,C]);if(!j)return null;const A=["graph-edge",r!=="default"&&`graph-edge--${r}`,p&&"selected",x].filter(Boolean).join(" "),L=!!y;return d.jsx("g",V(R({ref:S,className:A,role:L?"button":"presentation","aria-hidden":L?void 0:!0,"aria-pressed":L?p:void 0,"aria-label":L?i?`${i}: ${t} to ${n}`:`${t} to ${n}`:void 0,tabIndex:L?0:void 0,onKeyDown:L?z=>{(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),y(e))}:void 0,"data-testid":`graph-edge-${e}`},_),{children:d.jsx(Ag,{id:e,d:j.d,mid:j.labelPos,label:i,variant:r,weight:c,opacity:o,strokeDash:u,onSelect:y,detailedTestIds:!0})}))});u5.displayName="GraphEdge";const d5=360,f5=260,h5=640,Bw=re.forwardRef((m,h)=>{var g=m,{open:e,width:t=d5,onWidthChange:n,minWidth:i=f5,maxWidth:r=h5,children:c,className:o=""}=g,u=pe(g,["open","width","onWidthChange","minWidth","maxWidth","children","className"]);const[p,y]=M.useState(t),[x,_]=M.useState(!1),S=!!n,w=S?p:t,N=M.useRef(null),k=M.useCallback(D=>T=>{D.forEach(B=>{typeof B=="function"?B(T):B&&(B.current=T)})},[]);M.useEffect(()=>{N.current&&(N.current.inert=!e)},[e]);const C=M.useRef(null),j=M.useRef(null),A=M.useCallback(D=>{const T=C.current;if(!T)return;const B=Math.min(r,Math.max(i,T.startWidth-(D.clientX-T.startX)));y(B),n==null||n(B)},[i,r,n]),L=M.useCallback(()=>{C.current=null,_(!1);const D=j.current;D&&(document.removeEventListener("mousemove",D.move),document.removeEventListener("mouseup",D.up),j.current=null)},[]),z=M.useCallback(D=>{D.preventDefault(),C.current={startX:D.clientX,startWidth:w},_(!0),j.current={move:A,up:L},document.addEventListener("mousemove",A),document.addEventListener("mouseup",L)},[w,A,L]);M.useEffect(()=>()=>{const D=j.current;D&&(document.removeEventListener("mousemove",D.move),document.removeEventListener("mouseup",D.up))},[]);const F=M.useCallback(D=>{const T=D.shiftKey?40:10;if(D.key==="ArrowLeft"){D.preventDefault();const B=Math.min(r,w+T);y(B),n==null||n(B)}else if(D.key==="ArrowRight"){D.preventDefault();const B=Math.max(i,w-T);y(B),n==null||n(B)}},[w,i,r,n]);return d.jsxs("div",V(R({ref:k([N,h]),className:["detail-drawer",e&&"detail-drawer--open",o].filter(Boolean).join(" "),style:{width:e?w:0},"aria-hidden":!e},u),{children:[S&&d.jsx("div",{className:["detail-drawer__resize-handle",x&&"detail-drawer__resize-handle--active"].filter(Boolean).join(" "),role:"separator","aria-orientation":"vertical","aria-label":"Resize detail panel","aria-valuenow":Math.round(w),"aria-valuemin":i,"aria-valuemax":r,tabIndex:e?0:-1,onMouseDown:z,onKeyDown:F}),d.jsx("div",{className:"detail-drawer__content",style:{width:w},children:c})]}))});Bw.displayName="DetailDrawer";const Uw=re.forwardRef((u,o)=>{var h=u,{node:e,relationships:t=[],onNodeSelect:n,emptyStateText:i="Select a node to inspect.",className:r=""}=h,c=pe(h,["node","relationships","onNodeSelect","emptyStateText","className"]);const m=["graph-inspector",r].filter(Boolean).join(" ");if(!e)return d.jsx("div",V(R({ref:o,className:m},c),{children:d.jsx("div",{className:"graph-inspector__empty","data-testid":"inspector-empty",children:i})}));const g=t.filter(y=>y.direction==="out"),p=t.filter(y=>y.direction==="in");return d.jsxs("div",V(R({ref:o,className:m},c),{children:[d.jsxs("div",{className:"graph-inspector__head",children:[d.jsxs("div",{className:"graph-inspector__head-eyebrow",children:[e.kind&&d.jsx("span",{className:"graph-inspector__badge",children:e.kind}),e.domain&&d.jsx("span",{className:`graph-inspector__badge graph-inspector__badge--${e.domain}`,children:e.domain})]}),d.jsx("div",{className:"graph-inspector__title","data-testid":"inspector-title",children:e.title}),d.jsx("div",{className:"graph-inspector__id","data-testid":"inspector-id",children:e.id})]}),d.jsxs("div",{className:"graph-inspector__body",children:[e.description&&d.jsx("p",{className:"graph-inspector__description","data-testid":"inspector-description",children:e.description}),e.metadata&&Object.keys(e.metadata).length>0&&d.jsx("dl",{className:"graph-inspector__kv","data-testid":"inspector-metadata",children:Object.entries(e.metadata).map(([y,x])=>d.jsxs(re.Fragment,{children:[d.jsx("dt",{children:y}),d.jsx("dd",{children:String(x)})]},y))}),g.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"graph-inspector__section-label",children:["Outgoing · ",g.length]}),d.jsx("ul",{className:"graph-inspector__rels","data-testid":"inspector-outgoing",children:g.map(y=>d.jsxs("li",{className:"graph-inspector__rel",children:[d.jsx("span",{className:"graph-inspector__rel-dir graph-inspector__rel-dir--out",children:"→"}),d.jsx("span",{className:"graph-inspector__rel-pred",children:y.predicate}),d.jsxs("button",{type:"button",className:"graph-inspector__rel-target","data-domain":y.targetDomain,onClick:()=>n==null?void 0:n(y.target),"aria-label":`Navigate to ${y.targetTitle}`,"data-testid":`inspector-rel-${y.id}`,children:[d.jsx("span",{className:"graph-inspector__rel-swatch"}),d.jsx("span",{children:y.targetTitle})]})]},y.id))})]}),p.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"graph-inspector__section-label",children:["Incoming · ",p.length]}),d.jsx("ul",{className:"graph-inspector__rels","data-testid":"inspector-incoming",children:p.map(y=>d.jsxs("li",{className:"graph-inspector__rel",children:[d.jsx("span",{className:"graph-inspector__rel-dir graph-inspector__rel-dir--in",children:"←"}),d.jsx("span",{className:"graph-inspector__rel-pred",children:y.predicate}),d.jsxs("button",{type:"button",className:"graph-inspector__rel-target","data-domain":y.targetDomain,onClick:()=>n==null?void 0:n(y.target),"aria-label":`Navigate to ${y.targetTitle}`,"data-testid":`inspector-rel-${y.id}`,children:[d.jsx("span",{className:"graph-inspector__rel-swatch"}),d.jsx("span",{children:y.targetTitle})]})]},y.id))})]}),t.length===0&&d.jsx("div",{className:"graph-inspector__empty-mini",children:"No relationships yet."})]})]}))});Uw.displayName="GraphInspector";const m5=re.forwardRef((o,c)=>{var u=o,{edge:e,onNodeSelect:t,emptyStateText:n="Select an edge to inspect.",className:i=""}=u,r=pe(u,["edge","onNodeSelect","emptyStateText","className"]);const h=["graph-edge-inspector",i].filter(Boolean).join(" ");if(!e)return d.jsx("div",V(R({ref:c,className:h},r),{children:d.jsx("div",{className:"graph-edge-inspector__empty","data-testid":"edge-inspector-empty",children:n})}));const m=e.metadata?Object.entries(e.metadata):[],g=(p,y,x,_)=>{const S=d.jsx("span",{className:"graph-edge-inspector__endpoint-swatch"});return t?d.jsxs("button",{type:"button",className:"graph-edge-inspector__endpoint graph-edge-inspector__endpoint--button","data-domain":x,onClick:()=>t(p),"aria-label":`Inspect ${y}`,"data-testid":_,children:[S,d.jsx("span",{children:y})]}):d.jsxs("span",{className:"graph-edge-inspector__endpoint","data-domain":x,"data-testid":_,children:[S,d.jsx("span",{children:y})]})};return d.jsxs("div",V(R({ref:c,className:h},r),{children:[d.jsxs("div",{className:"graph-edge-inspector__head",children:[d.jsx("div",{className:"graph-edge-inspector__head-eyebrow",children:e.variant&&e.variant!=="default"&&d.jsx("span",{className:`graph-edge-inspector__badge graph-edge-inspector__badge--${e.variant}`,children:e.variant})}),d.jsx("div",{className:"graph-edge-inspector__title","data-testid":"edge-inspector-title",children:e.predicate}),d.jsx("div",{className:"graph-edge-inspector__id","data-testid":"edge-inspector-id",children:e.id})]}),d.jsxs("div",{className:"graph-edge-inspector__body",children:[d.jsxs("div",{className:"graph-edge-inspector__endpoints","data-testid":"edge-inspector-endpoints",children:[g(e.sourceId,e.sourceTitle,e.sourceDomain,"edge-inspector-source"),d.jsx(Ee,{name:"arrowRight",size:14,className:"graph-edge-inspector__arrow"}),g(e.targetId,e.targetTitle,e.targetDomain,"edge-inspector-target")]}),(e.weight!==void 0||m.length>0)&&d.jsxs("dl",{className:"graph-edge-inspector__kv","data-testid":"edge-inspector-metadata",children:[e.weight!==void 0&&d.jsxs(re.Fragment,{children:[d.jsx("dt",{children:"weight"}),d.jsx("dd",{children:e.weight})]}),m.map(([p,y])=>d.jsxs(re.Fragment,{children:[d.jsx("dt",{children:p}),d.jsx("dd",{children:String(y)})]},p))]})]})]}))});m5.displayName="GraphEdgeInspector";const p5={ok:"rgb(var(--status-emerald))",warning:"rgb(var(--status-amber))",error:"rgb(var(--status-rose))",idle:"rgb(var(--status-neutral))"},g5=re.forwardRef((y,p)=>{var x=y,{title:e,nodeRole:t="",status:n="idle",metrics:i=[],selected:r=!1,x:c,y:o,onSelect:u,className:h="",style:m}=x,g=pe(x,["title","nodeRole","status","metrics","selected","x","y","onSelect","className","style"]);const _=["topology-node",`topology-node--${n}`,r?"topology-node--selected":"",u?"topology-node--interactive":"",h].filter(Boolean).join(" "),S=R(R({},c!==void 0&&o!==void 0?{position:"absolute",left:`${c}px`,top:`${o}px`}:{}),m),w=e.replace(/\s+/g,"-").toLowerCase(),N=k=>{u&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),u())};return d.jsxs("div",V(R({ref:p,className:_,style:S,"data-testid":`topology-node-${w}`,onClick:u,onKeyDown:N,tabIndex:u?0:void 0,"aria-selected":r,role:u?"button":void 0},g),{children:[d.jsxs("div",{className:"topology-node__head",children:[d.jsx("div",{className:"topology-node__title",children:e}),d.jsx("div",{className:"topology-node__status-dot",style:{backgroundColor:p5[n]},"data-testid":`topology-status-${w}`,"aria-label":`Status: ${n}`})]}),d.jsx("div",{className:"topology-node__role","data-testid":`topology-role-${w}`,children:t}),i.length>0&&d.jsx("div",{className:"topology-node__metrics","data-testid":`topology-metrics-${w}`,children:i.map((k,C)=>d.jsxs("div",{className:"topology-node__metric-row",children:[d.jsx("div",{className:"topology-node__metric-label",children:k.label}),d.jsxs("div",{className:"topology-node__metric-value",children:[k.value,k.unit&&d.jsx("span",{className:"topology-node__metric-unit",children:k.unit})]}),d.jsx("div",{className:"topology-node__metric-bar",children:d.jsx("div",{className:"topology-node__metric-fill",style:{width:`${Number.isFinite(k.percent)?Math.max(0,Math.min(100,k.percent)):0}%`,backgroundColor:k.color?`rgb(var(--status-${k.color}))`:"rgb(var(--accent-primary))"}})})]},C))})]}))});g5.displayName="TopologyNode";const Db={life:"var(--dom-life)",climate:"var(--dom-climate)",software:"var(--dom-software)",default:"var(--dom-default)"},y5=re.forwardRef((y,p)=>{var x=y,{depth:e=0,domain:t,kind:n,label:i,meta:r,description:c,selected:o=!1,onSelect:u,showKind:h=!0,className:m=""}=x,g=pe(x,["depth","domain","kind","label","meta","description","selected","onSelect","showKind","className"]);const _=Db[t]||Db.default,S=["hierarchy-row",o&&"selected",u&&"interactive",m].filter(Boolean).join(" "),w=re.useCallback(N=>{(N.key==="Enter"||N.key===" ")&&u&&(N.preventDefault(),u())},[u]);return d.jsxs("div",V(R({ref:p,className:S,role:u?"button":void 0,tabIndex:u?0:void 0,"aria-pressed":u?o:void 0,onClick:u,onKeyDown:u?w:void 0,style:{"--hierarchy-depth":e,"--domain-color":_}},g),{children:[d.jsxs("div",{className:"hierarchy-row__left",children:[e>0&&d.jsx("div",{className:"hierarchy-row__connector"}),d.jsxs("div",{className:"hierarchy-row__pill",children:[d.jsx("div",{className:"hierarchy-row__swatch"}),h&&d.jsx("span",{className:"hierarchy-row__kind",children:n}),d.jsx("span",{className:"hierarchy-row__label",children:i}),r&&d.jsx("span",{className:"hierarchy-row__meta",children:r})]})]}),c&&d.jsx("div",{className:"hierarchy-row__right",children:d.jsx("span",{className:"hierarchy-row__description",children:c})})]}))});y5.displayName="HierarchyRow";const v5=re.forwardRef((r,i)=>{var c=r,{className:e="",children:t}=c,n=pe(c,["className","children"]);const o=["hierarchy-tree",e].filter(Boolean).join(" ");return d.jsx("div",V(R({ref:i,className:o},n),{children:t}))});v5.displayName="HierarchyTree";const x5=re.forwardRef((o,c)=>{var u=o,{nodes:e,wrap:t=!1,className:n="","aria-label":i}=u,r=pe(u,["nodes","wrap","className","aria-label"]);if(e.length===0)return null;const h=["lineage-rail",t&&"lineage-rail--wrap",n].filter(Boolean).join(" "),m=i||`Lineage: ${e.map(g=>g.label).join(" → ")}`;return d.jsx("div",V(R({ref:c,className:h,role:"list","aria-label":m},r),{children:e.map((g,p)=>{const y=p===0;return d.jsxs(re.Fragment,{children:[p>0&&d.jsx("span",{className:"lineage-rail__arrow","aria-hidden":"true",children:"→"}),d.jsx(b5,{node:g,isHead:y})]},`${g.label}-${p}`)})}))});x5.displayName="LineageRail";const b5=({node:e,isHead:t})=>{const n=["lineage-rail__node",e.onClick&&"lineage-rail__node--interactive",t&&"lineage-rail__node--head"].filter(Boolean).join(" "),i=r=>{(r.key==="Enter"||r.key===" ")&&e.onClick&&(r.preventDefault(),e.onClick())};return d.jsxs(Hn,{className:n,role:"listitem","aria-current":t?"step":void 0,onClick:e.onClick,onKeyDown:e.onClick?i:void 0,tabIndex:e.onClick?0:void 0,children:[e.icon&&d.jsx(Ee,{name:e.icon,size:14}),d.jsx("span",{className:"lineage-rail__label",children:e.label})]})},_5=re.forwardRef((m,h)=>{var g=m,{thumb:e,title:t,subtitle:n,meta:i,badge:r,selected:c=!1,className:o=""}=g,u=pe(g,["thumb","title","subtitle","meta","badge","selected","className"]);const[p,y]=re.useState(!1),[x,_]=re.useState(!1);re.useEffect(()=>{y(!1),_(!1)},[e.kind==="image"?e.src:null]);const S=["asset-card",c&&"asset-card--selected",o].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:h,className:S,"aria-selected":c},u),{children:[d.jsxs("div",{className:"asset-card__thumb-wrapper",children:[(()=>{if(e.kind==="doc")return d.jsxs("div",{className:"asset-card__thumb asset-card__thumb--doc",children:[d.jsx("div",{className:"asset-card__doc-page"}),d.jsx("div",{className:`asset-card__doc-tab asset-card__doc-tab--${e.ext.toLowerCase()}`,children:e.ext.toUpperCase()})]});if(e.kind==="cover")return d.jsx("div",{className:"asset-card__thumb asset-card__thumb--cover",style:{"--cover-gradient":e.gradient},children:d.jsx(Ee,{name:e.glyph,size:32,className:"asset-card__cover-glyph"})});if(e.kind==="image")return(p||!x&&!e.src)&&e.fallbackGlyph?d.jsx("div",{className:"asset-card__thumb asset-card__thumb--image-fallback",children:d.jsx(Ee,{name:e.fallbackGlyph,size:32,className:"asset-card__image-glyph"})}):d.jsx("div",{className:"asset-card__thumb asset-card__thumb--image",children:d.jsx("img",{src:e.src,alt:"",className:"asset-card__image",onLoad:()=>_(!0),onError:()=>y(!0),"aria-hidden":"true"})})})(),r&&d.jsx("div",{className:"asset-card__badge",children:r})]}),d.jsxs("div",{className:"asset-card__body",children:[d.jsx("div",{className:"asset-card__title",children:t}),n&&d.jsx("div",{className:"asset-card__subtitle",children:n}),i&&d.jsx("div",{className:"asset-card__meta",children:i})]})]}))});_5.displayName="AssetCard";const S5=re.forwardRef((o,c)=>{var u=o,{columns:e=3,gap:t=14,className:n="",children:i}=u,r=pe(u,["columns","gap","className","children"]);const h=["asset-grid",n].filter(Boolean).join(" ");return d.jsx("div",V(R({ref:c,className:h,style:{"--asset-columns":e,"--asset-gap":`${t}px`}},r),{children:i}))});S5.displayName="AssetGrid";const Lg=(e,t=[])=>t.filter(n=>{const i=typeof n.startDate=="string"?new Date(n.startDate):new Date(n.startDate);return wl(e,i)}),w5=({focusedDate:e,selectedDate:t,grid:n,events:i,calendarColors:r,weekStartsOn:c,onSelectDate:o,onSelectEvent:u,renderEvent:h,onKeyDown:m})=>{const g=typeof e=="string"?new Date(e):e,p=t?typeof t=="string"?new Date(t):t:null;let y=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];return c===1&&(y=y.slice(1).concat(y.slice(0,1))),d.jsxs("div",{className:"calendar-month",role:"grid",onKeyDown:m,tabIndex:0,children:[d.jsx("div",{className:"calendar-month__header",role:"row",children:y.map(x=>d.jsx("div",{className:"calendar-month__weekday",role:"columnheader",children:x.slice(0,3).toUpperCase()},x))}),n.map((x,_)=>d.jsx("div",{className:"calendar-month__week",role:"row",children:x.map((S,w)=>{const N=S.getMonth()!==g.getMonth(),k=wl(S,g),C=p?wl(S,p):!1,j=rS(S),A=Lg(S,i),L=3,z=A.length-L;return d.jsxs("div",{className:`calendar-month__cell ${N?"calendar-month__cell--out-of-month":""} ${k?"calendar-month__cell--focused":""} ${C?"calendar-month__cell--selected":""}`,role:"gridcell",onClick:()=>!N&&(o==null?void 0:o(S)),onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),!N&&(o==null||o(S)))},children:[d.jsx("div",{className:"calendar-month__date-number","aria-current":j?"date":void 0,children:j?d.jsx(Hn,{variant:"amber",form:"default",children:S.getDate()}):d.jsx("span",{children:S.getDate()})}),d.jsxs("div",{className:"calendar-month__events",children:[A.slice(0,L).map(F=>{const D=(r==null?void 0:r[F.calendarId])||"rgb(var(--status-cyan))";return d.jsx("div",{className:"calendar-month__event-bar",style:{borderLeftColor:D},onClick:T=>{T.stopPropagation(),u==null||u(F.id)},role:"button",tabIndex:0,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),T.stopPropagation(),u==null||u(F.id))},children:h?h(F,D):d.jsx("span",{className:"calendar-month__event-title",children:F.title||"Event"})},F.id)}),z>0&&d.jsxs("div",{className:"calendar-month__event-overflow",children:["+",z," more"]})]})]},`${_}-${w}`)})},_))]})},N5=({focusedDate:e,weekStartsOn:t,events:n,calendarColors:i,onSelectDate:r,onSelectEvent:c,renderEvent:o})=>{const u=Nl(e,t);return d.jsx("div",{className:"calendar-week",children:d.jsx("div",{className:"calendar-week__days",children:u.map(h=>{const m=Lg(h,n);return d.jsxs("div",{className:"calendar-week__day",role:"button",tabIndex:0,onClick:()=>r==null?void 0:r(h),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),r==null||r(h))},children:[d.jsx("div",{className:"calendar-week__header",children:h.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}),d.jsx("div",{className:"calendar-week__events",children:m.map(g=>{const p=(i==null?void 0:i[g.calendarId])||"rgb(var(--status-cyan))";return d.jsx("div",{className:"calendar-week__event",style:{borderLeftColor:p},role:"button",tabIndex:0,onClick:y=>{y.stopPropagation(),c==null||c(g.id)},onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),y.stopPropagation(),c==null||c(g.id))},children:o?o(g,p):d.jsx("span",{children:g.title||"Event"})},g.id)})})]},h.toISOString())})})})},C5=({focusedDate:e,events:t,calendarColors:n,onSelectEvent:i,renderEvent:r})=>{const c=Lg(e,t);return d.jsxs("div",{className:"calendar-day",children:[d.jsx("div",{className:"calendar-day__title",children:typeof e=="string"?new Date(e).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"}):e.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"})}),d.jsx("div",{className:"calendar-day__events",children:c.length===0?d.jsx("div",{className:"calendar-day__empty",children:"No events scheduled"}):c.map(o=>{const u=(n==null?void 0:n[o.calendarId])||"rgb(var(--status-cyan))";return d.jsx("div",{className:"calendar-day__event",style:{borderLeftColor:u},role:"button",tabIndex:0,onClick:()=>i==null?void 0:i(o.id),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i==null||i(o.id))},children:r?r(o,u):d.jsx("span",{children:o.title||"Event"})},o.id)})})]})},j5=({focusedDate:e,events:t=[],calendarColors:n,onSelectEvent:i,renderEvent:r})=>{const c=typeof e=="string"?new Date(e):e,o=t.filter(u=>(typeof u.startDate=="string"?new Date(u.startDate):new Date(u.startDate))>=c).sort((u,h)=>{const m=typeof u.startDate=="string"?new Date(u.startDate):new Date(u.startDate),g=typeof h.startDate=="string"?new Date(h.startDate):new Date(h.startDate);return m.getTime()-g.getTime()});return d.jsx("div",{className:"calendar-agenda",children:o.length===0?d.jsx("div",{className:"calendar-agenda__empty",children:"No upcoming events"}):d.jsx("div",{className:"calendar-agenda__list",children:o.map(u=>{const h=(n==null?void 0:n[u.calendarId])||"rgb(var(--status-cyan))";return d.jsxs("div",{className:"calendar-agenda__item",role:"button",tabIndex:0,onClick:()=>i==null?void 0:i(u.id),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),i==null||i(u.id))},children:[d.jsx("div",{className:"calendar-agenda__date",style:{color:h},children:typeof u.startDate=="string"?new Date(u.startDate).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}):u.startDate.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}),d.jsx("div",{className:"calendar-agenda__content",children:r?r(u,h):d.jsx("span",{children:u.title||"Event"})})]},u.id)})})})},E5=re.forwardRef((_,x)=>{var S=_,{view:e,focusedDate:t,selectedDate:n,events:i,calendarColors:r,weekStartsOn:c=0,onChangeView:o,onNavigate:u,onSelectDate:h,onSelectEvent:m,renderEvent:g,className:p=""}=S,y=pe(S,["view","focusedDate","selectedDate","events","calendarColors","weekStartsOn","onChangeView","onNavigate","onSelectDate","onSelectEvent","renderEvent","className"]);const w=typeof t=="string"?new Date(t):t,N=M.useMemo(()=>lS(w,c),[w.getTime(),c]),k=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"},{value:"agenda",label:"Agenda"}],C=M.useCallback(z=>{if(e!=="month")return;const F=new Date(w);if(z.key==="ArrowLeft"||z.key==="ArrowRight"||z.key==="ArrowUp"||z.key==="ArrowDown"){z.preventDefault();const D=z.key==="ArrowLeft"?-1:z.key==="ArrowRight"?1:z.key==="ArrowUp"?-7:7;F.setDate(F.getDate()+D),u==null||u(F)}else if(z.key==="PageUp")z.preventDefault(),F.setMonth(F.getMonth()-1),u==null||u(F);else if(z.key==="PageDown")z.preventDefault(),F.setMonth(F.getMonth()+1),u==null||u(F);else if(z.key==="Home"){z.preventDefault();const D=Nl(F,c);u==null||u(D[0])}else if(z.key==="End"){z.preventDefault();const D=Nl(F,c);u==null||u(D[6])}},[w.getTime(),u,e,c]),j=M.useCallback(()=>{const z=new Date(w);e==="month"?z.setMonth(z.getMonth()-1):e==="week"?z.setDate(z.getDate()-7):(e==="day"||e==="agenda")&&z.setDate(z.getDate()-1),u==null||u(z)},[w.getTime(),u,e]),A=M.useCallback(()=>{const z=new Date(w);e==="month"?z.setMonth(z.getMonth()+1):e==="week"?z.setDate(z.getDate()+7):(e==="day"||e==="agenda")&&z.setDate(z.getDate()+1),u==null||u(z)},[w.getTime(),u,e]),L=M.useCallback(()=>{u==null||u(new Date)},[u]);return d.jsxs("div",V(R({ref:x,className:`calendar ${p}`.trim()},y),{children:[d.jsxs("div",{className:"calendar__header",children:[d.jsxs("div",{className:"calendar__title",children:[e==="month"&&fT(w),e==="week"&&hT(w,c),e==="day"&&sp(w),e==="agenda"&&"Agenda"]}),d.jsxs("div",{className:"calendar__controls",children:[d.jsx(_n,{variant:"secondary",size:"sm",onClick:j,"aria-label":"Previous",children:d.jsx(Ee,{name:"chevronLeft",size:16})}),d.jsx(_n,{variant:"secondary",size:"sm",onClick:L,children:"Today"}),d.jsx(_n,{variant:"secondary",size:"sm",onClick:A,"aria-label":"Next",children:d.jsx(Ee,{name:"chevronRight",size:16})})]})]}),d.jsx("div",{className:"calendar__view-selector",children:d.jsx(Ss,{value:e,onChange:z=>o==null?void 0:o(z),options:k})}),d.jsxs("div",{className:"calendar__content",children:[e==="month"&&d.jsx(w5,{focusedDate:w,selectedDate:n,grid:N,events:i,calendarColors:r,weekStartsOn:c,onSelectDate:h,onSelectEvent:m,renderEvent:g,onKeyDown:C}),e==="week"&&d.jsx(N5,{focusedDate:w,weekStartsOn:c,events:i,calendarColors:r,onSelectDate:h,onSelectEvent:m,renderEvent:g}),e==="day"&&d.jsx(C5,{focusedDate:w,events:i,calendarColors:r,onSelectEvent:m,renderEvent:g}),e==="agenda"&&d.jsx(j5,{focusedDate:w,events:i,calendarColors:r,onSelectEvent:m,renderEvent:g})]})]}))});E5.displayName="Calendar";const k5=({card:e,isSelected:t,renderCard:n,onSelect:i,onCardPointerDown:r,onCardKeyDown:c})=>n?d.jsx("div",{className:`kanban-card ${t?"kanban-card--selected":""}`,onPointerDown:o=>r(o,e.id),onKeyDown:o=>c(o,e.id),onClick:()=>i(e.id),tabIndex:0,role:"button","aria-pressed":t,children:n(e,t)}):d.jsxs("div",{className:`kanban-card ${t?"kanban-card--selected":""} ${e.done?"kanban-card--done":""}`,onPointerDown:o=>r(o,e.id),onKeyDown:o=>c(o,e.id),onClick:()=>i(e.id),tabIndex:0,role:"button","aria-pressed":t,children:[e.context&&d.jsx("div",{className:"kanban-card__context",children:e.context}),d.jsx("div",{className:"kanban-card__title",children:e.title}),e.version&&d.jsx("div",{className:"kanban-card__version",children:d.jsx(aa,{children:e.version})}),(e.dueDate||e.badges)&&d.jsxs("div",{className:"kanban-card__meta",children:[e.dueDate&&d.jsx("div",{className:"kanban-card__due-date",children:e.dueDate}),e.badges&&e.badges.length>0&&d.jsx("div",{className:"kanban-card__badges",children:e.badges.map(o=>d.jsx("span",{className:"kanban-card__badge",children:o},o))})]}),e.blocked&&d.jsxs("div",{className:"kanban-card__blocked",children:[d.jsx(Ee,{name:"alert",size:16}),e.blocked]})]}),M5=({column:e,cards:t,selectedId:n,onSelectCard:i,renderCard:r,draggedCardId:c,insertionIndex:o,onCardPointerDown:u,onCardKeyDown:h})=>{const m=M.useRef(null),g=e.wipLimit&&t.length>e.wipLimit;return d.jsxs(W_,{className:"kanban-column",noPadding:!0,children:[d.jsxs("div",{className:"kanban-column__header",children:[d.jsxs("div",{className:"kanban-column__header-left",children:[e.statusColor&&d.jsx("div",{className:"kanban-column__status-dot",style:{backgroundColor:Zo[e.statusColor]}}),d.jsx("div",{className:"kanban-column__title",children:e.title})]}),d.jsxs("div",{className:"kanban-column__header-right",children:[d.jsx(Hn,{variant:"neutral",children:t.length}),g&&d.jsx("div",{className:"kanban-column__wip-warning",title:`Over WIP limit of ${e.wipLimit}`,children:d.jsx(Ee,{name:"alert",size:14})})]})]}),d.jsxs("div",{ref:m,className:"kanban-column__body",children:[t.length===0?d.jsx("div",{className:"kanban-column__empty",children:"Drop cards here"}):t.map((p,y)=>d.jsxs(re.Fragment,{children:[c&&o===y&&d.jsx("div",{className:"kanban-column__insertion-line"}),d.jsx(k5,{card:p,isSelected:n===p.id,renderCard:r,onSelect:x=>i==null?void 0:i(x),onCardPointerDown:u,onCardKeyDown:h})]},p.id)),c&&o===t.length&&d.jsx("div",{className:"kanban-column__insertion-line"})]})]})},T5=re.forwardRef((m,h)=>{var g=m,{columns:e,cards:t,selectedId:n,onSelectCard:i,onMoveCard:r,renderCard:c,className:o=""}=g,u=pe(g,["columns","cards","selectedId","onSelectCard","onMoveCard","renderCard","className"]);const p=M.useRef(null),[y,x]=M.useState(null),[_,S]=M.useState(null),[w,N]=M.useState(null),k=M.useRef(null),C=M.useRef(null),j=M.useMemo(()=>{const T={};return e.forEach(B=>{T[B.id]=t.filter(P=>P.columnId===B.id)}),T},[e,t]),A=M.useCallback((T,B,P)=>{k.current&&(k.current.textContent=`Card "${T}" moved to ${B} at position ${P+1}`)},[]),L=M.useCallback((T,B)=>{const P=t.find(H=>H.id===B);if(!P)return;const K=T.currentTarget;K.setPointerCapture(T.pointerId),p.current={cardId:B,sourceColumnId:P.columnId,sourceIndex:j[P.columnId].findIndex(H=>H.id===B),offsetY:T.clientY,pointerId:T.pointerId,capturingElement:K},x(B),N(P.columnId)},[t,j]),z=M.useCallback(T=>{var B;if(!p.current||!((B=C.current)!=null&&B.getBoundingClientRect()))return;let P=null;for(const G of e){const W=document.querySelector(`[data-column-id="${CSS.escape(G.id)}"]`);if(W){const O=W.getBoundingClientRect();if(T.clientX>=O.left&&T.clientX<O.right){P=G,N(G.id);break}}}if(!P)return;const K=document.querySelector(`[data-column-id="${CSS.escape(P.id)}"] .kanban-column__body`);if(!K)return;const H=K.getBoundingClientRect(),q=T.clientY-H.top,$=K.querySelectorAll(".kanban-card");let Q=0;for(let G=0;G<$.length;G++){const W=$[G].getBoundingClientRect(),O=W.top-H.top;if(q<O+W.height/2){Q=G;break}else Q=G+1}S(Q)},[e]),F=M.useCallback(T=>{if(!p.current)return;const B=p.current;if(p.current=null,w&&_!==null){const P=e.find(H=>H.id===B.sourceColumnId),K=e.find(H=>H.id===w);if(K&&P){const H=t.find(q=>q.id===B.cardId);H&&(r(B.cardId,w,_),A(H.title,K.title,_))}}if(x(null),S(null),N(null),B.capturingElement&&B.pointerId!==void 0)try{B.capturingElement.releasePointerCapture(B.pointerId)}catch(P){}},[e,t,w,_,r,A]),D=M.useCallback((T,B)=>{var P,K;const H=t.find(q=>q.id===B);if(H){if(T.key===" "){T.preventDefault();const q=p.current;if(q!=null&&q.isKeyboardGrab){r(q.cardId,q.sourceColumnId,q.sourceIndex);const $=e.find(Q=>Q.id===q.sourceColumnId);A(H.title,($==null?void 0:$.title)||"",q.sourceIndex),p.current=null,x(null),S(null),N(null)}else{const $=j[H.columnId].findIndex(Q=>Q.id===B);p.current={cardId:B,sourceColumnId:H.columnId,sourceIndex:$,offsetY:0,isKeyboardGrab:!0,originalColumnId:H.columnId,originalIndex:$},x(B),N(H.columnId)}}else if(T.key==="ArrowUp"||T.key==="ArrowDown"||T.key==="ArrowLeft"||T.key==="ArrowRight"){T.preventDefault();const q=p.current;if(!q||!q.isKeyboardGrab)return;const $=e.findIndex(se=>se.id===q.sourceColumnId),Q=j[q.sourceColumnId];if(!Q){p.current=null,x(null),S(null),N(null);return}const G=q.sourceIndex;let W=q.sourceColumnId,O=G;T.key==="ArrowUp"&&G>0?O=G-1:T.key==="ArrowDown"&&G<Q.length-1?O=G+1:T.key==="ArrowLeft"&&$>0?(W=e[$-1].id,O=0):T.key==="ArrowRight"&&$<e.length-1&&(W=e[$+1].id,O=0),p.current=V(R({},q),{sourceColumnId:W,sourceIndex:O}),N(W),S(O),A(H.title,((P=e.find(se=>se.id===W))==null?void 0:P.title)||"",O)}else if(T.key==="Escape"){const q=p.current;q!=null&&q.isKeyboardGrab&&q.originalColumnId!==void 0&&q.originalIndex!==void 0&&(r(q.cardId,q.originalColumnId,q.originalIndex),A(H.title,((K=e.find($=>$.id===q.originalColumnId))==null?void 0:K.title)||"",q.originalIndex)),p.current=null,x(null),S(null),N(null)}}},[t,j,e,r,A]);return d.jsxs("div",V(R({ref:h,className:`kanban-board ${o}`,onPointerMove:z,onPointerUp:F},u),{children:[d.jsx("div",{ref:C,className:"kanban-board__columns",children:e.map(T=>d.jsx("div",{"data-column-id":T.id,className:"kanban-board__column-wrapper",children:d.jsx(M5,{column:T,cards:j[T.id]||[],selectedId:n,onSelectCard:B=>i==null?void 0:i(B),renderCard:c,draggedCardId:y||void 0,insertionIndex:w===T.id?_!=null?_:0:void 0,onCardPointerDown:L,onCardKeyDown:D})},T.id))}),d.jsx("div",{ref:k,className:"kanban-board__live-region",role:"status","aria-live":"polite","aria-atomic":"true"})]}))});T5.displayName="KanbanBoard";const R5=re.forwardRef((h,u)=>{var m=h,{entries:e=[],follow:t=!0,maxRows:n=500,showOps:i=!1,className:r="","aria-label":c}=m,o=pe(m,["entries","follow","maxRows","showOps","className","aria-label"]);const g=M.useRef(null),p=M.useRef(null),[y,x]=M.useState(t);M.useEffect(()=>{u&&(typeof u=="function"?u(g.current):u.current=g.current)},[u]),M.useEffect(()=>{if(!t||!p.current)return;const N=new IntersectionObserver(k=>{k.forEach(C=>{C.isIntersecting&&x(!0)})},{threshold:.1});return N.observe(p.current),()=>{N.disconnect()}},[t]),M.useEffect(()=>{y&&t&&g.current&&(g.current.scrollTop=g.current.scrollHeight)},[e,t,y]),M.useEffect(()=>{if(!t||!g.current)return;const N=()=>{const{scrollTop:C,scrollHeight:j,clientHeight:A}=g.current;j-C-A<50||x(!1)},k=g.current;return k.addEventListener("scroll",N),()=>{k.removeEventListener("scroll",N)}},[t]);const _=e.slice(-n),S=N=>N.id?N.id:`log-${typeof N.timestamp=="string"?N.timestamp:N.timestamp.getTime()}-${N.level}-${N.message}-${N.op||""}-${N.target||""}`,w=["log-stream",r].filter(Boolean).join(" ");return d.jsxs("div",V(R({ref:g,className:w,role:"log","aria-live":y&&t?"polite":void 0,"aria-label":c!=null?c:"Log stream"},o),{children:[d.jsx("div",{className:"log-stream__content",children:_.length===0?d.jsx("div",{className:"log-stream__empty",children:d.jsx("span",{className:"log-stream__empty-text",children:"No log entries"})}):_.map(N=>{const k=typeof N.timestamp=="string"?new Date(N.timestamp):N.timestamp,C=uT(k),j=`log-stream__level log-stream__level--${N.level.toLowerCase()}`;return d.jsxs("div",{className:i?"log-stream__row log-stream__row--with-ops":"log-stream__row",children:[d.jsx("span",{className:"log-stream__time",children:C}),d.jsx("span",{className:j,children:N.level}),i&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"log-stream__op",children:N.op||""}),d.jsx("span",{className:"log-stream__target",children:N.target||""})]}),d.jsx("span",{className:"log-stream__message",children:N.message})]},S(N))})}),t&&d.jsx("div",{ref:p,className:"log-stream__sentinel"})]}))});R5.displayName="LogStream";function Sp(e){const t=e.trim();if(/^#[0-9a-fA-F]{6}$/i.test(t))return t;if(/^#[0-9a-fA-F]{3}$/i.test(t)){const o=t.slice(1);return"#"+o[0]+o[0]+o[1]+o[1]+o[2]+o[2]}const n=t.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(n){const o=Math.max(0,Math.min(255,parseInt(n[1],10))),u=Math.max(0,Math.min(255,parseInt(n[2],10))),h=Math.max(0,Math.min(255,parseInt(n[3],10)));return"#"+[o,u,h].map(m=>m.toString(16).padStart(2,"0")).join("")}const i=t.match(/hsla?\s*\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)%\s*,\s*(\d+(?:\.\d+)?)%/);if(i){const o=parseFloat(i[1])/360,u=parseFloat(i[2])/100,h=parseFloat(i[3])/100,m=(1-Math.abs(2*h-1))*u,g=m*(1-Math.abs(o*6%2-1)),p=h-m/2;let y=0,x=0,_=0;o<1/6?(y=m,x=g):o<2/6?(y=g,x=m):o<3/6?(x=m,_=g):o<4/6?(x=g,_=m):o<5/6?(y=g,_=m):(y=m,_=g);const S=w=>Math.round((w+p)*255).toString(16).padStart(2,"0");return"#"+S(y)+S(x)+S(_)}const r={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",purple:"#800080",fuchsia:"#ff00ff"},c=t.toLowerCase();return c in r?r[c]:"#10b981"}function A5(e,t,n,i){const r=(e-t)/(n-t||1),c=Math.round((.12+r*.88)*255).toString(16).padStart(2,"0");return`${Sp(i)}${c}`}function rs(e,t,n){const i=Math.pow(2,n),r=(t+180)/360*i*256,c=Math.max(-85.05112878,Math.min(85.05112878,e)),o=(1-Math.log(Math.tan(c*Math.PI/180)+1/Math.cos(c*Math.PI/180))/Math.PI)/2*i*256;return{x:r,y:o}}function L5(e,t,n){const i=Math.pow(2,n),r=e/(i*256)*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*(t/(i*256)))))*180/Math.PI,lng:r}}function D5({patternId:e,zoomLevel:t}){const n=32*Math.pow(2,t);return d.jsxs("pattern",{id:e,x:0,y:0,width:n,height:n,patternUnits:"userSpaceOnUse",children:[d.jsx("rect",{width:n,height:n,fill:"none",stroke:"rgb(var(--canvas-fg-3))",strokeWidth:"0.5",opacity:"0.3"}),d.jsx("circle",{cx:0,cy:0,r:1,fill:"rgb(var(--canvas-fg-3))",opacity:"0.4"})]})}function O5({pin:e,x:t,y:n,onClose:i}){const r=M.useRef(null);return wd(r,!0,{mode:"popup"}),M.useEffect(()=>{const c=o=>{o.key==="Escape"&&i()};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[i]),d.jsxs("div",{ref:r,className:"map-popover",style:{left:`${t}px`,top:`${n}px`},role:"dialog",children:[e.label&&d.jsx("div",{className:"map-popover__label",children:e.label}),e.timestamp&&d.jsx("div",{className:"map-popover__timestamp",children:e.timestamp}),e.detail&&d.jsx("div",{className:"map-popover__detail",children:e.detail})]})}const z5=re.forwardRef((N,w)=>{var k=N,{mode:e,pins:t=[],selectedPinId:n,onSelectPin:i,trackPoints:r=[],heatmapData:c=[],heatmapColor:o="#10b981",tileUrl:u,bounds:h,scaleBar:m=!1,minZoom:g=0,maxZoom:p=18,onViewportChange:y,onModeChange:x,className:_=""}=k,S=pe(k,["mode","pins","selectedPinId","onSelectPin","trackPoints","heatmapData","heatmapColor","tileUrl","bounds","scaleBar","minZoom","maxZoom","onViewportChange","onModeChange","className"]);const C=M.useRef(null),[j,A]=M.useState(null),[L,z]=M.useState(null),F=M.useRef(!1),D=M.useCallback(O=>{const se=L5(O.x/O.zoom,O.y/O.zoom,Math.round(O.zoom*4));y==null||y({center:{lat:se.lat,lng:se.lng},zoom:O.zoom})},[y]),{transform:T,viewport:B,bind:P,panTo:K}=Lw({minZoom:g,maxZoom:p,onViewportChange:D,containerRef:C}),H=`map-grid-${M.useId().replace(/:/g,"")}`;M.useEffect(()=>{const O=C.current;if(!O)return;const se=new ResizeObserver(ue=>{const{width:I,height:ie}=ue[0].contentRect;I>0&&ie>0&&A({width:I,height:ie})});return se.observe(O),()=>se.disconnect()},[]),M.useEffect(()=>{if(F.current||!j||!h&&t.length===0&&r.length===0&&c.length===0)return;const O=[...t.map(ke=>({lat:ke.lat,lng:ke.lng})),...r.map(ke=>({lat:ke.lat,lng:ke.lng})),...c.map(ke=>({lat:ke.lat,lng:ke.lng}))];let se=null;if(h)se={north:Math.max(h[0].lat,h[1].lat),south:Math.min(h[0].lat,h[1].lat),east:Math.max(h[0].lng,h[1].lng),west:Math.min(h[0].lng,h[1].lng)};else if(O.length>0){const ke=O.map(Me=>Me.lat),ft=O.map(Me=>Me.lng);se={north:Math.max(...ke),south:Math.min(...ke),east:Math.max(...ft),west:Math.min(...ft)}}if(!se)return;const ue=60,I=rs(se.north,se.west,10).y,ie=rs(se.south,se.east,10).y,ye=rs(se.north,se.west,10).x,xe=rs(se.north,se.east,10).x,Ce=Math.abs(ie-I),Se=Math.abs(xe-ye);if(Ce===0||Se===0||j.height<=ue*2||j.width<=ue*2){K(j.width/2,j.height/2),F.current=!0;return}const Pe=Math.log2((j.height-ue*2)/Ce),vt=Math.log2((j.width-ue*2)/Se);if(!Number.isFinite(Pe)||!Number.isFinite(vt)){K(j.width/2,j.height/2),F.current=!0;return}const mt=Math.max(g,Math.min(p,Math.floor(Math.min(Pe,vt)))),Ut=(se.north+se.south)/2,rt=(se.east+se.west)/2,$e=rs(Ut,rt,mt),Ue=j.width/2-$e.x*mt,xt=j.height/2-$e.y*mt;K(Ue,xt),F.current=!0},[j,h,t.length,r.length,c.length,g,p,K]);const q=M.useCallback(O=>{O.target instanceof Element&&(O.target.closest(".map-pin")||O.target.closest(".map-popover")||O.target.closest("[data-no-drag]"))||P.onPointerDown(O)},[P]),$=M.useCallback(()=>e!=="pins"||!t.length?null:d.jsx("div",{className:"map-pins","data-testid":"map-pins",style:{position:"absolute",inset:0,pointerEvents:"none"},children:t.map(O=>{const se=rs(O.lat,O.lng,Math.round(B.zoom*4)),ue=B.x+se.x*B.zoom,I=B.y+se.y*B.zoom;return d.jsxs("button",{type:"button",className:["map-pin",n===O.id&&"map-pin--selected"].filter(Boolean).join(" "),onClick:ie=>{ie.stopPropagation(),i==null||i(O.id);const ye=ie.target.getBoundingClientRect();z({x:ye.right+8,y:ye.top})},"aria-label":`${O.label||"Pin"} at latitude ${O.lat.toFixed(4)}, longitude ${O.lng.toFixed(4)}${O.timestamp?` on ${O.timestamp}`:""}`,"data-testid":`map-pin-${O.id}`,"data-no-drag":!0,style:{position:"absolute",left:`${ue}px`,top:`${I}px`,pointerEvents:"auto"},children:[d.jsx("span",{className:"map-pin__dot"}),O.label&&d.jsx("span",{className:"map-pin__label",children:O.label})]},O.id)})}),[e,t,B.zoom,B.x,B.y,n,i]),Q=M.useCallback(()=>{if(e!=="track"||!r.length)return null;const O=r.map(se=>rs(se.lat,se.lng,Math.round(B.zoom*4))).map((se,ue)=>`${ue===0?"M":"L"} ${se.x} ${se.y}`).join(" ");return d.jsx("g",{className:"map-track","data-testid":"map-track",children:d.jsx("path",{d:O,className:"map-track__line"})})},[e,r,B.zoom]),G=M.useCallback(()=>{if(e!=="heatmap"||!c.length)return null;const O=c.map(I=>I.value).filter(I=>I!=null),se=Math.min(...O),ue=Math.max(...O);return d.jsx("g",{className:"map-heatmap","data-testid":"map-heatmap",children:c.map((I,ie)=>{const ye=rs(I.lat,I.lng,Math.round(B.zoom*4)),xe=(I.value-se)/(ue-se||1),Ce=A5(I.value,se,ue,o);return d.jsx("circle",{cx:ye.x,cy:ye.y,r:8+xe*4,fill:Ce,opacity:.6,"data-testid":`heatmap-point-${ie}`},ie)})})},[e,c,o,B.zoom]),W=M.useCallback(()=>{if(!u||!j)return null;const O=Math.min(Math.max(Math.floor(B.zoom*4),0),28),se=Math.pow(2,O),ue=Math.max(0,Math.floor(-B.x/(256*B.zoom))),I=Math.max(0,Math.floor(-B.y/(256*B.zoom))),ie=Math.min(se,Math.ceil((j.width-B.x)/(256*B.zoom))),ye=Math.min(se,Math.ceil((j.height-B.y)/(256*B.zoom))),xe=typeof u=="function"?u:(Se,Pe,vt)=>u.replace("{x}",String(Se)).replace("{y}",String(Pe)).replace("{z}",String(vt)),Ce=[];for(let Se=ue;Se<ie;Se++)for(let Pe=I;Pe<ye;Pe++){const vt=xe(Se,Pe,O);Ce.push(d.jsx("image",{href:vt,x:Se*256,y:Pe*256,width:256,height:256,"data-testid":`tile-${Se}-${Pe}`},`${O}-${Se}-${Pe}`))}return Ce},[u,j,B]);return d.jsxs("div",V(R(V(R({ref:O=>{typeof w=="function"?w(O):w&&(w.current=O),C.current=O},className:["map-canvas",_].filter(Boolean).join(" ")},P),{onPointerDown:q,role:"application","aria-label":"Map canvas"}),S),{children:[d.jsxs("svg",{className:"map-svg",width:"100%",height:"100%",style:{position:"absolute",inset:0,overflow:"visible"},children:[d.jsx("defs",{children:d.jsx(D5,{patternId:H,zoomLevel:B.zoom})}),u?d.jsx("g",{className:"map-tiles",transform:T,children:W()}):d.jsx("rect",{width:"100%",height:"100%",fill:`url(#${H})`,className:"map-grid"}),d.jsxs("g",{className:"map-viewport",transform:T,children:[Q(),G()]})]}),$(),d.jsxs("div",{className:"map-overlay",children:[e==="track"&&d.jsx("div",{className:"map-legend",children:d.jsxs("div",{className:"map-legend__item",children:[d.jsx("div",{className:"map-legend__line",style:{backgroundColor:"rgb(var(--status-cyan))"}}),"Track"]})}),e==="heatmap"&&d.jsx("div",{className:"map-legend",children:d.jsxs("div",{className:"map-legend__item",children:[d.jsx("div",{className:"map-legend__gradient",style:{backgroundImage:`linear-gradient(to right, ${Sp(o)}20, ${Sp(o)}cc)`}}),"Density"]})}),x&&d.jsxs("div",{className:"map-mode-switch",children:[d.jsx("button",{type:"button",className:["map-mode-switch__button",e==="pins"&&"map-mode-switch__button--active"].filter(Boolean).join(" "),onClick:()=>x("pins"),"aria-label":"Switch to pins mode",title:"Pins",children:"Pins"}),d.jsx("button",{type:"button",className:["map-mode-switch__button",e==="track"&&"map-mode-switch__button--active"].filter(Boolean).join(" "),onClick:()=>x("track"),"aria-label":"Switch to track mode",title:"Track",children:"Track"}),d.jsx("button",{type:"button",className:["map-mode-switch__button",e==="heatmap"&&"map-mode-switch__button--active"].filter(Boolean).join(" "),onClick:()=>x("heatmap"),"aria-label":"Switch to heatmap mode",title:"Heatmap",children:"Heatmap"})]}),m&&d.jsx("div",{className:"map-scale-bar",children:d.jsxs("div",{className:"map-scale-bar__label",children:["Zoom: ",B.zoom.toFixed(1)]})})]}),n&&L&&(()=>{const O=t.find(se=>se.id===n);return O?d.jsx(O5,{pin:O,x:L.x,y:L.y,onClose:()=>{i==null||i(null),z(null)}}):null})()]}))});z5.displayName="MapCanvas";const I5=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"short",year:"numeric"}),B5=re.forwardRef((h,u)=>{var m=h,{focusedDate:e,selectedDate:t,markers:n=[],weekStartsOn:i=0,onSelect:r,className:c=""}=m,o=pe(m,["focusedDate","selectedDate","markers","weekStartsOn","onSelect","className"]);const g=typeof e=="string"?new Date(e):new Date(e),p=t?typeof t=="string"?new Date(t):t:null,y=M.useMemo(()=>lS(g,i),[g.getTime(),i]),x=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];i===1&&x.push(x.shift());const _=S=>n.some(w=>wl(S,w));return d.jsxs("div",V(R({ref:u,className:`mini-calendar ${c}`.trim()},o),{children:[d.jsx("div",{className:"mini-calendar__header",children:d.jsx("div",{className:"mini-calendar__title",children:I5(g)})}),d.jsxs("div",{className:"mini-calendar__grid",children:[d.jsx("div",{className:"mini-calendar__weekdays",children:x.map(S=>d.jsx("div",{className:"mini-calendar__weekday",children:S.toUpperCase()},S))}),d.jsx("div",{className:"mini-calendar__dates",children:y.map(S=>S.map(w=>{const N=w.getMonth()!==g.getMonth(),k=p?wl(w,p):!1,C=rS(w),j=_(w);return d.jsxs("button",{className:`mini-calendar__date ${N?"mini-calendar__date--out-of-month":""} ${k?"mini-calendar__date--selected":""} ${C?"mini-calendar__date--today":""} ${j?"mini-calendar__date--has-marker":""}`,onClick:()=>!N&&(r==null?void 0:r(w)),type:"button","aria-current":C?"date":void 0,"aria-selected":k,children:[d.jsx("span",{className:"mini-calendar__date-number",children:w.getDate()}),j&&d.jsx("span",{className:"mini-calendar__marker"})]},w.toISOString())}))})]})]}))});B5.displayName="MiniCalendar";const U5={life:"var(--dom-life)",climate:"var(--dom-climate)",software:"var(--dom-software)",data:"var(--dom-default)",infrastructure:"var(--dom-default)"},F5=e=>U5[e]||"var(--accent-primary)",H5=e=>{const t=["emerald","cyan","amber","rose","violet"],n=e.split("").reduce((i,r)=>i+r.charCodeAt(0),0);return t[n%t.length]},P5=re.forwardRef((y,p)=>{var x=y,{domain:e,source:t,version:n,snippet:i,provenance:r,score:c,onOpen:o,actions:u,selected:h=!1,className:m=""}=x,g=pe(x,["domain","source","version","snippet","provenance","score","onOpen","actions","selected","className"]);const _=F5(e),S=H5(e),w=re.useCallback(C=>{(C.key==="Enter"||C.key===" ")&&o&&(C.preventDefault(),o())},[o]),N=["result-card",h&&"result-card--selected",m].filter(Boolean).join(" "),k=n?`${t} v${n}`:t;return d.jsxs("div",V(R({ref:p,className:N,role:"article","aria-label":k,tabIndex:o?0:void 0,onClick:o,onKeyDown:o?w:void 0,style:{"--domain-color":_}},g),{children:[d.jsxs("div",{className:"result-card__header",children:[d.jsxs("div",{className:"result-card__header-left",children:[d.jsx("div",{className:`result-card__domain-dot result-card__domain-dot--${S}`}),d.jsx("span",{className:"result-card__source",children:t}),n&&d.jsx(aa,{children:n})]}),c!==void 0&&d.jsx("span",{className:"result-card__score-label",children:c.toFixed(2)})]}),c!==void 0&&d.jsx("div",{className:"result-card__score-bar",children:d.jsx(ag,{percent:c*100,color:"amber",height:4})}),d.jsx("div",{className:"result-card__snippet",children:i}),r&&Object.values(r).some(C=>C!==void 0)&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"result-card__divider"}),d.jsxs("div",{className:"result-card__provenance",children:[r.collection&&d.jsxs("span",{className:"result-card__provenance-field",children:[d.jsx("span",{className:"result-card__provenance-label",children:"Collection"}),d.jsx("span",{className:"result-card__provenance-value",children:r.collection})]}),r.document&&d.jsxs("span",{className:"result-card__provenance-field",children:[d.jsx("span",{className:"result-card__provenance-label",children:"Document"}),d.jsx("span",{className:"result-card__provenance-value",children:r.document})]}),r.section&&d.jsxs("span",{className:"result-card__provenance-field",children:[d.jsx("span",{className:"result-card__provenance-label",children:"Section"}),d.jsx("span",{className:"result-card__provenance-value",children:r.section})]})]})]}),u&&u.length>0&&d.jsx("div",{className:"result-card__actions",children:u.map((C,j)=>d.jsx(_n,{variant:"ghost",size:"sm",icon:!!C.icon,title:C.label,onClick:A=>{A.stopPropagation(),C.onClick()},children:C.icon?d.jsx(Ee,{name:C.icon,size:16}):C.label},j))})]}))});P5.displayName="ResultCard";const $5=/^[0-9a-fA-F]+$/;function Fw(e){let t;typeof atob=="function"?t=atob(e):t=globalThis.Buffer.from(e,"base64").toString("binary");let n="";for(let i=0;i<t.length;i++)n+=t.charCodeAt(i).toString(16).padStart(2,"0");return n}function Om(e,t){if(!e)return"";if($5.test(e)&&e.length===t)return e.toLowerCase();try{return Fw(e).toLowerCase()}catch(n){return e.toLowerCase()}}function q5(e){return!e||/^0+$/.test(e)?null:e}const zm=["UNSPECIFIED","INTERNAL","SERVER","CLIENT","PRODUCER","CONSUMER"];function V5(e){var t,n;if(typeof e=="number")return(t=zm[e])!=null?t:"UNSPECIFIED";if(typeof e=="string"){if(/^\d+$/.test(e))return(n=zm[Number(e)])!=null?n:"UNSPECIFIED";const i=e.replace(/^SPAN_KIND_/,"").toUpperCase();return zm.includes(i)?i:"UNSPECIFIED"}return"UNSPECIFIED"}function G5(e){const t=typeof e=="string"&&/^\d+$/.test(e)?Number(e):e;return t===2||t==="STATUS_CODE_ERROR"?"error":"ok"}function Uu(e){if(e==null||e==="")return null;try{return typeof e=="number"?Number.isFinite(e)?BigInt(Math.trunc(e)):null:BigInt(/[.eE]/.test(e)?e.split(/[.eE]/)[0]:e)}catch(t){return null}}function Dg(e){var t;if(!e)return"";if(e.stringValue!==void 0)return e.stringValue;if(e.boolValue!==void 0)return e.boolValue;if(e.intValue!==void 0){const n=Number(e.intValue);return Number.isSafeInteger(n)?n:String(e.intValue)}if(e.doubleValue!==void 0)return e.doubleValue;if(e.bytesValue!==void 0)try{return Fw(e.bytesValue)}catch(n){return e.bytesValue}return e.arrayValue?JSON.stringify(((t=e.arrayValue.values)!=null?t:[]).map(Dg)):e.kvlistValue?JSON.stringify(wp(e.kvlistValue.values)):""}function wp(e){const t={};return(e!=null?e:[]).forEach(n=>{n&&n.key&&(t[n.key]=Dg(n.value))}),t}function Im(e,t){const n=(e!=null?e:[]).find(i=>i.key===t);return n?Dg(n.value):void 0}const Y5=["http.response.status_code","http.status_code","rpc.grpc.status_code"];function K5(e,t={}){var p,y,x;const n=(p=t.serviceNameKey)!=null?p:"service.name",i=Array.isArray(e)?e:(y=e==null?void 0:e.resourceSpans)!=null?y:[],r={},c=[];if(i.forEach(_=>{var k,C,j,A;var S;const w=(S=_.resource)==null?void 0:S.attributes,N=String((k=Im(w,n))!=null?k:"unknown_service");if(!r[N]){const L=(C=Im(w,"host.name"))!=null?C:Im(w,"service.instance.id");r[N]={label:N,host:L!=null?String(L):void 0}}((A=(j=_.scopeSpans)!=null?j:_.instrumentationLibrarySpans)!=null?A:[]).forEach(L=>{var z;((z=L.spans)!=null?z:[]).forEach(F=>c.push({span:F,service:N}))})}),c.length===0)return{spans:[],services:r,meta:{traceId:""}};let o=null;c.forEach(({span:_})=>{const S=Uu(_.startTimeUnixNano);S!==null&&(o===null||S<o)&&(o=S)});const u=o!=null?o:BigInt(0),h=c.map(({span:_,service:S})=>{var T,B,P,K;var w;const N=(T=Uu(_.startTimeUnixNano))!=null?T:u,k=(B=Uu(_.endTimeUnixNano))!=null?B:N,C=Number(N-u)/1e6,j=Number(k-N)/1e6,A=wp(_.attributes);let L;const z=((P=_.events)!=null?P:[]).map(H=>{var G;const q=wp(H.attributes),$=Uu(H.timeUnixNano),Q=$!==null?Number($-u)/1e6:C;return H.name==="exception"&&!L&&(L={type:q["exception.type"]!=null?String(q["exception.type"]):void 0,message:q["exception.message"]!=null?String(q["exception.message"]):void 0,stacktrace:q["exception.stacktrace"]!=null?String(q["exception.stacktrace"]):void 0}),{time:Q,name:(G=H.name)!=null?G:"event",attributes:q}});let F;for(const H of Y5){const q=A[H];if(q!==void 0){F=typeof q=="boolean"?String(q):q;break}}const D={id:Om(_.spanId,16),parentId:q5(Om(_.parentSpanId,16)),name:(K=_.name)!=null?K:"(unnamed)",service:S,kind:V5(_.kind),start:C,duration:j,status:G5((w=_.status)==null?void 0:w.code),statusCode:F,attributes:A,exception:L,events:z.length?z:void 0};return t.deriveStatus?V(R({},D),{status:t.deriveStatus(D)}):D}),m=(x=h.find(_=>_.parentId===null))!=null?x:h[0],g={traceId:Om(c[0].span.traceId,32),name:m==null?void 0:m.name,rootService:m==null?void 0:m.service};return{spans:h,services:r,meta:g}}function X5(e){if(!e)return"";const t=e.split("-");return t.length===3?(t[1]+t[2]).toLowerCase():e.replace(/-/g,"").toLowerCase()}function Q5(e,t){return t?"SERVER":e.namespace==="aws"||e.namespace==="remote"?"CLIENT":"INTERNAL"}function Z5(e){return e.fault||e.error||e.throttle?"error":"ok"}function Np(e,t,n){if(n!=null){if(typeof n!="object"||Array.isArray(n)){e[t]=Array.isArray(n)?JSON.stringify(n):n;return}Object.entries(n).forEach(([i,r])=>{if(r==null)return;const c=t?`${t}.${i}`:i;typeof r=="object"&&!Array.isArray(r)?Np(e,c,r):e[c]=Array.isArray(r)?JSON.stringify(r):r})}}function J5(e){var t,n;const i={},r=(t=e.http)==null?void 0:t.request,c=(n=e.http)==null?void 0:n.response;if((r==null?void 0:r.method)!=null&&(i["http.request.method"]=r.method),(r==null?void 0:r.url)!=null&&(i["url.full"]=r.url),(r==null?void 0:r.user_agent)!=null&&(i["user_agent.original"]=r.user_agent),(r==null?void 0:r.client_ip)!=null&&(i["client.address"]=r.client_ip),(c==null?void 0:c.status)!=null&&(i["http.response.status_code"]=c.status),(c==null?void 0:c.content_length)!=null&&(i["http.response.body.size"]=c.content_length),e.sql){const o=e.sql;o.database_type!=null&&(i["db.system"]=o.database_type),o.sanitized_query!=null&&(i["db.statement"]=o.sanitized_query),o.url!=null&&(i["server.address"]=o.url),o.user!=null&&(i["db.user"]=o.user)}return e.namespace&&(i["aws.xray.namespace"]=e.namespace),e.throttle&&(i["aws.xray.throttle"]=!0),"origin"in e&&e.origin&&(i["cloud.platform"]=String(e.origin)),e.aws&&Np(i,"aws",e.aws),e.annotations&&Object.entries(e.annotations).forEach(([o,u])=>{i[o]=u}),e.metadata&&Np(i,"metadata",e.metadata),i}function W5(e){var o,u;var t,n,i,r;let c;if(e.cause&&typeof e.cause=="object"&&(t=e.cause.exceptions)!=null&&t.length){const h=e.cause.exceptions[0],m=(n=h.stack)!=null&&n.length?`${(o=h.type)!=null?o:"Error"}: ${(u=h.message)!=null?u:""}
78
- `+h.stack.map(g=>{var p,y,x;return` at ${(p=g.label)!=null?p:"<anonymous>"} (${(y=g.path)!=null?y:"?"}:${(x=g.line)!=null?x:0})`}).join(`
79
- `):void 0;c={type:h.type,message:h.message,stacktrace:m}}else typeof e.cause=="string"&&(c={type:"Error",message:`exception ${e.cause}`});return{exception:c,statusCode:(r=(i=e.http)==null?void 0:i.response)==null?void 0:r.status}}function Hw(e){var t,n;if(e==null)return[];if(Array.isArray(e))return e.flatMap(Hw);if(e.Traces||e.traces){const i=(t=e.Traces)!=null?t:e.traces;let r=i;return i.length>1&&(console.warn(`fromXRay: response has ${i.length} traces; using the first. Pass one trace at a time for the rest.`),r=i.slice(0,1)),r.flatMap(c=>{var o;return((o=c.Segments)!=null?o:[]).map(u=>typeof u.Document=="string"?JSON.parse(u.Document):u.Document)})}return e.Segments||e.segments?((n=e.Segments)!=null?n:e.segments).map(i=>typeof i.Document=="string"?JSON.parse(i.Document):i.Document):[e]}function ez(e,t={}){var p;const n=Hw(e);if(n.length===0)return{spans:[],services:{},meta:{traceId:""}};const i=[],r={},c=(y,x,_,S)=>{var w;i.push({node:y,parentId:x,service:_,isRoot:S}),((w=y.subsegments)!=null?w:[]).forEach(N=>c(N,y.id,_,!1))};n.forEach(y=>{var S;const x=y.type==="subsegment",_=y.name;r[_]||(r[_]={label:_}),c(y,(S=y.parent_id)!=null?S:null,_,!x)});let o=1/0,u=-1/0;i.forEach(({node:y})=>{typeof y.start_time=="number"&&(o=Math.min(o,y.start_time)),typeof y.end_time=="number"&&(u=Math.max(u,y.end_time))}),Number.isFinite(o)||(o=0),Number.isFinite(u)||(u=o);const h=i.map(({node:y,parentId:x,service:_,isRoot:S})=>{var D,T,B,P;const w=typeof y.start_time=="number"?y.start_time:o,N=(w-o)*1e3,k=typeof y.end_time=="number"?y.end_time:u,C=Math.max(0,(k-w)*1e3),j=J5(y),{exception:A,statusCode:L}=W5(y),z=A?[{time:N,name:"exception",attributes:{"exception.type":(D=A.type)!=null?D:"","exception.message":(T=A.message)!=null?T:""}}]:void 0,F={id:String((B=y.id)!=null?B:"").toLowerCase(),parentId:x!=null?String(x).toLowerCase():null,name:String((P=y.name)!=null?P:"(unnamed)"),service:_,kind:Q5(y,S),start:N,duration:C,status:Z5(y),statusCode:L,attributes:j,exception:A,events:z};return t.deriveStatus?V(R({},F),{status:t.deriveStatus(F)}):F}),m=(p=n.find(y=>y.type!=="subsegment"))!=null?p:n[0],g={traceId:X5(m.trace_id),name:m.name,rootService:m.name};return{spans:h,services:r,meta:g}}function tz(e){const t={};e.forEach(h=>{t[h.id]=V(R({},h),{end:h.start+h.duration,depth:0,children:[],hasChildren:!1})});const n=[];e.forEach(h=>{const m=t[h.id];h.parentId&&t[h.parentId]&&h.parentId!==h.id?t[h.parentId].children.push(m):n.push(m)});const i=(h,m)=>h.start-m.start||h.end-m.end;n.sort(i);const r=[];let c=0;const o=(h,m)=>{h.depth=m,h.hasChildren=h.children.length>0,m>c&&(c=m),r.push(h),h.children.sort(i),h.children.forEach(g=>o(g,m+1))};n.forEach(h=>o(h,0));const u=r.reduce((h,m)=>m.end>h?m.end:h,0);return{byId:t,ordered:r,roots:n,total:u,maxDepth:c}}function Pw(e){if(!e.children.length)return e.duration;const t=e.children.map(c=>[Math.max(c.start,e.start),Math.min(c.end,e.end)]).filter(([c,o])=>o>c).sort((c,o)=>c[0]-o[0]);let n=0,i=null,r=0;return t.forEach(([c,o])=>{i===null?(i=c,r=o):c<=r?r=Math.max(r,o):(n+=r-i,i=c,r=o)}),i!==null&&(n+=r-i),Math.max(0,e.duration-n)}function nz(e,t){const n=[],i=new Set;return e.forEach(r=>{if(r.parentId&&i.has(r.parentId)){i.add(r.id);return}n.push(r),t.has(r.id)&&i.add(r.id)}),n}function az(e){let t=0;const n=i=>{i.children.forEach(r=>{t++,n(r)})};return n(e),t}const Cp=2;function $w(e,t,n=Cp){const i=Math.max(1e-6,t-e),r=100-2*n;return{x:c=>n+(c-e)/i*r,w:c=>Math.max(.5,c/i*r)}}function iz(e,t){const n=Math.max(1e-6,t-e)/8,i=Math.pow(10,Math.floor(Math.log10(n))),r=n/i,c=i*(r<1.5?1:r<3?2:r<7?5:10),o=[],u=Math.ceil(e/c-1e-9)*c;for(let h=u;h<=t+1e-6;h+=c)o.push(+h.toFixed(3));return{ticks:o,step:c}}function Fn(e){return e==null?"—":e>=1e3?(e/1e3).toFixed(2)+" s":e>=10?e.toFixed(0)+" ms":e>=1?e.toFixed(1)+" ms":e.toFixed(2)+" ms"}const qw=["#22D3EE","#818CF8","#10B981","#8B5CF6","#14B8A6","#F59E0B","#38BDF8","#A3E635","#E879F9","#2DD4BF"];function sz(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t>>>0}function rz(e,t=qw){return t[sz(e)%t.length]}function lz(e,t,n,i=qw){var r;return(n==null?void 0:n(e))||((r=t==null?void 0:t[e])==null?void 0:r.color)||rz(e,i)}function oz(e,t){var n;return((n=t==null?void 0:t[e])==null?void 0:n.label)||e}const cz={SERVER:"server",CLIENT:"client",INTERNAL:"internal",PRODUCER:"producer",CONSUMER:"consumer",UNSPECIFIED:"internal"},uz={ok:"OK",warn:"WARN",error:"ERROR"};function dz({model:e,resolveColor:t,selectedId:n}){const{ordered:i,total:r}=e,c=100,o=2,u=1,h=3,m=i.length,g=h*2+m*(o+u),p=i.findIndex(x=>x.id===n),y=re.useMemo(()=>{const x=$w(0,r);return i.map((_,S)=>d.jsx("rect",{x:x.x(_.start),y:h+S*(o+u),width:x.w(_.duration),height:o,rx:"0.6",fill:_.status==="error"?"rgb(var(--status-error))":t(_.service),fillOpacity:.5},_.id))},[i,r,t]);return d.jsxs("svg",{className:"trace-detail__minimap",width:"100%",height:g,viewBox:`0 0 ${c} ${g}`,preserveAspectRatio:"none",children:[p>=0&&d.jsx("rect",{x:"0",y:h+p*(o+u)-1,width:c,height:o+2,className:"trace-detail__minimap-band"}),y]})}function Ob({rows:e}){return d.jsx("div",{className:"trace-detail__kv",children:e.map(([t,n],i)=>d.jsxs(re.Fragment,{children:[d.jsx("div",{className:"trace-detail__kv-key",title:t,children:t}),d.jsx("div",{className:"trace-detail__kv-val",title:typeof n=="string"?n:void 0,children:n})]},t+i))})}function Ks({title:e,right:t,children:n}){return d.jsxs("div",{className:"trace-detail__section",children:[d.jsxs("div",{className:"trace-detail__section-head",children:[d.jsx("span",{className:"trace-detail__eyebrow",children:e}),t]}),d.jsx("div",{className:"trace-detail__section-body",children:n})]})}const Vw=re.forwardRef(function({span:e,model:t,traceId:n,resolveColor:i,serviceLabel:r,serviceHost:c,onClose:o,onSelect:u,renderAttributes:h,closeButtonRef:m},g){var z,F,D,T;var p;const y=i(e.service),x=t.total,_=Pw(e),S=x>0?e.duration/x*100:0,w=e.duration>0?_/e.duration*100:0,N=e.parentId?t.byId[e.parentId]:null,k=(z=cz[e.kind])!=null?z:"internal",C=t.ordered.findIndex(B=>B.id===e.id)+1,j=e.attributes?Object.entries(e.attributes):[],A=((F=e.events)!=null?F:[]).filter(B=>B.name!=="exception"),L=({label:B,value:P,sub:K})=>d.jsxs("div",{className:"trace-detail__timing-row",children:[d.jsx("span",{className:"trace-detail__timing-label",children:B}),d.jsxs("span",{className:"trace-detail__timing-value",children:[P,K&&d.jsxs("span",{className:"trace-detail__timing-sub",children:[" ",K]})]})]});return d.jsxs("div",{className:"trace-detail",ref:g,role:"complementary","aria-label":`Span detail: ${e.name}`,onKeyDown:B=>{B.key==="Escape"&&(B.stopPropagation(),o())},children:[d.jsxs("div",{className:"trace-detail__head",children:[d.jsx("span",{className:"trace-detail__head-swatch",style:{background:y}}),d.jsxs("div",{className:"trace-detail__head-main",children:[d.jsxs("div",{className:"trace-detail__eyebrow",children:[r.toUpperCase()," · ",e.kind]}),d.jsx("div",{className:"trace-detail__title",children:e.name}),d.jsx("div",{className:"trace-detail__status-row",children:d.jsxs("span",{className:`trace-detail__status-pill trace-detail__status-pill--${e.status}`,children:[d.jsx("span",{className:"trace-detail__status-dot"}),uz[e.status],e.statusCode!=null&&e.statusCode!==0?` · ${e.statusCode}`:""]})})]}),d.jsx("button",{type:"button",className:"trace-detail__close",onClick:o,title:"Close panel","aria-label":"Close span detail",ref:m,children:d.jsx(Ee,{name:"x",size:14})})]}),d.jsxs("div",{className:"trace-detail__scroll",children:[d.jsxs(Ks,{title:"TRACE MAP",children:[d.jsx("div",{className:"trace-detail__minimap-wrap",children:d.jsx(dz,{model:t,resolveColor:i,selectedId:e.id})}),d.jsxs("div",{className:"trace-detail__minimap-caption",children:["row ",C," of ",t.ordered.length]})]}),d.jsxs(Ks,{title:"TIMING",children:[d.jsx(L,{label:"start offset",value:Fn(e.start)}),d.jsx(L,{label:"duration",value:Fn(e.duration)}),d.jsx(L,{label:"self time",value:Fn(_),sub:`· ${w.toFixed(0)}%`}),d.jsx(L,{label:"% of trace",value:`${S.toFixed(1)}%`}),d.jsxs("div",{className:"trace-detail__selfbar",children:[d.jsx("div",{className:"trace-detail__selfbar-self",style:{width:`${w}%`,background:y}}),d.jsx("div",{className:"trace-detail__selfbar-children"})]}),d.jsxs("div",{className:"trace-detail__selfbar-legend",children:[d.jsxs("span",{children:["SELF ",Fn(_)]}),d.jsxs("span",{children:["IN CHILDREN ",Fn(e.duration-_)]})]})]}),d.jsx(Ks,{title:"IDENTITY",children:d.jsx(Ob,{rows:[["span_id",e.id],["parent",N?d.jsx("button",{type:"button",className:"trace-detail__link",onClick:()=>u(N.id),title:N.name,children:N.name}):d.jsx("span",{className:"trace-detail__muted",children:"— root —"})],["service",d.jsxs("span",{className:"trace-detail__svc",title:r,children:[d.jsx("span",{className:"trace-detail__svc-dot",style:{background:y}}),r]})],...c?[["host",c]]:[],["kind",d.jsx("span",{className:`trace-detail__kind trace-detail__kind--${k}`,children:e.kind})],...n?[["trace_id",n]]:[]]})}),h?d.jsx(Ks,{title:"ATTRIBUTES",children:h(e)}):j.length>0?d.jsx(Ks,{title:"ATTRIBUTES",right:d.jsx("span",{className:"trace-detail__count",children:j.length}),children:d.jsx(Ob,{rows:j.map(([B,P])=>[B,String(P)])})}):null,A.length>0&&d.jsx(Ks,{title:"EVENTS",right:d.jsx("span",{className:"trace-detail__count",children:A.length}),children:d.jsx("div",{className:"trace-detail__events",children:A.map((B,P)=>d.jsxs("div",{className:"trace-detail__event",children:[d.jsx("span",{className:"trace-detail__event-time",children:Fn(B.time)}),d.jsx("span",{className:"trace-detail__event-name",children:B.name})]},P))})}),d.jsx(Ks,{title:"STATUS",children:e.status==="error"&&e.exception?d.jsxs("div",{className:"trace-detail__error",children:[d.jsxs("div",{className:"trace-detail__error-head",children:[d.jsx(Ee,{name:"alert",size:14}),d.jsx("span",{children:(D=e.exception.type)!=null?D:"Error"})]}),e.exception.message&&d.jsx("div",{className:"trace-detail__error-msg",children:e.exception.message}),e.exception.stacktrace&&d.jsx("pre",{className:"trace-detail__error-stack",children:e.exception.stacktrace})]}):e.status==="warn"?d.jsxs("div",{className:"trace-detail__warn",children:[d.jsx(Ee,{name:"alert",size:13}),"degraded — ",String((T=(p=e.attributes)==null?void 0:p.note)!=null?T:"elevated latency on this span")]}):d.jsxs("div",{className:"trace-detail__ok",children:[d.jsx("span",{className:"trace-detail__ok-dot"}),"OK",e.statusCode?` · ${e.statusCode}`:""]})}),d.jsx("div",{className:"trace-detail__foot-spacer"})]})]})});Vw.displayName="TraceDetailPanel";const zb=14,Ib=16;function fz({node:e,rowHeight:t,treeWidth:n,selected:i,hovered:r,collapsed:c,color:o,onSelect:u,onHover:h,onToggle:m,registerRef:g}){const p=zb+e.depth*Ib,y=[];for(let _=0;_<e.depth;_++)y.push(zb+_*Ib+7);const x=["trace-viewer__tree-row",i&&"is-selected",r&&"is-hovered",e.status==="error"&&"is-error",e.status==="warn"&&"is-warn"].filter(Boolean).join(" ");return d.jsxs("div",{ref:_=>g(e.id,_),className:x,role:"treeitem","aria-level":e.depth+1,"aria-selected":i,"aria-expanded":e.hasChildren?!c:void 0,tabIndex:i?0:-1,style:{height:t,paddingLeft:p,width:n},onClick:()=>u(e.id),onMouseEnter:()=>h(e.id),onMouseLeave:()=>h(null),children:[y.map((_,S)=>d.jsx("span",{className:"trace-viewer__guide",style:{left:_}},S)),e.hasChildren?d.jsx("button",{type:"button",className:"trace-viewer__twisty"+(c?"":" is-open"),onClick:_=>{_.stopPropagation(),m(e.id)},tabIndex:-1,"aria-label":c?"Expand":"Collapse",children:d.jsx(Ee,{name:"chevronRight",size:13})}):d.jsx("span",{className:"trace-viewer__twisty trace-viewer__twisty--leaf",children:d.jsx("span",{className:"trace-viewer__leaf-dot"})}),d.jsx("span",{className:"trace-viewer__swatch",style:{background:o}}),d.jsx("span",{className:"trace-viewer__tree-name",children:e.name}),c&&e.hasChildren&&d.jsxs("span",{className:"trace-viewer__desc-count",children:["+",az(e)]}),d.jsx("span",{className:"trace-viewer__tree-dur",children:Fn(e.duration)})]})}function hz({node:e,rowHeight:t,scaleX:n,scaleW:i,selected:r,hovered:c,color:o,onSelect:u,onHover:h}){const m=n(e.start),g=i(e.duration),p=m+g<68,y=e.status==="error",x=e.status==="warn",_=["trace-viewer__wf-row",r&&"is-selected",c&&"is-hovered"].filter(Boolean).join(" ");return d.jsxs("div",{className:_,style:{height:t},onClick:()=>u(e.id),onMouseEnter:()=>h(e.id),onMouseLeave:()=>h(null),children:[d.jsx("div",{className:"trace-viewer__bar"+(y?" is-error":"")+(r?" is-selected":""),style:{left:`${m}%`,width:`${g}%`,background:o},children:x&&d.jsx("span",{className:"trace-viewer__bar-warn"})}),y&&d.jsx("span",{className:"trace-viewer__bar-alert",style:{left:`calc(${m}% - 4px)`},children:d.jsx(Ee,{name:"alert",size:12})}),d.jsxs("span",{className:"trace-viewer__bar-label",style:p?{left:`calc(${m+g}% + 7px)`}:{right:`calc(${100-m}% + 7px)`},children:[d.jsx("span",{className:"trace-viewer__bar-dur"+(y?" is-error":x?" is-warn":""),children:Fn(e.duration)}),d.jsx("span",{className:"trace-viewer__bar-name",children:e.name})]})]})}const mz=re.memo(function({model:e,resolveColor:t,resolveLabel:n}){const{ordered:i,total:r}=e,c=new Set(i.map(y=>y.service)),o=i.filter(y=>y.status==="error").length,u=i.filter(y=>y.status==="warn").length,h={};i.forEach(y=>{h[y.service]=(h[y.service]||0)+Pw(y)});const m=Object.entries(h).sort((y,x)=>x[1]-y[1]),g=m.reduce((y,[,x])=>y+x,0)||1,p=({label:y,value:x,tone:_})=>d.jsxs("div",{className:"trace-viewer__stat"+(_?` trace-viewer__stat--${_}`:""),children:[d.jsx("span",{className:"trace-viewer__eyebrow",children:y}),d.jsx("span",{className:"trace-viewer__stat-value",children:x})]});return d.jsxs("div",{className:"trace-viewer__summary",children:[d.jsx(p,{label:"DURATION",value:Fn(r),tone:"accent"}),d.jsx(p,{label:"SPANS",value:i.length}),d.jsx(p,{label:"SERVICES",value:c.size}),d.jsx(p,{label:"ERRORS",value:o,tone:o?"error":void 0}),d.jsx(p,{label:"WARNINGS",value:u,tone:u?"warn":void 0}),d.jsxs("div",{className:"trace-viewer__svcbar-wrap",children:[d.jsx("span",{className:"trace-viewer__eyebrow",children:"TIME PER SERVICE · SELF"}),d.jsx("div",{className:"trace-viewer__svcbar",children:m.map(([y,x])=>d.jsx("div",{className:"trace-viewer__svcbar-seg",title:`${n(y)} · ${Fn(x)}`,style:{width:`${x/g*100}%`,background:t(y)}},y))}),d.jsx("div",{className:"trace-viewer__svc-legend",children:m.map(([y,x])=>d.jsxs("span",{className:"trace-viewer__svc-legend-item",children:[d.jsx("span",{className:"trace-viewer__svc-legend-dot",style:{background:t(y)}}),n(y),d.jsx("span",{className:"trace-viewer__svc-legend-val",children:Fn(x)})]},y))})]})]})}),pz=re.forwardRef(function(F,z){var D=F,{trace:e,otlp:t,xray:n,selectedSpanId:i,defaultSelectedSpanId:r=null,onSelectSpan:c,collapsedSpanIds:o,defaultCollapsedSpanIds:u,onToggleSpan:h,showSummary:m=!0,showToolbar:g=!0,showDetailPanel:p=!0,treeWidth:y=336,detailPanelWidth:x=360,rowHeight:_=30,services:S,serviceColor:w,deriveStatus:N,renderAttributes:k,enableZoom:C=!0,virtualizeThreshold:j=80,className:A=""}=D,L=pe(D,["trace","otlp","xray","selectedSpanId","defaultSelectedSpanId","onSelectSpan","collapsedSpanIds","defaultCollapsedSpanIds","onToggleSpan","showSummary","showToolbar","showDetailPanel","treeWidth","detailPanelWidth","rowHeight","services","serviceColor","deriveStatus","renderAttributes","enableZoom","virtualizeThreshold","className"]);var T,B;const P=M.useMemo(()=>{let le;return t?le=K5(t):n?le=ez(n):le=e!=null?e:{spans:[]},N&&(le=V(R({},le),{spans:le.spans.map(we=>V(R({},we),{status:N(we)}))})),le},[t,n,e,N]),K=M.useMemo(()=>tz(P.spans),[P]),{ordered:H,byId:q,total:$}=K,Q=M.useMemo(()=>{var le;return R(R({},(le=P.services)!=null?le:{}),S!=null?S:{})},[P.services,S]),G=M.useCallback(le=>lz(le,Q,w),[Q,w]),W=M.useCallback(le=>oz(le,Q),[Q]),[O,se]=M.useState(r),ue=i!==void 0?i:O,I=ue&&q[ue]?ue:null,ie=M.useCallback(le=>{i===void 0&&se(le),c==null||c(le)},[i,c]),[ye,xe]=M.useState(()=>new Set(u!=null?u:[])),Ce=M.useMemo(()=>o?new Set(o):ye,[o,ye]),Se=M.useCallback(le=>{const we=!Ce.has(le);o===void 0&&xe(De=>{const Ye=new Set(De);return Ye.has(le)?Ye.delete(le):Ye.add(le),Ye}),h==null||h(le,we)},[Ce,o,h]),Pe=M.useCallback(le=>{var we;if(o!==void 0)return;const De=[];let Ye=(we=q[le])!=null&&we.parentId?q[q[le].parentId]:null;for(;Ye;)De.push(Ye.id),Ye=Ye.parentId?q[Ye.parentId]:null;De.length&&xe($t=>{const ra=new Set($t);return De.forEach(on=>ra.delete(on)),ra})},[q,o]),[vt,mt]=M.useState(null),[Ut,rt]=M.useState(null),$e=Ut!=null?Ut:[0,$||1],Ue=M.useMemo(()=>$w($e[0],$e[1]),[$e[0],$e[1]]),xt=M.useMemo(()=>iz($e[0],$e[1]).ticks,[$e[0],$e[1]]),ke=M.useMemo(()=>nz(H,Ce),[H,Ce]),ft=M.useMemo(()=>{const le=new Map;return ke.forEach((we,De)=>le.set(we.id,De)),le},[ke]),Me=ke.length*_,[$n,yn]=M.useState(600),wn=ke.length>=j,{visibleRange:Ca,containerRef:Rt,sentinelRef:za}=sg({itemCount:ke.length,itemHeight:_,containerHeight:$n,overscan:16}),ce=wn?Math.max(0,Ca[0]):0,de=wn?Math.min(ke.length,Ca[1]):ke.length,Oe=ke.slice(ce,de);M.useEffect(()=>{const le=Rt.current;if(!le||typeof ResizeObserver>"u")return;const we=new ResizeObserver(()=>yn(le.clientHeight||600));return we.observe(le),yn(le.clientHeight||600),()=>we.disconnect()},[Rt]);const nt=M.useMemo(()=>{const le=new Set;let we=I?q[I]:null;for(;we;)le.add(we.id),we=we.parentId?q[we.parentId]:null;return le},[I,q]),Te=M.useRef(new Map),_t=M.useCallback((le,we)=>{we?Te.current.set(le,we):Te.current.delete(le)},[]),Et=M.useRef(null),Ie=M.useCallback(le=>{const we=ft.get(le),De=Rt.current;if(we==null||!De)return;const Ye=we*_,$t=Ye+_;Ye<De.scrollTop?De.scrollTop=Math.max(0,Ye-_):$t>De.scrollTop+De.clientHeight&&(De.scrollTop=$t-De.clientHeight+_)},[ft,_,Rt]),pt=M.useCallback((le,we=6)=>{const De=Te.current.get(le);if(De){De.focus();return}we>0&&requestAnimationFrame(()=>pt(le,we-1))},[]);M.useEffect(()=>{I&&(Ie(I),Et.current===I&&(pt(I),Et.current=null))},[I,Ie,pt]);const Xe=M.useCallback((le,we=!0)=>{Pe(le),we&&(Et.current=le),ie(le)},[Pe,ie]),Je=M.useCallback(le=>{var we;const De=I!=null?I:(we=ke[0])==null?void 0:we.id;if(!De)return;const Ye=ft.get(De);if(Ye==null)return;const $t=q[De];switch(le.key){case"ArrowDown":le.preventDefault(),ke[Ye+1]&&Xe(ke[Ye+1].id);break;case"ArrowUp":le.preventDefault(),ke[Ye-1]&&Xe(ke[Ye-1].id);break;case"ArrowRight":le.preventDefault(),$t.hasChildren&&Ce.has(De)?Se(De):ke[Ye+1]&&ke[Ye+1].parentId===De&&Xe(ke[Ye+1].id);break;case"ArrowLeft":le.preventDefault(),$t.hasChildren&&!Ce.has(De)?Se(De):$t.parentId&&Xe($t.parentId);break;case"Home":le.preventDefault(),ke[0]&&Xe(ke[0].id);break;case"End":le.preventDefault(),ke[ke.length-1]&&Xe(ke[ke.length-1].id);break;case"Enter":case" ":le.preventDefault(),Xe(De);break;case"Escape":I&&(le.preventDefault(),ie(null));break}},[I,ke,ft,q,Ce,Se,Xe,ie]),Nn=M.useMemo(()=>{const le=new Map;return H.forEach((we,De)=>le.set(we.id,De)),le},[H]),ln=M.useMemo(()=>H.filter(le=>le.status==="error").map(le=>le.id),[H]),_r=M.useCallback(le=>{var ra,on;if(!ln.length)return;const we=fn=>{var Gn;return(Gn=Nn.get(fn))!=null?Gn:-1},De=I?we(I):-1,Ye=ln.map(we).sort((fn,Gn)=>fn-Gn);let $t;le===1?$t=(ra=Ye.find(fn=>fn>De))!=null?ra:Ye[0]:$t=(on=[...Ye].reverse().find(fn=>fn<De))!=null?on:Ye[Ye.length-1],$t!=null&&Xe(H[$t].id)},[ln,H,I,Xe]),ei=M.useCallback(()=>{o===void 0&&xe(new Set(H.filter(le=>le.hasChildren).map(le=>le.id)))},[o,H]),Ia=M.useCallback(()=>{o===void 0&&xe(new Set)},[o]),ti=M.useRef(null),[en,sa]=M.useState(null),Mn=M.useRef(null),Ba=M.useCallback(le=>{const we=ti.current;if(!we)return 0;const De=we.getBoundingClientRect();return Math.min(100,Math.max(0,(le-De.left)/De.width*100))},[]),Li=M.useCallback(le=>{const we=100-2*Cp,De=(le-Cp)/we;return $e[0]+De*($e[1]-$e[0])},[$e]),ni=M.useCallback(le=>{if(!C||$<=0)return;le.currentTarget.setPointerCapture(le.pointerId);const we=Ba(le.clientX);Mn.current=we,sa({a:we,b:we})},[C,$,Ba]),Ua=M.useCallback(le=>{Mn.current!=null&&sa({a:Mn.current,b:Ba(le.clientX)})},[Ba]),qn=M.useCallback(()=>{if(Mn.current==null)return;const le=en;if(Mn.current=null,sa(null),!le||Math.abs(le.b-le.a)<1.5)return;const we=Li(Math.min(le.a,le.b)),De=Li(Math.max(le.a,le.b)),Ye=Math.max(0,Math.min(we,De)),$t=Math.min($,Math.max(we,De));$t-Ye>$*.005&&rt([Ye,$t])},[en,Li,$]),Fa=M.useCallback(()=>{Mn.current=null,sa(null)},[]),ai=Ut!=null;M.useEffect(()=>{i===void 0&&O&&!q[O]&&se(null)},[q,O,i]);const ja=I?q[I]:null,Ea=p&&!!ja,Di=M.useRef(null),ii=M.useCallback(()=>{const le=I;ie(null),le&&pt(le)},[I,ie,pt]),Ha=ln.length,Vn=["trace-viewer",A].filter(Boolean).join(" ");return H.length?d.jsxs("div",V(R({ref:z,className:Vn},L),{children:[m&&d.jsx(mz,{model:K,resolveColor:G,resolveLabel:W}),g&&d.jsxs("div",{className:"trace-viewer__toolbar",children:[d.jsxs("div",{className:"trace-viewer__toolbar-group",children:[d.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:Ia,title:"Expand all","aria-label":"Expand all",children:d.jsx(Ee,{name:"chevronDown",size:14})}),d.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:ei,title:"Collapse all","aria-label":"Collapse all",children:d.jsx(Ee,{name:"chevronRight",size:14})})]}),d.jsxs("div",{className:"trace-viewer__toolbar-group",children:[d.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:()=>_r(-1),disabled:!Ha,title:"Previous error","aria-label":"Previous error",children:d.jsx(Ee,{name:"arrowUp",size:14})}),d.jsxs("span",{className:"trace-viewer__error-count"+(Ha?" is-active":""),children:[Ha," error",Ha!==1?"s":""]}),d.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:()=>_r(1),disabled:!Ha,title:"Next error","aria-label":"Next error",children:d.jsx(Ee,{name:"arrowDown",size:14})})]}),C&&d.jsxs("div",{className:"trace-viewer__toolbar-group",children:[d.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:()=>rt(null),disabled:!ai,title:"Reset zoom","aria-label":"Reset zoom",children:d.jsx(Ee,{name:"reload",size:14})}),d.jsx("span",{className:"trace-viewer__zoom-hint",children:ai?`${Fn($e[0])} – ${Fn($e[1])}`:"drag axis to zoom"})]})]}),d.jsxs("div",{className:"trace-viewer__body",children:[d.jsxs("div",{className:"trace-viewer__lane",children:[d.jsxs("div",{className:"trace-viewer__lane-head",style:{height:32},children:[d.jsxs("div",{className:"trace-viewer__tree-head",style:{width:y},children:[d.jsxs("span",{className:"trace-viewer__eyebrow",children:["SPAN · ",ke.length,"/",H.length]}),d.jsx("span",{className:"trace-viewer__eyebrow",children:"DURATION"})]}),d.jsxs("div",{className:"trace-viewer__axis"+(C?" is-zoomable":""),ref:ti,onPointerDown:ni,onPointerMove:Ua,onPointerUp:qn,onPointerCancel:Fa,onLostPointerCapture:Fa,onDoubleClick:()=>rt(null),children:[xt.map((le,we)=>d.jsx("div",{className:"trace-viewer__tick-label",style:{left:`${Ue.x(le)}%`},children:le===0?"0":Fn(le)},we)),en&&d.jsx("div",{className:"trace-viewer__brush",style:{left:`${Math.min(en.a,en.b)}%`,width:`${Math.abs(en.b-en.a)}%`}})]})]}),d.jsx("div",{className:"trace-viewer__scroll",ref:Rt,children:d.jsxs("div",{className:"trace-viewer__rows",style:{height:Me},children:[d.jsx("div",{ref:za,className:"trace-viewer__sentinel"}),d.jsx("div",{className:"trace-viewer__tree",role:"tree","aria-label":"Span tree",tabIndex:0,onKeyDown:Je,style:{width:y,height:Me},children:Oe.map((le,we)=>{const De=ce+we;return d.jsx("div",{className:"trace-viewer__row-abs",style:{top:De*_},children:d.jsx(fz,{node:le,rowHeight:_,treeWidth:y,selected:I===le.id,hovered:vt===le.id,collapsed:Ce.has(le.id),color:G(le.service),onSelect:Ye=>Xe(Ye,!1),onHover:mt,onToggle:Se,registerRef:_t})},le.id)})}),d.jsxs("div",{className:"trace-viewer__wf",style:{height:Me},children:[xt.map((le,we)=>d.jsx("div",{className:"trace-viewer__gridline",style:{left:`${Ue.x(le)}%`}},we)),d.jsx("svg",{className:"trace-viewer__connectors",width:"100%",height:Me,viewBox:`0 0 100 ${Me}`,preserveAspectRatio:"none",children:ke.map(le=>{if(!le.parentId)return null;const we=ft.get(le.id),De=ft.get(le.parentId);if(we==null||De==null)return null;const Ye=Math.min(we,De);if(Math.max(we,De)<ce-24||Ye>de+24)return null;const $t=q[le.parentId],ra=Ue.x($t.start),on=Ue.x(le.start),fn=De*_+_/2+5,Gn=we*_+_/2,J=nt.has(le.id)&&nt.has(le.parentId);return d.jsx("path",{d:`M ${ra} ${fn} L ${ra} ${Gn} L ${on} ${Gn}`,className:"trace-viewer__connector"+(J?" is-active":""),vectorEffect:"non-scaling-stroke"},le.id)})}),Oe.map((le,we)=>{const De=ce+we;return d.jsx("div",{className:"trace-viewer__row-abs",style:{top:De*_},children:d.jsx(hz,{node:le,rowHeight:_,scaleX:Ue.x,scaleW:Ue.w,selected:I===le.id,hovered:vt===le.id,color:G(le.service),onSelect:Ye=>Xe(Ye,!1),onHover:mt})},le.id)})]})]})})]}),p&&d.jsx("div",{className:"trace-viewer__panel"+(Ea?" is-open":""),style:{width:Ea?x:0},children:ja&&d.jsx(Vw,{span:ja,model:K,traceId:(T=P.meta)==null?void 0:T.traceId,resolveColor:G,serviceLabel:W(ja.service),serviceHost:(B=Q[ja.service])==null?void 0:B.host,onClose:ii,onSelect:le=>Xe(le,!1),renderAttributes:k,closeButtonRef:Di})})]})]})):d.jsx("div",V(R({ref:z,className:Vn},L),{children:d.jsx("div",{className:"trace-viewer__empty",children:"No spans in this trace."})}))});pz.displayName="TraceViewer";function Gw(e,t){let n;try{n=e()}catch(r){return}return{getItem:r=>{var c;const o=h=>h===null?null:JSON.parse(h,void 0),u=(c=n.getItem(r))!=null?c:null;return u instanceof Promise?u.then(o):o(u)},setItem:(r,c)=>n.setItem(r,JSON.stringify(c,void 0)),removeItem:r=>n.removeItem(r)}}const jp=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(i){return jp(i)(n)},catch(i){return this}}}catch(n){return{then(i){return this},catch(i){return jp(i)(n)}}}},gz=(e,t)=>(n,i,r)=>{let c=R({storage:Gw(()=>window.localStorage),partialize:w=>w,version:0,merge:(w,N)=>R(R({},N),w)},t),o=!1,u=0;const h=new Set,m=new Set;let g=c.storage;if(!g)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${c.name}', the given storage is currently unavailable.`),n(...w)},i,r);const p=()=>{const w=c.partialize(R({},i()));return g.setItem(c.name,{state:w,version:c.version})},y=r.setState;r.setState=(w,N)=>(y(w,N),p());const x=e((...w)=>(n(...w),p()),i,r);r.getInitialState=()=>x;let _;const S=()=>{var w,N;if(!g)return;const k=++u;o=!1,h.forEach(j=>{var A;return j((A=i())!=null?A:x)});const C=((N=c.onRehydrateStorage)==null?void 0:N.call(c,(w=i())!=null?w:x))||void 0;return jp(g.getItem.bind(g))(c.name).then(j=>{if(j)if(typeof j.version=="number"&&j.version!==c.version){if(c.migrate){const A=c.migrate(j.state,j.version);return A instanceof Promise?A.then(L=>[!0,L]):[!0,A]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,j.state];return[!1,void 0]}).then(j=>{var A;if(k!==u)return;const[L,z]=j;if(_=c.merge(z,(A=i())!=null?A:x),n(_,!0),L)return p()}).then(()=>{k===u&&(C==null||C(_,void 0),_=i(),o=!0,m.forEach(j=>j(_)))}).catch(j=>{k===u&&(C==null||C(void 0,j))})};return r.persist={setOptions:w=>{c=R(R({},c),w),w.storage&&(g=w.storage)},clearStorage:()=>{g==null||g.removeItem(c.name)},getOptions:()=>c,rehydrate:()=>S(),hasHydrated:()=>o,onHydrate:w=>(h.add(w),()=>{h.delete(w)}),onFinishHydration:w=>(m.add(w),()=>{m.delete(w)})},c.skipHydration||S(),_||x},yz=gz,Bb=typeof window!="undefined"?window.innerWidth>=1300:!1;function Ep(e){typeof document!="undefined"&&document.body.classList.toggle("dark-canvas",e)}const Ro=(e,t)=>`${e}:${t}`,vz="dr-viewer-ui-preferences",xz={getItem:e=>typeof window!="undefined"?window.localStorage.getItem(e):null,setItem:(e,t)=>{typeof window!="undefined"&&window.localStorage.setItem(e,t)},removeItem:e=>{typeof window!="undefined"&&window.localStorage.removeItem(e)}},Ne=md()(yz(e=>({view:"model",layerId:null,selectedId:null,changesetId:null,canvasDark:!0,chatOpen:Bb,wide:Bb,mode:"graph",focus:"layer",expandedSections:new Set(["model"]),expandedLayers:new Set,graphLayout:"force",showClusterBoundaries:!0,showAllRelations:!0,nodeMarginPreset:"default",setView:t=>e({view:t}),selectLayer:t=>e(n=>{const i=new Set(n.expandedLayers);return i.add(Ro(n.view,t)),{layerId:t,selectedId:null,focus:"layer",expandedSections:new Set(n.expandedSections).add(n.view),expandedLayers:i}}),selectNode:t=>e({selectedId:t,focus:"node"}),selectGraphNode:t=>e(n=>({selectedId:t,focus:"node",expandedSections:new Set(n.expandedSections).add(n.view),expandedLayers:n.layerId?new Set(n.expandedLayers).add(Ro(n.view,n.layerId)):n.expandedLayers})),navigateToElement:(t,n)=>e(i=>{const c=i.layerId===n?i.expandedLayers:new Set(i.expandedLayers).add(Ro("model",n));return{view:"model",layerId:n,selectedId:t,focus:"node",expandedSections:new Set(i.expandedSections).add("model"),expandedLayers:c}}),navigateToSpecNode:(t,n)=>e(i=>{const c=i.layerId===n?i.expandedLayers:new Set(i.expandedLayers).add(Ro("spec",n));return{view:"spec",layerId:n,selectedId:t,focus:"node",expandedSections:new Set(i.expandedSections).add("spec"),expandedLayers:c}}),selectChangeset:t=>e(n=>({view:"changesets",changesetId:t,expandedSections:new Set(n.expandedSections).add("changesets")})),setMode:t=>e({mode:t}),toggleCanvasDark:()=>e(t=>{const n=!t.canvasDark;return Ep(n),{canvasDark:n}}),toggleChat:()=>e(t=>({chatOpen:!t.chatOpen})),toggleSection:t=>e(n=>{const i=new Set(n.expandedSections);i.has(t)?i.delete(t):i.add(t);const r=n.view!==t;return R({view:t,expandedSections:i},r?{selectedId:null,focus:"layer"}:{})}),toggleLayer:(t,n)=>e(i=>{const r=Ro(t,n),c=new Set(i.expandedLayers),o=c.has(r);return o?c.delete(r):c.add(r),{view:t,layerId:n,selectedId:o?i.selectedId:null,focus:o?i.focus:"layer",expandedSections:new Set(i.expandedSections).add(t),expandedLayers:c}}),setWide:t=>e({wide:t}),setGraphLayout:t=>e({graphLayout:t}),toggleClusterBoundaries:()=>e(t=>({showClusterBoundaries:!t.showClusterBoundaries})),toggleShowAllRelations:()=>e(t=>({showAllRelations:!t.showAllRelations})),setNodeMarginPreset:t=>e({nodeMarginPreset:t})}),{name:vz,version:1,storage:Gw(()=>xz),partialize:e=>({canvasDark:e.canvasDark,chatOpen:e.chatOpen,graphLayout:e.graphLayout,showClusterBoundaries:e.showClusterBoundaries,showAllRelations:e.showAllRelations,nodeMarginPreset:e.nodeMarginPreset}),onRehydrateStorage:()=>e=>{e&&Ep(e.canvasDark)}}));typeof document!="undefined"&&Ep(Ne.getState().canvasDark);const bz=new Set(["force","galaxy","force-clustered"]),_z=new Set(["tight","default","wide"]);{const e=Ne.getState(),t={};bz.has(e.graphLayout)||(t.graphLayout="force"),_z.has(e.nodeMarginPreset)||(t.nodeMarginPreset="default"),Object.keys(t).length>0&&Ne.setState(t)}typeof window!="undefined"&&window.addEventListener("resize",()=>{const e=window.innerWidth>=1300;e!==Ne.getState().wide&&Ne.getState().setWide(e)});const zo=md(e=>({state:"disconnected",reconnectAttempt:0,reconnectDelay:0,lastError:null,lastConnectedAt:null,lastDisconnectedAt:null,setConnecting:()=>e({state:"connecting",lastError:null}),setConnected:()=>e({state:"connected",reconnectAttempt:0,reconnectDelay:0,lastError:null,lastConnectedAt:new Date}),setDisconnected:()=>e({state:"disconnected",lastDisconnectedAt:new Date}),setReconnecting:(t,n)=>e({state:"reconnecting",reconnectAttempt:t,reconnectDelay:n}),setError:t=>e({state:"error",lastError:t}),reset:()=>e({state:"disconnected",reconnectAttempt:0,reconnectDelay:0,lastError:null,lastConnectedAt:null,lastDisconnectedAt:null})})),Sz={connected:{label:"connected",color:"#10B981"},connecting:{label:"connecting",color:"#FBBF24"},reconnecting:{label:"reconnecting",color:"#FBBF24"},disconnected:{label:"disconnected",color:"#64748B"},error:{label:"disconnected",color:"#F43F5E"}},wz=[{value:"light",label:"light"},{value:"dark",label:"dark"}];function Nz(){const e=Ne(o=>o.canvasDark),t=Ne(o=>o.toggleCanvasDark),n=Ne(o=>o.chatOpen),i=Ne(o=>o.toggleChat),r=zo(o=>o.state),c=Sz[r];return d.jsxs("div",{style:{height:54,flex:"none",display:"flex",alignItems:"center",gap:18,padding:"0 16px",background:"rgb(var(--shell-bg-2))",borderBottom:"1px solid rgb(var(--shell-border))"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[d.jsx("div",{style:{width:24,height:24,borderRadius:6,background:"linear-gradient(135deg,#FBBF24,#B45309)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"'JetBrains Mono',monospace",fontWeight:700,fontSize:12,color:"#1B1206"},children:"dr"}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",lineHeight:1.15},children:[d.jsx("span",{style:{fontSize:13,fontWeight:600,color:"rgb(var(--shell-fg-1))"},children:"Documentation Robotics"}),d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.08em",color:"rgb(var(--shell-fg-3))"},children:"architecture viewer"})]})]}),d.jsx("div",{style:{flex:1}}),d.jsx(Ss,{value:e?"dark":"light",onChange:o=>{o==="dark"!==e&&t()},options:wz,"aria-label":"Canvas theme"}),d.jsxs("button",{type:"button",onClick:i,"aria-pressed":n,style:{display:"flex",alignItems:"center",gap:7,padding:"6px 12px",borderRadius:7,fontSize:12,fontWeight:500,fontFamily:"inherit",cursor:"pointer",transition:"all .12s",background:n?"rgb(var(--shell-surface))":"transparent",color:n?"rgb(var(--shell-fg-1))":"rgb(var(--shell-fg-2))",border:n?"1px solid rgb(var(--shell-border-2))":"1px solid rgb(var(--shell-border))"},children:[d.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"#FBBF24",display:"inline-block"}}),"DrBot"]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,paddingLeft:4},"data-testid":"connection-status","data-state":r,children:[d.jsx("span",{style:{position:"relative",width:8,height:8},children:d.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:c.color}})}),d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--shell-fg-2))"},children:c.label})]})]})}const Yw=["motivation","business","security","application","technology","api","data-model","data-store","ux","navigation","apm","testing"],Kw={motivation:"#8B5CF6",business:"#F59E0B",security:"#F43F5E",application:"#818CF8",technology:"#22D3EE",api:"#10B981","data-model":"#2DD4BF","data-store":"#38BDF8",ux:"#F472B6",navigation:"#A78BFA",apm:"#FB923C",testing:"#4ADE80"},Cz={motivation:"Motivation",business:"Business",security:"Security",application:"Application",technology:"Technology",api:"API","data-model":"Data Model","data-store":"Data Store",ux:"UX",navigation:"Navigation",apm:"APM",testing:"Testing"},jz={motivation:"ArchiMate 3.2",business:"ArchiMate 3.2",security:"NIST SP 800-53",application:"ArchiMate 3.2",technology:"ArchiMate 3.2",api:"OpenAPI 3.0","data-model":"JSON Schema Draft 7","data-store":"ISO/IEC 9075 (SQL)",ux:"HTML 5.3",navigation:"SPA Navigation Patterns",apm:"OpenTelemetry",testing:"IEEE 829-2008"},Ez="#6B7280";function Ad(e){return e in Kw}function Za(e){return e&&Ad(e)?Kw[e]:Ez}function Es(e){return e&&Ad(e)?Cz[e]:e?e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):""}function Ld(e){return e&&Ad(e)?jz[e]:""}const kz={nodes:[],links:[],countsByLayer:{},nodesByLayer:{},relCount:0};function Ts(){const e=iM(),t=e.data,n=M.useMemo(()=>{var c,o,u,h,m;if(!(t!=null&&t.nodes))return kz;const i={},r={};for(const g of t.nodes){const p=g.layer_id;p&&(i[p]=((c=i[p])!=null?c:0)+1,((o=r[p])!=null?o:r[p]=[]).push(g))}return{nodes:t.nodes,links:(u=t.links)!=null?u:[],countsByLayer:i,nodesByLayer:r,relCount:(m=(h=t.links)==null?void 0:h.length)!=null?m:0}},[t]);return V(R({},e),{derived:n})}const Mz={version:"",byLayer:{}};function br(){const e=sM(),t=e.data,n=M.useMemo(()=>{var r,c,o,u;if(!(t!=null&&t.schemas))return Mz;const i={};for(const h of Object.values(t.schemas)){const m=h,g=m.layer;if(!(g!=null&&g.id))continue;const p=(r=m.nodeSchemas)!=null?r:{},y=Object.keys(p);i[g.id]={typeCount:y.length,typeIds:y,typeTitles:y.map(x=>{var _,S;return(S=(_=p[x])==null?void 0:_.title)!=null?S:x}),standard:(o=(c=g.inspired_by)==null?void 0:c.standard)!=null?o:Ld(g.id)}}return{version:(u=t.version)!=null?u:"",byLayer:i}},[t]);return V(R({},e),{derived:n,raw:t})}const Tz={add:{op:"add",label:"ADD",color:"#10B981",colorLight:"#047857",background:"rgba(16,185,129,0.12)"},update:{op:"update",label:"MOD",color:"#22D3EE",colorLight:"#0E7490",background:"rgba(34,211,238,0.12)"},delete:{op:"delete",label:"DEL",color:"#F43F5E",colorLight:"#BE123C",background:"rgba(244,63,94,0.12)"}};function Xw(e){const t=(e!=null?e:"").toLowerCase();return t.includes("delete")||t==="del"||t==="remove"?"delete":t.includes("add")||t==="create"?"add":"update"}function Bm(e){var n;if(!e)return"element";const t=(n=e.type)!=null?n:e.predicate;return typeof t=="string"&&t.length>0?t:"element"}function hd(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(hd).join(",")}]`;const t=e;return`{${Object.keys(t).sort().map(n=>`${JSON.stringify(n)}:${hd(t[n])}`).join(",")}}`}function Rz(e,t){if(!e||!t)return[];const n=new Set([...Object.keys(e),...Object.keys(t)]),i=[];for(const r of n)hd(e[r])!==hd(t[r])&&i.push(r);return i}function Az(e){var c,o,u;const t=Xw(e.type);if(t==="add")return((c=e.type)!=null?c:"").includes("relationship")?"Added relationship":`Added ${Bm(e.after)}`;if(t==="delete")return((o=e.type)!=null?o:"").includes("relationship")?"Removed relationship":`Removed ${Bm(e.before)}`;const n=Rz(e.before,e.after);if(n.length===0)return`Updated ${Bm((u=e.after)!=null?u:e.before)}`;const i=n.slice(0,3).join(", "),r=n.length>3?` +${n.length-3} more`:"";return`Changed ${i}${r}`}function Lz(e,t){var r,c,o;const n=Xw(e.type),i=(r=e.elementId)!=null?r:"(unknown)";return{key:`${i}::${(c=e.sequenceNumber)!=null?c:t}`,op:n,meta:Tz[n],elementId:i,layerName:(o=e.layerName)!=null?o:"",detail:Az(e),hasDiff:!!e.before||!!e.after,raw:e}}function Dz(e){return e?e.map(Lz):[]}function Oz(e){const t=e.before?JSON.stringify(e.before,null,2):"",n=e.after?JSON.stringify(e.after,null,2):"",i=t?t.split(`
80
- `):[],r=n?n.split(`
81
- `):[],c=new Set(i),o=new Set(r),u=[];for(const h of i)o.has(h)||u.push({type:"removed",content:h});for(const h of r)c.has(h)||u.push({type:"added",content:h});return u}function zz(e,t){if(!t)return e;const{additions:n,modifications:i,deletions:r}=t;return`${n} additions · ${i} modifications · ${r} deletions in this changeset.`}const Iz={list:[]};function dc(){const e=rM(),t=e.data,n=M.useMemo(()=>{const i=t==null?void 0:t.changesets;if(!i)return Iz;const r=Object.entries(i).map(([c,o])=>{var u,h,m,g;return{id:c,name:(u=o.name)!=null?u:c,status:(h=o.status)!=null?h:"unknown",created:(m=o.created)!=null?m:"",changesCount:(g=o.changes_count)!=null?g:0}});return r.sort((c,o)=>o.created.localeCompare(c.created)),{list:r}},[t]);return V(R({},e),{derived:n})}const Bz={additions:0,modifications:0,deletions:0};function Qw(e){const t=lM(e!=null?e:"",{enabled:!!e}),n=t.data,i=M.useMemo(()=>{var r,c,o,u,h,m,g,p,y,x,_,S,w,N,k,C;return n?{id:(c=(r=n.id)!=null?r:e)!=null?c:"",name:(u=(o=n.name)!=null?o:n.id)!=null?u:"",status:(h=n.status)!=null?h:"unknown",created:(m=n.created)!=null?m:"",modified:(g=n.modified)!=null?g:"",baseSnapshot:(p=n.baseSnapshot)!=null?p:"",stats:{additions:(x=(y=n.stats)==null?void 0:y.additions)!=null?x:0,modifications:(S=(_=n.stats)==null?void 0:_.modifications)!=null?S:0,deletions:(N=(w=n.stats)==null?void 0:w.deletions)!=null?N:0},rows:Dz(n.changes),changesCount:(C=(k=n.changes)==null?void 0:k.length)!=null?C:0}:null},[n,e]);return V(R({},t),{detail:i,emptyStats:Bz})}const Uz=[{id:"model",label:"Model",icon:"graph"},{id:"spec",label:"Schema",icon:"schema"},{id:"changesets",label:"Changesets",icon:"clock"}];function Zw({open:e}){return d.jsx("span",{style:{position:"absolute",right:12,top:0,bottom:0,display:"flex",alignItems:"center",pointerEvents:"none"},children:d.jsx("span",{className:`drv-chev${e?" drv-chev--open":""}`})})}function Fz({section:e}){const t=Ne(u=>u.view),n=Ne(u=>u.expandedSections),i=Ne(u=>u.toggleSection),{derived:r}=dc(),c=n.has(e.id),o=e.id==="changesets"?r.list.length:12;return d.jsxs("div",{style:{position:"relative"},children:[d.jsx(Jo,{icon:e.icon,label:e.label,count:o,active:t===e.id,depth:0,onClick:()=>i(e.id)}),d.jsx(Zw,{open:c})]})}function Hz({sectionId:e,slug:t}){var N,k,C;const n=Ne(j=>j.view),i=Ne(j=>j.layerId),r=Ne(j=>j.selectedId),c=Ne(j=>j.expandedLayers),o=Ne(j=>j.toggleLayer),u=Ne(j=>j.selectNode),{derived:h}=Ts(),{derived:m}=br(),g=`${e}:${t}`,p=c.has(g),y=n===e&&i===t,x=m.byLayer[t],_=(N=h.nodesByLayer[t])!=null?N:[],S=e==="spec"?(k=x==null?void 0:x.typeCount)!=null?k:0:_.length,w=e==="spec"?((C=x==null?void 0:x.typeIds)!=null?C:[]).map((j,A)=>{var L;return{id:`${t}.${j}`,label:(L=x==null?void 0:x.typeTitles[A])!=null?L:j}}):_.map(j=>({id:j.id,label:j.name}));return d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:{position:"relative"},children:[d.jsx(Jo,{label:Es(t),count:S,active:y,depth:1,onClick:()=>o(e,t)}),d.jsx(Zw,{open:p})]}),p&&w.map(j=>{const A=n===e&&i===t&&r===j.id;return d.jsx("div",{style:{position:"relative"},children:d.jsx(Jo,{label:j.label,active:A,depth:1,className:"drv-nav-l2",onClick:()=>u(j.id),title:j.label})},j.id)})]})}function Pz(){const e=Ne(r=>r.view),t=Ne(r=>r.changesetId),n=Ne(r=>r.selectChangeset),{derived:i}=dc();return i.list.length===0?d.jsx("div",{style:{padding:"8px 10px 8px 34px",fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--shell-fg-4))"},children:"no changesets"}):d.jsx(d.Fragment,{children:i.list.map(r=>{const c=e==="changesets"&&t===r.id;return d.jsx("div",{style:{position:"relative"},children:d.jsx(Jo,{label:r.name,count:r.changesCount,active:c,depth:1,onClick:()=>n(r.id),title:r.name})},r.id)})})}function $z(){const e=Ne(t=>t.expandedSections);return d.jsx("div",{className:"drv-scroll drv-noscroll",style:{flex:1,overflowY:"auto",padding:"8px"},"data-testid":"nav-tree",children:Uz.map(t=>{const n=e.has(t.id);return d.jsxs("div",{children:[d.jsx(Fz,{section:t}),n&&t.id==="changesets"&&d.jsx(Pz,{}),n&&t.id!=="changesets"&&Yw.map(i=>d.jsx(Hz,{sectionId:t.id,slug:i},i))]},t.id)})})}function qz(){const{derived:e}=Ts(),{derived:t}=br(),n=e.relCount,i=t.version||"—";return d.jsxs("div",{style:{width:244,flex:"none",background:"rgb(var(--shell-bg-2))",borderRight:"1px solid rgb(var(--shell-border))",display:"flex",flexDirection:"column",minHeight:0},"data-testid":"left-rail",children:[d.jsxs("div",{style:{height:40,flex:"none",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 14px",borderBottom:"1px solid rgb(var(--shell-border))"},children:[d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--shell-fg-3))"},children:"Navigation"}),d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,color:"rgb(var(--shell-fg-4))"},"data-testid":"rail-count"})]}),d.jsx($z,{}),d.jsxs("div",{style:{flex:"none",padding:"10px 14px",borderTop:"1px solid rgb(var(--shell-border))",display:"flex",flexDirection:"column",gap:3},"data-testid":"rail-footer",children:[d.jsxs("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.08em",color:"rgb(var(--shell-fg-3))"},children:["SPEC ",i]}),d.jsxs("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,color:"rgb(var(--shell-fg-4))"},children:["12 layers · ",n," rels"]})]})]})}const kp={fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--shell-fg-3))"},Ub=V(R({},kp),{color:"rgb(var(--shell-fg-4))"});function Vz(){var u;const e=Ne(h=>h.layerId),{derived:t}=Ts(),{derived:n}=br(),i=e&&(u=t.countsByLayer[e])!=null?u:0,r=e?Es(e).toLowerCase():"",c=e?`${i} ${r} elements`:`${t.nodes.length} elements`,o=n.version||"—";return d.jsx(eg,{style:{height:28},"data-testid":"status-bar",left:d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14},children:[d.jsx("span",{style:kp,"data-testid":"status-elements",children:c}),d.jsx("span",{style:Ub,children:"·"}),d.jsxs("span",{style:kp,children:[t.relCount," refs indexed · 0 unresolved"]})]}),right:d.jsxs("span",{style:Ub,children:["cli ",o," · refs ok"]})})}function Gz(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\./g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Dd(e){return`${e.layer_id}.${e.type}.${Gz(e.name)}`}function Od(e){const t=new Map,n=new Map;for(const i of e.nodes)n.set(i.id,i),t.set(i.id,i),t.set(Dd(i),i);return{byEndpoint:t,byUuid:n}}function Qa(e,t){return e.byEndpoint.get(t)}function Yz(e,t){var i;return((i=e.nodesByLayer[t])!=null?i:[]).map(r=>({id:r.id,label:r.name,kind:r.type,domainColor:t}))}function Kz(e,t,n){const i=[];for(const r of e.links){const c=Qa(n,r.source),o=Qa(n,r.target);!c||!o||c.layer_id!==t||o.layer_id!==t||i.push({id:r.id,sourceId:c.id,targetId:o.id,label:r.type})}return i}function Oa(e,t){var i;return(i=e==null?void 0:e.schemas)==null?void 0:i[`${t}.json`]}function zd(e,t){const n=`${e}.`;if(t.startsWith(n))return t.slice(n.length);const i=t.lastIndexOf(".");return i>=0?t.slice(i+1):t}function Fb(e,t,n){var c,o,u;const i=zd(t,n),r=Oa(e,t);return(u=(o=(c=r==null?void 0:r.nodeSchemas)==null?void 0:c[i])==null?void 0:o.title)!=null?u:i}function Xz(e,t){var c;const n=Oa(e,t),i=(c=n==null?void 0:n.nodeSchemas)!=null?c:{};return Object.entries(i).map(([o,u])=>{var h;return{id:`${t}.${o}`,label:(h=u.title)!=null?h:o,kind:"spec node",domainColor:t}})}const Qz={"many-to-many":"N:N","one-to-many":"1:N","many-to-one":"N:1","one-to-one":"1:1"};function Mp(e){var t;return e&&(t=Qz[e])!=null?t:""}function Zz(e,t){var c;const n=Oa(e,t),i=(c=n==null?void 0:n.relationshipSchemas)!=null?c:{},r=[];for(const o of Object.values(i))o.source_layer!==t||o.destination_layer!==t||o.source_spec_node_id!==o.destination_spec_node_id&&r.push({id:o.id,sourceId:o.source_spec_node_id,targetId:o.destination_spec_node_id,label:o.predicate});return r}function Jw(e,t){var c;const n=Oa(e,t),i=(c=n==null?void 0:n.relationshipSchemas)!=null?c:{};let r=0;for(const o of Object.values(i))o.source_layer===t&&o.destination_layer===t&&(r+=1);return r}function Jz(e,t,n){var u;const i=Oa(e,t),r=(u=i==null?void 0:i.relationshipSchemas)!=null?u:{},c=[];let o=0;for(const h of Object.values(r)){const m=Mp(h.cardinality),g=m?`${h.predicate} ${m}`:h.predicate;h.source_spec_node_id===n?c.push({id:`out-${o++}-${h.id}`,target:h.destination_spec_node_id,targetTitle:Fb(e,h.destination_layer,h.destination_spec_node_id),targetDomain:h.destination_layer,predicate:g,direction:"out"}):h.destination_spec_node_id===n&&c.push({id:`in-${o++}-${h.id}`,target:h.source_spec_node_id,targetTitle:Fb(e,h.source_layer,h.source_spec_node_id),targetDomain:h.source_layer,predicate:g,direction:"in"})}return c}function Og(e){var r,c,o;const t=(r=e==null?void 0:e.properties)==null?void 0:r.attributes,n=new Set((c=t==null?void 0:t.required)!=null?c:[]),i=(o=t==null?void 0:t.properties)!=null?o:{};return Object.entries(i).map(([u,h])=>{var m;return{name:u,type:(m=h==null?void 0:h.type)!=null?m:"object",required:n.has(u)}})}function Wz(e,t,n){var u,h;const i=Oa(e,t),r=zd(t,n),c=(u=i==null?void 0:i.nodeSchemas)==null?void 0:u[r];if(!c)return null;const o={};for(const m of Og(c))o[m.name]=m.required?"required":"—";return{id:n,title:(h=c.title)!=null?h:r,kind:"SPEC NODE",domain:t,description:c.description,metadata:o}}function e8(e,t){var r;const n=Oa(e,t),i=Object.keys((r=n==null?void 0:n.nodeSchemas)!=null?r:{})[0];return i?`${t}.${i}`:void 0}const zg=Za("application"),Ww=Za("navigation"),eN="rgb(var(--status-emerald))",tN="rgb(var(--accent-primary))",nN="rgb(var(--accent-primary-deep))",Tp="—";function Cs(e){return e==null||e===""?Tp:String(e)}function et(e,t,n){return{text:Cs(e),kind:t,color:n}}function jt(e,t,n){return{key:e,value:Cs(t),prose:n}}function Ig(e,t,n){return[{label:e==="spec"?"schema":"model",target:{kind:"section",view:e}},{label:t,target:{kind:"layer",view:e,layerId:t},current:n}]}const t8="minmax(0,1.1fr) minmax(0,1.5fr) 78px",n8="minmax(0,1.3fr) minmax(0,1fr) minmax(0,0.9fr) 96px",a8="minmax(0,1fr) minmax(0,0.9fr) minmax(0,1.2fr)";function i8(e,t,n,i,r){var k,C,j,A,L,z;if(!Ad(t))return null;const c=Oa(r,t),o=c==null?void 0:c.layer,u=o==null?void 0:o.number,h=(C=(k=o==null?void 0:o.inspired_by)==null?void 0:k.standard)!=null?C:Ld(t),m=(j=c==null?void 0:c.nodeSchemas)!=null?j:{},g=Object.keys(m).length,p=Jw(r,t),y=(A=n.nodesByLayer[t])!=null?A:[],x=Za(t),_=Es(t),S=Object.entries(m).map(([F,D])=>{var B;const T=y.filter(P=>P.type===F).length;return{target:{kind:"specNode",specNodeId:`${t}.${F}`,layerId:t},cells:[et((B=D.title)!=null?B:F,"name"),et(`${t}.${F}`,"dim"),et(T,"num")]}}),w=y.map(F=>{let D=0,T=0;for(const B of n.links){const P=Qa(i,B.source);if(!P||P.id!==F.id)continue;const K=Qa(i,B.target);K&&(K.layer_id===t?D+=1:T+=1)}return{target:{kind:"element",elementId:F.id,layerId:t},cells:[et(F.name,"name"),et(F.type,"mono"),et(Bg(F),"dim"),et(`${D} · ${T}`,"num")]}}),N=[];for(const F of y)for(const D of n.links){const T=Qa(i,D.source);if(!T||T.id!==F.id)continue;const B=Qa(i,D.target);!B||B.layer_id===t||N.push({target:{kind:"element",elementId:B.id,layerId:B.layer_id},cells:[et(F.name,"name"),et(D.type,"dim"),et(`${B.layer_id}.${B.type}`,"mono",Za(B.layer_id))]})}return{eyebrow:`LAYER ${Cs(u)} · ${h}`,title:_,idChip:t,meta:`${g} node types · ${p} relationship schemas`,color:x,crumbs:Ig(e,t,!0),description:`${_} is layer ${Cs(u)} of 12 in the federated model, inspired by ${h}. The spec defines ${g} node types and ${p} valid relationship schemas for this layer; the loaded model holds ${y.length} elements.`,stats:[{label:"NODE TYPES",value:g,color:x},{label:"RELATIONSHIPS",value:p,color:zg},{label:"ELEMENTS",value:y.length,color:eN},{label:"LAYER",value:`${Cs(u)} / 12`,color:tN}],factsTitle:"LAYER SPEC",facts:[jt("layer_id",t),jt("number",u),jt("name",_,!0),jt("description",o==null?void 0:o.description,!0),jt("inspired_by.standard",h),jt("inspired_by.version",(L=o==null?void 0:o.inspired_by)==null?void 0:L.version),jt("inspired_by.url",(z=o==null?void 0:o.inspired_by)==null?void 0:z.url),jt("spec source",`spec/dist/${t}.json`)],tables:[{title:"Spec node types",columns:["node type","spec_node_id","instances"],widths:t8,rows:S,emptyText:"No node types are published for this layer."},{title:"Elements in model",columns:["name","type","provenance","rels · xrefs"],widths:n8,rows:w,emptyText:"No elements of this layer in the loaded model."},{title:"Cross-layer references",columns:["from","predicate","to"],widths:a8,rows:N,emptyText:"This layer emits no cross-layer references."}]}}const aN="minmax(0,1fr) minmax(0,0.8fr) 96px",s8="minmax(0,1fr) minmax(0,1.2fr) minmax(0,0.8fr) minmax(0,1fr) minmax(0,0.7fr) 62px",r8="minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr) minmax(0,0.8fr)",l8="minmax(0,1fr) minmax(0,1.5fr) 96px";function o8(e){var n,i,r;const t=[];for(const c of Object.values((n=e==null?void 0:e.schemas)!=null?n:{})){const o=c;(i=o==null?void 0:o.layer)!=null&&i.id&&t.push(...Object.values((r=o.relationshipSchemas)!=null?r:{}))}return t}function Hb(e,t,n){var c,o,u;const i=zd(t,n),r=(o=(c=Oa(e,t))==null?void 0:c.nodeSchemas)==null?void 0:o[i];return(u=r==null?void 0:r.title)!=null?u:i}function c8(e,t,n,i){var k,C,j,A,L,z,F,D,T,B,P,K;const r=Oa(n,e),c=zd(e,t),o=(k=r==null?void 0:r.nodeSchemas)==null?void 0:k[c];if(!o)return null;const u=Za(e),h=(A=(j=(C=r==null?void 0:r.layer)==null?void 0:C.inspired_by)==null?void 0:j.standard)!=null?A:Ld(e),m=Og(o),g=((L=i.nodesByLayer[e])!=null?L:[]).filter(H=>H.type===c),p=o8(n),y=p.filter(H=>H.source_spec_node_id===t),x=p.filter(H=>H.destination_spec_node_id===t),_=m.map(H=>({cells:[et(H.name,"mono"),et(H.type,"dim"),et(H.required?"required":"optional","dim",H.required?nN:void 0)]})),S=y.map(H=>({target:{kind:"specNode",specNodeId:H.destination_spec_node_id,layerId:H.destination_layer},cells:[et(H.predicate,"mono"),et(Hb(n,H.destination_layer,H.destination_spec_node_id),"name"),et(H.destination_layer,"dim",Za(H.destination_layer)),et(H.cardinality?Mp(H.cardinality)||H.cardinality:Tp,"dim"),et(H.strength,"dim"),et(H.required?"yes":"no","num")]})),w=x.map(H=>({target:{kind:"specNode",specNodeId:H.source_spec_node_id,layerId:H.source_layer},cells:[et(Hb(n,H.source_layer,H.source_spec_node_id),"name"),et(H.predicate,"mono"),et(H.cardinality?Mp(H.cardinality)||H.cardinality:Tp,"dim"),et(H.strength,"dim")]})),N=g.map(H=>({target:{kind:"element",elementId:H.id,layerId:e},cells:[et(H.name,"name"),et(Dd(H),"dim"),et(Bg(H),"dim")]}));return{eyebrow:`SPEC NODE · ${h}`,title:(z=o.title)!=null?z:c,idChip:t,meta:`${m.length} attributes · ${g.length} instances`,color:u,crumbs:[...Ig("spec",e,!1),{label:c,current:!0}],description:(F=o.description)!=null?F:"",stats:[{label:"ATTRIBUTES",value:m.length,color:u},{label:"OUTGOING TYPES",value:y.length,color:zg},{label:"INCOMING TYPES",value:x.length,color:Ww},{label:"INSTANCES",value:g.length,color:eN}],factsTitle:"SPEC NODE",facts:[jt("spec_node_id",t),jt("layer_id",e),jt("type",c),jt("title",o.title,!0),jt("extends",(T=(D=o.allOf)==null?void 0:D[0])==null?void 0:T.$ref),jt("schema",o.$id),jt("inspired_by",(P=(B=r==null?void 0:r.layer)==null?void 0:B.inspired_by)!=null&&P.version?`${h} ${r.layer.inspired_by.version}`:h),jt("required",(K=o.required)==null?void 0:K.join(", "))],tables:[{title:"Attributes",columns:["attribute","type","constraint"],widths:aN,rows:_,emptyText:"No attribute schema is published for this node type."},{title:"Valid outgoing relationships",columns:["predicate","destination","layer","cardinality","strength","required"],widths:s8,rows:S,emptyText:"This node type declares no outgoing relationships."},{title:"Valid incoming relationships",columns:["source","predicate","cardinality","strength"],widths:r8,rows:w,emptyText:"No other node type declares a relationship into this one."},{title:"Instances in model",columns:["name","path","provenance"],widths:l8,rows:N,emptyText:"No instances of this node type in the loaded model."}]}}const u8="minmax(0,1fr) minmax(0,1.5fr) 88px",d8="minmax(0,1fr) minmax(0,1.3fr) minmax(0,0.8fr) minmax(0,1.4fr)",f8="minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr) minmax(0,0.8fr)";function Bg(e){var n;const t=e.source_reference;return(n=t==null?void 0:t.provenance)!=null?n:"authored"}function h8(e){var n,i;const t=e.source_reference;return(i=(n=t==null?void 0:t.locations)==null?void 0:n.find(r=>r.symbol||r.file))!=null?i:{}}function m8(e,t,n,i,r){var j,A,L,z,F;const c=i.byUuid.get(t);if(!c||c.layer_id!==e)return null;const o=Za(e),u=Es(e),h=Oa(r,e),m=(j=h==null?void 0:h.nodeSchemas)==null?void 0:j[c.type],g=Og(m),p=[],y=[];for(const D of n.links){const T=Qa(i,D.source),B=Qa(i,D.target);if(!(!T||!B))if(T.id===c.id){const P=`${Cs(T.spec_node_id)}.${D.type}.${Cs(B.spec_node_id)}`;p.push({target:{kind:"element",elementId:B.id,layerId:B.layer_id},cells:[et(D.type,"mono"),et(B.name,"name"),et(B.layer_id,"dim",Za(B.layer_id)),et(P,"dim")]})}else B.id===c.id&&y.push({target:{kind:"element",elementId:T.id,layerId:T.layer_id},cells:[et(T.name,"name"),et(D.type,"mono"),et(T.type,"dim"),et(T.layer_id,"dim",Za(T.layer_id))]})}const x=p.filter(D=>{var T;return((T=D.target)==null?void 0:T.kind)==="element"&&D.target.layerId===e}).length,_=p.length-x,S=[{target:{kind:"specNode",specNodeId:`${e}.${c.type}`,layerId:e},cells:[et((A=m==null?void 0:m.title)!=null?A:c.type,"name"),et(`${e}.${c.type}`,"dim"),et(`${g.length} attrs`,"num")]}],w=g.map(D=>({cells:[et(D.name,"mono"),et(D.type,"dim"),et(D.required?"required":"optional","dim",D.required?nN:void 0)]})),N=Dd(c),k=h8(c),C=(L=c.metadata)!=null?L:{};return{eyebrow:`ELEMENT · ${u}`,title:c.name,idChip:c.id,meta:`${p.length} outgoing · ${y.length} incoming`,color:o,crumbs:[...Ig("model",e,!1),{label:c.id,current:!0}],description:(z=c.description)!=null?z:"",stats:[{label:"INTRA-LAYER",value:x,color:o},{label:"CROSS-LAYER",value:_,color:zg},{label:"INCOMING",value:y.length,color:Ww},{label:"VERSION",value:Cs(C.version),color:tN}],factsTitle:"NODE",facts:[jt("path",N),jt("id",c.id),jt("spec_node_id",(F=c.spec_node_id)!=null?F:`${e}.${c.type}`),jt("type",c.type),jt("layer_id",e),jt("name",c.name,!0),jt("source_reference.provenance",Bg(c)),jt("source_reference.file",k.file),jt("source_reference.symbol",k.symbol),jt("metadata.created_at",C.created_at),jt("metadata.updated_at",C.updated_at),jt("metadata.created_by",C.created_by),jt("metadata.version",C.version)],tables:[{title:"Conforms to",columns:["spec node","spec_node_id","attributes"],widths:u8,rows:S,emptyText:"No spec node type resolved for this element."},{title:"Attributes",columns:["attribute","type","constraint"],widths:aN,rows:w,emptyText:"No attribute schema is published for this node type."},{title:"Outgoing relationships",columns:["predicate","target","layer","spec_relationship_id"],widths:d8,rows:p,emptyText:"This element has no outgoing relationships."},{title:"Incoming relationships",columns:["source","predicate","type","layer"],widths:f8,rows:y,emptyText:"No other element references this one."}]}}const Da="'JetBrains Mono',monospace";function p8(){const e=Ne(u=>u.view),t=Ne(u=>u.layerId),n=Ne(u=>u.selectedId),i=Ne(u=>u.focus),{derived:r}=Ts(),{raw:c}=br(),o=M.useMemo(()=>Od(r),[r]);return M.useMemo(()=>!t||e==="changesets"?null:i==="layer"?i8(e,t,r,o,c):n?e==="spec"?c8(t,n,c,r):m8(t,n,r,o,c):null,[e,t,n,i,r,o,c])}function g8(){const e=Ne(r=>r.setView),t=Ne(r=>r.selectLayer),n=Ne(r=>r.navigateToElement),i=Ne(r=>r.navigateToSpecNode);return r=>{if(r)switch(r.kind){case"section":e(r.view);return;case"layer":e(r.view),t(r.layerId);return;case"element":n(r.elementId,r.layerId);return;case"specNode":i(r.specNodeId,r.layerId);return;default:return r}}}const y8={name:{fontSize:13,color:"rgb(var(--canvas-fg-1))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},mono:{fontFamily:Da,fontSize:11,color:"rgb(var(--canvas-fg-2))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},dim:{fontFamily:Da,fontSize:11,color:"rgb(var(--canvas-fg-3))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},num:{fontFamily:Da,fontSize:11,color:"rgb(var(--canvas-fg-2))",textAlign:"right"}};function v8({cell:e}){return d.jsx("span",{role:"cell",style:R(R({},y8[e.kind]),e.color?{color:e.color}:null),children:e.text})}function x8({pg:e,onNavigate:t}){const n={fontFamily:Da,fontSize:11};return d.jsx("nav",{"aria-label":"Breadcrumb",style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:e.crumbs.map((i,r)=>d.jsxs("span",{style:{display:"contents"},children:[r>0&&d.jsx("span",{style:V(R({},n),{color:"rgb(var(--canvas-fg-4))"}),"aria-hidden":"true",children:"/"}),i.target?d.jsx("button",{type:"button",className:`drv-crumb${i.current?" drv-crumb--current":""}`,onClick:()=>t(i.target),"data-testid":"page-crumb",style:R({background:"none",border:"none",padding:0},n),children:i.label}):d.jsx("span",{style:V(R({},n),{color:i.current?"rgb(var(--canvas-fg-1))":"rgb(var(--canvas-fg-3))"}),children:i.label})]},`${i.label}-${r}`))})}function b8({pg:e}){return d.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,minmax(0,1fr))",gap:14},children:e.stats.map(t=>d.jsxs("div",{style:{padding:"12px 14px",background:"rgb(var(--canvas-card))",border:"1px solid rgb(var(--canvas-border))",borderLeft:`2px solid ${t.color}`,borderRadius:8},children:[d.jsx("div",{style:{fontFamily:Da,fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:t.label}),d.jsx("div",{style:{fontSize:28,fontWeight:700,letterSpacing:"-0.02em",color:"rgb(var(--canvas-fg-1))",marginTop:4},children:t.value})]},t.label))})}function _8({pg:e}){return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[d.jsx("span",{style:{fontFamily:Da,fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:e.factsTitle}),d.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(2,minmax(0,1fr))",gap:"1px 32px"},children:e.facts.map(t=>d.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0,150px) minmax(0,1fr)",gap:12,padding:"7px 0",borderBottom:"1px solid rgb(var(--canvas-border))"},children:[d.jsx("span",{style:{fontFamily:Da,fontSize:11,lineHeight:1.45,color:"rgb(var(--canvas-fg-3))",minWidth:0,overflowWrap:"anywhere",wordBreak:"break-word"},children:t.key}),d.jsx("span",{style:t.prose?{fontSize:12,color:"rgb(var(--canvas-fg-1))",overflowWrap:"anywhere"}:{fontFamily:Da,fontSize:11,color:"rgb(var(--canvas-fg-1))",overflowWrap:"anywhere"},children:t.value})]},t.key))})]})}const Pb={display:"grid",gap:14,alignItems:"center",padding:"9px 10px",borderBottom:"1px solid rgb(var(--canvas-border))",borderRadius:4};function S8({row:e,widths:t,onNavigate:n}){const i=e.cells.map((r,c)=>d.jsx(v8,{cell:r},c));return e.target?d.jsx("button",{type:"button",role:"row",className:"drv-row",onClick:()=>n(e.target),"data-testid":"page-row",style:V(R({},Pb),{gridTemplateColumns:t,width:"100%",border:"none",borderBottom:"1px solid rgb(var(--canvas-border))",textAlign:"left",font:"inherit"}),children:i}):d.jsx("div",{role:"row",style:V(R({},Pb),{gridTemplateColumns:t}),children:i})}function w8({pg:e,onNavigate:t}){return d.jsx(d.Fragment,{children:e.tables.map(n=>d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[d.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[d.jsx("span",{style:{fontFamily:Da,fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:n.title}),d.jsx("span",{style:{fontFamily:Da,fontSize:10,color:"rgb(var(--canvas-fg-3))"},children:n.rows.length?n.rows.length:""})]}),n.rows.length===0?d.jsx("span",{style:{fontSize:13,color:"rgb(var(--canvas-fg-3))"},children:n.emptyText}):d.jsxs("div",{role:"table","aria-label":n.title,children:[d.jsx("div",{role:"row",style:{display:"grid",gridTemplateColumns:n.widths,gap:14,alignItems:"center",padding:"0 10px 7px",fontFamily:Da,fontSize:10,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",borderBottom:"1px solid rgb(var(--canvas-border))"},children:n.columns.map(i=>d.jsx("span",{role:"columnheader",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i},i))}),n.rows.map((i,r)=>d.jsx(S8,{row:i,widths:n.widths,onNavigate:t},r))]})]},n.title))})}function N8({pg:e}){const t=g8();return d.jsx("div",{className:"drv-scroll",style:{position:"absolute",inset:0,overflowY:"auto",padding:"2px 22px 44px"},"data-testid":"page-view",children:d.jsxs("div",{style:{maxWidth:1040,display:"flex",flexDirection:"column",gap:28},children:[d.jsx(x8,{pg:e,onNavigate:t}),d.jsx("p",{style:{fontSize:14,lineHeight:1.6,color:"rgb(var(--canvas-fg-2))",margin:0,maxWidth:760,textWrap:"pretty"},children:e.description}),d.jsx(b8,{pg:e}),d.jsx(_8,{pg:e}),d.jsx(w8,{pg:e,onNavigate:t})]})})}const iN="You",C8=/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/;function j8(e){return C8.test(e)}function Id(e){return["annotations",e!=null?e:""]}function sN(e){return["annotation-replies",e]}function E8(e){return Ml({queryKey:Id(e),enabled:!!e,queryFn:()=>Ge(null,null,function*(){var n;return(n=(yield vr().getapiannotations({elementId:e})).annotations)!=null?n:[]})})}function k8(e,t=!0){return Ml({queryKey:sN(e),enabled:t,queryFn:()=>Ge(null,null,function*(){var i;return(i=(yield vr().getapiannotationsannotationIdreplies(e)).replies)!=null?i:[]})})}function M8(){const e=kl();return xd({mutationFn:t=>{var n,i;return vr().postapiannotations({elementId:t.elementId,author:(n=t.author)!=null?n:iN,content:t.content,tags:(i=t.tags)!=null?i:[]})},onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Id(n.elementId)})}})}function T8(){const e=kl();return xd({mutationFn:t=>{const n={};return t.content!==void 0&&(n.content=t.content),t.tags!==void 0&&(n.tags=t.tags),t.resolved!==void 0&&(n.resolved=t.resolved),vr().patchapiannotationsannotationId(t.id,n)},onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Id(n.elementId)})}})}function R8(){const e=kl();return xd({mutationFn:t=>vr().deleteapiannotationsannotationId(t.id),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Id(n.elementId)})}})}function A8(){const e=kl();return xd({mutationFn:t=>{var n;return vr().postapiannotationsannotationIdreplies(t.annotationId,{author:(n=t.author)!=null?n:iN,content:t.content})},onSuccess:(t,n)=>{e.invalidateQueries({queryKey:sN(n.annotationId)})}})}function rN(e){const t=new Date(e).getTime();if(Number.isNaN(t))return e;const n=Date.now()-t,i=Math.round(n/1e3);if(i<45)return"just now";const r=Math.round(i/60);if(r<60)return`${r}m ago`;const c=Math.round(r/60);if(c<24)return`${c}h ago`;const o=Math.round(c/24);if(o<30)return`${o}d ago`;const u=Math.round(o/30);return u<12?`${u}mo ago`:`${Math.round(u/12)}y ago`}function L8(e){const t=new Set;for(const n of e.split(/[\s,]+/)){const i=n.trim().toLowerCase();i&&t.add(i)}return[...t]}const D8={display:"block",fontFamily:"'JetBrains Mono', monospace",fontSize:10.5,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",fontWeight:500},fr={fontFamily:"'JetBrains Mono', monospace",fontSize:10.5,color:"rgb(var(--canvas-fg-3))"},O8={background:"rgb(var(--canvas-card))",border:"1px solid rgb(var(--canvas-border))",borderRadius:8,padding:"10px 12px"};function z8({elementId:e,notify:t}){const[n,i]=M.useState(""),[r,c]=M.useState(""),o=M8(),u=n.trim(),h=M.useMemo(()=>L8(r),[r]),m=h.filter(y=>!j8(y)),g=u.length>=1&&u.length<=5e3&&m.length===0&&!o.isPending,p=()=>{g&&o.mutate({elementId:e,content:u,tags:h},{onSuccess:()=>{i(""),c(""),t("success","Annotation added")},onError:()=>t("error","Failed to add annotation")})};return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[d.jsx(Zp,{value:n,onChange:y=>i(y.target.value),placeholder:"Add an annotation…",rows:3,"aria-label":"New annotation content","data-testid":"annotation-add-content"}),d.jsx(Qo,{mono:!0,value:r,onChange:y=>c(y.target.value),placeholder:"tags (space or comma separated)",error:m.length>0,"aria-label":"New annotation tags","data-testid":"annotation-add-tags"}),m.length>0&&d.jsxs("span",{style:V(R({},fr),{color:"rgb(var(--status-rose))"}),children:["invalid tag",m.length>1?"s":"",": ",m.join(", ")]}),d.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:d.jsx(_n,{variant:"accent",size:"sm",disabled:!g,onClick:p,"data-testid":"annotation-add-submit",children:o.isPending?"Adding…":"Add"})})]})}function I8({annotationId:e,expanded:t,notify:n}){const{data:i=[],isLoading:r}=k8(e,t),c=A8(),[o,u]=M.useState(""),h=o.trim(),m=h.length>=1&&h.length<=5e3&&!c.isPending,g=()=>{m&&c.mutate({annotationId:e,content:h},{onSuccess:()=>{u(""),n("success","Reply added")},onError:()=>n("error","Failed to add reply")})};return d.jsxs("div",{style:{marginTop:8,paddingLeft:12,borderLeft:"2px solid rgb(var(--canvas-border))",display:"flex",flexDirection:"column",gap:8},"data-testid":"annotation-replies",children:[r&&i.length===0?d.jsx("span",{style:fr,children:"loading replies…"}):i.map(p=>d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("span",{style:{fontSize:12,fontWeight:600,color:"rgb(var(--canvas-fg-1))"},children:p.author}),d.jsx("span",{style:fr,title:p.createdAt,children:rN(p.createdAt)})]}),d.jsx("p",{style:{margin:0,fontSize:12.5,lineHeight:1.5,color:"rgb(var(--canvas-fg-2))",whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:p.content})]},p.id)),d.jsxs("div",{style:{display:"flex",gap:6,alignItems:"flex-start"},children:[d.jsx(Qo,{value:o,onChange:p=>u(p.target.value),placeholder:"Reply…","aria-label":"Reply content","data-testid":"annotation-reply-input",style:{flex:1},onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),g())}}),d.jsx(_n,{variant:"secondary",size:"sm",disabled:!m,onClick:g,"data-testid":"annotation-reply-submit",children:"Reply"})]})]})}function B8({annotation:e,elementId:t,notify:n}){const i=T8(),r=R8(),[c,o]=M.useState(!1),[u,h]=M.useState(e.content),[m,g]=M.useState(!1),[p,y]=M.useState(!1),x=u.trim(),_=x.length>=1&&x.length<=5e3&&x!==e.content&&!i.isPending,S=()=>{_&&i.mutate({id:e.id,elementId:t,content:x},{onSuccess:()=>{o(!1),n("success","Annotation updated")},onError:()=>n("error","Failed to update annotation")})},w=()=>{i.mutate({id:e.id,elementId:t,resolved:!e.resolved},{onSuccess:()=>n("success",e.resolved?"Reopened":"Resolved"),onError:()=>n("error","Failed to update annotation")})},N=()=>{r.mutate({id:e.id,elementId:t},{onSuccess:()=>{g(!1),n("success","Annotation deleted")},onError:()=>{g(!1),n("error","Failed to delete annotation")}})},k=C=>{C==="edit"?(h(e.content),o(!0)):C==="resolve"?w():C==="delete"&&g(!0)};return d.jsxs("div",{style:O8,"data-testid":"annotation-item","data-resolved":e.resolved,children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[d.jsx("span",{style:{fontSize:12.5,fontWeight:600,color:"rgb(var(--canvas-fg-1))"},children:e.author}),d.jsx("span",{style:fr,title:e.createdAt,children:rN(e.createdAt)}),e.resolved&&d.jsx(Hn,{variant:"emerald","data-testid":"annotation-resolved-chip",children:"resolved"}),d.jsx("div",{style:{marginLeft:"auto"},children:d.jsx(jw,{placement:"bottom-end",triggerLabel:"Annotation actions",actions:[{id:"edit",label:"Edit",icon:"edit"},{id:"resolve",label:e.resolved?"Reopen":"Resolve",icon:"check"},{type:"separator"},{id:"delete",label:"Delete",icon:"trash",danger:!0}],onAction:k})})]}),c?d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[d.jsx(Zp,{value:u,onChange:C=>h(C.target.value),rows:3,"aria-label":"Edit annotation content","data-testid":"annotation-edit-content",autoFocus:!0}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:6},children:[d.jsx(_n,{variant:"ghost",size:"sm",onClick:()=>o(!1),"data-testid":"annotation-edit-cancel",children:"Cancel"}),d.jsx(_n,{variant:"accent",size:"sm",disabled:!_,onClick:S,"data-testid":"annotation-edit-save",children:i.isPending?"Saving…":"Save"})]})]}):d.jsx("p",{style:{margin:0,fontSize:13,lineHeight:1.55,color:"rgb(var(--canvas-fg-2))",whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:e.content}),e.tags.length>0&&d.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:8},"data-testid":"annotation-tags",children:e.tags.map(C=>d.jsx(Hn,{form:"id-tag",children:C},C))}),d.jsx("div",{style:{marginTop:8},children:d.jsx(_n,{variant:"ghost",size:"sm",onClick:()=>y(C=>!C),"aria-expanded":p,"data-testid":"annotation-replies-toggle",children:p?"Hide replies":"Replies"})}),p&&d.jsx(I8,{annotationId:e.id,expanded:p,notify:n}),d.jsx(X_,{isOpen:m,onClose:()=>g(!1),onConfirm:N,title:"Delete annotation",message:"This permanently removes the annotation and its replies. Continue?",confirmLabel:r.isPending?"Deleting…":"Delete",variant:"danger"})]})}function U8({elementId:e}){const{data:t=[],isLoading:n,isError:i}=E8(e),[r,c]=M.useState({open:!1,variant:"success",title:""}),o=(u,h)=>c({open:!0,variant:u,title:h});return d.jsxs("section",{style:{padding:"16px",borderTop:"1px solid rgb(var(--canvas-border))",display:"flex",flexDirection:"column",gap:12},"data-testid":"annotations-section",children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("span",{style:D8,children:"Annotations"}),d.jsxs("span",{style:fr,"data-testid":"annotations-count",children:["· ",t.length]})]}),d.jsx(z8,{elementId:e,notify:o}),n?d.jsx("span",{style:fr,children:"loading…"}):i?d.jsx("span",{style:V(R({},fr),{color:"rgb(var(--status-rose))"}),children:"failed to load annotations"}):t.length===0?d.jsx("span",{style:{fontSize:12.5,color:"rgb(var(--canvas-fg-3))"},"data-testid":"annotations-empty",children:"No annotations yet"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:t.map(u=>d.jsx(B8,{annotation:u,elementId:e,notify:o},u.id))}),d.jsx(J_,{isOpen:r.open,onClose:()=>c(u=>V(R({},u),{open:!1})),variant:r.variant,title:r.title})]})}function F8(e,t,n){if(!n.byUuid.get(t))return[];const r=[];let c=0;for(const o of e.links){const u=Qa(n,o.source),h=Qa(n,o.target);!u||!h||(u.id===t?r.push({id:`out-${c++}-${o.id}`,target:h.id,targetTitle:h.name,targetDomain:h.layer_id,predicate:o.type,direction:"out"}):h.id===t&&r.push({id:`in-${c++}-${o.id}`,target:u.id,targetTitle:u.name,targetDomain:u.layer_id,predicate:o.type,direction:"in"}))}return r}function H8(e){var t;return(t=e==null?void 0:e.provenance)!=null?t:"authored"}function P8(e){var n,i;const t=(n=e==null?void 0:e.locations)==null?void 0:n.find(r=>r.symbol||r.file);return(i=t==null?void 0:t.symbol)!=null?i:t==null?void 0:t.file}function $8(e,t){const n=e.source_reference,i={layer:t,type:e.type,provenance:H8(n)},r=P8(n);return r&&(i.source=r),{id:e.id,title:e.name,kind:e.type,domain:e.layer_id,description:e.description,metadata:i}}function q8(e){const t=e.lastIndexOf(".");return t>0?e.slice(0,t):e}const V8=320;function G8(){const[e,t]=M.useState(V8),n=Ne(j=>j.view),i=Ne(j=>j.layerId),r=Ne(j=>j.selectedId),c=Ne(j=>j.navigateToElement),o=Ne(j=>j.navigateToSpecNode),{derived:u}=Ts(),{raw:h}=br(),m=M.useMemo(()=>Od(u),[u]),g=n==="spec",p=!g&&r?m.byUuid.get(r):void 0,y=M.useMemo(()=>p?$8(p,Es(p.layer_id)):null,[p]),x=M.useMemo(()=>p?F8(u,p.id,m):[],[u,p,m]),_=M.useMemo(()=>g&&i&&r?Wz(h,i,r):null,[g,h,i,r]),S=M.useMemo(()=>g&&i&&r?Jz(h,i,r):[],[g,h,i,r]),w=g?_:y,N=g?S:x,k=j=>{if(g){o(j,q8(j));return}const A=m.byUuid.get(j);A&&c(A.id,A.layer_id)},C=p?Dd(p):null;return d.jsx(Bw,{open:!!w,width:e,onWidthChange:t,"data-testid":"inspector",children:d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[d.jsx(Uw,{node:w,relationships:N,onNodeSelect:k,emptyStateText:g?"Select a node type to inspect.":"Select an element to inspect."}),C&&d.jsx(U8,{elementId:C})]})})}const Y8=new Set(["realizes","provides","extends","connects","exposes","implements","composes","aggregates","specializes","assigned-to","associated-with","scheduled-for"]);function K8(e){return!!e&&Y8.has(e)}function X8(e){return K8(e.label)}const Q8=[{value:"graph",label:"graph"},{value:"page",label:"page"}],Z8=[{value:"force",label:"Force"},{value:"galaxy",label:"Galaxy"},{value:"force-clustered",label:"Clustered"}],J8=[{value:"on",label:"On"},{value:"off",label:"Off"}],W8=[{value:"tight",label:"Tight"},{value:"default",label:"Default"},{value:"wide",label:"Wide"}],eI=[{value:"structural",label:"Structural"},{value:"all",label:"All"}],tI=120;function nI(e){if(e==="tight")return 0;if(e==="wide")return tI}function aI(){const[e,t]=M.useState(!1),n=M.useRef(null),i=M.useRef(!1),r=Ne(x=>x.graphLayout),c=Ne(x=>x.setGraphLayout),o=Ne(x=>x.showClusterBoundaries),u=Ne(x=>x.toggleClusterBoundaries),h=Ne(x=>x.nodeMarginPreset),m=Ne(x=>x.setNodeMarginPreset),g=Ne(x=>x.showAllRelations),p=Ne(x=>x.toggleShowAllRelations),y=x=>{x.currentTarget.contains(x.relatedTarget)||t(!1)};return d.jsxs("div",{onMouseEnter:()=>t(!0),onMouseLeave:y,onFocus:()=>{if(i.current){i.current=!1;return}t(!0)},onBlur:y,onKeyDown:x=>{var _;x.key==="Escape"&&(t(!1),i.current=!0,(_=n.current)==null||_.focus())},style:{position:"absolute",top:14,left:14,zIndex:1},"data-testid":"graph-controls",children:[d.jsx("button",{ref:n,type:"button",className:"graph-toolbar__btn","aria-label":"Graph display options","aria-expanded":e,"aria-controls":"graph-controls-panel","data-testid":"graph-controls-toggle",onClick:()=>t(!0),style:{background:"transparent"},children:d.jsx(Ee,{name:"settings",size:16})}),e&&d.jsxs("div",{id:"graph-controls-panel",style:{marginTop:6,display:"flex",flexWrap:"wrap",gap:14,rowGap:8,maxWidth:"min(420px, calc(100vw - 28px))",padding:"10px 14px",background:"rgb(var(--canvas-card) / 0.5)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",border:"1px solid rgb(var(--canvas-border))",borderRadius:"var(--radius-lg)",boxShadow:"var(--shadow-md)"},"data-testid":"graph-controls-panel",children:[d.jsx(Fu,{label:"Layout",testId:"graph-layout-control",children:d.jsx(Ss,{value:r,onChange:x=>c(x),options:Z8})}),r!=="force"&&d.jsx(Fu,{label:"Boundaries",testId:"graph-boundaries-control",children:d.jsx(Ss,{value:o?"on":"off",onChange:x=>{x==="on"!==o&&u()},options:J8})}),r!=="galaxy"&&d.jsx(Fu,{label:"Node margin",testId:"graph-margin-control",children:d.jsx(Ss,{value:h,onChange:x=>m(x),options:W8})}),d.jsx(Fu,{label:"Relations",testId:"graph-relations-control",children:d.jsx(Ss,{value:g?"all":"structural",onChange:x=>{x==="all"!==g&&p()},options:eI})})]})]})}function Fu({label:e,testId:t,children:n}){return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},"data-testid":t,children:[d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,textTransform:"uppercase",letterSpacing:"0.08em",color:"rgb(var(--canvas-fg-3))"},children:e}),n]})}function Hu({message:e}){return d.jsx("div",{style:{flex:1,display:"grid",placeItems:"center",color:"rgb(var(--canvas-fg-3))",fontFamily:"'JetBrains Mono',monospace",fontSize:12},"data-testid":"canvas-empty",children:e})}function iI(){var G;const e=Ne(W=>W.view),t=Ne(W=>W.layerId),n=Ne(W=>W.selectedId),i=Ne(W=>W.selectGraphNode),r=Ne(W=>W.selectLayer),c=Ne(W=>W.mode),o=Ne(W=>W.setMode),u=Ne(W=>W.graphLayout),h=Ne(W=>W.showClusterBoundaries),m=Ne(W=>W.showAllRelations),g=Ne(W=>W.nodeMarginPreset),p=p8(),y=c==="page",x=nI(g),_=M.useRef(null),{derived:S}=Ts(),{derived:w,raw:N}=br(),k=e==="spec",C=M.useMemo(()=>Od(S),[S]),j=M.useMemo(()=>t?k?Xz(N,t):Yz(S,t):[],[k,N,S,t]),A=M.useMemo(()=>t?k?Zz(N,t):Kz(S,t,C):[],[k,N,S,t,C]),L=t!=null?t:"",z=((G=w.byLayer[L])==null?void 0:G.standard)||Ld(L),F=k?`META-MODEL${z?` · ${z}`:""}`:`INSTANCE MODEL${z?` · ${z}`:""}`,D=t?k?`${Es(L)} schema`:Es(L):k?"Schema":"Model",T=M.useMemo(()=>{var W,O,se;if(!t)return"";if(k){const ue=(O=(W=w.byLayer[L])==null?void 0:W.typeCount)!=null?O:0,I=Jw(N,L);return`${ue} node types · ${I} relationships`}return`${(se=S.countsByLayer[L])!=null?se:0} elements`},[k,t,L,w,N,S]),B=k?"select a layer to view its schema":"select a layer to view its instance model",P=k?"no node types in this layer":"no elements in this layer",K=y&&p?p.color:Za(L),H=y&&p?p.eyebrow:F,q=y&&p?p.title:D,$=y&&p?p.idChip:t!=null?t:e,Q=y&&p?p.meta:T;return d.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,background:"rgb(var(--canvas-bg))",borderTopLeftRadius:8,overflow:"hidden"},"data-testid":"canvas",children:[d.jsx(ig,{style:{flex:"none",padding:"16px 22px 14px"},eyebrow:d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{width:10,height:10,borderRadius:3,flex:"none",background:K,display:"inline-block"}}),d.jsx("span",{children:H})]}),title:q,idChip:$,actions:d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))"},children:Q}),d.jsx(Ss,{value:c,onChange:W=>o(W),options:Q8,"data-testid":"canvas-mode-toggle"})]})}),d.jsx("div",{ref:_,style:{flex:1,position:"relative",minHeight:0},children:y?t?p?d.jsx(N8,{pg:p}):d.jsx(Hu,{message:"select a node to view its page"}):d.jsx(Hu,{message:B}):d.jsxs(d.Fragment,{children:[t?j.length===0?d.jsx(Hu,{message:P}):d.jsxs(d.Fragment,{children:[d.jsx(Iw,{nodes:j,edges:A,selectedNodeId:n!=null?n:void 0,onNodeSelect:W=>i(W),onBackgroundClick:()=>r(t),centerOnSelect:!0,fullscreenContainerRef:_,layout:u,nodeMargin:x,showClusterBoundaries:h,isStructuralEdge:X8,showAllRelations:m,toolbarPosition:"bottom-left",fitView:u!=="force",fitPadding:40,style:{position:"absolute",inset:0,width:"100%",height:"100%"}},`${e}:${t}:${u}:${g}`),d.jsx(aI,{})]}):d.jsx(Hu,{message:B}),d.jsx(G8,{})]})})]})}function sI(e){return e==="staged"?"#FBBF24":"#10B981"}function $b({message:e}){return d.jsx("div",{style:{flex:1,display:"grid",placeItems:"center",color:"rgb(var(--canvas-fg-3))",fontFamily:"'JetBrains Mono',monospace",fontSize:12},"data-testid":"changeset-canvas-empty",children:e})}function rI({row:e}){const[t,n]=M.useState(!1),i=Ne(c=>c.canvasDark),r=t&&e.hasDiff?Oz(e.raw):[];return d.jsxs("div",{style:{background:"rgb(var(--canvas-card))",border:"1px solid rgb(var(--canvas-border))",borderRadius:8,overflow:"hidden"},"data-testid":"changeset-row","data-op":e.op,children:[d.jsxs("div",{role:e.hasDiff?"button":void 0,tabIndex:e.hasDiff?0:void 0,onClick:e.hasDiff?()=>n(c=>!c):void 0,onKeyDown:e.hasDiff?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),n(o=>!o))}:void 0,style:{display:"flex",alignItems:"flex-start",gap:12,padding:"12px 14px",cursor:e.hasDiff?"pointer":"default"},children:[d.jsx("span",{style:{flex:"none",fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.05em",textTransform:"uppercase",padding:"3px 8px",borderRadius:4,width:42,textAlign:"center",background:e.meta.background,color:i?e.meta.color:e.meta.colorLight},"data-testid":"changeset-op-badge",children:e.meta.label}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3,minWidth:0,flex:1},children:[d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:12,color:"rgb(var(--canvas-fg-1))",wordBreak:"break-all"},children:e.elementId}),d.jsx("span",{style:{fontSize:12,color:"rgb(var(--canvas-fg-3))",lineHeight:1.45},children:e.detail})]}),e.layerName&&d.jsx("span",{style:{flex:"none",fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.04em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",alignSelf:"center"},children:e.layerName})]}),t&&e.hasDiff&&d.jsx("div",{style:{borderTop:"1px solid rgb(var(--canvas-border))",padding:"10px 14px 14px"},children:r.length>0?d.jsx(rg,{lines:r}):d.jsx("div",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))"},children:"no field-level changes"})})]})}function lI(){var u,h,m,g,p,y;const e=Ne(x=>x.changesetId),{derived:t}=dc(),{detail:n}=Qw(e),i=t.list.find(x=>x.id===e),r=(h=(u=n==null?void 0:n.name)!=null?u:i==null?void 0:i.name)!=null?h:"",c=(g=(m=n==null?void 0:n.status)!=null?m:i==null?void 0:i.status)!=null?g:"unknown",o=(y=(p=n==null?void 0:n.changesCount)!=null?p:i==null?void 0:i.changesCount)!=null?y:0;return d.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,background:"rgb(var(--canvas-bg))",borderTopLeftRadius:8,overflow:"hidden"},"data-testid":"canvas",children:[e&&d.jsx(ig,{style:{flex:"none",padding:"16px 22px 14px"},eyebrow:d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{width:10,height:10,borderRadius:3,flex:"none",background:sI(c),display:"inline-block"}}),d.jsx("span",{children:"CHANGESET"})]}),title:r,idChip:c,actions:d.jsxs("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))"},children:[o," changes"]})}),d.jsx("div",{style:{flex:1,position:"relative",minHeight:0},children:e?n?d.jsxs("div",{className:"drv-scroll",style:{position:"absolute",inset:0,overflowY:"auto",padding:"20px 22px"},"data-testid":"changeset-list",children:[d.jsx("p",{style:{fontSize:13,color:"rgb(var(--canvas-fg-2))",margin:"0 0 18px 0",maxWidth:620,lineHeight:1.5},children:zz(n.name,n.stats)}),d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,maxWidth:760},children:n.rows.map(x=>d.jsx(rI,{row:x},x.key))})]}):d.jsx($b,{message:"loading changeset…"}):d.jsx($b,{message:"select a changeset to view its changes"})})]})}function qb(e){return e==="staged"?{color:"amber",label:"STAGED"}:e==="discarded"?{color:"neutral",label:"DISCARDED"}:e==="committed"?{color:"emerald",label:"COMMITTED"}:{color:"neutral",label:e.toUpperCase()}}function Vb(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Um({label:e,value:t}){return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:5},children:[d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:e}),d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:12,color:"rgb(var(--canvas-fg-1))",wordBreak:"break-all"},children:t})]})}function oI(){const e=Ne(n=>n.changesetId),{detail:t}=Qw(e);return d.jsx("div",{style:{width:320,flex:"none",borderLeft:"1px solid rgb(var(--canvas-border))",background:"rgb(var(--canvas-surface))",display:"flex",flexDirection:"column",minHeight:0},"data-testid":"inspector",children:!e||!t?d.jsx("div",{style:{flex:1,display:"grid",placeItems:"center",padding:24,textAlign:"center",color:"rgb(var(--canvas-fg-3))",fontFamily:"'JetBrains Mono',monospace",fontSize:12},"data-testid":"changeset-inspector-empty",children:e?"loading changeset…":"Select a changeset to inspect."}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:{flex:"none",padding:"16px 16px 14px",borderBottom:"1px solid rgb(var(--canvas-border))"},children:[d.jsx("div",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",marginBottom:6},children:"CHANGESET"}),d.jsx("div",{style:{fontSize:16,fontWeight:600,color:"rgb(var(--canvas-fg-1))",lineHeight:1.3},children:t.name}),d.jsxs("div",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))",marginTop:4},children:[t.changesCount," changes"]})]}),d.jsxs("div",{className:"drv-scroll",style:{flex:1,minHeight:0,overflowY:"auto",padding:16,display:"flex",flexDirection:"column",gap:16},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx(P_,{color:qb(t.status).color,"aria-label":t.status}),d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,letterSpacing:"0.06em",color:"rgb(var(--canvas-fg-2))"},children:qb(t.status).label})]}),d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx(Ku,{label:"Added",value:t.stats.additions,color:"emerald",style:{flex:1,padding:11}}),d.jsx(Ku,{label:"Modified",value:t.stats.modifications,color:"cyan",style:{flex:1,padding:11}}),d.jsx(Ku,{label:"Deleted",value:t.stats.deletions,color:"rose",style:{flex:1,padding:11}})]}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[d.jsx(Um,{label:"Created",value:Vb(t.created)}),d.jsx(Um,{label:"Modified",value:Vb(t.modified)}),t.baseSnapshot&&d.jsx(Um,{label:"Base Snapshot",value:t.baseSnapshot})]})]})]})})}class He extends Error{constructor(t,n,i){super(n),this.code=t,this.context=i,this.name="ChatValidationError"}}function Pu(e){if(typeof e!="string"||e.trim().length===0)throw new He("INVALID_MESSAGE_ID","Message ID must be a non-empty string",{id:e})}function lN(e){if(!e||typeof e!="object")throw new He("INVALID_CONTENT","Content must be an object",{content:e});const t=e,n=t.type;if(typeof n!="string")throw new He("INVALID_CONTENT_TYPE","Content must have a type field that is a string",{type:n});if(typeof t.timestamp!="string")throw new He("MISSING_TIMESTAMP","Content must have a timestamp field",{timestamp:t.timestamp});switch(n){case"text":{if(typeof t.content!="string")throw new He("INVALID_TEXT_CONTENT","Text content must have a content field that is a string",{content:t.content});break}case"tool_invocation":{if(typeof t.toolUseId!="string"||t.toolUseId.length===0)throw new He("INVALID_TOOL_USE_ID","Tool invocation must have a non-empty toolUseId",{toolUseId:t.toolUseId});if(typeof t.toolName!="string")throw new He("INVALID_TOOL_NAME","Tool invocation must have a toolName field",{toolName:t.toolName});if(!t.toolInput||typeof t.toolInput!="object")throw new He("INVALID_TOOL_INPUT","Tool invocation must have a toolInput field",{toolInput:t.toolInput});if(!t.status||typeof t.status!="object")throw new He("INVALID_TOOL_STATUS","Tool invocation must have a status field",{status:t.status});break}case"thinking":{if(typeof t.content!="string")throw new He("INVALID_THINKING_CONTENT","Thinking content must have a content field that is a string",{content:t.content});break}case"usage":{if(typeof t.inputTokens!="number")throw new He("INVALID_USAGE","Usage content must have an inputTokens field that is a number",{inputTokens:t.inputTokens});if(typeof t.outputTokens!="number")throw new He("INVALID_USAGE","Usage content must have an outputTokens field that is a number",{outputTokens:t.outputTokens});if(typeof t.totalTokens!="number")throw new He("INVALID_USAGE","Usage content must have a totalTokens field that is a number",{totalTokens:t.totalTokens});if(typeof t.totalCostUsd!="number")throw new He("INVALID_USAGE","Usage content must have a totalCostUsd field that is a number",{totalCostUsd:t.totalCostUsd});break}case"error":{if(typeof t.code!="string")throw new He("INVALID_ERROR","Error content must have a code field that is a string",{code:t.code});if(typeof t.message!="string")throw new He("INVALID_ERROR","Error content must have a message field that is a string",{message:t.message});break}default:throw new He("UNKNOWN_CONTENT_TYPE",`Unknown content type: ${n}. Must be one of: text, tool_invocation, thinking, usage, error`,{type:n})}}function cI(e){if(!e||typeof e!="object")throw new He("INVALID_MESSAGE","Message must be an object",{message:e});const t=e;if(typeof t.id!="string"||t.id.length===0)throw new He("INVALID_MESSAGE_ID","Message must have a non-empty id field",{id:t.id});if(typeof t.role!="string")throw new He("INVALID_ROLE","Message must have a role field that is a string",{role:t.role});const n=["user","assistant","system"];if(!n.includes(t.role))throw new He("INVALID_ROLE_VALUE",`Role must be one of: ${n.join(", ")}`,{role:t.role});if(typeof t.conversationId!="string"||t.conversationId.length===0)throw new He("INVALID_CONVERSATION_ID","Message must have a non-empty conversationId field",{conversationId:t.conversationId});if(typeof t.timestamp!="string"||t.timestamp.length===0)throw new He("INVALID_TIMESTAMP","Message must have a non-empty timestamp field",{timestamp:t.timestamp});if(!Array.isArray(t.parts))throw new He("INVALID_PARTS","Message must have a parts field that is an array",{parts:t.parts});for(let i=0;i<t.parts.length;i++)try{lN(t.parts[i])}catch(r){throw r instanceof He?new He(r.code,`Invalid content at parts[${i}]: ${r.message}`,V(R({},r.context),{partIndex:i})):r}if(t.isStreaming!==void 0&&typeof t.isStreaming!="boolean")throw new He("INVALID_STREAMING_FLAG","isStreaming must be a boolean",{isStreaming:t.isStreaming})}function uI(e){if(!e||typeof e!="object")throw new He("INVALID_SDK_STATUS","SDK status must be an object",{status:e});const t=e;if(typeof t.sdkAvailable!="boolean")throw new He("INVALID_SDK_AVAILABLE","sdkAvailable must be a boolean",{sdkAvailable:t.sdkAvailable});if(t.sdkVersion!==null&&typeof t.sdkVersion!="string")throw new He("INVALID_SDK_VERSION","sdkVersion must be a string or null",{sdkVersion:t.sdkVersion});if(t.errorMessage!==null&&typeof t.errorMessage!="string")throw new He("INVALID_ERROR_MESSAGE","errorMessage must be a string or null",{errorMessage:t.errorMessage})}function dI(e){if(e!==null&&(typeof e!="string"||e.length===0))throw new He("INVALID_CONVERSATION_ID","Conversation ID must be a non-empty string or null",{id:e})}function fI(e){if(e!==null&&typeof e!="string")throw new He("INVALID_ERROR_MESSAGE","Error message must be a string or null",{error:e})}function hI(e){if(!e||typeof e!="object")throw new He("INVALID_UPDATES","Updates must be an object",{updates:e});const t=e;if(t.id!==void 0&&(typeof t.id!="string"||t.id.length===0))throw new He("INVALID_ID_UPDATE","Updated id must be a non-empty string",{id:t.id});if(t.role!==void 0){const n=["user","assistant","system"];if(!n.includes(t.role))throw new He("INVALID_ROLE_UPDATE",`Updated role must be one of: ${n.join(", ")}`,{role:t.role})}if(t.conversationId!==void 0&&(typeof t.conversationId!="string"||t.conversationId.length===0))throw new He("INVALID_CONVERSATION_ID_UPDATE","Updated conversationId must be a non-empty string",{conversationId:t.conversationId});if(t.timestamp!==void 0&&typeof t.timestamp!="string")throw new He("INVALID_TIMESTAMP_UPDATE","Updated timestamp must be a string",{timestamp:t.timestamp});if(t.isStreaming!==void 0&&typeof t.isStreaming!="boolean")throw new He("INVALID_STREAMING_UPDATE","Updated isStreaming must be a boolean",{isStreaming:t.isStreaming});if(t.parts!==void 0)throw new He("INVALID_PARTS_UPDATE","Parts cannot be directly updated - use appendPart or appendTextContent instead",{parts:t.parts})}function mI(e){if(!e||typeof e!="object")throw new He("INVALID_UPDATES","Updates must be an object",{updates:e});const t=e;if(t.toolName!==void 0&&(typeof t.toolName!="string"||t.toolName.length===0))throw new He("INVALID_TOOL_NAME","Updated toolName must be a non-empty string",{toolName:t.toolName});if(t.toolInput!==void 0&&(typeof t.toolInput!="object"||t.toolInput===null))throw new He("INVALID_TOOL_INPUT","Updated toolInput must be an object",{toolInput:t.toolInput});if(t.status!==void 0){if(typeof t.status!="object"||t.status===null)throw new He("INVALID_TOOL_STATUS","Updated status must be an object",{status:t.status});const n=t.status,i=["executing","completed","failed"];if(!i.includes(n.state))throw new He("INVALID_STATUS_STATE",`Updated status state must be one of: ${i.join(", ")}`,{state:n.state})}}const Un=md((e,t)=>({messages:[],activeConversationId:null,isStreaming:!1,sdkStatus:null,error:null,setActiveConversationId:n=>{dI(n),e({activeConversationId:n})},setStreaming:n=>{if(typeof n!="boolean")throw new He("INVALID_STREAMING_FLAG","isStreaming must be a boolean",{isStreaming:n});e({isStreaming:n})},setSdkStatus:n=>{n!==null&&uI(n),e({sdkStatus:n})},setError:n=>{fI(n),e({error:n})},reset:()=>e({messages:[],activeConversationId:null,isStreaming:!1,sdkStatus:null,error:null}),addMessage:n=>{cI(n);const r=t();if(r.messages.length>=1e3)throw new He("MAX_MESSAGES_EXCEEDED","Cannot add message: maximum limit of 1000 messages reached",{currentCount:r.messages.length,maxLimit:1e3});r.activeConversationId&&n.conversationId!==r.activeConversationId&&console.warn(`Message conversationId "${n.conversationId}" does not match active conversationId "${r.activeConversationId}"`),e(c=>({messages:[...c.messages,n]}))},updateMessage:(n,i)=>{if(Pu(n),hI(i),!t().messages.some(o=>o.id===n))throw new He("MESSAGE_NOT_FOUND",`Message with id "${n}" not found`,{id:n});e(o=>({messages:o.messages.map(u=>u.id===n?R(R({},u),i):u)}))},deleteMessage:n=>{Pu(n),e(i=>({messages:i.messages.filter(r=>r.id!==n)}))},appendPart:(n,i)=>{Pu(n),lN(i);const o=t().messages.find(u=>u.id===n);if(!o)throw new He("MESSAGE_NOT_FOUND",`Message with id "${n}" not found`,{messageId:n});if(o.parts.length>=500)throw new He("MAX_PARTS_EXCEEDED","Cannot append part: maximum limit of 500 parts per message reached",{messageId:n,currentCount:o.parts.length,maxLimit:500});e(u=>({messages:u.messages.map(h=>{if(h.id===n){const m=V(R({},i),{timestamp:i.timestamp&&i.timestamp.length>0?i.timestamp:new Date().toISOString()});return V(R({},h),{parts:[...h.parts,m]})}return h})}))},appendTextContent:(n,i)=>{if(Pu(n),typeof i!="string")throw new He("INVALID_TEXT_CONTENT","Content must be a string",{content:i});const o=t().messages.find(m=>m.id===n);if(!o)throw new He("MESSAGE_NOT_FOUND",`Message with id "${n}" not found`,{messageId:n});const u=o.parts[o.parts.length-1];if(!(u&&u.type==="text")&&o.parts.length>=500)throw new He("MAX_PARTS_EXCEEDED","Cannot append part: maximum limit of 500 parts per message reached",{messageId:n,currentCount:o.parts.length,maxLimit:500});e(m=>({messages:m.messages.map(g=>{if(g.id===n){const p=g.parts[g.parts.length-1];if(p&&p.type==="text"){const x=[...g.parts];return x[g.parts.length-1]=V(R({},p),{content:p.content+i}),V(R({},g),{parts:x})}const y={type:"text",content:i,timestamp:new Date().toISOString()};return V(R({},g),{parts:[...g.parts,y]})}return g})}))},updateToolInvocation:(n,i)=>{if(typeof n!="string"||n.length===0)throw new He("INVALID_TOOL_USE_ID","toolUseId must be a non-empty string",{toolUseId:n});mI(i);const r=t();let c=!1;for(const o of r.messages){for(const u of o.parts)if(u.type==="tool_invocation"&&"toolUseId"in u&&u.toolUseId===n){c=!0;break}if(c)break}if(!c)throw new He("TOOL_NOT_FOUND",`Tool invocation with toolUseId "${n}" not found`,{toolUseId:n});e(o=>({messages:o.messages.map(u=>V(R({},u),{parts:u.parts.map(h=>h.type==="tool_invocation"&&"toolUseId"in h&&h.toolUseId===n?R(R({},h),i):h)}))}))},getLastMessage:()=>{const n=t().messages;return n.length>0?n[n.length-1]:void 0},getMessagesByConversation:n=>t().messages.filter(i=>i.conversationId===n),getCurrentStreamingMessage:()=>{const n=t().messages;for(let i=n.length-1;i>=0;i--)if(n[i].isStreaming)return n[i]}})),pI="modulepreload",gI=function(e){return"/"+e},Gb={},yI=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){let o=function(m){return Promise.all(m.map(g=>Promise.resolve(g).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),h=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));r=o(n.map(m=>{if(m=gI(m),m in Gb)return;Gb[m]=!0;const g=m.endsWith(".css"),p=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const y=document.createElement("link");if(y.rel=g?"stylesheet":pI,g||(y.as="script"),y.crossOrigin="",y.href=m,h&&y.setAttribute("nonce",h),document.head.appendChild(y),g)return new Promise((x,_)=>{y.addEventListener("load",x),y.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(o){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=o,window.dispatchEvent(u),!u.defaultPrevented)throw o}return r.then(o=>{for(const u of o||[])u.status==="rejected"&&c(u.reason);return t().catch(c)})},Ot={JSONRPC_MESSAGE_PARSE_FAILED:"JSONRPC_001",JSONRPC_ATTACH_LISTENER_FAILED:"JSONRPC_002",JSONRPC_ATTACH_LISTENER_BACKGROUND_FAILED:"JSONRPC_003",JSONRPC_SEND_REQUEST_FAILED:"JSONRPC_004",JSONRPC_SEND_NOTIFICATION_FAILED:"JSONRPC_005",JSONRPC_NOTIFICATION_HANDLER_ERROR:"JSONRPC_006",JSONRPC_HANDLE_NOTIFICATION_ERROR:"JSONRPC_007",JSONRPC_MESSAGE_HANDLER_ERROR:"JSONRPC_008",JSONRPC_WEBSOCKET_LOAD_FAILED:"JSONRPC_009",JSONRPC_UNKNOWN_RESPONSE_ID:"JSONRPC_010",CHAT_GET_STATUS_FAILED:"CHAT_001",CHAT_SEND_FAILED:"CHAT_002",CHAT_CANCEL_FAILED:"CHAT_003",WS_CONNECTION_ERROR:"WS_001",WS_MESSAGE_PARSE_FAILED:"WS_002",WS_ERROR_EVENT:"WS_003",WS_EVENT_HANDLER_ERROR:"WS_004",WS_MAX_RECONNECT_ATTEMPTS:"WS_005",WS_SEND_FAILED:"WS_006",WS_NOT_CONNECTED:"WS_007",SPEC_CONVERSION_FAILED:"DATA_001",DATA_LOADER_SUCCESS_CALLBACK_FAILED:"DATA_002",DATA_LOADER_ERROR_CALLBACK_FAILED:"DATA_003",DATA_NORMALIZATION_FAILED:"DATA_004",DATA_LOADER_LOAD_FAILED:"DATA_005",ANNOTATION_CREATE_FAILED:"ANNOTATION_001",ANNOTATION_DELETE_FAILED:"ANNOTATION_002",ANNOTATION_RESOLVE_FAILED:"ANNOTATION_003",ANNOTATION_REPLY_FAILED:"ANNOTATION_004",ANNOTATION_DELETE_ROLLBACK_FAILED:"ANNOTATION_005",SESSION_STORAGE_PARSE_ERROR:"STORAGE_001",AUTH_COOKIE_DECODE_FAILED:"AUTH_001",AUTH_REQUEST_FAILED:"AUTH_002"};var ve=(e=>(e.VALIDATION_ERROR="validation_error",e.NOT_FOUND="not_found",e.NETWORK_ERROR="network_error",e.TIMEOUT="timeout",e.UNAUTHORIZED="unauthorized",e.RATE_LIMITED="rate_limited",e.RESOURCE_EXHAUSTED="resource_exhausted",e.CONFLICT="conflict",e.EXTERNAL_SERVICE_ERROR="external_service_error",e.ASSERTION_FAILED="assertion_failed",e.INVALID_STATE="invalid_state",e.NOT_IMPLEMENTED="not_implemented",e.TYPE_ERROR="type_error",e.PARSE_ERROR="parse_error",e.LOGIC_ERROR="logic_error",e.NULL_REFERENCE="null_reference",e.INTERNAL_ERROR="internal_error",e))(ve||{}),Xs=(e=>(e.LOW="low",e.MEDIUM="medium",e.HIGH="high",e.CRITICAL="critical",e))(Xs||{}),ya=(e=>(e.RETRY="retry",e.EXPONENTIAL_BACKOFF="exponential_backoff",e.FALLBACK="fallback",e.USER_ACTION="user_action",e.RELOAD="reload",e.NONE="none",e))(ya||{});const un={network:/network|fetch|offline|connection|timeout|ERR_NAME_NOT_RESOLVED|ERR_INTERNET_DISCONNECTED/i,timeout:/timeout|timed out|deadline|took too long/i,networkDetail:{dns:/dns|name.*not.*resolved|ERR_NAME_NOT_RESOLVED/i,timeout:/timeout|timed out|deadline/i},unauthorized:/401|unauthorized|forbidden|not authorized|credentials/i,notFound:/404|not found|does not exist|resource.*not.*found/i,rateLimited:/429|rate limit|too many requests|quota|throttle/i,conflict:/409|conflict|duplicate|already.*exists|constraint/i,serverError:/500|502|503|504|internal.*error|service.*unavailable|gateway/i,validation:/validation|must be|required|bad request|email.*valid|password.*valid|field.*invalid/i,parseError:/parse|syntax|unexpected token|json|xml|invalid.*format/i,typeError:/type|not a function|is not a|undefined|null|cannot read|cannot set/i,resourceExhausted:/out of memory|quota|storage|disk|heap|too large|maximum/i,assertionFailed:/assertion.*failed|assert.*failed/i,invalidState:/invalid state|invariant|unreachable|should not happen/i,externalService:/third.?party|external|webhook|provider|service.*failed/i};function vI(e,t,n,i){const r=Date.now(),c=n==null?void 0:n.stack,o=`${t} ${(n==null?void 0:n.message)||""}`.toLowerCase(),u=xI(o,n),h=bI(u,i),m=_I(u),g=SI(u,o),p=wI(u,g),y=g&&NI(u),x=EI(u,t),_=MI(i,u);return{errorId:e,message:t,originalError:n,category:u,severity:h,isExpectedFailure:m,isTransient:g,recoveryStrategy:p,canRetry:y,maxRetryAttempts:CI(u),retryDelayMs:jI(u),context:i,userFacingMessage:x,devMessage:kI(u,t,n),timestamp:r,stackTrace:c,affectedFeatures:_}}function xI(e,t){return t instanceof TypeError?ve.TYPE_ERROR:t instanceof SyntaxError?ve.PARSE_ERROR:t instanceof RangeError?ve.RESOURCE_EXHAUSTED:un.network.test(e)?un.networkDetail.timeout.test(e)?ve.TIMEOUT:(un.networkDetail.dns.test(e),ve.NETWORK_ERROR):un.timeout.test(e)?ve.TIMEOUT:un.unauthorized.test(e)?ve.UNAUTHORIZED:un.notFound.test(e)?ve.NOT_FOUND:un.rateLimited.test(e)?ve.RATE_LIMITED:un.conflict.test(e)?ve.CONFLICT:un.serverError.test(e)?ve.EXTERNAL_SERVICE_ERROR:un.assertionFailed.test(e)?ve.ASSERTION_FAILED:un.validation.test(e)&&!un.invalidState.test(e)&&!un.assertionFailed.test(e)?ve.VALIDATION_ERROR:un.invalidState.test(e)?ve.INVALID_STATE:un.parseError.test(e)?ve.PARSE_ERROR:un.typeError.test(e)?ve.TYPE_ERROR:un.resourceExhausted.test(e)?ve.RESOURCE_EXHAUSTED:un.externalService.test(e)?ve.EXTERNAL_SERVICE_ERROR:ve.INTERNAL_ERROR}function bI(e,t){return t!=null&&t.isCritical||e===ve.ASSERTION_FAILED||e===ve.INVALID_STATE||e===ve.NULL_REFERENCE||e===ve.TYPE_ERROR?Xs.CRITICAL:e===ve.UNAUTHORIZED||e===ve.NETWORK_ERROR||e===ve.TIMEOUT||e===ve.EXTERNAL_SERVICE_ERROR?Xs.HIGH:e===ve.VALIDATION_ERROR||e===ve.NOT_FOUND||e===ve.PARSE_ERROR||e===ve.CONFLICT?Xs.MEDIUM:e===ve.RATE_LIMITED||e===ve.RESOURCE_EXHAUSTED?Xs.LOW:Xs.MEDIUM}function _I(e){return[ve.VALIDATION_ERROR,ve.NOT_FOUND,ve.NETWORK_ERROR,ve.TIMEOUT,ve.UNAUTHORIZED,ve.RATE_LIMITED,ve.RESOURCE_EXHAUSTED,ve.CONFLICT,ve.EXTERNAL_SERVICE_ERROR,ve.PARSE_ERROR].includes(e)}function SI(e,t){const n=[ve.NETWORK_ERROR,ve.TIMEOUT,ve.RATE_LIMITED,ve.EXTERNAL_SERVICE_ERROR];return e===ve.RESOURCE_EXHAUSTED?!t.includes("permanent")&&!t.includes("quota"):n.includes(e)}function wI(e,t){return e===ve.ASSERTION_FAILED||e===ve.INVALID_STATE||e===ve.NOT_IMPLEMENTED||e===ve.TYPE_ERROR||e===ve.NULL_REFERENCE||e===ve.LOGIC_ERROR?ya.NONE:e===ve.NETWORK_ERROR&&t||e===ve.TIMEOUT&&t||e===ve.EXTERNAL_SERVICE_ERROR&&t||e===ve.RATE_LIMITED?ya.EXPONENTIAL_BACKOFF:e===ve.UNAUTHORIZED||e===ve.VALIDATION_ERROR||e===ve.NOT_FOUND?ya.USER_ACTION:e===ve.CONFLICT?ya.FALLBACK:(e===ve.PARSE_ERROR,ya.NONE)}function NI(e){return[ve.NETWORK_ERROR,ve.TIMEOUT,ve.RATE_LIMITED,ve.EXTERNAL_SERVICE_ERROR,ve.RESOURCE_EXHAUSTED].includes(e)}function CI(e){switch(e){case ve.NETWORK_ERROR:case ve.TIMEOUT:return 3;case ve.EXTERNAL_SERVICE_ERROR:return 2;case ve.RATE_LIMITED:return 1;case ve.RESOURCE_EXHAUSTED:return 2;default:return}}function jI(e){switch(e){case ve.NETWORK_ERROR:return 500;case ve.TIMEOUT:return 1e3;case ve.EXTERNAL_SERVICE_ERROR:return 1e3;case ve.RATE_LIMITED:return 5e3;case ve.RESOURCE_EXHAUSTED:return 2e3;default:return}}function EI(e,t){switch(e){case ve.NETWORK_ERROR:return"Network connection failed. Please check your internet connection.";case ve.TIMEOUT:return"The operation took too long. Please try again.";case ve.UNAUTHORIZED:return"Your session has expired. Please log in again.";case ve.NOT_FOUND:return"The requested resource was not found.";case ve.RATE_LIMITED:return"Too many requests. Please wait before trying again.";case ve.RESOURCE_EXHAUSTED:return"System resources are temporarily exhausted. Please try again.";case ve.VALIDATION_ERROR:return`Invalid input: ${t}`;case ve.CONFLICT:return"This resource has been modified by someone else. Please refresh and try again.";case ve.EXTERNAL_SERVICE_ERROR:return"External service is temporarily unavailable. Please try again.";case ve.PARSE_ERROR:return"Unable to process the response. Please try again or contact support.";case ve.ASSERTION_FAILED:case ve.INVALID_STATE:case ve.TYPE_ERROR:case ve.NULL_REFERENCE:case ve.INTERNAL_ERROR:return"An unexpected error occurred. Please refresh the page or contact support.";default:return"An error occurred. Please try again."}}function kI(e,t,n){var c;return[`[${((c=Object.entries(ve).find(([,o])=>o===e))==null?void 0:c[0])||"UNKNOWN"}] ${t}`,n!=null&&n.message?`Original: ${n.message}`:""].filter(Boolean).join(" | ")}function MI(e,t){const n=[];return e!=null&&e.feature&&typeof e.feature=="string"&&n.push(e.feature),e!=null&&e.layer&&typeof e.layer=="string"&&n.push(`${e.layer}_layer`),t===ve.NETWORK_ERROR?n.push("data_sync","websocket","api_calls"):t===ve.EXTERNAL_SERVICE_ERROR&&n.push("export","integrations"),[...new Set(n)]}function Bt(e,t,n,i){const r=new Date().toISOString(),c=vI(e,t,i,n),o={errorId:e,message:t,timestamp:r,context:n||{},category:c.category,severity:c.severity,isExpectedFailure:c.isExpectedFailure,isTransient:c.isTransient,recoveryStrategy:c.recoveryStrategy,canRetry:c.canRetry,affectedFeatures:c.affectedFeatures};if(typeof window!="undefined")try{const u=window.__SENTRY__;if(u&&u.captureException){const h=i||new Error(t);h.errorId=e,h.context=n,h.category=c.category,h.severity=c.severity,h.isExpectedFailure=c.isExpectedFailure,h.isTransient=c.isTransient,h.recoveryStrategy=c.recoveryStrategy,u.setTag("error_id",e),u.setTag("error_category",c.category),u.setTag("error_severity",c.severity),u.setTag("is_expected",String(c.isExpectedFailure)),u.setTag("is_transient",String(c.isTransient)),u.captureException(h)}}catch(u){console.warn("[ErrorTracker] Failed to capture error in Sentry:",u instanceof Error?u.message:String(u),{errorId:e,message:t})}if(e!==Ot.SESSION_STORAGE_PARSE_ERROR&&typeof sessionStorage!="undefined")try{const u="app:error_log",h=sessionStorage.getItem(u),m=h?JSON.parse(h):[];m.push(o),m.length>50&&m.shift(),sessionStorage.setItem(u,JSON.stringify(m))}catch(u){console.warn("[ErrorTracker] Failed to store error log in session storage:",u instanceof Error?u.message:String(u),{errorId:e,message:t})}return c}function Io(e,t){const n=new Date().toISOString();if(console.warn(e),typeof sessionStorage!="undefined")try{const i="app:warning_log",r=sessionStorage.getItem(i),c=r?JSON.parse(r):[];c.push({message:e,timestamp:n,context:t||{}}),c.length>50&&c.shift(),sessionStorage.setItem(i,JSON.stringify(c))}catch(i){console.warn("[ErrorTracker] Failed to store warning log in session storage:",i instanceof Error?i.message:String(i),{message:e})}}class Ug extends Error{constructor(t,n,i){super(i),this.code=t,this.rpcError=n,this.name="JsonRpcErrorResult",Object.setPrototypeOf(this,Ug.prototype)}}class TI{constructor(){Ct(this,"pendingRequests",new Map);Ct(this,"notificationHandlers",new Map);Ct(this,"requestTimeout",3e4);Ct(this,"requestIdCounter",1);Ct(this,"messageListenerAttached",!1);Ct(this,"messageListenerAttachmentInProgress",!1);Ct(this,"cachedWebSocketClient",null);this.ensureMessageListenerAttached()}getWebSocketClient(){return Ge(this,null,function*(){if(this.cachedWebSocketClient)return this.cachedWebSocketClient;try{const t=yield yI(()=>Promise.resolve().then(()=>e9),void 0);return this.cachedWebSocketClient=t.websocketClient,this.cachedWebSocketClient}catch(t){throw Bt(Ot.JSONRPC_WEBSOCKET_LOAD_FAILED,"Failed to load WebSocket client - JSON-RPC communication will not be available",{},t instanceof Error?t:new Error(String(t))),t}})}ensureMessageListenerAttachedAsync(){return Ge(this,null,function*(){if(!this.messageListenerAttached&&!this.messageListenerAttachmentInProgress){this.messageListenerAttachmentInProgress=!0;try{(yield this.getWebSocketClient()).on("message",n=>{try{if(!this.isValidJsonRpcMessage(n)){Bt(Ot.JSONRPC_MESSAGE_PARSE_FAILED,"Invalid JSON-RPC message structure - missing required fields",{message:String(n)});return}this.handleMessage(n)}catch(i){i instanceof TypeError?Bt(Ot.JSONRPC_MESSAGE_PARSE_FAILED,"Invalid JSON-RPC message structure",{error:i instanceof Error?i.message:String(i),message:String(n)},i instanceof Error?i:new Error(String(i))):Bt(Ot.JSONRPC_MESSAGE_HANDLER_ERROR,"Unexpected error while handling JSON-RPC message - possible programming bug",{error:i instanceof Error?i.message:String(i),errorType:i instanceof Error?i.constructor.name:typeof i,message:String(n),stack:i instanceof Error?i.stack:void 0},i instanceof Error?i:new Error(String(i)))}}),this.messageListenerAttached=!0}catch(t){Bt(Ot.JSONRPC_ATTACH_LISTENER_FAILED,"Failed to attach message listener to WebSocket - JSON-RPC responses will not be received",{error:t instanceof Error?t.message:String(t)},t instanceof Error?t:new Error(String(t)))}finally{this.messageListenerAttachmentInProgress=!1}}})}ensureMessageListenerAttached(){this.messageListenerAttached||this.messageListenerAttachmentInProgress||this.ensureMessageListenerAttachedAsync().catch(t=>{Bt(Ot.JSONRPC_ATTACH_LISTENER_BACKGROUND_FAILED,"Failed to attach message listener in background",{error:t instanceof Error?t.message:String(t)})})}sendRequest(t,n,i){return Ge(this,null,function*(){const r=this.generateRequestId(),c={jsonrpc:"2.0",method:t,id:r};return n&&(c.params=n),new Promise((o,u)=>{const h=i!=null?i:this.requestTimeout,m=setTimeout(()=>{this.pendingRequests.delete(r),u(new Error(`JSON-RPC request timeout for method '${t}' after ${h}ms`))},h);this.pendingRequests.set(r,{id:r,method:t,resolve:g=>o(g),reject:u,timeout:m}),this._sendRequestMessage(c,r,m,u)})})}sendNotification(t,n){const i=R({jsonrpc:"2.0",method:t},n&&{params:n});this._sendNotificationMessage(i,t)}_sendRequestMessage(t,n,i,r){return Ge(this,null,function*(){try{if(!(yield this.getWebSocketClient()).send(t)){this.pendingRequests.delete(n),clearTimeout(i);const u="Failed to send JSON-RPC request: WebSocket not connected";Bt(Ot.JSONRPC_SEND_REQUEST_FAILED,u,{method:t.method}),r(new Error(u))}}catch(c){this.pendingRequests.delete(n),clearTimeout(i);const o=`Failed to send JSON-RPC request: ${c instanceof Error?c.message:"Unknown error"}`;Bt(Ot.JSONRPC_SEND_REQUEST_FAILED,o,{error:c instanceof Error?c.message:String(c),method:t.method}),r(new Error(o))}})}_sendNotificationMessage(t,n){return Ge(this,null,function*(){try{(yield this.getWebSocketClient()).send(t)||Bt(Ot.JSONRPC_SEND_NOTIFICATION_FAILED,`Failed to send notification for method '${n}': WebSocket not connected`,{method:n})}catch(i){Bt(Ot.JSONRPC_SEND_NOTIFICATION_FAILED,`Failed to send notification for method '${n}'`,{error:i instanceof Error?i.message:String(i),method:n})}})}onNotification(t,n){this.notificationHandlers.has(t)||this.notificationHandlers.set(t,new Set);const i=this.notificationHandlers.get(t);return i.add(n),()=>{i.delete(n),i.size===0&&this.notificationHandlers.delete(t)}}handleMessage(t){"result"in t||"error"in t?this.handleResponse(t):"method"in t&&!("id"in t)&&this.handleNotification(t)}handleResponse(t){const{id:n}=t,i=this.pendingRequests.get(n);if(!i){const r=`Received JSON-RPC response for unknown request ID: ${n}. This may indicate a timing issue or protocol error.`;Bt(Ot.JSONRPC_UNKNOWN_RESPONSE_ID,r,{responseId:n},new Error(r));return}if(this.pendingRequests.delete(n),clearTimeout(i.timeout),"result"in t)i.resolve(t.result);else if("error"in t){const r=this.createError(t.error,i.method);i.reject(r)}}handleNotification(t){const{method:n,params:i}=t;if(!n){Io("Received notification without method");return}const r=this.notificationHandlers.get(n);!r||r.size===0||r.forEach(c=>{try{const o=c(i!=null?i:{});o&&typeof o.then=="function"&&o.catch(u=>{Bt(Ot.JSONRPC_NOTIFICATION_HANDLER_ERROR,`Error in notification handler for '${n}'`,{error:u instanceof Error?u.message:String(u),method:n})})}catch(o){Bt(Ot.JSONRPC_NOTIFICATION_HANDLER_ERROR,`Error in notification handler for '${n}'`,{error:o instanceof Error?o.message:String(o),method:n})}})}createError(t,n){const i=`JSON-RPC Error (${t.code}): ${t.message} [method: ${n}]`;return new Ug(t.code,t,i)}generateRequestId(){return`req-${Date.now()}-${this.requestIdCounter++}`}clearPendingRequests(){this.pendingRequests.forEach(({timeout:n})=>{clearTimeout(n)});const t=new Error("WebSocket connection closed");this.pendingRequests.forEach(({reject:n})=>{n(t)}),this.pendingRequests.clear()}getPendingRequestCount(){return this.pendingRequests.size}static validateRequest(t){if(typeof t!="object"||t===null)return!1;const n=t;return n.jsonrpc==="2.0"&&typeof n.method=="string"&&(n.id===void 0||typeof n.id=="string"||typeof n.id=="number")}static validateResponse(t){if(typeof t!="object"||t===null)return!1;const n=t;return n.jsonrpc!=="2.0"||n.id===void 0&&n.id!==0?!1:"result"in n&&!("error"in n)||"error"in n&&!("result"in n)}isValidJsonRpcMessage(t){if(typeof t!="object"||t===null)return!1;const n=t;if(n.jsonrpc!=="2.0")return!1;const i="id"in n,r="method"in n,c="result"in n,o="error"in n;return i&&(c||o)?c&&!o||!c&&o:!!(r&&!i)}}const ls=new TI;function RI(e,t,n){switch(e){case"executing":return{state:"executing"};case"completed":return{state:"completed",result:t};case"failed":return{state:"failed",error:n||"Unknown error"};default:return console.warn(`[ChatService] Unknown tool status: "${e}", treating as executing`),{state:"executing"}}}class AI{constructor(){Ct(this,"currentConversationId",null);Ct(this,"currentRequestId",null);this.setupNotificationHandlers()}setupNotificationHandlers(){ls.onNotification("chat.response.chunk",t=>{this.handleResponseChunk(t)}),ls.onNotification("chat.tool.invoke",t=>{this.handleToolInvoke(t)}),ls.onNotification("chat.thinking",t=>{this.handleThinking(t)}),ls.onNotification("chat.usage",t=>{this.handleUsage(t)}),ls.onNotification("chat.error",t=>{this.handleError(t)})}getStatus(){return Ge(this,null,function*(){var t,n,i,r,c,o;try{const u=yield ls.sendRequest("chat.status",{}),h={sdkAvailable:(n=(t=u.sdkAvailable)!=null?t:u.sdk_available)!=null?n:!1,sdkVersion:(r=(i=u.sdkVersion)!=null?i:u.sdk_version)!=null?r:null,errorMessage:(o=(c=u.errorMessage)!=null?c:u.error_message)!=null?o:null};return Un.getState().setSdkStatus(h),h}catch(u){const h=u instanceof Error?u.message:"Unknown error";Bt(Ot.CHAT_GET_STATUS_FAILED,"Failed to get status",{error:h});const m={sdkAvailable:!1,sdkVersion:null,errorMessage:h};throw Un.getState().setSdkStatus(m),u}})}sendMessage(t){return Ge(this,null,function*(){if(!t.trim())throw new Error("Message cannot be empty");const n=Un.getState(),r={id:this.generateMessageId(),role:"user",conversationId:this.currentConversationId||this.generateConversationId(),timestamp:new Date().toISOString(),parts:[{type:"text",content:t,timestamp:new Date().toISOString()}]};this.currentConversationId=r.conversationId,n.setActiveConversationId(this.currentConversationId),n.addMessage(r);const c=this.generateMessageId(),o={id:c,role:"assistant",conversationId:r.conversationId,timestamp:new Date().toISOString(),parts:[],isStreaming:!0};n.addMessage(o),n.setStreaming(!0),n.setError(null);try{this.currentRequestId=this.generateRequestId();const u=yield ls.sendRequest("chat.send",{message:t},6e4);return n.updateMessage(c,{isStreaming:!1}),n.setStreaming(!1),u}catch(u){n.setStreaming(!1);const h=u instanceof Error?u.message:"Unknown error";throw n.setError(h),Bt(Ot.CHAT_SEND_FAILED,"Failed to send message",{error:h,message:t}),n.appendPart(c,{type:"error",code:"SEND_FAILED",message:h,timestamp:new Date().toISOString()}),u}})}cancelMessage(){return Ge(this,null,function*(){const t=Un.getState();try{const n=yield ls.sendRequest("chat.cancel",{},5e3);return t.setStreaming(!1),n}catch(n){const i=n instanceof Error?n.message:"Unknown error";throw Bt(Ot.CHAT_CANCEL_FAILED,"Failed to cancel",{error:i}),t.setStreaming(!1),n}})}handleResponseChunk(t){const n=Un.getState(),i=n.getCurrentStreamingMessage();if(!i){Io("Received response chunk but no streaming message");return}n.appendTextContent(i.id,t.content)}handleToolInvoke(t){const n=Un.getState(),i=n.getCurrentStreamingMessage();if(!i){Io("Received tool invoke but no streaming message");return}const r=RI(t.status,t.result,t.error);i.parts.find(o=>o.type==="tool_invocation"&&o.toolUseId===t.tool_use_id)?n.updateToolInvocation(t.tool_use_id,{status:r}):n.appendPart(i.id,{type:"tool_invocation",toolUseId:t.tool_use_id,toolName:t.toolName,toolInput:t.toolInput,status:r,timestamp:t.timestamp||new Date().toISOString()})}handleThinking(t){const n=Un.getState(),i=n.getCurrentStreamingMessage();if(!i){Io("Received thinking but no streaming message");return}n.appendPart(i.id,{type:"thinking",content:t.content,timestamp:t.timestamp||new Date().toISOString()})}handleUsage(t){const n=Un.getState(),i=n.getCurrentStreamingMessage();if(!i){Io("Received usage but no streaming message");return}n.appendPart(i.id,{type:"usage",inputTokens:t.input_tokens,outputTokens:t.output_tokens,totalTokens:t.total_tokens,totalCostUsd:t.total_cost_usd,timestamp:t.timestamp||new Date().toISOString()})}handleError(t){const n=Un.getState(),i=t.message||"Unknown error";n.setError(i),n.setStreaming(!1);const r=n.getCurrentStreamingMessage();r&&n.appendPart(r.id,{type:"error",code:t.code||"UNKNOWN_ERROR",message:i,timestamp:t.timestamp||new Date().toISOString()})}generateMessageId(){return`msg-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}generateConversationId(){return`conv-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}generateRequestId(){return`req-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}getCurrentConversationId(){return this.currentConversationId}getCurrentRequestId(){return this.currentRequestId}reset(){this.currentConversationId=null,this.currentRequestId=null,Un.getState().reset()}}const LI=new AI;function DI(e){return e==="user"?"user":"bot"}function OI(e){return e==="user"?"You":"DrBot"}function zI(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function II(e){switch(e.state){case"executing":return"running";case"completed":return"success";case"failed":return"error";default:return"running"}}function Yb(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch(t){return String(e)}}function BI(e){var i;const t=[],n=(i=e.toolInput)!=null?i:{};for(const[r,c]of Object.entries(n))t.push({key:r,value:Yb(c)});return e.status.state==="completed"&&e.status.result!==void 0?t.push({key:"result",value:Yb(e.status.result)}):e.status.state==="failed"&&t.push({key:"error",value:e.status.error}),t}function UI(e){return{name:e.toolName,status:II(e.status),output:BI(e)}}function FI(e){const t=typeof e.totalCostUsd=="number"&&e.totalCostUsd>0?` · $${e.totalCostUsd.toFixed(4)}`:"";return`${e.totalTokens} tokens (${e.inputTokens} in / ${e.outputTokens} out)${t}`}function HI(e){var g,p;const t=DI(e.role),n=OI(e.role),i=zI(e.timestamp),r=!!e.isStreaming,c=[];let o=0,u=null;const h=(y={})=>R({id:`${e.id}:${o++}`,role:t,senderName:n,timestamp:i,body:"",bodyKind:"markdown",isStreaming:r},y),m=()=>{u&&(c.push(u),u=null)};for(const y of e.parts)switch(y.type){case"text":{const x=(g=y.content)!=null?g:"";u&&u.bodyKind==="markdown"&&!u.toolBlock&&!u.thinkingBlock?u.body+=x:(m(),u=h({body:x}));break}case"thinking":{const x={content:(p=y.content)!=null?p:""};u&&u.bodyKind==="markdown"&&!u.thinkingBlock&&!u.toolBlock?(u.thinkingBlock=x,m()):(m(),c.push(h({thinkingBlock:x})));break}case"tool_invocation":{const x=UI(y);u&&u.bodyKind==="markdown"&&!u.toolBlock?(u.toolBlock=x,m()):(m(),c.push(h({toolBlock:x})));break}case"error":{m(),c.push(h({body:y.message,bodyKind:"error",isStreaming:!1}));break}case"usage":{m(),c.push(h({body:FI(y),bodyKind:"usage",isStreaming:!1}));break}}return m(),c.length===0&&c.push(h({})),c}function PI(e){const t=[];for(const n of e)t.push(...HI(n));return t}const Fm=["What does this element do?","Show cross-layer references","Any unresolved references?","Explain the data-model layer"];function $I({row:e}){return e.bodyKind==="error"?d.jsx("span",{style:{color:"#F43F5E",fontSize:12.5,lineHeight:1.5},"data-testid":"chat-error-line",children:e.body}):e.bodyKind==="usage"?d.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:10.5,color:"rgb(var(--canvas-fg-3))"},children:e.body}):d.jsx(Cw,{content:e.body,isStreaming:e.isStreaming})}function qI(){const e=Ne(A=>A.view),t=Ne(A=>A.layerId),n=Ne(A=>A.selectedId),i=Ne(A=>A.changesetId),r=Un(A=>A.messages),c=Un(A=>A.isStreaming),o=Un(A=>A.error),{derived:u}=Ts(),{derived:h}=dc(),m=M.useMemo(()=>Od(u),[u]),g=e==="model"&&n?m.byUuid.get(n):void 0,p=g==null?void 0:g.name,y=t?Es(t):"",x=M.useMemo(()=>{if(e==="changesets"){const A=h.list.find(L=>L.id===i);return A?A.name:"changesets"}return p||(y?`${y} layer`:"meta-model")},[e,h.list,i,p,y]),_=M.useMemo(()=>p?[`What does ${p} do?`,"Show cross-layer references","Any unresolved references?",y?`Explain the ${y} layer`:Fm[3]]:y?[...Fm.slice(0,3),`Explain the ${y} layer`]:Fm,[p,y]),S=M.useMemo(()=>PI(r),[r]),[w,N]=M.useState(""),k=A=>{const L=A.trim();!L||c||(N(""),LI.sendMessage(L).catch(()=>{}))},C=r.length<=1,j=d.jsxs(d.Fragment,{children:[o&&d.jsx("div",{role:"alert","data-testid":"chat-store-error",style:{flex:"none",margin:"6px 12px 0 12px",padding:"8px 10px",borderRadius:8,fontSize:12,lineHeight:1.45,color:"#F43F5E",background:"rgba(244,63,94,0.08)",border:"1px solid rgba(244,63,94,0.25)"},children:/-32001|sdk|not (?:installed|available)/i.test(o)?"No chat client is available on the server (the Claude SDK is not installed). The drawer is read-only until it is enabled.":o}),C&&d.jsx("div",{style:{flex:"none",padding:"10px 12px 6px 12px",borderTop:"1px solid rgb(var(--canvas-border))"},children:d.jsx(gS,{suggestions:_,onSelect:A=>k(A)})}),d.jsx("div",{style:{flex:"none",padding:"0 8px 10px 8px"},children:d.jsx(yS,{value:w,onChange:N,onSubmit:A=>k(A),scopeLabel:x,placeholder:"Ask about the model…",loading:c})})]});return d.jsx(vS,{composer:j,children:S.map(A=>d.jsx(hS,{role:A.role,senderName:A.senderName,timestamp:A.timestamp,body:d.jsx($I,{row:A}),toolBlock:A.toolBlock,thinkingBlock:A.thinkingBlock},A.id))})}const Kb={width:372,flex:"none",background:"rgb(var(--canvas-bg))",display:"flex",flexDirection:"column",minHeight:0,borderLeft:"1px solid rgb(var(--canvas-border))"},VI={position:"absolute",right:0,top:0,bottom:0,zIndex:30,boxShadow:"-16px 0 44px -22px rgba(0,0,0,0.5)"};function GI(){const e=Ne(i=>i.chatOpen),t=Ne(i=>i.wide);if(!e)return null;const n=t?Kb:R(R({},Kb),VI);return d.jsxs("div",{style:n,"data-testid":"chat-drawer","data-mode":t?"pane":"overlay",children:[d.jsxs("div",{style:{height:40,flex:"none",display:"flex",alignItems:"center",gap:8,padding:"0 16px",borderBottom:"1px solid rgb(var(--canvas-border))"},children:[d.jsx("span",{className:"drv-chat-pulse",style:{width:6,height:6,borderRadius:"50%",background:"#FBBF24",display:"inline-block"}}),d.jsx("span",{style:{fontSize:13,fontWeight:600,color:"rgb(var(--canvas-fg-1))"},children:"DrBot"}),d.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:10,letterSpacing:"0.06em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:"model assistant"})]}),d.jsx("div",{style:{flex:1,minHeight:0,position:"relative"},children:d.jsx("div",{style:{position:"absolute",inset:0},children:d.jsx(qI,{})})})]})}const $u="data-model",YI="I'm **DrBot**, scoped to the loaded architecture model. Select any element to inspect it, then ask me to explain it, trace its cross-layer references, or validate reference integrity.";function KI(){M.useEffect(()=>{var i;const e=Un.getState();if(e.messages.length>0)return;const t=new Date().toISOString(),n={id:`msg-greeting-${Date.now()}`,role:"assistant",conversationId:(i=e.activeConversationId)!=null?i:"greeting",timestamp:t,parts:[{type:"text",content:YI,timestamp:t}]};e.addMessage(n)},[])}function XI(){const e=Ne(g=>g.view),t=Ne(g=>g.layerId),n=Ne(g=>g.changesetId),i=Ne(g=>g.navigateToElement),r=Ne(g=>g.navigateToSpecNode),c=Ne(g=>g.selectChangeset),{derived:o}=Ts(),{derived:u,raw:h}=br(),{derived:m}=dc();M.useEffect(()=>{var g,p,y;if(e==="changesets"){if(n)return;const x=m.list[0];x&&c(x.id);return}if(!t){if(e==="model"){if(o.nodes.length===0)return;const x=(g=o.nodesByLayer[$u])!=null&&g.length?$u:Object.keys(o.nodesByLayer)[0];if(!x)return;const _=(p=o.nodesByLayer[x])==null?void 0:p[0];_&&i(_.id,x);return}if(e==="spec"){if(Object.keys(u.byLayer).length===0)return;const x=(y=u.byLayer[$u])!=null&&y.typeCount?$u:Yw.find(S=>{var w;return(w=u.byLayer[S])==null?void 0:w.typeCount});if(!x)return;const _=e8(h,x);_&&r(_,x)}}},[e,t,n,o,u,h,m,i,r,c])}function QI(){const t=Ne(n=>n.view)==="changesets";return XI(),KI(),d.jsxs("div",{style:{height:"100vh",minWidth:880,display:"flex",flexDirection:"column",background:"rgb(var(--shell-bg))",color:"rgb(var(--shell-fg-1))",fontFamily:"Inter, system-ui, sans-serif",overflow:"hidden"},"data-testid":"app-shell",children:[d.jsx(Nz,{}),d.jsxs("div",{style:{flex:1,display:"flex",minHeight:0,position:"relative"},children:[d.jsx(qz,{}),t?d.jsx(lI,{}):d.jsx(iI,{}),t&&d.jsx(oI,{}),d.jsx(GI,{})]}),d.jsx(Vz,{})]})}const ZI=0,os=1,JI=2,WI=3;class oN{constructor(t,n=null){Ct(this,"ws",null);Ct(this,"url");Ct(this,"token",null);Ct(this,"reconnectAttempts",0);Ct(this,"maxReconnectAttempts",10);Ct(this,"reconnectDelay",1e3);Ct(this,"maxReconnectDelay",3e4);Ct(this,"reconnectTimer",null);Ct(this,"heartbeatTimer",null);Ct(this,"heartbeatInterval",3e4);Ct(this,"eventHandlers",new Map);Ct(this,"isIntentionallyClosed",!1);Ct(this,"subscribedTopics",[]);Ct(this,"mode","detecting");Ct(this,"connectionTimeout",null);Ct(this,"maxConnectionAttempts",3);Ct(this,"connectionErrors",[]);this.url=t,this.token=n}setToken(t){this.token=t,console.log("[WebSocket] Token updated:",t?"present":"cleared")}getAuthProtocols(){if(this.token)return["token",this.token]}connect(){if(this.ws&&this.ws.readyState===os){console.log("[WebSocket] Already connected");return}if(this.mode==="rest"){console.log("[WebSocket] Using REST mode, skipping WebSocket connection"),this.emit("rest-mode",{});return}this.ws&&(this.ws.onopen=null,this.ws.onmessage=null,this.ws.onerror=null,this.ws.onclose=null,this.ws.close(),this.ws=null),this.isIntentionallyClosed=!1,this.mode==="detecting"&&console.log(`[WebSocket] Attempting WebSocket connection (attempt ${this.reconnectAttempts+1}/${this.maxConnectionAttempts})...`);try{const t=this.getAuthProtocols();this.ws=new WebSocket(this.url,t),this.ws.onopen=this.handleOpen.bind(this),this.ws.onmessage=this.handleMessage.bind(this),this.ws.onerror=this.handleError.bind(this),this.ws.onclose=this.handleClose.bind(this),this.mode==="detecting"&&(this.connectionTimeout=setTimeout(()=>{this.ws&&this.ws.readyState!==os&&(console.log("[WebSocket] Connection timeout during detection phase"),this.ws.close())},3e3))}catch(t){this.mode==="detecting"?(console.debug("[WebSocket] Connection error during detection:",t),this.handleConnectionFailure(),this.connectionErrors.push(t instanceof Error?t:new Error(String(t)))):(Bt(Ot.WS_CONNECTION_ERROR,"WebSocket connection error",{error:t instanceof Error?t.message:String(t)}),this.scheduleReconnect())}}getConnectionErrors(){return[...this.connectionErrors]}isTestEnvironment(){return Rp()}triggerCloseForTesting(){this.isTestEnvironment()&&(this.ws&&this.ws.readyState===os?(console.log("[WebSocket] TEST: Forcing close event"),this.ws.close(1e3,"Test-triggered close")):console.warn("[WebSocket] TEST: Cannot close, not connected"))}simulateMaxReconnectAttemptsForTesting(){this.isTestEnvironment()&&(console.log("[WebSocket] TEST: Simulating max reconnect attempts"),this.reconnectAttempts=this.maxReconnectAttempts,Bt(Ot.WS_MAX_RECONNECT_ATTEMPTS,"Max reconnection attempts reached (TEST SIMULATION)",{attempts:this.reconnectAttempts}),this.emit("max-reconnect-attempts",{attempts:this.reconnectAttempts}))}disconnect(){this.isIntentionallyClosed=!0,this.stopHeartbeat(),this.cancelReconnect(),this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),this.ws&&(this.ws.onopen=null,this.ws.onmessage=null,this.ws.onerror=null,this.ws.onclose=null,this.ws.close(),this.ws=null),console.log("[WebSocket] Disconnected"),this.emit("disconnect",{})}subscribe(t){this.subscribedTopics=t,this.ws&&this.ws.readyState===os&&this.send({type:"subscribe",topics:t})}send(t){var n;if(this.ws&&this.ws.readyState===os)try{return this.ws.send(JSON.stringify(t)),!0}catch(i){return Bt(Ot.WS_SEND_FAILED,"Failed to send WebSocket message",{error:i instanceof Error?i.message:String(i),message:t}),!1}else return Bt(Ot.WS_NOT_CONNECTED,"Cannot send message, WebSocket not connected",{connectionState:(n=this.ws)==null?void 0:n.readyState,message:t}),!1}on(t,n){this.eventHandlers.has(t)||this.eventHandlers.set(t,new Set),this.eventHandlers.get(t).add(n)}off(t,n){const i=this.eventHandlers.get(t);i&&i.delete(n)}get isConnected(){return this.ws!==null&&this.ws.readyState===os}get connectionState(){if(!this.ws)return this.reconnectTimer?"reconnecting":"disconnected";switch(this.ws.readyState){case ZI:return"connecting";case os:return"connected";case JI:case WI:return this.reconnectTimer?"reconnecting":"disconnected";default:return"disconnected"}}get transportMode(){return this.mode}handleConnectionFailure(){this.reconnectAttempts++,this.reconnectAttempts>=this.maxConnectionAttempts?(console.log("[WebSocket] Server does not support WebSocket, using REST mode"),this.connectionErrors.length>0&&(console.warn("[WebSocket] Connection attempts failed with the following errors:"),this.connectionErrors.forEach((t,n)=>{console.warn(` [${n+1}] ${t.message}`)})),this.mode="rest",this.reconnectAttempts=0,this.emit("rest-mode",{}),this.emit("connect",{})):setTimeout(()=>this.connect(),500)}handleOpen(){this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),console.log("[WebSocket] Connected successfully"),this.mode="websocket",this.reconnectAttempts=0,this.reconnectDelay=1e3,this.startHeartbeat(),this.emit("connect",{}),this.subscribedTopics.length>0&&this.subscribe(this.subscribedTopics)}handleMessage(t){var n;try{const i=JSON.parse(t.data),r=(n=i.type)!=null?n:"message";console.log("[WebSocket] Received:",r),this.emit(r,i),r!=="message"&&this.emit("message",i)}catch(i){Bt(Ot.WS_MESSAGE_PARSE_FAILED,"Failed to parse WebSocket message",{error:i instanceof Error?i.message:String(i),data:t.data})}}handleError(t){const n=Rp();if(this.mode==="detecting"){const i=t instanceof ErrorEvent?t.message:String(t);this.connectionErrors.push(new Error(`[Attempt ${this.reconnectAttempts+1}/${this.maxConnectionAttempts}] ${i}`)),console.debug("[WebSocket] Connection error during detection (attempt %d/%d): %s",this.reconnectAttempts+1,this.maxConnectionAttempts,i)}else n?console.debug("[WebSocket] Error in test environment:",t):Bt(Ot.WS_ERROR_EVENT,"WebSocket error event",{error:t instanceof ErrorEvent?t.message:String(t)});this.emit("error",{kind:"event",error:t})}handleClose(t){if(this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),this.mode==="detecting"){this.handleConnectionFailure();return}console.log(`[WebSocket] Closed (code: ${t.code}, reason: ${t.reason})`),this.stopHeartbeat(),this.emit("close",{code:t.code,reason:t.reason}),!this.isIntentionallyClosed&&this.mode!=="rest"&&this.scheduleReconnect()}scheduleReconnect(){if(this.isIntentionallyClosed)return;if(this.reconnectAttempts>=this.maxReconnectAttempts){Bt(Ot.WS_MAX_RECONNECT_ATTEMPTS,"Max reconnection attempts reached",{attempts:this.reconnectAttempts}),this.emit("max-reconnect-attempts",{attempts:this.reconnectAttempts});return}this.reconnectAttempts++;const t=Math.min(this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1),this.maxReconnectDelay);console.log(`[WebSocket] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts})`),this.emit("reconnecting",{attempt:this.reconnectAttempts,delay:t}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}cancelReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws&&this.ws.readyState===os&&this.send({type:"ping"})},this.heartbeatInterval)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}emit(t,n){const i=this.eventHandlers.get(t);i&&i.forEach(r=>{try{r(n)}catch(c){Bt(Ot.WS_EVENT_HANDLER_ERROR,`Error in WebSocket event handler for '${t}'`,{error:c instanceof Error?c.message:String(c),event:t})}})}}function Rp(){return typeof window=="undefined"?!1:!!(window.__PLAYWRIGHT__||window.__STORYBOOK_MOCK_WEBSOCKET__||window.__karma__||window.jasmine||window.jest)}let sn;if(typeof window!="undefined"){const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;sn=new oN(t,null)}else{const e=new Map;sn={setToken:()=>{},connect:()=>{setTimeout(()=>{const t=e.get("error");t&&t.forEach(i=>i({code:"SSR_ENVIRONMENT",message:"WebSocket not available in SSR/Node.js environment"}));const n=e.get("rest-mode");n&&n.forEach(i=>i({}))},0)},disconnect:()=>{},subscribe:()=>{},send:()=>(Bt(Ot.WS_SEND_FAILED,"Cannot send message in SSR/Node.js environment - use REST API instead",{environment:"SSR/Node.js"}),!1),on:(t,n)=>{e.has(t)||e.set(t,new Set),e.get(t).add(n)},off:(t,n)=>{const i=e.get(t);i&&i.delete(n)},get isConnected(){return!1},get connectionState(){return"disconnected"},get transportMode(){return"rest"}}}typeof window!="undefined"&&Rp()&&(window.__WEBSOCKET_CLIENT__=sn);const e9=Object.freeze(Object.defineProperty({__proto__:null,WebSocketClient:oN,get websocketClient(){return sn}},Symbol.toStringTag,{value:"Module"}));function t9(){const e=Xp(g=>g.token),t=zo(g=>g.setConnected),n=zo(g=>g.setDisconnected),i=zo(g=>g.setReconnecting),r=zo(g=>g.setError),c=M.useCallback(()=>{console.log("[RootShell] WebSocket connected"),t(),sn.transportMode==="websocket"&&sn.subscribe(["model","changesets","annotations"])},[t]),o=M.useCallback(()=>{console.log("[RootShell] Using REST mode"),t()},[t]),u=M.useCallback(()=>{console.log("[RootShell] WebSocket disconnected"),n()},[n]),h=M.useCallback(g=>{i(g.attempt,g.delay)},[i]),m=M.useCallback(g=>{const p=g.kind==="event"?g.error:`${g.code}: ${g.message}`;console.error("[RootShell] WebSocket error:",p),r("Connection error")},[r]);return M.useEffect(()=>(console.log("[RootShell] Initializing WebSocket connection"),e&&(console.log("[RootShell] Setting authentication token for WebSocket"),sn.setToken(e)),sn.on("connect",c),sn.on("disconnect",u),sn.on("reconnecting",h),sn.on("error",m),sn.on("rest-mode",o),sn.connect(),()=>{sn.off("connect",c),sn.off("disconnect",u),sn.off("reconnecting",h),sn.off("error",m),sn.off("rest-mode",o),sn.disconnect()}),[e,c,u,h,m,o]),d.jsx(T_,{})}const n9={model:"model",spec:"spec",changesets:"changesets"},a9={model:"model",spec:"spec",changesets:"changesets"},i9={model:"graph",spec:"graph",changesets:"list"};function Xb(e,t,n){return`${e!=null?e:""}|${t!=null?t:""}|${n!=null?n:""}`}function s9(){const{section:e}=vd({strict:!1}),t=lc({strict:!1}),n=Ne(x=>x.view),i=Ne(x=>x.setView),r=Ne(x=>x.layerId),c=Ne(x=>x.selectedId),o=Ne(x=>x.changesetId),u=Ne(x=>x.selectLayer),h=Ne(x=>x.selectNode),m=Ne(x=>x.selectChangeset),g=M.useRef(!1),p=M.useRef(n),y=M.useRef(Xb(r,c,o));return M.useEffect(()=>{const x=e?n9[e]:void 0;x&&i(x)},[e,i]),M.useEffect(()=>{if(t.changeset&&t.changeset!==o){m(t.changeset);return}t.layer&&t.layer!==r&&u(t.layer),t.node&&t.node!==c&&h(t.node)},[t.layer,t.node,t.changeset]),M.useEffect(()=>{const x=Xb(r,c,o);if(!g.current){g.current=!0,p.current=n,y.current=x;return}const _=p.current!==n,S=y.current!==x;if(!_&&!S)return;p.current=n,y.current=x;const w=a9[n],N=e!==w;!N&&!S||cN.navigate({to:"/$section/$view",params:{section:w,view:i9[w]},search:n==="changesets"?{changeset:o!=null?o:void 0}:{layer:r!=null?r:void 0,node:c!=null?c:void 0},replace:!N})},[n,r,c,o,e]),d.jsx(QI,{})}const Fg=rk({component:t9}),r9=$p({getParentRoute:()=>Fg,path:"/",validateSearch:e=>({token:typeof e.token=="string"?e.token:void 0}),component:uM}),l9=$p({getParentRoute:()=>Fg,path:"/$section/$view",validateSearch:e=>({layer:typeof e.layer=="string"?e.layer:void 0,node:typeof e.node=="string"?e.node:void 0,changeset:typeof e.changeset=="string"?e.changeset:void 0}),component:s9}),o9=Fg.addChildren([r9,l9]),cN=mk({routeTree:o9,history:Bj()}),c9=new URLSearchParams(window.location.search),Hm=c9.get("token");if(Hm){console.log("[main] Found token in URL query string, storing to localStorage"),localStorage.setItem("dr_auth_token",Hm),Xp.getState().setToken(Hm),console.log("[main] Updated authStore with new token");const e=window.location.pathname+window.location.hash;window.history.replaceState(null,"",e),console.log("[main] URL cleaned, removed token from query string")}tM();const uN=document.getElementById("root");if(!uN)throw new Error("Root element not found");const u9=oM();Tj.createRoot(uN).render(d.jsx(re.StrictMode,{children:d.jsx(Pk,{client:u9,children:d.jsx(yk,{router:cN})})}))});export default d9();