@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.
- package/README.md +39 -1
- package/dist/analyzers/verify-engine.js +22 -19
- package/dist/analyzers/verify-engine.js.map +2 -2
- package/dist/cli.js +101 -27
- package/dist/cli.js.map +3 -3
- package/dist/coding-agents/agents/claude-code.js +3 -1
- package/dist/coding-agents/agents/claude-code.js.map +2 -2
- package/dist/coding-agents/claude-code-client.js +2 -1
- package/dist/coding-agents/claude-code-client.js.map +2 -2
- package/dist/coding-agents/copilot-client.js +17 -12
- package/dist/coding-agents/copilot-client.js.map +2 -2
- package/dist/coding-agents/default-permissions.js +122 -0
- package/dist/coding-agents/default-permissions.js.map +7 -0
- package/dist/commands/add.js +10 -6
- package/dist/commands/add.js.map +2 -2
- package/dist/commands/analyzer.js +18 -10
- package/dist/commands/analyzer.js.map +2 -2
- package/dist/commands/audit.js +6 -6
- package/dist/commands/audit.js.map +2 -2
- package/dist/commands/changeset.js +238 -145
- package/dist/commands/changeset.js.map +2 -2
- package/dist/commands/delete.js +45 -18
- package/dist/commands/delete.js.map +3 -3
- package/dist/commands/element.js +3 -2
- package/dist/commands/element.js.map +2 -2
- package/dist/commands/farm.js +657 -0
- package/dist/commands/farm.js.map +7 -0
- package/dist/commands/init.js +11 -1
- package/dist/commands/init.js.map +2 -2
- package/dist/commands/mcp.js +107 -0
- package/dist/commands/mcp.js.map +7 -0
- package/dist/commands/relationship.js +53 -30
- package/dist/commands/relationship.js.map +2 -2
- package/dist/commands/reports.js +1 -1
- package/dist/commands/reports.js.map +2 -2
- package/dist/commands/update.js +19 -6
- package/dist/commands/update.js.map +2 -2
- package/dist/commands/validate.js +41 -3
- package/dist/commands/validate.js.map +2 -2
- package/dist/commands/version.js +2 -2
- package/dist/commands/version.js.map +2 -2
- package/dist/config.js +83 -0
- package/dist/config.js.map +7 -0
- package/dist/core/annotation-store.js +138 -0
- package/dist/core/annotation-store.js.map +7 -0
- package/dist/core/farm-manifest.js +134 -0
- package/dist/core/farm-manifest.js.map +7 -0
- package/dist/core/farm-sync-engine.js +346 -0
- package/dist/core/farm-sync-engine.js.map +7 -0
- package/dist/core/farm-sync-state.js +159 -0
- package/dist/core/farm-sync-state.js.map +7 -0
- package/dist/core/manifest.js +6 -3
- package/dist/core/manifest.js.map +2 -2
- package/dist/core/migration-registry.js +55 -1
- package/dist/core/migration-registry.js.map +2 -2
- package/dist/core/model.js +177 -16
- package/dist/core/model.js.map +3 -3
- package/dist/core/virtual-projection.js +1 -0
- package/dist/core/virtual-projection.js.map +2 -2
- package/dist/generated/node-types.js +1 -1
- package/dist/generated/node-types.js.map +2 -2
- package/dist/generated/relationship-index.js +45 -9
- package/dist/generated/relationship-index.js.map +2 -2
- package/dist/integrations/claude_code/docs/MCP_SERVER.md +55 -0
- package/dist/integrations/claude_code/docs/README.md +4 -0
- package/dist/mcp/api-key-manager.js +98 -0
- package/dist/mcp/api-key-manager.js.map +7 -0
- package/dist/mcp/http-transport.js +176 -0
- package/dist/mcp/http-transport.js.map +7 -0
- package/dist/mcp/resource-registry.js +97 -0
- package/dist/mcp/resource-registry.js.map +7 -0
- package/dist/mcp/tool-registry.js +44 -0
- package/dist/mcp/tool-registry.js.map +7 -0
- package/dist/mcp/tools/annotation-create.js +39 -0
- package/dist/mcp/tools/annotation-create.js.map +7 -0
- package/dist/mcp/tools/annotation-delete.js +29 -0
- package/dist/mcp/tools/annotation-delete.js.map +7 -0
- package/dist/mcp/tools/annotation-get.js +29 -0
- package/dist/mcp/tools/annotation-get.js.map +7 -0
- package/dist/mcp/tools/annotation-list.js +24 -0
- package/dist/mcp/tools/annotation-list.js.map +7 -0
- package/dist/mcp/tools/annotation-reply.js +34 -0
- package/dist/mcp/tools/annotation-reply.js.map +7 -0
- package/dist/mcp/tools/annotation-shared.js +10 -0
- package/dist/mcp/tools/annotation-shared.js.map +7 -0
- package/dist/mcp/tools/annotation-update.js +39 -0
- package/dist/mcp/tools/annotation-update.js.map +7 -0
- package/dist/mcp/tools/changeset-list.js +33 -0
- package/dist/mcp/tools/changeset-list.js.map +7 -0
- package/dist/mcp/tools/changeset-show.js +39 -0
- package/dist/mcp/tools/changeset-show.js.map +7 -0
- package/dist/mcp/tools/chat-launch.js +50 -0
- package/dist/mcp/tools/chat-launch.js.map +7 -0
- package/dist/mcp/tools/chat-status.js +26 -0
- package/dist/mcp/tools/chat-status.js.map +7 -0
- package/dist/mcp/tools/index.js +47 -0
- package/dist/mcp/tools/index.js.map +7 -0
- package/dist/mcp/tools/model-add.js +106 -0
- package/dist/mcp/tools/model-add.js.map +7 -0
- package/dist/mcp/tools/model-delete.js +99 -0
- package/dist/mcp/tools/model-delete.js.map +7 -0
- package/dist/mcp/tools/model-export.js +72 -0
- package/dist/mcp/tools/model-export.js.map +7 -0
- package/dist/mcp/tools/model-info.js +51 -0
- package/dist/mcp/tools/model-info.js.map +7 -0
- package/dist/mcp/tools/model-list.js +53 -0
- package/dist/mcp/tools/model-list.js.map +7 -0
- package/dist/mcp/tools/model-reload.js +34 -0
- package/dist/mcp/tools/model-reload.js.map +7 -0
- package/dist/mcp/tools/model-search.js +88 -0
- package/dist/mcp/tools/model-search.js.map +7 -0
- package/dist/mcp/tools/model-show.js +41 -0
- package/dist/mcp/tools/model-show.js.map +7 -0
- package/dist/mcp/tools/model-stats.js +22 -0
- package/dist/mcp/tools/model-stats.js.map +7 -0
- package/dist/mcp/tools/model-trace.js +55 -0
- package/dist/mcp/tools/model-trace.js.map +7 -0
- package/dist/mcp/tools/model-update.js +105 -0
- package/dist/mcp/tools/model-update.js.map +7 -0
- package/dist/mcp/tools/model-validate.js +78 -0
- package/dist/mcp/tools/model-validate.js.map +7 -0
- package/dist/mcp/tools/shared.js +103 -0
- package/dist/mcp/tools/shared.js.map +7 -0
- package/dist/reports/model-layer-report-generator.js +5 -3
- package/dist/reports/model-layer-report-generator.js.map +2 -2
- package/dist/reports/model-readme-generator.js +116 -0
- package/dist/reports/model-readme-generator.js.map +7 -0
- package/dist/reports/model-report-data.js +37 -1
- package/dist/reports/model-report-data.js.map +2 -2
- package/dist/reports/model-report-orchestrator.js +29 -6
- package/dist/reports/model-report-orchestrator.js.map +2 -2
- package/dist/reports/model-report-utils.js +9 -0
- package/dist/reports/model-report-utils.js.map +7 -0
- package/dist/schemas/bundled/analyzers/cbm.json +2 -2
- package/dist/schemas/bundled/analyzers/manifest.json +2 -2
- package/dist/schemas/bundled/api.json +1 -1
- package/dist/schemas/bundled/apm.json +1 -1
- package/dist/schemas/bundled/application.json +12 -1
- package/dist/schemas/bundled/base.json +1 -1
- package/dist/schemas/bundled/business.json +1 -1
- package/dist/schemas/bundled/data-model.json +38 -2
- package/dist/schemas/bundled/data-store.json +1 -1
- package/dist/schemas/bundled/manifest.json +4 -4
- package/dist/schemas/bundled/motivation.json +1 -1
- package/dist/schemas/bundled/navigation.json +1 -1
- package/dist/schemas/bundled/product.json +1 -1
- package/dist/schemas/bundled/security.json +1 -1
- package/dist/schemas/bundled/technology.json +1 -1
- package/dist/schemas/bundled/testing.json +1 -1
- package/dist/schemas/bundled/ux.json +1 -1
- package/dist/server/server.js +45 -7
- package/dist/server/server.js.map +2 -2
- package/dist/telemetry/config.js +2 -40
- package/dist/telemetry/config.js.map +2 -2
- package/dist/telemetry/index.js +1 -1
- package/dist/types/index.js.map +2 -2
- package/dist/utils/ansi-suppressor.js +25 -0
- package/dist/utils/ansi-suppressor.js.map +7 -0
- package/dist/utils/color-utils.js +34 -0
- package/dist/utils/color-utils.js.map +7 -0
- package/dist/utils/element-reference-shape.js +15 -1
- package/dist/utils/element-reference-shape.js.map +3 -3
- package/dist/utils/errors.js +69 -10
- package/dist/utils/errors.js.map +2 -2
- package/dist/utils/globals.js +17 -1
- package/dist/utils/globals.js.map +2 -2
- package/dist/utils/project-paths.js +24 -2
- package/dist/utils/project-paths.js.map +2 -2
- package/dist/utils/reference-path-parser.js +49 -0
- package/dist/utils/reference-path-parser.js.map +7 -0
- package/dist/utils/source-reference.js +5 -0
- package/dist/utils/source-reference.js.map +2 -2
- package/dist/utils/spec-version.js +10 -2
- package/dist/utils/spec-version.js.map +2 -2
- package/dist/validators/composed-reference-validator.js +262 -0
- package/dist/validators/composed-reference-validator.js.map +7 -0
- package/dist/validators/reference-validator.js +59 -8
- package/dist/validators/reference-validator.js.map +3 -3
- package/dist/validators/relationship-schema-validator.js +30 -2
- package/dist/validators/relationship-schema-validator.js.map +3 -3
- package/dist/viewer/README.md +6 -6
- package/dist/viewer/assets/main-B7AOQXXX.js +81 -0
- package/dist/viewer/assets/main-vdrFrG7q.css +1 -0
- package/dist/viewer/index.html +2 -2
- package/dist/viewer/manifest.json +10 -10
- package/dist/viewer/version.json +1 -1
- package/package.json +6 -3
- package/dist/viewer/assets/main-BRPZyc36.css +0 -1
- package/dist/viewer/assets/main-BrpLargo.js +0 -81
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var PE=Object.defineProperty,qE=Object.defineProperties;var VE=Object.getOwnPropertyDescriptors;var Vu=Object.getOwnPropertySymbols;var Kx=Object.prototype.hasOwnProperty,Yx=Object.prototype.propertyIsEnumerable;var Xx=e=>{throw TypeError(e)},Gu=Math.pow,cm=(e,t,n)=>t in e?PE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))Kx.call(t,n)&&cm(e,n,t[n]);if(Vu)for(var n of Vu(t))Yx.call(t,n)&&cm(e,n,t[n]);return e},V=(e,t)=>qE(e,VE(t));var pe=(e,t)=>{var n={};for(var i in e)Kx.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&Vu)for(var i of Vu(e))t.indexOf(i)<0&&Yx.call(e,i)&&(n[i]=e[i]);return n};var GE=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Tt=(e,t,n)=>cm(e,typeof t!="symbol"?t+"":t,n),um=(e,t,n)=>t.has(e)||Xx("Cannot "+n);var X=(e,t,n)=>(um(e,t,"read from private field"),n?n.call(e):t.get(e)),Be=(e,t,n)=>t.has(e)?Xx("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ke=(e,t,n,i)=>(um(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),nt=(e,t,n)=>(um(e,t,"access private method"),n);var Ku=(e,t,n,i)=>({set _(r){ke(e,t,r,n)},get _(){return X(e,t,i)}});var Qe=(e,t,n)=>new Promise((i,r)=>{var l=f=>{try{u(n.next(f))}catch(m){r(m)}},o=f=>{try{u(n.throw(f))}catch(m){r(m)}},u=f=>f.done?i(f.value):Promise.resolve(f.value).then(l,o);u((n=n.apply(e,t)).next())});import{r as ng,a as k_,g as KE,b as k,R as re,c as Od}from"./vendor-CxKvDp2x.js";var W9=GE(my=>{(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 l of r)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const l={};return r.integrity&&(l.integrity=r.integrity),r.referrerPolicy&&(l.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?l.credentials="include":r.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(r){if(r.ep)return;r.ep=!0;const l=n(r);fetch(r.href,l)}})();var dm={exports:{}},Fo={};/**
|
|
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 Qx;function YE(){if(Qx)return Fo;Qx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,r,l){var o=null;if(l!==void 0&&(o=""+l),r.key!==void 0&&(o=""+r.key),"key"in r){l={};for(var u in r)u!=="key"&&(l[u]=r[u])}else l=r;return r=l.ref,{$$typeof:e,type:i,key:o,ref:r!==void 0?r:null,props:l}}return Fo.Fragment=t,Fo.jsx=n,Fo.jsxs=n,Fo}var Zx;function XE(){return Zx||(Zx=1,dm.exports=YE()),dm.exports}var d=XE(),fm={exports:{}},$o={},hm={exports:{}},mm={};/**
|
|
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 Jx;function QE(){return Jx||(Jx=1,(function(e){function t(P,Q){var K=P.length;P.push(Q);e:for(;0<K;){var W=K-1>>>1,z=P[W];if(0<r(z,Q))P[W]=Q,P[K]=z,K=W;else break e}}function n(P){return P.length===0?null:P[0]}function i(P){if(P.length===0)return null;var Q=P[0],K=P.pop();if(K!==Q){P[0]=K;e:for(var W=0,z=P.length,se=z>>>1;W<se;){var ue=2*(W+1)-1,I=P[ue],ae=ue+1,ye=P[ae];if(0>r(I,K))ae<z&&0>r(ye,I)?(P[W]=ye,P[ae]=K,W=ae):(P[W]=I,P[ue]=K,W=ue);else if(ae<z&&0>r(ye,K))P[W]=ye,P[ae]=K,W=ae;else break e}}return Q}function r(P,Q){var K=P.sortIndex-Q.sortIndex;return K!==0?K:P.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var f=[],m=[],g=1,p=null,y=3,x=!1,_=!1,S=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate!="undefined"?setImmediate:null;function E(P){for(var Q=n(m);Q!==null;){if(Q.callback===null)i(m);else if(Q.startTime<=P)i(m),Q.sortIndex=Q.expirationTime,t(f,Q);else break;Q=n(m)}}function T(P){if(S=!1,E(P),!_)if(n(f)!==null)_=!0,D||(D=!0,H());else{var Q=n(m);Q!==null&&q(T,Q.startTime-P)}}var D=!1,O=-1,F=5,A=-1;function M(){return w?!0:!(e.unstable_now()-A<F)}function B(){if(w=!1,D){var P=e.unstable_now();A=P;var Q=!0;try{e:{_=!1,S&&(S=!1,R(O),O=-1),x=!0;var K=y;try{t:{for(E(P),p=n(f);p!==null&&!(p.expirationTime>P&&M());){var W=p.callback;if(typeof W=="function"){p.callback=null,y=p.priorityLevel;var z=W(p.expirationTime<=P);if(P=e.unstable_now(),typeof z=="function"){p.callback=z,E(P),Q=!0;break t}p===n(f)&&i(f),E(P)}else i(f);p=n(f)}if(p!==null)Q=!0;else{var se=n(m);se!==null&&q(T,se.startTime-P),Q=!1}}break e}finally{p=null,y=K,x=!1}Q=void 0}}finally{Q?H():D=!1}}}var H;if(typeof C=="function")H=function(){C(B)};else if(typeof MessageChannel!="undefined"){var G=new MessageChannel,$=G.port2;G.port1.onmessage=B,H=function(){$.postMessage(null)}}else H=function(){N(B,0)};function q(P,Q){O=N(function(){P(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(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(P){switch(y){case 1:case 2:case 3:var Q=3;break;default:Q=y}var K=y;y=Q;try{return P()}finally{y=K}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(P,Q){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var K=y;y=P;try{return Q()}finally{y=K}},e.unstable_scheduleCallback=function(P,Q,K){var W=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?W+K:W):K=W,P){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=K+z,P={id:g++,callback:Q,priorityLevel:P,startTime:K,expirationTime:z,sortIndex:-1},K>W?(P.sortIndex=K,t(m,P),n(f)===null&&P===n(m)&&(S?(R(O),O=-1):S=!0,q(T,K-W))):(P.sortIndex=z,t(f,P),_||x||(_=!0,D||(D=!0,H()))),P},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(P){var Q=y;return function(){var K=y;y=Q;try{return P.apply(this,arguments)}finally{y=K}}}})(mm)),mm}var Wx;function ZE(){return Wx||(Wx=1,hm.exports=QE()),hm.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 eb;function JE(){if(eb)return $o;eb=1;var e=ZE(),t=ng(),n=k_();function i(a){var s="https://react.dev/errors/"+a;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}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 l(a){var s=a,c=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,(s.flags&4098)!==0&&(c=s.return),a=s.return;while(a)}return s.tag===3?c: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 f(a){if(l(a)!==a)throw Error(i(188))}function m(a){var s=a.alternate;if(!s){if(s=l(a),s===null)throw Error(i(188));return s!==a?null:a}for(var c=a,h=s;;){var v=c.return;if(v===null)break;var b=v.alternate;if(b===null){if(h=v.return,h!==null){c=h;continue}break}if(v.child===b.child){for(b=v.child;b;){if(b===c)return f(v),a;if(b===h)return f(v),s;b=b.sibling}throw Error(i(188))}if(c.return!==h.return)c=v,h=b;else{for(var j=!1,U=v.child;U;){if(U===c){j=!0,c=v,h=b;break}if(U===h){j=!0,h=v,c=b;break}U=U.sibling}if(!j){for(U=b.child;U;){if(U===c){j=!0,c=b,h=v;break}if(U===h){j=!0,h=b,c=v;break}U=U.sibling}if(!j)throw Error(i(189))}}if(c.alternate!==h)throw Error(i(190))}if(c.tag!==3)throw Error(i(188));return c.stateNode.current===c?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"),R=Symbol.for("react.consumer"),C=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function H(a){return a===null||typeof a!="object"?null:(a=B&&a[B]||a["@@iterator"],typeof a=="function"?a:null)}var G=Symbol.for("react.client.reference");function $(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===G?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 T:return"Suspense";case D:return"SuspenseList";case A:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case _:return"Portal";case C:return a.displayName||"Context";case R:return(a._context.displayName||"Context")+".Consumer";case E:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case O:return s=a.displayName||null,s!==null?s:$(a.type)||"Memo";case F:s=a._payload,a=a._init;try{return $(a(s))}catch(c){}}return null}var q=Array.isArray,P=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,K={pending:!1,data:null,method:null,action:null},W=[],z=-1;function se(a){return{current:a}}function ue(a){0>z||(a.current=W[z],W[z]=null,z--)}function I(a,s){z++,W[z]=a.current,a.current=s}var ae=se(null),ye=se(null),xe=se(null),he=se(null);function we(a,s){switch(I(xe,s),I(ye,a),I(ae,null),s.nodeType){case 9:case 11:a=(a=s.documentElement)&&(a=a.namespaceURI)?gx(a):0;break;default:if(a=s.tagName,s=s.namespaceURI)s=gx(s),a=yx(s,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}ue(ae),I(ae,a)}function Ce(){ue(ae),ue(ye),ue(xe)}function at(a){a.memoizedState!==null&&I(he,a);var s=ae.current,c=yx(s,a.type);s!==c&&(I(ye,a),I(ae,c))}function Ze(a){ye.current===a&&(ue(ae),ue(ye)),he.current===a&&(ue(he),Io._currentValue=K)}var Ht,ct;function Ie(a){if(Ht===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);Ht=s&&s[1]||"",ct=-1<c.stack.indexOf(`
|
|
26
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
27
|
+
`+Ht+a+ct}var Ke=!1;function St(a,s){if(!a||Ke)return"";Ke=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={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(ce){var ie=ce}Reflect.construct(a,[],ge)}else{try{ge.call()}catch(ce){ie=ce}a.call(ge.prototype)}}else{try{throw Error()}catch(ce){ie=ce}(ge=a())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ce){if(ce&&ie&&typeof ce.stack=="string")return[ce.stack,ie.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=h.DetermineComponentFrameRoot(),j=b[0],U=b[1];if(j&&U){var Y=j.split(`
|
|
28
|
+
`),ne=U.split(`
|
|
29
|
+
`);for(v=h=0;h<Y.length&&!Y[h].includes("DetermineComponentFrameRoot");)h++;for(;v<ne.length&&!ne[v].includes("DetermineComponentFrameRoot");)v++;if(h===Y.length||v===ne.length)for(h=Y.length-1,v=ne.length-1;1<=h&&0<=v&&Y[h]!==ne[v];)v--;for(;1<=h&&0<=v;h--,v--)if(Y[h]!==ne[v]){if(h!==1||v!==1)do if(h--,v--,0>v||Y[h]!==ne[v]){var fe=`
|
|
30
|
+
`+Y[h].replace(" at new "," at ");return a.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",a.displayName)),fe}while(1<=h&&0<=v);break}}}finally{Ke=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?Ie(c):""}function Oe(a,s){switch(a.tag){case 26:case 27:case 5:return Ie(a.type);case 16:return Ie("Lazy");case 13:return a.child!==s&&s!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return St(a.type,!1);case 11:return St(a.type.render,!1);case 1:return St(a.type,!0);case 31:return Ie("Activity");default:return""}}function pt(a){try{var s="",c=null;do s+=Oe(a,c),c=a,a=a.return;while(a);return s}catch(h){return`
|
|
31
|
+
Error generating stack: `+h.message+`
|
|
32
|
+
`+h.stack}}var $e=Object.prototype.hasOwnProperty,ha=e.unstable_scheduleCallback,Jn=e.unstable_cancelCallback,Ia=e.unstable_shouldYield,Ln=e.unstable_requestPaint,xt=e.unstable_now,za=e.unstable_getCurrentPriorityLevel,de=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,Me=e.unstable_IdlePriority,ze=e.log,Et=e.unstable_setDisableYieldValue,wt=null,gt=null;function bt(a){if(typeof ze=="function"&&Et(a),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(wt,a)}catch(s){}}var mt=Math.clz32?Math.clz32:We,Wn=Math.log,un=Math.LN2;function We(a){return a>>>=0,a===0?32:31-(Wn(a)/un|0)|0}var Pi=256,oi=262144,sn=4194304;function dn(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 Ba(a,s,c){var h=a.pendingLanes;if(h===0)return 0;var v=0,b=a.suspendedLanes,j=a.pingedLanes;a=a.warmLanes;var U=h&134217727;return U!==0?(h=U&~b,h!==0?v=dn(h):(j&=U,j!==0?v=dn(j):c||(c=U&~a,c!==0&&(v=dn(c))))):(U=h&~b,U!==0?v=dn(U):j!==0?v=dn(j):c||(c=h&~a,c!==0&&(v=dn(c)))),v===0?0:s!==0&&s!==v&&(s&b)===0&&(b=v&-v,c=s&-s,b>=c||b===32&&(c&4194048)!==0)?s:v}function Ye(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function ma(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 Qt(){var a=sn;return sn<<=1,(sn&62914560)===0&&(sn=4194304),a}function _n(a){for(var s=[],c=0;31>c;c++)s.push(a);return s}function pa(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Kl(a,s,c,h,v,b){var j=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var U=a.entanglements,Y=a.expirationTimes,ne=a.hiddenUpdates;for(c=j&~c;0<c;){var fe=31-mt(c),ge=1<<fe;U[fe]=0,Y[fe]=-1;var ie=ne[fe];if(ie!==null)for(ne[fe]=null,fe=0;fe<ie.length;fe++){var ce=ie[fe];ce!==null&&(ce.lane&=-536870913)}c&=~ge}h!==0&&$s(a,h,0),b!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=b&~(j&~s))}function $s(a,s,c){a.pendingLanes|=s,a.suspendedLanes&=~s;var h=31-mt(s);a.entangledLanes|=s,a.entanglements[h]=a.entanglements[h]|1073741824|c&261930}function qi(a,s){var c=a.entangledLanes|=s;for(a=a.entanglements;c;){var h=31-mt(c),v=1<<h;v&s|a[h]&s&&(a[h]|=s),c&=~v}}function ga(a,s){var c=s&-s;return c=(c&42)!==0?1:Vi(c),(c&(a.suspendedLanes|s))!==0?0:c}function Vi(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 ci(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Hs(){var a=Q.p;return a!==0?a:(a=window.event,a===void 0?32:Fx(a.type))}function Ka(a,s){var c=Q.p;try{return Q.p=a,s()}finally{Q.p=c}}var kn=Math.random().toString(36).slice(2),le="__reactFiber$"+kn,Ee="__reactProps$"+kn,Le="__reactContainer$"+kn,He="__reactEvents$"+kn,zt="__reactListeners$"+kn,Dn="__reactHandles$"+kn,ya="__reactResources$"+kn,Zt="__reactMarker$"+kn;function On(a){delete a[le],delete a[Ee],delete a[He],delete a[zt],delete a[Dn]}function Ua(a){var s=a[le];if(s)return s;for(var c=a.parentNode;c;){if(s=c[Le]||c[le]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(a=Nx(a);a!==null;){if(c=a[le])return c;a=Nx(a)}return s}a=c,c=a.parentNode}return null}function Gi(a){if(a=a[le]||a[Le]){var s=a.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return a}return null}function Ps(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(i(33))}function Ki(a){var s=a[ya];return s||(s=a[ya]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Jt(a){a[Zt]=!0}var Ya=new Set,Lc={};function ui(a,s){di(a,s),di(a+"Capture",s)}function di(a,s){for(Lc[a]=s,a=0;a<s.length;a++)Ya.add(s[a])}var Dc=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]*$"),Yl={},Xl={};function Dr(a){return $e.call(Xl,a)?!0:$e.call(Yl,a)?!1:Dc.test(a)?Xl[a]=!0:(Yl[a]=!0,!1)}function Or(a,s,c){if(Dr(s))if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+c)}}function Ir(a,s,c){if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(s);return}a.setAttribute(s,""+c)}}function fn(a,s,c,h){if(h===null)a.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(s,c,""+h)}}function In(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Oc(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Z(a,s,c){var h=Object.getOwnPropertyDescriptor(a.constructor.prototype,s);if(!a.hasOwnProperty(s)&&typeof h!="undefined"&&typeof h.get=="function"&&typeof h.set=="function"){var v=h.get,b=h.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return v.call(this)},set:function(j){c=""+j,b.call(this,j)}}),Object.defineProperty(a,s,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(j){c=""+j},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function oe(a){if(!a._valueTracker){var s=Oc(a)?"checked":"value";a._valueTracker=Z(a,s,""+a[s])}}function _e(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var c=s.getValue(),h="";return a&&(h=Oc(a)?a.checked?"true":"false":a.value),a=h,a!==c?(s.setValue(a),!0):!1}function De(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 Pe=/[\n"\\]/g;function Xe(a){return a.replace(Pe,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function ft(a,s,c,h,v,b,j,U){a.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?a.type=j:a.removeAttribute("type"),s!=null?j==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+In(s)):a.value!==""+In(s)&&(a.value=""+In(s)):j!=="submit"&&j!=="reset"||a.removeAttribute("value"),s!=null?Sn(a,j,In(s)):c!=null?Sn(a,j,In(c)):h!=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=""+In(U):a.removeAttribute("name")}function rn(a,s,c,h,v,b,j,U){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(a.type=b),s!=null||c!=null){if(!(b!=="submit"&&b!=="reset"||s!=null)){oe(a);return}c=c!=null?""+In(c):"",s=s!=null?""+In(s):c,U||s===a.value||(a.value=s),a.defaultValue=s}h=h!=null?h:v,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=U?a.checked:!!h,a.defaultChecked=!!h,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(a.name=j),oe(a)}function Sn(a,s,c){s==="number"&&De(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function ea(a,s,c,h){if(a=a.options,s){s={};for(var v=0;v<c.length;v++)s["$"+c[v]]=!0;for(c=0;c<a.length;c++)v=s.hasOwnProperty("$"+a[c].value),a[c].selected!==v&&(a[c].selected=v),v&&h&&(a[c].defaultSelected=!0)}else{for(c=""+In(c),s=null,v=0;v<a.length;v++){if(a[v].value===c){a[v].selected=!0,h&&(a[v].defaultSelected=!0);return}s!==null||a[v].disabled||(s=a[v])}s!==null&&(s.selected=!0)}}function Ql(a,s,c){if(s!=null&&(s=""+In(s),s!==a.value&&(a.value=s),c==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=c!=null?""+In(c):""}function Zl(a,s,c,h){if(s==null){if(h!=null){if(c!=null)throw Error(i(92));if(q(h)){if(1<h.length)throw Error(i(93));h=h[0]}c=h}c==null&&(c=""),s=c}c=In(s),a.defaultValue=c,h=a.textContent,h===c&&h!==""&&h!==null&&(a.value=h),oe(a)}function fi(a,s){if(s){var c=a.firstChild;if(c&&c===a.lastChild&&c.nodeType===3){c.nodeValue=s;return}}a.textContent=s}var Kt=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 gn(a,s,c){var h=s.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":h?a.setProperty(s,c):typeof c!="number"||c===0||Kt.has(s)?s==="float"?a.cssFloat=c:a[s]=(""+c).trim():a[s]=c+"px"}function hi(a,s,c){if(s!=null&&typeof s!="object")throw Error(i(62));if(a=a.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var v in s)h=s[v],s.hasOwnProperty(v)&&c[v]!==h&&gn(a,v,h)}else for(var b in s)s.hasOwnProperty(b)&&gn(a,b,s[b])}function sf(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 UN=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"]]),FN=/^[\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 Ic(a){return FN.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function mi(){}var rf=null;function lf(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var zr=null,Br=null;function py(a){var s=Gi(a);if(s&&(a=s.stateNode)){var c=a[Ee]||null;e:switch(a=s.stateNode,s.type){case"input":if(ft(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),s=c.name,c.type==="radio"&&s!=null){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Xe(""+s)+'"][type="radio"]'),s=0;s<c.length;s++){var h=c[s];if(h!==a&&h.form===a.form){var v=h[Ee]||null;if(!v)throw Error(i(90));ft(h,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(s=0;s<c.length;s++)h=c[s],h.form===a.form&&_e(h)}break e;case"textarea":Ql(a,c.value,c.defaultValue);break e;case"select":s=c.value,s!=null&&ea(a,!!c.multiple,s,!1)}}}var of=!1;function gy(a,s,c){if(of)return a(s,c);of=!0;try{var h=a(s);return h}finally{if(of=!1,(zr!==null||Br!==null)&&(wu(),zr&&(s=zr,a=Br,Br=zr=null,py(s),a)))for(s=0;s<a.length;s++)py(a[s])}}function Jl(a,s){var c=a.stateNode;if(c===null)return null;var h=c[Ee]||null;if(h===null)return null;c=h[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":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break e;default:a=!1}if(a)return null;if(c&&typeof c!="function")throw Error(i(231,s,typeof c));return c}var pi=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),cf=!1;if(pi)try{var Wl={};Object.defineProperty(Wl,"passive",{get:function(){cf=!0}}),window.addEventListener("test",Wl,Wl),window.removeEventListener("test",Wl,Wl)}catch(a){cf=!1}var Yi=null,uf=null,zc=null;function yy(){if(zc)return zc;var a,s=uf,c=s.length,h,v="value"in Yi?Yi.value:Yi.textContent,b=v.length;for(a=0;a<c&&s[a]===v[a];a++);var j=c-a;for(h=1;h<=j&&s[c-h]===v[b-h];h++);return zc=v.slice(a,1<h?1-h:void 0)}function Bc(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 Uc(){return!0}function vy(){return!1}function zn(a){function s(c,h,v,b,j){this._reactName=c,this._targetInst=v,this.type=h,this.nativeEvent=b,this.target=j,this.currentTarget=null;for(var U in a)a.hasOwnProperty(U)&&(c=a[U],this[U]=c?c(b):b[U]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Uc:vy,this.isPropagationStopped=vy,this}return p(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Uc)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Uc)},persist:function(){},isPersistent:Uc}),s}var qs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fc=zn(qs),eo=p({},qs,{view:0,detail:0}),$N=zn(eo),df,ff,to,$c=p({},eo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mf,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!==to&&(to&&a.type==="mousemove"?(df=a.screenX-to.screenX,ff=a.screenY-to.screenY):ff=df=0,to=a),df)},movementY:function(a){return"movementY"in a?a.movementY:ff}}),xy=zn($c),HN=p({},$c,{dataTransfer:0}),PN=zn(HN),qN=p({},eo,{relatedTarget:0}),hf=zn(qN),VN=p({},qs,{animationName:0,elapsedTime:0,pseudoElement:0}),GN=zn(VN),KN=p({},qs,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),YN=zn(KN),XN=p({},qs,{data:0}),by=zn(XN),QN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZN={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"},JN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function WN(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=JN[a])?!!s[a]:!1}function mf(){return WN}var eC=p({},eo,{key:function(a){if(a.key){var s=QN[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=Bc(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?ZN[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mf,charCode:function(a){return a.type==="keypress"?Bc(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Bc(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),tC=zn(eC),nC=p({},$c,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_y=zn(nC),aC=p({},eo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mf}),iC=zn(aC),sC=p({},qs,{propertyName:0,elapsedTime:0,pseudoElement:0}),rC=zn(sC),lC=p({},$c,{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}),oC=zn(lC),cC=p({},qs,{newState:0,oldState:0}),uC=zn(cC),dC=[9,13,27,32],pf=pi&&"CompositionEvent"in window,no=null;pi&&"documentMode"in document&&(no=document.documentMode);var fC=pi&&"TextEvent"in window&&!no,Sy=pi&&(!pf||no&&8<no&&11>=no),wy=" ",Ny=!1;function Cy(a,s){switch(a){case"keyup":return dC.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ey(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ur=!1;function hC(a,s){switch(a){case"compositionend":return Ey(s);case"keypress":return s.which!==32?null:(Ny=!0,wy);case"textInput":return a=s.data,a===wy&&Ny?null:a;default:return null}}function mC(a,s){if(Ur)return a==="compositionend"||!pf&&Cy(a,s)?(a=yy(),zc=uf=Yi=null,Ur=!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 Sy&&s.locale!=="ko"?null:s.data;default:return null}}var pC={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 jy(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!pC[a.type]:s==="textarea"}function ky(a,s,c,h){zr?Br?Br.push(h):Br=[h]:zr=h,s=Ru(s,"onChange"),0<s.length&&(c=new Fc("onChange","change",null,c,h),a.push({event:c,listeners:s}))}var ao=null,io=null;function gC(a){ux(a,0)}function Hc(a){var s=Ps(a);if(_e(s))return a}function Ty(a,s){if(a==="change")return s}var Ry=!1;if(pi){var gf;if(pi){var yf="oninput"in document;if(!yf){var My=document.createElement("div");My.setAttribute("oninput","return;"),yf=typeof My.oninput=="function"}gf=yf}else gf=!1;Ry=gf&&(!document.documentMode||9<document.documentMode)}function Ay(){ao&&(ao.detachEvent("onpropertychange",Ly),io=ao=null)}function Ly(a){if(a.propertyName==="value"&&Hc(io)){var s=[];ky(s,io,a,lf(a)),gy(gC,s)}}function yC(a,s,c){a==="focusin"?(Ay(),ao=s,io=c,ao.attachEvent("onpropertychange",Ly)):a==="focusout"&&Ay()}function vC(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Hc(io)}function xC(a,s){if(a==="click")return Hc(s)}function bC(a,s){if(a==="input"||a==="change")return Hc(s)}function _C(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var ta=typeof Object.is=="function"?Object.is:_C;function so(a,s){if(ta(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var c=Object.keys(a),h=Object.keys(s);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var v=c[h];if(!$e.call(s,v)||!ta(a[v],s[v]))return!1}return!0}function Dy(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Oy(a,s){var c=Dy(a);a=0;for(var h;c;){if(c.nodeType===3){if(h=a+c.textContent.length,a<=s&&h>=s)return{node:c,offset:s-a};a=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Dy(c)}}function Iy(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?Iy(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function zy(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=De(a.document);s instanceof a.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch(h){c=!1}if(c)a=s.contentWindow;else break;s=De(a.document)}return s}function vf(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 SC=pi&&"documentMode"in document&&11>=document.documentMode,Fr=null,xf=null,ro=null,bf=!1;function By(a,s,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;bf||Fr==null||Fr!==De(h)||(h=Fr,"selectionStart"in h&&vf(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),ro&&so(ro,h)||(ro=h,h=Ru(xf,"onSelect"),0<h.length&&(s=new Fc("onSelect","select",null,s,c),a.push({event:s,listeners:h}),s.target=Fr)))}function Vs(a,s){var c={};return c[a.toLowerCase()]=s.toLowerCase(),c["Webkit"+a]="webkit"+s,c["Moz"+a]="moz"+s,c}var $r={animationend:Vs("Animation","AnimationEnd"),animationiteration:Vs("Animation","AnimationIteration"),animationstart:Vs("Animation","AnimationStart"),transitionrun:Vs("Transition","TransitionRun"),transitionstart:Vs("Transition","TransitionStart"),transitioncancel:Vs("Transition","TransitionCancel"),transitionend:Vs("Transition","TransitionEnd")},_f={},Uy={};pi&&(Uy=document.createElement("div").style,"AnimationEvent"in window||(delete $r.animationend.animation,delete $r.animationiteration.animation,delete $r.animationstart.animation),"TransitionEvent"in window||delete $r.transitionend.transition);function Gs(a){if(_f[a])return _f[a];if(!$r[a])return a;var s=$r[a],c;for(c in s)if(s.hasOwnProperty(c)&&c in Uy)return _f[a]=s[c];return a}var Fy=Gs("animationend"),$y=Gs("animationiteration"),Hy=Gs("animationstart"),wC=Gs("transitionrun"),NC=Gs("transitionstart"),CC=Gs("transitioncancel"),Py=Gs("transitionend"),qy=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 Fa(a,s){qy.set(a,s),ui(s,[a])}var Pc=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)},va=[],Hr=0,wf=0;function qc(){for(var a=Hr,s=wf=Hr=0;s<a;){var c=va[s];va[s++]=null;var h=va[s];va[s++]=null;var v=va[s];va[s++]=null;var b=va[s];if(va[s++]=null,h!==null&&v!==null){var j=h.pending;j===null?v.next=v:(v.next=j.next,j.next=v),h.pending=v}b!==0&&Vy(c,v,b)}}function Vc(a,s,c,h){va[Hr++]=a,va[Hr++]=s,va[Hr++]=c,va[Hr++]=h,wf|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function Nf(a,s,c,h){return Vc(a,s,c,h),Gc(a)}function Ks(a,s){return Vc(a,null,null,s),Gc(a)}function Vy(a,s,c){a.lanes|=c;var h=a.alternate;h!==null&&(h.lanes|=c);for(var v=!1,b=a.return;b!==null;)b.childLanes|=c,h=b.alternate,h!==null&&(h.childLanes|=c),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-mt(c),a=b.hiddenUpdates,h=a[v],h===null?a[v]=[s]:h.push(s),s.lane=c|536870912),b):null}function Gc(a){if(50<To)throw To=0,Lh=null,Error(i(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var Pr={};function EC(a,s,c,h){this.tag=a,this.key=c,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=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function na(a,s,c,h){return new EC(a,s,c,h)}function Cf(a){return a=a.prototype,!(!a||!a.isReactComponent)}function gi(a,s){var c=a.alternate;return c===null?(c=na(a.tag,s,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=s,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&65011712,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,s=a.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function Gy(a,s){a.flags&=65011714;var c=a.alternate;return c===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=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,s=c.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a}function Kc(a,s,c,h,v,b){var j=0;if(h=a,typeof a=="function")Cf(a)&&(j=1);else if(typeof a=="string")j=ME(a,c,ae.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case A:return a=na(31,c,s,v),a.elementType=A,a.lanes=b,a;case S:return Ys(c.children,v,b,s);case w:j=8,v|=24;break;case N:return a=na(12,c,s,v|2),a.elementType=N,a.lanes=b,a;case T:return a=na(13,c,s,v),a.elementType=T,a.lanes=b,a;case D:return a=na(19,c,s,v),a.elementType=D,a.lanes=b,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case C:j=10;break e;case R:j=9;break e;case E:j=11;break e;case O:j=14;break e;case F:j=16,h=null;break e}j=29,c=Error(i(130,a===null?"null":typeof a,"")),h=null}return s=na(j,c,s,v),s.elementType=a,s.type=h,s.lanes=b,s}function Ys(a,s,c,h){return a=na(7,a,h,s),a.lanes=c,a}function Ef(a,s,c){return a=na(6,a,null,s),a.lanes=c,a}function Ky(a){var s=na(18,null,null,0);return s.stateNode=a,s}function jf(a,s,c){return s=na(4,a.children!==null?a.children:[],a.key,s),s.lanes=c,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}var Yy=new WeakMap;function xa(a,s){if(typeof a=="object"&&a!==null){var c=Yy.get(a);return c!==void 0?c:(s={value:a,source:s,stack:pt(s)},Yy.set(a,s),s)}return{value:a,source:s,stack:pt(s)}}var qr=[],Vr=0,Yc=null,lo=0,ba=[],_a=0,Xi=null,Xa=1,Qa="";function yi(a,s){qr[Vr++]=lo,qr[Vr++]=Yc,Yc=a,lo=s}function Xy(a,s,c){ba[_a++]=Xa,ba[_a++]=Qa,ba[_a++]=Xi,Xi=a;var h=Xa;a=Qa;var v=32-mt(h)-1;h&=~(1<<v),c+=1;var b=32-mt(s)+v;if(30<b){var j=v-v%5;b=(h&(1<<j)-1).toString(32),h>>=j,v-=j,Xa=1<<32-mt(s)+v|c<<v|h,Qa=b+a}else Xa=1<<b|c<<v|h,Qa=a}function kf(a){a.return!==null&&(yi(a,1),Xy(a,1,0))}function Tf(a){for(;a===Yc;)Yc=qr[--Vr],qr[Vr]=null,lo=qr[--Vr],qr[Vr]=null;for(;a===Xi;)Xi=ba[--_a],ba[_a]=null,Qa=ba[--_a],ba[_a]=null,Xa=ba[--_a],ba[_a]=null}function Qy(a,s){ba[_a++]=Xa,ba[_a++]=Qa,ba[_a++]=Xi,Xa=s.id,Qa=s.overflow,Xi=a}var yn=null,Ut=null,ut=!1,Qi=null,Sa=!1,Rf=Error(i(519));function Zi(a){var s=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw oo(xa(s,a)),Rf}function Zy(a){var s=a.stateNode,c=a.type,h=a.memoizedProps;switch(s[le]=a,s[Ee]=h,c){case"dialog":st("cancel",s),st("close",s);break;case"iframe":case"object":case"embed":st("load",s);break;case"video":case"audio":for(c=0;c<Mo.length;c++)st(Mo[c],s);break;case"source":st("error",s);break;case"img":case"image":case"link":st("error",s),st("load",s);break;case"details":st("toggle",s);break;case"input":st("invalid",s),rn(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":st("invalid",s);break;case"textarea":st("invalid",s),Zl(s,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||s.textContent===""+c||h.suppressHydrationWarning===!0||mx(s.textContent,c)?(h.popover!=null&&(st("beforetoggle",s),st("toggle",s)),h.onScroll!=null&&st("scroll",s),h.onScrollEnd!=null&&st("scrollend",s),h.onClick!=null&&(s.onclick=mi),s=!0):s=!1,s||Zi(a,!0)}function Jy(a){for(yn=a.return;yn;)switch(yn.tag){case 5:case 31:case 13:Sa=!1;return;case 27:case 3:Sa=!0;return;default:yn=yn.return}}function Gr(a){if(a!==yn)return!1;if(!ut)return Jy(a),ut=!0,!1;var s=a.tag,c;if((c=s!==3&&s!==27)&&((c=s===5)&&(c=a.type,c=!(c!=="form"&&c!=="button")||Yh(a.type,a.memoizedProps)),c=!c),c&&Ut&&Zi(a),Jy(a),s===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Ut=wx(a)}else if(s===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Ut=wx(a)}else s===27?(s=Ut,ds(a.type)?(a=Wh,Wh=null,Ut=a):Ut=s):Ut=yn?Na(a.stateNode.nextSibling):null;return!0}function Xs(){Ut=yn=null,ut=!1}function Mf(){var a=Qi;return a!==null&&($n===null?$n=a:$n.push.apply($n,a),Qi=null),a}function oo(a){Qi===null?Qi=[a]:Qi.push(a)}var Af=se(null),Qs=null,vi=null;function Ji(a,s,c){I(Af,s._currentValue),s._currentValue=c}function xi(a){a._currentValue=Af.current,ue(Af)}function Lf(a,s,c){for(;a!==null;){var h=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),a===c)break;a=a.return}}function Df(a,s,c,h){var v=a.child;for(v!==null&&(v.return=a);v!==null;){var b=v.dependencies;if(b!==null){var j=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|=c,U=b.alternate,U!==null&&(U.lanes|=c),Lf(b.return,c,a),h||(j=null);break e}b=U.next}}else if(v.tag===18){if(j=v.return,j===null)throw Error(i(341));j.lanes|=c,b=j.alternate,b!==null&&(b.lanes|=c),Lf(j,c,a),j=null}else j=v.child;if(j!==null)j.return=v;else for(j=v;j!==null;){if(j===a){j=null;break}if(v=j.sibling,v!==null){v.return=j.return,j=v;break}j=j.return}v=j}}function Kr(a,s,c,h){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 j=v.alternate;if(j===null)throw Error(i(387));if(j=j.memoizedProps,j!==null){var U=v.type;ta(v.pendingProps.value,j.value)||(a!==null?a.push(U):a=[U])}}else if(v===he.current){if(j=v.alternate,j===null)throw Error(i(387));j.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(a!==null?a.push(Io):a=[Io])}v=v.return}a!==null&&Df(s,a,c,h),s.flags|=262144}function Xc(a){for(a=a.firstContext;a!==null;){if(!ta(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Zs(a){Qs=a,vi=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function vn(a){return Wy(Qs,a)}function Qc(a,s){return Qs===null&&Zs(a),Wy(a,s)}function Wy(a,s){var c=s._currentValue;if(s={context:s,memoizedValue:c,next:null},vi===null){if(a===null)throw Error(i(308));vi=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else vi=vi.next=s;return c}var jC=typeof AbortController!="undefined"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(c,h){a.push(h)}};this.abort=function(){s.aborted=!0,a.forEach(function(c){return c()})}},kC=e.unstable_scheduleCallback,TC=e.unstable_NormalPriority,Wt={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Of(){return{controller:new jC,data:new Map,refCount:0}}function co(a){a.refCount--,a.refCount===0&&kC(TC,function(){a.controller.abort()})}var uo=null,If=0,Yr=0,Xr=null;function RC(a,s){if(uo===null){var c=uo=[];If=0,Yr=Uh(),Xr={status:"pending",value:void 0,then:function(h){c.push(h)}}}return If++,s.then(ev,ev),s}function ev(){if(--If===0&&uo!==null){Xr!==null&&(Xr.status="fulfilled");var a=uo;uo=null,Yr=0,Xr=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function MC(a,s){var c=[],h={status:"pending",value:null,reason:null,then:function(v){c.push(v)}};return a.then(function(){h.status="fulfilled",h.value=s;for(var v=0;v<c.length;v++)(0,c[v])(s)},function(v){for(h.status="rejected",h.reason=v,v=0;v<c.length;v++)(0,c[v])(void 0)}),h}var tv=P.S;P.S=function(a,s){B1=xt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&RC(a,s),tv!==null&&tv(a,s)};var Js=se(null);function zf(){var a=Js.current;return a!==null?a:Dt.pooledCache}function Zc(a,s){s===null?I(Js,Js.current):I(Js,s.pool)}function nv(){var a=zf();return a===null?null:{parent:Wt._currentValue,pool:a}}var Qr=Error(i(460)),Bf=Error(i(474)),Jc=Error(i(542)),Wc={then:function(){}};function av(a){return a=a.status,a==="fulfilled"||a==="rejected"}function iv(a,s,c){switch(c=a[c],c===void 0?a.push(s):c!==s&&(s.then(mi,mi),s=c),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,rv(a),a;default:if(typeof s.status=="string")s.then(mi,mi);else{if(a=Dt,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=s,a.status="pending",a.then(function(h){if(s.status==="pending"){var v=s;v.status="fulfilled",v.value=h}},function(h){if(s.status==="pending"){var v=s;v.status="rejected",v.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,rv(a),a}throw er=s,Qr}}function Ws(a){try{var s=a._init;return s(a._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(er=c,Qr):c}}var er=null;function sv(){if(er===null)throw Error(i(459));var a=er;return er=null,a}function rv(a){if(a===Qr||a===Jc)throw Error(i(483))}var Zr=null,fo=0;function eu(a){var s=fo;return fo+=1,Zr===null&&(Zr=[]),iv(Zr,a,s)}function ho(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function tu(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 lv(a){function s(ee,J){if(a){var te=ee.deletions;te===null?(ee.deletions=[J],ee.flags|=16):te.push(J)}}function c(ee,J){if(!a)return null;for(;J!==null;)s(ee,J),J=J.sibling;return null}function h(ee){for(var J=new Map;ee!==null;)ee.key!==null?J.set(ee.key,ee):J.set(ee.index,ee),ee=ee.sibling;return J}function v(ee,J){return ee=gi(ee,J),ee.index=0,ee.sibling=null,ee}function b(ee,J,te){return ee.index=te,a?(te=ee.alternate,te!==null?(te=te.index,te<J?(ee.flags|=67108866,J):te):(ee.flags|=67108866,J)):(ee.flags|=1048576,J)}function j(ee){return a&&ee.alternate===null&&(ee.flags|=67108866),ee}function U(ee,J,te,me){return J===null||J.tag!==6?(J=Ef(te,ee.mode,me),J.return=ee,J):(J=v(J,te),J.return=ee,J)}function Y(ee,J,te,me){var Ue=te.type;return Ue===S?fe(ee,J,te.props.children,me,te.key):J!==null&&(J.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===F&&Ws(Ue)===J.type)?(J=v(J,te.props),ho(J,te),J.return=ee,J):(J=Kc(te.type,te.key,te.props,null,ee.mode,me),ho(J,te),J.return=ee,J)}function ne(ee,J,te,me){return J===null||J.tag!==4||J.stateNode.containerInfo!==te.containerInfo||J.stateNode.implementation!==te.implementation?(J=jf(te,ee.mode,me),J.return=ee,J):(J=v(J,te.children||[]),J.return=ee,J)}function fe(ee,J,te,me,Ue){return J===null||J.tag!==7?(J=Ys(te,ee.mode,me,Ue),J.return=ee,J):(J=v(J,te),J.return=ee,J)}function ge(ee,J,te){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=Ef(""+J,ee.mode,te),J.return=ee,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return te=Kc(J.type,J.key,J.props,null,ee.mode,te),ho(te,J),te.return=ee,te;case _:return J=jf(J,ee.mode,te),J.return=ee,J;case F:return J=Ws(J),ge(ee,J,te)}if(q(J)||H(J))return J=Ys(J,ee.mode,te,null),J.return=ee,J;if(typeof J.then=="function")return ge(ee,eu(J),te);if(J.$$typeof===C)return ge(ee,Qc(ee,J),te);tu(ee,J)}return null}function ie(ee,J,te,me){var Ue=J!==null?J.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Ue!==null?null:U(ee,J,""+te,me);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return te.key===Ue?Y(ee,J,te,me):null;case _:return te.key===Ue?ne(ee,J,te,me):null;case F:return te=Ws(te),ie(ee,J,te,me)}if(q(te)||H(te))return Ue!==null?null:fe(ee,J,te,me,null);if(typeof te.then=="function")return ie(ee,J,eu(te),me);if(te.$$typeof===C)return ie(ee,J,Qc(ee,te),me);tu(ee,te)}return null}function ce(ee,J,te,me,Ue){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return ee=ee.get(te)||null,U(J,ee,""+me,Ue);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case x:return ee=ee.get(me.key===null?te:me.key)||null,Y(J,ee,me,Ue);case _:return ee=ee.get(me.key===null?te:me.key)||null,ne(J,ee,me,Ue);case F:return me=Ws(me),ce(ee,J,te,me,Ue)}if(q(me)||H(me))return ee=ee.get(te)||null,fe(J,ee,me,Ue,null);if(typeof me.then=="function")return ce(ee,J,te,eu(me),Ue);if(me.$$typeof===C)return ce(ee,J,te,Qc(J,me),Ue);tu(J,me)}return null}function Te(ee,J,te,me){for(var Ue=null,yt=null,Ae=J,tt=J=0,ot=null;Ae!==null&&tt<te.length;tt++){Ae.index>tt?(ot=Ae,Ae=null):ot=Ae.sibling;var vt=ie(ee,Ae,te[tt],me);if(vt===null){Ae===null&&(Ae=ot);break}a&&Ae&&vt.alternate===null&&s(ee,Ae),J=b(vt,J,tt),yt===null?Ue=vt:yt.sibling=vt,yt=vt,Ae=ot}if(tt===te.length)return c(ee,Ae),ut&&yi(ee,tt),Ue;if(Ae===null){for(;tt<te.length;tt++)Ae=ge(ee,te[tt],me),Ae!==null&&(J=b(Ae,J,tt),yt===null?Ue=Ae:yt.sibling=Ae,yt=Ae);return ut&&yi(ee,tt),Ue}for(Ae=h(Ae);tt<te.length;tt++)ot=ce(Ae,ee,tt,te[tt],me),ot!==null&&(a&&ot.alternate!==null&&Ae.delete(ot.key===null?tt:ot.key),J=b(ot,J,tt),yt===null?Ue=ot:yt.sibling=ot,yt=ot);return a&&Ae.forEach(function(gs){return s(ee,gs)}),ut&&yi(ee,tt),Ue}function Ve(ee,J,te,me){if(te==null)throw Error(i(151));for(var Ue=null,yt=null,Ae=J,tt=J=0,ot=null,vt=te.next();Ae!==null&&!vt.done;tt++,vt=te.next()){Ae.index>tt?(ot=Ae,Ae=null):ot=Ae.sibling;var gs=ie(ee,Ae,vt.value,me);if(gs===null){Ae===null&&(Ae=ot);break}a&&Ae&&gs.alternate===null&&s(ee,Ae),J=b(gs,J,tt),yt===null?Ue=gs:yt.sibling=gs,yt=gs,Ae=ot}if(vt.done)return c(ee,Ae),ut&&yi(ee,tt),Ue;if(Ae===null){for(;!vt.done;tt++,vt=te.next())vt=ge(ee,vt.value,me),vt!==null&&(J=b(vt,J,tt),yt===null?Ue=vt:yt.sibling=vt,yt=vt);return ut&&yi(ee,tt),Ue}for(Ae=h(Ae);!vt.done;tt++,vt=te.next())vt=ce(Ae,ee,tt,vt.value,me),vt!==null&&(a&&vt.alternate!==null&&Ae.delete(vt.key===null?tt:vt.key),J=b(vt,J,tt),yt===null?Ue=vt:yt.sibling=vt,yt=vt);return a&&Ae.forEach(function(HE){return s(ee,HE)}),ut&&yi(ee,tt),Ue}function Lt(ee,J,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 Ue=te.key;J!==null;){if(J.key===Ue){if(Ue=te.type,Ue===S){if(J.tag===7){c(ee,J.sibling),me=v(J,te.props.children),me.return=ee,ee=me;break e}}else if(J.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===F&&Ws(Ue)===J.type){c(ee,J.sibling),me=v(J,te.props),ho(me,te),me.return=ee,ee=me;break e}c(ee,J);break}else s(ee,J);J=J.sibling}te.type===S?(me=Ys(te.props.children,ee.mode,me,te.key),me.return=ee,ee=me):(me=Kc(te.type,te.key,te.props,null,ee.mode,me),ho(me,te),me.return=ee,ee=me)}return j(ee);case _:e:{for(Ue=te.key;J!==null;){if(J.key===Ue)if(J.tag===4&&J.stateNode.containerInfo===te.containerInfo&&J.stateNode.implementation===te.implementation){c(ee,J.sibling),me=v(J,te.children||[]),me.return=ee,ee=me;break e}else{c(ee,J);break}else s(ee,J);J=J.sibling}me=jf(te,ee.mode,me),me.return=ee,ee=me}return j(ee);case F:return te=Ws(te),Lt(ee,J,te,me)}if(q(te))return Te(ee,J,te,me);if(H(te)){if(Ue=H(te),typeof Ue!="function")throw Error(i(150));return te=Ue.call(te),Ve(ee,J,te,me)}if(typeof te.then=="function")return Lt(ee,J,eu(te),me);if(te.$$typeof===C)return Lt(ee,J,Qc(ee,te),me);tu(ee,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,J!==null&&J.tag===6?(c(ee,J.sibling),me=v(J,te),me.return=ee,ee=me):(c(ee,J),me=Ef(te,ee.mode,me),me.return=ee,ee=me),j(ee)):c(ee,J)}return function(ee,J,te,me){try{fo=0;var Ue=Lt(ee,J,te,me);return Zr=null,Ue}catch(Ae){if(Ae===Qr||Ae===Jc)throw Ae;var yt=na(29,Ae,null,ee.mode);return yt.lanes=me,yt.return=ee,yt}finally{}}}var tr=lv(!0),ov=lv(!1),Wi=!1;function Uf(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ff(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 es(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ts(a,s,c){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(_t&2)!==0){var v=h.pending;return v===null?s.next=s:(s.next=v.next,v.next=s),h.pending=s,s=Gc(a),Vy(a,null,c),s}return Vc(a,h,s,c),Gc(a)}function mo(a,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194048)!==0)){var h=s.lanes;h&=a.pendingLanes,c|=h,s.lanes=c,qi(a,c)}}function $f(a,s){var c=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var v=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var j={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};b===null?v=b=j:b=b.next=j,c=c.next}while(c!==null);b===null?v=b=s:b=b.next=s}else v=b=s;c={baseState:h.baseState,firstBaseUpdate:v,lastBaseUpdate:b,shared:h.shared,callbacks:h.callbacks},a.updateQueue=c;return}a=c.lastBaseUpdate,a===null?c.firstBaseUpdate=s:a.next=s,c.lastBaseUpdate=s}var Hf=!1;function po(){if(Hf){var a=Xr;if(a!==null)throw a}}function go(a,s,c,h){Hf=!1;var v=a.updateQueue;Wi=!1;var b=v.firstBaseUpdate,j=v.lastBaseUpdate,U=v.shared.pending;if(U!==null){v.shared.pending=null;var Y=U,ne=Y.next;Y.next=null,j===null?b=ne:j.next=ne,j=Y;var fe=a.alternate;fe!==null&&(fe=fe.updateQueue,U=fe.lastBaseUpdate,U!==j&&(U===null?fe.firstBaseUpdate=ne:U.next=ne,fe.lastBaseUpdate=Y))}if(b!==null){var ge=v.baseState;j=0,fe=ne=Y=null,U=b;do{var ie=U.lane&-536870913,ce=ie!==U.lane;if(ce?(lt&ie)===ie:(h&ie)===ie){ie!==0&&ie===Yr&&(Hf=!0),fe!==null&&(fe=fe.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Te=a,Ve=U;ie=s;var Lt=c;switch(Ve.tag){case 1:if(Te=Ve.payload,typeof Te=="function"){ge=Te.call(Lt,ge,ie);break e}ge=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Ve.payload,ie=typeof Te=="function"?Te.call(Lt,ge,ie):Te,ie==null)break e;ge=p({},ge,ie);break e;case 2:Wi=!0}}ie=U.callback,ie!==null&&(a.flags|=64,ce&&(a.flags|=8192),ce=v.callbacks,ce===null?v.callbacks=[ie]:ce.push(ie))}else ce={lane:ie,tag:U.tag,payload:U.payload,callback:U.callback,next:null},fe===null?(ne=fe=ce,Y=ge):fe=fe.next=ce,j|=ie;if(U=U.next,U===null){if(U=v.shared.pending,U===null)break;ce=U,U=ce.next,ce.next=null,v.lastBaseUpdate=ce,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),rs|=j,a.lanes=j,a.memoizedState=ge}}function cv(a,s){if(typeof a!="function")throw Error(i(191,a));a.call(s)}function uv(a,s){var c=a.callbacks;if(c!==null)for(a.callbacks=null,a=0;a<c.length;a++)cv(c[a],s)}var Jr=se(null),nu=se(0);function dv(a,s){a=ki,I(nu,a),I(Jr,s),ki=a|s.baseLanes}function Pf(){I(nu,ki),I(Jr,Jr.current)}function qf(){ki=nu.current,ue(Jr),ue(nu)}var aa=se(null),wa=null;function ns(a){var s=a.alternate;I(Yt,Yt.current&1),I(aa,a),wa===null&&(s===null||Jr.current!==null||s.memoizedState!==null)&&(wa=a)}function Vf(a){I(Yt,Yt.current),I(aa,a),wa===null&&(wa=a)}function fv(a){a.tag===22?(I(Yt,Yt.current),I(aa,a),wa===null&&(wa=a)):as()}function as(){I(Yt,Yt.current),I(aa,aa.current)}function ia(a){ue(aa),wa===a&&(wa=null),ue(Yt)}var Yt=se(0);function au(a){for(var s=a;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Zh(c)||Jh(c)))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 bi=0,et=null,Mt=null,en=null,iu=!1,Wr=!1,nr=!1,su=0,yo=0,el=null,AC=0;function qt(){throw Error(i(321))}function Gf(a,s){if(s===null)return!1;for(var c=0;c<s.length&&c<a.length;c++)if(!ta(a[c],s[c]))return!1;return!0}function Kf(a,s,c,h,v,b){return bi=b,et=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,P.H=a===null||a.memoizedState===null?Xv:oh,nr=!1,b=c(h,v),nr=!1,Wr&&(b=mv(s,c,h,v)),hv(a),b}function hv(a){P.H=bo;var s=Mt!==null&&Mt.next!==null;if(bi=0,en=Mt=et=null,iu=!1,yo=0,el=null,s)throw Error(i(300));a===null||tn||(a=a.dependencies,a!==null&&Xc(a)&&(tn=!0))}function mv(a,s,c,h){et=a;var v=0;do{if(Wr&&(el=null),yo=0,Wr=!1,25<=v)throw Error(i(301));if(v+=1,en=Mt=null,a.updateQueue!=null){var b=a.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}P.H=Qv,b=s(c,h)}while(Wr);return b}function LC(){var a=P.H,s=a.useState()[0];return s=typeof s.then=="function"?vo(s):s,a=a.useState()[0],(Mt!==null?Mt.memoizedState:null)!==a&&(et.flags|=1024),s}function Yf(){var a=su!==0;return su=0,a}function Xf(a,s,c){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~c}function Qf(a){if(iu){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}iu=!1}bi=0,en=Mt=et=null,Wr=!1,yo=su=0,el=null}function Tn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?et.memoizedState=en=a:en=en.next=a,en}function Xt(){if(Mt===null){var a=et.alternate;a=a!==null?a.memoizedState:null}else a=Mt.next;var s=en===null?et.memoizedState:en.next;if(s!==null)en=s,Mt=a;else{if(a===null)throw et.alternate===null?Error(i(467)):Error(i(310));Mt=a,a={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},en===null?et.memoizedState=en=a:en=en.next=a}return en}function ru(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vo(a){var s=yo;return yo+=1,el===null&&(el=[]),a=iv(el,a,s),s=et,(en===null?s.memoizedState:en.next)===null&&(s=s.alternate,P.H=s===null||s.memoizedState===null?Xv:oh),a}function lu(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return vo(a);if(a.$$typeof===C)return vn(a)}throw Error(i(438,String(a)))}function Zf(a){var s=null,c=et.updateQueue;if(c!==null&&(s=c.memoCache),s==null){var h=et.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(v){return v.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),c===null&&(c=ru(),et.updateQueue=c),c.memoCache=s,c=s.data[s.index],c===void 0)for(c=s.data[s.index]=Array(a),h=0;h<a;h++)c[h]=M;return s.index++,c}function _i(a,s){return typeof s=="function"?s(a):s}function ou(a){var s=Xt();return Jf(s,Mt,a)}function Jf(a,s,c){var h=a.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=c;var v=a.baseQueue,b=h.pending;if(b!==null){if(v!==null){var j=v.next;v.next=b.next,b.next=j}s.baseQueue=v=b,h.pending=null}if(b=a.baseState,v===null)a.memoizedState=b;else{s=v.next;var U=j=null,Y=null,ne=s,fe=!1;do{var ge=ne.lane&-536870913;if(ge!==ne.lane?(lt&ge)===ge:(bi&ge)===ge){var ie=ne.revertLane;if(ie===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ge===Yr&&(fe=!0);else if((bi&ie)===ie){ne=ne.next,ie===Yr&&(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,j=b):Y=Y.next=ge,et.lanes|=ie,rs|=ie;ge=ne.action,nr&&c(b,ge),b=ne.hasEagerState?ne.eagerState:c(b,ge)}else ie={lane:ge,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},Y===null?(U=Y=ie,j=b):Y=Y.next=ie,et.lanes|=ge,rs|=ge;ne=ne.next}while(ne!==null&&ne!==s);if(Y===null?j=b:Y.next=U,!ta(b,a.memoizedState)&&(tn=!0,fe&&(c=Xr,c!==null)))throw c;a.memoizedState=b,a.baseState=j,a.baseQueue=Y,h.lastRenderedState=b}return v===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function Wf(a){var s=Xt(),c=s.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=a;var h=c.dispatch,v=c.pending,b=s.memoizedState;if(v!==null){c.pending=null;var j=v=v.next;do b=a(b,j.action),j=j.next;while(j!==v);ta(b,s.memoizedState)||(tn=!0),s.memoizedState=b,s.baseQueue===null&&(s.baseState=b),c.lastRenderedState=b}return[b,h]}function pv(a,s,c){var h=et,v=Xt(),b=ut;if(b){if(c===void 0)throw Error(i(407));c=c()}else c=s();var j=!ta((Mt||v).memoizedState,c);if(j&&(v.memoizedState=c,tn=!0),v=v.queue,nh(vv.bind(null,h,v,a),[a]),v.getSnapshot!==s||j||en!==null&&en.memoizedState.tag&1){if(h.flags|=2048,tl(9,{destroy:void 0},yv.bind(null,h,v,c,s),null),Dt===null)throw Error(i(349));b||(bi&127)!==0||gv(h,s,c)}return c}function gv(a,s,c){a.flags|=16384,a={getSnapshot:s,value:c},s=et.updateQueue,s===null?(s=ru(),et.updateQueue=s,s.stores=[a]):(c=s.stores,c===null?s.stores=[a]:c.push(a))}function yv(a,s,c,h){s.value=c,s.getSnapshot=h,xv(s)&&bv(a)}function vv(a,s,c){return c(function(){xv(s)&&bv(a)})}function xv(a){var s=a.getSnapshot;a=a.value;try{var c=s();return!ta(a,c)}catch(h){return!0}}function bv(a){var s=Ks(a,2);s!==null&&Hn(s,a,2)}function eh(a){var s=Tn();if(typeof a=="function"){var c=a;if(a=c(),nr){bt(!0);try{c()}finally{bt(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_i,lastRenderedState:a},s}function _v(a,s,c,h){return a.baseState=c,Jf(a,Mt,typeof h=="function"?h:_i)}function DC(a,s,c,h,v){if(du(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(j){b.listeners.push(j)}};P.T!==null?c(!0):b.isTransition=!1,h(b),c=s.pending,c===null?(b.next=s.pending=b,Sv(s,b)):(b.next=c.next,s.pending=c.next=b)}}function Sv(a,s){var c=s.action,h=s.payload,v=a.state;if(s.isTransition){var b=P.T,j={};P.T=j;try{var U=c(v,h),Y=P.S;Y!==null&&Y(j,U),wv(a,s,U)}catch(ne){th(a,s,ne)}finally{b!==null&&j.types!==null&&(b.types=j.types),P.T=b}}else try{b=c(v,h),wv(a,s,b)}catch(ne){th(a,s,ne)}}function wv(a,s,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){Nv(a,s,h)},function(h){return th(a,s,h)}):Nv(a,s,c)}function Nv(a,s,c){s.status="fulfilled",s.value=c,Cv(s),a.state=c,s=a.pending,s!==null&&(c=s.next,c===s?a.pending=null:(c=c.next,s.next=c,Sv(a,c)))}function th(a,s,c){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=c,Cv(s),s=s.next;while(s!==h)}a.action=null}function Cv(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function Ev(a,s){return s}function jv(a,s){if(ut){var c=Dt.formState;if(c!==null){e:{var h=et;if(ut){if(Ut){t:{for(var v=Ut,b=Sa;v.nodeType!==8;){if(!b){v=null;break t}if(v=Na(v.nextSibling),v===null){v=null;break t}}b=v.data,v=b==="F!"||b==="F"?v:null}if(v){Ut=Na(v.nextSibling),h=v.data==="F!";break e}}Zi(h)}h=!1}h&&(s=c[0])}}return c=Tn(),c.memoizedState=c.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ev,lastRenderedState:s},c.queue=h,c=Gv.bind(null,et,h),h.dispatch=c,h=eh(!1),b=lh.bind(null,et,!1,h.queue),h=Tn(),v={state:s,dispatch:null,action:a,pending:null},h.queue=v,c=DC.bind(null,et,v,b,c),v.dispatch=c,h.memoizedState=a,[s,c,!1]}function kv(a){var s=Xt();return Tv(s,Mt,a)}function Tv(a,s,c){if(s=Jf(a,s,Ev)[0],a=ou(_i)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var h=vo(s)}catch(j){throw j===Qr?Jc:j}else h=s;s=Xt();var v=s.queue,b=v.dispatch;return c!==s.memoizedState&&(et.flags|=2048,tl(9,{destroy:void 0},OC.bind(null,v,c),null)),[h,b,a]}function OC(a,s){a.action=s}function Rv(a){var s=Xt(),c=Mt;if(c!==null)return Tv(s,c,a);Xt(),s=s.memoizedState,c=Xt();var h=c.queue.dispatch;return c.memoizedState=a,[s,h,!1]}function tl(a,s,c,h){return a={tag:a,create:c,deps:h,inst:s,next:null},s=et.updateQueue,s===null&&(s=ru(),et.updateQueue=s),c=s.lastEffect,c===null?s.lastEffect=a.next=a:(h=c.next,c.next=a,a.next=h,s.lastEffect=a),a}function Mv(){return Xt().memoizedState}function cu(a,s,c,h){var v=Tn();et.flags|=a,v.memoizedState=tl(1|s,{destroy:void 0},c,h===void 0?null:h)}function uu(a,s,c,h){var v=Xt();h=h===void 0?null:h;var b=v.memoizedState.inst;Mt!==null&&h!==null&&Gf(h,Mt.memoizedState.deps)?v.memoizedState=tl(s,b,c,h):(et.flags|=a,v.memoizedState=tl(1|s,b,c,h))}function Av(a,s){cu(8390656,8,a,s)}function nh(a,s){uu(2048,8,a,s)}function IC(a){et.flags|=4;var s=et.updateQueue;if(s===null)s=ru(),et.updateQueue=s,s.events=[a];else{var c=s.events;c===null?s.events=[a]:c.push(a)}}function Lv(a){var s=Xt().memoizedState;return IC({ref:s,nextImpl:a}),function(){if((_t&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}function Dv(a,s){return uu(4,2,a,s)}function Ov(a,s){return uu(4,4,a,s)}function Iv(a,s){if(typeof s=="function"){a=a();var c=s(a);return function(){typeof c=="function"?c():s(null)}}if(s!=null)return a=a(),s.current=a,function(){s.current=null}}function zv(a,s,c){c=c!=null?c.concat([a]):null,uu(4,4,Iv.bind(null,s,a),c)}function ah(){}function Bv(a,s){var c=Xt();s=s===void 0?null:s;var h=c.memoizedState;return s!==null&&Gf(s,h[1])?h[0]:(c.memoizedState=[a,s],a)}function Uv(a,s){var c=Xt();s=s===void 0?null:s;var h=c.memoizedState;if(s!==null&&Gf(s,h[1]))return h[0];if(h=a(),nr){bt(!0);try{a()}finally{bt(!1)}}return c.memoizedState=[h,s],h}function ih(a,s,c){return c===void 0||(bi&1073741824)!==0&&(lt&261930)===0?a.memoizedState=s:(a.memoizedState=c,a=F1(),et.lanes|=a,rs|=a,c)}function Fv(a,s,c,h){return ta(c,s)?c:Jr.current!==null?(a=ih(a,c,h),ta(a,s)||(tn=!0),a):(bi&42)===0||(bi&1073741824)!==0&&(lt&261930)===0?(tn=!0,a.memoizedState=c):(a=F1(),et.lanes|=a,rs|=a,s)}function $v(a,s,c,h,v){var b=Q.p;Q.p=b!==0&&8>b?b:8;var j=P.T,U={};P.T=U,lh(a,!1,s,c);try{var Y=v(),ne=P.S;if(ne!==null&&ne(U,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var fe=MC(Y,h);xo(a,s,fe,la(a))}else xo(a,s,h,la(a))}catch(ge){xo(a,s,{then:function(){},status:"rejected",reason:ge},la())}finally{Q.p=b,j!==null&&U.types!==null&&(j.types=U.types),P.T=j}}function zC(){}function sh(a,s,c,h){if(a.tag!==5)throw Error(i(476));var v=Hv(a).queue;$v(a,v,s,K,c===null?zC:function(){return Pv(a),c(h)})}function Hv(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_i,lastRenderedState:K},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_i,lastRenderedState:c},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function Pv(a){var s=Hv(a);s.next===null&&(s=a.alternate.memoizedState),xo(a,s.next.queue,{},la())}function rh(){return vn(Io)}function qv(){return Xt().memoizedState}function Vv(){return Xt().memoizedState}function BC(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var c=la();a=es(c);var h=ts(s,a,c);h!==null&&(Hn(h,s,c),mo(h,s,c)),s={cache:Of()},a.payload=s;return}s=s.return}}function UC(a,s,c){var h=la();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},du(a)?Kv(s,c):(c=Nf(a,s,c,h),c!==null&&(Hn(c,a,h),Yv(c,s,h)))}function Gv(a,s,c){var h=la();xo(a,s,c,h)}function xo(a,s,c,h){var v={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(du(a))Kv(s,v);else{var b=a.alternate;if(a.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var j=s.lastRenderedState,U=b(j,c);if(v.hasEagerState=!0,v.eagerState=U,ta(U,j))return Vc(a,s,v,0),Dt===null&&qc(),!1}catch(Y){}finally{}if(c=Nf(a,s,v,h),c!==null)return Hn(c,a,h),Yv(c,s,h),!0}return!1}function lh(a,s,c,h){if(h={lane:2,revertLane:Uh(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},du(a)){if(s)throw Error(i(479))}else s=Nf(a,c,h,2),s!==null&&Hn(s,a,2)}function du(a){var s=a.alternate;return a===et||s!==null&&s===et}function Kv(a,s){Wr=iu=!0;var c=a.pending;c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s}function Yv(a,s,c){if((c&4194048)!==0){var h=s.lanes;h&=a.pendingLanes,c|=h,s.lanes=c,qi(a,c)}}var bo={readContext:vn,use:lu,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};bo.useEffectEvent=qt;var Xv={readContext:vn,use:lu,useCallback:function(a,s){return Tn().memoizedState=[a,s===void 0?null:s],a},useContext:vn,useEffect:Av,useImperativeHandle:function(a,s,c){c=c!=null?c.concat([a]):null,cu(4194308,4,Iv.bind(null,s,a),c)},useLayoutEffect:function(a,s){return cu(4194308,4,a,s)},useInsertionEffect:function(a,s){cu(4,2,a,s)},useMemo:function(a,s){var c=Tn();s=s===void 0?null:s;var h=a();if(nr){bt(!0);try{a()}finally{bt(!1)}}return c.memoizedState=[h,s],h},useReducer:function(a,s,c){var h=Tn();if(c!==void 0){var v=c(s);if(nr){bt(!0);try{c(s)}finally{bt(!1)}}}else v=s;return h.memoizedState=h.baseState=v,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:v},h.queue=a,a=a.dispatch=UC.bind(null,et,a),[h.memoizedState,a]},useRef:function(a){var s=Tn();return a={current:a},s.memoizedState=a},useState:function(a){a=eh(a);var s=a.queue,c=Gv.bind(null,et,s);return s.dispatch=c,[a.memoizedState,c]},useDebugValue:ah,useDeferredValue:function(a,s){var c=Tn();return ih(c,a,s)},useTransition:function(){var a=eh(!1);return a=$v.bind(null,et,a.queue,!0,!1),Tn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,c){var h=et,v=Tn();if(ut){if(c===void 0)throw Error(i(407));c=c()}else{if(c=s(),Dt===null)throw Error(i(349));(lt&127)!==0||gv(h,s,c)}v.memoizedState=c;var b={value:c,getSnapshot:s};return v.queue=b,Av(vv.bind(null,h,b,a),[a]),h.flags|=2048,tl(9,{destroy:void 0},yv.bind(null,h,b,c,s),null),c},useId:function(){var a=Tn(),s=Dt.identifierPrefix;if(ut){var c=Qa,h=Xa;c=(h&~(1<<32-mt(h)-1)).toString(32)+c,s="_"+s+"R_"+c,c=su++,0<c&&(s+="H"+c.toString(32)),s+="_"}else c=AC++,s="_"+s+"r_"+c.toString(32)+"_";return a.memoizedState=s},useHostTransitionStatus:rh,useFormState:jv,useActionState:jv,useOptimistic:function(a){var s=Tn();s.memoizedState=s.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=c,s=lh.bind(null,et,!0,c),c.dispatch=s,[a,s]},useMemoCache:Zf,useCacheRefresh:function(){return Tn().memoizedState=BC.bind(null,et)},useEffectEvent:function(a){var s=Tn(),c={impl:a};return s.memoizedState=c,function(){if((_t&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}},oh={readContext:vn,use:lu,useCallback:Bv,useContext:vn,useEffect:nh,useImperativeHandle:zv,useInsertionEffect:Dv,useLayoutEffect:Ov,useMemo:Uv,useReducer:ou,useRef:Mv,useState:function(){return ou(_i)},useDebugValue:ah,useDeferredValue:function(a,s){var c=Xt();return Fv(c,Mt.memoizedState,a,s)},useTransition:function(){var a=ou(_i)[0],s=Xt().memoizedState;return[typeof a=="boolean"?a:vo(a),s]},useSyncExternalStore:pv,useId:qv,useHostTransitionStatus:rh,useFormState:kv,useActionState:kv,useOptimistic:function(a,s){var c=Xt();return _v(c,Mt,a,s)},useMemoCache:Zf,useCacheRefresh:Vv};oh.useEffectEvent=Lv;var Qv={readContext:vn,use:lu,useCallback:Bv,useContext:vn,useEffect:nh,useImperativeHandle:zv,useInsertionEffect:Dv,useLayoutEffect:Ov,useMemo:Uv,useReducer:Wf,useRef:Mv,useState:function(){return Wf(_i)},useDebugValue:ah,useDeferredValue:function(a,s){var c=Xt();return Mt===null?ih(c,a,s):Fv(c,Mt.memoizedState,a,s)},useTransition:function(){var a=Wf(_i)[0],s=Xt().memoizedState;return[typeof a=="boolean"?a:vo(a),s]},useSyncExternalStore:pv,useId:qv,useHostTransitionStatus:rh,useFormState:Rv,useActionState:Rv,useOptimistic:function(a,s){var c=Xt();return Mt!==null?_v(c,Mt,a,s):(c.baseState=a,[a,c.queue.dispatch])},useMemoCache:Zf,useCacheRefresh:Vv};Qv.useEffectEvent=Lv;function ch(a,s,c,h){s=a.memoizedState,c=c(h,s),c=c==null?s:p({},s,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}var uh={enqueueSetState:function(a,s,c){a=a._reactInternals;var h=la(),v=es(h);v.payload=s,c!=null&&(v.callback=c),s=ts(a,v,h),s!==null&&(Hn(s,a,h),mo(s,a,h))},enqueueReplaceState:function(a,s,c){a=a._reactInternals;var h=la(),v=es(h);v.tag=1,v.payload=s,c!=null&&(v.callback=c),s=ts(a,v,h),s!==null&&(Hn(s,a,h),mo(s,a,h))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var c=la(),h=es(c);h.tag=2,s!=null&&(h.callback=s),s=ts(a,h,c),s!==null&&(Hn(s,a,c),mo(s,a,c))}};function Zv(a,s,c,h,v,b,j){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,b,j):s.prototype&&s.prototype.isPureReactComponent?!so(c,h)||!so(v,b):!0}function Jv(a,s,c,h){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,h),s.state!==a&&uh.enqueueReplaceState(s,s.state,null)}function ar(a,s){var c=s;if("ref"in s){c={};for(var h in s)h!=="ref"&&(c[h]=s[h])}if(a=a.defaultProps){c===s&&(c=p({},c));for(var v in a)c[v]===void 0&&(c[v]=a[v])}return c}function Wv(a){Pc(a)}function e1(a){console.error(a)}function t1(a){Pc(a)}function fu(a,s){try{var c=a.onUncaughtError;c(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function n1(a,s,c){try{var h=a.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function dh(a,s,c){return c=es(c),c.tag=3,c.payload={element:null},c.callback=function(){fu(a,s)},c}function a1(a){return a=es(a),a.tag=3,a}function i1(a,s,c,h){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var b=h.value;a.payload=function(){return v(b)},a.callback=function(){n1(s,c,h)}}var j=c.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(a.callback=function(){n1(s,c,h),typeof v!="function"&&(ls===null?ls=new Set([this]):ls.add(this));var U=h.stack;this.componentDidCatch(h.value,{componentStack:U!==null?U:""})})}function FC(a,s,c,h,v){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(s=c.alternate,s!==null&&Kr(s,c,v,!0),c=aa.current,c!==null){switch(c.tag){case 31:case 13:return wa===null?Nu():c.alternate===null&&Vt===0&&(Vt=3),c.flags&=-257,c.flags|=65536,c.lanes=v,h===Wc?c.flags|=16384:(s=c.updateQueue,s===null?c.updateQueue=new Set([h]):s.add(h),Ih(a,h,v)),!1;case 22:return c.flags|=65536,h===Wc?c.flags|=16384:(s=c.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=s):(c=s.retryQueue,c===null?s.retryQueue=new Set([h]):c.add(h)),Ih(a,h,v)),!1}throw Error(i(435,c.tag))}return Ih(a,h,v),Nu(),!1}if(ut)return s=aa.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=v,h!==Rf&&(a=Error(i(422),{cause:h}),oo(xa(a,c)))):(h!==Rf&&(s=Error(i(423),{cause:h}),oo(xa(s,c))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,h=xa(h,c),v=dh(a.stateNode,h,v),$f(a,v),Vt!==4&&(Vt=2)),!1;var b=Error(i(520),{cause:h});if(b=xa(b,c),ko===null?ko=[b]:ko.push(b),Vt!==4&&(Vt=2),s===null)return!0;h=xa(h,c),c=s;do{switch(c.tag){case 3:return c.flags|=65536,a=v&-v,c.lanes|=a,a=dh(c.stateNode,h,a),$f(c,a),!1;case 1:if(s=c.type,b=c.stateNode,(c.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(ls===null||!ls.has(b))))return c.flags|=65536,v&=-v,c.lanes|=v,v=a1(v),i1(v,a,c,h),$f(c,v),!1}c=c.return}while(c!==null);return!1}var fh=Error(i(461)),tn=!1;function xn(a,s,c,h){s.child=a===null?ov(s,null,c,h):tr(s,a.child,c,h)}function s1(a,s,c,h,v){c=c.render;var b=s.ref;if("ref"in h){var j={};for(var U in h)U!=="ref"&&(j[U]=h[U])}else j=h;return Zs(s),h=Kf(a,s,c,j,b,v),U=Yf(),a!==null&&!tn?(Xf(a,s,v),Si(a,s,v)):(ut&&U&&kf(s),s.flags|=1,xn(a,s,h,v),s.child)}function r1(a,s,c,h,v){if(a===null){var b=c.type;return typeof b=="function"&&!Cf(b)&&b.defaultProps===void 0&&c.compare===null?(s.tag=15,s.type=b,l1(a,s,b,h,v)):(a=Kc(c.type,null,h,s,s.mode,v),a.ref=s.ref,a.return=s,s.child=a)}if(b=a.child,!bh(a,v)){var j=b.memoizedProps;if(c=c.compare,c=c!==null?c:so,c(j,h)&&a.ref===s.ref)return Si(a,s,v)}return s.flags|=1,a=gi(b,h),a.ref=s.ref,a.return=s,s.child=a}function l1(a,s,c,h,v){if(a!==null){var b=a.memoizedProps;if(so(b,h)&&a.ref===s.ref)if(tn=!1,s.pendingProps=h=b,bh(a,v))(a.flags&131072)!==0&&(tn=!0);else return s.lanes=a.lanes,Si(a,s,v)}return hh(a,s,c,h,v)}function o1(a,s,c,h){var v=h.children,b=a!==null?a.memoizedState:null;if(a===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((s.flags&128)!==0){if(b=b!==null?b.baseLanes|c:c,a!==null){for(h=s.child=a.child,v=0;h!==null;)v=v|h.lanes|h.childLanes,h=h.sibling;h=v&~b}else h=0,s.child=null;return c1(a,s,b,c,h)}if((c&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&Zc(s,b!==null?b.cachePool:null),b!==null?dv(s,b):Pf(),fv(s);else return h=s.lanes=536870912,c1(a,s,b!==null?b.baseLanes|c:c,c,h)}else b!==null?(Zc(s,b.cachePool),dv(s,b),as(),s.memoizedState=null):(a!==null&&Zc(s,null),Pf(),as());return xn(a,s,v,c),s.child}function _o(a,s){return a!==null&&a.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function c1(a,s,c,h,v){var b=zf();return b=b===null?null:{parent:Wt._currentValue,pool:b},s.memoizedState={baseLanes:c,cachePool:b},a!==null&&Zc(s,null),Pf(),fv(s),a!==null&&Kr(a,s,h,!0),s.childLanes=v,null}function hu(a,s){return s=pu({mode:s.mode,children:s.children},a.mode),s.ref=a.ref,a.child=s,s.return=a,s}function u1(a,s,c){return tr(s,a.child,null,c),a=hu(s,s.pendingProps),a.flags|=2,ia(s),s.memoizedState=null,a}function $C(a,s,c){var h=s.pendingProps,v=(s.flags&128)!==0;if(s.flags&=-129,a===null){if(ut){if(h.mode==="hidden")return a=hu(s,h),s.lanes=536870912,_o(null,a);if(Vf(s),(a=Ut)?(a=Sx(a,Sa),a=a!==null&&a.data==="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Xi!==null?{id:Xa,overflow:Qa}:null,retryLane:536870912,hydrationErrors:null},c=Ky(a),c.return=s,s.child=c,yn=s,Ut=null)):a=null,a===null)throw Zi(s);return s.lanes=536870912,null}return hu(s,h)}var b=a.memoizedState;if(b!==null){var j=b.dehydrated;if(Vf(s),v)if(s.flags&256)s.flags&=-257,s=u1(a,s,c);else if(s.memoizedState!==null)s.child=a.child,s.flags|=128,s=null;else throw Error(i(558));else if(tn||Kr(a,s,c,!1),v=(c&a.childLanes)!==0,tn||v){if(h=Dt,h!==null&&(j=ga(h,c),j!==0&&j!==b.retryLane))throw b.retryLane=j,Ks(a,j),Hn(h,a,j),fh;Nu(),s=u1(a,s,c)}else a=b.treeContext,Ut=Na(j.nextSibling),yn=s,ut=!0,Qi=null,Sa=!1,a!==null&&Qy(s,a),s=hu(s,h),s.flags|=4096;return s}return a=gi(a.child,{mode:h.mode,children:h.children}),a.ref=s.ref,s.child=a,a.return=s,a}function mu(a,s){var c=s.ref;if(c===null)a!==null&&a.ref!==null&&(s.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(i(284));(a===null||a.ref!==c)&&(s.flags|=4194816)}}function hh(a,s,c,h,v){return Zs(s),c=Kf(a,s,c,h,void 0,v),h=Yf(),a!==null&&!tn?(Xf(a,s,v),Si(a,s,v)):(ut&&h&&kf(s),s.flags|=1,xn(a,s,c,v),s.child)}function d1(a,s,c,h,v,b){return Zs(s),s.updateQueue=null,c=mv(s,h,c,v),hv(a),h=Yf(),a!==null&&!tn?(Xf(a,s,b),Si(a,s,b)):(ut&&h&&kf(s),s.flags|=1,xn(a,s,c,b),s.child)}function f1(a,s,c,h,v){if(Zs(s),s.stateNode===null){var b=Pr,j=c.contextType;typeof j=="object"&&j!==null&&(b=vn(j)),b=new c(h,b),s.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=uh,s.stateNode=b,b._reactInternals=s,b=s.stateNode,b.props=h,b.state=s.memoizedState,b.refs={},Uf(s),j=c.contextType,b.context=typeof j=="object"&&j!==null?vn(j):Pr,b.state=s.memoizedState,j=c.getDerivedStateFromProps,typeof j=="function"&&(ch(s,c,j,h),b.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(j=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),j!==b.state&&uh.enqueueReplaceState(b,b.state,null),go(s,h,b,v),po(),b.state=s.memoizedState),typeof b.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(a===null){b=s.stateNode;var U=s.memoizedProps,Y=ar(c,U);b.props=Y;var ne=b.context,fe=c.contextType;j=Pr,typeof fe=="object"&&fe!==null&&(j=vn(fe));var ge=c.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!==j)&&Jv(s,b,h,j),Wi=!1;var ie=s.memoizedState;b.state=ie,go(s,h,b,v),po(),ne=s.memoizedState,U||ie!==ne||Wi?(typeof ge=="function"&&(ch(s,c,ge,h),ne=s.memoizedState),(Y=Wi||Zv(s,c,Y,h,ie,ne,j))?(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=h,s.memoizedState=ne),b.props=h,b.state=ne,b.context=j,h=Y):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{b=s.stateNode,Ff(a,s),j=s.memoizedProps,fe=ar(c,j),b.props=fe,ge=s.pendingProps,ie=b.context,ne=c.contextType,Y=Pr,typeof ne=="object"&&ne!==null&&(Y=vn(ne)),U=c.getDerivedStateFromProps,(ne=typeof U=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(j!==ge||ie!==Y)&&Jv(s,b,h,Y),Wi=!1,ie=s.memoizedState,b.state=ie,go(s,h,b,v),po();var ce=s.memoizedState;j!==ge||ie!==ce||Wi||a!==null&&a.dependencies!==null&&Xc(a.dependencies)?(typeof U=="function"&&(ch(s,c,U,h),ce=s.memoizedState),(fe=Wi||Zv(s,c,fe,h,ie,ce,Y)||a!==null&&a.dependencies!==null&&Xc(a.dependencies))?(ne||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(h,ce,Y),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(h,ce,Y)),typeof b.componentDidUpdate=="function"&&(s.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof b.componentDidUpdate!="function"||j===a.memoizedProps&&ie===a.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&ie===a.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=ce),b.props=h,b.state=ce,b.context=Y,h=fe):(typeof b.componentDidUpdate!="function"||j===a.memoizedProps&&ie===a.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&ie===a.memoizedState||(s.flags|=1024),h=!1)}return b=h,mu(a,s),h=(s.flags&128)!==0,b||h?(b=s.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:b.render(),s.flags|=1,a!==null&&h?(s.child=tr(s,a.child,null,v),s.child=tr(s,null,c,v)):xn(a,s,c,v),s.memoizedState=b.state,a=s.child):a=Si(a,s,v),a}function h1(a,s,c,h){return Xs(),s.flags|=256,xn(a,s,c,h),s.child}var mh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ph(a){return{baseLanes:a,cachePool:nv()}}function gh(a,s,c){return a=a!==null?a.childLanes&~c:0,s&&(a|=ra),a}function m1(a,s,c){var h=s.pendingProps,v=!1,b=(s.flags&128)!==0,j;if((j=b)||(j=a!==null&&a.memoizedState===null?!1:(Yt.current&2)!==0),j&&(v=!0,s.flags&=-129),j=(s.flags&32)!==0,s.flags&=-33,a===null){if(ut){if(v?ns(s):as(),(a=Ut)?(a=Sx(a,Sa),a=a!==null&&a.data!=="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Xi!==null?{id:Xa,overflow:Qa}:null,retryLane:536870912,hydrationErrors:null},c=Ky(a),c.return=s,s.child=c,yn=s,Ut=null)):a=null,a===null)throw Zi(s);return Jh(a)?s.lanes=32:s.lanes=536870912,null}var U=h.children;return h=h.fallback,v?(as(),v=s.mode,U=pu({mode:"hidden",children:U},v),h=Ys(h,v,c,null),U.return=s,h.return=s,U.sibling=h,s.child=U,h=s.child,h.memoizedState=ph(c),h.childLanes=gh(a,j,c),s.memoizedState=mh,_o(null,h)):(ns(s),yh(s,U))}var Y=a.memoizedState;if(Y!==null&&(U=Y.dehydrated,U!==null)){if(b)s.flags&256?(ns(s),s.flags&=-257,s=vh(a,s,c)):s.memoizedState!==null?(as(),s.child=a.child,s.flags|=128,s=null):(as(),U=h.fallback,v=s.mode,h=pu({mode:"visible",children:h.children},v),U=Ys(U,v,c,null),U.flags|=2,h.return=s,U.return=s,h.sibling=U,s.child=h,tr(s,a.child,null,c),h=s.child,h.memoizedState=ph(c),h.childLanes=gh(a,j,c),s.memoizedState=mh,s=_o(null,h));else if(ns(s),Jh(U)){if(j=U.nextSibling&&U.nextSibling.dataset,j)var ne=j.dgst;j=ne,h=Error(i(419)),h.stack="",h.digest=j,oo({value:h,source:null,stack:null}),s=vh(a,s,c)}else if(tn||Kr(a,s,c,!1),j=(c&a.childLanes)!==0,tn||j){if(j=Dt,j!==null&&(h=ga(j,c),h!==0&&h!==Y.retryLane))throw Y.retryLane=h,Ks(a,h),Hn(j,a,h),fh;Zh(U)||Nu(),s=vh(a,s,c)}else Zh(U)?(s.flags|=192,s.child=a.child,s=null):(a=Y.treeContext,Ut=Na(U.nextSibling),yn=s,ut=!0,Qi=null,Sa=!1,a!==null&&Qy(s,a),s=yh(s,h.children),s.flags|=4096);return s}return v?(as(),U=h.fallback,v=s.mode,Y=a.child,ne=Y.sibling,h=gi(Y,{mode:"hidden",children:h.children}),h.subtreeFlags=Y.subtreeFlags&65011712,ne!==null?U=gi(ne,U):(U=Ys(U,v,c,null),U.flags|=2),U.return=s,h.return=s,h.sibling=U,s.child=h,_o(null,h),h=s.child,U=a.child.memoizedState,U===null?U=ph(c):(v=U.cachePool,v!==null?(Y=Wt._currentValue,v=v.parent!==Y?{parent:Y,pool:Y}:v):v=nv(),U={baseLanes:U.baseLanes|c,cachePool:v}),h.memoizedState=U,h.childLanes=gh(a,j,c),s.memoizedState=mh,_o(a.child,h)):(ns(s),c=a.child,a=c.sibling,c=gi(c,{mode:"visible",children:h.children}),c.return=s,c.sibling=null,a!==null&&(j=s.deletions,j===null?(s.deletions=[a],s.flags|=16):j.push(a)),s.child=c,s.memoizedState=null,c)}function yh(a,s){return s=pu({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function pu(a,s){return a=na(22,a,null,s),a.lanes=0,a}function vh(a,s,c){return tr(s,a.child,null,c),a=yh(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function p1(a,s,c){a.lanes|=s;var h=a.alternate;h!==null&&(h.lanes|=s),Lf(a.return,s,c)}function xh(a,s,c,h,v,b){var j=a.memoizedState;j===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:v,treeForkCount:b}:(j.isBackwards=s,j.rendering=null,j.renderingStartTime=0,j.last=h,j.tail=c,j.tailMode=v,j.treeForkCount=b)}function g1(a,s,c){var h=s.pendingProps,v=h.revealOrder,b=h.tail;h=h.children;var j=Yt.current,U=(j&2)!==0;if(U?(j=j&1|2,s.flags|=128):j&=1,I(Yt,j),xn(a,s,h,c),h=ut?lo:0,!U&&a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&p1(a,c,s);else if(a.tag===19)p1(a,c,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(c=s.child,v=null;c!==null;)a=c.alternate,a!==null&&au(a)===null&&(v=c),c=c.sibling;c=v,c===null?(v=s.child,s.child=null):(v=c.sibling,c.sibling=null),xh(s,!1,v,c,b,h);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=s.child,s.child=null;v!==null;){if(a=v.alternate,a!==null&&au(a)===null){s.child=v;break}a=v.sibling,v.sibling=c,c=v,v=a}xh(s,!0,c,null,b,h);break;case"together":xh(s,!1,null,null,void 0,h);break;default:s.memoizedState=null}return s.child}function Si(a,s,c){if(a!==null&&(s.dependencies=a.dependencies),rs|=s.lanes,(c&s.childLanes)===0)if(a!==null){if(Kr(a,s,c,!1),(c&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,c=gi(a,a.pendingProps),s.child=c,c.return=s;a.sibling!==null;)a=a.sibling,c=c.sibling=gi(a,a.pendingProps),c.return=s;c.sibling=null}return s.child}function bh(a,s){return(a.lanes&s)!==0?!0:(a=a.dependencies,!!(a!==null&&Xc(a)))}function HC(a,s,c){switch(s.tag){case 3:we(s,s.stateNode.containerInfo),Ji(s,Wt,a.memoizedState.cache),Xs();break;case 27:case 5:at(s);break;case 4:we(s,s.stateNode.containerInfo);break;case 10:Ji(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Vf(s),null;break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(ns(s),s.flags|=128,null):(c&s.child.childLanes)!==0?m1(a,s,c):(ns(s),a=Si(a,s,c),a!==null?a.sibling:null);ns(s);break;case 19:var v=(a.flags&128)!==0;if(h=(c&s.childLanes)!==0,h||(Kr(a,s,c,!1),h=(c&s.childLanes)!==0),v){if(h)return g1(a,s,c);s.flags|=128}if(v=s.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),I(Yt,Yt.current),h)break;return null;case 22:return s.lanes=0,o1(a,s,c,s.pendingProps);case 24:Ji(s,Wt,a.memoizedState.cache)}return Si(a,s,c)}function y1(a,s,c){if(a!==null)if(a.memoizedProps!==s.pendingProps)tn=!0;else{if(!bh(a,c)&&(s.flags&128)===0)return tn=!1,HC(a,s,c);tn=(a.flags&131072)!==0}else tn=!1,ut&&(s.flags&1048576)!==0&&Xy(s,lo,s.index);switch(s.lanes=0,s.tag){case 16:e:{var h=s.pendingProps;if(a=Ws(s.elementType),s.type=a,typeof a=="function")Cf(a)?(h=ar(a,h),s.tag=1,s=f1(null,s,a,h,c)):(s.tag=0,s=hh(null,s,a,h,c));else{if(a!=null){var v=a.$$typeof;if(v===E){s.tag=11,s=s1(null,s,a,h,c);break e}else if(v===O){s.tag=14,s=r1(null,s,a,h,c);break e}}throw s=$(a)||a,Error(i(306,s,""))}}return s;case 0:return hh(a,s,s.type,s.pendingProps,c);case 1:return h=s.type,v=ar(h,s.pendingProps),f1(a,s,h,v,c);case 3:e:{if(we(s,s.stateNode.containerInfo),a===null)throw Error(i(387));h=s.pendingProps;var b=s.memoizedState;v=b.element,Ff(a,s),go(s,h,null,c);var j=s.memoizedState;if(h=j.cache,Ji(s,Wt,h),h!==b.cache&&Df(s,[Wt],c,!0),po(),h=j.element,b.isDehydrated)if(b={element:h,isDehydrated:!1,cache:j.cache},s.updateQueue.baseState=b,s.memoizedState=b,s.flags&256){s=h1(a,s,h,c);break e}else if(h!==v){v=xa(Error(i(424)),s),oo(v),s=h1(a,s,h,c);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(Ut=Na(a.firstChild),yn=s,ut=!0,Qi=null,Sa=!0,c=ov(s,null,h,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Xs(),h===v){s=Si(a,s,c);break e}xn(a,s,h,c)}s=s.child}return s;case 26:return mu(a,s),a===null?(c=kx(s.type,null,s.pendingProps,null))?s.memoizedState=c:ut||(c=s.type,a=s.pendingProps,h=Mu(xe.current).createElement(c),h[le]=s,h[Ee]=a,bn(h,c,a),Jt(h),s.stateNode=h):s.memoizedState=kx(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return at(s),a===null&&ut&&(h=s.stateNode=Cx(s.type,s.pendingProps,xe.current),yn=s,Sa=!0,v=Ut,ds(s.type)?(Wh=v,Ut=Na(h.firstChild)):Ut=v),xn(a,s,s.pendingProps.children,c),mu(a,s),a===null&&(s.flags|=4194304),s.child;case 5:return a===null&&ut&&((v=h=Ut)&&(h=vE(h,s.type,s.pendingProps,Sa),h!==null?(s.stateNode=h,yn=s,Ut=Na(h.firstChild),Sa=!1,v=!0):v=!1),v||Zi(s)),at(s),v=s.type,b=s.pendingProps,j=a!==null?a.memoizedProps:null,h=b.children,Yh(v,b)?h=null:j!==null&&Yh(v,j)&&(s.flags|=32),s.memoizedState!==null&&(v=Kf(a,s,LC,null,null,c),Io._currentValue=v),mu(a,s),xn(a,s,h,c),s.child;case 6:return a===null&&ut&&((a=c=Ut)&&(c=xE(c,s.pendingProps,Sa),c!==null?(s.stateNode=c,yn=s,Ut=null,a=!0):a=!1),a||Zi(s)),null;case 13:return m1(a,s,c);case 4:return we(s,s.stateNode.containerInfo),h=s.pendingProps,a===null?s.child=tr(s,null,h,c):xn(a,s,h,c),s.child;case 11:return s1(a,s,s.type,s.pendingProps,c);case 7:return xn(a,s,s.pendingProps,c),s.child;case 8:return xn(a,s,s.pendingProps.children,c),s.child;case 12:return xn(a,s,s.pendingProps.children,c),s.child;case 10:return h=s.pendingProps,Ji(s,s.type,h.value),xn(a,s,h.children,c),s.child;case 9:return v=s.type._context,h=s.pendingProps.children,Zs(s),v=vn(v),h=h(v),s.flags|=1,xn(a,s,h,c),s.child;case 14:return r1(a,s,s.type,s.pendingProps,c);case 15:return l1(a,s,s.type,s.pendingProps,c);case 19:return g1(a,s,c);case 31:return $C(a,s,c);case 22:return o1(a,s,c,s.pendingProps);case 24:return Zs(s),h=vn(Wt),a===null?(v=zf(),v===null&&(v=Dt,b=Of(),v.pooledCache=b,b.refCount++,b!==null&&(v.pooledCacheLanes|=c),v=b),s.memoizedState={parent:h,cache:v},Uf(s),Ji(s,Wt,v)):((a.lanes&c)!==0&&(Ff(a,s),go(s,null,null,c),po()),v=a.memoizedState,b=s.memoizedState,v.parent!==h?(v={parent:h,cache:h},s.memoizedState=v,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=v),Ji(s,Wt,h)):(h=b.cache,Ji(s,Wt,h),h!==v.cache&&Df(s,[Wt],c,!0))),xn(a,s,s.pendingProps.children,c),s.child;case 29:throw s.pendingProps}throw Error(i(156,s.tag))}function wi(a){a.flags|=4}function _h(a,s,c,h,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(q1())a.flags|=8192;else throw er=Wc,Bf}else a.flags&=-16777217}function v1(a,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!Lx(s))if(q1())a.flags|=8192;else throw er=Wc,Bf}function gu(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?Qt():536870912,a.lanes|=s,sl|=s)}function So(a,s){if(!ut)switch(a.tailMode){case"hidden":s=a.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function Ft(a){var s=a.alternate!==null&&a.alternate.child===a.child,c=0,h=0;if(s)for(var v=a.child;v!==null;)c|=v.lanes|v.childLanes,h|=v.subtreeFlags&65011712,h|=v.flags&65011712,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)c|=v.lanes|v.childLanes,h|=v.subtreeFlags,h|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=h,a.childLanes=c,s}function PC(a,s,c){var h=s.pendingProps;switch(Tf(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(s),null;case 1:return Ft(s),null;case 3:return c=s.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),xi(Wt),Ce(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&(Gr(s)?wi(s):a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Mf())),Ft(s),null;case 26:var v=s.type,b=s.memoizedState;return a===null?(wi(s),b!==null?(Ft(s),v1(s,b)):(Ft(s),_h(s,v,null,h,c))):b?b!==a.memoizedState?(wi(s),Ft(s),v1(s,b)):(Ft(s),s.flags&=-16777217):(a=a.memoizedProps,a!==h&&wi(s),Ft(s),_h(s,v,a,h,c)),null;case 27:if(Ze(s),c=xe.current,v=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==h&&wi(s);else{if(!h){if(s.stateNode===null)throw Error(i(166));return Ft(s),null}a=ae.current,Gr(s)?Zy(s):(a=Cx(v,h,c),s.stateNode=a,wi(s))}return Ft(s),null;case 5:if(Ze(s),v=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==h&&wi(s);else{if(!h){if(s.stateNode===null)throw Error(i(166));return Ft(s),null}if(b=ae.current,Gr(s))Zy(s);else{var j=Mu(xe.current);switch(b){case 1:b=j.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:b=j.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":b=j.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":b=j.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":b=j.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof h.is=="string"?j.createElement("select",{is:h.is}):j.createElement("select"),h.multiple?b.multiple=!0:h.size&&(b.size=h.size);break;default:b=typeof h.is=="string"?j.createElement(v,{is:h.is}):j.createElement(v)}}b[le]=s,b[Ee]=h;e:for(j=s.child;j!==null;){if(j.tag===5||j.tag===6)b.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===s)break e;for(;j.sibling===null;){if(j.return===null||j.return===s)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}s.stateNode=b;e:switch(bn(b,v,h),v){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&wi(s)}}return Ft(s),_h(s,s.type,a===null?null:a.memoizedProps,s.pendingProps,c),null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==h&&wi(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(i(166));if(a=xe.current,Gr(s)){if(a=s.stateNode,c=s.memoizedProps,h=null,v=yn,v!==null)switch(v.tag){case 27:case 5:h=v.memoizedProps}a[le]=s,a=!!(a.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||mx(a.nodeValue,c)),a||Zi(s,!0)}else a=Mu(a).createTextNode(h),a[le]=s,s.stateNode=a}return Ft(s),null;case 31:if(c=s.memoizedState,a===null||a.memoizedState!==null){if(h=Gr(s),c!==null){if(a===null){if(!h)throw Error(i(318));if(a=s.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[le]=s}else Xs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ft(s),a=!1}else c=Mf(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=c),a=!0;if(!a)return s.flags&256?(ia(s),s):(ia(s),null);if((s.flags&128)!==0)throw Error(i(558))}return Ft(s),null;case 13:if(h=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(v=Gr(s),h!==null&&h.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 Xs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ft(s),v=!1}else v=Mf(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=v),v=!0;if(!v)return s.flags&256?(ia(s),s):(ia(s),null)}return ia(s),(s.flags&128)!==0?(s.lanes=c,s):(c=h!==null,a=a!==null&&a.memoizedState!==null,c&&(h=s.child,v=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(v=h.alternate.memoizedState.cachePool.pool),b=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(b=h.memoizedState.cachePool.pool),b!==v&&(h.flags|=2048)),c!==a&&c&&(s.child.flags|=8192),gu(s,s.updateQueue),Ft(s),null);case 4:return Ce(),a===null&&Ph(s.stateNode.containerInfo),Ft(s),null;case 10:return xi(s.type),Ft(s),null;case 19:if(ue(Yt),h=s.memoizedState,h===null)return Ft(s),null;if(v=(s.flags&128)!==0,b=h.rendering,b===null)if(v)So(h,!1);else{if(Vt!==0||a!==null&&(a.flags&128)!==0)for(a=s.child;a!==null;){if(b=au(a),b!==null){for(s.flags|=128,So(h,!1),a=b.updateQueue,s.updateQueue=a,gu(s,a),s.subtreeFlags=0,a=c,c=s.child;c!==null;)Gy(c,a),c=c.sibling;return I(Yt,Yt.current&1|2),ut&&yi(s,h.treeForkCount),s.child}a=a.sibling}h.tail!==null&&xt()>_u&&(s.flags|=128,v=!0,So(h,!1),s.lanes=4194304)}else{if(!v)if(a=au(b),a!==null){if(s.flags|=128,v=!0,a=a.updateQueue,s.updateQueue=a,gu(s,a),So(h,!0),h.tail===null&&h.tailMode==="hidden"&&!b.alternate&&!ut)return Ft(s),null}else 2*xt()-h.renderingStartTime>_u&&c!==536870912&&(s.flags|=128,v=!0,So(h,!1),s.lanes=4194304);h.isBackwards?(b.sibling=s.child,s.child=b):(a=h.last,a!==null?a.sibling=b:s.child=b,h.last=b)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=xt(),a.sibling=null,c=Yt.current,I(Yt,v?c&1|2:c&1),ut&&yi(s,h.treeForkCount),a):(Ft(s),null);case 22:case 23:return ia(s),qf(),h=s.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(c&536870912)!==0&&(s.flags&128)===0&&(Ft(s),s.subtreeFlags&6&&(s.flags|=8192)):Ft(s),c=s.updateQueue,c!==null&&gu(s,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==c&&(s.flags|=2048),a!==null&&ue(Js),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),xi(Wt),Ft(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function qC(a,s){switch(Tf(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return xi(Wt),Ce(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return Ze(s),null;case 31:if(s.memoizedState!==null){if(ia(s),s.alternate===null)throw Error(i(340));Xs()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 13:if(ia(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(i(340));Xs()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return ue(Yt),null;case 4:return Ce(),null;case 10:return xi(s.type),null;case 22:case 23:return ia(s),qf(),a!==null&&ue(Js),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return xi(Wt),null;case 25:return null;default:return null}}function x1(a,s){switch(Tf(s),s.tag){case 3:xi(Wt),Ce();break;case 26:case 27:case 5:Ze(s);break;case 4:Ce();break;case 31:s.memoizedState!==null&&ia(s);break;case 13:ia(s);break;case 19:ue(Yt);break;case 10:xi(s.type);break;case 22:case 23:ia(s),qf(),a!==null&&ue(Js);break;case 24:xi(Wt)}}function wo(a,s){try{var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var v=h.next;c=v;do{if((c.tag&a)===a){h=void 0;var b=c.create,j=c.inst;h=b(),j.destroy=h}c=c.next}while(c!==v)}}catch(U){kt(s,s.return,U)}}function is(a,s,c){try{var h=s.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var b=v.next;h=b;do{if((h.tag&a)===a){var j=h.inst,U=j.destroy;if(U!==void 0){j.destroy=void 0,v=s;var Y=c,ne=U;try{ne()}catch(fe){kt(v,Y,fe)}}}h=h.next}while(h!==b)}}catch(fe){kt(s,s.return,fe)}}function b1(a){var s=a.updateQueue;if(s!==null){var c=a.stateNode;try{uv(s,c)}catch(h){kt(a,a.return,h)}}}function _1(a,s,c){c.props=ar(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(h){kt(a,s,h)}}function No(a,s){try{var c=a.ref;if(c!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof c=="function"?a.refCleanup=c(h):c.current=h}}catch(v){kt(a,s,v)}}function Za(a,s){var c=a.ref,h=a.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(v){kt(a,s,v)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){kt(a,s,v)}else c.current=null}function S1(a){var s=a.type,c=a.memoizedProps,h=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(v){kt(a,a.return,v)}}function Sh(a,s,c){try{var h=a.stateNode;fE(h,a.type,c,s),h[Ee]=s}catch(v){kt(a,a.return,v)}}function w1(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&ds(a.type)||a.tag===4}function wh(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||w1(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&&ds(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 Nh(a,s,c){var h=a.tag;if(h===5||h===6)a=a.stateNode,s?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(a,s):(s=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,s.appendChild(a),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=mi));else if(h!==4&&(h===27&&ds(a.type)&&(c=a.stateNode,s=null),a=a.child,a!==null))for(Nh(a,s,c),a=a.sibling;a!==null;)Nh(a,s,c),a=a.sibling}function yu(a,s,c){var h=a.tag;if(h===5||h===6)a=a.stateNode,s?c.insertBefore(a,s):c.appendChild(a);else if(h!==4&&(h===27&&ds(a.type)&&(c=a.stateNode),a=a.child,a!==null))for(yu(a,s,c),a=a.sibling;a!==null;)yu(a,s,c),a=a.sibling}function N1(a){var s=a.stateNode,c=a.memoizedProps;try{for(var h=a.type,v=s.attributes;v.length;)s.removeAttributeNode(v[0]);bn(s,h,c),s[le]=a,s[Ee]=c}catch(b){kt(a,a.return,b)}}var Ni=!1,nn=!1,Ch=!1,C1=typeof WeakSet=="function"?WeakSet:Set,hn=null;function VC(a,s){if(a=a.containerInfo,Gh=Bu,a=zy(a),vf(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else e:{c=(c=a.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var v=h.anchorOffset,b=h.focusNode;h=h.focusOffset;try{c.nodeType,b.nodeType}catch(Ve){c=null;break e}var j=0,U=-1,Y=-1,ne=0,fe=0,ge=a,ie=null;t:for(;;){for(var ce;ge!==c||v!==0&&ge.nodeType!==3||(U=j+v),ge!==b||h!==0&&ge.nodeType!==3||(Y=j+h),ge.nodeType===3&&(j+=ge.nodeValue.length),(ce=ge.firstChild)!==null;)ie=ge,ge=ce;for(;;){if(ge===a)break t;if(ie===c&&++ne===v&&(U=j),ie===b&&++fe===h&&(Y=j),(ce=ge.nextSibling)!==null)break;ge=ie,ie=ge.parentNode}ge=ce}c=U===-1||Y===-1?null:{start:U,end:Y}}else c=null}c=c||{start:0,end:0}}else c=null;for(Kh={focusedElem:a,selectionRange:c},Bu=!1,hn=s;hn!==null;)if(s=hn,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,hn=a;else for(;hn!==null;){switch(s=hn,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(c=0;c<a.length;c++)v=a[c],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&b!==null){a=void 0,c=s,v=b.memoizedProps,b=b.memoizedState,h=c.stateNode;try{var Te=ar(c.type,v);a=h.getSnapshotBeforeUpdate(Te,b),h.__reactInternalSnapshotBeforeUpdate=a}catch(Ve){kt(c,c.return,Ve)}}break;case 3:if((a&1024)!==0){if(a=s.stateNode.containerInfo,c=a.nodeType,c===9)Qh(a);else if(c===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Qh(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,hn=a;break}hn=s.return}}function E1(a,s,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:Ei(a,c),h&4&&wo(5,c);break;case 1:if(Ei(a,c),h&4)if(a=c.stateNode,s===null)try{a.componentDidMount()}catch(j){kt(c,c.return,j)}else{var v=ar(c.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(v,s,a.__reactInternalSnapshotBeforeUpdate)}catch(j){kt(c,c.return,j)}}h&64&&b1(c),h&512&&No(c,c.return);break;case 3:if(Ei(a,c),h&64&&(a=c.updateQueue,a!==null)){if(s=null,c.child!==null)switch(c.child.tag){case 27:case 5:s=c.child.stateNode;break;case 1:s=c.child.stateNode}try{uv(a,s)}catch(j){kt(c,c.return,j)}}break;case 27:s===null&&h&4&&N1(c);case 26:case 5:Ei(a,c),s===null&&h&4&&S1(c),h&512&&No(c,c.return);break;case 12:Ei(a,c);break;case 31:Ei(a,c),h&4&&T1(a,c);break;case 13:Ei(a,c),h&4&&R1(a,c),h&64&&(a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(c=eE.bind(null,c),bE(a,c))));break;case 22:if(h=c.memoizedState!==null||Ni,!h){s=s!==null&&s.memoizedState!==null||nn,v=Ni;var b=nn;Ni=h,(nn=s)&&!b?ji(a,c,(c.subtreeFlags&8772)!==0):Ei(a,c),Ni=v,nn=b}break;case 30:break;default:Ei(a,c)}}function j1(a){var s=a.alternate;s!==null&&(a.alternate=null,j1(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&On(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,Bn=!1;function Ci(a,s,c){for(c=c.child;c!==null;)k1(a,s,c),c=c.sibling}function k1(a,s,c){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(wt,c)}catch(b){}switch(c.tag){case 26:nn||Za(c,s),Ci(a,s,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:nn||Za(c,s);var h=Pt,v=Bn;ds(c.type)&&(Pt=c.stateNode,Bn=!1),Ci(a,s,c),Lo(c.stateNode),Pt=h,Bn=v;break;case 5:nn||Za(c,s);case 6:if(h=Pt,v=Bn,Pt=null,Ci(a,s,c),Pt=h,Bn=v,Pt!==null)if(Bn)try{(Pt.nodeType===9?Pt.body:Pt.nodeName==="HTML"?Pt.ownerDocument.body:Pt).removeChild(c.stateNode)}catch(b){kt(c,s,b)}else try{Pt.removeChild(c.stateNode)}catch(b){kt(c,s,b)}break;case 18:Pt!==null&&(Bn?(a=Pt,bx(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,c.stateNode),hl(a)):bx(Pt,c.stateNode));break;case 4:h=Pt,v=Bn,Pt=c.stateNode.containerInfo,Bn=!0,Ci(a,s,c),Pt=h,Bn=v;break;case 0:case 11:case 14:case 15:is(2,c,s),nn||is(4,c,s),Ci(a,s,c);break;case 1:nn||(Za(c,s),h=c.stateNode,typeof h.componentWillUnmount=="function"&&_1(c,s,h)),Ci(a,s,c);break;case 21:Ci(a,s,c);break;case 22:nn=(h=nn)||c.memoizedState!==null,Ci(a,s,c),nn=h;break;default:Ci(a,s,c)}}function T1(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{hl(a)}catch(c){kt(s,s.return,c)}}}function R1(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{hl(a)}catch(c){kt(s,s.return,c)}}function GC(a){switch(a.tag){case 31:case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new C1),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new C1),s;default:throw Error(i(435,a.tag))}}function vu(a,s){var c=GC(a);s.forEach(function(h){if(!c.has(h)){c.add(h);var v=tE.bind(null,a,h);h.then(v,v)}})}function Un(a,s){var c=s.deletions;if(c!==null)for(var h=0;h<c.length;h++){var v=c[h],b=a,j=s,U=j;e:for(;U!==null;){switch(U.tag){case 27:if(ds(U.type)){Pt=U.stateNode,Bn=!1;break e}break;case 5:Pt=U.stateNode,Bn=!1;break e;case 3:case 4:Pt=U.stateNode.containerInfo,Bn=!0;break e}U=U.return}if(Pt===null)throw Error(i(160));k1(b,j,v),Pt=null,Bn=!1,b=v.alternate,b!==null&&(b.return=null),v.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)M1(s,a),s=s.sibling}var $a=null;function M1(a,s){var c=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Un(s,a),Fn(a),h&4&&(is(3,a,a.return),wo(3,a),is(5,a,a.return));break;case 1:Un(s,a),Fn(a),h&512&&(nn||c===null||Za(c,c.return)),h&64&&Ni&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var v=$a;if(Un(s,a),Fn(a),h&512&&(nn||c===null||Za(c,c.return)),h&4){var b=c!==null?c.memoizedState:null;if(h=a.memoizedState,c===null)if(h===null)if(a.stateNode===null){e:{h=a.type,c=a.memoizedProps,v=v.ownerDocument||v;t:switch(h){case"title":b=v.getElementsByTagName("title")[0],(!b||b[Zt]||b[le]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=v.createElement(h),v.head.insertBefore(b,v.querySelector("head > title"))),bn(b,h,c),b[le]=a,Jt(b),h=b;break e;case"link":var j=Mx("link","href",v).get(h+(c.href||""));if(j){for(var U=0;U<j.length;U++)if(b=j[U],b.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&b.getAttribute("rel")===(c.rel==null?null:c.rel)&&b.getAttribute("title")===(c.title==null?null:c.title)&&b.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){j.splice(U,1);break t}}b=v.createElement(h),bn(b,h,c),v.head.appendChild(b);break;case"meta":if(j=Mx("meta","content",v).get(h+(c.content||""))){for(U=0;U<j.length;U++)if(b=j[U],b.getAttribute("content")===(c.content==null?null:""+c.content)&&b.getAttribute("name")===(c.name==null?null:c.name)&&b.getAttribute("property")===(c.property==null?null:c.property)&&b.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&b.getAttribute("charset")===(c.charSet==null?null:c.charSet)){j.splice(U,1);break t}}b=v.createElement(h),bn(b,h,c),v.head.appendChild(b);break;default:throw Error(i(468,h))}b[le]=a,Jt(b),h=b}a.stateNode=h}else Ax(v,a.type,a.stateNode);else a.stateNode=Rx(v,h,a.memoizedProps);else b!==h?(b===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):b.count--,h===null?Ax(v,a.type,a.stateNode):Rx(v,h,a.memoizedProps)):h===null&&a.stateNode!==null&&Sh(a,a.memoizedProps,c.memoizedProps)}break;case 27:Un(s,a),Fn(a),h&512&&(nn||c===null||Za(c,c.return)),c!==null&&h&4&&Sh(a,a.memoizedProps,c.memoizedProps);break;case 5:if(Un(s,a),Fn(a),h&512&&(nn||c===null||Za(c,c.return)),a.flags&32){v=a.stateNode;try{fi(v,"")}catch(Te){kt(a,a.return,Te)}}h&4&&a.stateNode!=null&&(v=a.memoizedProps,Sh(a,v,c!==null?c.memoizedProps:v)),h&1024&&(Ch=!0);break;case 6:if(Un(s,a),Fn(a),h&4){if(a.stateNode===null)throw Error(i(162));h=a.memoizedProps,c=a.stateNode;try{c.nodeValue=h}catch(Te){kt(a,a.return,Te)}}break;case 3:if(Du=null,v=$a,$a=Au(s.containerInfo),Un(s,a),$a=v,Fn(a),h&4&&c!==null&&c.memoizedState.isDehydrated)try{hl(s.containerInfo)}catch(Te){kt(a,a.return,Te)}Ch&&(Ch=!1,A1(a));break;case 4:h=$a,$a=Au(a.stateNode.containerInfo),Un(s,a),Fn(a),$a=h;break;case 12:Un(s,a),Fn(a);break;case 31:Un(s,a),Fn(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,vu(a,h)));break;case 13:Un(s,a),Fn(a),a.child.flags&8192&&a.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(bu=xt()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,vu(a,h)));break;case 22:v=a.memoizedState!==null;var Y=c!==null&&c.memoizedState!==null,ne=Ni,fe=nn;if(Ni=ne||v,nn=fe||Y,Un(s,a),nn=fe,Ni=ne,Fn(a),h&8192)e:for(s=a.stateNode,s._visibility=v?s._visibility&-2:s._visibility|1,v&&(c===null||Y||Ni||nn||ir(a)),c=null,s=a;;){if(s.tag===5||s.tag===26){if(c===null){Y=c=s;try{if(b=Y.stateNode,v)j=b.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{U=Y.stateNode;var ge=Y.memoizedProps.style,ie=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;U.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(Te){kt(Y,Y.return,Te)}}}else if(s.tag===6){if(c===null){Y=s;try{Y.stateNode.nodeValue=v?"":Y.memoizedProps}catch(Te){kt(Y,Y.return,Te)}}}else if(s.tag===18){if(c===null){Y=s;try{var ce=Y.stateNode;v?_x(ce,!0):_x(Y.stateNode,!1)}catch(Te){kt(Y,Y.return,Te)}}}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;c===s&&(c=null),s=s.return}c===s&&(c=null),s.sibling.return=s.return,s=s.sibling}h&4&&(h=a.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,vu(a,c))));break;case 19:Un(s,a),Fn(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,vu(a,h)));break;case 30:break;case 21:break;default:Un(s,a),Fn(a)}}function Fn(a){var s=a.flags;if(s&2){try{for(var c,h=a.return;h!==null;){if(w1(h)){c=h;break}h=h.return}if(c==null)throw Error(i(160));switch(c.tag){case 27:var v=c.stateNode,b=wh(a);yu(a,b,v);break;case 5:var j=c.stateNode;c.flags&32&&(fi(j,""),c.flags&=-33);var U=wh(a);yu(a,U,j);break;case 3:case 4:var Y=c.stateNode.containerInfo,ne=wh(a);Nh(a,ne,Y);break;default:throw Error(i(161))}}catch(fe){kt(a,a.return,fe)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function A1(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;A1(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function Ei(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)E1(a,s.alternate,s),s=s.sibling}function ir(a){for(a=a.child;a!==null;){var s=a;switch(s.tag){case 0:case 11:case 14:case 15:is(4,s,s.return),ir(s);break;case 1:Za(s,s.return);var c=s.stateNode;typeof c.componentWillUnmount=="function"&&_1(s,s.return,c),ir(s);break;case 27:Lo(s.stateNode);case 26:case 5:Za(s,s.return),ir(s);break;case 22:s.memoizedState===null&&ir(s);break;case 30:ir(s);break;default:ir(s)}a=a.sibling}}function ji(a,s,c){for(c=c&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var h=s.alternate,v=a,b=s,j=b.flags;switch(b.tag){case 0:case 11:case 15:ji(v,b,c),wo(4,b);break;case 1:if(ji(v,b,c),h=b,v=h.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ne){kt(h,h.return,ne)}if(h=b,v=h.updateQueue,v!==null){var U=h.stateNode;try{var Y=v.shared.hiddenCallbacks;if(Y!==null)for(v.shared.hiddenCallbacks=null,v=0;v<Y.length;v++)cv(Y[v],U)}catch(ne){kt(h,h.return,ne)}}c&&j&64&&b1(b),No(b,b.return);break;case 27:N1(b);case 26:case 5:ji(v,b,c),c&&h===null&&j&4&&S1(b),No(b,b.return);break;case 12:ji(v,b,c);break;case 31:ji(v,b,c),c&&j&4&&T1(v,b);break;case 13:ji(v,b,c),c&&j&4&&R1(v,b);break;case 22:b.memoizedState===null&&ji(v,b,c),No(b,b.return);break;case 30:break;default:ji(v,b,c)}s=s.sibling}}function Eh(a,s){var c=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==c&&(a!=null&&a.refCount++,c!=null&&co(c))}function jh(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&co(a))}function Ha(a,s,c,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)L1(a,s,c,h),s=s.sibling}function L1(a,s,c,h){var v=s.flags;switch(s.tag){case 0:case 11:case 15:Ha(a,s,c,h),v&2048&&wo(9,s);break;case 1:Ha(a,s,c,h);break;case 3:Ha(a,s,c,h),v&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&co(a)));break;case 12:if(v&2048){Ha(a,s,c,h),a=s.stateNode;try{var b=s.memoizedProps,j=b.id,U=b.onPostCommit;typeof U=="function"&&U(j,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(Y){kt(s,s.return,Y)}}else Ha(a,s,c,h);break;case 31:Ha(a,s,c,h);break;case 13:Ha(a,s,c,h);break;case 23:break;case 22:b=s.stateNode,j=s.alternate,s.memoizedState!==null?b._visibility&2?Ha(a,s,c,h):Co(a,s):b._visibility&2?Ha(a,s,c,h):(b._visibility|=2,nl(a,s,c,h,(s.subtreeFlags&10256)!==0||!1)),v&2048&&Eh(j,s);break;case 24:Ha(a,s,c,h),v&2048&&jh(s.alternate,s);break;default:Ha(a,s,c,h)}}function nl(a,s,c,h,v){for(v=v&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var b=a,j=s,U=c,Y=h,ne=j.flags;switch(j.tag){case 0:case 11:case 15:nl(b,j,U,Y,v),wo(8,j);break;case 23:break;case 22:var fe=j.stateNode;j.memoizedState!==null?fe._visibility&2?nl(b,j,U,Y,v):Co(b,j):(fe._visibility|=2,nl(b,j,U,Y,v)),v&&ne&2048&&Eh(j.alternate,j);break;case 24:nl(b,j,U,Y,v),v&&ne&2048&&jh(j.alternate,j);break;default:nl(b,j,U,Y,v)}s=s.sibling}}function Co(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var c=a,h=s,v=h.flags;switch(h.tag){case 22:Co(c,h),v&2048&&Eh(h.alternate,h);break;case 24:Co(c,h),v&2048&&jh(h.alternate,h);break;default:Co(c,h)}s=s.sibling}}var Eo=8192;function al(a,s,c){if(a.subtreeFlags&Eo)for(a=a.child;a!==null;)D1(a,s,c),a=a.sibling}function D1(a,s,c){switch(a.tag){case 26:al(a,s,c),a.flags&Eo&&a.memoizedState!==null&&AE(c,$a,a.memoizedState,a.memoizedProps);break;case 5:al(a,s,c);break;case 3:case 4:var h=$a;$a=Au(a.stateNode.containerInfo),al(a,s,c),$a=h;break;case 22:a.memoizedState===null&&(h=a.alternate,h!==null&&h.memoizedState!==null?(h=Eo,Eo=16777216,al(a,s,c),Eo=h):al(a,s,c));break;default:al(a,s,c)}}function O1(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 jo(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];hn=h,z1(h,a)}O1(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)I1(a),a=a.sibling}function I1(a){switch(a.tag){case 0:case 11:case 15:jo(a),a.flags&2048&&is(9,a,a.return);break;case 3:jo(a);break;case 12:jo(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&2&&(a.return===null||a.return.tag!==13)?(s._visibility&=-3,xu(a)):jo(a);break;default:jo(a)}}function xu(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];hn=h,z1(h,a)}O1(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:is(8,s,s.return),xu(s);break;case 22:c=s.stateNode,c._visibility&2&&(c._visibility&=-3,xu(s));break;default:xu(s)}a=a.sibling}}function z1(a,s){for(;hn!==null;){var c=hn;switch(c.tag){case 0:case 11:case 15:is(8,c,s);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:co(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,hn=h;else e:for(c=a;hn!==null;){h=hn;var v=h.sibling,b=h.return;if(j1(h),h===c){hn=null;break e}if(v!==null){v.return=b,hn=v;break e}hn=b}}}var KC={getCacheForType:function(a){var s=vn(Wt),c=s.data.get(a);return c===void 0&&(c=a(),s.data.set(a,c)),c},cacheSignal:function(){return vn(Wt).controller.signal}},YC=typeof WeakMap=="function"?WeakMap:Map,_t=0,Dt=null,it=null,lt=0,jt=0,sa=null,ss=!1,il=!1,kh=!1,ki=0,Vt=0,rs=0,sr=0,Th=0,ra=0,sl=0,ko=null,$n=null,Rh=!1,bu=0,B1=0,_u=1/0,Su=null,ls=null,ln=0,os=null,rl=null,Ti=0,Mh=0,Ah=null,U1=null,To=0,Lh=null;function la(){return(_t&2)!==0&<!==0?lt&-lt:P.T!==null?Uh():Hs()}function F1(){if(ra===0)if((lt&536870912)===0||ut){var a=oi;oi<<=1,(oi&3932160)===0&&(oi=262144),ra=a}else ra=536870912;return a=aa.current,a!==null&&(a.flags|=32),ra}function Hn(a,s,c){(a===Dt&&(jt===2||jt===9)||a.cancelPendingCommit!==null)&&(ll(a,0),cs(a,lt,ra,!1)),pa(a,c),((_t&2)===0||a!==Dt)&&(a===Dt&&((_t&2)===0&&(sr|=c),Vt===4&&cs(a,lt,ra,!1)),Ja(a))}function $1(a,s,c){if((_t&6)!==0)throw Error(i(327));var h=!c&&(s&127)===0&&(s&a.expiredLanes)===0||Ye(a,s),v=h?ZC(a,s):Oh(a,s,!0),b=h;do{if(v===0){il&&!h&&cs(a,s,0,!1);break}else{if(c=a.current.alternate,b&&!XC(c)){v=Oh(a,s,!1),b=!1;continue}if(v===2){if(b=s,a.errorRecoveryDisabledLanes&b)var j=0;else j=a.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){s=j;e:{var U=a;v=ko;var Y=U.current.memoizedState.isDehydrated;if(Y&&(ll(U,j).flags|=256),j=Oh(U,j,!1),j!==2){if(kh&&!Y){U.errorRecoveryDisabledLanes|=b,sr|=b,v=4;break e}b=$n,$n=v,b!==null&&($n===null?$n=b:$n.push.apply($n,b))}v=j}if(b=!1,v!==2)continue}}if(v===1){ll(a,0),cs(a,s,0,!0);break}e:{switch(h=a,b=v,b){case 0:case 1:throw Error(i(345));case 4:if((s&4194048)!==s)break;case 6:cs(h,s,ra,!ss);break e;case 2:$n=null;break;case 3:case 5:break;default:throw Error(i(329))}if((s&62914560)===s&&(v=bu+300-xt(),10<v)){if(cs(h,s,ra,!ss),Ba(h,0,!0)!==0)break e;Ti=s,h.timeoutHandle=vx(H1.bind(null,h,c,$n,Su,Rh,s,ra,sr,sl,ss,b,"Throttled",-0,0),v);break e}H1(h,c,$n,Su,Rh,s,ra,sr,sl,ss,b,null,-0,0)}}break}while(!0);Ja(a)}function H1(a,s,c,h,v,b,j,U,Y,ne,fe,ge,ie,ce){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:mi},D1(s,b,ge);var Te=(b&62914560)===b?bu-xt():(b&4194048)===b?B1-xt():0;if(Te=LE(ge,Te),Te!==null){Ti=b,a.cancelPendingCommit=Te(Q1.bind(null,a,s,b,c,h,v,j,U,Y,fe,ge,null,ie,ce)),cs(a,b,j,!ne);return}}Q1(a,s,b,c,h,v,j,U,Y)}function XC(a){for(var s=a;;){var c=s.tag;if((c===0||c===11||c===15)&&s.flags&16384&&(c=s.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var v=c[h],b=v.getSnapshot;v=v.value;try{if(!ta(b(),v))return!1}catch(j){return!1}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;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 cs(a,s,c,h){s&=~Th,s&=~sr,a.suspendedLanes|=s,a.pingedLanes&=~s,h&&(a.warmLanes|=s),h=a.expirationTimes;for(var v=s;0<v;){var b=31-mt(v),j=1<<b;h[b]=-1,v&=~j}c!==0&&$s(a,c,s)}function wu(){return(_t&6)===0?(Ro(0),!1):!0}function Dh(){if(it!==null){if(jt===0)var a=it.return;else a=it,vi=Qs=null,Qf(a),Zr=null,fo=0,a=it;for(;a!==null;)x1(a.alternate,a),a=a.return;it=null}}function ll(a,s){var c=a.timeoutHandle;c!==-1&&(a.timeoutHandle=-1,pE(c)),c=a.cancelPendingCommit,c!==null&&(a.cancelPendingCommit=null,c()),Ti=0,Dh(),Dt=a,it=c=gi(a.current,null),lt=s,jt=0,sa=null,ss=!1,il=Ye(a,s),kh=!1,sl=ra=Th=sr=rs=Vt=0,$n=ko=null,Rh=!1,(s&8)!==0&&(s|=s&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=s;0<h;){var v=31-mt(h),b=1<<v;s|=a[v],h&=~b}return ki=s,qc(),c}function P1(a,s){et=null,P.H=bo,s===Qr||s===Jc?(s=sv(),jt=3):s===Bf?(s=sv(),jt=4):jt=s===fh?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,sa=s,it===null&&(Vt=1,fu(a,xa(s,a.current)))}function q1(){var a=aa.current;return a===null?!0:(lt&4194048)===lt?wa===null:(lt&62914560)===lt||(lt&536870912)!==0?a===wa:!1}function V1(){var a=P.H;return P.H=bo,a===null?bo:a}function G1(){var a=P.A;return P.A=KC,a}function Nu(){Vt=4,ss||(lt&4194048)!==lt&&aa.current!==null||(il=!0),(rs&134217727)===0&&(sr&134217727)===0||Dt===null||cs(Dt,lt,ra,!1)}function Oh(a,s,c){var h=_t;_t|=2;var v=V1(),b=G1();(Dt!==a||lt!==s)&&(Su=null,ll(a,s)),s=!1;var j=Vt;e:do try{if(jt!==0&&it!==null){var U=it,Y=sa;switch(jt){case 8:Dh(),j=6;break e;case 3:case 2:case 9:case 6:aa.current===null&&(s=!0);var ne=jt;if(jt=0,sa=null,ol(a,U,Y,ne),c&&il){j=0;break e}break;default:ne=jt,jt=0,sa=null,ol(a,U,Y,ne)}}QC(),j=Vt;break}catch(fe){P1(a,fe)}while(!0);return s&&a.shellSuspendCounter++,vi=Qs=null,_t=h,P.H=v,P.A=b,it===null&&(Dt=null,lt=0,qc()),j}function QC(){for(;it!==null;)K1(it)}function ZC(a,s){var c=_t;_t|=2;var h=V1(),v=G1();Dt!==a||lt!==s?(Su=null,_u=xt()+500,ll(a,s)):il=Ye(a,s);e:do try{if(jt!==0&&it!==null){s=it;var b=sa;t:switch(jt){case 1:jt=0,sa=null,ol(a,s,b,1);break;case 2:case 9:if(av(b)){jt=0,sa=null,Y1(s);break}s=function(){jt!==2&&jt!==9||Dt!==a||(jt=7),Ja(a)},b.then(s,s);break e;case 3:jt=7;break e;case 4:jt=5;break e;case 7:av(b)?(jt=0,sa=null,Y1(s)):(jt=0,sa=null,ol(a,s,b,7));break;case 5:var j=null;switch(it.tag){case 26:j=it.memoizedState;case 5:case 27:var U=it;if(j?Lx(j):U.stateNode.complete){jt=0,sa=null;var Y=U.sibling;if(Y!==null)it=Y;else{var ne=U.return;ne!==null?(it=ne,Cu(ne)):it=null}break t}}jt=0,sa=null,ol(a,s,b,5);break;case 6:jt=0,sa=null,ol(a,s,b,6);break;case 8:Dh(),Vt=6;break e;default:throw Error(i(462))}}JC();break}catch(fe){P1(a,fe)}while(!0);return vi=Qs=null,P.H=h,P.A=v,_t=c,it!==null?0:(Dt=null,lt=0,qc(),Vt)}function JC(){for(;it!==null&&!Ia();)K1(it)}function K1(a){var s=y1(a.alternate,a,ki);a.memoizedProps=a.pendingProps,s===null?Cu(a):it=s}function Y1(a){var s=a,c=s.alternate;switch(s.tag){case 15:case 0:s=d1(c,s,s.pendingProps,s.type,void 0,lt);break;case 11:s=d1(c,s,s.pendingProps,s.type.render,s.ref,lt);break;case 5:Qf(s);default:x1(c,s),s=it=Gy(s,ki),s=y1(c,s,ki)}a.memoizedProps=a.pendingProps,s===null?Cu(a):it=s}function ol(a,s,c,h){vi=Qs=null,Qf(s),Zr=null,fo=0;var v=s.return;try{if(FC(a,v,s,c,lt)){Vt=1,fu(a,xa(c,a.current)),it=null;return}}catch(b){if(v!==null)throw it=v,b;Vt=1,fu(a,xa(c,a.current)),it=null;return}s.flags&32768?(ut||h===1?a=!0:il||(lt&536870912)!==0?a=!1:(ss=a=!0,(h===2||h===9||h===3||h===6)&&(h=aa.current,h!==null&&h.tag===13&&(h.flags|=16384))),X1(s,a)):Cu(s)}function Cu(a){var s=a;do{if((s.flags&32768)!==0){X1(s,ss);return}a=s.return;var c=PC(s.alternate,s,ki);if(c!==null){it=c;return}if(s=s.sibling,s!==null){it=s;return}it=s=a}while(s!==null);Vt===0&&(Vt=5)}function X1(a,s){do{var c=qC(a.alternate,a);if(c!==null){c.flags&=32767,it=c;return}if(c=a.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!s&&(a=a.sibling,a!==null)){it=a;return}it=a=c}while(a!==null);Vt=6,it=null}function Q1(a,s,c,h,v,b,j,U,Y){a.cancelPendingCommit=null;do Eu();while(ln!==0);if((_t&6)!==0)throw Error(i(327));if(s!==null){if(s===a.current)throw Error(i(177));if(b=s.lanes|s.childLanes,b|=wf,Kl(a,c,b,j,U,Y),a===Dt&&(it=Dt=null,lt=0),rl=s,os=a,Ti=c,Mh=b,Ah=v,U1=h,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,nE(Re,function(){return tx(),null})):(a.callbackNode=null,a.callbackPriority=0),h=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||h){h=P.T,P.T=null,v=Q.p,Q.p=2,j=_t,_t|=4;try{VC(a,s,c)}finally{_t=j,Q.p=v,P.T=h}}ln=1,Z1(),J1(),W1()}}function Z1(){if(ln===1){ln=0;var a=os,s=rl,c=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||c){c=P.T,P.T=null;var h=Q.p;Q.p=2;var v=_t;_t|=4;try{M1(s,a);var b=Kh,j=zy(a.containerInfo),U=b.focusedElem,Y=b.selectionRange;if(j!==U&&U&&U.ownerDocument&&Iy(U.ownerDocument.documentElement,U)){if(Y!==null&&vf(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,ie=ge&&ge.defaultView||window;if(ie.getSelection){var ce=ie.getSelection(),Te=U.textContent.length,Ve=Math.min(Y.start,Te),Lt=Y.end===void 0?Ve:Math.min(Y.end,Te);!ce.extend&&Ve>Lt&&(j=Lt,Lt=Ve,Ve=j);var ee=Oy(U,Ve),J=Oy(U,Lt);if(ee&&J&&(ce.rangeCount!==1||ce.anchorNode!==ee.node||ce.anchorOffset!==ee.offset||ce.focusNode!==J.node||ce.focusOffset!==J.offset)){var te=ge.createRange();te.setStart(ee.node,ee.offset),ce.removeAllRanges(),Ve>Lt?(ce.addRange(te),ce.extend(J.node,J.offset)):(te.setEnd(J.node,J.offset),ce.addRange(te))}}}}for(ge=[],ce=U;ce=ce.parentNode;)ce.nodeType===1&&ge.push({element:ce,left:ce.scrollLeft,top:ce.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}}Bu=!!Gh,Kh=Gh=null}finally{_t=v,Q.p=h,P.T=c}}a.current=s,ln=2}}function J1(){if(ln===2){ln=0;var a=os,s=rl,c=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||c){c=P.T,P.T=null;var h=Q.p;Q.p=2;var v=_t;_t|=4;try{E1(a,s.alternate,s)}finally{_t=v,Q.p=h,P.T=c}}ln=3}}function W1(){if(ln===4||ln===3){ln=0,Ln();var a=os,s=rl,c=Ti,h=U1;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?ln=5:(ln=0,rl=os=null,ex(a,a.pendingLanes));var v=a.pendingLanes;if(v===0&&(ls=null),ci(c),s=s.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(wt,s,void 0,(s.current.flags&128)===128)}catch(Y){}if(h!==null){s=P.T,v=Q.p,Q.p=2,P.T=null;try{for(var b=a.onRecoverableError,j=0;j<h.length;j++){var U=h[j];b(U.value,{componentStack:U.stack})}}finally{P.T=s,Q.p=v}}(Ti&3)!==0&&Eu(),Ja(a),v=a.pendingLanes,(c&261930)!==0&&(v&42)!==0?a===Lh?To++:(To=0,Lh=a):To=0,Ro(0)}}function ex(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,co(s)))}function Eu(){return Z1(),J1(),W1(),tx()}function tx(){if(ln!==5)return!1;var a=os,s=Mh;Mh=0;var c=ci(Ti),h=P.T,v=Q.p;try{Q.p=32>c?32:c,P.T=null,c=Ah,Ah=null;var b=os,j=Ti;if(ln=0,rl=os=null,Ti=0,(_t&6)!==0)throw Error(i(331));var U=_t;if(_t|=4,I1(b.current),L1(b,b.current,j,c),_t=U,Ro(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(wt,b)}catch(Y){}return!0}finally{Q.p=v,P.T=h,ex(a,s)}}function nx(a,s,c){s=xa(c,s),s=dh(a.stateNode,s,2),a=ts(a,s,2),a!==null&&(pa(a,2),Ja(a))}function kt(a,s,c){if(a.tag===3)nx(a,a,c);else for(;s!==null;){if(s.tag===3){nx(s,a,c);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ls===null||!ls.has(h))){a=xa(c,a),c=a1(2),h=ts(s,c,2),h!==null&&(i1(c,h,s,a),pa(h,2),Ja(h));break}}s=s.return}}function Ih(a,s,c){var h=a.pingCache;if(h===null){h=a.pingCache=new YC;var v=new Set;h.set(s,v)}else v=h.get(s),v===void 0&&(v=new Set,h.set(s,v));v.has(c)||(kh=!0,v.add(c),a=WC.bind(null,a,s,c),s.then(a,a))}function WC(a,s,c){var h=a.pingCache;h!==null&&h.delete(s),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,Dt===a&&(lt&c)===c&&(Vt===4||Vt===3&&(lt&62914560)===lt&&300>xt()-bu?(_t&2)===0&&ll(a,0):Th|=c,sl===lt&&(sl=0)),Ja(a)}function ax(a,s){s===0&&(s=Qt()),a=Ks(a,s),a!==null&&(pa(a,s),Ja(a))}function eE(a){var s=a.memoizedState,c=0;s!==null&&(c=s.retryLane),ax(a,c)}function tE(a,s){var c=0;switch(a.tag){case 31:case 13:var h=a.stateNode,v=a.memoizedState;v!==null&&(c=v.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(s),ax(a,c)}function nE(a,s){return ha(a,s)}var ju=null,cl=null,zh=!1,ku=!1,Bh=!1,us=0;function Ja(a){a!==cl&&a.next===null&&(cl===null?ju=cl=a:cl=cl.next=a),ku=!0,zh||(zh=!0,iE())}function Ro(a,s){if(!Bh&&ku){Bh=!0;do for(var c=!1,h=ju;h!==null;){if(a!==0){var v=h.pendingLanes;if(v===0)var b=0;else{var j=h.suspendedLanes,U=h.pingedLanes;b=(1<<31-mt(42|a)+1)-1,b&=v&~(j&~U),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(c=!0,lx(h,b))}else b=lt,b=Ba(h,h===Dt?b:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(b&3)===0||Ye(h,b)||(c=!0,lx(h,b));h=h.next}while(c);Bh=!1}}function aE(){ix()}function ix(){ku=zh=!1;var a=0;us!==0&&mE()&&(a=us);for(var s=xt(),c=null,h=ju;h!==null;){var v=h.next,b=sx(h,s);b===0?(h.next=null,c===null?ju=v:c.next=v,v===null&&(cl=c)):(c=h,(a!==0||(b&3)!==0)&&(ku=!0)),h=v}ln!==0&&ln!==5||Ro(a),us!==0&&(us=0)}function sx(a,s){for(var c=a.suspendedLanes,h=a.pingedLanes,v=a.expirationTimes,b=a.pendingLanes&-62914561;0<b;){var j=31-mt(b),U=1<<j,Y=v[j];Y===-1?((U&c)===0||(U&h)!==0)&&(v[j]=ma(U,s)):Y<=s&&(a.expiredLanes|=U),b&=~U}if(s=Dt,c=lt,c=Ba(a,a===s?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h=a.callbackNode,c===0||a===s&&(jt===2||jt===9)||a.cancelPendingCommit!==null)return h!==null&&h!==null&&Jn(h),a.callbackNode=null,a.callbackPriority=0;if((c&3)===0||Ye(a,c)){if(s=c&-c,s===a.callbackPriority)return s;switch(h!==null&&Jn(h),ci(c)){case 2:case 8:c=ve;break;case 32:c=Re;break;case 268435456:c=Me;break;default:c=Re}return h=rx.bind(null,a),c=ha(c,h),a.callbackPriority=s,a.callbackNode=c,s}return h!==null&&h!==null&&Jn(h),a.callbackPriority=2,a.callbackNode=null,2}function rx(a,s){if(ln!==0&&ln!==5)return a.callbackNode=null,a.callbackPriority=0,null;var c=a.callbackNode;if(Eu()&&a.callbackNode!==c)return null;var h=lt;return h=Ba(a,a===Dt?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h===0?null:($1(a,h,s),sx(a,xt()),a.callbackNode!=null&&a.callbackNode===c?rx.bind(null,a):null)}function lx(a,s){if(Eu())return null;$1(a,s,!0)}function iE(){gE(function(){(_t&6)!==0?ha(de,aE):ix()})}function Uh(){if(us===0){var a=Yr;a===0&&(a=Pi,Pi<<=1,(Pi&261888)===0&&(Pi=256)),us=a}return us}function ox(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Ic(""+a)}function cx(a,s){var c=s.ownerDocument.createElement("input");return c.name=s.name,c.value=s.value,a.id&&c.setAttribute("form",a.id),s.parentNode.insertBefore(c,s),a=new FormData(a),c.parentNode.removeChild(c),a}function sE(a,s,c,h,v){if(s==="submit"&&c&&c.stateNode===v){var b=ox((v[Ee]||null).action),j=h.submitter;j&&(s=(s=j[Ee]||null)?ox(s.formAction):j.getAttribute("formAction"),s!==null&&(b=s,j=null));var U=new Fc("action","action",null,h,v);a.push({event:U,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(us!==0){var Y=j?cx(v,j):new FormData(v);sh(c,{pending:!0,data:Y,method:v.method,action:b},null,Y)}}else typeof b=="function"&&(U.preventDefault(),Y=j?cx(v,j):new FormData(v),sh(c,{pending:!0,data:Y,method:v.method,action:b},b,Y))},currentTarget:v}]})}}for(var Fh=0;Fh<Sf.length;Fh++){var $h=Sf[Fh],rE=$h.toLowerCase(),lE=$h[0].toUpperCase()+$h.slice(1);Fa(rE,"on"+lE)}Fa(Fy,"onAnimationEnd"),Fa($y,"onAnimationIteration"),Fa(Hy,"onAnimationStart"),Fa("dblclick","onDoubleClick"),Fa("focusin","onFocus"),Fa("focusout","onBlur"),Fa(wC,"onTransitionRun"),Fa(NC,"onTransitionStart"),Fa(CC,"onTransitionCancel"),Fa(Py,"onTransitionEnd"),di("onMouseEnter",["mouseout","mouseover"]),di("onMouseLeave",["mouseout","mouseover"]),di("onPointerEnter",["pointerout","pointerover"]),di("onPointerLeave",["pointerout","pointerover"]),ui("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ui("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ui("onBeforeInput",["compositionend","keypress","textInput","paste"]),ui("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ui("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ui("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mo="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(" "),oE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mo));function ux(a,s){s=(s&4)!==0;for(var c=0;c<a.length;c++){var h=a[c],v=h.event;h=h.listeners;e:{var b=void 0;if(s)for(var j=h.length-1;0<=j;j--){var U=h[j],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){Pc(fe)}v.currentTarget=null,b=Y}else for(j=0;j<h.length;j++){if(U=h[j],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){Pc(fe)}v.currentTarget=null,b=Y}}}}function st(a,s){var c=s[He];c===void 0&&(c=s[He]=new Set);var h=a+"__bubble";c.has(h)||(dx(s,a,2,!1),c.add(h))}function Hh(a,s,c){var h=0;s&&(h|=4),dx(c,a,h,s)}var Tu="_reactListening"+Math.random().toString(36).slice(2);function Ph(a){if(!a[Tu]){a[Tu]=!0,Ya.forEach(function(c){c!=="selectionchange"&&(oE.has(c)||Hh(c,!1,a),Hh(c,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[Tu]||(s[Tu]=!0,Hh("selectionchange",!1,s))}}function dx(a,s,c,h){switch(Fx(s)){case 2:var v=IE;break;case 8:v=zE;break;default:v=im}c=v.bind(null,s,c,a),v=void 0,!cf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(v=!0),h?v!==void 0?a.addEventListener(s,c,{capture:!0,passive:v}):a.addEventListener(s,c,!0):v!==void 0?a.addEventListener(s,c,{passive:v}):a.addEventListener(s,c,!1)}function qh(a,s,c,h,v){var b=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var j=h.tag;if(j===3||j===4){var U=h.stateNode.containerInfo;if(U===v)break;if(j===4)for(j=h.return;j!==null;){var Y=j.tag;if((Y===3||Y===4)&&j.stateNode.containerInfo===v)return;j=j.return}for(;U!==null;){if(j=Ua(U),j===null)return;if(Y=j.tag,Y===5||Y===6||Y===26||Y===27){h=b=j;continue e}U=U.parentNode}}h=h.return}gy(function(){var ne=b,fe=lf(c),ge=[];e:{var ie=qy.get(a);if(ie!==void 0){var ce=Fc,Te=a;switch(a){case"keypress":if(Bc(c)===0)break e;case"keydown":case"keyup":ce=tC;break;case"focusin":Te="focus",ce=hf;break;case"focusout":Te="blur",ce=hf;break;case"beforeblur":case"afterblur":ce=hf;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=xy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=PN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=iC;break;case Fy:case $y:case Hy:ce=GN;break;case Py:ce=rC;break;case"scroll":case"scrollend":ce=$N;break;case"wheel":ce=oC;break;case"copy":case"cut":case"paste":ce=YN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=_y;break;case"toggle":case"beforetoggle":ce=uC}var Ve=(s&4)!==0,Lt=!Ve&&(a==="scroll"||a==="scrollend"),ee=Ve?ie!==null?ie+"Capture":null:ie;Ve=[];for(var J=ne,te;J!==null;){var me=J;if(te=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||te===null||ee===null||(me=Jl(J,ee),me!=null&&Ve.push(Ao(J,me,te))),Lt)break;J=J.return}0<Ve.length&&(ie=new ce(ie,Te,null,c,fe),ge.push({event:ie,listeners:Ve}))}}if((s&7)===0){e:{if(ie=a==="mouseover"||a==="pointerover",ce=a==="mouseout"||a==="pointerout",ie&&c!==rf&&(Te=c.relatedTarget||c.fromElement)&&(Ua(Te)||Te[Le]))break e;if((ce||ie)&&(ie=fe.window===fe?fe:(ie=fe.ownerDocument)?ie.defaultView||ie.parentWindow:window,ce?(Te=c.relatedTarget||c.toElement,ce=ne,Te=Te?Ua(Te):null,Te!==null&&(Lt=l(Te),Ve=Te.tag,Te!==Lt||Ve!==5&&Ve!==27&&Ve!==6)&&(Te=null)):(ce=null,Te=ne),ce!==Te)){if(Ve=xy,me="onMouseLeave",ee="onMouseEnter",J="mouse",(a==="pointerout"||a==="pointerover")&&(Ve=_y,me="onPointerLeave",ee="onPointerEnter",J="pointer"),Lt=ce==null?ie:Ps(ce),te=Te==null?ie:Ps(Te),ie=new Ve(me,J+"leave",ce,c,fe),ie.target=Lt,ie.relatedTarget=te,me=null,Ua(fe)===ne&&(Ve=new Ve(ee,J+"enter",Te,c,fe),Ve.target=te,Ve.relatedTarget=Lt,me=Ve),Lt=me,ce&&Te)t:{for(Ve=cE,ee=ce,J=Te,te=0,me=ee;me;me=Ve(me))te++;me=0;for(var Ue=J;Ue;Ue=Ve(Ue))me++;for(;0<te-me;)ee=Ve(ee),te--;for(;0<me-te;)J=Ve(J),me--;for(;te--;){if(ee===J||J!==null&&ee===J.alternate){Ve=ee;break t}ee=Ve(ee),J=Ve(J)}Ve=null}else Ve=null;ce!==null&&fx(ge,ie,ce,Ve,!1),Te!==null&&Lt!==null&&fx(ge,Lt,Te,Ve,!0)}}e:{if(ie=ne?Ps(ne):window,ce=ie.nodeName&&ie.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ie.type==="file")var yt=Ty;else if(jy(ie))if(Ry)yt=bC;else{yt=vC;var Ae=yC}else ce=ie.nodeName,!ce||ce.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ne&&sf(ne.elementType)&&(yt=Ty):yt=xC;if(yt&&(yt=yt(a,ne))){ky(ge,yt,c,fe);break e}Ae&&Ae(a,ie,ne),a==="focusout"&&ne&&ie.type==="number"&&ne.memoizedProps.value!=null&&Sn(ie,"number",ie.value)}switch(Ae=ne?Ps(ne):window,a){case"focusin":(jy(Ae)||Ae.contentEditable==="true")&&(Fr=Ae,xf=ne,ro=null);break;case"focusout":ro=xf=Fr=null;break;case"mousedown":bf=!0;break;case"contextmenu":case"mouseup":case"dragend":bf=!1,By(ge,c,fe);break;case"selectionchange":if(SC)break;case"keydown":case"keyup":By(ge,c,fe)}var tt;if(pf)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 Ur?Cy(a,c)&&(ot="onCompositionEnd"):a==="keydown"&&c.keyCode===229&&(ot="onCompositionStart");ot&&(Sy&&c.locale!=="ko"&&(Ur||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&Ur&&(tt=yy()):(Yi=fe,uf="value"in Yi?Yi.value:Yi.textContent,Ur=!0)),Ae=Ru(ne,ot),0<Ae.length&&(ot=new by(ot,a,null,c,fe),ge.push({event:ot,listeners:Ae}),tt?ot.data=tt:(tt=Ey(c),tt!==null&&(ot.data=tt)))),(tt=fC?hC(a,c):mC(a,c))&&(ot=Ru(ne,"onBeforeInput"),0<ot.length&&(Ae=new by("onBeforeInput","beforeinput",null,c,fe),ge.push({event:Ae,listeners:ot}),Ae.data=tt)),sE(ge,a,ne,c,fe)}ux(ge,s)})}function Ao(a,s,c){return{instance:a,listener:s,currentTarget:c}}function Ru(a,s){for(var c=s+"Capture",h=[];a!==null;){var v=a,b=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||b===null||(v=Jl(a,c),v!=null&&h.unshift(Ao(a,v,b)),v=Jl(a,s),v!=null&&h.push(Ao(a,v,b))),a.tag===3)return h;a=a.return}return[]}function cE(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function fx(a,s,c,h,v){for(var b=s._reactName,j=[];c!==null&&c!==h;){var U=c,Y=U.alternate,ne=U.stateNode;if(U=U.tag,Y!==null&&Y===h)break;U!==5&&U!==26&&U!==27||ne===null||(Y=ne,v?(ne=Jl(c,b),ne!=null&&j.unshift(Ao(c,ne,Y))):v||(ne=Jl(c,b),ne!=null&&j.push(Ao(c,ne,Y)))),c=c.return}j.length!==0&&a.push({event:s,listeners:j})}var uE=/\r\n?/g,dE=/\u0000|\uFFFD/g;function hx(a){return(typeof a=="string"?a:""+a).replace(uE,`
|
|
33
|
+
`).replace(dE,"")}function mx(a,s){return s=hx(s),hx(a)===s}function At(a,s,c,h,v,b){switch(c){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||fi(a,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&fi(a,""+h);break;case"className":Ir(a,"class",h);break;case"tabIndex":Ir(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Ir(a,c,h);break;case"style":hi(a,h,b);break;case"data":if(s!=="object"){Ir(a,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||c!=="href")){a.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(c);break}h=Ic(""+h),a.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){a.setAttribute(c,"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"&&(c==="formAction"?(s!=="input"&&At(a,s,"name",v.name,v,null),At(a,s,"formEncType",v.formEncType,v,null),At(a,s,"formMethod",v.formMethod,v,null),At(a,s,"formTarget",v.formTarget,v,null)):(At(a,s,"encType",v.encType,v,null),At(a,s,"method",v.method,v,null),At(a,s,"target",v.target,v,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(c);break}h=Ic(""+h),a.setAttribute(c,h);break;case"onClick":h!=null&&(a.onclick=mi);break;case"onScroll":h!=null&&st("scroll",a);break;case"onScrollEnd":h!=null&&st("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(c=h.__html,c!=null){if(v.children!=null)throw Error(i(60));a.innerHTML=c}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}c=Ic(""+h),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,""+h):a.removeAttribute(c);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":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,""):a.removeAttribute(c);break;case"capture":case"download":h===!0?a.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,h):a.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(c,h):a.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(c):a.setAttribute(c,h);break;case"popover":st("beforetoggle",a),st("toggle",a),Or(a,"popover",h);break;case"xlinkActuate":fn(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":fn(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":fn(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":fn(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":fn(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":fn(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":fn(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":fn(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":fn(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Or(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=UN.get(c)||c,Or(a,c,h))}}function Vh(a,s,c,h,v,b){switch(c){case"style":hi(a,h,b);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(c=h.__html,c!=null){if(v.children!=null)throw Error(i(60));a.innerHTML=c}}break;case"children":typeof h=="string"?fi(a,h):(typeof h=="number"||typeof h=="bigint")&&fi(a,""+h);break;case"onScroll":h!=null&&st("scroll",a);break;case"onScrollEnd":h!=null&&st("scrollend",a);break;case"onClick":h!=null&&(a.onclick=mi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Lc.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(v=c.endsWith("Capture"),s=c.slice(2,v?c.length-7:void 0),b=a[Ee]||null,b=b!=null?b[c]:null,typeof b=="function"&&a.removeEventListener(s,b,v),typeof h=="function")){typeof b!="function"&&b!==null&&(c in a?a[c]=null:a.hasAttribute(c)&&a.removeAttribute(c)),a.addEventListener(s,h,v);break e}c in a?a[c]=h:h===!0?a.setAttribute(c,""):Or(a,c,h)}}}function bn(a,s,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":st("error",a),st("load",a);var h=!1,v=!1,b;for(b in c)if(c.hasOwnProperty(b)){var j=c[b];if(j!=null)switch(b){case"src":h=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:At(a,s,b,j,c,null)}}v&&At(a,s,"srcSet",c.srcSet,c,null),h&&At(a,s,"src",c.src,c,null);return;case"input":st("invalid",a);var U=b=j=v=null,Y=null,ne=null;for(h in c)if(c.hasOwnProperty(h)){var fe=c[h];if(fe!=null)switch(h){case"name":v=fe;break;case"type":j=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:At(a,s,h,fe,c,null)}}rn(a,b,U,Y,ne,j,v,!1);return;case"select":st("invalid",a),h=j=b=null;for(v in c)if(c.hasOwnProperty(v)&&(U=c[v],U!=null))switch(v){case"value":b=U;break;case"defaultValue":j=U;break;case"multiple":h=U;default:At(a,s,v,U,c,null)}s=b,c=j,a.multiple=!!h,s!=null?ea(a,!!h,s,!1):c!=null&&ea(a,!!h,c,!0);return;case"textarea":st("invalid",a),b=v=h=null;for(j in c)if(c.hasOwnProperty(j)&&(U=c[j],U!=null))switch(j){case"value":h=U;break;case"defaultValue":v=U;break;case"children":b=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(91));break;default:At(a,s,j,U,c,null)}Zl(a,h,v,b);return;case"option":for(Y in c)if(c.hasOwnProperty(Y)&&(h=c[Y],h!=null))switch(Y){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:At(a,s,Y,h,c,null)}return;case"dialog":st("beforetoggle",a),st("toggle",a),st("cancel",a),st("close",a);break;case"iframe":case"object":st("load",a);break;case"video":case"audio":for(h=0;h<Mo.length;h++)st(Mo[h],a);break;case"image":st("error",a),st("load",a);break;case"details":st("toggle",a);break;case"embed":case"source":case"link":st("error",a),st("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 c)if(c.hasOwnProperty(ne)&&(h=c[ne],h!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:At(a,s,ne,h,c,null)}return;default:if(sf(s)){for(fe in c)c.hasOwnProperty(fe)&&(h=c[fe],h!==void 0&&Vh(a,s,fe,h,c,void 0));return}}for(U in c)c.hasOwnProperty(U)&&(h=c[U],h!=null&&At(a,s,U,h,c,null))}function fE(a,s,c,h){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,j=null,U=null,Y=null,ne=null,fe=null;for(ce in c){var ge=c[ce];if(c.hasOwnProperty(ce)&&ge!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":Y=ge;default:h.hasOwnProperty(ce)||At(a,s,ce,null,h,ge)}}for(var ie in h){var ce=h[ie];if(ge=c[ie],h.hasOwnProperty(ie)&&(ce!=null||ge!=null))switch(ie){case"type":b=ce;break;case"name":v=ce;break;case"checked":ne=ce;break;case"defaultChecked":fe=ce;break;case"value":j=ce;break;case"defaultValue":U=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(i(137,s));break;default:ce!==ge&&At(a,s,ie,ce,h,ge)}}ft(a,j,U,Y,ne,fe,b,v);return;case"select":ce=j=U=ie=null;for(b in c)if(Y=c[b],c.hasOwnProperty(b)&&Y!=null)switch(b){case"value":break;case"multiple":ce=Y;default:h.hasOwnProperty(b)||At(a,s,b,null,h,Y)}for(v in h)if(b=h[v],Y=c[v],h.hasOwnProperty(v)&&(b!=null||Y!=null))switch(v){case"value":ie=b;break;case"defaultValue":U=b;break;case"multiple":j=b;default:b!==Y&&At(a,s,v,b,h,Y)}s=U,c=j,h=ce,ie!=null?ea(a,!!c,ie,!1):!!h!=!!c&&(s!=null?ea(a,!!c,s,!0):ea(a,!!c,c?[]:"",!1));return;case"textarea":ce=ie=null;for(U in c)if(v=c[U],c.hasOwnProperty(U)&&v!=null&&!h.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:At(a,s,U,null,h,v)}for(j in h)if(v=h[j],b=c[j],h.hasOwnProperty(j)&&(v!=null||b!=null))switch(j){case"value":ie=v;break;case"defaultValue":ce=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(i(91));break;default:v!==b&&At(a,s,j,v,h,b)}Ql(a,ie,ce);return;case"option":for(var Te in c)if(ie=c[Te],c.hasOwnProperty(Te)&&ie!=null&&!h.hasOwnProperty(Te))switch(Te){case"selected":a.selected=!1;break;default:At(a,s,Te,null,h,ie)}for(Y in h)if(ie=h[Y],ce=c[Y],h.hasOwnProperty(Y)&&ie!==ce&&(ie!=null||ce!=null))switch(Y){case"selected":a.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:At(a,s,Y,ie,h,ce)}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 c)ie=c[Ve],c.hasOwnProperty(Ve)&&ie!=null&&!h.hasOwnProperty(Ve)&&At(a,s,Ve,null,h,ie);for(ne in h)if(ie=h[ne],ce=c[ne],h.hasOwnProperty(ne)&&ie!==ce&&(ie!=null||ce!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,s));break;default:At(a,s,ne,ie,h,ce)}return;default:if(sf(s)){for(var Lt in c)ie=c[Lt],c.hasOwnProperty(Lt)&&ie!==void 0&&!h.hasOwnProperty(Lt)&&Vh(a,s,Lt,void 0,h,ie);for(fe in h)ie=h[fe],ce=c[fe],!h.hasOwnProperty(fe)||ie===ce||ie===void 0&&ce===void 0||Vh(a,s,fe,ie,h,ce);return}}for(var ee in c)ie=c[ee],c.hasOwnProperty(ee)&&ie!=null&&!h.hasOwnProperty(ee)&&At(a,s,ee,null,h,ie);for(ge in h)ie=h[ge],ce=c[ge],!h.hasOwnProperty(ge)||ie===ce||ie==null&&ce==null||At(a,s,ge,ie,h,ce)}function px(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hE(){if(typeof performance.getEntriesByType=="function"){for(var a=0,s=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var v=c[h],b=v.transferSize,j=v.initiatorType,U=v.duration;if(b&&U&&px(j)){for(j=0,U=v.responseEnd,h+=1;h<c.length;h++){var Y=c[h],ne=Y.startTime;if(ne>U)break;var fe=Y.transferSize,ge=Y.initiatorType;fe&&px(ge)&&(Y=Y.responseEnd,j+=fe*(Y<U?1:(U-ne)/(Y-ne)))}if(--h,s+=8*(b+j)/(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 Gh=null,Kh=null;function Mu(a){return a.nodeType===9?a:a.ownerDocument}function gx(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 yx(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 Yh(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 Xh=null;function mE(){var a=window.event;return a&&a.type==="popstate"?a===Xh?!1:(Xh=a,!0):(Xh=null,!1)}var vx=typeof setTimeout=="function"?setTimeout:void 0,pE=typeof clearTimeout=="function"?clearTimeout:void 0,xx=typeof Promise=="function"?Promise:void 0,gE=typeof queueMicrotask=="function"?queueMicrotask:typeof xx!="undefined"?function(a){return xx.resolve(null).then(a).catch(yE)}:vx;function yE(a){setTimeout(function(){throw a})}function ds(a){return a==="head"}function bx(a,s){var c=s,h=0;do{var v=c.nextSibling;if(a.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"||c==="/&"){if(h===0){a.removeChild(v),hl(s);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")Lo(a.ownerDocument.documentElement);else if(c==="head"){c=a.ownerDocument.head,Lo(c);for(var b=c.firstChild;b;){var j=b.nextSibling,U=b.nodeName;b[Zt]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&b.rel.toLowerCase()==="stylesheet"||c.removeChild(b),b=j}}else c==="body"&&Lo(a.ownerDocument.body);c=v}while(c);hl(s)}function _x(a,s){var c=a;a=0;do{var h=c.nextSibling;if(c.nodeType===1?s?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(s?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(a===0)break;a--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||a++;c=h}while(c)}function Qh(a){var s=a.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var c=s;switch(s=s.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Qh(c),On(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}a.removeChild(c)}}function vE(a,s,c,h){for(;a.nodeType===1;){var v=c;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[Zt])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=Na(a.nextSibling),a===null)break}return null}function xE(a,s,c){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=Na(a.nextSibling),a===null))return null;return a}function Sx(a,s){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!s||(a=Na(a.nextSibling),a===null))return null;return a}function Zh(a){return a.data==="$?"||a.data==="$~"}function Jh(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function bE(a,s){var c=a.ownerDocument;if(a.data==="$~")a._reactRetry=s;else if(a.data!=="$?"||c.readyState!=="loading")s();else{var h=function(){s(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),a._reactRetry=h}}function Na(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 Wh=null;function wx(a){a=a.nextSibling;for(var s=0;a;){if(a.nodeType===8){var c=a.data;if(c==="/$"||c==="/&"){if(s===0)return Na(a.nextSibling);s--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||s++}a=a.nextSibling}return null}function Nx(a){a=a.previousSibling;for(var s=0;a;){if(a.nodeType===8){var c=a.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(s===0)return a;s--}else c!=="/$"&&c!=="/&"||s++}a=a.previousSibling}return null}function Cx(a,s,c){switch(s=Mu(c),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 Lo(a){for(var s=a.attributes;s.length;)a.removeAttributeNode(s[0]);On(a)}var Ca=new Map,Ex=new Set;function Au(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Ri=Q.d;Q.d={f:_E,r:SE,D:wE,C:NE,L:CE,m:EE,X:kE,S:jE,M:TE};function _E(){var a=Ri.f(),s=wu();return a||s}function SE(a){var s=Gi(a);s!==null&&s.tag===5&&s.type==="form"?Pv(s):Ri.r(a)}var ul=typeof document=="undefined"?null:document;function jx(a,s,c){var h=ul;if(h&&typeof s=="string"&&s){var v=Xe(s);v='link[rel="'+a+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),Ex.has(v)||(Ex.add(v),a={rel:a,crossOrigin:c,href:s},h.querySelector(v)===null&&(s=h.createElement("link"),bn(s,"link",a),Jt(s),h.head.appendChild(s)))}}function wE(a){Ri.D(a),jx("dns-prefetch",a,null)}function NE(a,s){Ri.C(a,s),jx("preconnect",a,s)}function CE(a,s,c){Ri.L(a,s,c);var h=ul;if(h&&a&&s){var v='link[rel="preload"][as="'+Xe(s)+'"]';s==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+Xe(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+Xe(c.imageSizes)+'"]')):v+='[href="'+Xe(a)+'"]';var b=v;switch(s){case"style":b=dl(a);break;case"script":b=fl(a)}Ca.has(b)||(a=p({rel:"preload",href:s==="image"&&c&&c.imageSrcSet?void 0:a,as:s},c),Ca.set(b,a),h.querySelector(v)!==null||s==="style"&&h.querySelector(Do(b))||s==="script"&&h.querySelector(Oo(b))||(s=h.createElement("link"),bn(s,"link",a),Jt(s),h.head.appendChild(s)))}}function EE(a,s){Ri.m(a,s);var c=ul;if(c&&a){var h=s&&typeof s.as=="string"?s.as:"script",v='link[rel="modulepreload"][as="'+Xe(h)+'"][href="'+Xe(a)+'"]',b=v;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=fl(a)}if(!Ca.has(b)&&(a=p({rel:"modulepreload",href:a},s),Ca.set(b,a),c.querySelector(v)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Oo(b)))return}h=c.createElement("link"),bn(h,"link",a),Jt(h),c.head.appendChild(h)}}}function jE(a,s,c){Ri.S(a,s,c);var h=ul;if(h&&a){var v=Ki(h).hoistableStyles,b=dl(a);s=s||"default";var j=v.get(b);if(!j){var U={loading:0,preload:null};if(j=h.querySelector(Do(b)))U.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":s},c),(c=Ca.get(b))&&em(a,c);var Y=j=h.createElement("link");Jt(Y),bn(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,Lu(j,s,h)}j={type:"stylesheet",instance:j,count:1,state:U},v.set(b,j)}}}function kE(a,s){Ri.X(a,s);var c=ul;if(c&&a){var h=Ki(c).hoistableScripts,v=fl(a),b=h.get(v);b||(b=c.querySelector(Oo(v)),b||(a=p({src:a,async:!0},s),(s=Ca.get(v))&&tm(a,s),b=c.createElement("script"),Jt(b),bn(b,"link",a),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(v,b))}}function TE(a,s){Ri.M(a,s);var c=ul;if(c&&a){var h=Ki(c).hoistableScripts,v=fl(a),b=h.get(v);b||(b=c.querySelector(Oo(v)),b||(a=p({src:a,async:!0,type:"module"},s),(s=Ca.get(v))&&tm(a,s),b=c.createElement("script"),Jt(b),bn(b,"link",a),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(v,b))}}function kx(a,s,c,h){var v=(v=xe.current)?Au(v):null;if(!v)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(s=dl(c.href),c=Ki(v).hoistableStyles,h=c.get(s),h||(h={type:"style",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){a=dl(c.href);var b=Ki(v).hoistableStyles,j=b.get(a);if(j||(v=v.ownerDocument||v,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(a,j),(b=v.querySelector(Do(a)))&&!b._p&&(j.instance=b,j.state.loading=5),Ca.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Ca.set(a,c),b||RE(v,a,c,j.state))),s&&h===null)throw Error(i(528,""));return j}if(s&&h!==null)throw Error(i(529,""));return null;case"script":return s=c.async,c=c.src,typeof c=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=fl(c),c=Ki(v).hoistableScripts,h=c.get(s),h||(h={type:"script",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function dl(a){return'href="'+Xe(a)+'"'}function Do(a){return'link[rel="stylesheet"]['+a+"]"}function Tx(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function RE(a,s,c,h){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=a.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),bn(s,"link",c),Jt(s),a.head.appendChild(s))}function fl(a){return'[src="'+Xe(a)+'"]'}function Oo(a){return"script[async]"+a}function Rx(a,s,c){if(s.count++,s.instance===null)switch(s.type){case"style":var h=a.querySelector('style[data-href~="'+Xe(c.href)+'"]');if(h)return s.instance=h,Jt(h),h;var v=p({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),Jt(h),bn(h,"style",v),Lu(h,c.precedence,a),s.instance=h;case"stylesheet":v=dl(c.href);var b=a.querySelector(Do(v));if(b)return s.state.loading|=4,s.instance=b,Jt(b),b;h=Tx(c),(v=Ca.get(v))&&em(h,v),b=(a.ownerDocument||a).createElement("link"),Jt(b);var j=b;return j._p=new Promise(function(U,Y){j.onload=U,j.onerror=Y}),bn(b,"link",h),s.state.loading|=4,Lu(b,c.precedence,a),s.instance=b;case"script":return b=fl(c.src),(v=a.querySelector(Oo(b)))?(s.instance=v,Jt(v),v):(h=c,(v=Ca.get(b))&&(h=p({},c),tm(h,v)),a=a.ownerDocument||a,v=a.createElement("script"),Jt(v),bn(v,"link",h),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&&(h=s.instance,s.state.loading|=4,Lu(h,c.precedence,a));return s.instance}function Lu(a,s,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=h.length?h[h.length-1]:null,b=v,j=0;j<h.length;j++){var U=h[j];if(U.dataset.precedence===s)b=U;else if(b!==v)break}b?b.parentNode.insertBefore(a,b.nextSibling):(s=c.nodeType===9?c.head:c,s.insertBefore(a,s.firstChild))}function em(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function tm(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var Du=null;function Mx(a,s,c){if(Du===null){var h=new Map,v=Du=new Map;v.set(c,h)}else v=Du,h=v.get(c),h||(h=new Map,v.set(c,h));if(h.has(a))return h;for(h.set(a,null),c=c.getElementsByTagName(a),v=0;v<c.length;v++){var b=c[v];if(!(b[Zt]||b[le]||a==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var j=b.getAttribute(s)||"";j=a+j;var U=h.get(j);U?U.push(b):h.set(j,[b])}}return h}function Ax(a,s,c){a=a.ownerDocument||a,a.head.insertBefore(c,s==="title"?a.querySelector("head > title"):null)}function ME(a,s,c){if(c===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 Lx(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function AE(a,s,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var v=dl(h.href),b=s.querySelector(Do(v));if(b){s=b._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(a.count++,a=Ou.bind(a),s.then(a,a)),c.state.loading|=4,c.instance=b,Jt(b);return}b=s.ownerDocument||s,h=Tx(h),(v=Ca.get(v))&&em(h,v),b=b.createElement("link"),Jt(b);var j=b;j._p=new Promise(function(U,Y){j.onload=U,j.onerror=Y}),bn(b,"link",h),c.instance=b}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(c,s),(s=c.state.preload)&&(c.state.loading&3)===0&&(a.count++,c=Ou.bind(a),s.addEventListener("load",c),s.addEventListener("error",c))}}var nm=0;function LE(a,s){return a.stylesheets&&a.count===0&&zu(a,a.stylesheets),0<a.count||0<a.imgCount?function(c){var h=setTimeout(function(){if(a.stylesheets&&zu(a,a.stylesheets),a.unsuspend){var b=a.unsuspend;a.unsuspend=null,b()}},6e4+s);0<a.imgBytes&&nm===0&&(nm=62500*hE());var v=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&zu(a,a.stylesheets),a.unsuspend)){var b=a.unsuspend;a.unsuspend=null,b()}},(a.imgBytes>nm?50:800)+s);return a.unsuspend=c,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(v)}}:null}function Ou(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zu(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Iu=null;function zu(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Iu=new Map,s.forEach(DE,a),Iu=null,Ou.call(a))}function DE(a,s){if(!(s.state.loading&4)){var c=Iu.get(a);if(c)var h=c.get(null);else{c=new Map,Iu.set(a,c);for(var v=a.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<v.length;b++){var j=v[b];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(c.set(j.dataset.precedence,j),h=j)}h&&c.set(null,h)}v=s.instance,j=v.getAttribute("data-precedence"),b=c.get(j)||h,b===h&&c.set(null,v),c.set(j,v),this.count++,h=Ou.bind(this),v.addEventListener("load",h),v.addEventListener("error",h),b?b.parentNode.insertBefore(v,b.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(v,a.firstChild)),s.state.loading|=4}}var Io={$$typeof:C,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function OE(a,s,c,h,v,b,j,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=_n(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_n(0),this.hiddenUpdates=_n(null),this.identifierPrefix=h,this.onUncaughtError=v,this.onCaughtError=b,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function Dx(a,s,c,h,v,b,j,U,Y,ne,fe,ge){return a=new OE(a,s,c,j,Y,ne,fe,ge,U),s=1,b===!0&&(s|=24),b=na(3,null,null,s),a.current=b,b.stateNode=a,s=Of(),s.refCount++,a.pooledCache=s,s.refCount++,b.memoizedState={element:h,isDehydrated:c,cache:s},Uf(b),a}function Ox(a){return a?(a=Pr,a):Pr}function Ix(a,s,c,h,v,b){v=Ox(v),h.context===null?h.context=v:h.pendingContext=v,h=es(s),h.payload={element:c},b=b===void 0?null:b,b!==null&&(h.callback=b),c=ts(a,h,s),c!==null&&(Hn(c,a,s),mo(c,a,s))}function zx(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c<s?c:s}}function am(a,s){zx(a,s),(a=a.alternate)&&zx(a,s)}function Bx(a){if(a.tag===13||a.tag===31){var s=Ks(a,67108864);s!==null&&Hn(s,a,67108864),am(a,67108864)}}function Ux(a){if(a.tag===13||a.tag===31){var s=la();s=Vi(s);var c=Ks(a,s);c!==null&&Hn(c,a,s),am(a,s)}}var Bu=!0;function IE(a,s,c,h){var v=P.T;P.T=null;var b=Q.p;try{Q.p=2,im(a,s,c,h)}finally{Q.p=b,P.T=v}}function zE(a,s,c,h){var v=P.T;P.T=null;var b=Q.p;try{Q.p=8,im(a,s,c,h)}finally{Q.p=b,P.T=v}}function im(a,s,c,h){if(Bu){var v=sm(h);if(v===null)qh(a,s,h,Uu,c),$x(a,h);else if(UE(v,a,s,c,h))h.stopPropagation();else if($x(a,h),s&4&&-1<BE.indexOf(a)){for(;v!==null;){var b=Gi(v);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var j=dn(b.pendingLanes);if(j!==0){var U=b;for(U.pendingLanes|=2,U.entangledLanes|=2;j;){var Y=1<<31-mt(j);U.entanglements[1]|=Y,j&=~Y}Ja(b),(_t&6)===0&&(_u=xt()+500,Ro(0))}}break;case 31:case 13:U=Ks(b,2),U!==null&&Hn(U,b,2),wu(),am(b,2)}if(b=sm(h),b===null&&qh(a,s,h,Uu,c),b===v)break;v=b}v!==null&&h.stopPropagation()}else qh(a,s,h,null,c)}}function sm(a){return a=lf(a),rm(a)}var Uu=null;function rm(a){if(Uu=null,a=Ua(a),a!==null){var s=l(a);if(s===null)a=null;else{var c=s.tag;if(c===13){if(a=o(s),a!==null)return a;a=null}else if(c===31){if(a=u(s),a!==null)return a;a=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;a=null}else s!==a&&(a=null)}}return Uu=a,null}function Fx(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 de:return 2;case ve:return 8;case Re:case Ge:return 32;case Me:return 268435456;default:return 32}default:return 32}}var lm=!1,fs=null,hs=null,ms=null,zo=new Map,Bo=new Map,ps=[],BE="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 $x(a,s){switch(a){case"focusin":case"focusout":fs=null;break;case"dragenter":case"dragleave":hs=null;break;case"mouseover":case"mouseout":ms=null;break;case"pointerover":case"pointerout":zo.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bo.delete(s.pointerId)}}function Uo(a,s,c,h,v,b){return a===null||a.nativeEvent!==b?(a={blockedOn:s,domEventName:c,eventSystemFlags:h,nativeEvent:b,targetContainers:[v]},s!==null&&(s=Gi(s),s!==null&&Bx(s)),a):(a.eventSystemFlags|=h,s=a.targetContainers,v!==null&&s.indexOf(v)===-1&&s.push(v),a)}function UE(a,s,c,h,v){switch(s){case"focusin":return fs=Uo(fs,a,s,c,h,v),!0;case"dragenter":return hs=Uo(hs,a,s,c,h,v),!0;case"mouseover":return ms=Uo(ms,a,s,c,h,v),!0;case"pointerover":var b=v.pointerId;return zo.set(b,Uo(zo.get(b)||null,a,s,c,h,v)),!0;case"gotpointercapture":return b=v.pointerId,Bo.set(b,Uo(Bo.get(b)||null,a,s,c,h,v)),!0}return!1}function Hx(a){var s=Ua(a.target);if(s!==null){var c=l(s);if(c!==null){if(s=c.tag,s===13){if(s=o(c),s!==null){a.blockedOn=s,Ka(a.priority,function(){Ux(c)});return}}else if(s===31){if(s=u(c),s!==null){a.blockedOn=s,Ka(a.priority,function(){Ux(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Fu(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var c=sm(a.nativeEvent);if(c===null){c=a.nativeEvent;var h=new c.constructor(c.type,c);rf=h,c.target.dispatchEvent(h),rf=null}else return s=Gi(c),s!==null&&Bx(s),a.blockedOn=c,!1;s.shift()}return!0}function Px(a,s,c){Fu(a)&&c.delete(s)}function FE(){lm=!1,fs!==null&&Fu(fs)&&(fs=null),hs!==null&&Fu(hs)&&(hs=null),ms!==null&&Fu(ms)&&(ms=null),zo.forEach(Px),Bo.forEach(Px)}function $u(a,s){a.blockedOn===s&&(a.blockedOn=null,lm||(lm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,FE)))}var Hu=null;function qx(a){Hu!==a&&(Hu=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Hu===a&&(Hu=null);for(var s=0;s<a.length;s+=3){var c=a[s],h=a[s+1],v=a[s+2];if(typeof h!="function"){if(rm(h||c)===null)continue;break}var b=Gi(c);b!==null&&(a.splice(s,3),s-=3,sh(b,{pending:!0,data:v,method:c.method,action:h},h,v))}}))}function hl(a){function s(Y){return $u(Y,a)}fs!==null&&$u(fs,a),hs!==null&&$u(hs,a),ms!==null&&$u(ms,a),zo.forEach(s),Bo.forEach(s);for(var c=0;c<ps.length;c++){var h=ps[c];h.blockedOn===a&&(h.blockedOn=null)}for(;0<ps.length&&(c=ps[0],c.blockedOn===null);)Hx(c),c.blockedOn===null&&ps.shift();if(c=(a.ownerDocument||a).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var v=c[h],b=c[h+1],j=v[Ee]||null;if(typeof b=="function")j||qx(c);else if(j){var U=null;if(b&&b.hasAttribute("formAction")){if(v=b,j=b[Ee]||null)U=j.formAction;else if(rm(v)!==null)continue}else U=j.action;typeof U=="function"?c[h+1]=U:(c.splice(h,3),h-=3),qx(c)}}}function Vx(){function a(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(j){return v=j})},focusReset:"manual",scroll:"manual"})}function s(){v!==null&&(v(),v=null),h||setTimeout(c,20)}function c(){if(!h&&!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 h=!1,v=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),v!==null&&(v(),v=null)}}}function om(a){this._internalRoot=a}Pu.prototype.render=om.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(i(409));var c=s.current,h=la();Ix(c,h,a,s,null,null)},Pu.prototype.unmount=om.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;Ix(a.current,2,null,a,null,null),wu(),s[Le]=null}};function Pu(a){this._internalRoot=a}Pu.prototype.unstable_scheduleHydration=function(a){if(a){var s=Hs();a={blockedOn:null,target:a,priority:s};for(var c=0;c<ps.length&&s!==0&&s<ps[c].priority;c++);ps.splice(c,0,a),c===0&&Hx(a)}};var Gx=t.version;if(Gx!=="19.2.4")throw Error(i(527,Gx,"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 $E={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var qu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qu.isDisabled&&qu.supportsFiber)try{wt=qu.inject($E),gt=qu}catch(a){}}return $o.createRoot=function(a,s){if(!r(a))throw Error(i(299));var c=!1,h="",v=Wv,b=e1,j=t1;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(b=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError)),s=Dx(a,1,!1,null,null,c,h,null,v,b,j,Vx),a[Le]=s.current,Ph(a),new om(s)},$o.hydrateRoot=function(a,s,c){if(!r(a))throw Error(i(299));var h=!1,v="",b=Wv,j=e1,U=t1,Y=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onUncaughtError!==void 0&&(b=c.onUncaughtError),c.onCaughtError!==void 0&&(j=c.onCaughtError),c.onRecoverableError!==void 0&&(U=c.onRecoverableError),c.formState!==void 0&&(Y=c.formState)),s=Dx(a,1,!0,s,c!=null?c:null,h,v,Y,b,j,U,Vx),s.context=Ox(null),c=s.current,h=la(),h=Vi(h),v=es(h),v.callback=null,ts(c,v,h),c=h,s.current.lanes=c,pa(s,c),Ja(s),a[Le]=s.current,Ph(a),new Pu(s)},$o.version="19.2.4",$o}var tb;function WE(){if(tb)return fm.exports;tb=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(),fm.exports=JE(),fm.exports}var ej=WE();const tj=KE(ej),rp=new WeakMap,nj=new WeakMap,vd={current:[]};let pm=!1,ac=0;const Zo=new Set,Yu=new Map;function T_(e){for(const t of e){if(vd.current.includes(t))continue;vd.current.push(t),t.recompute();const n=nj.get(t);if(n)for(const i of n){const r=rp.get(i);r!=null&&r.length&&T_(r)}}}function aj(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function ij(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function R_(e){var t;if(ac>0&&!Yu.has(e)&&Yu.set(e,e.prevState),Zo.add(e),!(ac>0)&&!pm)try{for(pm=!0;Zo.size>0;){const n=Array.from(Zo);Zo.clear();for(const i of n){const r=(t=Yu.get(i))!=null?t:i.prevState;i.prevState=r,aj(i)}for(const i of n){const r=rp.get(i);r&&(vd.current.push(i),T_(r))}for(const i of n){const r=rp.get(i);if(r)for(const l of r)ij(l)}}}finally{pm=!1,vd.current=[],Yu.clear()}}function sj(e){ac++;try{e()}finally{if(ac--,ac===0){const t=Zo.values().next().value;t&&R_(t)}}}function rj(e){return typeof e=="function"}class lj{constructor(t,n){this.listeners=new Set,this.subscribe=i=>{var r,l;this.listeners.add(i);const o=(l=(r=this.options)==null?void 0:r.onSubscribe)==null?void 0:l.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):rj(t)?this.state=t(this.prevState):this.state=t,(r=(i=this.options)==null?void 0:i.onUpdate)==null||r.call(i),R_(this)}}const Ds="__TSR_index",nb="popstate",ab="beforeunload";function oj(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()},l=m=>Qe(null,null,function*(){var g=m,{task:o,navigateOpts:u}=g,f=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=f.type==="PUSH"||f.type==="REPLACE";if(typeof document!="undefined"&&y.length&&x)for(const R of y){const C=dc(f.path,f.state);if(yield R.blockerFn({currentLocation:t,nextLocation:C,action:f.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,f)=>{const m=t.state[Ds];u=ib(m+1,u),l({task:()=>{e.pushState(o,u),i({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:o,state:u})},replace:(o,u,f)=>{const m=t.state[Ds];u=ib(m,u),l({task:()=>{e.replaceState(o,u),i({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:o,state:u})},go:(o,u)=>{l({task:()=>{e.go(o),r({type:"GO",index:o})},navigateOpts:u,type:"GO"})},back:o=>{l({task:()=>{var u;e.back((u=o==null?void 0:o.ignoreBlocker)!=null?u:!1),r({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{l({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[Ds]!==0,createHref:o=>e.createHref(o),block:o=>{var f,m;if(!e.setBlockers)return()=>{};const u=(m=(f=e.getBlockers)==null?void 0:f.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 ib(e,t){t||(t={});const n=ag();return V(L({},t),{key:n,__TSR_key:n,[Ds]:e})}function M_(e){var F,A,M,B,H;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 l=()=>r,o=G=>r=G,u=(A=e==null?void 0:e.createHref)!=null?A:(G=>G),f=(M=e==null?void 0:e.parseLocation)!=null?M:(()=>dc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!((B=t.history.state)!=null&&B.__TSR_key)&&!((H=t.history.state)!=null&&H.key)){const G=ag();t.history.replaceState({[Ds]:0,key:G,__TSR_key:G},"")}let m=f(),g,p=!1,y=!1,x=!1,_=!1;const S=()=>m;let w,N;const R=()=>{w&&(O._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),O._ignoreSubscribers=!1,w=void 0,N=void 0,g=void 0)},C=(G,$,q)=>{const P=u($);N||(g=m),m=dc($,q),w={href:P,state:q,isPush:(w==null?void 0:w.isPush)||G==="push"},N||(N=Promise.resolve().then(()=>R()))},E=G=>{m=f(),O.notify({type:G})},T=()=>Qe(null,null,function*(){if(y){y=!1;return}const G=f(),$=G.state[Ds]-m.state[Ds],q=$===1,P=$===-1,Q=!q&&!P||p;p=!1;const K=Q?"GO":P?"BACK":"FORWARD",W=Q?{type:"GO",index:$}:{type:P?"BACK":"FORWARD"};if(x)x=!1;else{const z=l();if(typeof document!="undefined"&&z.length){for(const se of z)if(yield se.blockerFn({currentLocation:m,nextLocation:G,action:K})){y=!0,t.history.go(1),O.notify(W);return}}}m=f(),O.notify(W)}),D=G=>{var P;if(_){_=!1;return}let $=!1;const q=l();if(typeof document!="undefined"&&q.length)for(const Q of q){const K=(P=Q.enableBeforeUnload)!=null?P:!0;if(K===!0){$=!0;break}if(typeof K=="function"&&K()===!0){$=!0;break}}if($)return G.preventDefault(),G.returnValue=""},O=oj({getLocation:S,getLength:()=>t.history.length,pushState:(G,$)=>C("push",G,$),replaceState:(G,$)=>C("replace",G,$),back:G=>(G&&(x=!0),_=!0,t.history.back()),forward:G=>{G&&(x=!0),_=!0,t.history.forward()},go:G=>{p=!0,t.history.go(G)},createHref:G=>u(G),flush:R,destroy:()=>{t.history.pushState=n,t.history.replaceState=i,t.removeEventListener(ab,D,{capture:!0}),t.removeEventListener(nb,T)},onBlocked:()=>{g&&m!==g&&(m=g)},getBlockers:l,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(ab,D,{capture:!0}),t.addEventListener(nb,T),t.history.pushState=function(...G){const $=n.apply(t.history,G);return O._ignoreSubscribers||E("PUSH"),$},t.history.replaceState=function(...G){const $=i.apply(t.history,G);return O._ignoreSubscribers||E("REPLACE"),$},O}function cj(e){const t=typeof document!="undefined"?window:void 0;return M_({window:t,parseLocation:()=>{var f;const n=t.location.hash.split("#").slice(1),i=(f=n[0])!=null?f:"/",r=t.location.search,l=n.slice(1),o=l.length===0?"":`#${l.join("#")}`,u=`${i}${r}${o}`;return dc(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 dc(e,t){const n=uj(e),i=n.indexOf("#"),r=n.indexOf("?"),l=ag();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||{[Ds]:0,key:l,__TSR_key:l}}}function ag(){return(Math.random()+1).toString(36).substring(7)}const gm=!1;function ic(e){let t;return sj(()=>{t=e()}),t}function fc(e){return e[e.length-1]}function dj(e){return typeof e=="function"}function As(e,t){return dj(e)?e(t):e}const fj=Object.prototype.hasOwnProperty,sb=Object.prototype.propertyIsEnumerable;function ca(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=t,r=ob(e)&&ob(i);if(!r&&!(xd(e)&&xd(i)))return i;const l=r?e:rb(e);if(!l)return i;const o=r?i:rb(i);if(!o)return i;const u=l.length,f=o.length,m=r?new Array(f):{};let g=0;for(let p=0;p<f;p++){const y=r?p:o[p],x=e[y],_=i[y];if(x===_){m[y]=x,(r?p<u:fj.call(e,y))&&g++;continue}if(x===null||_===null||typeof x!="object"||typeof _!="object"){m[y]=_;continue}const S=ca(x,_,n+1);m[y]=S,S===x&&g++}return u===f&&g===u?e:m}function rb(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!sb.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(!sb.call(e,r))return!1;i.push(r)}return i}function xd(e){if(!lb(e))return!1;const t=e.constructor;if(typeof t=="undefined")return!0;const n=t.prototype;return!(!lb(n)||!n.hasOwnProperty("isPrototypeOf"))}function lb(e){return Object.prototype.toString.call(e)==="[object Object]"}function ob(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sr(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,l=e.length;r<l;r++)if(!Sr(e[r],t[r],n))return!1;return!0}if(xd(e)&&xd(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)&&!Sr(e[u],t[u],n))return!1;return!0}let l=0;if(!r)l=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&l++;let o=0;for(const u in t)if((!r||t[u]!==void 0)&&(o++,o>l||!Sr(e[u],t[u],n)))return!1;return l===o}return!1}function Dl(e){let t,n;const i=new Promise((r,l)=>{t=r,n=l});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 bl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function hj(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function cb(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 hj(t)}const A_=["http:","https:","mailto:","tel:"];function bd(e){if(!e)return!1;try{const t=new URL(e);return!A_.includes(t.protocol)}catch(t){return!1}}function Ho(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+=cb(e.slice(n,r.index))+r[0],n=t.lastIndex;i=i+cb(n?e.slice(n):e);let l=!1;return i.startsWith("//")&&(l=!0,i="/"+i.replace(/^\/+/,"")),{path:i,handledProtocolRelativeURL:l}}function mj(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var pj="Invariant failed";function Ui(e,t){if(!e)throw new Error(pj)}function _d(e){const t=new Map;let n,i;const r=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,i&&(i.next=l,l.prev=i)):(l.next.prev=void 0,n=l.next,l.next=void 0,i&&(l.prev=i,i.next=l)),i=l)};return{get(l){const o=t.get(l);if(o)return r(o),o.value},set(l,o){if(t.size>=e&&n){const f=n;t.delete(f.key),f.next&&(n=f.next,f.next.prev=void 0),f===i&&(i=void 0)}const u=t.get(l);if(u)u.value=o,r(u);else{const f={key:l,value:o,prev:i};i&&(i.next=f),i=f,n||(n=f),t.set(l,f)}},clear(){t.clear(),n=void 0,i=void 0}}}const Ol=0,jr=1,kr=2,hc=3,ur=4,L_=5;function gj(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 ig(e,t,n=new Uint16Array(6)){const i=e.indexOf("/",t),r=i===-1?e.length:i,l=e.substring(t,r);if(!l||!l.includes("$"))return n[0]=Ol,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n;if(l==="$"){const u=e.length;return n[0]=kr,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,n}if(l.charCodeAt(0)===36)return n[0]=jr,n[1]=t,n[2]=t+1,n[3]=r,n[4]=r,n[5]=r,n;const o=gj(l);if(o){const[u,f]=o,m=l.charCodeAt(u+1);if(m===45){if(u+2<l.length&&l.charCodeAt(u+2)===36){const g=u+3,p=f;if(g<p)return n[0]=hc,n[1]=t+u,n[2]=t+g,n[3]=t+p,n[4]=t+f+1,n[5]=r,n}}else if(m===36){const g=u+1,p=u+2;return p===f?(n[0]=kr,n[1]=t+u,n[2]=t+g,n[3]=t+p,n[4]=t+f+1,n[5]=e.length,n):(n[0]=jr,n[1]=t+u,n[2]=t+p,n[3]=t+f,n[4]=t+f+1,n[5]=r,n)}}return n[0]=Ol,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}function Id(e,t,n,i,r,l,o){var f,m,g,p,y,x,_,S,w,N,R,C,E,T,D,O,F,A,M,B,H,G,$,q,P,Q,K,W,z,se,ue;o==null||o(n);let u=i;{const I=(f=n.fullPath)!=null?f:n.from,ae=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<ae;){const we=ig(I,u,t);let Ce;const at=u,Ze=we[5];switch(u=Ze+1,l++,we[0]){case Ol:{const ct=I.substring(we[2],we[3]);if(ye){const Ie=(S=r.static)==null?void 0:S.get(ct);if(Ie)Ce=Ie;else{(w=r.static)!=null||(r.static=new Map);const Ke=dr((N=n.fullPath)!=null?N:n.from);Ke.parent=r,Ke.depth=l,Ce=Ke,r.static.set(ct,Ke)}}else{const Ie=ct.toLowerCase(),Ke=(R=r.staticInsensitive)==null?void 0:R.get(Ie);if(Ke)Ce=Ke;else{(C=r.staticInsensitive)!=null||(r.staticInsensitive=new Map);const St=dr((E=n.fullPath)!=null?E:n.from);St.parent=r,St.depth=l,Ce=St,r.staticInsensitive.set(Ie,St)}}break}case jr:{const ct=I.substring(at,we[1]),Ie=I.substring(we[4],Ze),Ke=ye&&!!(ct||Ie),St=ct?Ke?ct:ct.toLowerCase():void 0,Oe=Ie?Ke?Ie:Ie.toLowerCase():void 0,pt=!xe&&((T=r.dynamic)==null?void 0:T.find($e=>!$e.skipOnParamError&&$e.caseSensitive===Ke&&$e.prefix===St&&$e.suffix===Oe));if(pt)Ce=pt;else{const $e=vm(jr,(D=n.fullPath)!=null?D:n.from,Ke,St,Oe);Ce=$e,$e.depth=l,$e.parent=r,(O=r.dynamic)!=null||(r.dynamic=[]),r.dynamic.push($e)}break}case hc:{const ct=I.substring(at,we[1]),Ie=I.substring(we[4],Ze),Ke=ye&&!!(ct||Ie),St=ct?Ke?ct:ct.toLowerCase():void 0,Oe=Ie?Ke?Ie:Ie.toLowerCase():void 0,pt=!xe&&((F=r.optional)==null?void 0:F.find($e=>!$e.skipOnParamError&&$e.caseSensitive===Ke&&$e.prefix===St&&$e.suffix===Oe));if(pt)Ce=pt;else{const $e=vm(hc,(A=n.fullPath)!=null?A:n.from,Ke,St,Oe);Ce=$e,$e.parent=r,$e.depth=l,(M=r.optional)!=null||(r.optional=[]),r.optional.push($e)}break}case kr:{const ct=I.substring(at,we[1]),Ie=I.substring(we[4],Ze),Ke=ye&&!!(ct||Ie),St=ct?Ke?ct:ct.toLowerCase():void 0,Oe=Ie?Ke?Ie:Ie.toLowerCase():void 0,pt=vm(kr,(B=n.fullPath)!=null?B:n.from,Ke,St,Oe);Ce=pt,pt.parent=r,pt.depth=l,(H=r.wildcard)!=null||(r.wildcard=[]),r.wildcard.push(pt)}}r=Ce}if(xe&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const we=dr((G=n.fullPath)!=null?G:n.from);we.kind=L_,we.parent=r,l++,we.depth=l,($=r.pathless)!=null||(r.pathless=[]),r.pathless.push(we),r=we}const he=(n.path||!n.children)&&!n.isRoot;if(he&&I.endsWith("/")){const we=dr((q=n.fullPath)!=null?q:n.from);we.kind=ur,we.parent=r,l++,we.depth=l,r.index=we,r=we}r.parse=(K=(Q=(P=n.options)==null?void 0:P.params)==null?void 0:Q.parse)!=null?K:null,r.skipOnParamError=xe,r.parsingPriority=(se=(z=(W=n.options)==null?void 0:W.skipRouteOnParseError)==null?void 0:z.priority)!=null?se:0,he&&!r.route&&(r.route=n,r.fullPath=(ue=n.fullPath)!=null?ue:n.from)}if(n.children)for(const I of n.children)Id(e,t,I,u,r,l,o)}function ym(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 Ss(e){var t,n,i;if(e.pathless)for(const r of e.pathless)Ss(r);if(e.static)for(const r of e.static.values())Ss(r);if(e.staticInsensitive)for(const r of e.staticInsensitive.values())Ss(r);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(ym);for(const r of e.dynamic)Ss(r)}if((n=e.optional)!=null&&n.length){e.optional.sort(ym);for(const r of e.optional)Ss(r)}if((i=e.wildcard)!=null&&i.length){e.wildcard.sort(ym);for(const r of e.wildcard)Ss(r)}}function dr(e){return{kind:Ol,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 vm(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 yj(e,t){const n=dr("/"),i=new Uint16Array(6);for(const r of e)Id(!1,i,r,1,n,0);Ss(n),t.masksTree=n,t.flatCache=_d(1e3)}function vj(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const i=sg(e,t.masksTree);return t.flatCache.set(e,i),i}function xj(e,t,n,i,r){e||(e="/"),i||(i="/");const l=t?`case\0${e}`:e;let o=r.singleCache.get(l);if(!o){o=dr("/");const u=new Uint16Array(6);Id(t,u,{from:e},1,o,0),r.singleCache.set(l,o)}return sg(i,o,n)}function bj(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 l;try{l=sg(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)l=null;else throw o}return l&&(l.branch=wj(l.route)),t.matchCache.set(i,l),l}function _j(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Sj(e,t=!1,n){const i=dr(e.fullPath),r=new Uint16Array(6),l={},o={};let u=0;return Id(t,r,e,1,i,0,m=>{if(n==null||n(m,u),Ui(!(m.id in l),`Duplicate routes found with id: ${String(m.id)}`),l[m.id]=m,u!==0&&m.path){const g=_j(m.fullPath);(!o[g]||m.fullPath.endsWith("/"))&&(o[g]=m)}u++}),Ss(i),{processedTree:{segmentTree:i,singleCache:_d(1e3),matchCache:_d(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:o}}function sg(e,t,n=!1){const i=e.split("/"),r=Cj(e,i,t,n);if(!r)return null;const[l]=D_(e,i,r);return{route:r.node.route,rawParams:l,parsedParams:r.parsedParams}}function D_(e,t,n){var g,p,y,x,_,S,w,N,R,C,E,T,D,O,F,A,M,B,H,G;const i=Nj(n.node);let r=null;const l={};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,f=(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++,f++,m++){const $=i[u];if($.kind===ur)break;if($.kind===L_){m--,o--,f--;continue}const q=t[o],P=f;if(q&&(f+=q.length),$.kind===jr){r!=null||(r=n.node.fullPath.split("/"));const Q=r[m],K=(C=(R=$.prefix)==null?void 0:R.length)!=null?C:0;if(Q.charCodeAt(K)===123){const z=(T=(E=$.suffix)==null?void 0:E.length)!=null?T:0,se=Q.substring(K+2,Q.length-z-1),ue=q.substring(K,q.length-z);l[se]=decodeURIComponent(ue)}else{const z=Q.substring(1);l[z]=decodeURIComponent(q)}}else if($.kind===hc){if(n.skipped&1<<u){o--,f=P-1;continue}r!=null||(r=n.node.fullPath.split("/"));const Q=r[m],K=(O=(D=$.prefix)==null?void 0:D.length)!=null?O:0,W=(A=(F=$.suffix)==null?void 0:F.length)!=null?A:0,z=Q.substring(K+3,Q.length-W-1),se=$.suffix||$.prefix?q.substring(K,q.length-W):q;se&&(l[z]=decodeURIComponent(se))}else if($.kind===kr){const Q=$,K=e.substring(P+((B=(M=Q.prefix)==null?void 0:M.length)!=null?B:0),e.length-((G=(H=Q.suffix)==null?void 0:H.length)!=null?G:0)),W=decodeURIComponent(K);l["*"]=W,l._splat=W;break}}return n.rawParams&&Object.assign(l,n.rawParams),[l,{part:o,node:u,path:f,segment:m}]}function wj(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Nj(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Cj(e,t,n,i){var p;if(e==="/"&&n.index)return{node:n.index,skipped:0};const r=!fc(t),l=r&&e!=="/",o=t.length-(r?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let f=null,m=null,g=null;for(;u.length;){const y=u.pop(),{node:x,index:_,skipped:S,depth:w,statics:N,dynamics:R,optionals:C}=y;let{extract:E,rawParams:T,parsedParams:D}=y;if(x.skipOnParamError){if(!xm(e,t,y))continue;T=y.rawParams,E=y.extract,D=y.parsedParams}i&&x.route&&x.kind!==ur&&Po(m,y)&&(m=y);const O=_===o;if(O&&(x.route&&!l&&Po(g,y)&&(g=y),!x.optional&&!x.wildcard&&!x.index&&!x.pathless))continue;const F=O?void 0:t[_];let A;if(O&&x.index){const M={node:x.index,index:_,skipped:S,depth:w+1,statics:N,dynamics:R,optionals:C,extract:E,rawParams:T,parsedParams:D};let B=!0;if(x.index.skipOnParamError&&(xm(e,t,M)||(B=!1)),B){if(N===o&&!R&&!C&&!S)return M;Po(g,M)&&(g=M)}}if(x.wildcard&&Po(f,y))for(const M of x.wildcard){const{prefix:B,suffix:H}=M;if(B&&(O||!(M.caseSensitive?F:A!=null?A:A=F.toLowerCase()).startsWith(B)))continue;if(H){if(O)continue;const $=t.slice(_).join("/").slice(-H.length);if((M.caseSensitive?$:$.toLowerCase())!==H)continue}const G={node:M,index:o,skipped:S,depth:w,statics:N,dynamics:R,optionals:C,extract:E,rawParams:T,parsedParams:D};if(!(M.skipOnParamError&&!xm(e,t,G))){f=G;break}}if(x.optional){const M=S|1<<w,B=w+1;for(let H=x.optional.length-1;H>=0;H--){const G=x.optional[H];u.push({node:G,index:_,skipped:M,depth:B,statics:N,dynamics:R,optionals:C,extract:E,rawParams:T,parsedParams:D})}if(!O)for(let H=x.optional.length-1;H>=0;H--){const G=x.optional[H],{prefix:$,suffix:q}=G;if($||q){const P=G.caseSensitive?F:A!=null?A:A=F.toLowerCase();if($&&!P.startsWith($)||q&&!P.endsWith(q))continue}u.push({node:G,index:_+1,skipped:S,depth:B,statics:N,dynamics:R,optionals:C+1,extract:E,rawParams:T,parsedParams:D})}}if(!O&&x.dynamic&&F)for(let M=x.dynamic.length-1;M>=0;M--){const B=x.dynamic[M],{prefix:H,suffix:G}=B;if(H||G){const $=B.caseSensitive?F:A!=null?A:A=F.toLowerCase();if(H&&!$.startsWith(H)||G&&!$.endsWith(G))continue}u.push({node:B,index:_+1,skipped:S,depth:w+1,statics:N,dynamics:R+1,optionals:C,extract:E,rawParams:T,parsedParams:D})}if(!O&&x.staticInsensitive){const M=x.staticInsensitive.get(A!=null?A:A=F.toLowerCase());M&&u.push({node:M,index:_+1,skipped:S,depth:w+1,statics:N+1,dynamics:R,optionals:C,extract:E,rawParams:T,parsedParams:D})}if(!O&&x.static){const M=x.static.get(F);M&&u.push({node:M,index:_+1,skipped:S,depth:w+1,statics:N+1,dynamics:R,optionals:C,extract:E,rawParams:T,parsedParams:D})}if(x.pathless){const M=w+1;for(let B=x.pathless.length-1;B>=0;B--){const H=x.pathless[B];u.push({node:H,index:_,skipped:S,depth:M,statics:N,dynamics:R,optionals:C,extract:E,rawParams:T,parsedParams:D})}}}if(g&&f)return Po(f,g)?g:f;if(g)return g;if(f)return f;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 xm(e,t,n){try{const[i,r]=D_(e,t,n);n.rawParams=i,n.extract=r;const l=n.node.parse(i);return n.parsedParams=Object.assign({},n.parsedParams,l),!0}catch(i){return null}}function Po(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===ur)>(e.node.kind===ur)||t.node.kind===ur==(e.node.kind===ur)&&t.depth>e.depth))):!0}function dd(e){return rg(e.filter(t=>t!==void 0).join("/"))}function rg(e){return e.replace(/\/{2,}/g,"/")}function O_(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function zi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function I_(e){return zi(O_(e))}function Sd(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Ej(e,t,n){return Sd(e,n)===Sd(t,n)}function jj({base:e,to:t,trailingSlash:n="never",cache:i}){const r=t.startsWith("/"),l=!r&&t===".";let o;if(i){o=r?t:l?e:e+"\0"+t;const p=i.get(o);if(p)return p}let u;if(l)u=e.split("/");else if(r)u=t.split("/");else{for(u=e.split("/");u.length>1&&fc(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&&(fc(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));let f,m="";for(let p=0;p<u.length;p++){p>0&&(m+="/");const y=u[p];if(!y)continue;f=ig(y,0,f);const x=f[0];if(x===Ol){m+=y;continue}const _=f[5],S=y.substring(0,f[1]),w=y.substring(f[4],_),N=y.substring(f[2],f[3]);x===jr?m+=S||w?`${S}{$${N}}${w}`:`$${N}`:x===kr?m+=S||w?`${S}{$}${w}`:"$":m+=`${S}{-$${N}}${w}`}m=rg(m);const g=m||"/";return o&&i&&i.set(o,g),g}function kj(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,l=>{var o;return(o=t.get(l))!=null?o:l})}function bm(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=>ub(r,n)).join("/"):ub(i,n)}function _m(r){var l=r,{path:e,params:t,decoder:n}=l,i=pe(l,["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 f=e.length;let m=0,g,p="";for(;m<f;){const S=m;g=ig(e,S,g);const w=g[5];if(m=w+1,S===w)continue;const N=g[0];if(N===Ol){p+="/"+e.substring(S,w);continue}if(N===kr){const R=t._splat;u._splat=R,u["*"]=R;const C=e.substring(S,g[1]),E=e.substring(g[4],w);if(!R){o=!0,(C||E)&&(p+="/"+C+E);continue}const T=bm("_splat",t,n);p+="/"+C+T+E;continue}if(N===jr){const R=e.substring(g[2],g[3]);!o&&!(R in t)&&(o=!0),u[R]=t[R];const C=e.substring(S,g[1]),E=e.substring(g[4],w),T=(x=bm(R,t,n))!=null?x:"undefined";p+="/"+C+T+E;continue}if(N===hc){const R=e.substring(g[2],g[3]),C=t[R];if(C==null)continue;u[R]=C;const E=e.substring(S,g[1]),T=e.substring(g[4],w),D=(_=bm(R,t,n))!=null?_:"";p+="/"+E+D+T;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:u,interpolatedPath:p||"/",isMissingParams:o}}function ub(e,t){var i;const n=encodeURIComponent(e);return(i=t==null?void 0:t(n))!=null?i:n}function ua(e){return!!(e!=null&&e.isNotFound)}function Tj(){try{if(typeof window!="undefined"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch(e){}}const lp="tsr-scroll-restoration-v1_3",Rj=(e,t)=>{let n;return(...i)=>{n||(n=setTimeout(()=>{e(...i),n=null},t))}};function Mj(){const e=Tj();if(!e)return null;const t=e.getItem(lp);let n=t?JSON.parse(t):{};return{state:n,set:i=>{n=As(i,n)||n;try{e.setItem(lp,JSON.stringify(n))}catch(r){console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Xu=Mj(),Aj=e=>e.state.__TSR_key||e.href;function Lj(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 wd=!1;function Dj({storageKey:e,key:t,behavior:n,shouldScrollRestoration:i,scrollToTopSelectors:r,location:l}){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),f=o[u];wd=!0;e:{if(i&&f&&Object.keys(f).length>0){for(const _ in f){const S=f[_];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=(l!=null?l: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)}}wd=!1}function Oj(e,t){var l;if(!Xu||(((l=e.options.scrollRestoration)!=null?l:!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Xu))return;e.isScrollRestorationSetup=!0,wd=!1;const i=e.options.getScrollRestorationKey||Aj;window.history.scrollRestoration="manual";const r=o=>{if(wd||!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=Lj(o.target)}const f=i(e.state.location);Xu.set(m=>{const g=m[f]||(m[f]={}),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",Rj(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})||(Dj({storageKey:lp,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Xu.set(f=>(f[u]||(f[u]={}),f)))})}function Ij(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 zj(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 Bj(e){const t=new URLSearchParams(e),n={};for(const[i,r]of t.entries()){const l=n[i];l==null?n[i]=Sm(r):Array.isArray(l)?l.push(Sm(r)):n[i]=[l,Sm(r)]}return n}const Uj=$j(JSON.parse),Fj=Hj(JSON.stringify,JSON.parse);function $j(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Bj(t);for(const i in n){const r=n[i];if(typeof r=="string")try{n[i]=e(r)}catch(l){}}return n}}function Hj(e,t){const n=typeof t=="function";function i(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch(l){}else if(n&&typeof r=="string")try{return t(r),e(r)}catch(l){}return r}return r=>{const l=zj(r,i);return l?`?${l}`:""}}const ka="__root__";function Pj(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&bd(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${A_.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 Ma(e){return e instanceof Response&&!!e.options}const fd=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},zd=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),_l=(e,t,n=!0)=>{var l;const i=L({},(l=e.router.options.context)!=null?l:{}),r=n?t:t-1;for(let o=0;o<=r;o++){const u=e.matches[o];if(!u)continue;const f=e.router.getMatch(u.id);f&&Object.assign(i,f.__routeContext,f.__beforeLoadContext)}return i},z_=(e,t)=>{var r,l,o;const n=(l=e.router.routesById[(r=t.routeId)!=null?r:""])!=null?l:e.router.routeTree;!n.options.notFoundComponent&&((o=e.router.options)!=null&&o.defaultNotFoundComponent)&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),Ui(n.options.notFoundComponent);const i=e.matches.find(u=>u.routeId===n.id);Ui(i,"Could not find match for route: "+n.id),e.updateMatch(i.id,u=>V(L({},u),{status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,z_(e,t))},Ls=(e,t,n)=>{var i,r,l;if(!(!Ma(n)&&!ua(n))){if(Ma(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=Ma(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,u=>V(L({},u),{status:o,context:_l(e,t.index),isFetching:!1,error:n})),ua(n)&&!n.routeId&&(n.routeId=t.routeId),(l=t._nonReactive.loadPromise)==null||l.resolve()}throw Ma(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(z_(e,n),n)}},B_=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,qo=(e,t,n,i)=>{var u,f,m;const{id:r,routeId:l}=e.matches[t],o=e.router.looseRoutesById[l];if(n instanceof Promise)throw n;n.routerCode=i,(u=e.firstBadMatchIndex)!=null||(e.firstBadMatchIndex=t),Ls(e,e.router.getMatch(r),n);try{(m=(f=o.options).onError)==null||m.call(f,n)}catch(g){n=g,Ls(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(L({},g),{error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})})},U_=(e,t,n,i)=>{var o,u,f;if(i._nonReactive.pendingTimeout!==void 0)return;const r=(o=n.options.pendingMs)!=null?o:e.router.options.defaultPendingMs;if(!!(e.onReady&&!zd(e,t)&&(n.options.loader||n.options.beforeLoad||H_(n))&&typeof r=="number"&&r!==1/0&&((f=n.options.pendingComponent)!=null?f:(u=e.router.options)!=null&&u.defaultPendingComponent))){const m=setTimeout(()=>{fd(e)},r);i._nonReactive.pendingTimeout=m}},qj=(e,t,n)=>{const i=e.router.getMatch(t);if(!i._nonReactive.beforeLoadPromise&&!i._nonReactive.loaderPromise)return;U_(e,t,n,i);const r=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&Ls(e,l,l.error)};return i._nonReactive.beforeLoadPromise?i._nonReactive.beforeLoadPromise.then(r):r()},Vj=(e,t,n,i)=>{const r=e.router.getMatch(t),l=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Dl(()=>{l==null||l.resolve()});const{paramsError:o,searchError:u}=r;o&&qo(e,n,o,"PARSE_PARAMS"),u&&qo(e,n,u,"VALIDATE_SEARCH"),U_(e,t,i,r);const f=new AbortController;let m=!1;const g=()=>{m||(m=!0,e.updateMatch(t,E=>V(L({},E),{isFetching:"beforeLoad",fetchCount:E.fetchCount+1,abortController:f})))},p=()=>{var E;(E=r._nonReactive.beforeLoadPromise)==null||E.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,T=>V(L({},T),{isFetching:!1}))};if(!i.options.beforeLoad){ic(()=>{g(),p()});return}r._nonReactive.beforeLoadPromise=Dl();const y=L(L({},_l(e,n,!1)),r.__routeContext),{search:x,params:_,cause:S}=r,w=zd(e,t),N=L({search:x,abortController:f,params:_,preload:w,context:y,location:e.location,navigate:E=>e.router.navigate(V(L({},E),{_fromLocation:e.location})),buildLocation:e.router.buildLocation,cause:w?"preload":S,matches:e.matches,routeId:i.id},e.router.options.additionalContext),R=E=>{if(E===void 0){ic(()=>{g(),p()});return}(Ma(E)||ua(E))&&(g(),qo(e,n,E,"BEFORE_LOAD")),ic(()=>{g(),e.updateMatch(t,T=>V(L({},T),{__beforeLoadContext:E})),p()})};let C;try{if(C=i.options.beforeLoad(N),bl(C))return g(),C.catch(E=>{qo(e,n,E,"BEFORE_LOAD")}).then(R)}catch(E){g(),qo(e,n,E,"BEFORE_LOAD")}R(C)},Gj=(e,t)=>{const{id:n,routeId:i}=e.matches[t],r=e.router.looseRoutesById[i],l=()=>u(),o=()=>Vj(e,n,t,r),u=()=>{if(B_(e,n))return;const f=qj(e,n,r);return bl(f)?f.then(o):o()};return l()},Kj=(e,t,n)=>{var l,o,u,f,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=(l=n.options).head)==null?void 0:o.call(l,r),(f=(u=n.options).scripts)==null?void 0:f.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}})},F_=(e,t,n,i)=>{const r=e.matchPromises[n-1],{params:l,loaderDeps:o,abortController:u,cause:f}=e.router.getMatch(t),m=_l(e,n),g=zd(e,t);return L({params:l,deps:o,preload:!!g,parentMatchPromise:r,abortController:u,context:m,location:e.location,navigate:p=>e.router.navigate(V(L({},p),{_fromLocation:e.location})),cause:g?"preload":f,route:i},e.router.options.additionalContext)},db=(e,t,n,i)=>Qe(null,null,function*(){var r,l,o,u,f,m,g;try{const p=e.router.getMatch(t);try{(!(gm!=null?gm:e.router.isServer)||p.ssr===!0)&&$_(i);const y=(l=(r=i.options).loader)==null?void 0:l.call(r,F_(e,t,n,i)),x=i.options.loader&&bl(y);if(!!(x||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||p._nonReactive.minPendingPromise)&&e.updateMatch(t,w=>V(L({},w),{isFetching:"loader"})),i.options.loader){const w=x?yield y:y;Ls(e,e.router.getMatch(t),w),w!==void 0&&e.updateMatch(t,N=>V(L({},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(L({},w),{error:void 0,context:_l(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(L({},S),{status:S.status==="pending"?"success":S.status,isFetching:!1,context:_l(e,n)}));return}const _=p._nonReactive.minPendingPromise;_&&(yield _),ua(y)&&(yield(f=(u=i.options.notFoundComponent)==null?void 0:u.preload)==null?void 0:f.call(u)),Ls(e,e.router.getMatch(t),y);try{(g=(m=i.options).onError)==null||g.call(m,y)}catch(S){x=S,Ls(e,e.router.getMatch(t),S)}e.updateMatch(t,S=>V(L({},S),{error:x,context:_l(e,n),status:"error",isFetching:!1}))}}catch(p){const y=e.router.getMatch(t);y&&(y._nonReactive.loaderPromise=void 0),Ls(e,y,p)}}),Yj=(e,t)=>Qe(null,null,function*(){var g,p;function n(y,x,_,S){return Qe(this,null,function*(){var D,O,F,A;const w=Date.now()-x.updatedAt,N=y?(O=(D=S.options.preloadStaleTime)!=null?D:e.router.options.defaultPreloadStaleTime)!=null?O:3e4:(A=(F=S.options.staleTime)!=null?F:e.router.options.defaultStaleTime)!=null?A:0,R=S.options.shouldReload,C=typeof R=="function"?R(F_(e,i,t,S)):R,{status:E,invalid:T}=_;l=E==="success"&&(T||(C!=null?C:w>N)),y&&S.options.preload===!1||(l&&!e.sync?(o=!0,Qe(null,null,function*(){var M,B;try{yield db(e,i,t,S);const H=e.router.getMatch(i);(M=H._nonReactive.loaderPromise)==null||M.resolve(),(B=H._nonReactive.loadPromise)==null||B.resolve(),H._nonReactive.loaderPromise=void 0}catch(H){Ma(H)&&(yield e.router.navigate(H.options))}})):(E!=="success"||l&&e.sync)&&(yield db(e,i,t,S)))})}const{id:i,routeId:r}=e.matches[t];let l=!1,o=!1;const u=e.router.looseRoutesById[r];if(!B_(e,i)){const y=e.router.getMatch(i),x=zd(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&&Ls(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=Dl(),_!==S.preload&&e.updateMatch(i,w=>V(L({},w),{preload:_})),yield n(x,y,S,u)}}const f=e.router.getMatch(i);o||((g=f._nonReactive.loaderPromise)==null||g.resolve(),(p=f._nonReactive.loadPromise)==null||p.resolve()),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,o||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const m=o?f.isFetching:!1;return m!==f.isFetching||f.invalid!==!1?(e.updateMatch(i,y=>V(L({},y),{isFetching:m,invalid:!1})),e.router.getMatch(i)):f});function fb(e){return Qe(this,null,function*(){var n;const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(i=>i._forcePending)&&fd(t);try{for(let f=0;f<t.matches.length;f++){const m=Gj(t,f);bl(m)&&(yield m)}const i=(n=t.firstBadMatchIndex)!=null?n:t.matches.length;for(let f=0;f<i;f++)t.matchPromises.push(Yj(t,f));const l=(yield Promise.allSettled(t.matchPromises)).filter(f=>f.status==="rejected").map(f=>f.reason);let o;for(const f of l){if(Ma(f))throw f;!o&&ua(f)&&(o=f)}for(const f of t.matches){const{id:m,routeId:g}=f,p=t.router.looseRoutesById[g];try{const y=Kj(t,m,p);if(y){const x=yield y;t.updateMatch(m,_=>L(L({},_),x))}}catch(y){console.error(`Error executing head for route ${g}:`,y)}}if(o)throw o;const u=fd(t);bl(u)&&(yield u)}catch(i){if(ua(i)&&!t.preload){const r=fd(t);throw bl(r)&&(yield r),i}if(Ma(i))throw i}return t.matches})}function $_(e){return Qe(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 P_){const l=(i=e.options[r])==null?void 0:i.preload;l&&n.push(l())}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 H_(e){var t;for(const n of P_)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const P_=["component","errorComponent","pendingComponent","notFoundComponent"];function Xj(e){return{input:({url:t})=>{for(const n of e)t=op(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=q_(e[n],t);return t}}}function Qj(e){const t=I_(e.basepath),n=`/${t}`,i=`${n}/`,r=e.caseSensitive?n:n.toLowerCase(),l=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(l)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=dd(["/",t,o.pathname]),o)}}function op(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 q_(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 wr(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,l=(t==null?void 0:t.hash)!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:i,hrefChanged:r,hashChanged:l}}class Zj{constructor(t){var n,i,r,l;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,R,C,E;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,f=(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=L(L({},u),o),this.isServer=(R=this.options.isServer)!=null?R:typeof document=="undefined",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=kj(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=M_()),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 T;this.resolvePathCache=_d(1e3),T=this.buildRouteTree(),this.setRoutes(T)}!this.__store&&this.latestLocation&&(this.__store=new lj(Wj(this.latestLocation),{onUpdate:()=>{this.__store.state=V(L({},this.state),{cachedMatches:this.state.cachedMatches.filter(T=>!["redirected"].includes(T.status))})}}),Oj(this));let p=!1;const y=(C=this.options.basepath)!=null?C:"/",x=this.options.rewrite;if(m||f!==y||g!==x){this.basepath=y;const T=[],D=I_(y);D&&D!=="/"&&T.push(Qj({basepath:y})),x&&T.push(x),this.rewrite=T.length===0?void 0:T.length===1?T[0]:Xj(T),this.history&&this.updateLatestLocation(),p=!0}p&&this.__store&&(this.__store.state=V(L({},this.state),{location:this.latestLocation})),typeof window!="undefined"&&"CSS"in window&&typeof((E=window.CSS)==null?void 0:E.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=Sj(this.routeTree,this.options.caseSensitive,(u,f)=>{u.init({originalIndex:f})});return this.options.routeMasks&&yj(this.options.routeMasks,o.processedTree),o},this.subscribe=(o,u)=>{const f={eventType:o,fn:u};return this.subscribers.add(f),()=>{this.subscribers.delete(f)}},this.emit=o=>{this.subscribers.forEach(u=>{u.eventType===o.type&&u.fn(o)})},this.parseLocation=(o,u)=>{const f=({pathname:y,search:x,hash:_,href:S,state:w})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(y)){const D=this.options.parseSearch(x),O=this.options.stringifySearch(D);return{href:y+O+_,publicHref:S,pathname:Ho(y).path,external:!1,searchStr:O,search:ca(u==null?void 0:u.search,D),hash:Ho(_.slice(1)).path,state:ca(u==null?void 0:u.state,w)}}const N=new URL(S,this.origin),R=op(this.rewrite,N),C=this.options.parseSearch(R.search),E=this.options.stringifySearch(C);return R.search=E,{href:R.href.replace(R.origin,""),publicHref:S,pathname:Ho(R.pathname).path,external:!!this.rewrite&&R.origin!==this.origin,searchStr:E,search:ca(u==null?void 0:u.search,C),hash:Ho(R.hash.slice(1)).path,state:ca(u==null?void 0:u.state,w)}},m=f(o),{__tempLocation:g,__tempKey:p}=m.state;if(g&&(!p||p===this.tempLocationKey)){const y=f(g);return y.state.key=m.state.key,y.state.__TSR_key=m.state.__TSR_key,delete y.state.__tempLocation,V(L({},y),{maskedLocation:m})}return m},this.resolvePathWithBase=(o,u)=>jj({base:o,to:rg(u),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(o,u,f)=>typeof o=="string"?this.matchRoutesInternal({pathname:o,search:u},f):this.matchRoutesInternal(o,u),this.getMatchedRoutes=o=>ek({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,K,W,z,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=L({},p.params),w=m.to?this.resolvePathWithBase(x,`${m.to}`):this.resolvePathWithBase(x,"."),N=m.params===!1||m.params===null?{}:((K=m.params)!=null?K:!0)===!0?S:Object.assign(S,As(m.params,S)),R=_m({path:w,params:N,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,C=this.getMatchedRoutes(R);let E=C.matchedRoutes;(C.foundRoute?C.foundRoute.path!=="/"&&C.routeParams["**"]:zi(R))&&this.options.notFoundRoute&&(E=[...E,this.options.notFoundRoute]);let D=!1;if(Object.keys(N).length>0)for(const ue of E){const I=(z=(W=ue.options.params)==null?void 0:W.stringify)!=null?z:ue.options.stringifyParams;I&&(D=!0,Object.assign(N,I(N)))}const O=o.leaveParams?w:Ho(D?_m({path:w,params:N,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:R).path;let F=_;if(o._includeValidateSearch&&((se=this.options.search)!=null&&se.strict)){const ue={};E.forEach(I=>{if(I.options.validateSearch)try{Object.assign(ue,hd(I.options.validateSearch,L(L({},ue),F)))}catch(ae){}}),F=ue}F=tk({search:F,dest:m,destRoutes:E,_includeValidateSearch:o._includeValidateSearch}),F=ca(_,F);const A=this.options.stringifySearch(F),M=m.hash===!0?g.hash:m.hash?As(m.hash,g.hash):void 0,B=M?`#${M}`:"";let H=m.state===!0?g.state:m.state?As(m.state,g.state):{};H=ca(g.state,H);const G=`${O}${A}${B}`;let $,q,P=!1;if(this.rewrite){const ue=new URL(G,this.origin),I=q_(this.rewrite,ue);$=ue.href.replace(ue.origin,""),I.origin!==this.origin?(q=I.href,P=!0):q=I.pathname+I.search+I.hash}else $=mj(G),q=$;return{publicHref:q,href:$,pathname:O,search:F,searchStr:A,state:H,hash:M!=null?M:"",external:P,unmaskOnReload:m.unmaskOnReload}},f=(m={},g)=>{const p=u(m);let y=g?u(g):void 0;if(!y){const _={};if(this.options.routeMasks){const S=vj(p.pathname,this.processedTree);if(S){Object.assign(_,S.rawParams);const x=S.route,{from:w,params:N}=x,R=pe(x,["from","params"]),C=N===!1||N===null?{}:(N!=null?N:!0)===!0?_:Object.assign(_,As(N,_));g=V(L({from:o.from},R),{params:C}),y=u(g)}}}return y&&(p.maskedLocation=y),p};return o.mask?f(o,L({from:o.from},o.mask)):f(o)},this.commitLocation=m=>Qe(this,null,function*(){var g=m,{viewTransition:o,ignoreBlocker:u}=g,f=pe(g,["viewTransition","ignoreBlocker"]);var S,w,N,R;const p=()=>{const C=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];C.forEach(T=>{f.state[T]=this.latestLocation.state[T]});const E=Sr(f.state,this.latestLocation.state);return C.forEach(T=>{delete f.state[T]}),E},y=zi(this.latestLocation.href)===zi(f.href),x=this.commitLocationPromise;if(this.commitLocationPromise=Dl(()=>{x==null||x.resolve()}),y&&p())this.load();else{let _=f,{maskedLocation:C,hashScrollIntoView:E}=_,T=pe(_,["maskedLocation","hashScrollIntoView"]);C&&(T=V(L({},C),{state:V(L({},C.state),{__tempKey:void 0,__tempLocation:V(L({},T),{search:T.searchStr,state:V(L({},T.state),{__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0})})})}),(w=(S=T.unmaskOnReload)!=null?S:this.options.unmaskOnReload)!=null&&w&&(T.state.__tempKey=this.tempLocationKey)),T.state.__hashScrollIntoViewOptions=(N=E!=null?E:this.options.defaultHashScrollIntoView)!=null?N:!0,this.shouldViewTransition=o,this.history[f.replace?"replace":"push"](T.publicHref,T.state,{ignoreBlocker:u})}return this.resetNextScroll=(R=f.resetScroll)!=null?R:!0,this.history.subscribers.size||this.load(),this.commitLocationPromise}),this.buildAndCommitLocation=(x={})=>{var _=x,{replace:o,resetScroll:u,hashScrollIntoView:f,viewTransition:m,ignoreBlocker:g,href:p}=_,y=pe(_,["replace","resetScroll","hashScrollIntoView","viewTransition","ignoreBlocker","href"]);if(p){const N=this.history.location.state.__TSR_index,R=dc(p,{__TSR_index:o?N:N+1}),C=new URL(R.pathname,this.origin),E=op(this.rewrite,C);y.to=E.pathname,y.search=this.options.parseSearch(R.search),y.hash=R.hash.slice(1)}const S=this.buildLocation(V(L({},y),{_includeValidateSearch:!0}));this.pendingBuiltLocation=S;const w=this.commitLocation(V(L({},S),{viewTransition:m,replace:o,resetScroll:u,hashScrollIntoView:f,ignoreBlocker:g}));return Promise.resolve().then(()=>{this.pendingBuiltLocation===S&&(this.pendingBuiltLocation=void 0)}),w},this.navigate=p=>Qe(this,null,function*(){var y=p,{to:o,reloadDocument:u,href:f,publicHref:m}=y,g=pe(y,["to","reloadDocument","href","publicHref"]);var _,S;let x=!1;if(f)try{new URL(`${f}`),x=!0}catch(w){}if(x&&!u&&(u=!0),u){if(o!==void 0||!f){const N=this.buildLocation(L({to:o},g));f=f!=null?f:N.publicHref,m=m!=null?m:N.publicHref}const w=!x&&m?m:f;if(bd(w))return Promise.resolve();if(!g.ignoreBlocker){const N=this.history,R=(S=(_=N.getBlockers)==null?void 0:_.call(N))!=null?S:[];for(const C of R)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(L({},g),{href:f,to:o,_isNavigate:!0}))}),this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const o=this.matchRoutes(this.latestLocation);this.__store.setState(u=>V(L({},u),{status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:o,cachedMatches:u.cachedMatches.filter(f=>!o.some(m=>m.id===f.id))}))},this.load=o=>Qe(this,null,function*(){let u,f,m;for(m=new Promise(p=>{this.startTransition(()=>Qe(this,null,function*(){var y;try{this.beforeLoad();const x=this.latestLocation,_=this.state.resolvedLocation;this.state.redirect||this.emit(L({type:"onBeforeNavigate"},wr({resolvedLocation:_,location:x}))),this.emit(L({type:"onBeforeLoad"},wr({resolvedLocation:_,location:x}))),yield fb({router:this,sync:o==null?void 0:o.sync,matches:this.state.pendingMatches,location:x,updateMatch:this.updateMatch,onReady:()=>Qe(this,null,function*(){this.startTransition(()=>{this.startViewTransition(()=>Qe(this,null,function*(){let S=[],w=[],N=[];ic(()=>{this.__store.setState(R=>{const C=R.matches,E=R.pendingMatches||R.matches;return S=C.filter(T=>!E.some(D=>D.id===T.id)),w=E.filter(T=>!C.some(D=>D.id===T.id)),N=E.filter(T=>C.some(D=>D.id===T.id)),V(L({},R),{isLoading:!1,loadedAt:Date.now(),matches:E,pendingMatches:void 0,cachedMatches:[...R.cachedMatches,...S.filter(T=>T.status!=="error"&&T.status!=="notFound")]})}),this.clearExpiredCache()}),[[S,"onLeave"],[w,"onEnter"],[N,"onStay"]].forEach(([R,C])=>{R.forEach(E=>{var T,D;(D=(T=this.looseRoutesById[E.routeId].options)[C])==null||D.call(T,E)})})}))})})})}catch(x){Ma(x)?(u=x,this.navigate(V(L({},u.options),{replace:!0,ignoreBlocker:!0}))):ua(x)&&(f=x),this.__store.setState(_=>V(L({},_),{statusCode:u?u.status:f?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(L({},p),{statusCode:g}))}),this.startViewTransition=o=>{var f;const u=(f=this.shouldViewTransition)!=null?f: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(wr({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 f=(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":"";f&&this.__store.setState(g=>{var p;return V(L({},g),{[f]:(p=g[f])==null?void 0:p.map(y=>y.id===o?u(y):y)})})})},this.getMatch=o=>{var f,m,g;const u=p=>p.id===o;return(g=(m=this.state.cachedMatches.find(u))!=null?m:(f=this.state.pendingMatches)==null?void 0:f.find(u))!=null?g:this.state.matches.find(u)},this.invalidate=o=>{const u=f=>{var m,g;return(g=(m=o==null?void 0:o.filter)==null?void 0:m.call(o,f))==null||g?L(V(L({},f),{invalid:!0}),o!=null&&o.forcePending||f.status==="error"||f.status==="notFound"?{status:"pending",error:void 0}:void 0):f};return this.__store.setState(f=>{var m;return V(L({},f),{matches:f.matches.map(u),cachedMatches:f.cachedMatches.map(u),pendingMatches:(m=f.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 f;const u=o.headers.get("Location");if(!o.options.href||o.options._builtLocation){const m=(f=o.options._builtLocation)!=null?f: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(f=>V(L({},f),{cachedMatches:f.cachedMatches.filter(m=>!u(m))})):this.__store.setState(f=>V(L({},f),{cachedMatches:[]}))},this.clearExpiredCache=()=>{const o=u=>{var y,x,_;const f=this.looseRoutesById[u.routeId];if(!f.options.loader)return!0;const m=(_=u.preload?(y=f.options.preloadGcTime)!=null?y:this.options.defaultPreloadGcTime:(x=f.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=$_,this.preloadRoute=o=>Qe(this,null,function*(){var p;const u=this.buildLocation(o);let f=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)]);ic(()=>{f.forEach(y=>{g.has(y.id)||this.__store.setState(x=>V(L({},x),{cachedMatches:[...x.cachedMatches,y]}))})});try{return f=yield fb({router:this,matches:f,location:u,preload:!0,updateMatch:(y,x)=>{m.has(y)?f=f.map(_=>_.id===y?x(_):_):this.updateMatch(y,x)}}),f}catch(y){if(Ma(y))return y.options.reloadDocument?void 0:yield this.preloadRoute(V(L({},y.options),{_fromLocation:u}));ua(y)||console.error(y);return}}),this.matchRoute=(o,u)=>{var x,_,S;const f=V(L({},o),{to:o.to?this.resolvePathWithBase(o.from||"",o.to):void 0,params:o.params||{},leaveParams:!0}),m=this.buildLocation(f);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=xj(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&&!Sr(y.rawParams,o.params,{partial:!0})?!1:(S=u==null?void 0:u.includeSearch)==null||S?Sr(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(L({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:Fj,parseSearch:(l=t.parseSearch)!=null?l:Uj})),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,l,o;return(t==null?void 0:t.id)?(o=(l=t.context)!=null?l:this.options.context)!=null?o:void 0:(r=this.options.context)!=null?r:void 0}matchRoutesInternal(t,n){var y,x,_,S,w,N,R,C,E,T;const i=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:l,parsedParams:o}=i;let{matchedRoutes:u}=i,f=!1;(r?r.path!=="/"&&l["**"]:zi(t.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:f=!0);const m=f?ak(this.options.notFoundMode,u):void 0,g=new Array(u.length),p=new Map(this.state.matches.map(D=>[D.routeId,D]));for(let D=0;D<u.length;D++){const O=u[D],F=g[D-1];let A,M,B;{const ae=(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=(_=hd(O.options.validateSearch,L({},ae)))!=null?_:void 0;A=L(L({},ae),xe),M=L(L({},ye),xe),B=void 0}catch(xe){let he=xe;if(xe instanceof Nd||(he=new Nd(xe.message,{cause:xe})),n!=null&&n.throwOnError)throw he;A=ae,M={},B=he}}const H=(N=(w=(S=O.options).loaderDeps)==null?void 0:w.call(S,{search:A}))!=null?N:"",G=H?JSON.stringify(H):"",{interpolatedPath:$,usedParams:q}=_m({path:O.fullPath,params:l,decoder:this.pathParamsDecoder,server:this.isServer}),P=O.id+$+G,Q=this.getMatch(P),K=p.get(O.id),W=(R=Q==null?void 0:Q._strictParams)!=null?R:q;let z;if(!Q)try{hb(O,q,o,W)}catch(ae){if(ua(ae)||Ma(ae)?z=ae:z=new Jj(ae.message,{cause:ae}),n!=null&&n.throwOnError)throw z}Object.assign(l,W);const se=K?"stay":"enter";let ue;if(Q)ue=V(L({},Q),{cause:se,params:(C=K==null?void 0:K.params)!=null?C:l,_strictParams:W,search:ca(K?K.search:Q.search,A),_strictSearch:M});else{const ae=O.options.loader||O.options.beforeLoad||O.lazyFn||H_(O)?"pending":"success";ue={id:P,ssr:O.options.ssr,index:D,routeId:O.id,params:(E=K==null?void 0:K.params)!=null?E:l,_strictParams:W,pathname:$,updatedAt:Date.now(),search:K?ca(K.search,A):A,_strictSearch:M,searchError:void 0,status:ae,isFetching:!1,error:void 0,paramsError:z,__routeContext:void 0,_nonReactive:{loadPromise:Dl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:se,loaderDeps:K?ca(K.loaderDeps,H):H,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:O.options.staticData||{},fullPath:O.fullPath}}n!=null&&n.preload||(ue.globalNotFound=m===O.id),ue.searchError=B;const I=this.getParentContext(F);ue.context=L(L(L({},I),ue.__routeContext),ue.__beforeLoadContext),g[D]=ue}for(let D=0;D<g.length;D++){const O=g[D],F=this.looseRoutesById[O.routeId],A=this.getMatch(O.id),M=p.get(O.routeId);if(O.params=M?ca(M.params,l):l,!A){const B=g[D-1],H=this.getParentContext(B);if(F.options.context){const G={deps:O.loaderDeps,params:O.params,context:H!=null?H:{},location:t,navigate:$=>this.navigate(V(L({},$),{_fromLocation:t})),buildLocation:this.buildLocation,cause:O.cause,abortController:O.abortController,preload:!!O.preload,matches:g,routeId:F.id};O.__routeContext=(T=F.options.context(G))!=null?T:void 0}O.context=L(L(L({},H),O.__routeContext),O.__beforeLoadContext)}}return g}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:i,parsedParams:r}=this.getMatchedRoutes(t.pathname),l=fc(n),o=L({},t.search);for(const g of n)try{Object.assign(o,hd(g.options.validateSearch,o))}catch(p){}const u=fc(this.state.matches),f=u&&u.routeId===l.id&&t.pathname===this.state.location.pathname;let m;if(f)m=u.params;else{const g=L({},i);for(const p of n)try{hb(p,i,r!=null?r:{},g)}catch(y){}m=g}return{matchedRoutes:n,fullPath:l.fullPath,search:o,params:m}}}class Nd extends Error{}class Jj extends Error{}function Wj(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function hd(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Nd("Async validation not supported");if(n.issues)throw new Nd(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 ek({pathname:e,routesById:t,processedTree:n}){const i={},r=zi(e);let l,o;const u=bj(r,n,!0);return u&&(l=u.route,Object.assign(i,u.rawParams),o=Object.assign({},u.parsedParams)),{matchedRoutes:(u==null?void 0:u.branch)||[t[ka]],routeParams:i,foundRoute:l,parsedParams:o}}function tk({search:e,dest:t,destRoutes:n,_includeValidateSearch:i}){return nk(n)(e,t,i!=null?i:!1)}function nk(e){var r;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const l of e){if("search"in l.options)(r=l.options.search)!=null&&r.middlewares&&t.middlewares.push(...l.options.search.middlewares);else if(l.options.preSearchFilters||l.options.postSearchFilters){const o=({search:u,next:f})=>{let m=u;"preSearchFilters"in l.options&&l.options.preSearchFilters&&(m=l.options.preSearchFilters.reduce((p,y)=>y(p),u));const g=f(m);return"postSearchFilters"in l.options&&l.options.postSearchFilters?l.options.postSearchFilters.reduce((p,y)=>y(p),g):g};t.middlewares.push(o)}if(l.options.validateSearch){const o=({search:u,next:f})=>{var g;const m=f(u);if(!t._includeValidateSearch)return m;try{return L(L({},m),(g=hd(l.options.validateSearch,m))!=null?g:void 0)}catch(p){return m}};t.middlewares.push(o)}}const n=({search:l})=>{const o=t.dest;return o.search?o.search===!0?l:As(o.search,l):{}};t.middlewares.push(n);const i=(l,o,u)=>{if(l>=u.length)return o;const f=u[l];return f({search:o,next:g=>i(l+1,g,u)})};return function(o,u,f){return t.dest=u,t._includeValidateSearch=f,i(0,o,t.middlewares)}}function ak(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 ka}function hb(e,t,n,i){var l,o;const r=(o=(l=e.options.params)==null?void 0:l.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 ik="Error preloading route! ☝️";class V_{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=ka:this.parentRoute||Ui(!1);let l=r?ka:i==null?void 0:i.path;l&&l!=="/"&&(l=O_(l));const o=(i==null?void 0:i.id)||l;let u=r?ka:dd([this.parentRoute.id===ka?"":this.parentRoute.id,o]);l===ka&&(l="/"),u!==ka&&(u=dd(["/",u]));const f=u===ka?"/":dd([this.parentRoute.fullPath,l]);this._path=l,this._id=u,this._fullPath=f,this._to=zi(f)},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=>Pj(L({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 sk extends V_{constructor(t){super(t)}}const Qu=typeof window!="undefined"?k.useLayoutEffect:k.useEffect;function wm(e){const t=k.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function rk(e,t,n={},i={}){k.useEffect(()=>{if(!e.current||i.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([l])=>{t(l)},n);return r.observe(e.current),()=>{r.disconnect()}},[t,n,i.disabled,e])}function lk(e){const t=k.useRef(null);return k.useImperativeHandle(e,()=>t.current,[]),t}function lg(e){var n;const t=(n=e.errorComponent)!=null?n:og;return d.jsx(ok,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:i,reset:r})=>i?k.createElement(t,{error:i,reset:r}):e.children})}class ok extends k.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 og({error:e}){const[t,n]=k.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 ck({children:e,fallback:t=null}){return G_()?d.jsx(re.Fragment,{children:e}):d.jsx(re.Fragment,{children:t})}function G_(){return re.useSyncExternalStore(uk,()=>!0,()=>!1)}function uk(){return()=>{}}var Nm={exports:{}},Cm={},Em={exports:{}},jm={};/**
|
|
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 mb;function dk(){if(mb)return jm;mb=1;var e=ng();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,l=e.useLayoutEffect,o=e.useDebugValue;function u(p,y){var x=y(),_=i({inst:{value:x,getSnapshot:y}}),S=_[0].inst,w=_[1];return l(function(){S.value=x,S.getSnapshot=y,f(S)&&w({inst:S})},[p,x,y]),r(function(){return f(S)&&w({inst:S}),p(function(){f(S)&&w({inst:S})})},[p]),o(x),x}function f(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 jm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,jm}var pb;function fk(){return pb||(pb=1,Em.exports=dk()),Em.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 gb;function hk(){if(gb)return Cm;gb=1;var e=ng(),t=fk();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,l=e.useRef,o=e.useEffect,u=e.useMemo,f=e.useDebugValue;return Cm.useSyncExternalStoreWithSelector=function(m,g,p,y,x){var _=l(null);if(_.current===null){var S={hasValue:!1,value:null};_.current=S}else S=_.current;_=u(function(){function N(D){if(!R){if(R=!0,C=D,D=y(D),x!==void 0&&S.hasValue){var O=S.value;if(x(O,D))return E=O}return E=D}if(O=E,i(C,D))return O;var F=y(D);return x!==void 0&&x(O,F)?(C=D,O):(C=D,E=F)}var R=!1,C,E,T=p===void 0?null:p;return[function(){return N(g())},T===null?void 0:function(){return N(T())}]},[g,p,y,x]);var w=r(m,_[0],_[1]);return o(function(){S.hasValue=!0,S.value=w},[w]),f(w),w},Cm}var yb;function mk(){return yb||(yb=1,Nm.exports=hk()),Nm.exports}var pk=mk();function gk(e,t=i=>i,n={}){var l;const i=(l=n.equal)!=null?l:yk;return pk.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,i)}function yk(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=vb(e);if(n.length!==vb(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 vb(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const km=k.createContext(null);function K_(){return typeof document=="undefined"?km:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=km,km)}function Oa(e){var n;const t=k.useContext(K_());return(n=e==null?void 0:e.warn)==null,t}function Aa(e){const t=Oa({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,i=k.useRef(void 0);return gk(n.__store,r=>{var l;if(e!=null&&e.select){if((l=e.structuralSharing)!=null?l:n.options.defaultStructuralSharing){const o=ca(i.current,e.select(r));return i.current=o,o}return e.select(r)}return r})}const Bd=k.createContext(void 0),vk=k.createContext(void 0);function ri(e){const t=k.useContext(e.from?vk:Bd);return Aa({select:i=>{var l;const r=i.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(Ui(!(((l=e.shouldThrow)==null||l)&&!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 cg(e){return ri({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ug(e){const i=e,{select:t}=i,n=pe(i,["select"]);return ri(V(L({},n),{select:r=>t?t(r.loaderDeps):r.loaderDeps}))}function Ud(e){return ri({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 kc(e){return ri({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function dg(e){const t=Oa();return k.useCallback(n=>{var i;return t.navigate(V(L({},n),{from:(i=n.from)!=null?i:e==null?void 0:e.from}))},[e==null?void 0:e.from,t])}var Y_=k_();function xk(e,t){var ve,Re,Ge;const n=Oa(),i=lk(t),de=e,{activeProps:r,inactiveProps:l,activeOptions:o,to:u,preload:f,preloadDelay:m,hashScrollIntoView:g,replace:p,startTransition:y,resetScroll:x,viewTransition:_,children:S,target:w,disabled:N,style:R,className:C,onClick:E,onFocus:T,onMouseEnter:D,onMouseLeave:O,onTouchStart:F,ignoreBlocker:A,params:M,search:B,hash:H,state:G,mask:$,reloadDocument:q,unsafeRelative:P,from:Q,_fromLocation:K}=de,W=pe(de,["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"]),z=G_(),se=Aa({select:Me=>Me.location.search,structuralSharing:!0}),ue=e.from,I=k.useMemo(()=>V(L({},e),{from:ue}),[n,se,ue,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ae=k.useMemo(()=>n.buildLocation(L({},I)),[n,I]),ye=ae.maskedLocation?ae.maskedLocation.publicHref:ae.publicHref,xe=ae.maskedLocation?ae.maskedLocation.external:ae.external,he=k.useMemo(()=>Ck(ye,xe,n.history,N),[N,xe,ye,n.history]),we=k.useMemo(()=>{if(he!=null&&he.external)return bd(he.href)?void 0:he.href;if(!Ek(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),bd(u)?void 0:u}catch(ze){}},[u,he]),Ce=Aa({select:Me=>{var ze;if(we)return!1;if(o!=null&&o.exact){if(!Ej(Me.location.pathname,ae.pathname,n.basepath))return!1}else{const Et=Sd(Me.location.pathname,n.basepath),wt=Sd(ae.pathname,n.basepath);if(!(Et.startsWith(wt)&&(Et.length===wt.length||Et[wt.length]==="/")))return!1}return((ze=o==null?void 0:o.includeSearch)==null||ze)&&!Sr(Me.location.search,ae.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?z&&Me.location.hash===ae.hash:!0}}),at=Ce?(ve=As(r,{}))!=null?ve:bk:Tm,Ze=Ce?Tm:(Re=As(l,{}))!=null?Re:Tm,Ht=[C,at.className,Ze.className].filter(Boolean).join(" "),ct=(R||at.style||Ze.style)&&L(L(L({},R),at.style),Ze.style),[Ie,Ke]=k.useState(!1),St=k.useRef(!1),Oe=e.reloadDocument||we?!1:f!=null?f:n.options.defaultPreload,pt=(Ge=m!=null?m:n.options.defaultPreloadDelay)!=null?Ge:0,$e=k.useCallback(()=>{n.preloadRoute(L({},I)).catch(Me=>{console.warn(Me),console.warn(ik)})},[n,I]),ha=k.useCallback(Me=>{Me!=null&&Me.isIntersecting&&$e()},[$e]);rk(i,ha,Nk,{disabled:!!N||Oe!=="viewport"}),k.useEffect(()=>{St.current||!N&&Oe==="render"&&($e(),St.current=!0)},[N,$e,Oe]);const Jn=Me=>{const ze=Me.currentTarget.getAttribute("target"),Et=w!==void 0?w:ze;if(!N&&!jk(Me)&&!Me.defaultPrevented&&(!Et||Et==="_self")&&Me.button===0){Me.preventDefault(),Y_.flushSync(()=>{Ke(!0)});const wt=n.subscribe("onResolved",()=>{wt(),Ke(!1)});n.navigate(V(L({},I),{replace:p,resetScroll:x,hashScrollIntoView:g,startTransition:y,viewTransition:_,ignoreBlocker:A}))}};if(we)return L(L(L(L(L(L(L(L(L(L(V(L({},W),{ref:i,href:we}),S&&{children:S}),w&&{target:w}),N&&{disabled:N}),R&&{style:R}),C&&{className:C}),E&&{onClick:E}),T&&{onFocus:T}),D&&{onMouseEnter:D}),O&&{onMouseLeave:O}),F&&{onTouchStart:F});const Ia=Me=>{N||Oe&&$e()},Ln=Ia,xt=Me=>{if(!(N||!Oe))if(!pt)$e();else{const ze=Me.target;if(Vo.has(ze))return;const Et=setTimeout(()=>{Vo.delete(ze),$e()},pt);Vo.set(ze,Et)}},za=Me=>{if(N||!Oe||!pt)return;const ze=Me.target,Et=Vo.get(ze);Et&&(clearTimeout(Et),Vo.delete(ze))};return L(L(L(L(L(V(L(L(L({},W),at),Ze),{href:he==null?void 0:he.href,ref:i,onClick:Go([E,Jn]),onFocus:Go([T,Ia]),onMouseEnter:Go([D,xt]),onMouseLeave:Go([O,za]),onTouchStart:Go([F,Ln]),disabled:!!N,target:w}),ct&&{style:ct}),Ht&&{className:Ht}),N&&_k),Ce&&Sk),z&&Ie&&wk)}const Tm={},bk={className:"active"},_k={role:"link","aria-disabled":!0},Sk={"data-status":"active","aria-current":"page"},wk={"data-transitioning":"transitioning"},Vo=new WeakMap,Nk={rootMargin:"100px"},Go=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ck(e,t,n,i){if(!i)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Ek(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const X_=k.forwardRef((e,t)=>{const u=e,{_asChild:n}=u,i=pe(u,["_asChild"]),f=xk(i,t),{type:r}=f,l=pe(f,["type"]),o=typeof i.children=="function"?i.children({isActive:l["data-status"]==="active"}):i.children;if(!n){const m=l,{disabled:g}=m,p=pe(m,["disabled"]);return k.createElement("a",p,o)}return k.createElement(n,l,o)});function jk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class kk extends V_{constructor(t){super(t),this.useMatch=n=>ri({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>ri(V(L({},n),{from:this.id,select:i=>n!=null&&n.select?n.select(i.context):i.context})),this.useSearch=n=>kc({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>Ud({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>ug(V(L({},n),{from:this.id})),this.useLoaderData=n=>cg(V(L({},n),{from:this.id})),this.useNavigate=()=>dg({from:this.fullPath}),this.Link=re.forwardRef((n,i)=>d.jsx(X_,L({ref:i,from:this.fullPath},n))),this.$$typeof=Symbol.for("react.memo")}}function fg(e){return new kk(e)}class Tk extends sk{constructor(t){super(t),this.useMatch=n=>ri({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>ri(V(L({},n),{from:this.id,select:i=>n!=null&&n.select?n.select(i.context):i.context})),this.useSearch=n=>kc({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>Ud({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>ug(V(L({},n),{from:this.id})),this.useLoaderData=n=>cg(V(L({},n),{from:this.id})),this.useNavigate=()=>dg({from:this.fullPath}),this.Link=re.forwardRef((n,i)=>d.jsx(X_,L({ref:i,from:this.fullPath},n))),this.$$typeof=Symbol.for("react.memo")}}function Rk(e){return new Tk(e)}function xb(e){return typeof e=="object"?new bb(e,{silent:!0}).createRoute(e):new bb(e,{silent:!0}).createRoute}class bb{constructor(t,n){this.path=t,this.createRoute=i=>{this.silent;const r=fg(i);return r.isRoot=!1,r},this.silent=n==null?void 0:n.silent}}class _b{constructor(t){this.useMatch=n=>ri({select:n==null?void 0:n.select,from:this.options.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>ri({from:this.options.id,select:i=>n!=null&&n.select?n.select(i.context):i.context}),this.useSearch=n=>kc({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.options.id}),this.useParams=n=>Ud({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>ug(V(L({},n),{from:this.options.id})),this.useLoaderData=n=>cg(V(L({},n),{from:this.options.id})),this.useNavigate=()=>{const n=Oa();return dg({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Sb(e){return typeof e=="object"?new _b(e):t=>new _b(L({id:e},t))}function Mk(){const e=Oa(),t=k.useRef({router:e,mounted:!1}),[n,i]=k.useState(!1),{hasPendingMatches:r,isLoading:l}=Aa({select:p=>({isLoading:p.isLoading,hasPendingMatches:p.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),o=wm(l),u=l||n||r,f=wm(u),m=l||r,g=wm(m);return e.startTransition=p=>{i(!0),k.startTransition(()=>{p(),i(!1)})},k.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 zi(e.latestLocation.publicHref)!==zi(y.publicHref)&&e.commitLocation(V(L({},y),{replace:!0})),()=>{p()}},[e,e.history]),Qu(()=>{if(typeof window!="undefined"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},Qe(null,null,function*(){try{yield e.load()}catch(y){console.error(y)}})},[e]),Qu(()=>{o&&!l&&e.emit(L({type:"onLoad"},wr(e.state)))},[o,e,l]),Qu(()=>{g&&!m&&e.emit(L({type:"onBeforeRouteMount"},wr(e.state)))},[m,g,e]),Qu(()=>{if(f&&!u){const p=wr(e.state);e.emit(L({type:"onResolved"},p)),e.__store.setState(y=>V(L({},y),{status:"idle",resolvedLocation:y.location})),p.hrefChanged&&Ij(e)}},[u,f,e]),null}function Ak(e){const t=Aa({select:n=>`not-found-${n.location.pathname}-${n.status}`});return d.jsx(lg,{getResetKey:()=>t,onCatch:(n,i)=>{var r;if(ua(n))(r=e.onCatch)==null||r.call(e,n,i);else throw n},errorComponent:({error:n})=>{var i;if(ua(n))return(i=e.fallback)==null?void 0:i.call(e,n);throw n},children:e.children})}function Lk(){return d.jsx("p",{children:"Not Found"})}function vl(e){return d.jsx(d.Fragment,{children:e.children})}function Q_(e,t,n){return t.options.notFoundComponent?d.jsx(t.options.notFoundComponent,L({},n)):e.options.defaultNotFoundComponent?d.jsx(e.options.defaultNotFoundComponent,L({},n)):d.jsx(Lk,{})}function Dk(){return Oa().isScrollRestoring,null}const Z_=k.memo(function({matchId:t}){var S,w,N,R,C,E,T,D,O;const n=Oa(),i=Aa({select:F=>{var B;const A=F.matches.findIndex(H=>H.id===t),M=F.matches[A];return Ui(M),{routeId:M.routeId,ssr:M.ssr,_displayPending:M._displayPending,resetKey:F.loadedAt,parentRouteId:(B=F.matches[A-1])==null?void 0:B.routeId}},structuralSharing:!0}),r=n.routesById[i.routeId],l=(S=r.options.pendingComponent)!=null?S:n.options.defaultPendingComponent,o=l?d.jsx(l,{}):null,u=(w=r.options.errorComponent)!=null?w:n.options.defaultErrorComponent,f=(N=r.options.onCatch)!=null?N:n.options.defaultOnCatch,m=r.isRoot?(C=r.options.notFoundComponent)!=null?C:(R=n.options.notFoundRoute)==null?void 0:R.options.component:r.options.notFoundComponent,g=i.ssr===!1||i.ssr==="data-only",p=(!r.isRoot||r.options.wrapInSuspense||g)&&((D=(E=r.options.wrapInSuspense)!=null?E:l)!=null?D:(T=r.options.errorComponent)!=null&&T.preload||g)?k.Suspense:vl,y=u?lg:vl,x=m?Ak:vl,_=r.isRoot&&(O=r.options.shellComponent)!=null?O:vl;return d.jsxs(_,{children:[d.jsx(Bd.Provider,{value:t,children:d.jsx(p,{fallback:o,children:d.jsx(y,{getResetKey:()=>i.resetKey,errorComponent:u||og,onCatch:(F,A)=>{if(ua(F))throw F;f==null||f(F,A)},children:d.jsx(x,{fallback:F=>{if(!m||F.routeId&&F.routeId!==i.routeId||!F.routeId&&!r.isRoot)throw F;return k.createElement(m,F)},children:g||i._displayPending?d.jsx(ck,{fallback:o,children:d.jsx(wb,{matchId:t})}):d.jsx(wb,{matchId:t})})})})}),i.parentRouteId===ka&&n.options.scrollRestoration?d.jsxs(d.Fragment,{children:[d.jsx(Ok,{}),d.jsx(Dk,{})]}):null]})});function Ok(){const e=Oa(),t=k.useRef(void 0);return d.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit(L({type:"onRendered"},wr(e.state))),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const wb=k.memo(function({matchId:t}){var f,m,g,p,y;const n=Oa(),{match:i,key:r,routeId:l}=Aa({select:x=>{var C;const _=x.matches.find(E=>E.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[l],u=k.useMemo(()=>{var _;const x=(_=o.options.component)!=null?_:n.options.defaultComponent;return x?d.jsx(x,{},r):d.jsx(J_,{})},[r,o.options.component,n.options.defaultComponent]);if(i._displayPending)throw(f=n.getMatch(i.id))==null?void 0:f._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=Dl();_._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 Ui(ua(i.error)),Q_(n,o,i.error);if(i.status==="redirected")throw Ui(Ma(i.error)),(y=n.getMatch(i.id))==null?void 0:y._nonReactive.loadPromise;if(i.status==="error")throw i.error;return u}),J_=k.memo(function(){const t=Oa(),n=k.useContext(Bd),i=Aa({select:m=>{var g;return(g=m.matches.find(p=>p.id===n))==null?void 0:g.routeId}}),r=t.routesById[i],l=Aa({select:m=>{const p=m.matches.find(y=>y.id===n);return Ui(p),p.globalNotFound}}),o=Aa({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(l)return Q_(t,r,void 0);if(!o)return null;const f=d.jsx(Z_,{matchId:o});return i===ka?d.jsx(k.Suspense,{fallback:u,children:f}):f});function Ik(){var o;const e=Oa(),n=(o=e.routesById[ka].options.pendingComponent)!=null?o:e.options.defaultPendingComponent,i=n?d.jsx(n,{}):null,r=typeof document!="undefined"&&e.ssr?vl:k.Suspense,l=d.jsxs(r,{fallback:i,children:[d.jsx(Mk,{}),d.jsx(zk,{})]});return e.options.InnerWrap?d.jsx(e.options.InnerWrap,{children:l}):l}function zk(){const e=Oa(),t=Aa({select:r=>{var l;return(l=r.matches[0])==null?void 0:l.id}}),n=Aa({select:r=>r.loadedAt}),i=t?d.jsx(Z_,{matchId:t}):null;return d.jsx(Bd.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?i:d.jsx(lg,{getResetKey:()=>n,errorComponent:og,onCatch:r=>{r.message||r.toString()},children:i})})}const Bk=e=>new Uk(e);class Uk extends Zj{constructor(t){super(t)}}typeof globalThis!="undefined"?(globalThis.createFileRoute=xb,globalThis.createLazyFileRoute=Sb):typeof window!="undefined"&&(window.createFileRoute=xb,window.createLazyFileRoute=Sb);function Fk(i){var r=i,{router:e,children:t}=r,n=pe(r,["router","children"]);Object.keys(n).length>0&&e.update(V(L(L({},e.options),n),{context:L(L({},e.options.context),n.context)}));const l=K_(),o=d.jsx(l.Provider,{value:e,children:t});return e.options.Wrap?d.jsx(e.options.Wrap,{children:o}):o}function $k(n){var i=n,{router:e}=i,t=pe(i,["router"]);return d.jsx(Fk,V(L({router:e},t),{children:d.jsx(Ik,{})}))}var Hl=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(){}},Hk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ws,tg,y_,Pk=(y_=class{constructor(){Be(this,ws,Hk);Be(this,tg,!1)}setTimeoutProvider(e){ke(this,ws,e)}setTimeout(e,t){return X(this,ws).setTimeout(e,t)}clearTimeout(e){X(this,ws).clearTimeout(e)}setInterval(e,t){return X(this,ws).setInterval(e,t)}clearInterval(e){X(this,ws).clearInterval(e)}},ws=new WeakMap,tg=new WeakMap,y_),fr=new Pk;function qk(e){setTimeout(e,0)}var Tr=typeof window=="undefined"||"Deno"in globalThis;function Mn(){}function Vk(e,t){return typeof e=="function"?e(t):e}function cp(e){return typeof e=="number"&&e>=0&&e!==1/0}function W_(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Os(e,t){return typeof e=="function"?e(t):e}function Ta(e,t){return typeof e=="function"?e(t):e}function Nb(e,t){const{type:n="all",exact:i,fetchStatus:r,predicate:l,queryKey:o,stale:u}=e;if(o){if(i){if(t.queryHash!==hg(o,t.options))return!1}else if(!mc(t.queryKey,o))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||r&&r!==t.state.fetchStatus||l&&!l(t))}function Cb(e,t){const{exact:n,status:i,predicate:r,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(Rr(t.options.mutationKey)!==Rr(l))return!1}else if(!mc(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||r&&!r(t))}function hg(e,t){return((t==null?void 0:t.queryKeyHashFn)||Rr)(e)}function Rr(e){return JSON.stringify(e,(t,n)=>up(n)?Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{}):n)}function mc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>mc(e[n],t[n])):!1}var Gk=Object.prototype.hasOwnProperty;function eS(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=Eb(e)&&Eb(t);if(!i&&!(up(e)&&up(t)))return t;const l=(i?e:Object.keys(e)).length,o=i?t:Object.keys(t),u=o.length,f=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){f[p]=y,(i?g<l:Gk.call(e,p))&&m++;continue}if(y===null||x===null||typeof y!="object"||typeof x!="object"){f[p]=x;continue}const _=eS(y,x,n+1);f[p]=_,_===y&&m++}return l===u&&m===l?e:f}function Cd(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 Eb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function up(e){if(!jb(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jb(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jb(e){return Object.prototype.toString.call(e)==="[object Object]"}function Kk(e){return new Promise(t=>{fr.setTimeout(t,e)})}function dp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?eS(e,t):t}function Yk(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function Xk(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var mg=Symbol();function tS(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===mg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function pg(e,t){return typeof e=="function"?e(...t):!!e}function Qk(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 hr,Ns,Sl,v_,Zk=(v_=class extends Hl{constructor(){super();Be(this,hr);Be(this,Ns);Be(this,Sl);ke(this,Sl,t=>{if(!Tr&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){X(this,Ns)||this.setEventListener(X(this,Sl))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,Ns))==null||t.call(this),ke(this,Ns,void 0))}setEventListener(t){var n;ke(this,Sl,t),(n=X(this,Ns))==null||n.call(this),ke(this,Ns,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){X(this,hr)!==t&&(ke(this,hr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof X(this,hr)=="boolean"?X(this,hr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hr=new WeakMap,Ns=new WeakMap,Sl=new WeakMap,v_),gg=new Zk;function fp(){let e,t;const n=new Promise((r,l)=>{e=r,t=l});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 Jk=qk;function Wk(){let e=[],t=0,n=u=>{u()},i=u=>{u()},r=Jk;const l=u=>{t?e.push(u):r(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&r(()=>{i(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;t++;try{f=u()}finally{t--,t||o()}return f},batchCalls:u=>(...f)=>{l(()=>{u(...f)})},schedule:l,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{r=u}}}var cn=Wk(),wl,Cs,Nl,x_,eT=(x_=class extends Hl{constructor(){super();Be(this,wl,!0);Be(this,Cs);Be(this,Nl);ke(this,Nl,t=>{if(!Tr&&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,Cs)||this.setEventListener(X(this,Nl))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,Cs))==null||t.call(this),ke(this,Cs,void 0))}setEventListener(t){var n;ke(this,Nl,t),(n=X(this,Cs))==null||n.call(this),ke(this,Cs,t(this.setOnline.bind(this)))}setOnline(t){X(this,wl)!==t&&(ke(this,wl,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return X(this,wl)}},wl=new WeakMap,Cs=new WeakMap,Nl=new WeakMap,x_),Ed=new eT;function tT(e){return Math.min(1e3*Gu(2,e),3e4)}function nS(e){return(e!=null?e:"online")==="online"?Ed.isOnline():!0}var hp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function aS(e){let t=!1,n=0,i;const r=fp(),l=()=>r.status!=="pending",o=S=>{var w;if(!l()){const N=new hp(S);y(N),(w=e.onCancel)==null||w.call(e,N)}},u=()=>{t=!0},f=()=>{t=!1},m=()=>gg.isFocused()&&(e.networkMode==="always"||Ed.isOnline())&&e.canRun(),g=()=>nS(e.networkMode)&&e.canRun(),p=S=>{l()||(i==null||i(),r.resolve(S))},y=S=>{l()||(i==null||i(),r.reject(S))},x=()=>new Promise(S=>{var w;i=N=>{(l()||m())&&S(N)},(w=e.onPause)==null||w.call(e)}).then(()=>{var S;i=void 0,l()||(S=e.onContinue)==null||S.call(e)}),_=()=>{if(l())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 D,O,F;if(l())return;const R=(D=e.retry)!=null?D:Tr?0:3,C=(O=e.retryDelay)!=null?O:tT,E=typeof C=="function"?C(n,N):C,T=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,N);if(t||!T){y(N);return}n++,(F=e.onFail)==null||F.call(e,n,N),Kk(E).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:f,canStart:g,start:()=>(g()?_():x().then(_),r)}}var mr,b_,iS=(b_=class{constructor(){Be(this,mr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cp(this.gcTime)&&ke(this,mr,fr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e!=null?e:Tr?1/0:300*1e3)}clearGcTimeout(){X(this,mr)&&(fr.clearTimeout(X(this,mr)),ke(this,mr,void 0))}},mr=new WeakMap,b_),pr,Cl,ja,gr,pn,wc,yr,Pa,Mi,__,nT=(__=class extends iS{constructor(t){var n;super();Be(this,Pa);Be(this,pr);Be(this,Cl);Be(this,ja);Be(this,gr);Be(this,pn);Be(this,wc);Be(this,yr);ke(this,yr,!1),ke(this,wc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ke(this,gr,t.client),ke(this,ja,X(this,gr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ke(this,pr,Tb(this.options)),this.state=(n=t.state)!=null?n:X(this,pr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=X(this,pn))==null?void 0:t.promise}setOptions(t){if(this.options=L(L({},X(this,wc)),t),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Tb(this.options);n.data!==void 0&&(this.setState(kb(n.data,n.dataUpdatedAt)),ke(this,pr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&X(this,ja).remove(this)}setData(t,n){const i=dp(this.state.data,t,this.options);return nt(this,Pa,Mi).call(this,{data:i,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),i}setState(t,n){nt(this,Pa,Mi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var i,r;const n=(i=X(this,pn))==null?void 0:i.promise;return(r=X(this,pn))==null||r.cancel(t),n?n.then(Mn).catch(Mn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(X(this,pr))}isActive(){return this.observers.some(t=>Ta(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Os(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:!W_(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,pn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,pn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),X(this,ja).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,pn)&&(X(this,yr)?X(this,pn).cancel({revert:!0}):X(this,pn).cancelRetry()),this.scheduleGc()),X(this,ja).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||nt(this,Pa,Mi).call(this,{type:"invalidate"})}fetch(t,n){return Qe(this,null,function*(){var f,m,g,p,y,x,_,S,w,N,R,C;if(this.state.fetchStatus!=="idle"&&((f=X(this,pn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(X(this,pn))return X(this,pn).continueRetry(),X(this,pn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(T=>T.options.queryFn);E&&this.setOptions(E.options)}const i=new AbortController,r=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(ke(this,yr,!0),i.signal)})},l=()=>{const E=tS(this.options,n),D=(()=>{const O={client:X(this,gr),queryKey:this.queryKey,meta:this.meta};return r(O),O})();return ke(this,yr,!1),this.options.persister?this.options.persister(E,D,this):E(D)},u=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:X(this,gr),state:this.state,fetchFn:l};return r(E),E})();(m=this.options.behavior)==null||m.onFetch(u,this),ke(this,Cl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=u.fetchOptions)==null?void 0:g.meta))&&nt(this,Pa,Mi).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),ke(this,pn,aS({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:E=>{E instanceof hp&&E.revert&&this.setState(V(L({},X(this,Cl)),{fetchStatus:"idle"})),i.abort()},onFail:(E,T)=>{nt(this,Pa,Mi).call(this,{type:"failed",failureCount:E,error:T})},onPause:()=>{nt(this,Pa,Mi).call(this,{type:"pause"})},onContinue:()=>{nt(this,Pa,Mi).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const E=yield X(this,pn).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(y=X(this,ja).config).onSuccess)==null||x.call(y,E,this),(S=(_=X(this,ja).config).onSettled)==null||S.call(_,E,this.state.error,this),E}catch(E){if(E instanceof hp){if(E.silent)return X(this,pn).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw nt(this,Pa,Mi).call(this,{type:"error",error:E}),(N=(w=X(this,ja).config).onError)==null||N.call(w,E,this),(C=(R=X(this,ja).config).onSettled)==null||C.call(R,this.state.data,E,this),E}finally{this.scheduleGc()}})}},pr=new WeakMap,Cl=new WeakMap,ja=new WeakMap,gr=new WeakMap,pn=new WeakMap,wc=new WeakMap,yr=new WeakMap,Pa=new WeakSet,Mi=function(t){const n=i=>{var r;switch(t.type){case"failed":return V(L({},i),{fetchFailureCount:t.failureCount,fetchFailureReason:t.error});case"pause":return V(L({},i),{fetchStatus:"paused"});case"continue":return V(L({},i),{fetchStatus:"fetching"});case"fetch":return V(L(L({},i),sS(i.data,this.options)),{fetchMeta:(r=t.meta)!=null?r:null});case"success":const l=L(V(L(L({},i),kb(t.data,t.dataUpdatedAt)),{dataUpdateCount:i.dataUpdateCount+1}),!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null});return ke(this,Cl,t.manual?l:void 0),l;case"error":const o=t.error;return V(L({},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(L({},i),{isInvalidated:!0});case"setState":return L(L({},i),t.state)}};this.state=n(this.state),cn.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),X(this,ja).notify({query:this,type:"updated",action:t})})},__);function sS(e,t){return L({fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nS(t.networkMode)?"fetching":"paused"},e===void 0&&{error:null,status:"pending"})}function kb(e,t){return{data:e,dataUpdatedAt:t!=null?t:Date.now(),error:null,isInvalidated:!1,status:"success"}}function Tb(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 Vn,dt,Nc,Rn,vr,El,Ai,Es,Cc,jl,kl,xr,br,js,Tl,Ct,Jo,mp,pp,gp,yp,vp,xp,bp,rS,S_,aT=(S_=class extends Hl{constructor(t,n){super();Be(this,Ct);Be(this,Vn);Be(this,dt);Be(this,Nc);Be(this,Rn);Be(this,vr);Be(this,El);Be(this,Ai);Be(this,Es);Be(this,Cc);Be(this,jl);Be(this,kl);Be(this,xr);Be(this,br);Be(this,js);Be(this,Tl,new Set);this.options=n,ke(this,Vn,t),ke(this,Es,null),ke(this,Ai,fp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,dt).addObserver(this),Rb(X(this,dt),this.options)?nt(this,Ct,Jo).call(this):this.updateResult(),nt(this,Ct,yp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _p(X(this,dt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _p(X(this,dt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,nt(this,Ct,vp).call(this),nt(this,Ct,xp).call(this),X(this,dt).removeObserver(this)}setOptions(t){const n=this.options,i=X(this,dt);if(this.options=X(this,Vn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ta(this.options.enabled,X(this,dt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");nt(this,Ct,bp).call(this),X(this,dt).setOptions(this.options),n._defaulted&&!Cd(this.options,n)&&X(this,Vn).getQueryCache().notify({type:"observerOptionsUpdated",query:X(this,dt),observer:this});const r=this.hasListeners();r&&Mb(X(this,dt),i,this.options,n)&&nt(this,Ct,Jo).call(this),this.updateResult(),r&&(X(this,dt)!==i||Ta(this.options.enabled,X(this,dt))!==Ta(n.enabled,X(this,dt))||Os(this.options.staleTime,X(this,dt))!==Os(n.staleTime,X(this,dt)))&&nt(this,Ct,mp).call(this);const l=nt(this,Ct,pp).call(this);r&&(X(this,dt)!==i||Ta(this.options.enabled,X(this,dt))!==Ta(n.enabled,X(this,dt))||l!==X(this,js))&&nt(this,Ct,gp).call(this,l)}getOptimisticResult(t){const n=X(this,Vn).getQueryCache().build(X(this,Vn),t),i=this.createResult(n,t);return sT(this,i)&&(ke(this,Rn,i),ke(this,El,this.options),ke(this,vr,X(this,dt).state)),i}getCurrentResult(){return X(this,Rn)}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,Ai).status==="pending"&&X(this,Ai).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,r))})}trackProp(t){X(this,Tl).add(t)}getCurrentQuery(){return X(this,dt)}refetch(n={}){var t=pe(n,[]);return this.fetch(L({},t))}fetchOptimistic(t){const n=X(this,Vn).defaultQueryOptions(t),i=X(this,Vn).getQueryCache().build(X(this,Vn),n);return i.fetch().then(()=>this.createResult(i,n))}fetch(t){var n;return nt(this,Ct,Jo).call(this,V(L({},t),{cancelRefetch:(n=t.cancelRefetch)!=null?n:!0})).then(()=>(this.updateResult(),X(this,Rn)))}createResult(t,n){var A;const i=X(this,dt),r=this.options,l=X(this,Rn),o=X(this,vr),u=X(this,El),m=t!==i?t.state:X(this,Nc),{state:g}=t;let p=L({},g),y=!1,x;if(n._optimisticResults){const M=this.hasListeners(),B=!M&&Rb(t,n),H=M&&Mb(t,i,n,r);(B||H)&&(p=L(L({},p),sS(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 M;l!=null&&l.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(M=l.data,N=!0):M=typeof n.placeholderData=="function"?n.placeholderData((A=X(this,kl))==null?void 0:A.state.data,X(this,kl)):n.placeholderData,M!==void 0&&(w="success",x=dp(l==null?void 0:l.data,M,n),y=!0)}if(n.select&&x!==void 0&&!N)if(l&&x===(o==null?void 0:o.data)&&n.select===X(this,Cc))x=X(this,jl);else try{ke(this,Cc,n.select),x=n.select(x),x=dp(l==null?void 0:l.data,x,n),ke(this,jl,x),ke(this,Es,null)}catch(M){ke(this,Es,M)}X(this,Es)&&(_=X(this,Es),x=X(this,jl),S=Date.now(),w="error");const R=p.fetchStatus==="fetching",C=w==="pending",E=w==="error",T=C&&R,D=x!==void 0,F={status:w,fetchStatus:p.fetchStatus,isPending:C,isSuccess:w==="success",isError:E,isInitialLoading:T,isLoading:T,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:R,isRefetching:R&&!C,isLoadingError:E&&!D,isPaused:p.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:E&&D,isStale:yg(t,n),refetch:this.refetch,promise:X(this,Ai),isEnabled:Ta(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=F.data!==void 0,B=F.status==="error"&&!M,H=q=>{B?q.reject(F.error):M&&q.resolve(F.data)},G=()=>{const q=ke(this,Ai,F.promise=fp());H(q)},$=X(this,Ai);switch($.status){case"pending":t.queryHash===i.queryHash&&H($);break;case"fulfilled":(B||F.data!==$.value)&&G();break;case"rejected":(!B||F.error!==$.reason)&&G();break}}return F}updateResult(){const t=X(this,Rn),n=this.createResult(X(this,dt),this.options);if(ke(this,vr,X(this,dt).state),ke(this,El,this.options),X(this,vr).data!==void 0&&ke(this,kl,X(this,dt)),Cd(n,t))return;ke(this,Rn,n);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,l=typeof r=="function"?r():r;if(l==="all"||!l&&!X(this,Tl).size)return!0;const o=new Set(l!=null?l:X(this,Tl));return this.options.throwOnError&&o.add("error"),Object.keys(X(this,Rn)).some(u=>{const f=u;return X(this,Rn)[f]!==t[f]&&o.has(f)})};nt(this,Ct,rS).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&nt(this,Ct,yp).call(this)}},Vn=new WeakMap,dt=new WeakMap,Nc=new WeakMap,Rn=new WeakMap,vr=new WeakMap,El=new WeakMap,Ai=new WeakMap,Es=new WeakMap,Cc=new WeakMap,jl=new WeakMap,kl=new WeakMap,xr=new WeakMap,br=new WeakMap,js=new WeakMap,Tl=new WeakMap,Ct=new WeakSet,Jo=function(t){nt(this,Ct,bp).call(this);let n=X(this,dt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Mn)),n},mp=function(){nt(this,Ct,vp).call(this);const t=Os(this.options.staleTime,X(this,dt));if(Tr||X(this,Rn).isStale||!cp(t))return;const i=W_(X(this,Rn).dataUpdatedAt,t)+1;ke(this,xr,fr.setTimeout(()=>{X(this,Rn).isStale||this.updateResult()},i))},pp=function(){var t;return(t=typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,dt)):this.options.refetchInterval)!=null?t:!1},gp=function(t){nt(this,Ct,xp).call(this),ke(this,js,t),!(Tr||Ta(this.options.enabled,X(this,dt))===!1||!cp(X(this,js))||X(this,js)===0)&&ke(this,br,fr.setInterval(()=>{(this.options.refetchIntervalInBackground||gg.isFocused())&&nt(this,Ct,Jo).call(this)},X(this,js)))},yp=function(){nt(this,Ct,mp).call(this),nt(this,Ct,gp).call(this,nt(this,Ct,pp).call(this))},vp=function(){X(this,xr)&&(fr.clearTimeout(X(this,xr)),ke(this,xr,void 0))},xp=function(){X(this,br)&&(fr.clearInterval(X(this,br)),ke(this,br,void 0))},bp=function(){const t=X(this,Vn).getQueryCache().build(X(this,Vn),this.options);if(t===X(this,dt))return;const n=X(this,dt);ke(this,dt,t),ke(this,Nc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},rS=function(t){cn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(X(this,Rn))}),X(this,Vn).getQueryCache().notify({query:X(this,dt),type:"observerResultsUpdated"})})},S_);function iT(e,t){return Ta(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Rb(e,t){return iT(e,t)||e.state.data!==void 0&&_p(e,t,t.refetchOnMount)}function _p(e,t,n){if(Ta(t.enabled,e)!==!1&&Os(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&yg(e,t)}return!1}function Mb(e,t,n,i){return(e!==t||Ta(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&yg(e,n)}function yg(e,t){return Ta(t.enabled,e)!==!1&&e.isStaleByTime(Os(t.staleTime,e))}function sT(e,t){return!Cd(e.getCurrentResult(),t)}function Ab(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,l=((x=t.state.data)==null?void 0:x.pages)||[],o=((_=t.state.data)==null?void 0:_.pageParams)||[];let u={pages:[],pageParams:[]},f=0;const m=()=>Qe(null,null,function*(){var C;let S=!1;const w=E=>{Qk(E,()=>t.signal,()=>S=!0)},N=tS(t.options,t.fetchOptions),R=(E,T,D)=>Qe(null,null,function*(){if(S)return Promise.reject();if(T==null&&E.pages.length)return Promise.resolve(E);const F=(()=>{const H={client:t.client,queryKey:t.queryKey,pageParam:T,direction:D?"backward":"forward",meta:t.options.meta};return w(H),H})(),A=yield N(F),{maxPages:M}=t.options,B=D?Xk:Yk;return{pages:B(E.pages,A,M),pageParams:B(E.pageParams,T,M)}});if(r&&l.length){const E=r==="backward",T=E?rT:Lb,D={pages:l,pageParams:o},O=T(i,D);u=yield R(D,O,E)}else{const E=e!=null?e:l.length;do{const T=f===0?(C=o[0])!=null?C:i.initialPageParam:Lb(i,u);if(f>0&&T==null)break;u=yield R(u,T),f++}while(f<E)}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 Lb(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 rT(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 Ec,ni,wn,_r,ai,_s,w_,lT=(w_=class extends iS{constructor(t){super();Be(this,ai);Be(this,Ec);Be(this,ni);Be(this,wn);Be(this,_r);ke(this,Ec,t.client),this.mutationId=t.mutationId,ke(this,wn,t.mutationCache),ke(this,ni,[]),this.state=t.state||lS(),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,ni).includes(t)||(X(this,ni).push(t),this.clearGcTimeout(),X(this,wn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ke(this,ni,X(this,ni).filter(n=>n!==t)),this.scheduleGc(),X(this,wn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,ni).length||(this.state.status==="pending"?this.scheduleGc():X(this,wn).remove(this))}continue(){var t,n;return(n=(t=X(this,_r))==null?void 0:t.continue())!=null?n:this.execute(this.state.variables)}execute(t){return Qe(this,null,function*(){var o,u,f,m,g,p,y,x,_,S,w,N,R,C,E,T,D,O,F;const n=()=>{nt(this,ai,_s).call(this,{type:"continue"})},i={client:X(this,Ec),meta:this.options.meta,mutationKey:this.options.mutationKey};ke(this,_r,aS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(A,M)=>{nt(this,ai,_s).call(this,{type:"failed",failureCount:A,error:M})},onPause:()=>{nt(this,ai,_s).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,wn).canRun(this)}));const r=this.state.status==="pending",l=!X(this,_r).canStart();try{if(r)n();else{nt(this,ai,_s).call(this,{type:"pending",variables:t,isPaused:l}),X(this,wn).config.onMutate&&(yield X(this,wn).config.onMutate(t,this,i));const M=yield(f=(u=this.options).onMutate)==null?void 0:f.call(u,t,i);M!==this.state.context&&nt(this,ai,_s).call(this,{type:"pending",context:M,variables:t,isPaused:l})}const A=yield X(this,_r).start();return yield(g=(m=X(this,wn).config).onSuccess)==null?void 0:g.call(m,A,t,this.state.context,this,i),yield(y=(p=this.options).onSuccess)==null?void 0:y.call(p,A,t,this.state.context,i),yield(_=(x=X(this,wn).config).onSettled)==null?void 0:_.call(x,A,null,this.state.variables,this.state.context,this,i),yield(w=(S=this.options).onSettled)==null?void 0:w.call(S,A,null,t,this.state.context,i),nt(this,ai,_s).call(this,{type:"success",data:A}),A}catch(A){try{yield(R=(N=X(this,wn).config).onError)==null?void 0:R.call(N,A,t,this.state.context,this,i)}catch(M){Promise.reject(M)}try{yield(E=(C=this.options).onError)==null?void 0:E.call(C,A,t,this.state.context,i)}catch(M){Promise.reject(M)}try{yield(D=(T=X(this,wn).config).onSettled)==null?void 0:D.call(T,void 0,A,this.state.variables,this.state.context,this,i)}catch(M){Promise.reject(M)}try{yield(F=(O=this.options).onSettled)==null?void 0:F.call(O,void 0,A,t,this.state.context,i)}catch(M){Promise.reject(M)}throw nt(this,ai,_s).call(this,{type:"error",error:A}),A}finally{X(this,wn).runNext(this)}})}},Ec=new WeakMap,ni=new WeakMap,wn=new WeakMap,_r=new WeakMap,ai=new WeakSet,_s=function(t){const n=i=>{switch(t.type){case"failed":return V(L({},i),{failureCount:t.failureCount,failureReason:t.error});case"pause":return V(L({},i),{isPaused:!0});case"continue":return V(L({},i),{isPaused:!1});case"pending":return V(L({},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(L({},i),{data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1});case"error":return V(L({},i),{data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"})}};this.state=n(this.state),cn.batch(()=>{X(this,ni).forEach(i=>{i.onMutationUpdate(t)}),X(this,wn).notify({mutation:this,type:"updated",action:t})})},w_);function lS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Li,qa,jc,N_,oT=(N_=class extends Hl{constructor(t={}){super();Be(this,Li);Be(this,qa);Be(this,jc);this.config=t,ke(this,Li,new Set),ke(this,qa,new Map),ke(this,jc,0)}build(t,n,i){const r=new lT({client:t,mutationCache:this,mutationId:++Ku(this,jc)._,options:t.defaultMutationOptions(n),state:i});return this.add(r),r}add(t){X(this,Li).add(t);const n=Zu(t);if(typeof n=="string"){const i=X(this,qa).get(n);i?i.push(t):X(this,qa).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(X(this,Li).delete(t)){const n=Zu(t);if(typeof n=="string"){const i=X(this,qa).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,qa).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Zu(t);if(typeof n=="string"){const i=X(this,qa).get(n),r=i==null?void 0:i.find(l=>l.state.status==="pending");return!r||r===t}else return!0}runNext(t){var i,r;const n=Zu(t);if(typeof n=="string"){const l=(i=X(this,qa).get(n))==null?void 0:i.find(o=>o!==t&&o.state.isPaused);return(r=l==null?void 0:l.continue())!=null?r:Promise.resolve()}else return Promise.resolve()}clear(){cn.batch(()=>{X(this,Li).forEach(t=>{this.notify({type:"removed",mutation:t})}),X(this,Li).clear(),X(this,qa).clear()})}getAll(){return Array.from(X(this,Li))}find(t){const n=L({exact:!0},t);return this.getAll().find(i=>Cb(n,i))}findAll(t={}){return this.getAll().filter(n=>Cb(t,n))}notify(t){cn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return cn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Mn))))}},Li=new WeakMap,qa=new WeakMap,jc=new WeakMap,N_);function Zu(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Di,ks,Gn,Oi,Bi,md,Sp,C_,cT=(C_=class extends Hl{constructor(n,i){super();Be(this,Bi);Be(this,Di);Be(this,ks);Be(this,Gn);Be(this,Oi);ke(this,Di,n),this.setOptions(i),this.bindMethods(),nt(this,Bi,md).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,Di).defaultMutationOptions(n),Cd(this.options,i)||X(this,Di).getMutationCache().notify({type:"observerOptionsUpdated",mutation:X(this,Gn),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&Rr(i.mutationKey)!==Rr(this.options.mutationKey)?this.reset():((r=X(this,Gn))==null?void 0:r.state.status)==="pending"&&X(this,Gn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=X(this,Gn))==null||n.removeObserver(this)}onMutationUpdate(n){nt(this,Bi,md).call(this),nt(this,Bi,Sp).call(this,n)}getCurrentResult(){return X(this,ks)}reset(){var n;(n=X(this,Gn))==null||n.removeObserver(this),ke(this,Gn,void 0),nt(this,Bi,md).call(this),nt(this,Bi,Sp).call(this)}mutate(n,i){var r;return ke(this,Oi,i),(r=X(this,Gn))==null||r.removeObserver(this),ke(this,Gn,X(this,Di).getMutationCache().build(X(this,Di),this.options)),X(this,Gn).addObserver(this),X(this,Gn).execute(n)}},Di=new WeakMap,ks=new WeakMap,Gn=new WeakMap,Oi=new WeakMap,Bi=new WeakSet,md=function(){var i,r;const n=(r=(i=X(this,Gn))==null?void 0:i.state)!=null?r:lS();ke(this,ks,V(L({},n),{isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset}))},Sp=function(n){cn.batch(()=>{var i,r,l,o,u,f,m,g;if(X(this,Oi)&&this.hasListeners()){const p=X(this,ks).variables,y=X(this,ks).context,x={client:X(this,Di),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(r=(i=X(this,Oi)).onSuccess)==null||r.call(i,n.data,p,y,x)}catch(_){Promise.reject(_)}try{(o=(l=X(this,Oi)).onSettled)==null||o.call(l,n.data,null,p,y,x)}catch(_){Promise.reject(_)}}else if((n==null?void 0:n.type)==="error"){try{(f=(u=X(this,Oi)).onError)==null||f.call(u,n.error,p,y,x)}catch(_){Promise.reject(_)}try{(g=(m=X(this,Oi)).onSettled)==null||g.call(m,void 0,n.error,p,y,x)}catch(_){Promise.reject(_)}}}this.listeners.forEach(p=>{p(X(this,ks))})})},C_),ii,E_,uT=(E_=class extends Hl{constructor(t={}){super();Be(this,ii);this.config=t,ke(this,ii,new Map)}build(t,n,i){var u;const r=n.queryKey,l=(u=n.queryHash)!=null?u:hg(r,n);let o=this.get(l);return o||(o=new nT({client:t,queryKey:r,queryHash:l,options:t.defaultQueryOptions(n),state:i,defaultOptions:t.getQueryDefaults(r)}),this.add(o)),o}add(t){X(this,ii).has(t.queryHash)||(X(this,ii).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=X(this,ii).get(t.queryHash);n&&(t.destroy(),n===t&&X(this,ii).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){cn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,ii).get(t)}getAll(){return[...X(this,ii).values()]}find(t){const n=L({exact:!0},t);return this.getAll().find(i=>Nb(n,i))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(i=>Nb(t,i)):n}notify(t){cn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){cn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){cn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ii=new WeakMap,E_),Gt,Ts,Rs,Rl,Ml,Ms,Al,Ll,j_,dT=(j_=class{constructor(e={}){Be(this,Gt);Be(this,Ts);Be(this,Rs);Be(this,Rl);Be(this,Ml);Be(this,Ms);Be(this,Al);Be(this,Ll);ke(this,Gt,e.queryCache||new uT),ke(this,Ts,e.mutationCache||new oT),ke(this,Rs,e.defaultOptions||{}),ke(this,Rl,new Map),ke(this,Ml,new Map),ke(this,Ms,0)}mount(){Ku(this,Ms)._++,X(this,Ms)===1&&(ke(this,Al,gg.subscribe(e=>Qe(this,null,function*(){e&&(yield this.resumePausedMutations(),X(this,Gt).onFocus())}))),ke(this,Ll,Ed.subscribe(e=>Qe(this,null,function*(){e&&(yield this.resumePausedMutations(),X(this,Gt).onOnline())}))))}unmount(){var e,t;Ku(this,Ms)._--,X(this,Ms)===0&&((e=X(this,Al))==null||e.call(this),ke(this,Al,void 0),(t=X(this,Ll))==null||t.call(this),ke(this,Ll,void 0))}isFetching(e){return X(this,Gt).findAll(V(L({},e),{fetchStatus:"fetching"})).length}isMutating(e){return X(this,Ts).findAll(V(L({},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(Os(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),l=r==null?void 0:r.state.data,o=Vk(t,l);if(o!==void 0)return X(this,Gt).build(this,i).setData(o,V(L({},n),{manual:!0}))}setQueriesData(e,t,n){return cn.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);cn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=X(this,Gt);return cn.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(L({type:"active"},e),t)))}cancelQueries(e,t={}){const n=L({revert:!0},t),i=cn.batch(()=>X(this,Gt).findAll(e).map(r=>r.cancel(n)));return Promise.all(i).then(Mn).catch(Mn)}invalidateQueries(e,t={}){return cn.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(L({},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(L({},t),{cancelRefetch:(r=t.cancelRefetch)!=null?r:!0}),i=cn.batch(()=>X(this,Gt).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(Mn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(i).then(Mn)}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(Os(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mn).catch(Mn)}fetchInfiniteQuery(e){return e.behavior=Ab(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mn).catch(Mn)}ensureInfiniteQueryData(e){return e.behavior=Ab(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ed.isOnline()?X(this,Ts).resumePausedMutations():Promise.resolve()}getQueryCache(){return X(this,Gt)}getMutationCache(){return X(this,Ts)}getDefaultOptions(){return X(this,Rs)}setDefaultOptions(e){ke(this,Rs,e)}setQueryDefaults(e,t){X(this,Rl).set(Rr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,Rl).values()],n={};return t.forEach(i=>{mc(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){X(this,Ml).set(Rr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,Ml).values()],n={};return t.forEach(i=>{mc(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t=V(L(L(L({},X(this,Rs).queries),this.getQueryDefaults(e.queryKey)),e),{_defaulted:!0});return t.queryHash||(t.queryHash=hg(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===mg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:V(L(L(L({},X(this,Rs).mutations),(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey)),e),{_defaulted:!0})}clear(){X(this,Gt).clear(),X(this,Ts).clear()}},Gt=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,Rl=new WeakMap,Ml=new WeakMap,Ms=new WeakMap,Al=new WeakMap,Ll=new WeakMap,j_),oS=k.createContext(void 0),Pl=e=>{const t=k.useContext(oS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},fT=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(oS.Provider,{value:e,children:t})),cS=k.createContext(!1),hT=()=>k.useContext(cS);cS.Provider;function mT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var pT=k.createContext(mT()),gT=()=>k.useContext(pT),yT=(e,t,n)=>{const i=n!=null&&n.state.error&&typeof e.throwOnError=="function"?pg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},vT=e=>{k.useEffect(()=>{e.clearReset()},[e])},xT=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(r&&e.data===void 0||pg(n,[e.error,i])),bT=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))}},_T=(e,t)=>e.isLoading&&e.isFetching&&!t,ST=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Db=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wT(e,t,n){var y,x,_,S;const i=hT(),r=gT(),l=Pl(),o=l.defaultQueryOptions(e);(x=(y=l.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||x.call(y,o);const u=l.getQueryCache().get(o.queryHash);o._optimisticResults=i?"isRestoring":"optimistic",bT(o),yT(o,r,u),vT(r);const f=!l.getQueryCache().get(o.queryHash),[m]=k.useState(()=>new t(l,o)),g=m.getOptimisticResult(o),p=!i&&e.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(w=>{const N=p?m.subscribe(cn.batchCalls(w)):Mn;return m.updateResult(),N},[m,p]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),k.useEffect(()=>{m.setOptions(o)},[o,m]),ST(o,g))throw Db(o,m,r);if(xT({result:g,errorResetBoundary:r,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw g.error;if((S=(_=l.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||S.call(_,o,g),o.experimental_prefetchInRender&&!Tr&&_T(g,i)){const w=f?Db(o,m,r):u==null?void 0:u.promise;w==null||w.catch(Mn).finally(()=>{m.updateResult()})}return o.notifyOnChangeProps?g:m.trackResult(g)}function ql(e,t){return wT(e,aT)}function Fd(e,t){const n=Pl(),[i]=k.useState(()=>new cT(n,e));k.useEffect(()=>{i.setOptions(e)},[i,e]);const r=k.useSyncExternalStore(k.useCallback(o=>i.subscribe(cn.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=k.useCallback((o,u)=>{i.mutate(o,u).catch(Mn)},[i]);if(r.error&&pg(i.options.throwOnError,[r.error]))throw r.error;return V(L({},r),{mutate:l,mutateAsync:r.mutate})}const NT="dr_auth_token";function CT(){const e=window.fetch;window.fetch=function(...t){const[n,i]=t,r=typeof window!="undefined"?localStorage.getItem(NT):null,l=i||{};if(r&&!l.headers)l.headers={Authorization:`Bearer ${r}`};else if(r&&l.headers){const o=l.headers;o.Authorization||(o.Authorization=`Bearer ${r}`)}return e(n,l)},console.log("[FetchInterceptor] Installed - will add Authorization header to all requests")}var ET={};class jT{constructor(t){Tt(this,"baseUrl");Tt(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 Qe(this,null,function*(){const i=`${this.getBaseUrl()}/health`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},l=yield fetch(i,r);if(!l.ok){const o=yield l.text();throw new Error(`GET /health failed: ${l.status} ${o}`)}return l.json()})}getapimodel(){return Qe(this,null,function*(){const i=`${this.getBaseUrl()}/api/model`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},l=yield fetch(i,r);if(!l.ok){const o=yield l.text();throw new Error(`GET /api/model failed: ${l.status} ${o}`)}return l.json()})}getapilayerslayerName(t){return Qe(this,null,function*(){const n=this.getBaseUrl(),i=`/api/layers/${encodeURIComponent(t)}`,r=`${n}${i}`,l={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,l);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/layers/:layerName failed: ${o.status} ${u}`)}return o.json()})}getapispec(){return Qe(this,null,function*(){const i=`${this.getBaseUrl()}/api/spec`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},l=yield fetch(i,r);if(!l.ok){const o=yield l.text();throw new Error(`GET /api/spec failed: ${l.status} ${o}`)}return l.json()})}getapiannotations(t){return Qe(this,null,function*(){const n=this.getBaseUrl(),i="/api/annotations",r=new URLSearchParams;t&&Object.entries(t).forEach(([f,m])=>{m!=null&&r.append(f,m)});const l=r.toString()?`${n}${i}?${r.toString()}`:`${n}${i}`,o={method:"GET",headers:this.getHeaders(),credentials:"include"},u=yield fetch(l,o);if(!u.ok){const f=yield u.text();throw new Error(`GET /api/annotations failed: ${u.status} ${f}`)}return u.json()})}postapiannotations(t){return Qe(this,null,function*(){const r=`${this.getBaseUrl()}/api/annotations`,l={method:"POST",headers:this.getHeaders(),credentials:"include"};t&&(l.body=JSON.stringify(t));const o=yield fetch(r,l);if(!o.ok){const u=yield o.text();throw new Error(`POST /api/annotations failed: ${o.status} ${u}`)}return o.json()})}getapiannotationsannotationId(t){return Qe(this,null,function*(){const n=this.getBaseUrl(),i=`/api/annotations/${encodeURIComponent(t)}`,r=`${n}${i}`,l={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,l);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 Qe(this,null,function*(){const i=this.getBaseUrl(),r=`/api/annotations/${encodeURIComponent(t)}`,l=`${i}${r}`,o={method:"PUT",headers:this.getHeaders(),credentials:"include"};n&&(o.body=JSON.stringify(n));const u=yield fetch(l,o);if(!u.ok){const f=yield u.text();throw new Error(`PUT /api/annotations/:annotationId failed: ${u.status} ${f}`)}return u.json()})}patchapiannotationsannotationId(t,n){return Qe(this,null,function*(){const i=this.getBaseUrl(),r=`/api/annotations/${encodeURIComponent(t)}`,l=`${i}${r}`,o={method:"PATCH",headers:this.getHeaders(),credentials:"include"};n&&(o.body=JSON.stringify(n));const u=yield fetch(l,o);if(!u.ok){const f=yield u.text();throw new Error(`PATCH /api/annotations/:annotationId failed: ${u.status} ${f}`)}return u.json()})}deleteapiannotationsannotationId(t){return Qe(this,null,function*(){const n=this.getBaseUrl(),i=`/api/annotations/${encodeURIComponent(t)}`,r=`${n}${i}`,l={method:"DELETE",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,l);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 Qe(this,null,function*(){const n=this.getBaseUrl(),i=`/api/annotations/${encodeURIComponent(t)}/replies`,r=`${n}${i}`,l={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,l);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 Qe(this,null,function*(){const i=this.getBaseUrl(),r=`/api/annotations/${encodeURIComponent(t)}/replies`,l=`${i}${r}`,o={method:"POST",headers:this.getHeaders(),credentials:"include"};n&&(o.body=JSON.stringify(n));const u=yield fetch(l,o);if(!u.ok){const f=yield u.text();throw new Error(`POST /api/annotations/:annotationId/replies failed: ${u.status} ${f}`)}return u.json()})}getapichangesets(){return Qe(this,null,function*(){const i=`${this.getBaseUrl()}/api/changesets`,r={method:"GET",headers:this.getHeaders(),credentials:"include"},l=yield fetch(i,r);if(!l.ok){const o=yield l.text();throw new Error(`GET /api/changesets failed: ${l.status} ${o}`)}return l.json()})}getapichangesetschangesetId(t){return Qe(this,null,function*(){const n=this.getBaseUrl(),i=`/api/changesets/${encodeURIComponent(t)}`,r=`${n}${i}`,l={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(r,l);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/changesets/:changesetId failed: ${o.status} ${u}`)}return o.json()})}}let Rm=null;function Ar(e){if(!Rm){const t=typeof window!="undefined"?window.location.origin:ET.API_URL||"http://localhost:8080";Rm=new jT(t)}return Rm}const $d=Ar();function kT(e){return ql({queryKey:["getapimodel"],queryFn:()=>$d.getapimodel()})}function TT(e){return ql({queryKey:["getapispec"],queryFn:()=>$d.getapispec()})}function RT(e){return ql({queryKey:["getapichangesets"],queryFn:()=>$d.getapichangesets()})}function MT(e,t){return ql(L({queryKey:["getapichangesetschangesetId",e],queryFn:()=>$d.getapichangesetschangesetId(e)},t))}function AT(){return new dT({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*10,retry:1},mutations:{retry:0}}})}const sc="dr_auth_token";function Ob(){if(typeof window=="undefined")return null;const e=localStorage.getItem(sc);if(e)return console.log("[Auth] Token loaded from localStorage"),e;const t=LT();return t?(console.log("[Auth] Token loaded from cookie"),t):(console.log("[Auth] No token found - running in development mode"),null)}function LT(){if(typeof document=="undefined")return null;const e=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith(`${sc}=`));if(!e)return null;try{return decodeURIComponent(e.split("=")[1]||"")}catch(t){return e.split("=")[1]||null}}const vg=Od((e,t)=>({token:Ob(),isAuthenticated:!!Ob(),setToken:n=>{typeof window!="undefined"&&(n?localStorage.setItem(sc,n):localStorage.removeItem(sc)),e({token:n,isAuthenticated:!!n}),console.log("[Auth] Token updated:",n?"present":"cleared")},clearToken:()=>{typeof window!="undefined"&&localStorage.removeItem(sc),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 DT(){const e=kc({strict:!1}),t=vg(n=>n.setToken);return k.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 OT={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"},je=re.forwardRef((o,l)=>{var u=o,{name:e,size:t=24,className:n="","aria-label":i}=u,r=pe(u,["name","size","className","aria-label"]);const f=OT[e];return f?d.jsx("svg",V(L({ref:l,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:f})})):(console.warn(`Icon "${e}" does not exist in ICONS map`),null)});je.displayName="Icon";function IT(e){return e.split(" ").slice(0,2).map(t=>t[0]).join("").toUpperCase()}const Wo={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)))"},Ib=Object.keys(Wo);function zT(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 BT(e){const t=zT(e)%Ib.length;return Ib[t]}function UT(e,t){if(e&&e in Wo)return Wo[e];if(e)return e;if(t){const n=BT(t);return Wo[n]}return Wo.amber}const FT=re.forwardRef((p,g)=>{var y=p,{name:e,src:t,size:n="md",shape:i="circle",status:r,color:l,decorative:o,className:u="",style:f}=y,m=pe(y,["name","src","size","shape","status","color","decorative","className","style"]);const[x,_]=k.useState(!1),S=IT(e),w=!t||x,N=["avatar",`avatar--${n}`,`avatar--${i}`,u].filter(Boolean).join(" "),R=w?{background:UT(l,e)}:{display:"none"},C=w?{display:"none"}:{};return d.jsxs("div",V(L({ref:g,className:N,style:f,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:R,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})]}))});FT.displayName="Avatar";const En=re.forwardRef((f,u)=>{var m=f,{variant:e="primary",size:t="md",icon:n,className:i="",disabled:r,type:l="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",L({ref:u,type:l,disabled:r,className:g},o))});En.displayName="Button";const Xn=re.forwardRef((o,l)=>{var u=o,{variant:e="neutral",form:t="default",className:n="",children:i}=u,r=pe(u,["variant","form","className","children"]);const f=["chip",`chip--${t}`,t==="default"&&`chip--${e}`,n].filter(Boolean).join(" ");return d.jsxs("span",V(L({ref:l,className:f},r),{children:[t==="default"&&d.jsx("span",{className:"chip__dot"}),t==="env"&&d.jsx("span",{className:"chip__dot chip__dot--env"}),i]}))});Xn.displayName="Chip";const xg=re.forwardRef((l,r)=>{var o=l,{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",L({ref:r,className:u},i))});xg.displayName="Badge";const uS=re.forwardRef((o,l)=>{var u=o,{color:e="cyan",pulse:t=!1,className:n="",role:i="img"}=u,r=pe(u,["color","pulse","className","role"]);const f=["status-badge",`status-badge--${e}`,t&&"status-badge--pulse",n].filter(Boolean).join(" ");return d.jsx("div",L({ref:l,role:i,className:f},r))});uS.displayName="StatusBadge";const pc=re.forwardRef((l,r)=>{var o=l,{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",L({type:"text",ref:r,className:u},i))});pc.displayName="TextInput";const bg=re.forwardRef((l,r)=>{var o=l,{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",L({ref:r,className:u},i))});bg.displayName="TextArea";const $T=re.forwardRef((l,r)=>{var o=l,{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",L({ref:r,type:"number",className:u},i))});$T.displayName="NumberInput";const HT="[data-dropdown-item]:not([data-disabled])";function Hd({triggerRef:e,panelRef:t,isOpen:n,onClose:i,itemSelector:r=HT,restoreFocus:l=!0}){const[o,u]=k.useState(null),f=k.useRef(!1),m=k.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 k.useEffect(()=>{var g;if(n&&!f.current){f.current=!0;const p=m();u(y=>{var x;return y&&p.includes(y)?y:(x=p[0])!=null?x:null})}else!n&&f.current&&(f.current=!1,u(null),l&&((g=e.current)==null||g.focus()))},[n,m,l,e]),k.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]),k.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,R=(_=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(!R)return;x.preventDefault();const C=x.shiftKey?-1:1,E=(w+C+S.length)%S.length;u(S[E]);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 Pd=(e="bottom-start")=>`dropdown-panel--placement-${e}`,dS=k.createContext(void 0);function fS(e){const t=k.useContext(dS);if(!t)throw new Error(`${e} must be used inside <Select>`);return t}const hS=re.forwardRef((e,t)=>{var ue;const{placeholder:n="Select…",error:i=!1,disabled:r=!1,id:l,name:o,className:u="",ariaLabel:f,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]=k.useState(y==="single"&&(ue=e.defaultValue)!=null?ue:""),[N,R]=k.useState(()=>{var I;return new Set(y==="multi"?(I=e.defaultValues)!=null?I:[]:[])}),C=k.useMemo(()=>{var I,ae;if(y==="single"){const ye=x?(I=e.value)!=null?I:"":S;return ye?new Set([ye]):new Set}return _?new Set((ae=e.values)!=null?ae:[]):N},[y,x,_,e.value,e.values,S,N]),[E,T]=k.useState(!1),D=k.useRef(null),O=k.useRef(null),F=k.useRef(null),[A,M]=k.useState(new Map),B=k.useCallback((I,ae)=>(M(ye=>{if(ye.get(I)===ae)return ye;const xe=new Map(ye);return xe.set(I,ae),xe}),()=>{M(ye=>{if(!ye.has(I))return ye;const xe=new Map(ye);return xe.delete(I),xe})}),[]),H=k.useCallback(I=>{r||T(I)},[r]),G=k.useCallback(()=>T(!1),[]),{focusedValue:$,setFocusedValue:q}=Hd({triggerRef:D,panelRef:O,isOpen:E,onClose:G});k.useEffect(()=>{if(E&&C.size>0&&!$){const I=C.values().next().value;I&&q(I)}},[E,C,$,q]);const P=k.useCallback(I=>{var ae,ye;if(y==="single")x||w(I),(ae=e.onChange)==null||ae.call(e,I),T(!1);else{const xe=new Set(C);xe.has(I)?xe.delete(I):xe.add(I),_||R(xe),(ye=e.onValuesChange)==null||ye.call(e,Array.from(xe))}},[y,x,_,C,e]),Q={mode:y,isOpen:E,onOpenChange:H,selectedValues:C,onValueChange:P,focusedValue:$,setFocusedValue:q,registerItem:B,panelRef:O},K=k.useMemo(()=>{var xe,he;if(C.size===0)return d.jsx("span",{className:"select__placeholder",children:n});if(y==="single"){const we=C.values().next().value;return d.jsx("span",{className:"select__value",children:(xe=A.get(we))!=null?xe:we})}const I=Array.from(C),ae=I[0],ye=(he=A.get(ae))!=null?he:ae;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,A,y,n]),W=I=>{E||(I.key==="ArrowDown"||I.key==="ArrowUp"||I.key==="Enter"||I.key===" ")&&(I.preventDefault(),H(!0))},z=o&&C.size>0?Array.from(C).map(I=>d.jsx("input",{type:"hidden",name:o,value:I},I)):null,se=I=>{D.current=I,typeof t=="function"?t(I):t&&(t.current=I)};return d.jsx(dS.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:l,type:"button",className:"select__trigger","aria-haspopup":"listbox","aria-expanded":E,"aria-invalid":i||void 0,"aria-label":f,disabled:r,onClick:()=>H(!E),onKeyDown:W,children:[K,d.jsx(je,{name:"chevronDown",size:14,className:`select__chevron ${E?"select__chevron--open":""}`})]}),z,d.jsx("div",{ref:O,role:"listbox","aria-multiselectable":y==="multi"?!0:void 0,className:`dropdown-panel ${Pd(g)} select__panel`,hidden:!E,children:m})]})})});hS.displayName="Select";function PT({value:e,icon:t,description:n,disabled:i=!1,children:r}){const{selectedValues:l,onValueChange:o,focusedValue:u,setFocusedValue:f,registerItem:m,mode:g}=fS("Select.Item"),p=k.useRef(null),y=l.has(e),x=u===e;return k.useEffect(()=>m(e,r),[e,r,m]),k.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&&f(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(je,{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(je,{name:"check",size:14})})]})}function qT({value:e,description:t,disabled:n=!1,children:i}){const{selectedValues:r,onValueChange:l,focusedValue:o,setFocusedValue:u,registerItem:f}=fS("Select.CheckboxItem"),m=k.useRef(null),g=r.has(e),p=o===e;return k.useEffect(()=>f(e,i),[e,i,f]),k.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:()=>l(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 VT(){return d.jsx("div",{role:"separator",className:"dropdown-separator"})}function GT({children:e}){return d.jsx("div",{className:"dropdown-section-title",children:e})}const jd=Object.assign(hS,{Item:PT,CheckboxItem:qT,Separator:VT,SectionTitle:GT}),KT=re.forwardRef((l,r)=>{var o=l,{indeterminate:e=!1,className:t="","aria-checked":n}=o,i=pe(o,["indeterminate","className","aria-checked"]);const u=re.useRef(null),f=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(L({ref:f,type:"checkbox",className:m},i),{"aria-checked":n!=null?n:e?"mixed":i.checked!==void 0?!!i.checked:void 0}))});KT.displayName="TriState";const YT=re.forwardRef((p,g)=>{var y=p,{label:e,htmlFor:t,required:n=!1,disabled:i=!1,error:r,errorId:l,hint:o,children:u,className:f=""}=y,m=pe(y,["label","htmlFor","required","disabled","error","errorId","hint","children","className"]);const x=["field",i?"field--disabled":"",f].filter(Boolean).join(" ");return d.jsxs("div",V(L({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:l,children:r})]}))});YT.displayName="Field";const gc={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 XT(e){return e in gc?gc[e]:e}function QT(e){return e.map(([t,n],i)=>(i?"L":"M")+t.toFixed(2)+","+n.toFixed(2)).join(" ")}const _g=re.forwardRef((g,m)=>{var p=g,{data:e,width:t=88,height:n=28,color:i="emerald",area:r=!0,label:l,className:o="",style:u}=p,f=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),R=Math.max(...e),C=e.map((D,O)=>[O/(e.length-1)*t,n-2-(D-N)/(R-N||1)*(n-4)]),E=QT(C),T=`${E} L${t},${n} L0,${n} Z`;return{line:E,fill:T}},[e,t,n]);if(!x)return null;const _=XT(String(i)),{line:S,fill:w}=x;return d.jsxs("svg",V(L({ref:m,role:"img","aria-label":l!=null?l:"trend sparkline",width:t,height:n,viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"none",style:L({display:"block"},u),className:o},f),{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"})]}))});_g.displayName="Sparkline";const pd=re.forwardRef((y,p)=>{var x=y,{label:e="",value:t="",delta:n,color:i="cyan",icon:r,sparkData:l,meta:o,metaIcon:u,className:f="","aria-label":m}=x,g=pe(x,["label","value","delta","color","icon","sparkData","meta","metaIcon","className","aria-label"]);const _=["stat-tile",`stat-tile--${i}`,f].filter(Boolean).join(" ");return d.jsxs("div",V(L({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(je,{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(je,{name:u,size:12,"aria-hidden":"true"}),d.jsx("span",{className:"stat-tile__meta-text",children:o})]})]}),l&&d.jsx("div",{className:"stat-tile__sparkline",children:d.jsx(_g,{data:l,width:88,height:28,color:i||"cyan"})})]}))});pd.displayName="StatTile";const ZT=re.forwardRef((l,r)=>{var o=l,{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(L({ref:r,className:u},i),{children:n}))});ZT.displayName="StatGrid";const da=re.forwardRef((l,r)=>{var o=l,{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(L({ref:r,className:u},i),{children:t}))});da.displayName="VersionPill";const Ii=re.forwardRef((u,o)=>{var f=u,{value:e,onChange:t,options:n,disabled:i=!1,className:r=""}=f,l=pe(f,["value","onChange","options","disabled","className"]);const m=["segmented-control",i?"segmented-control--disabled":"",r].filter(Boolean).join(" "),g=k.useRef([]),p=k.useCallback((_,S)=>{var w;const N=n.map((E,T)=>E.disabled?null:T).filter(E=>E!==null),R=N.indexOf(S);let C;_.key==="ArrowRight"||_.key==="ArrowDown"?(_.preventDefault(),C=N[(R+1)%N.length]):(_.key==="ArrowLeft"||_.key==="ArrowUp")&&(_.preventDefault(),C=N[(R-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(L({ref:o,className:m,role:"radiogroup"},l),{children:n.map((_,S)=>{const w=e===_.value,N=w||!y&&S===x?0:-1;return d.jsx("button",{ref:R=>{g.current[S]=R},className:`segmented-control__segment ${w?"segmented-control__segment--active":""}`,onClick:()=>!i&&!_.disabled&&t(_.value),onKeyDown:R=>p(R,S),type:"button",role:"radio","aria-checked":w,disabled:i||_.disabled,tabIndex:N,children:_.label},_.value)})}))});Ii.displayName="SegmentedControl";const JT=re.forwardRef((y,p)=>{var x=y,{columns:e,data:t,rowKey:n,selectable:i=!1,selectedRows:r=[],onSelectRows:l,onRowClick:o,onSort:u,emptyState:f,className:m=""}=x,g=pe(x,["columns","data","rowKey","selectable","selectedRows","onSelectRows","onRowClick","onSort","emptyState","className"]);const[_,S]=k.useState(null),[w,N]=k.useState("asc"),R=k.useRef(null),C=t.length>0&&r.length===t.length,E=r.length>0&&r.length<t.length;k.useEffect(()=>{R.current&&(R.current.indeterminate=E)},[E]);const T=(B,H)=>typeof n=="function"?n(B,H):B[n],D=()=>{C?l==null||l([]):l==null||l(t.map((B,H)=>T(B,H)))},O=B=>{r.includes(B)?l==null||l(r.filter(H=>H!==B)):l==null||l([...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"))},A=(B,H)=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),F(H))},M=["table",m].filter(Boolean).join(" ");return d.jsxs("table",V(L({ref:p,className:M},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:R,type:"checkbox",className:"table__checkbox",checked:C,onChange:D,"aria-label":"Select all rows"})}),e.map(B=>{const H=String(B.key),G=_===H,$=G?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":$,tabIndex:B.sortable?0:void 0,onClick:()=>B.sortable&&F(H),onKeyDown:B.sortable?q=>A(q,H):void 0,children:d.jsxs("div",{className:"table__header-content",children:[B.label,G&&d.jsx(je,{name:w==="asc"?"chevronUp":"chevronDown",size:14,className:"table__sort-icon"})]})},H)})]})}),d.jsx("tbody",{className:"table__body",children:t.length===0&&f?d.jsx("tr",{className:"table__row",children:d.jsx("td",{className:"table__cell table__cell--empty",colSpan:e.length+(i?1:0),children:f})}):t.map((B,H)=>{const G=T(B,H),$=r.includes(G),q=!!o;return d.jsxs("tr",{"data-row-key":G,className:["table__row",$?"table__row--selected":"",q?"table__row--clickable":""].filter(Boolean).join(" "),onClick:q?()=>o(B,G):void 0,onKeyDown:q?P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),o(B,G))}: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:$,"aria-label":`Select row ${G}`,onChange:()=>O(G),onClick:P=>P.stopPropagation()})}),e.map(P=>d.jsx("td",{className:"table__cell",children:P.render?P.render(B[P.key],B,H):B[P.key]},`${G}-${String(P.key)}`))]},G)})})]}))});JT.displayName="Table";const yc=re.forwardRef((g,m)=>{var p=g,{icon:e,label:t,count:n,active:i=!1,depth:r=0,onClick:l,className:o="",type:u="button"}=p,f=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(L({ref:m,type:u,className:y,onClick:l,"aria-current":i?"page":void 0},f),{children:[r===0&&e&&d.jsx(je,{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})]}))});yc.displayName="NavItem";const Sg=re.forwardRef((f,u)=>{var m=f,{title:e,version:t,collapsed:n=!1,action:i,className:r="","aria-label":l}=m,o=pe(m,["title","version","collapsed","action","className","aria-label"]);const g=["app-title",n&&"app-title--collapsed",r].filter(Boolean).join(" "),p=l!=null?l:t?`${e} ${t}`:e;return d.jsxs("div",V(L({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})]}))});Sg.displayName="AppTitle";const wp=re.forwardRef((_,x)=>{var S=_,{sections:e,activeItemId:t,collapsed:n=!1,onCollapse:i,onSelectItem:r,defaultExpandedIds:l,expandedIds:o,onExpandedChange:u,showCollapseToggle:f=!0,appTitle:m,footer:g,className:p=""}=S,y=pe(S,["sections","activeItemId","collapsed","onCollapse","onSelectItem","defaultExpandedIds","expandedIds","onExpandedChange","showCollapseToggle","appTitle","footer","className"]);var O;const w=o!==void 0,[N,R]=k.useState(()=>new Set(l)),C=w?new Set(o):N,E=F=>{const A=new Set(C);A.has(F)?A.delete(F):A.add(F),w||R(A),u==null||u(Array.from(A))},T=["sidebar",n&&"sidebar--collapsed",p].filter(Boolean).join(" "),D=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(je,{name:n?"chevronRight":"chevronLeft",size:16})});return d.jsxs("div",V(L({ref:x,className:T},y),{children:[m?d.jsxs(d.Fragment,{children:[d.jsx(Sg,V(L({},m),{collapsed:n,action:n?m.action:(O=m.action)!=null?O:D})),n&&D]}):f&&D,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(A=>{const M=A.children&&A.children.length>0,B=C.has(A.id),H=t===A.id;return d.jsxs(re.Fragment,{children:[d.jsxs("button",{type:"button",className:`sidebar__item ${H?"sidebar__item--active":""}`,onClick:()=>{M?E(A.id):r==null||r(A.id)},title:n?A.label:void 0,"aria-current":H?"page":void 0,"aria-expanded":M?B:void 0,children:[A.icon&&d.jsx(je,{name:A.icon,size:18,className:"sidebar__item-icon"}),!n&&d.jsx("span",{className:"sidebar__item-label",children:A.label}),!n&&A.count!==void 0&&d.jsx("span",{className:"sidebar__item-count",children:A.count}),!n&&M&&d.jsx(je,{name:"chevronRight",size:14,className:`sidebar__item-chevron ${B?"sidebar__item-chevron--open":""}`})]}),!n&&M&&B&&A.children.map(G=>d.jsxs("button",{type:"button",className:`sidebar__item sidebar__item--child ${t===G.id?"sidebar__item--active":""}`,onClick:()=>r==null?void 0:r(G.id),"aria-current":t===G.id?"page":void 0,children:[d.jsx("span",{className:"sidebar__item-label",children:G.label}),G.count!==void 0&&d.jsx("span",{className:"sidebar__item-count",children:G.count})]},G.id))]},A.id)})})]},F.title))}),g&&d.jsx("div",{className:"sidebar__footer",children:g})]}))});wp.displayName="Sidebar";function wg(e){const[t,n]=k.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return k.useEffect(()=>{if(typeof window>"u")return;const i=window.matchMedia(e);n(i.matches);const r=l=>{n(l.matches)};return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[e]),t}const mS=re.forwardRef((g,m)=>{var p=g,{breadcrumbs:e,searchPlaceholder:t="Search…",onSearch:n,leadingContent:i,searchHint:r,children:l,className:o="",mobileBreakpoint:u=768}=p,f=pe(p,["breadcrumbs","searchPlaceholder","onSearch","leadingContent","searchHint","children","className","mobileBreakpoint"]);const y=wg(u!==!1?`(max-width: ${u}px)`:"(max-width: 0px)"),x=["topbar",o].filter(Boolean).join(" "),_=e?e.length-1:-1;return d.jsxs("div",V(L({ref:m,className:x,"data-mobile":y},f),{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((S,w)=>d.jsxs(re.Fragment,{children:[w>0&&d.jsx("span",{className:"breadcrumbs__separator","aria-hidden":"true",children:"/"}),S.href?d.jsx("a",{href:S.href,className:"breadcrumbs__link","aria-current":w===_?"page":void 0,children:S.label}):S.onClick?d.jsx("button",{type:"button",className:"breadcrumbs__link breadcrumbs__link--button",onClick:S.onClick,"aria-current":w===_?"page":void 0,children:S.label}):d.jsx("span",{className:"breadcrumbs__link breadcrumbs__link--static","aria-current":w===_?"page":void 0,children:S.label})]},w))})}),d.jsxs("div",{className:"topbar__actions",children:[n&&!y&&d.jsxs("div",{className:"topbar__search-wrap",children:[d.jsx("input",{type:"search",placeholder:t,"aria-label":t,className:"topbar__search",onChange:S=>n(S.target.value)}),r&&d.jsx("span",{className:"topbar__search-hint",children:r})]}),l]})]}))});mS.displayName="Topbar";const WT=re.forwardRef((o,l)=>{var u=o,{tabs:e=[],activeTabId:t="",onSelectTab:n,className:i=""}=u,r=pe(u,["tabs","activeTabId","onSelectTab","className"]);const f=["tab-bar",i].filter(Boolean).join(" "),m=k.useRef([]),g=k.useCallback((p,y)=>{var x;const _=e.map((N,R)=>N.disabled?-1:R).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(L({ref:l,className:f,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(Xn,{form:"id-tag",children:p.count})]},p.id))})}))});WT.displayName="TabBar";const pS=re.forwardRef((f,u)=>{var m=f,{left:e,center:t,right:n,className:i="",role:r="banner","aria-label":l="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(L({ref:u,className:g,role:r,"aria-label":l},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})]}))});pS.displayName="Titlebar";const eR=e=>typeof e=="object"&&e!==null&&"kind"in e,tR=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(je,{name:t.icon,size:14}),t.label&&d.jsx("span",{className:"statusbar__label",children:t.label})]},n);default:return t}}),Ng=re.forwardRef((u,o)=>{var f=u,{left:e,center:t,right:n,className:i="",mobileBreakpoint:r=768}=f,l=pe(f,["left","center","right","className","mobileBreakpoint"]);const m=wg(r!==!1?`(max-width: ${r}px)`:"(max-width: 0px)"),g=["statusbar",i].filter(Boolean).join(" "),p=y=>y?Array.isArray(y)&&y.length>0&&eR(y[0])?tR(y):y:null;return d.jsxs("div",V(L({ref:o,role:"status",className:g,"data-mobile":m},l),{children:[e&&d.jsx("div",{className:"statusbar__slot statusbar__slot--left statusbar__left",children:p(e)}),t&&d.jsx("div",{className:"statusbar__slot statusbar__slot--center",children:p(t)}),n&&d.jsx("div",{className:"statusbar__slot statusbar__slot--right statusbar__right",children:p(n)})]}))});Ng.displayName="Statusbar";const nR=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'];function qd(e,t,n){var l;const i=k.useRef(null),r=(l=n==null?void 0:n.mode)!=null?l:"modal";k.useEffect(()=>{if(!t||!e.current)return;i.current=document.activeElement;const o=()=>e.current?Array.from(e.current.querySelectorAll(nR.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())},f=o();return f.length>0&&r==="modal"&&f[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 Ju=0,Wu=null;function Cg(e){k.useEffect(()=>{if(e)return Ju===0&&(Wu=document.body.style.overflow,document.body.style.overflow="hidden"),Ju++,()=>{Ju--,Ju===0&&Wu!==null&&(document.body.style.overflow=Wu,Wu=null)}},[e])}const gS=re.forwardRef((g,m)=>{var p=g,{isOpen:e,onClose:t,title:n,position:i="right",width:r="320px",children:l,className:o="",keepMounted:u=!1}=p,f=pe(p,["isOpen","onClose","title","position","width","children","className","keepMounted"]);const y=re.useId(),x=k.useRef(null);k.useImperativeHandle(m,()=>x.current),qd(x,e),Cg(e),k.useEffect(()=>{const S=w=>{w.key==="Escape"&&e&&t()};if(e)return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[e,t]);const _=S=>{S.target===S.currentTarget&&t()};return!u&&!e?null:d.jsx("div",{className:"drawer-backdrop",onClick:e?_:void 0,style:{display:e?"block":"none"},children:d.jsxs("div",V(L({ref:x,className:["drawer",`drawer--${i}`,o].filter(Boolean).join(" "),style:{width:r},role:"dialog","aria-modal":e,"aria-labelledby":n?y:void 0,"data-open":e?"true":"false"},f),{children:[d.jsxs("div",{className:["drawer__header",n?"":"drawer__header--no-title"].filter(Boolean).join(" "),children:[n&&d.jsx("h2",{id:y,className:"drawer__title",children:n}),d.jsx("button",{type:"button",className:"drawer__close",onClick:t,"aria-label":"Close drawer",children:d.jsx(je,{name:"x",size:14})})]}),d.jsx("div",{className:"drawer__body",children:l})]}))})});gS.displayName="Drawer";const aR=re.forwardRef((g,m)=>{var p=g,{titlebar:e,appTitle:t,topbar:n,sidebar:i,statusbar:r,children:l,className:o="",mobileBreakpoint:u=768}=p,f=pe(p,["titlebar","appTitle","topbar","sidebar","statusbar","children","className","mobileBreakpoint"]);var K,ae;const[y,x]=k.useState(!1),_=wg(u!==!1?`(max-width: ${u}px)`:"(max-width: 0px)");k.useEffect(()=>{_||x(!1)},[_]);const S=["shell-layout",o].filter(Boolean).join(" "),W=e!=null?e:{},{hide:w}=W,N=pe(W,["hide"]),R=e&&!e.hide,z=t!=null?t:{},{hide:C}=z,E=pe(z,["hide"]),T=t&&!t.hide,se=n!=null?n:{},{hide:D}=se,O=pe(se,["hide"]),F=n&&!n.hide,ue=i!=null?i:{},{hide:A}=ue,M=pe(ue,["hide"]),B=i&&!i.hide,I=r!=null?r:{},{hide:H}=I,G=pe(I,["hide"]),$=r&&!r.hide,q=_?V(L({},M),{collapsed:!1,showCollapseToggle:!1,onSelectItem:ye=>{var xe;try{(xe=M==null?void 0:M.onSelectItem)==null||xe.call(M,ye)}finally{x(!1)}}}):M,P=_&&B&&d.jsx("button",{type:"button",className:"shell-layout__mobile-menu-toggle",onClick:()=>x(!0),"aria-label":"Open sidebar menu",children:d.jsx(je,{name:"menu",size:20})}),Q=F?V(L({},O),{mobileBreakpoint:(K=O.mobileBreakpoint)!=null?K:u,leadingContent:d.jsxs(d.Fragment,{children:[_&&P,O==null?void 0:O.leadingContent]})}):O;return d.jsxs("div",V(L({ref:m,className:S,"data-mobile":_},f),{children:[R&&d.jsx(pS,L({},N)),d.jsxs("div",{className:"shell-layout__main",children:[B?!_&&d.jsx("div",{className:"shell-layout__sidebar-col",children:d.jsx(wp,V(L({},q),{appTitle:T?E:q.appTitle}))}):T?d.jsx(Sg,L({},E)):null,d.jsxs("div",{className:"shell-layout__content",children:[F&&d.jsx(mS,L({},Q)),!F&&_&&P&&d.jsx("div",{className:"shell-layout__mobile-header",children:P}),d.jsx("main",{className:"shell-layout__canvas",children:l})]})]}),$&&d.jsx(Ng,V(L({},G),{mobileBreakpoint:(ae=G.mobileBreakpoint)!=null?ae:u})),_&&B&&d.jsx(gS,{isOpen:y,onClose:()=>x(!1),position:"left",width:"280px",keepMounted:!0,children:d.jsx(wp,V(L({},q),{appTitle:T?E:q.appTitle}))})]}))});aR.displayName="ShellLayout";const Eg=re.forwardRef((p,g)=>{var y=p,{isOpen:e,onClose:t,title:n,subtitle:i,children:r,footer:l,hintFooter:o,size:u="md",className:f=""}=y,m=pe(y,["isOpen","onClose","title","subtitle","children","footer","hintFooter","size","className"]);const x=re.useId(),_=k.useRef(null),S=k.useRef(null);k.useImperativeHandle(g,()=>S.current),qd(S,e),Cg(e),k.useEffect(()=>{const N=R=>{R.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(L({ref:S,className:["modal",`modal--${u}`,f].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(je,{name:"x",size:14})})]}),d.jsx("div",{className:"modal__body",children:r}),l&&d.jsx("div",{className:"modal__footer",children:l}),o&&d.jsx("div",{className:"modal__foot-hint",children:o})]}))}):null});Eg.displayName="Modal";const yS=re.forwardRef(({isOpen:e,onClose:t,onConfirm:n,title:i,subtitle:r,message:l,confirmLabel:o="Confirm",cancelLabel:u="Cancel",variant:f="danger"},m)=>d.jsxs(Eg,{ref:m,isOpen:e,onClose:t,title:i,subtitle:r,children:[d.jsx("div",{className:"confirm-dialog__message",children:l}),d.jsxs("div",{className:"confirm-dialog__footer",children:[d.jsx(En,{variant:"ghost",size:"sm",onClick:t,children:u}),d.jsx(En,{variant:f,size:"sm",onClick:n,children:o})]})]}));yS.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(je,{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 iR=re.forwardRef(({isOpen:e,onClose:t,title:n="Switch Workspace",current:i,recent:r=[],onOpenFolder:l,onNewWorkspace:o,onCloneFromGit:u,onPickRecent:f},m)=>d.jsx(Eg,{ref:m,isOpen:e,onClose:t,title:n,size:"lg",children:d.jsxs("div",{className:"workspace-switcher-dialog__content",children:[(l||o||u)&&d.jsxs("div",{className:"workspace-switcher-dialog__tiles",children:[l&&d.jsx(Mm,{icon:"folder",title:"Open folder…",description:"Point to an existing workspace directory",onClick:l}),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:()=>f(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)})})]})]})}));iR.displayName="WorkspaceSwitcherDialog";const vS=k.createContext(void 0);function Vd(){const e=k.useContext(vS);if(!e)throw new Error("FilterDropdown components must be used within FilterDropdown");return e}const xS=re.forwardRef(({mode:e="checkbox",children:t,onChange:n,className:i="",defaultValue:r,value:l,placement:o="bottom-start"},u)=>{const[f,m]=k.useState(!1),g=l!==void 0,[p,y]=k.useState(new Set(r!=null?r:[])),x=g?new Set(l):p,_=k.useRef(null),S=k.useRef(null),w=k.useRef(null),N=k.useCallback(()=>m(!1),[]),{focusedValue:R,setFocusedValue:C}=Hd({triggerRef:_,panelRef:S,isOpen:f,onClose:N}),E=k.useCallback(O=>{m(O)},[]),T=k.useCallback((O,F)=>{const A=new Set(x);F?(e==="radio"&&A.clear(),A.add(O)):A.delete(O),g||y(A),n==null||n(Array.from(A)),e==="radio"&&F&&m(!1)},[x,e,n,g]),D={isOpen:f,onOpenChange:E,mode:e,selectedValues:x,onValueChange:T,focusedValue:R,setFocusedValue:C,triggerRef:_,panelRef:S,placement:o};return d.jsx(vS.Provider,{value:D,children:d.jsx("div",{ref:O=>{w.current=O,typeof u=="function"?u(O):u&&(u.current=O)},className:`filter-dropdown ${i}`.trim(),children:t})})});xS.displayName="FilterDropdown";function sR(i){var r=i,{label:e,summary:t}=r,n=pe(r,["label","summary"]);const{isOpen:l,onOpenChange:o,triggerRef:u,mode:f}=Vd();return d.jsxs("button",V(L({ref:u,type:"button"},n),{className:"filter-dropdown__trigger",onClick:()=>o(!l),"aria-haspopup":f==="radio"?"dialog":"listbox","aria-expanded":l,children:[d.jsx("span",{className:"filter-dropdown__label",children:e}),d.jsx("span",{className:"filter-dropdown__summary",children:t}),d.jsx(je,{name:"chevronDown",size:14,className:`filter-dropdown__chevron ${l?"filter-dropdown__chevron--open":""}`})]}))}function rR(r){var l=r,{children:e,className:t="",style:n}=l,i=pe(l,["children","className","style"]);const{isOpen:o,mode:u,panelRef:f,placement:m}=Vd();return d.jsx("div",V(L({ref:f,className:`dropdown-panel ${Pd(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 lR({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 oR({value:e,label:t,description:n}){const{selectedValues:i,onValueChange:r,focusedValue:l,setFocusedValue:o,mode:u}=Vd(),f=k.useRef(null),m=i.has(e),g=l===e;return k.useEffect(()=>{var p;g&&((p=f.current)==null||p.focus())},[g]),d.jsxs("button",{ref:f,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 cR({value:e,label:t,description:n}){const{selectedValues:i,onValueChange:r,focusedValue:l,setFocusedValue:o}=Vd(),u=k.useRef(null),f=i.has(e),m=l===e;return k.useEffect(()=>{var g;m&&((g=u.current)==null||g.focus())},[m]),d.jsxs("button",{ref:u,type:"button",role:"radio","aria-checked":f,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:f,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(xS,{Trigger:sR,Panel:rR,Section:lR,Checkbox:oR,Radio:cR});const uR={success:"check",error:"x",warning:"alert",info:"info"},dR={success:"emerald",error:"rose",warning:"amber",info:"cyan"},bS=re.forwardRef((g,m)=>{var p=g,{isOpen:e,onClose:t,title:n,subtitle:i,variant:r="info",icon:l,duration:o=4e3,className:u=""}=p,f=pe(p,["isOpen","onClose","title","subtitle","variant","icon","duration","className"]);if(k.useEffect(()=>{if(e&&o){const _=setTimeout(t,o);return()=>clearTimeout(_)}},[e,o,t]),!e)return null;const y=l||uR[r],x=dR[r];return d.jsxs("div",V(L({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"},f),{children:[d.jsx("div",{className:`toast__icon toast__icon--${x}`,children:d.jsx(je,{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(je,{name:"x",size:14})})]}))});bS.displayName="Toast";const _S=({content:e,children:t,placement:n="top",delay:i=200,offset:r=6,className:l="",disabled:o=!1,open:u})=>{const f=u!==void 0,[m,g]=k.useState(!1),p=f?u:m,[y,x]=k.useState(n),_=k.useRef(),S=k.useRef(null),w=k.useId();k.useEffect(()=>()=>clearTimeout(_.current),[]),k.useEffect(()=>{o&&(clearTimeout(_.current),f||g(!1))},[o,f]),k.useEffect(()=>{p||x(n)},[p,n]),k.useLayoutEffect(()=>{if(!p)return;const E=S.current;if(!E)return;const T=E.getBoundingClientRect();n==="top"&&T.top<0?x("bottom"):n==="bottom"&&T.bottom>window.innerHeight?x("top"):n==="left"&&T.left<0?x("right"):n==="right"&&T.right>window.innerWidth&&x("left")},[p,n]);const N=()=>{o||f||(clearTimeout(_.current),_.current=setTimeout(()=>{x(n),g(!0)},i))},R=()=>{f||(clearTimeout(_.current),g(!1))},C=p&&!o&&e!=null;return d.jsxs("span",{className:"tooltip-wrapper",onPointerEnter:N,onPointerLeave:R,onFocus:N,onBlur:R,children:[re.cloneElement(t,C?{"aria-describedby":w}:{}),C&&d.jsx("div",{ref:S,role:"tooltip",id:w,className:["tooltip",`tooltip--${y}`,l].filter(Boolean).join(" "),style:{"--tooltip-offset":`${r}px`},children:e})]})};_S.displayName="Tooltip";const fR=re.forwardRef(({isOpen:e,onClose:t,commands:n=[],placeholder:i="Search commands…",emptyMessage:r="No commands found"},l)=>{const[o,u]=k.useState(""),[f,m]=k.useState(0),g=k.useRef(null),p=k.useRef(null),y=re.useId(),x=re.useId();k.useImperativeHandle(l,()=>p.current),qd(p,e),Cg(e);const _=k.useMemo(()=>{const N=o.toLowerCase();return n.filter(R=>{var E;var C;return R.label.toLowerCase().includes(N)||((E=(C=R.description)==null?void 0:C.toLowerCase().includes(N))!=null?E:!1)})},[n,o]),S=k.useMemo(()=>{const N=[],R=new Map;return _.forEach((C,E)=>{R.has(C.group)||(R.set(C.group,[]),N.push(C.group)),R.get(C.group).push({cmd:C,index:E})}),N.map(C=>({name:C,items:R.get(C)}))},[_]);k.useEffect(()=>{e?setTimeout(()=>{var N;return(N=g.current)==null?void 0:N.focus()},0):(u(""),m(0))},[e]),k.useEffect(()=>{const N=R=>{e&&(R.key==="Escape"?t():R.key==="ArrowDown"?(R.preventDefault(),_.length>0&&m(C=>(C+1)%_.length)):R.key==="ArrowUp"?(R.preventDefault(),_.length>0&&m(C=>(C-1+_.length)%_.length)):R.key==="Enter"&&(R.preventDefault(),_[f]&&(_[f].onSelect(),t(),u(""))))};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[e,t,_,f]);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(je,{name:"search",size:16}),d.jsx("input",{ref:g,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":!0,"aria-controls":y,"aria-activedescendant":_[f]?`${y}-${_[f].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 R;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:E})=>d.jsxs("button",{type:"button",id:`${y}-${C.id}`,role:"option","aria-selected":E===f,className:["command-palette__item",E===f&&"command-palette__item--selected"].filter(Boolean).join(" "),onClick:()=>{C.onSelect(),t(),u("")},children:[C.icon&&d.jsx(je,{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))]},(R=N.name)!=null?R:"__ungrouped")})})]})}):null});fR.displayName="CommandPalette";const SS=re.forwardRef((g,m)=>{var p=g,{title:e,subtitle:t,headerAction:n,footer:i,bordered:r=!0,noPadding:l=!1,className:o="",children:u}=p,f=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(L({ref:m,className:y},f),{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:l?"panel__body panel__body--no-padding":"panel__body",children:u}),i&&d.jsx("div",{className:"panel__footer",children:i})]}))});SS.displayName="Panel";const hR=re.forwardRef((y,p)=>{var x=y,{direction:e="horizontal",initialSplitPercent:t=50,splitPercent:n,onSplitChange:i,minSize:r=200,maxSize:l=800,first:o,second:u,dividerLabel:f,className:m=""}=x,g=pe(x,["direction","initialSplitPercent","splitPercent","onSplitChange","minSize","maxSize","first","second","dividerLabel","className"]);const[_,S]=k.useState(t),w=k.useRef(null),N=n!==void 0,R=N?n:_,C=k.useCallback((A,M)=>{const B=r/M*100,H=l/M*100;return Math.max(B,Math.min(A,H))},[r,l]),E=k.useCallback(A=>{N||S(A),i==null||i(A)},[N,i]),T=k.useCallback(A=>M=>{A.forEach(B=>{typeof B=="function"?B(M):B&&(B.current=M)})},[]),D=k.useCallback(()=>{const A=B=>{if(!w.current)return;const H=w.current.getBoundingClientRect(),G=e==="horizontal",$=G?B.clientX-H.left:B.clientY-H.top,q=G?H.width:H.height,P=$/q*100;E(C(P,q))},M=()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",M)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",M)},[e,C,E]),O=k.useCallback(A=>{if(!w.current)return;const M=A.shiftKey?10:2,B=e==="horizontal",H=w.current.getBoundingClientRect(),G=B?H.width:H.height;A.key==="ArrowLeft"||A.key==="ArrowUp"?(A.preventDefault(),E(C(R-M,G))):(A.key==="ArrowRight"||A.key==="ArrowDown")&&(A.preventDefault(),E(C(R+M,G)))},[e,R,C,E]),F=["split-pane",`split-pane--${e}`,m].filter(Boolean).join(" ");return d.jsxs("div",V(L({ref:T([w,p]),className:F},g),{children:[d.jsx("div",{className:"split-pane__first",style:e==="horizontal"?{width:`${R}%`}:{height:`${R}%`},children:o}),d.jsx("div",{role:"separator","aria-orientation":e==="horizontal"?"vertical":"horizontal","aria-valuenow":Math.round(R),"aria-valuemin":0,"aria-valuemax":100,"aria-label":f!=null?f:e==="horizontal"?"Horizontal divider":"Vertical divider",tabIndex:0,className:`split-pane__divider split-pane__divider--${e}`,onMouseDown:D,onKeyDown:O}),d.jsx("div",{className:"split-pane__second",style:e==="horizontal"?{width:`${100-R}%`}:{height:`${100-R}%`},children:u})]}))});hR.displayName="SplitPane";const wS=k.createContext(void 0),NS=()=>{const e=k.useContext(wS);if(!e)throw new Error("InspectorPanel.Section must be used within an InspectorPanel");return e},CS=re.forwardRef((u,o)=>{var f=u,{title:e,count:t,actions:n,children:i,className:r=""}=f,l=pe(f,["title","count","actions","children","className"]);NS();const m=["inspector-panel__section",r].filter(Boolean).join(" ");return d.jsxs("div",V(L({ref:o,className:m},l),{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})]}))});CS.displayName="InspectorPanel.Section";const ES=re.forwardRef((m,f)=>{var g=m,{title:e,count:t,actionIcon:n,actionLabel:i,onAction:r,rows:l,className:o=""}=g,u=pe(g,["title","count","actionIcon","actionLabel","onAction","rows","className"]);NS();const p=["inspector-panel__property-section",o].filter(Boolean).join(" ");return d.jsxs("div",V(L({ref:f,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})]}),l.length>0&&d.jsx("div",{className:"inspector-panel__property-rows",children:l.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))})]}))});ES.displayName="InspectorPanel.PropertySection";const jS=re.forwardRef((m,f)=>{var g=m,{eyebrow:e="",title:t,id:n,version:i,actions:r,children:l,className:o=""}=g,u=pe(g,["eyebrow","title","id","version","actions","children","className"]);const p=["inspector-panel",o].filter(Boolean).join(" ");return d.jsx(wS.Provider,{value:!0,children:d.jsxs("div",V(L({ref:f,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(da,{children:i})]}),r&&d.jsx("div",{className:"inspector-panel__actions",children:r})]}),d.jsx("div",{className:"inspector-panel__body",children:l})]}))})});jS.displayName="InspectorPanel";Object.assign(jS,{Section:CS,PropertySection:ES});const mR=re.forwardRef((o,l)=>{var u=o,{rows:e=[],keyWidth:t,className:n="",style:i}=u,r=pe(u,["rows","keyWidth","className","style"]);const f=["kv-grid",n].filter(Boolean).join(" "),m=t?V(L({},i),{gridTemplateColumns:`${typeof t=="number"?`${t}px`:t} 1fr`}):i;return d.jsx("dl",V(L({ref:l,className:f,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))}))});mR.displayName="KVGrid";const pR=re.forwardRef((f,u)=>{var m=f,{label:e,width:t,height:n,viewBox:i,className:r="",children:l}=m,o=pe(m,["label","width","height","viewBox","className","children"]);return d.jsx("svg",V(L({ref:u,role:"img","aria-label":e,width:t,height:n,viewBox:i,className:r,style:{display:"block"}},o),{children:l}))});pR.displayName="ChartWrapper";const Il=["#22D3EE","#10B981","#F59E0B","#818CF8","#8B5CF6","#F43F5E"],zb=Il,Us={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 zs(e){return Math.abs(e)>=1e3?(e/1e3).toFixed(1)+"k":Number.isInteger(e)?String(e):e.toFixed(1)}const Bb="#F59E0B",gR="#B45309",yR="#1B2949",vR="#2A3A5C",xR="#E6EDF3",bR="#A6B1BD",_R=re.forwardRef((R,N)=>{var C=R,{series:e,colors:t,xLabels:n,width:i=480,height:r=200,area:l=!1,axes:o=!1,grid:u=!1,ticks:f=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 E=Us[y],T=re.useId(),D=t!=null?t:e.length===1?[Il[0]]:Il,O=L({top:8,right:p?12:8,bottom:o?22:6,left:o?30:6},x),F=i-O.left-O.right,A=r-O.top-O.bottom,M=e.flat();if(M.length===0)return null;let B=Math.min(...M),H=Math.max(...M);const G=H-B||1;B-=G*.08,H+=G*.08,m&&(B=Math.min(B,m.value),H=Math.max(H,m.value));const $=Math.max(...e.map(ae=>ae.length)),q=ae=>O.left+($<=1?F/2:ae/($-1)*F),P=ae=>O.top+A-(ae-B)/(H-B)*A,Q=[];for(let ae=0;ae<=f;ae++)Q.push(B+ae/f*(H-B));const[K,W]=re.useState(null);function z(ae){const ye=ae.currentTarget.getBoundingClientRect(),xe=(ae.clientX-ye.left)/ye.width*i,he=Math.max(0,Math.min($-1,Math.round((xe-O.left)/F*($-1))));W(he)}function se(ae){return ae.map(([ye,xe],he)=>(he?"L":"M")+ye.toFixed(2)+","+xe.toFixed(2)).join(" ")}const ue=e.map(ae=>ae.map((ye,xe)=>[q(xe),P(ye)]));return d.jsxs("svg",V(L({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:L({display:"block",cursor:p?"crosshair":"default"},S),onMouseMove:p?z:void 0,onMouseLeave:p?()=>W(null):void 0},w),{children:[u&&Q.map((ae,ye)=>d.jsx("line",{x1:O.left,x2:i-O.right,y1:P(ae),y2:P(ae),stroke:E.grid,strokeWidth:"1"},"g"+ye)),o&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:O.left,x2:O.left,y1:O.top,y2:O.top+A,stroke:E.border,strokeWidth:"1"}),d.jsx("line",{x1:O.left,x2:i-O.right,y1:O.top+A,y2:O.top+A,stroke:E.border,strokeWidth:"1"}),Q.map((ae,ye)=>d.jsx("text",{x:O.left-6,y:P(ae)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:E.fg3,children:zs(ae)},"yt"+ye)),n&&n.map((ae,ye)=>d.jsx("text",{x:q(ye),y:O.top+A+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:E.fg3,children:ae},"xt"+ye))]}),m&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:O.left,x2:i-O.right,y1:P(m.value),y2:P(m.value),stroke:E.fg3,strokeWidth:"1",strokeDasharray:"3 3"}),m.label&&d.jsx("text",{x:i-O.right-4,y:P(m.value)-4,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:E.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:m.label})]}),g&&g.map((ae,ye)=>d.jsxs("g",{children:[d.jsx("line",{x1:q(ae.x),x2:q(ae.x),y1:O.top-2,y2:O.top+A,stroke:Bb,strokeWidth:"1",strokeDasharray:"2 2"}),d.jsx("circle",{cx:q(ae.x),cy:O.top+4,r:"3",fill:Bb}),ae.label&&d.jsx("text",{x:q(ae.x)+6,y:O.top+7,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:gR,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:ae.label})]},"mk"+ye)),ue.map((ae,ye)=>{const xe=D[ye%D.length],he=se(ae),we=`${he} L${ae[ae.length-1][0].toFixed(2)},${O.top+A} L${ae[0][0].toFixed(2)},${O.top+A} Z`,Ce=`${T}-lg${ye}`;return d.jsxs("g",{children:[l&&d.jsxs(d.Fragment,{children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:Ce,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:we,fill:`url(#${Ce})`})]}),d.jsx("path",{d:he,stroke:xe,strokeWidth:p?1.75:1.5,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})]},"s"+ye)}),p&&K!==null&&(()=>{const ae=18+e.length*16;let ye=q(K)+10;ye+132>i-4&&(ye=q(K)-132-10);const xe=O.top+4;return d.jsxs("g",{children:[d.jsx("line",{x1:q(K),x2:q(K),y1:O.top,y2:O.top+A,stroke:E.fg3,strokeWidth:"1",strokeDasharray:"2 3"}),e.map((he,we)=>he[K]!=null&&d.jsx("circle",{cx:q(K),cy:P(he[K]),r:"3",fill:E.card,stroke:D[we%D.length],strokeWidth:"1.75"},"h"+we)),d.jsx("rect",{x:ye,y:xe,width:132,height:ae,rx:"6",fill:yR,stroke:vR}),d.jsx("text",{x:ye+9,y:xe+13,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:bR,style:{textTransform:"uppercase",letterSpacing:"0.10em"},children:n?n[K]:`t${K}`}),e.map((he,we)=>d.jsxs("g",{children:[d.jsx("rect",{x:ye+9,y:xe+22+we*16,width:"6",height:"6",rx:"1",fill:D[we%D.length]}),d.jsx("text",{x:ye+20,y:xe+28+we*16,fontFamily:"JetBrains Mono, monospace",fontSize:"10.5",fill:xR,children:he[K]!=null?zs(he[K]):"—"})]},"tt"+we))]})})()]}))});_R.displayName="LineChart";const SR=re.forwardRef((x,y)=>{var _=x,{series:e,xLabels:t=[],yMin:n,yMax:i,yTickCount:r=5,legend:l=!1,width:o=400,height:u=200,tone:f="light",ariaLabel:m,className:g=""}=_,p=pe(_,["series","xLabels","yMin","yMax","yTickCount","legend","width","height","tone","ariaLabel","className"]);const S=Us[f],w=Q=>d.jsx("div",V(L({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,R=-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 K=0;K<Q.data.length;K++){const W=Q.data[K];W<N&&(N=W),W>R&&(R=W)}}}),C===0)return w("No data");const E=isFinite(N)&&isFinite(R),T=n!==void 0?n:E?Math.min(0,N):0,D=(i!==void 0?i:E?R:1)-T||1,O={top:8,right:10,bottom:22,left:36},F=o-O.left-O.right,A=u-O.top-O.bottom,M=Q=>O.top+A-(Q-T)/D*A,B=M(Math.max(T,0)),H=Array.from({length:r},(Q,K)=>{const W=r===1?1:r-1,z=T+D*K/W;return{value:z,y:M(z)}}),G=F/C,$=G*.18,q=Math.max(1,(G-$*2)/e.length),P=(Q,K)=>Q.color?gc[Q.color]:zb[K%zb.length];return d.jsxs("div",V(L({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}),H.map((Q,K)=>d.jsxs("g",{children:[d.jsx("line",{x1:O.left,x2:o-O.right,y1:Q.y,y2:Q.y,stroke:S.grid,strokeWidth:"1"}),d.jsx("text",{x:O.left-6,y:Q.y+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:zs(Q.value)})]},`y-${K}`)),d.jsx("line",{x1:O.left,x2:O.left,y1:O.top,y2:O.top+A,stroke:S.border,strokeWidth:"1"}),d.jsx("line",{x1:O.left,x2:o-O.right,y1:O.top+A,y2:O.top+A,stroke:S.border,strokeWidth:"1"}),e.map((Q,K)=>{const W=P(Q,K);return d.jsx("g",{children:Q.data.map((z,se)=>{const ue=O.left+se*G+$+K*q,I=M(z),ae=Math.min(I,B),ye=Math.abs(B-I);return d.jsx("rect",{x:ue,y:ae,width:Math.max(1,q-1),height:Math.max(0,ye),fill:W,rx:"1"},`bar-${K}-${se}`)})},`series-${K}`)}),t.map((Q,K)=>d.jsx("text",{x:O.left+(K+.5)*G,y:O.top+A+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:Q},`x-${K}`))]}),l&&d.jsx("div",{style:{display:"flex",gap:"12px",fontSize:"12px",flexWrap:"wrap",color:S.fg2},children:e.map((Q,K)=>d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[d.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"1px",backgroundColor:P(Q,K)}}),d.jsx("span",{children:Q.name})]},`legend-${K}`))})]}))});SR.displayName="BarChart";const wR=re.forwardRef((S,_)=>{var w=S,{values:e,xLabels:t,color:n,width:i=480,height:r=200,axes:l=!1,grid:o=!1,ticks:u=4,threshold:f,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=Us[m],R=n!=null?n:Il[2],C={top:8,right:8,bottom:l?22:6,left:l?30:6},E=i-C.left-C.right,T=r-C.top-C.bottom;if(!e||e.length===0)return null;const D=Math.max(...e,f?f.value:0),O=e.length,F=Math.max(2,E/O*.22),A=(E-F*(O-1))/O,M=H=>C.top+T-H/(D||1)*T,B=[];for(let H=0;H<=u;H++)B.push(H/u*D);return d.jsxs("svg",V(L({ref:_,role:"img","aria-label":g,width:i,height:r,viewBox:`0 0 ${i} ${r}`,className:p,style:L({display:"block"},y)},x),{children:[o&&B.map((H,G)=>d.jsx("line",{x1:C.left,x2:i-C.right,y1:M(H),y2:M(H),stroke:N.grid,strokeWidth:"1"},"g"+G)),l&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:C.left,x2:C.left,y1:C.top,y2:C.top+T,stroke:N.border,strokeWidth:"1"}),d.jsx("line",{x1:C.left,x2:i-C.right,y1:C.top+T,y2:C.top+T,stroke:N.border,strokeWidth:"1"}),B.map((H,G)=>d.jsx("text",{x:C.left-6,y:M(H)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:N.fg3,children:zs(H)},"yt"+G))]}),e.map((H,G)=>{const $=C.left+G*(A+F),q=M(H);return d.jsxs("g",{children:[d.jsx("rect",{x:$,y:q,width:A,height:C.top+T-q,fill:R,rx:"1"}),l&&t&&t[G]!==void 0&&d.jsx("text",{x:$+A/2,y:C.top+T+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:N.fg3,children:t[G]})]},G)}),f&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:C.left,x2:i-C.right,y1:M(f.value),y2:M(f.value),stroke:N.fg3,strokeWidth:"1",strokeDasharray:"3 3"}),f.label&&d.jsx("text",{x:i-C.right-4,y:M(f.value)-4,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:N.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:f.label})]})]}))});wR.displayName="BarV";const NR="#22D3EE",CR=re.forwardRef((y,p)=>{var x=y,{items:e,width:t=320,height:n=200,tone:i="light",showValues:r=!0,valueFormat:l,maxValue:o,label:u,className:f="",style:m}=x,g=pe(x,["items","width","height","tone","showValues","valueFormat","maxValue","label","className","style"]);const _=Us[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 R=o!=null?o:Math.max(...e.map(D=>D.value)),C=N/e.length,E=Math.min(C*.62,14),T=l!=null?l:zs;return d.jsx("svg",V(L({ref:p,role:"img","aria-label":u!=null?u:"Horizontal bar chart",width:t,height:n,viewBox:`0 0 ${t} ${n}`,className:f,style:L({display:"block"},m)},g),{children:e.map((D,O)=>{var B;const F=S.top+O*C+(C-E)/2,A=D.value/(R||1)*w,M=(B=D.color)!=null?B:NR;return d.jsxs("g",{children:[d.jsx("text",{x:S.left-10,y:F+E*.78,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:_.fg2,children:D.label}),d.jsx("rect",{x:S.left,y:F,width:w,height:E,fill:_.inset,rx:"2"}),d.jsx("rect",{x:S.left,y:F,width:A,height:E,fill:M,rx:"2"}),r&&d.jsx("text",{x:S.left+A+6,y:F+E*.78,fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:_.fg2,fontWeight:"500",children:T(D.value)})]},D.label)})}))});CR.displayName="BarH";const ER=re.forwardRef((S,_)=>{var w=S,{stacks:e,colors:t,width:n=480,height:i=200,axes:r=!1,grid:l=!1,ticks:o=4,normalized:u=!1,tone:f="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=Us[f],R=t!=null?t:Il,C={top:g?24:8,right:8,bottom:r?22:6,left:r?30:6},E=n-C.left-C.right,T=i-C.top-C.bottom;if(!e||e.length===0)return null;const D=e.map($=>$.parts.reduce((q,P)=>isNaN(q)||isNaN(P)?NaN:q+P,0)),O=D.filter($=>!isNaN($)),F=u?1:O.length>0?Math.max(...O):1,A=e.length,M=Math.max(2,E/A*.22),B=(E-M*(A-1))/A,H=[];for(let $=0;$<=o;$++)H.push($/o*F);const G=$=>C.top+T-$/(F||1)*T;return d.jsxs("svg",V(L({ref:_,role:"img","aria-label":m,width:n,height:i,viewBox:`0 0 ${n} ${i}`,className:p,style:L({display:"block"},y)},x),{children:[l&&H.map(($,q)=>d.jsx("line",{x1:C.left,x2:n-C.right,y1:G($),y2:G($),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+T,stroke:N.border,strokeWidth:"1"}),d.jsx("line",{x1:C.left,x2:n-C.right,y1:C.top+T,y2:C.top+T,stroke:N.border,strokeWidth:"1"}),H.map(($,q)=>d.jsx("text",{x:C.left-6,y:G($)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:N.fg3,children:u?`${Math.round($*100)}%`:zs($)},"yt"+q))]}),e.map(($,q)=>{const P=C.left+q*(B+M),Q=!isNaN(D[q])&&D[q]>0?D[q]:Math.max(...O,1);let K=0;return d.jsxs("g",{children:[$.parts.map((W,z)=>{if(isNaN(W))return null;const se=(u?W/Q:W)/(F||1)*T,ue=C.top+T-K-se;return K+=se,d.jsx("rect",{x:P,y:ue,width:B,height:se,fill:R[z%R.length]},z)}),g&&!isNaN(D[q])&&d.jsx("text",{x:P+B/2,y:C.top+T-K-6,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:N.fg3,children:g==="total"?zs(D[q]):g($)}),r&&d.jsx("text",{x:P+B/2,y:C.top+T+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:N.fg3,children:$.label})]},q)})]}))});ER.displayName="StackedBar";const jR=re.forwardRef((_,x)=>{var S=_,{slices:e,colors:t,width:n=160,height:i=160,thickness:r=14,gap:l=.03,centerValue:o,centerLabel:u,"aria-label":f,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=Us[m],N=t!=null?t:Il;if(!e||e.length===0)return null;const R=n/2,C=i/2,E=Math.min(n,i)/2-4,T=E-r,D=e.reduce((G,$)=>G+$.value,0)||1;function O(G,$){const q=Math.cos(G),P=Math.sin(G),Q=Math.cos($),K=Math.sin($),W=$-G>Math.PI?1:0;return[`M ${R+E*q} ${C+E*P}`,`A ${E} ${E} 0 ${W} 1 ${R+E*Q} ${C+E*K}`,`L ${R+T*Q} ${C+T*K}`,`A ${T} ${T} 0 ${W} 0 ${R+T*q} ${C+T*P}`,"Z"].join(" ")}const F=e.length>1?l:0;let A=-Math.PI/2;const M=e.map((G,$)=>{var K;const q=G.value/D*Math.PI*2,P=A+F/2;let Q=A+q-F/2;return Q-P>=Math.PI*2-1e-6&&(Q=P+Math.PI*2-1e-6),Q<=P&&(Q=P+1e-4),A+=q,{d:O(P,Q),color:(K=G.color)!=null?K:N[$%N.length]}}),B=Math.min(n,i)*.22,H=C+Math.min(n,i)*.18;return d.jsxs("svg",V(L({ref:x,role:"img","aria-label":f!=null?f:"Donut chart",width:n,height:i,viewBox:`0 0 ${n} ${i}`,className:g,style:L({display:"block"},p)},y),{children:[M.map((G,$)=>d.jsx("path",{d:G.d,fill:G.color},$)),o!=null&&d.jsx("text",{x:R,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:R,y:H,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:w.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:u})]}))});jR.displayName="Donut";const kR=re.forwardRef((w,S)=>{var N=w,{data:e,baseColor:t="#10B981",xLabels:n,yLabels:i,width:r=480,height:l=120,axes:o=!1,tone:u="light",showValues:f=!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 R=Us[u];if(!e||e.length===0)return null;const C=e.length,E=e[0].length,T={top:4,right:8,bottom:o?18:4,left:o?28:4},D=(r-T.left-T.right)/E,O=(l-T.top-T.bottom)/C,F=e.flat().filter(q=>q!=null&&!isNaN(q)),A=F.length?Math.min(...F):0,M=F.length?Math.max(...F):1,B=t.replace("#",""),H=m!=null?m:zs;function G(q){if(q==null||isNaN(q))return R.inset;const P=(q-A)/(M-A||1),Q=Math.round((.12+P*.88)*255).toString(16).padStart(2,"0");return`#${B}${Q}`}function $(q){return(q-A)/(M-A||1)>.55?"#FFFFFF":R.fg1}return d.jsxs("svg",V(L({ref:S,role:"img","aria-label":p!=null?p:"Heatmap",width:r,height:l,viewBox:`0 0 ${r} ${l}`,className:y,style:L({display:"block"},x)},_),{children:[p&&d.jsx("title",{children:p}),e.map((q,P)=>q.map((Q,K)=>{const W=T.left+K*D+1,z=T.top+P*O+1,se=W+(D-2)/2,ue=z+(O-2)/2,I=g==null?void 0:g(P,K,Q!=null&&!isNaN(Q)?Q:null);return d.jsxs("g",{children:[d.jsx("rect",{x:W,y:z,width:Math.max(0,D-2),height:Math.max(0,O-2),fill:G(Q),rx:"2"}),f&&Q!=null&&!isNaN(Q)&&d.jsx("text",{x:se,y:ue+3.5,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:$(Q),children:H(Q)}),I&&d.jsx("g",{transform:`translate(${se}, ${ue})`,children:I})]},`${P}-${K}`)})),o&&i&&i.map((q,P)=>d.jsx("text",{x:T.left-6,y:T.top+P*O+O/2+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:R.fg3,children:q},"y"+P)),o&&n&&n.map((q,P)=>d.jsx("text",{x:T.left+P*D+D/2,y:l-T.bottom+12,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:R.fg3,children:q},"x"+P))]}))});kR.displayName="Heatmap";const TR="#B45309",Am={ok:"#10B981",warn:"#F59E0B",error:"#F43F5E",idle:"",info:"#22D3EE"},RR=re.forwardRef((x,y)=>{var _=x,{tracks:e,range:t=[0,100],width:n=480,height:i=160,axes:r=!1,xLabels:l,marker:o,tone:u="light","aria-label":f,className:m="",style:g}=_,p=pe(_,["tracks","range","width","height","axes","xLabels","marker","tone","aria-label","className","style"]);const S=Us[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,R=i-w.top-w.bottom,C=R/e.length,E=Math.min(C*.6,14),T=O=>w.left+(O-t[0])/(t[1]-t[0]||1)*N;function D(O){var F;return O==="idle"?S.border:(F=Am[O])!=null?F:O}return d.jsxs("svg",V(L({ref:y,role:"img","aria-label":f,width:n,height:i,viewBox:`0 0 ${n} ${i}`,className:m,style:L({display:"block"},g)},p),{children:[e.map((O,F)=>{const A=w.top+F*C+(C-E)/2;return d.jsxs("g",{children:[d.jsx("text",{x:w.left-10,y:A+E*.78,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:S.fg2,children:O.label}),d.jsx("rect",{x:w.left,y:A,width:N,height:E,fill:S.inset,rx:"2"}),O.segments.map((M,B)=>d.jsx("rect",{x:T(M.start),y:A,width:Math.max(2,T(M.end)-T(M.start)),height:E,fill:D(M.kind),rx:"2"},B))]},F)}),r&&l&&l.map((O,F)=>d.jsx("text",{x:w.left+F/(l.length-1)*N,y:w.top+R+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:O},"x"+F)),o&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:T(o.x),x2:T(o.x),y1:w.top-2,y2:w.top+R+2,stroke:Am.warn,strokeWidth:"1",strokeDasharray:"2 2"}),d.jsx("circle",{cx:T(o.x),cy:w.top-2,r:"3",fill:Am.warn}),o.label&&d.jsx("text",{x:T(o.x)+6,y:w.top+2,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:TR,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:o.label})]})]}))});RR.displayName="StatusTimeline";const jg=re.forwardRef((u,o)=>{var f=u,{percent:e,color:t="emerald",height:n=6,label:i,className:r=""}=f,l=pe(f,["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(L({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},l),{children:d.jsx("div",{className:"progress-bar__fill",style:{width:`${m}%`}})}))});jg.displayName="ProgressBar";const MR=re.forwardRef((p,g)=>{var y=p,{label:e,value:t,unit:n,percent:i,sparklineData:r=[],color:l="emerald",progressLabel:o,className:u="","aria-label":f}=y,m=pe(y,["label","value","unit","percent","sparklineData","color","progressLabel","className","aria-label"]);return d.jsxs("div",V(L({ref:g,role:"row","aria-label":f!=null?f: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(jg,{percent:i,color:l,height:6,label:o!=null?o:e})}),d.jsx("div",{className:"metric-row__sparkline",children:d.jsx(_g,{data:r,width:60,height:18,color:l})}),d.jsxs("div",{className:"metric-row__value",children:[t,n&&d.jsx("span",{className:"metric-row__unit",children:n})]})]}))});MR.displayName="MetricRow";const kg=re.forwardRef((f,u)=>{var m=f,{eyebrow:e,title:t,idChip:n,subtitle:i,actions:r,className:l=""}=m,o=pe(m,["eyebrow","title","idChip","subtitle","actions","className"]);const g=["page-header",l].filter(Boolean).join(" ");return d.jsxs("div",V(L({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(Xn,{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})]}))});kg.displayName="PageHeader";const AR=re.forwardRef((x,y)=>{var _=x,{filters:e=[],value:t,defaultValue:n="",onSearchChange:i,onFilterRemove:r,onClearAll:l,searchPlaceholder:o="Search...",children:u,showingCount:f,totalCount:m,className:g=""}=_,p=pe(_,["filters","value","defaultValue","onSearchChange","onFilterRemove","onClearAll","searchPlaceholder","children","showingCount","totalCount","className"]);const S=t!==void 0,[w,N]=k.useState(n),R=S?t:w,C=O=>{const F=O.target.value;S||N(F),i==null||i(F)},E=()=>{S||N(""),l==null||l()},T=["filter-bar",g].filter(Boolean).join(" "),D=re.Children.count(u)>0;return d.jsxs("div",V(L({ref:y,className:T,"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(je,{name:"search",size:16,className:"filter-bar__search-icon"}),d.jsx("input",{type:"text","aria-label":"Search",placeholder:o,value:R,onChange:C,className:"filter-bar__search-input","data-testid":"filter-bar-search"})]}),D&&d.jsx("div",{className:"filter-bar__children",children:u}),f!==void 0&&m!==void 0&&d.jsxs("div",{className:"filter-bar__caption",children:["Showing ",f," of ",m]})]}),e.length>0&&d.jsxs("div",{className:"filter-bar__chips","data-testid":"filter-bar-chips",children:[l&&d.jsx("button",{type:"button",className:"filter-bar__clear-all",onClick:E,"data-testid":"filter-bar-clear-all",children:"Clear all"}),e.map(O=>d.jsxs(Xn,{variant:"neutral",className:"filter-bar__chip","data-testid":`filter-chip-${O.id}`,children:[d.jsx("span",{className:"filter-bar__chip-label",children:O.label}),d.jsx("button",{type:"button",className:"filter-bar__chip-close",onClick:()=>r==null?void 0:r(O.id),"aria-label":`Remove ${O.label} filter`,"data-testid":`filter-chip-close-${O.id}`,children:d.jsx(je,{name:"x",size:14})})]},O.id))]})]}))});AR.displayName="FilterBar";const kS=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),l=Math.floor(n/864e5);return i<1?"just now":i<60?`${i}m ago`:r<24?`${r}h ago`:l<7?`${l}d ago`:t.toLocaleDateString()},LR=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}`},zl=(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()},TS=e=>zl(e,new Date),Bl=(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 l=[];for(let o=0;o<7;o++){const u=new Date(r);u.setDate(r.getDate()+o),l.push(u)}return l},DR=8,RS=(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=Bl(i,t),l=[];let o=new Date(r[0]);for(;l.length<DR;){const u=Bl(o,t);l.push(u);const f=u[u.length-1];if(f.getMonth()>n.getMonth()||f.getFullYear()>n.getFullYear())break;o=new Date(f),o.setDate(o.getDate()+1)}return l},OR=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"long",year:"numeric"}),Np=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"short",day:"numeric"}),IR=(e,t)=>{const n=Bl(e,t),i=Np(n[0]),r=Np(n[6]);return`${i} – ${r}`},zR={create:"emerald",update:"cyan",delete:"rose",run:"amber"},BR=re.forwardRef((l,r)=>{var o=l,{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(L({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(L({ref:r,className:u,"data-testid":"activity-timeline"},i),{children:d.jsx("div",{className:"activity-timeline__list",children:e.map(f=>d.jsxs("div",V(L(L({className:["activity-timeline__event",f.onClick?"activity-timeline__event--clickable":""].filter(Boolean).join(" "),"data-testid":`activity-event-${f.id}`},f.kind&&{"data-kind":f.kind}),f.onClick&&{role:"button",tabIndex:0,onClick:()=>f.onClick(f),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),f.onClick(f))}}),{children:[d.jsx("div",{className:"activity-timeline__dot-container",children:f.dotColor?d.jsx("div",{className:"activity-timeline__dot--custom",style:{backgroundColor:gc[f.dotColor]},"data-testid":`activity-dot-custom-${f.id}`}):d.jsx(xg,{color:zR[f.type],className:"activity-timeline__dot","data-testid":`activity-dot-${f.type}`})}),d.jsxs("div",{className:"activity-timeline__content",children:[d.jsxs("div",{className:"activity-timeline__header",children:[f.kind&&d.jsx("span",{className:"activity-timeline__kind-label","data-testid":`activity-kind-tag-${f.id}`,children:f.kindLabel||f.kind}),d.jsx("div",{className:"activity-timeline__subject","data-testid":"activity-subject",children:f.headline||f.subject})]}),f.meta&&d.jsx("div",{className:"activity-timeline__meta","data-testid":"activity-meta",children:f.meta})]}),d.jsx("div",{className:"activity-timeline__timestamp","data-testid":"activity-timestamp",children:kS(f.timestamp)})]}),f.id))})}))});BR.displayName="ActivityTimeline";const UR=re.forwardRef((f,u)=>{var m=f,{entries:e=[],selectedId:t,onSelect:n,order:i="newest-first",emptyState:r="No versions available",className:l=""}=m,o=pe(m,["entries","selectedId","onSelect","order","emptyState","className"]);const g=k.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)))};k.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",l].filter(Boolean).join(" ");if(p.length===0)return d.jsx("div",V(L({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(L({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(L({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(da,{tone:"amber",className:"version-timeline__pill",children:w.label}),w.head&&d.jsx(Xn,{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:kS(w.timestamp)})]}),w.id))})}))});UR.displayName="VersionTimeline";const Tg=({itemCount:e,itemHeight:t,containerHeight:n,overscan:i=5})=>{const r=k.useRef(null),l=k.useRef(null),[o,u]=k.useState([0,Math.ceil(n/t)]);return k.useEffect(()=>{const f=r.current,m=l.current;if(!f||!m)return;const g=()=>{const p=m.getBoundingClientRect(),y=f.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 f.addEventListener("scroll",g,{passive:!0}),g(),()=>{f.removeEventListener("scroll",g)}},[e,t,n,i]),{visibleRange:o,containerRef:r,sentinelRef:l}},ml=28,FR=400,MS=re.forwardRef((u,o)=>{var f=u,{added:e=[],removed:t=[],kept:n=[],maxVisible:i=10,className:r=""}=f,l=pe(f,["added","removed","kept","maxVisible","className"]);const[m,g]=k.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:R}=Tg({itemCount:S,itemHeight:ml,containerHeight:FR}),[C,E]=w,T=["hash-set-diff",r].filter(Boolean).join(" ");return p?d.jsxs("div",V(L({ref:o,className:T,role:"table"},l),{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(da,{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(da,{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(da,{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*ml,position:"relative"},children:[d.jsx("div",{ref:R,style:{position:"absolute",top:0,left:0,width:"1px",height:`${S*ml}px`,visibility:"hidden",pointerEvents:"none"}}),d.jsx("div",{style:{height:C*ml}}),Array.from({length:Math.min(E-C,S-C)}).map((D,O)=>{const F=C+O,A=F<e.length?e[F]:null,M=F<t.length?t[F]:null;let B=null,H=!1;return y&&F===i?H=!0:F<x.length&&(B=x[F]),d.jsxs("div",{className:"hash-set-diff__row",style:{height:ml},role:"row",children:[d.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--added",role:"cell",children:A&&d.jsx("div",{className:"hash-set-diff__item",children:A})}),d.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--removed",role:"cell",children:M&&d.jsx("div",{className:"hash-set-diff__item",children:M})}),d.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--kept",role:"cell",children:H?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-E)*ml)}})]})})]})):d.jsx("div",V(L({ref:o,className:T},l),{children:d.jsx("div",{className:"hash-set-diff__empty",children:"No changes between these versions"})}))});MS.displayName="HashSetDiff";const pl=24,$R=500,Rg=re.forwardRef((r,i)=>{var l=r,{lines:e=[],className:t=""}=l,n=pe(l,["lines","className"]);const{visibleRange:o,containerRef:u,sentinelRef:f}=Tg({itemCount:e.length,itemHeight:pl,containerHeight:$R}),[m,g]=o,p=["side-by-side-diff",t].filter(Boolean).join(" ");return e.length>0?d.jsxs("div",V(L({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(da,{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(da,{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*pl,position:"relative"},children:[d.jsx("div",{ref:f,style:{position:"absolute",top:0,left:0,width:"1px",height:`${e.length*pl}px`,visibility:"hidden",pointerEvents:"none"}}),d.jsx("div",{style:{height:m*pl}}),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:pl},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)*pl)}})]})})]})):d.jsx("div",V(L({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 Mg=k.createContext(null),AS=re.forwardRef((o,l)=>{var u=o,{mode:e="hash-set",onModeChange:t,children:n,className:i=""}=u,r=pe(u,["mode","onModeChange","children","className"]);const[f,m]=k.useState(e);k.useEffect(()=>{m(e)},[e]);const g=x=>{m(x),t==null||t(x)},p=x=>{var _,S,w,N,R;const C=Array.from(((_=x.currentTarget.closest('[role="tablist"]'))==null?void 0:_.querySelectorAll('[role="tab"]'))||[]),E=C.indexOf(x.currentTarget);if(x.key==="ArrowLeft"){x.preventDefault();const T=E>0?E-1:C.length-1;(S=C[T])==null||S.focus()}else if(x.key==="ArrowRight"){x.preventDefault();const T=E<C.length-1?E+1:0;(w=C[T])==null||w.focus()}else x.key==="Home"?(x.preventDefault(),(N=C[0])==null||N.focus()):x.key==="End"&&(x.preventDefault(),(R=C[C.length-1])==null||R.focus())},y=["diff-viewer",i].filter(Boolean).join(" ");return d.jsx(Mg.Provider,{value:f,children:d.jsxs("div",V(L({ref:l,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":f==="hash-set","aria-controls":"diff-viewer-hash-set-panel",className:["diff-viewer__tab",f==="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":f==="side-by-side","aria-controls":"diff-viewer-side-by-side-panel",className:["diff-viewer__tab",f==="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:[f==="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}),f==="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})]})]}))})});AS.displayName="DiffViewer";function LS(f){var m=f,{added:e,removed:t,kept:n,maxVisible:i,label:r="Changes",labelTone:l="amber",className:o=""}=m,u=pe(m,["added","removed","kept","maxVisible","label","labelTone","className"]);return k.useContext(Mg)!=="hash-set"?null:d.jsxs("div",V(L({className:["diff-viewer-hash-set",o].filter(Boolean).join(" ")},u),{children:[r&&d.jsx("div",{className:"diff-viewer-hash-set__header",children:d.jsx(da,{tone:l,className:"diff-viewer-hash-set__label",children:r})}),d.jsx(MS,{added:e,removed:t,kept:n,maxVisible:i})]}))}LS.displayName="DiffViewerHashSet";function DS(u){var f=u,{lines:e,addedLabel:t="Version 2 (Added)",removedLabel:n="Version 1 (Removed)",addedLabelTone:i="emerald",removedLabelTone:r="rose",className:l=""}=f,o=pe(f,["lines","addedLabel","removedLabel","addedLabelTone","removedLabelTone","className"]);return k.useContext(Mg)!=="side-by-side"?null:d.jsxs("div",V(L({className:["diff-viewer-side-by-side",l].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(da,{tone:i,className:"diff-viewer-side-by-side__label",children:t}),n&&d.jsx(da,{tone:r,className:"diff-viewer-side-by-side__label",children:n})]})}),d.jsx(Rg,{lines:e})]}))}DS.displayName="DiffViewerSideBySide";Object.assign(AS,{HashSet:LS,SideBySide:DS});const HR={error:"rose",warn:"amber",info:"cyan",success:"emerald"},PR=re.forwardRef((l,r)=>{var o=l,{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(L({ref:r,className:u,"data-testid":"alert-strip"},i),{children:e.map(f=>d.jsxs("div",{className:"alert-strip__alert","data-testid":`alert-${f.id}`,children:[d.jsx(xg,{color:HR[f.severity],"data-testid":`alert-severity-${f.severity}`}),d.jsx("div",{className:"alert-strip__message","data-testid":"alert-message",children:f.message}),t&&d.jsx("button",{type:"button",className:"alert-strip__dismiss",onClick:()=>t(f.id),"aria-label":`Dismiss alert: ${f.message}`,"data-testid":`alert-dismiss-${f.id}`,children:d.jsx(je,{name:"x",size:16})})]},f.id))}))});PR.displayName="AlertStrip";const OS=re.forwardRef((o,l)=>{var u=o,{icon:e,title:t,description:n,className:i=""}=u,r=pe(u,["icon","title","description","className"]);const f=["quick-access-tile",i].filter(Boolean).join(" ");return d.jsxs("button",V(L({ref:l,type:"button",className:f,"data-testid":"quick-access-tile"},r),{children:[d.jsx("div",{className:"quick-access-tile__icon",children:d.jsx(je,{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(je,{name:"chevronRight",size:13,className:"quick-access-tile__chev"})]}))});OS.displayName="QuickAccessTile";const qR=re.forwardRef((o,l)=>{var u=o,{tiles:e,onAction:t,columns:n=4,className:i=""}=u,r=pe(u,["tiles","onAction","columns","className"]);const f=["quick-access-grid",i].filter(Boolean).join(" ");return d.jsx("div",V(L({ref:l,className:f,style:{"--qa-columns":n},"data-testid":"quick-access-grid"},r),{children:e.map(m=>d.jsx(OS,{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))}))});qR.displayName="QuickAccessGrid";const VR=re.forwardRef((g,m)=>{var p=g,{icon:e,title:t,description:n,summary:i=[],onClick:r,className:l="",disabled:o,type:u="button"}=p,f=pe(p,["icon","title","description","summary","onClick","className","disabled","type"]);const y=["config-tile",o&&"config-tile--disabled",l].filter(Boolean).join(" ");return d.jsxs("button",V(L({ref:m,type:u,className:y,onClick:r,disabled:o,"data-testid":"config-tile"},f),{children:[d.jsx("div",{className:"config-tile__icon",children:d.jsx(je,{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(je,{name:"chevronRight",size:16})})]}))});VR.displayName="ConfigTile";const GR=e=>/^https?:\/\//.test(e)||e.startsWith("/"),IS=re.forwardRef((p,g)=>{var y=p,{role:e,senderName:t,timestamp:n,body:i,avatar:r,badge:l,toolBlock:o,thinkingBlock:u,className:f=""}=y,m=pe(y,["role","senderName","timestamp","body","avatar","badge","toolBlock","thinkingBlock","className"]);const x=r&&GR(r)?d.jsx("img",{src:r,alt:t,className:"chat-message__avatar-img"}):r||t.slice(0,2).toUpperCase();return d.jsxs("div",V(L({ref:g,className:["chat-message",`chat-message--${e}`,f].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}),l&&d.jsx("span",{className:"chat-message__badge",children:l}),d.jsx("span",{className:"chat-message__timestamp",children:n})]}),d.jsx("div",{className:"chat-message__body",children:i}),u&&d.jsx(BS,{content:u.content}),o&&d.jsx(zS,{name:o.name,status:o.status,output:o.output})]})]}))});IS.displayName="ChatMessage";const zS=re.forwardRef((f,u)=>{var m=f,{name:e,status:t,output:n=[],defaultCollapsed:i=!1,onToggleCollapsed:r,className:l=""}=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(L({ref:u,className:["tool-block",l].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(je,{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))})]}))});zS.displayName="ToolBlock";const BS=re.forwardRef((u,o)=>{var f=u,{content:e,label:t="thinking",defaultCollapsed:n=!1,onToggleCollapsed:i,className:r=""}=f,l=pe(f,["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(L({ref:o,className:["thinking-block",r].filter(Boolean).join(" "),"data-testid":"thinking-block"},l),{children:[d.jsxs("button",{type:"button",className:"thinking-block__header",onClick:y,"aria-expanded":!m,"aria-controls":m?void 0:p,children:[d.jsx(je,{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})]}))});BS.displayName="ThinkingBlock";const KR=re.forwardRef((r,i)=>{var l=r,{label:e,className:t=""}=l,n=pe(l,["label","className"]);return d.jsxs("div",V(L({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"})]}))});KR.displayName="ChatDivider";const US=re.forwardRef((u,o)=>{var f=u,{suggestions:e,onSelect:t,selected:n,className:i="","aria-label":r="Suggestions"}=f,l=pe(f,["suggestions","onSelect","selected","className","aria-label"]);if(!e||e.length===0)return null;const m=n!==void 0;return d.jsx("div",V(L({ref:o,role:"group","aria-label":r,className:["chat-suggestions",i].filter(Boolean).join(" "),"data-testid":"chat-suggestions"},l),{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)})}))});US.displayName="ChatSuggestions";const YR=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`id-${Math.random().toString(36).slice(2,11)}-${Date.now()}`,FS=re.forwardRef((w,S)=>{var N=w,{placeholder:e="Type a message...",value:t,onChange:n,onSubmit:i,onContextChange:r,onAttachmentChange:l,scopeLabel:o,contextItems:u=[],attachments:f=[],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 R=k.useRef(null),C=k.useRef(null);k.useEffect(()=>{if(R.current){R.current.style.height="auto";const A=Math.min(R.current.scrollHeight,200);R.current.style.height=`${A}px`}},[t]);const E=A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),t.trim()&&!m&&!g&&i(t,u))},T=()=>{t.trim()&&!m&&!g&&i(t,u)},D=A=>{const M=u.filter(B=>B.id!==A);r==null||r(M)},O=A=>{if(!A.target.files)return;const M=Array.from(A.target.files).map(H=>({id:YR(),name:H.name,size:H.size})),B=[...f,...M];l==null||l(B),C.current&&(C.current.value="")},F=A=>{const M=f.filter(B=>B.id!==A);l==null||l(M)};return d.jsxs("div",V(L({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(A=>d.jsxs("div",{className:"chat-composer__context-pill",children:[d.jsx("span",{className:"chat-composer__context-label",children:A.label}),d.jsx("button",{className:"chat-composer__context-remove",onClick:()=>D(A.id),"aria-label":`Remove ${A.label}`,type:"button",children:d.jsx(je,{name:"x",size:10})})]},A.id)),f.map(A=>d.jsxs("div",{className:"chat-composer__attachment-pill",children:[d.jsx(je,{name:"paperclip",size:10}),d.jsx("span",{className:"chat-composer__attachment-label",children:A.name}),d.jsx("button",{className:"chat-composer__attachment-remove",onClick:()=>F(A.id),"aria-label":`Remove ${A.name}`,type:"button",children:d.jsx(je,{name:"x",size:10})})]},A.id))]}),d.jsxs("div",{className:"chat-composer__input-wrapper",children:[d.jsx("textarea",{ref:R,className:"chat-composer__input",placeholder:e,value:t,onChange:A=>n(A.target.value),onKeyDown:E,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:O,className:"chat-composer__file-input","aria-label":"Attach files"}),d.jsx("button",{className:"chat-composer__attach-button",onClick:()=>{var A;return(A=C.current)==null?void 0:A.click()},type:"button","aria-label":"Attach files",disabled:m,children:d.jsx(je,{name:"paperclip",size:12})}),d.jsxs(En,{variant:"primary",size:"sm",onClick:T,disabled:!t.trim()||m||g,children:[d.jsx(je,{name:"send",size:12}),"send"]})]})]})]})]}))});FS.displayName="ChatComposer";const $S=re.forwardRef((m,f)=>{var g=m,{children:e,bots:t=[],activeBotId:n,onBotChange:i,autoScroll:r=!0,composer:l,className:o=""}=g,u=pe(g,["children","bots","activeBotId","onBotChange","autoScroll","composer","className"]);const p=k.useRef(null);return k.useEffect(()=>{r&&p.current&&(p.current.scrollTop=p.current.scrollHeight)},[e,r]),d.jsxs("div",V(L({ref:f,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})}),l]}))});$S.displayName="ChatContainer";function XR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const QR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JR={};function Ub(e,t){return(JR.jsx?ZR:QR).test(e)}const WR=/[ \t\n\f\r]/g;function eM(e){return typeof e=="object"?e.type==="text"?Fb(e.value):!1:Fb(e)}function Fb(e){return e.replace(WR,"")===""}class Tc{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Tc.prototype.normal={};Tc.prototype.property={};Tc.prototype.space=void 0;function HS(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new Tc(n,i,t)}function Cp(e){return e.toLowerCase()}class Qn{constructor(t,n){this.attribute=n,this.property=t}}Qn.prototype.attribute="";Qn.prototype.booleanish=!1;Qn.prototype.boolean=!1;Qn.prototype.commaOrSpaceSeparated=!1;Qn.prototype.commaSeparated=!1;Qn.prototype.defined=!1;Qn.prototype.mustUseProperty=!1;Qn.prototype.number=!1;Qn.prototype.overloadedBoolean=!1;Qn.prototype.property="";Qn.prototype.spaceSeparated=!1;Qn.prototype.space=void 0;let tM=0;const Je=Lr(),an=Lr(),Ep=Lr(),Ne=Lr(),Ot=Lr(),Nr=Lr(),oa=Lr();function Lr(){return Gu(2,++tM)}const jp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Je,booleanish:an,commaOrSpaceSeparated:oa,commaSeparated:Nr,number:Ne,overloadedBoolean:Ep,spaceSeparated:Ot},Symbol.toStringTag,{value:"Module"})),Lm=Object.keys(jp);class Ag extends Qn{constructor(t,n,i,r){let l=-1;if(super(t,n),$b(this,"space",r),typeof i=="number")for(;++l<Lm.length;){const o=Lm[l];$b(this,Lm[l],(i&jp[o])===jp[o])}}}Ag.prototype.defined=!0;function $b(e,t,n){n&&(e[t]=n)}function Vl(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const l=new Ag(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(l.mustUseProperty=!0),t[i]=l,n[Cp(i)]=i,n[Cp(l.attribute)]=i}return new Tc(t,n,e.space)}const PS=Vl({properties:{ariaActiveDescendant:null,ariaAtomic:an,ariaAutoComplete:null,ariaBusy:an,ariaChecked:an,ariaColCount:Ne,ariaColIndex:Ne,ariaColSpan:Ne,ariaControls:Ot,ariaCurrent:null,ariaDescribedBy:Ot,ariaDetails:null,ariaDisabled:an,ariaDropEffect:Ot,ariaErrorMessage:null,ariaExpanded:an,ariaFlowTo:Ot,ariaGrabbed:an,ariaHasPopup:null,ariaHidden:an,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ot,ariaLevel:Ne,ariaLive:null,ariaModal:an,ariaMultiLine:an,ariaMultiSelectable:an,ariaOrientation:null,ariaOwns:Ot,ariaPlaceholder:null,ariaPosInSet:Ne,ariaPressed:an,ariaReadOnly:an,ariaRelevant:null,ariaRequired:an,ariaRoleDescription:Ot,ariaRowCount:Ne,ariaRowIndex:Ne,ariaRowSpan:Ne,ariaSelected:an,ariaSetSize:Ne,ariaSort:null,ariaValueMax:Ne,ariaValueMin:Ne,ariaValueNow:Ne,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function qS(e,t){return t in e?e[t]:t}function VS(e,t){return qS(e,t.toLowerCase())}const nM=Vl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nr,acceptCharset:Ot,accessKey:Ot,action:null,allow:null,allowFullScreen:Je,allowPaymentRequest:Je,allowUserMedia:Je,alpha:Je,alt:null,as:null,async:Je,autoCapitalize:null,autoComplete:Ot,autoFocus:Je,autoPlay:Je,blocking:Ot,capture:null,charSet:null,checked:Je,cite:null,className:Ot,closedBy:null,colorSpace:null,cols:Ne,colSpan:Ne,command:null,commandFor:null,content:null,contentEditable:an,controls:Je,controlsList:Ot,coords:Ne|Nr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Je,defer:Je,dir:null,dirName:null,disabled:Je,download:Ep,draggable:an,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Je,formTarget:null,headers:Ot,height:Ne,hidden:Ep,high:Ne,href:null,hrefLang:null,htmlFor:Ot,httpEquiv:Ot,id:null,imageSizes:null,imageSrcSet:null,inert:Je,inputMode:null,integrity:null,is:null,isMap:Je,itemId:null,itemProp:Ot,itemRef:Ot,itemScope:Je,itemType:Ot,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Je,low:Ne,manifest:null,max:null,maxLength:Ne,media:null,method:null,min:null,minLength:Ne,multiple:Je,muted:Je,name:null,nonce:null,noModule:Je,noValidate:Je,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:Je,optimum:Ne,pattern:null,ping:Ot,placeholder:null,playsInline:Je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Je,referrerPolicy:null,rel:Ot,required:Je,reversed:Je,rows:Ne,rowSpan:Ne,sandbox:Ot,scope:null,scoped:Je,seamless:Je,selected:Je,shadowRootClonable:Je,shadowRootCustomElementRegistry:Je,shadowRootDelegatesFocus:Je,shadowRootMode:null,shadowRootSerializable:Je,shape:null,size:Ne,sizes:null,slot:null,span:Ne,spellCheck:an,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ne,step:null,style:null,tabIndex:Ne,target:null,title:null,translate:null,type:null,typeMustMatch:Je,useMap:null,value:an,width:Ne,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ot,axis:null,background:null,bgColor:null,border:Ne,borderColor:null,bottomMargin:Ne,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Je,declare:Je,event:null,face:null,frame:null,frameBorder:null,hSpace:Ne,leftMargin:Ne,link:null,longDesc:null,lowSrc:null,marginHeight:Ne,marginWidth:Ne,noResize:Je,noHref:Je,noShade:Je,noWrap:Je,object:null,profile:null,prompt:null,rev:null,rightMargin:Ne,rules:null,scheme:null,scrolling:an,standby:null,summary:null,text:null,topMargin:Ne,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ne,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Je,disablePictureInPicture:Je,disableRemotePlayback:Je,exportParts:Nr,part:Ot,prefix:null,property:null,results:Ne,security:null,unselectable:null},space:"html",transform:VS}),aM=Vl({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:oa,accentHeight:Ne,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ne,amplitude:Ne,arabicForm:null,ascent:Ne,attributeName:null,attributeType:null,azimuth:Ne,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ne,by:null,calcMode:null,capHeight:Ne,className:Ot,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:Ne,diffuseConstant:Ne,direction:null,display:null,dur:null,divisor:Ne,dominantBaseline:null,download:Je,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ne,enableBackground:null,end:null,event:null,exponent:Ne,externalResourcesRequired:null,fill:null,fillOpacity:Ne,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:Nr,g2:Nr,glyphName:Nr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ne,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ne,horizOriginX:Ne,horizOriginY:Ne,id:null,ideographic:Ne,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ne,k:Ne,k1:Ne,k2:Ne,k3:Ne,k4:Ne,kernelMatrix:oa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ne,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:Ne,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:Ne,overlineThickness:Ne,paintOrder:null,panose1:null,path:null,pathLength:Ne,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ot,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ne,pointsAtY:Ne,pointsAtZ:Ne,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:oa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:oa,rev:oa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:oa,requiredFeatures:oa,requiredFonts:oa,requiredFormats:oa,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:Ne,specularExponent:Ne,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ne,strikethroughThickness:Ne,string:null,stroke:null,strokeDashArray:oa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ne,strokeOpacity:Ne,strokeWidth:null,style:null,surfaceScale:Ne,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:oa,tabIndex:Ne,tableValues:null,target:null,targetX:Ne,targetY:Ne,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:oa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ne,underlineThickness:Ne,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ne,values:null,vAlphabetic:Ne,vMathematical:Ne,vectorEffect:null,vHanging:Ne,vIdeographic:Ne,version:null,vertAdvY:Ne,vertOriginX:Ne,vertOriginY:Ne,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ne,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qS}),GS=Vl({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()}}),KS=Vl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:VS}),YS=Vl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),iM={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"},sM=/[A-Z]/g,Hb=/-[a-z]/g,rM=/^data[-\w.:]+$/i;function lM(e,t){const n=Cp(t);let i=t,r=Qn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rM.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Hb,cM);i="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Hb.test(l)){let o=l.replace(sM,oM);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=Ag}return new r(i,t)}function oM(e){return"-"+e.toLowerCase()}function cM(e){return e.charAt(1).toUpperCase()}const uM=HS([PS,nM,GS,KS,YS],"html"),Lg=HS([PS,aM,GS,KS,YS],"svg");function dM(e){return e.join(" ").trim()}var kd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function XS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dg={},Pb=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,fM=/\n/g,hM=/^\s*/,mM=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,pM=/^:\s*/,gM=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,yM=/^[;\s]*/,vM=/^\s+|\s+$/g,xM=`
|
|
50
|
+
`,qb="/",Vb="*",cr="",bM="comment",_M="declaration";function SM(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(fM);S&&(n+=S.length);var w=_.lastIndexOf(xM);i=~w?_.length-w:i+_.length}function l(){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 f(_){var S=_.exec(e);if(S){var w=S[0];return r(w),e=e.slice(w.length),S}}function m(){f(hM)}function g(_){var S;for(_=_||[];S=p();)S!==!1&&_.push(S);return _}function p(){var _=l();if(!(qb!=e.charAt(0)||Vb!=e.charAt(1))){for(var S=2;cr!=e.charAt(S)&&(Vb!=e.charAt(S)||qb!=e.charAt(S+1));)++S;if(S+=2,cr===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:bM,comment:w})}}function y(){var _=l(),S=f(mM);if(S){if(p(),!f(pM))return u("property missing ':'");var w=f(gM),N=_({type:_M,property:Gb(S[0].replace(Pb,cr)),value:w?Gb(w[0].replace(Pb,cr)):cr});return f(yM),N}}function x(){var _=[];g(_);for(var S;S=y();)S!==!1&&(_.push(S),g(_));return _}return m(),x()}function Gb(e){return e?e.replace(vM,cr):cr}var wM=SM,NM=kd&&kd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dg,"__esModule",{value:!0});Dg.default=EM;const CM=NM(wM);function EM(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,CM.default)(e),r=typeof t=="function";return i.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:u}=l;r?t(o,u,l):u&&(n=n||{},n[o]=u)}),n}var Gd={};Object.defineProperty(Gd,"__esModule",{value:!0});Gd.camelCase=void 0;var jM=/^--[a-zA-Z0-9_-]+$/,kM=/-([a-z])/g,TM=/^[^-]+$/,RM=/^-(webkit|moz|ms|o|khtml)-/,MM=/^-(ms)-/,AM=function(e){return!e||TM.test(e)||jM.test(e)},LM=function(e,t){return t.toUpperCase()},Kb=function(e,t){return"".concat(t,"-")},DM=function(e,t){return t===void 0&&(t={}),AM(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(MM,Kb):e=e.replace(RM,Kb),e.replace(kM,LM))};Gd.camelCase=DM;var OM=kd&&kd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},IM=OM(Dg),zM=Gd;function kp(e,t){var n={};return!e||typeof e!="string"||(0,IM.default)(e,function(i,r){i&&r&&(n[(0,zM.camelCase)(i,t)]=r)}),n}kp.default=kp;var BM=kp;const UM=XS(BM),QS=ZS("end"),Og=ZS("start");function ZS(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 FM(e){const t=Og(e),n=QS(e);if(t&&n)return{start:t,end:n}}function rc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Yb(e.position):"start"in e||"end"in e?Yb(e):"line"in e||"column"in e?Tp(e):""}function Tp(e){return Xb(e&&e.line)+":"+Xb(e&&e.column)}function Yb(e){return Tp(e&&e.start)+"-"+Tp(e&&e.end)}function Xb(e){return e&&typeof e=="number"?e:1}class jn extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l=L({},n)),typeof t=="string"?r=t:!l.cause&&t&&(o=!0,r=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?l.ruleId=i:(l.source=i.slice(0,f),l.ruleId=i.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const u=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.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=rc(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}jn.prototype.file="";jn.prototype.name="";jn.prototype.reason="";jn.prototype.message="";jn.prototype.stack="";jn.prototype.column=void 0;jn.prototype.line=void 0;jn.prototype.ancestors=void 0;jn.prototype.cause=void 0;jn.prototype.fatal=void 0;jn.prototype.place=void 0;jn.prototype.ruleId=void 0;jn.prototype.source=void 0;const Ig={}.hasOwnProperty,$M=new Map,HM=/[A-Z]/g,PM=new Set(["table","tbody","thead","tfoot","tr"]),qM=new Set(["td","th"]),JS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function VM(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=WM(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=JM(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"?Lg:uM,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=WS(r,e,void 0);return l&&typeof l!="string"?l:r.create(e,r.Fragment,{children:l||void 0},void 0)}function WS(e,t,n){if(t.type==="element")return GM(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return KM(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return XM(e,t,n);if(t.type==="mdxjsEsm")return YM(e,t);if(t.type==="root")return QM(e,t,n);if(t.type==="text")return ZM(e,t)}function GM(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Lg,e.schema=r),e.ancestors.push(t);const l=tw(e,t.tagName,!1),o=eA(e,t);let u=Bg(e,t);return PM.has(t.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!eM(f):!0})),ew(e,o,l,t),zg(o,u),e.ancestors.pop(),e.schema=i,e.create(t,l,o,n)}function KM(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)}vc(e,t.position)}function YM(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vc(e,t.position)}function XM(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=Lg,e.schema=r),e.ancestors.push(t);const l=t.name===null?e.Fragment:tw(e,t.name,!0),o=tA(e,t),u=Bg(e,t);return ew(e,o,l,t),zg(o,u),e.ancestors.pop(),e.schema=i,e.create(t,l,o,n)}function QM(e,t,n){const i={};return zg(i,Bg(e,t)),e.create(t,e.Fragment,i,n)}function ZM(e,t){return t.value}function ew(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function zg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function JM(e,t,n){return i;function i(r,l,o,u){const f=Array.isArray(o.children)?n:t;return u?f(l,o,u):f(l,o)}}function WM(e,t){return n;function n(i,r,l,o){const u=Array.isArray(l.children),f=Og(i);return t(r,l,o,u,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function eA(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&Ig.call(t.properties,r)){const l=nA(e,r,t.properties[r]);if(l){const[o,u]=l;e.tableCellAlignToStyle&&o==="align"&&typeof u=="string"&&qM.has(t.tagName)?i=u:n[o]=u}}if(i){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function tA(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 l=r.expression;l.type;const o=l.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else vc(e,t.position);else{const r=i.name;let l;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,l=e.evaluater.evaluateExpression(o.expression)}else vc(e,t.position);else l=i.value===null?!0:i.value;n[r]=l}return n}function Bg(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:$M;for(;++i<t.children.length;){const l=t.children[i];let o;if(e.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const m=r.get(f)||0;o=f+"-"+m,r.set(f,m+1)}}const u=WS(e,l,o);u!==void 0&&n.push(u)}return n}function nA(e,t,n){const i=lM(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?XR(n):dM(n)),i.property==="style"){let r=typeof n=="object"?n:aA(e,String(n));return e.stylePropertyNameCase==="css"&&(r=iA(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&i.space?iM[i.property]||i.property:i.attribute,n]}}function aA(e,t){try{return UM(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,r=new jn("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=JS+"#cannot-parse-style-attribute",r}}function tw(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let l=-1,o;for(;++l<r.length;){const u=Ub(r[l])?{type:"Identifier",name:r[l]}:{type:"Literal",value:r[l]};o=o?{type:"MemberExpression",object:o,property:u,computed:!!(l&&u.type==="Literal"),optional:!1}:u}i=o}else i=Ub(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const r=i.value;return Ig.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(i);vc(e)}function vc(e,t){const n=new jn("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=JS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function iA(e){const t={};let n;for(n in e)Ig.call(e,n)&&(t[sA(n)]=e[n]);return t}function sA(e){let t=e.replace(HM,rA);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function rA(e){return"-"+e.toLowerCase()}const Dm={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"]},lA={};function Ug(e,t){const n=lA,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return nw(e,i,r)}function nw(e,t,n){if(oA(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 Qb(e.children,t,n)}return Array.isArray(e)?Qb(e,t,n):""}function Qb(e,t,n){const i=[];let r=-1;for(;++r<e.length;)i[r]=nw(e[r],t,n);return i.join("")}function oA(e){return!!(e&&typeof e=="object")}const Zb=document.createElement("i");function Fg(e){const t="&"+e+";";Zb.innerHTML=t;const n=Zb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function fa(e,t,n,i){const r=e.length;let l=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);l<i.length;)o=i.slice(l,l+1e4),o.unshift(t,0),e.splice(...o),l+=1e4,t+=1e4}function Ra(e,t){return e.length>0?(fa(e,e.length,0,t),e):t}const Jb={}.hasOwnProperty;function aw(e){const t={};let n=-1;for(;++n<e.length;)cA(t,e[n]);return t}function cA(e,t){let n;for(n in t){const i=(Jb.call(e,n)?e[n]:void 0)||(e[n]={}),r=t[n];let l;if(r)for(l in r){Jb.call(i,l)||(i[l]=[]);const o=r[l];uA(i[l],Array.isArray(o)?o:o?[o]:[])}}}function uA(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);fa(e,0,0,i)}function iw(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 Va(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const An=Fs(/[A-Za-z]/),Nn=Fs(/[\dA-Za-z]/),dA=Fs(/[#-'*+\--9=?A-Z^-~]/);function Td(e){return e!==null&&(e<32||e===127)}const Rp=Fs(/\d/),fA=Fs(/[\dA-Fa-f]/),hA=Fs(/[!-/:-@[-`{-~]/);function qe(e){return e!==null&&e<-2}function It(e){return e!==null&&(e<0||e===32)}function rt(e){return e===-2||e===-1||e===32}const Kd=Fs(new RegExp("\\p{P}|\\p{S}","u")),Mr=Fs(/\s/);function Fs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Gl(e){const t=[];let n=-1,i=0,r=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Nn(e.charCodeAt(n+1))&&Nn(e.charCodeAt(n+2)))r=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const u=e.charCodeAt(n+1);l<56320&&u>56319&&u<57344?(o=String.fromCharCode(l,u),r=1):o="�"}else o=String.fromCharCode(l);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 ht(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(f){return rt(f)?(e.enter(n),u(f)):t(f)}function u(f){return rt(f)&&l++<r?(e.consume(f),u):(e.exit(n),t(f))}}const mA={tokenize:pA};function pA(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"),ht(e,t,"linePrefix")}function r(u){return e.enter("paragraph"),l(u)}function l(u){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,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"),l):(e.consume(u),o)}}const gA={tokenize:yA},Wb={tokenize:vA};function yA(e){const t=this,n=[];let i=0,r,l,o;return u;function u(C){if(i<n.length){const E=n[i];return t.containerState=E[1],e.attempt(E[0].continuation,f,m)(C)}return m(C)}function f(C){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&R();const E=t.events.length;let T=E,D;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){D=t.events[T][1].end;break}N(i);let O=E;for(;O<t.events.length;)t.events[O][1].end=L({},D),O++;return fa(t.events,T+1,0,t.events.slice(E)),t.events.length=O,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(Wb,g,p)(C)}function g(C){return r&&R(),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(Wb,x,_)(C)}function x(C){return i++,n.push([t.currentConstruct,t.containerState]),y(C)}function _(C){if(C===null){r&&R(),N(0),e.consume(C);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:l}),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,E){const T=t.sliceStream(C);if(E&&T.push(null),C.previous=l,l&&(l.next=C),l=C,r.defineSkip(C.start),r.write(T),t.parser.lazy[C.start.line]){let D=r.events.length;for(;D--;)if(r.events[D][1].start.offset<o&&(!r.events[D][1].end||r.events[D][1].end.offset>o))return;const O=t.events.length;let F=O,A,M;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(A){M=t.events[F][1].end;break}A=!0}for(N(i),D=O;D<t.events.length;)t.events[D][1].end=L({},M),D++;fa(t.events,F+1,0,t.events.slice(O)),t.events.length=D}}function N(C){let E=n.length;for(;E-- >C;){const T=n[E];t.containerState=T[1],T[0].exit.call(t,e)}n.length=C}function R(){r.write([null]),l=void 0,r=void 0,t.containerState._closeFlow=void 0}}function vA(e,t,n){return ht(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ul(e){if(e===null||It(e)||Mr(e))return 1;if(Kd(e))return 2}function Yd(e,t,n){const i=[];let r=-1;for(;++r<e.length;){const l=e[r].resolveAll;l&&!i.includes(l)&&(t=l(t,n),i.push(l))}return t}const Mp={name:"attention",resolveAll:xA,tokenize:bA};function xA(e,t){let n=-1,i,r,l,o,u,f,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;f=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=L({},e[i][1].end),y=L({},e[n][1].start);e0(p,-f),e0(y,f),o={type:f>1?"strongSequence":"emphasisSequence",start:p,end:L({},e[i][1].end)},u={type:f>1?"strongSequence":"emphasisSequence",start:L({},e[n][1].start),end:y},l={type:f>1?"strongText":"emphasisText",start:L({},e[i][1].end),end:L({},e[n][1].start)},r={type:f>1?"strong":"emphasis",start:L({},o.start),end:L({},u.end)},e[i][1].end=L({},o.start),e[n][1].start=L({},u.end),m=[],e[i][1].end.offset-e[i][1].start.offset&&(m=Ra(m,[["enter",e[i][1],t],["exit",e[i][1],t]])),m=Ra(m,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",l,t]]),m=Ra(m,Yd(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),m=Ra(m,[["exit",l,t],["enter",u,t],["exit",u,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=Ra(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,fa(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 bA(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=Ul(i);let l;return o;function o(f){return l=f,e.enter("attentionSequence"),u(f)}function u(f){if(f===l)return e.consume(f),u;const m=e.exit("attentionSequence"),g=Ul(f),p=!g||g===2&&r||n.includes(f),y=!r||r===2&&g||n.includes(i);return m._open=!!(l===42?p:p&&(r||!y)),m._close=!!(l===42?y:y&&(g||!p)),t(f)}}function e0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const _A={name:"autolink",tokenize:SA};function SA(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"),l}function l(x){return An(x)?(e.consume(x),o):x===64?n(x):m(x)}function o(x){return x===43||x===45||x===46||Nn(x)?(i=1,u(x)):m(x)}function u(x){return x===58?(e.consume(x),i=0,f):(x===43||x===45||x===46||Nn(x))&&i++<32?(e.consume(x),u):(i=0,m(x))}function f(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||Td(x)?n(x):(e.consume(x),f)}function m(x){return x===64?(e.consume(x),g):dA(x)?(e.consume(x),m):n(x)}function g(x){return Nn(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||Nn(x))&&i++<63){const _=x===45?y:p;return e.consume(x),_}return n(x)}}const Rc={partial:!0,tokenize:wA};function wA(e,t,n){return i;function i(l){return rt(l)?ht(e,r,"linePrefix")(l):r(l)}function r(l){return l===null||qe(l)?t(l):n(l)}}const sw={continuation:{tokenize:CA},exit:EA,name:"blockQuote",tokenize:NA};function NA(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"),l}return n(o)}function l(o){return rt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function CA(e,t,n){const i=this;return r;function r(o){return rt(o)?ht(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(sw,t,n)(o)}}function EA(e){e.exit("blockQuote")}const rw={name:"characterEscape",tokenize:jA};function jA(e,t,n){return i;function i(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),r}function r(l){return hA(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const lw={name:"characterReference",tokenize:kA};function kA(e,t,n){const i=this;let r=0,l,o;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),l=31,o=Nn,g(p))}function m(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=fA,g):(e.enter("characterReferenceValue"),l=7,o=Rp,g(p))}function g(p){if(p===59&&r){const y=e.exit("characterReferenceValue");return o===Nn&&!Fg(i.sliceSerialize(y))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&r++<l?(e.consume(p),g):n(p)}}const t0={partial:!0,tokenize:RA},n0={concrete:!0,name:"codeFenced",tokenize:TA};function TA(e,t,n){const i=this,r={partial:!0,tokenize:T};let l=0,o=0,u;return f;function f(D){return m(D)}function m(D){const O=i.events[i.events.length-1];return l=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,u=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(D)}function g(D){return D===u?(o++,e.consume(D),g):o<3?n(D):(e.exit("codeFencedFenceSequence"),rt(D)?ht(e,p,"whitespace")(D):p(D))}function p(D){return D===null||qe(D)?(e.exit("codeFencedFence"),i.interrupt?t(D):e.check(t0,S,E)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(D))}function y(D){return D===null||qe(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(D)):rt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ht(e,x,"whitespace")(D)):D===96&&D===u?n(D):(e.consume(D),y)}function x(D){return D===null||qe(D)?p(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(D))}function _(D){return D===null||qe(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(D)):D===96&&D===u?n(D):(e.consume(D),_)}function S(D){return e.attempt(r,E,w)(D)}function w(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),N}function N(D){return l>0&&rt(D)?ht(e,R,"linePrefix",l+1)(D):R(D)}function R(D){return D===null||qe(D)?e.check(t0,S,E)(D):(e.enter("codeFlowValue"),C(D))}function C(D){return D===null||qe(D)?(e.exit("codeFlowValue"),R(D)):(e.consume(D),C)}function E(D){return e.exit("codeFenced"),t(D)}function T(D,O,F){let A=0;return M;function M(q){return D.enter("lineEnding"),D.consume(q),D.exit("lineEnding"),B}function B(q){return D.enter("codeFencedFence"),rt(q)?ht(D,H,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):H(q)}function H(q){return q===u?(D.enter("codeFencedFenceSequence"),G(q)):F(q)}function G(q){return q===u?(A++,D.consume(q),G):A>=o?(D.exit("codeFencedFenceSequence"),rt(q)?ht(D,$,"whitespace")(q):$(q)):F(q)}function $(q){return q===null||qe(q)?(D.exit("codeFencedFence"),O(q)):F(q)}}}function RA(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"),l)}function l(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const Om={name:"codeIndented",tokenize:AA},MA={partial:!0,tokenize:LA};function AA(e,t,n){const i=this;return r;function r(m){return e.enter("codeIndented"),ht(e,l,"linePrefix",5)(m)}function l(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?f(m):qe(m)?e.attempt(MA,o,f)(m):(e.enter("codeFlowValue"),u(m))}function u(m){return m===null||qe(m)?(e.exit("codeFlowValue"),o(m)):(e.consume(m),u)}function f(m){return e.exit("codeIndented"),t(m)}}function LA(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):ht(e,l,"linePrefix",5)(o)}function l(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:IA,resolve:OA,tokenize:zA};function OA(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 IA(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zA(e,t,n){let i=0,r,l;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"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(l=e.enter("codeTextSequence"),r=0,g(p)):qe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),m(p))}function m(p){return p===null||p===32||p===96||qe(p)?(e.exit("codeTextData"),f(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)):(l.type="codeTextData",m(p))}}class BA{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 l=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&Ko(this.left,i),l.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),Ko(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ko(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);Ko(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ko(this.left,n.reverse())}}}function Ko(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 ow(e){const t={};let n=-1,i,r,l,o,u,f,m;const g=new BA(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"&&(f=i[1]._tokenizer.events,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,UA(g,n)),n=t[n],m=!0);else if(i[1]._container){for(l=n,r=void 0;l--;)if(o=g.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(r&&(g.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;r&&(i[1].end=L({},g.get(r)[1].start),u=g.slice(r,n),u.unshift(i),g.splice(r,n-r+1,u))}}return fa(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function UA(e,t){const n=e.get(t)[1],i=e.get(t)[2];let r=t-1;const l=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const u=o.events,f=[],m={};let g,p,y=-1,x=n,_=0,S=0;const w=[S];for(;x;){for(;e.get(++r)[1]!==x;);l.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]),R=l.pop();f.push([R,R+N.length-1]),e.splice(R,2,N)}for(f.reverse(),y=-1;++y<f.length;)m[_+f[y][0]]=_+f[y][1],_+=f[y][1]-f[y][0]-1;return m}const FA={resolve:HA,tokenize:PA},$A={partial:!0,tokenize:qA};function HA(e){return ow(e),e}function PA(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?l(u):qe(u)?e.check($A,o,l)(u):(e.consume(u),r)}function l(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 qA(e,t,n){const i=this;return r;function r(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ht(e,l,"linePrefix")}function l(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 cw(e,t,n,i,r,l,o,u,f){const m=f||Number.POSITIVE_INFINITY;let g=0;return p;function p(N){return N===60?(e.enter(i),e.enter(r),e.enter(l),e.consume(N),e.exit(l),y):N===null||N===32||N===41||Td(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(l),e.consume(N),e.exit(l),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||It(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||Td(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 uw(e,t,n,i,r,l){const o=this;let u=0,f;return m;function m(x){return e.enter(i),e.enter(r),e.consume(x),e.exit(r),e.enter(l),g}function g(x){return u>999||x===null||x===91||x===93&&!f||x===94&&!u&&"_hiddenFootnoteSupport"in o.parser.constructs?n(x):x===93?(e.exit(l),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),f||(f=!rt(x)),x===92?y:p)}function y(x){return x===91||x===92||x===93?(e.consume(x),u++,p):p(x)}}function dw(e,t,n,i,r,l){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,f):n(y)}function f(y){return y===o?(e.enter(r),e.consume(y),e.exit(r),e.exit(i),t):(e.enter(l),m(y))}function m(y){return y===o?(e.exit(l),f(o)):y===null?n(y):qe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),ht(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 lc(e,t){let n;return i;function i(r){return qe(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):rt(r)?ht(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const VA={name:"definition",tokenize:KA},GA={partial:!0,tokenize:YA};function KA(e,t,n){const i=this;let r;return l;function l(x){return e.enter("definition"),o(x)}function o(x){return uw.call(i,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function u(x){return r=Va(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),f):n(x)}function f(x){return It(x)?lc(e,m)(x):m(x)}function m(x){return cw(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function g(x){return e.attempt(GA,p,p)(x)}function p(x){return rt(x)?ht(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 YA(e,t,n){return i;function i(u){return It(u)?lc(e,r)(u):n(u)}function r(u){return dw(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function l(u){return rt(u)?ht(e,o,"whitespace")(u):o(u)}function o(u){return u===null||qe(u)?t(u):n(u)}}const XA={name:"hardBreakEscape",tokenize:QA};function QA(e,t,n){return i;function i(l){return e.enter("hardBreakEscape"),e.consume(l),r}function r(l){return qe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const ZA={name:"headingAtx",resolve:JA,tokenize:WA};function JA(e,t){let n=e.length-2,i=3,r,l;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},l={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},fa(e,i,n-i+1,[["enter",r,t],["enter",l,t],["exit",l,t],["exit",r,t]])),e}function WA(e,t,n){let i=0;return r;function r(g){return e.enter("atxHeading"),l(g)}function l(g){return e.enter("atxHeadingSequence"),o(g)}function o(g){return g===35&&i++<6?(e.consume(g),o):g===null||It(g)?(e.exit("atxHeadingSequence"),u(g)):n(g)}function u(g){return g===35?(e.enter("atxHeadingSequence"),f(g)):g===null||qe(g)?(e.exit("atxHeading"),t(g)):rt(g)?ht(e,u,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function f(g){return g===35?(e.consume(g),f):(e.exit("atxHeadingSequence"),u(g))}function m(g){return g===null||g===35||It(g)?(e.exit("atxHeadingText"),u(g)):(e.consume(g),m)}}const eL=["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"],a0=["pre","script","style","textarea"],tL={concrete:!0,name:"htmlFlow",resolveTo:iL,tokenize:sL},nL={partial:!0,tokenize:lL},aL={partial:!0,tokenize:rL};function iL(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 sL(e,t,n){const i=this;let r,l,o,u,f;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),l=!0,S):I===63?(e.consume(I),r=3,i.interrupt?t:z):An(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,_):An(I)?(e.consume(I),r=4,i.interrupt?t:z):n(I)}function x(I){return I===45?(e.consume(I),i.interrupt?t:z):n(I)}function _(I){const ae="CDATA[";return I===ae.charCodeAt(u++)?(e.consume(I),u===ae.length?i.interrupt?t:H:_):n(I)}function S(I){return An(I)?(e.consume(I),o=String.fromCharCode(I),w):n(I)}function w(I){if(I===null||I===47||I===62||It(I)){const ae=I===47,ye=o.toLowerCase();return!ae&&!l&&a0.includes(ye)?(r=1,i.interrupt?t(I):H(I)):eL.includes(o.toLowerCase())?(r=6,ae?(e.consume(I),N):i.interrupt?t(I):H(I)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(I):l?R(I):C(I))}return I===45||Nn(I)?(e.consume(I),o+=String.fromCharCode(I),w):n(I)}function N(I){return I===62?(e.consume(I),i.interrupt?t:H):n(I)}function R(I){return rt(I)?(e.consume(I),R):M(I)}function C(I){return I===47?(e.consume(I),M):I===58||I===95||An(I)?(e.consume(I),E):rt(I)?(e.consume(I),C):M(I)}function E(I){return I===45||I===46||I===58||I===95||Nn(I)?(e.consume(I),E):T(I)}function T(I){return I===61?(e.consume(I),D):rt(I)?(e.consume(I),T):C(I)}function D(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),f=I,O):rt(I)?(e.consume(I),D):F(I)}function O(I){return I===f?(e.consume(I),f=null,A):I===null||qe(I)?n(I):(e.consume(I),O)}function F(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||It(I)?T(I):(e.consume(I),F)}function A(I){return I===47||I===62||rt(I)?C(I):n(I)}function M(I){return I===62?(e.consume(I),B):n(I)}function B(I){return I===null||qe(I)?H(I):rt(I)?(e.consume(I),B):n(I)}function H(I){return I===45&&r===2?(e.consume(I),P):I===60&&r===1?(e.consume(I),Q):I===62&&r===4?(e.consume(I),se):I===63&&r===3?(e.consume(I),z):I===93&&r===5?(e.consume(I),W):qe(I)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(nL,ue,G)(I)):I===null||qe(I)?(e.exit("htmlFlowData"),G(I)):(e.consume(I),H)}function G(I){return e.check(aL,$,ue)(I)}function $(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),q}function q(I){return I===null||qe(I)?G(I):(e.enter("htmlFlowData"),H(I))}function P(I){return I===45?(e.consume(I),z):H(I)}function Q(I){return I===47?(e.consume(I),o="",K):H(I)}function K(I){if(I===62){const ae=o.toLowerCase();return a0.includes(ae)?(e.consume(I),se):H(I)}return An(I)&&o.length<8?(e.consume(I),o+=String.fromCharCode(I),K):H(I)}function W(I){return I===93?(e.consume(I),z):H(I)}function z(I){return I===62?(e.consume(I),se):I===45&&r===2?(e.consume(I),z):H(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 rL(e,t,n){const i=this;return r;function r(o){return qe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):n(o)}function l(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function lL(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Rc,t,n)}}const oL={name:"htmlText",tokenize:cL};function cL(e,t,n){const i=this;let r,l,o;return u;function u(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),f}function f(z){return z===33?(e.consume(z),m):z===47?(e.consume(z),T):z===63?(e.consume(z),C):An(z)?(e.consume(z),F):n(z)}function m(z){return z===45?(e.consume(z),g):z===91?(e.consume(z),l=0,_):An(z)?(e.consume(z),R):n(z)}function g(z){return z===45?(e.consume(z),x):n(z)}function p(z){return z===null?n(z):z===45?(e.consume(z),y):qe(z)?(o=p,Q(z)):(e.consume(z),p)}function y(z){return z===45?(e.consume(z),x):p(z)}function x(z){return z===62?P(z):z===45?y(z):p(z)}function _(z){const se="CDATA[";return z===se.charCodeAt(l++)?(e.consume(z),l===se.length?S:_):n(z)}function S(z){return z===null?n(z):z===93?(e.consume(z),w):qe(z)?(o=S,Q(z)):(e.consume(z),S)}function w(z){return z===93?(e.consume(z),N):S(z)}function N(z){return z===62?P(z):z===93?(e.consume(z),N):S(z)}function R(z){return z===null||z===62?P(z):qe(z)?(o=R,Q(z)):(e.consume(z),R)}function C(z){return z===null?n(z):z===63?(e.consume(z),E):qe(z)?(o=C,Q(z)):(e.consume(z),C)}function E(z){return z===62?P(z):C(z)}function T(z){return An(z)?(e.consume(z),D):n(z)}function D(z){return z===45||Nn(z)?(e.consume(z),D):O(z)}function O(z){return qe(z)?(o=O,Q(z)):rt(z)?(e.consume(z),O):P(z)}function F(z){return z===45||Nn(z)?(e.consume(z),F):z===47||z===62||It(z)?A(z):n(z)}function A(z){return z===47?(e.consume(z),P):z===58||z===95||An(z)?(e.consume(z),M):qe(z)?(o=A,Q(z)):rt(z)?(e.consume(z),A):P(z)}function M(z){return z===45||z===46||z===58||z===95||Nn(z)?(e.consume(z),M):B(z)}function B(z){return z===61?(e.consume(z),H):qe(z)?(o=B,Q(z)):rt(z)?(e.consume(z),B):A(z)}function H(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),r=z,G):qe(z)?(o=H,Q(z)):rt(z)?(e.consume(z),H):(e.consume(z),$)}function G(z){return z===r?(e.consume(z),r=void 0,q):z===null?n(z):qe(z)?(o=G,Q(z)):(e.consume(z),G)}function $(z){return z===null||z===34||z===39||z===60||z===61||z===96?n(z):z===47||z===62||It(z)?A(z):(e.consume(z),$)}function q(z){return z===47||z===62||It(z)?A(z):n(z)}function P(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):n(z)}function Q(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),K}function K(z){return rt(z)?ht(e,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):W(z)}function W(z){return e.enter("htmlTextData"),o(z)}}const $g={name:"labelEnd",resolveAll:hL,resolveTo:mL,tokenize:pL},uL={tokenize:gL},dL={tokenize:yL},fL={tokenize:vL};function hL(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&&fa(e,0,e.length,n),e}function mL(e,t){let n=e.length,i=0,r,l,o,u;for(;n--;)if(r=e[n][1],l){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&&(l=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(o=n);const f={type:e[l][1].type==="labelLink"?"link":"image",start:L({},e[l][1].start),end:L({},e[e.length-1][1].end)},m={type:"label",start:L({},e[l][1].start),end:L({},e[o][1].end)},g={type:"labelText",start:L({},e[l+i+2][1].end),end:L({},e[o-2][1].start)};return u=[["enter",f,t],["enter",m,t]],u=Ra(u,e.slice(l+1,l+i+3)),u=Ra(u,[["enter",g,t]]),u=Ra(u,Yd(t.parser.constructs.insideSpan.null,e.slice(l+i+4,o-3),t)),u=Ra(u,[["exit",g,t],e[o-2],e[o-1],["exit",m,t]]),u=Ra(u,e.slice(o+1)),u=Ra(u,[["exit",f,t]]),fa(e,l,e.length,u),e}function pL(e,t,n){const i=this;let r=i.events.length,l,o;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){l=i.events[r][1];break}return u;function u(y){return l?l._inactive?p(y):(o=i.parser.defined.includes(Va(i.sliceSerialize({start:l.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(uL,g,o?g:p)(y):y===91?e.attempt(dL,g,o?m:p)(y):o?g(y):p(y)}function m(y){return e.attempt(fL,g,p)(y)}function g(y){return t(y)}function p(y){return l._balanced=!0,n(y)}}function gL(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 It(p)?lc(e,l)(p):l(p)}function l(p){return p===41?g(p):cw(e,o,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return It(p)?lc(e,f)(p):g(p)}function u(p){return n(p)}function f(p){return p===34||p===39||p===40?dw(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function m(p){return It(p)?lc(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 yL(e,t,n){const i=this;return r;function r(u){return uw.call(i,e,l,o,"reference","referenceMarker","referenceString")(u)}function l(u){return i.parser.defined.includes(Va(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function o(u){return n(u)}}function vL(e,t,n){return i;function i(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),r}function r(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const xL={name:"labelStartImage",resolveAll:$g.resolveAll,tokenize:bL};function bL(e,t,n){const i=this;return r;function r(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),l}function l(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 _L={name:"labelStartLink",resolveAll:$g.resolveAll,tokenize:SL};function SL(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"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const Im={name:"lineEnding",tokenize:wL};function wL(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),ht(e,t,"linePrefix")}}const gd={name:"thematicBreak",tokenize:NL};function NL(e,t,n){let i=0,r;return l;function l(m){return e.enter("thematicBreak"),o(m)}function o(m){return r=m,u(m)}function u(m){return m===r?(e.enter("thematicBreakSequence"),f(m)):i>=3&&(m===null||qe(m))?(e.exit("thematicBreak"),t(m)):n(m)}function f(m){return m===r?(e.consume(m),i++,f):(e.exit("thematicBreakSequence"),rt(m)?ht(e,u,"whitespace")(m):u(m))}}const qn={continuation:{tokenize:kL},exit:RL,name:"list",tokenize:jL},CL={partial:!0,tokenize:ML},EL={partial:!0,tokenize:TL};function jL(e,t,n){const i=this,r=i.events[i.events.length-1];let l=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:Rp(x)){if(i.containerState.type||(i.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(gd,n,m)(x):m(x);if(!i.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(x)}return n(x)}function f(x){return Rp(x)&&++o<10?(e.consume(x),f):(!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(Rc,i.interrupt?n:g,e.attempt(CL,y,p))}function g(x){return i.containerState.initialBlankLine=!0,l++,y(x)}function p(x){return rt(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),y):n(x)}function y(x){return i.containerState.size=l+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function kL(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Rc,r,l);function r(u){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,ht(e,t,"listItemIndent",i.containerState.size+1)(u)}function l(u){return i.containerState.furtherBlankLines||!rt(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(EL,t,o)(u))}function o(u){return i.containerState._closeFlow=!0,i.interrupt=void 0,ht(e,e.attempt(qn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function TL(e,t,n){const i=this;return ht(e,r,"listItemIndent",i.containerState.size+1);function r(l){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(l):n(l)}}function RL(e){e.exit(this.containerState.type)}function ML(e,t,n){const i=this;return ht(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(l){const o=i.events[i.events.length-1];return!rt(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const i0={name:"setextUnderline",resolveTo:AL,tokenize:LL};function AL(e,t){let n=e.length,i,r,l;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),!l&&e[n][1].type==="definition"&&(l=n);const o={type:"setextHeading",start:L({},e[i][1].start),end:L({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",l?(e.splice(r,0,["enter",o,t]),e.splice(l+1,0,["exit",e[i][1],t]),e[i][1].end=L({},e[l][1].end)):e[i][1]=o,e.push(["exit",o,t]),e}function LL(e,t,n){const i=this;let r;return l;function l(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"),rt(m)?ht(e,f,"lineSuffix")(m):f(m))}function f(m){return m===null||qe(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const DL={tokenize:OL};function OL(e){const t=this,n=e.attempt(Rc,i,e.attempt(this.parser.constructs.flowInitial,r,ht(e,e.attempt(this.parser.constructs.flow,r,e.attempt(FA,r)),"linePrefix")));return n;function i(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const IL={resolveAll:hw()},zL=fw("string"),BL=fw("text");function fw(e){return{resolveAll:hw(e==="text"?UL:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],l=n.attempt(r,o,u);return o;function o(g){return m(g)?l(g):u(g)}function u(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),f}function f(g){return m(g)?(n.exit("data"),l(g)):(n.consume(g),f)}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 hw(e){return t;function t(n,i){let r=-1,l;for(;++r<=n.length;)l===void 0?n[r]&&n[r][1].type==="data"&&(l=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==l+2&&(n[l][1].end=n[r-1][1].end,n.splice(l+2,r-l-2),r=l+2),l=void 0);return e?e(n,i):n}}function UL(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 l=r.length,o=-1,u=0,f;for(;l--;){const m=r[l];if(typeof m=="string"){for(o=m.length;m.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(m===-2)f=!0,u++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const m={type:n===e.length||f||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:i.start._bufferIndex+o,_index:i.start._index+l,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:L({},i.end)};i.end=L({},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 FL={42:qn,43:qn,45:qn,48:qn,49:qn,50:qn,51:qn,52:qn,53:qn,54:qn,55:qn,56:qn,57:qn,62:sw},$L={91:VA},HL={[-2]:Om,[-1]:Om,32:Om},PL={35:ZA,42:gd,45:[i0,gd],60:tL,61:i0,95:gd,96:n0,126:n0},qL={38:lw,92:rw},VL={[-5]:Im,[-4]:Im,[-3]:Im,33:xL,38:lw,42:Mp,60:[_A,oL],91:_L,92:[XA,rw],93:$g,95:Mp,96:DA},GL={null:[Mp,IL]},KL={null:[42,95]},YL={null:[]},XL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:KL,contentInitial:$L,disable:YL,document:FL,flow:PL,flowInitial:HL,insideSpan:GL,string:qL,text:VL},Symbol.toStringTag,{value:"Module"}));function QL(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={},l=[];let o=[],u=[];const f={attempt:O(T),check:O(D),consume:R,enter:C,exit:E,interrupt:O(D,{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,f);return t.resolveAll&&l.push(t),m;function p(B){return o=Ra(o,B),w(),o[o.length-1]!==null?[]:(F(t,0),m.events=Yd(l,m.events,m),m.events)}function y(B,H){return JL(x(B),H)}function x(B){return ZL(o,B)}function _(){const{_bufferIndex:B,_index:H,line:G,column:$,offset:q}=i;return{_bufferIndex:B,_index:H,line:G,column:$,offset:q}}function S(B){r[B.line]=B.column,M()}function w(){let B;for(;i._index<o.length;){const H=o[i._index];if(typeof H=="string")for(B=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===B&&i._bufferIndex<H.length;)N(H.charCodeAt(i._bufferIndex));else N(H)}}function N(B){g=g(B)}function R(B){qe(B)?(i.line++,i.column=1,i.offset+=B===-3?2:1,M()):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,H){const G=H||{};return G.type=B,G.start=_(),m.events.push(["enter",G,m]),u.push(G),G}function E(B){const H=u.pop();return H.end=_(),m.events.push(["exit",H,m]),H}function T(B,H){F(B,H.from)}function D(B,H){H.restore()}function O(B,H){return G;function G($,q,P){let Q,K,W,z;return Array.isArray($)?ue($):"tokenize"in $?ue([$]):se($);function se(xe){return he;function he(we){const Ce=we!==null&&xe[we],at=we!==null&&xe.null,Ze=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(at)?at:at?[at]:[]];return ue(Ze)(we)}}function ue(xe){return Q=xe,K=0,xe.length===0?P:I(xe[K])}function I(xe){return he;function he(we){return z=A(),W=xe,xe.partial||(m.currentConstruct=xe),xe.name&&m.parser.constructs.disable.null.includes(xe.name)?ye():xe.tokenize.call(H?Object.assign(Object.create(m),H):m,f,ae,ye)(we)}}function ae(xe){return B(W,z),q}function ye(xe){return z.restore(),++K<Q.length?I(Q[K]):P}}}function F(B,H){B.resolveAll&&!l.includes(B)&&l.push(B),B.resolve&&fa(m.events,H,m.events.length-H,B.resolve(m.events.slice(H),m)),B.resolveTo&&(m.events=B.resolveTo(m.events,m))}function A(){const B=_(),H=m.previous,G=m.currentConstruct,$=m.events.length,q=Array.from(u);return{from:$,restore:P};function P(){i=B,m.previous=H,m.currentConstruct=G,m.events.length=$,u=q,M()}}function M(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function ZL(e,t){const n=t.start._index,i=t.start._bufferIndex,r=t.end._index,l=t.end._bufferIndex;let o;if(n===r)o=[e[n].slice(i,l)];else{if(o=e.slice(n,r),i>-1){const u=o[0];typeof u=="string"?o[0]=u.slice(i):o.shift()}l>0&&o.push(e[r].slice(0,l))}return o}function JL(e,t){let n=-1;const i=[];let r;for(;++n<e.length;){const l=e[n];let o;if(typeof l=="string")o=l;else switch(l){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(l)}r=l===-2,i.push(o)}return i.join("")}function WL(e){const t={constructs:aw([XL,...(e||{}).extensions||[]]),content:n(mA),defined:[],document:n(gA),flow:n(DL),lazy:{},string:n(zL),text:n(BL)};return t;function n(i){return r;function r(l){return QL(t,i,l)}}}function eD(e){for(;!ow(e););return e}const s0=/[\0\t\n\r]/g;function tD(){let e=1,t="",n=!0,i;return r;function r(l,o,u){const f=[];let m,g,p,y,x;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),p=0,t="",n&&(l.charCodeAt(0)===65279&&p++,n=void 0);p<l.length;){if(s0.lastIndex=p,m=s0.exec(l),y=m&&m.index!==void 0?m.index:l.length,x=l.charCodeAt(y),!m){t=l.slice(p);break}if(x===10&&p===y&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),p<y&&(f.push(l.slice(p,y)),e+=y-p),x){case 0:{f.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,f.push(-2);e++<g;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:i=!0,e=1}p=y+1}return u&&(i&&f.push(-5),t&&f.push(t),f.push(null)),f}}const nD=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function aD(e){return e.replace(nD,iD)}function iD(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),r=i===120||i===88;return iw(n.slice(r?2:1),r?16:10)}return Fg(n)||e}const mw={}.hasOwnProperty;function sD(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),rD(n)(eD(WL(n).document().write(tD()(e,t,!0))))}function rD(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l($e),autolinkProtocol:A,autolinkEmail:A,atxHeading:l(Ke),blockQuote:l(at),characterEscape:A,characterReference:A,codeFenced:l(Ze),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(Ze,o),codeText:l(Ht,o),codeTextData:A,data:A,codeFlowValue:A,definition:l(ct),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Ie),hardBreakEscape:l(St),hardBreakTrailing:l(St),htmlFlow:l(Oe,o),htmlFlowData:A,htmlText:l(Oe,o),htmlTextData:A,image:l(pt),label:o,link:l($e),listItem:l(Jn),listItemValue:y,listOrdered:l(ha,p),listUnordered:l(ha),paragraph:l(Ia),reference:I,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Ke),strong:l(Ln),thematicBreak:l(za)},exit:{atxHeading:f(),atxHeadingSequence:T,autolink:f(),autolinkEmail:Ce,autolinkProtocol:we,blockQuote:f(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:xe,characterReference:he,codeFenced:f(w),codeFencedFence:S,codeFencedFenceInfo:x,codeFencedFenceMeta:_,codeFlowValue:M,codeIndented:f(N),codeText:f(q),codeTextData:M,data:M,definition:f(),definitionDestinationString:E,definitionLabelString:R,definitionTitleString:C,emphasis:f(),hardBreakEscape:f(H),hardBreakTrailing:f(H),htmlFlow:f(G),htmlFlowData:M,htmlText:f($),htmlTextData:M,image:f(Q),label:W,labelText:K,lineEnding:B,link:f(P),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ae,resourceDestinationString:z,resourceTitleString:se,resource:ue,setextHeading:f(F),setextHeadingLineSequence:O,setextHeadingText:D,strong:f(),thematicBreak:f()}};pw(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(de){let ve={type:"root",children:[]};const Re={stack:[ve],tokenStack:[],config:t,enter:u,exit:m,buffer:o,resume:g,data:n},Ge=[];let Me=-1;for(;++Me<de.length;)if(de[Me][1].type==="listOrdered"||de[Me][1].type==="listUnordered")if(de[Me][0]==="enter")Ge.push(Me);else{const ze=Ge.pop();Me=r(de,ze,Me)}for(Me=-1;++Me<de.length;){const ze=t[de[Me][0]];mw.call(ze,de[Me][1].type)&&ze[de[Me][1].type].call(Object.assign({sliceSerialize:de[Me][2].sliceSerialize},Re),de[Me][1])}if(Re.tokenStack.length>0){const ze=Re.tokenStack[Re.tokenStack.length-1];(ze[1]||r0).call(Re,void 0,ze[0])}for(ve.position={start:ys(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:ys(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me<t.transforms.length;)ve=t.transforms[Me](ve)||ve;return ve}function r(de,ve,Re){let Ge=ve-1,Me=-1,ze=!1,Et,wt,gt,bt;for(;++Ge<=Re;){const mt=de[Ge];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?Me++:Me--,bt=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(Et&&!bt&&!Me&&!gt&&(gt=Ge),bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:bt=void 0}if(!Me&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||Me===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(Et){let Wn=Ge;for(wt=void 0;Wn--;){const un=de[Wn];if(un[1].type==="lineEnding"||un[1].type==="lineEndingBlank"){if(un[0]==="exit")continue;wt&&(de[wt][1].type="lineEndingBlank",ze=!0),un[1].type="lineEnding",wt=Wn}else if(!(un[1].type==="linePrefix"||un[1].type==="blockQuotePrefix"||un[1].type==="blockQuotePrefixWhitespace"||un[1].type==="blockQuoteMarker"||un[1].type==="listItemIndent"))break}gt&&(!wt||gt<wt)&&(Et._spread=!0),Et.end=Object.assign({},wt?de[wt][1].start:mt[1].end),de.splice(wt||Ge,0,["exit",Et,mt[2]]),Ge++,Re++}if(mt[1].type==="listItemPrefix"){const Wn={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};Et=Wn,de.splice(Ge,0,["enter",Wn,mt[2]]),Ge++,Re++,gt=void 0,bt=!0}}}return de[ve][1]._spread=ze,Re}function l(de,ve){return Re;function Re(Ge){u.call(this,de(Ge),Ge),ve&&ve.call(this,Ge)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(de,ve,Re){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([ve,Re||void 0]),de.position={start:ys(ve.start),end:void 0}}function f(de){return ve;function ve(Re){de&&de.call(this,Re),m.call(this,Re)}}function m(de,ve){const Re=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==de.type&&(ve?ve.call(this,de,Ge[0]):(Ge[1]||r0).call(this,de,Ge[0]));else throw new Error("Cannot close `"+de.type+"` ("+rc({start:de.start,end:de.end})+"): it’s not open");Re.position.end=ys(de.end)}function g(){return Ug(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function y(de){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function x(){const de=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=de}function _(){const de=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=de}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const de=this.resume(),ve=this.stack[this.stack.length-1];ve.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const de=this.resume(),ve=this.stack[this.stack.length-1];ve.value=de.replace(/(\r?\n|\r)$/g,"")}function R(de){const ve=this.resume(),Re=this.stack[this.stack.length-1];Re.label=ve,Re.identifier=Va(this.sliceSerialize(de)).toLowerCase()}function C(){const de=this.resume(),ve=this.stack[this.stack.length-1];ve.title=de}function E(){const de=this.resume(),ve=this.stack[this.stack.length-1];ve.url=de}function T(de){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Re=this.sliceSerialize(de).length;ve.depth=Re}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function O(de){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function A(de){const ve=this.stack[this.stack.length-1].children;let Re=ve[ve.length-1];(!Re||Re.type!=="text")&&(Re=xt(),Re.position={start:ys(de.start),end:void 0},ve.push(Re)),this.stack.push(Re)}function M(de){const ve=this.stack.pop();ve.value+=this.sliceSerialize(de),ve.position.end=ys(de.end)}function B(de){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=ve.children[ve.children.length-1];Re.position.end=ys(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(A.call(this,de),M.call(this,de))}function H(){this.data.atHardBreak=!0}function G(){const de=this.resume(),ve=this.stack[this.stack.length-1];ve.value=de}function $(){const de=this.resume(),ve=this.stack[this.stack.length-1];ve.value=de}function q(){const de=this.resume(),ve=this.stack[this.stack.length-1];ve.value=de}function P(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=ve,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function Q(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=ve,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function K(de){const ve=this.sliceSerialize(de),Re=this.stack[this.stack.length-2];Re.label=aD(ve),Re.identifier=Va(ve).toLowerCase()}function W(){const de=this.stack[this.stack.length-1],ve=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const Ge=de.children;Re.children=Ge}else Re.alt=ve}function z(){const de=this.resume(),ve=this.stack[this.stack.length-1];ve.url=de}function se(){const de=this.resume(),ve=this.stack[this.stack.length-1];ve.title=de}function ue(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ae(de){const ve=this.resume(),Re=this.stack[this.stack.length-1];Re.label=ve,Re.identifier=Va(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function ye(de){this.data.characterReferenceType=de.type}function xe(de){const ve=this.sliceSerialize(de),Re=this.data.characterReferenceType;let Ge;Re?(Ge=iw(ve,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Fg(ve);const Me=this.stack[this.stack.length-1];Me.value+=Ge}function he(de){const ve=this.stack.pop();ve.position.end=ys(de.end)}function we(de){M.call(this,de);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(de)}function Ce(de){M.call(this,de);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(de)}function at(){return{type:"blockquote",children:[]}}function Ze(){return{type:"code",lang:null,meta:null,value:""}}function Ht(){return{type:"inlineCode",value:""}}function ct(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function St(){return{type:"break"}}function Oe(){return{type:"html",value:""}}function pt(){return{type:"image",title:null,url:"",alt:null}}function $e(){return{type:"link",title:null,url:"",children:[]}}function ha(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function Jn(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function Ia(){return{type:"paragraph",children:[]}}function Ln(){return{type:"strong",children:[]}}function xt(){return{type:"text",value:""}}function za(){return{type:"thematicBreak"}}}function ys(e){return{line:e.line,column:e.column,offset:e.offset}}function pw(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?pw(e,i):lD(e,i)}}function lD(e,t){let n;for(n in t)if(mw.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 r0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+rc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+rc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+rc({start:t.start,end:t.end})+") is still open")}function oD(e){const t=this;t.parser=n;function n(i){return sD(i,V(L(L({},t.data("settings")),e),{extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]}))}}function cD(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 uD(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
53
|
+
`}]}function dD(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 l={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function fD(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hD(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mD(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=Gl(i.toLowerCase()),l=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=l+1,u+=1,e.footnoteCounts.set(i,u);const f={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,f);const m={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,m),e.applyData(t,m)}function pD(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 gD(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gw(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),l=r[0];l&&l.type==="text"?l.value="["+l.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 yD(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return gw(e,t);const r={src:Gl(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const l={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,l),e.applyData(t,l)}function vD(e,t){const n={src:Gl(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 xD(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 bD(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return gw(e,t);const r={href:Gl(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const l={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function _D(e,t){const n={href:Gl(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 SD(e,t,n){const i=e.all(t),r=n?wD(n):yw(t),l={},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:[]}),l.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 f=i[i.length-1];f&&(r||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
|
|
56
|
+
`});const m={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,m),e.applyData(t,m)}function wD(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=yw(n[i])}return t}function yw(e){const t=e.spread;return t!=null?t:e.children.length>1}function ND(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 l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function CD(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ED(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function jD(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kD(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=Og(t.children[1]),f=QS(t.children[t.children.length-1]);u&&f&&(o.position={start:u,end:f}),r.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function TD(e,t,n){const i=n?n.children:void 0,r=(i?i.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,o=l?l.length:t.children.length;let u=-1;const f=[];for(;++u<o;){const g=t.children[u],p={},y=l?l[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)),f.push(x)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,m),e.applyData(t,m)}function RD(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const l0=9,o0=32;function MD(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),r=0;const l=[];for(;i;)l.push(c0(t.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return l.push(c0(t.slice(r),r>0,!1)),l.join("")}function c0(e,t,n){let i=0,r=e.length;if(t){let l=e.codePointAt(i);for(;l===l0||l===o0;)i++,l=e.codePointAt(i)}if(n){let l=e.codePointAt(r-1);for(;l===l0||l===o0;)r--,l=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function AD(e,t){const n={type:"text",value:MD(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function LD(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const DD={blockquote:cD,break:uD,code:dD,delete:fD,emphasis:hD,footnoteReference:mD,heading:pD,html:gD,imageReference:yD,image:vD,inlineCode:xD,linkReference:bD,link:_D,listItem:SD,list:ND,paragraph:CD,root:ED,strong:jD,table:kD,tableCell:RD,tableRow:TD,text:AD,thematicBreak:LD,toml:ed,yaml:ed,definition:ed,footnoteDefinition:ed};function ed(){}const vw=-1,Xd=0,oc=1,Rd=2,Hg=3,Pg=4,qg=5,Vg=6,xw=7,bw=8,OD=typeof self=="object"?self:globalThis,u0=(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 OD[e](t)},ID=(e,t)=>{const n=(r,l)=>(e.set(l,r),r),i=r=>{if(e.has(r))return e.get(r);const[l,o]=t[r];switch(l){case Xd:case vw:return n(o,r);case oc:{const u=n([],r);for(const f of o)u.push(i(f));return u}case Rd:{const u=n({},r);for(const[f,m]of o)u[i(f)]=i(m);return u}case Hg:return n(new Date(o),r);case Pg:{const{source:u,flags:f}=o;return n(new RegExp(u,f),r)}case qg:{const u=n(new Map,r);for(const[f,m]of o)u.set(i(f),i(m));return u}case Vg:{const u=n(new Set,r);for(const f of o)u.add(i(f));return u}case xw:{const{name:u,message:f}=o;return n(u0(u,f),r)}case bw: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(u0(l,o),r)};return i},d0=e=>ID(new Map,e)(0),gl="",{toString:zD}={},{keys:BD}=Object,Yo=e=>{const t=typeof e;if(t!=="object"||!e)return[Xd,t];const n=zD.call(e).slice(8,-1);switch(n){case"Array":return[oc,gl];case"Object":return[Rd,gl];case"Date":return[Hg,gl];case"RegExp":return[Pg,gl];case"Map":return[qg,gl];case"Set":return[Vg,gl];case"DataView":return[oc,n]}return n.includes("Array")?[oc,n]:n.includes("Error")?[xw,n]:[Rd,n]},td=([e,t])=>e===Xd&&(t==="function"||t==="symbol"),UD=(e,t,n,i)=>{const r=(o,u)=>{const f=i.push(o)-1;return n.set(u,f),f},l=o=>{if(n.has(o))return n.get(o);let[u,f]=Yo(o);switch(u){case Xd:{let g=o;switch(f){case"bigint":u=bw,g=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return r([vw],o)}return r([u,g],o)}case oc:{if(f){let y=o;return f==="DataView"?y=new Uint8Array(o.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(o)),r([f,[...y]],o)}const g=[],p=r([u,g],o);for(const y of o)g.push(l(y));return p}case Rd:{if(f)switch(f){case"BigInt":return r([f,o.toString()],o);case"Boolean":case"Number":case"String":return r([f,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const g=[],p=r([u,g],o);for(const y of BD(o))(e||!td(Yo(o[y])))&&g.push([l(y),l(o[y])]);return p}case Hg:return r([u,o.toISOString()],o);case Pg:{const{source:g,flags:p}=o;return r([u,{source:g,flags:p}],o)}case qg:{const g=[],p=r([u,g],o);for(const[y,x]of o)(e||!(td(Yo(y))||td(Yo(x))))&&g.push([l(y),l(x)]);return p}case Vg:{const g=[],p=r([u,g],o);for(const y of o)(e||!td(Yo(y)))&&g.push(l(y));return p}}const{message:m}=o;return r([u,{name:f,message:m}],o)};return l},f0=(e,{json:t,lossy:n}={})=>{const i=[];return UD(!(t||n),!!t,new Map,i)(e),i},Md=typeof structuredClone=="function"?((e,t)=>t&&("json"in t||"lossy"in t)?d0(f0(e,t)):structuredClone(e)):(e,t)=>d0(f0(e,t));function FD(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 $D(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function HD(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||FD,i=e.options.footnoteBackLabel||$D,r=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[f]);if(!m)continue;const g=e.all(m),p=String(m.identifier).toUpperCase(),y=Gl(p.toLowerCase());let x=0;const _=[],S=e.footnoteCounts.get(p);for(;S!==void 0&&++x<=S;){_.length>0&&_.push({type:"text",value:" "});let R=typeof n=="string"?n:n(f,x);typeof R=="string"&&(R={type:"text",value:R}),_.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,x),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const w=g[g.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const R=w.children[w.children.length-1];R&&R.type==="text"?R.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:l,properties:V(L({},Md(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 Qd=(function(e){if(e==null)return GD;if(typeof e=="function")return Zd(e);if(typeof e=="object")return Array.isArray(e)?PD(e):qD(e);if(typeof e=="string")return VD(e);throw new Error("Expected function, string, or object as test")});function PD(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Qd(e[n]);return Zd(i);function i(...r){let l=-1;for(;++l<t.length;)if(t[l].apply(this,r))return!0;return!1}}function qD(e){const t=e;return Zd(n);function n(i){const r=i;let l;for(l in e)if(r[l]!==t[l])return!1;return!0}}function VD(e){return Zd(t);function t(n){return n&&n.type===e}}function Zd(e){return t;function t(n,i,r){return!!(KD(n)&&e.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function GD(){return!0}function KD(e){return e!==null&&typeof e=="object"&&"type"in e}const _w=[],YD=!0,Ap=!1,XD="skip";function Sw(e,t,n,i){let r;typeof t=="function"&&typeof n!="function"?(i=n,n=t):r=t;const l=Qd(r),o=i?-1:1;u(e,void 0,[])();function u(f,m,g){const p=f&&typeof f=="object"?f:{};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 ("+(f.type+(x?"<"+x+">":""))+")"})}return y;function y(){let x=_w,_,S,w;if((!t||l(f,m,g[g.length-1]||void 0))&&(x=QD(n(f,g)),x[0]===Ap))return x;if("children"in f&&f.children){const N=f;if(N.children&&x[0]!==XD)for(S=(i?N.children.length:-1)+o,w=g.concat(N);S>-1&&S<N.children.length;){const R=N.children[S];if(_=u(R,S,w)(),_[0]===Ap)return _;S=typeof _[1]=="number"?_[1]:S+o}}return x}}}function QD(e){return Array.isArray(e)?e:typeof e=="number"?[YD,e]:e==null?_w:[e]}function Gg(e,t,n,i){let r,l,o;typeof t=="function"&&typeof n!="function"?(l=void 0,o=t,r=n):(l=t,o=n,r=i),Sw(e,l,u,r);function u(f,m){const g=m[m.length-1],p=g?g.children.indexOf(f):void 0;return o(f,p,g)}}const Lp={}.hasOwnProperty,ZD={};function JD(e,t){const n=t||ZD,i=new Map,r=new Map,l=new Map,o=L(L({},DD),n.handlers),u={all:m,applyData:e3,definitionById:i,footnoteById:r,footnoteCounts:l,footnoteOrder:[],handlers:o,one:f,options:n,patch:WD,wrap:n3};return Gg(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 f(g,p){const y=g.type,x=u.handlers[y];if(Lp.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=Md(w);return N.children=u.all(g),N}return Md(g)}return(u.options.unknownHandler||t3)(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=h0(_.value)),!Array.isArray(_)&&_.type==="element")){const S=_.children[0];S&&S.type==="text"&&(S.value=h0(S.value))}Array.isArray(_)?p.push(..._):p.push(_)}}}return p}}function WD(e,t){e.position&&(t.position=FM(e))}function e3(e,t){let n=t;if(e&&e.data){const i=e.data.hName,r=e.data.hChildren,l=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"&&l&&Object.assign(n.properties,Md(l)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function t3(e,t){const n=t.data||{},i="value"in t&&!(Lp.call(n,"hProperties")||Lp.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 n3(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 h0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function m0(e,t){const n=JD(e,t),i=n.one(e,void 0),r=HD(n),l=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&l.children.push({type:"text",value:`
|
|
62
|
+
`},r),l}function a3(e,t){return e&&"run"in e?function(n,i){return Qe(this,null,function*(){const r=m0(n,L({file:i},t));yield e.run(r,i)})}:function(n,i){return m0(n,L({file:i},e||t))}}function p0(e){if(e)throw e}var yd=Object.prototype.hasOwnProperty,ww=Object.prototype.toString,g0=Object.defineProperty,y0=Object.getOwnPropertyDescriptor,v0=function(e){return typeof Array.isArray=="function"?Array.isArray(e):ww.call(e)==="[object Array]"},x0=function(e){if(!e||ww.call(e)!=="[object Object]")return!1;var t=yd.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&yd.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!t&&!n)return!1;var i;for(i in e);return typeof i>"u"||yd.call(e,i)},b0=function(e,t){g0&&t.name==="__proto__"?g0(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},_0=function(e,t){if(t==="__proto__")if(yd.call(e,t)){if(y0)return y0(e,t).value}else return;return e[t]},i3=function e(){var t,n,i,r,l,o,u=arguments[0],f=1,m=arguments.length,g=!1;for(typeof u=="boolean"&&(g=u,u=arguments[1]||{},f=2),(u==null||typeof u!="object"&&typeof u!="function")&&(u={});f<m;++f)if(t=arguments[f],t!=null)for(n in t)i=_0(u,n),r=_0(t,n),u!==r&&(g&&r&&(x0(r)||(l=v0(r)))?(l?(l=!1,o=i&&v0(i)?i:[]):o=i&&x0(i)?i:{},b0(u,{name:n,newValue:e(g,o,r)})):typeof r<"u"&&b0(u,{name:n,newValue:r}));return u};const zm=XS(i3);function Dp(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 s3(){const e=[],t={run:n,use:i};return t;function n(...r){let l=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);u(null,...r);function u(f,...m){const g=e[++l];let p=-1;if(f){o(f);return}for(;++p<r.length;)(m[p]===null||m[p]===void 0)&&(m[p]=r[p]);r=m,g?r3(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 r3(e,t){let n;return i;function i(...o){const u=e.length>o.length;let f;u&&o.push(r);try{f=e.apply(this,o)}catch(m){const g=m;if(u&&n)throw g;return r(g)}u||(f&&f.then&&typeof f.then=="function"?f.then(l,r):f instanceof Error?r(f):l(f))}function r(o,...u){n||(n=!0,t(o,...u))}function l(o){r(null,o)}}const ti={basename:l3,dirname:o3,extname:c3,join:u3,sep:"/"};function l3(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mc(e);let n=0,i=-1,r=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(l){n=r+1;break}}else i<0&&(l=!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(l){n=r+1;break}}else o<0&&(l=!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 o3(e){if(Mc(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 c3(e){Mc(e);let t=e.length,n=-1,i=0,r=-1,l=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:l!==1&&(l=1):r>-1&&(l=-1)}return r<0||n<0||l===0||l===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function u3(...e){let t=-1,n;for(;++t<e.length;)Mc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":d3(n)}function d3(e){Mc(e);const t=e.codePointAt(0)===47;let n=f3(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function f3(e,t){let n="",i=0,r=-1,l=0,o=-1,u,f;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||l===1))if(r!==o-1&&l===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),r=o,l=0;continue}}else if(n.length>0){n="",i=0,r=o,l=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,l=0}else u===46&&l>-1?l++:l=-1}return n}function Mc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const h3={cwd:m3};function m3(){return"/"}function Op(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function p3(e){if(typeof e=="string")e=new URL(e);else if(!Op(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 g3(e)}function g3(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 Bm=["history","path","basename","stem","extname","dirname"];class Nw{constructor(t){let n;t?Op(t)?n={path:t}:typeof t=="string"||y3(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":h3.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Bm.length;){const l=Bm[i];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let r;for(r in n)Bm.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?ti.basename(this.path):void 0}set basename(t){Fm(t,"basename"),Um(t,"basename"),this.path=ti.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ti.dirname(this.path):void 0}set dirname(t){S0(this.basename,"dirname"),this.path=ti.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ti.extname(this.path):void 0}set extname(t){if(Um(t,"extname"),S0(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=ti.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Op(t)&&(t=p3(t)),Fm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ti.basename(this.path,this.extname):void 0}set stem(t){Fm(t,"stem"),Um(t,"stem"),this.path=ti.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 jn(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 Um(e,t){if(e&&e.includes(ti.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ti.sep+"`")}function Fm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function S0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function y3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const v3=(function(e){const t=this.constructor.prototype,n=t[e],i=function(){return n.apply(i,arguments)};return Object.setPrototypeOf(i,t),i}),x3={}.hasOwnProperty;class Kg extends v3{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=s3()}copy(){const t=new Kg;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(zm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Pm("data",this.frozen),this.namespace[t]=n,this):x3.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Pm("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=nd(t),i=this.parser||this.Parser;return $m("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),$m("process",this.parser||this.Parser),Hm("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(l,o){const u=nd(t),f=i.parse(u);i.run(f,u,function(g,p,y){if(g||!p||!y)return m(g);const x=p,_=i.stringify(x,y);S3(_)?y.value=_:y.result=_,m(g,y)});function m(g,p){g||!p?o(g):l?l(p):n(void 0,p)}}}processSync(t){let n=!1,i;return this.freeze(),$m("processSync",this.parser||this.Parser),Hm("processSync",this.compiler||this.Compiler),this.process(t,r),N0("processSync","process",n),i;function r(l,o){n=!0,p0(l),i=o}}run(t,n,i){w0(t),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?l(void 0,i):new Promise(l);function l(o,u){const f=nd(n);r.run(t,f,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,l),N0("runSync","run",i),r;function l(o,u){p0(o),r=u,i=!0}}stringify(t,n){this.freeze();const i=nd(n),r=this.compiler||this.Compiler;return Hm("stringify",r),w0(t),r(t,i)}use(t,...n){const i=this.attachers,r=this.namespace;if(Pm("use",this.frozen),t!=null)if(typeof t=="function")f(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 l(m){if(typeof m=="function")f(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...p]=m;f(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=zm(!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];l(p)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function f(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];Dp(S)&&Dp(x)&&(x=zm(!0,S,x)),i[y]=[m,x,..._]}}}}const b3=new Kg().freeze();function $m(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Hm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pm(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 w0(e){if(!Dp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function N0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function nd(e){return _3(e)?e:new Nw(e)}function _3(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function S3(e){return typeof e=="string"||w3(e)}function w3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const N3="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",C0=[],E0={allowDangerousHtml:!0},C3=/^(https?|ircs?|mailto|xmpp)$/i,E3=[{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 j3(e){const t=k3(e),n=T3(e);return R3(t.runSync(t.parse(n),n),e)}function k3(e){const t=e.rehypePlugins||C0,n=e.remarkPlugins||C0,i=e.remarkRehypeOptions?L(L({},e.remarkRehypeOptions),E0):E0;return b3().use(oD).use(n).use(a3,i).use(t)}function T3(e){const t=e.children||"",n=new Nw;return typeof t=="string"&&(n.value=t),n}function R3(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,l=t.disallowedElements,o=t.skipHtml,u=t.unwrapDisallowed,f=t.urlTransform||M3;for(const g of E3)Object.hasOwn(t,g.from)&&""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+N3+g.id;return Gg(e,m),VM(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 Dm)if(Object.hasOwn(Dm,x)&&Object.hasOwn(g.properties,x)){const _=g.properties[x],S=Dm[x];(S===null||S.includes(g.tagName))&&(g.properties[x]=f(String(_||""),x,g))}}if(g.type==="element"){let x=n?!n.includes(g.tagName):l?l.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 M3(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||C3.test(e.slice(0,t))?e:""}function j0(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 A3(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function L3(e,t,n){const i=Qd((n||{}).ignore||[]),r=D3(t);let l=-1;for(;++l<r.length;)Sw(e,"text",o);function o(f,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(f,m)}function u(f,m){const g=m[m.length-1],p=r[l][0],y=r[l][1];let x=0;const _=g.children.indexOf(f);let S=!1,w=[];p.lastIndex=0;let N=p.exec(f.value);for(;N;){const R=N.index,C={index:N.index,input:N.input,stack:[...m,f]};let E=y(...N,C);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=R+1:(x!==R&&w.push({type:"text",value:f.value.slice(x,R)}),Array.isArray(E)?w.push(...E):E&&w.push(E),x=R+N[0].length,S=!0),!p.global)break;N=p.exec(f.value)}return S?(x<f.value.length&&w.push({type:"text",value:f.value.slice(x)}),g.children.splice(_,1,...w)):w=[f],_+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([O3(r[0]),I3(r[1])])}return t}function O3(e){return typeof e=="string"?new RegExp(A3(e),"g"):e}function I3(e){return typeof e=="function"?e:function(){return e}}const qm="phrasing",Vm=["autolink","link","image","label"];function z3(){return{transforms:[q3],enter:{literalAutolink:U3,literalAutolinkEmail:Gm,literalAutolinkHttp:Gm,literalAutolinkWww:Gm},exit:{literalAutolink:P3,literalAutolinkEmail:H3,literalAutolinkHttp:F3,literalAutolinkWww:$3}}}function B3(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:qm,notInConstruct:Vm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:qm,notInConstruct:Vm},{character:":",before:"[ps]",after:"\\/",inConstruct:qm,notInConstruct:Vm}]}}function U3(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Gm(e){this.config.enter.autolinkProtocol.call(this,e)}function F3(e){this.config.exit.autolinkProtocol.call(this,e)}function $3(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 H3(e){this.config.exit.autolinkEmail.call(this,e)}function P3(e){this.exit(e)}function q3(e){L3(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,V3],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),G3]],{ignore:["link","linkReference"]})}function V3(e,t,n,i,r){let l="";if(!Cw(r)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!K3(n)))return!1;const o=Y3(n+i);if(!o[0])return!1;const u={type:"link",title:null,url:l+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[u,{type:"text",value:o[1]}]:u}function G3(e,t,n,i){return!Cw(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function K3(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 Y3(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=j0(e,"(");let l=j0(e,")");for(;i!==-1&&r>l;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),l++;return[e,n]}function Cw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Mr(n)||Kd(n))&&(!t||n!==47)}Ew.peek=aO;function X3(){this.buffer()}function Q3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Z3(){this.buffer()}function J3(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function W3(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Va(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eO(e){this.exit(e)}function tO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Va(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nO(e){this.exit(e)}function aO(){return"["}function Ew(e,t,n,i){const r=n.createTracker(i);let l=r.move("[^");const o=n.enter("footnoteReference"),u=n.enter("reference");return l+=r.move(n.safe(n.associationId(e),{after:"]",before:l})),u(),o(),l+=r.move("]"),l}function iO(){return{enter:{gfmFootnoteCallString:X3,gfmFootnoteCall:Q3,gfmFootnoteDefinitionLabelString:Z3,gfmFootnoteDefinition:J3},exit:{gfmFootnoteCallString:W3,gfmFootnoteCall:eO,gfmFootnoteDefinitionLabelString:tO,gfmFootnoteDefinition:nO}}}function sO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ew},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,l,o){const u=l.createTracker(o);let f=u.move("[^");const m=l.enter("footnoteDefinition"),g=l.enter("label");return f+=u.move(l.safe(l.associationId(i),{before:f,after:"]"})),g(),f+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),f+=u.move((t?`
|
|
63
|
+
`:" ")+l.indentLines(l.containerFlow(i,u.current()),t?jw:rO))),m(),f}}function rO(e,t,n){return t===0?e:jw(e,t,n)}function jw(e,t,n){return(n?"":" ")+e}const lO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];kw.peek=fO;function oO(){return{canContainEols:["delete"],enter:{strikethrough:uO},exit:{strikethrough:dO}}}function cO(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:lO}],handlers:{delete:kw}}}function uO(e){this.enter({type:"delete",children:[]},e)}function dO(e){this.exit(e)}function kw(e,t,n,i){const r=n.createTracker(i),l=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,V(L({},r.current()),{before:o,after:"~"})),o+=r.move("~~"),l(),o}function fO(){return"~"}function hO(e){return e.length}function mO(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||hO,l=[],o=[],u=[],f=[];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 R=pO(e[g][N]);if(n.alignDelimiters!==!1){const C=r(R);w[N]=C,(f[N]===void 0||C>f[N])&&(f[N]=C)}S.push(R)}o[g]=S,u[g]=w}let p=-1;if(typeof i=="object"&&"length"in i)for(;++p<m;)l[p]=k0(i[p]);else{const S=k0(i);for(;++p<m;)l[p]=S}p=-1;const y=[],x=[];for(;++p<m;){const S=l[p];let w="",N="";S===99?(w=":",N=":"):S===108?w=":":S===114&&(N=":");let R=n.alignDelimiters===!1?1:Math.max(1,f[p]-w.length-N.length);const C=w+"-".repeat(R)+N;n.alignDelimiters!==!1&&(R=w.length+R+N.length,R>f[p]&&(f[p]=R),x[p]=R),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 R=S[p]||"";let C="",E="";if(n.alignDelimiters!==!1){const T=f[p]-(w[p]||0),D=l[p];D===114?C=" ".repeat(T):D===99?T%2?(C=" ".repeat(T/2+.5),E=" ".repeat(T/2-.5)):(C=" ".repeat(T/2),E=C):E=" ".repeat(T)}n.delimiterStart!==!1&&!p&&N.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||p)&&N.push(" "),n.alignDelimiters!==!1&&N.push(C),N.push(R),n.alignDelimiters!==!1&&N.push(E),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 pO(e){return e==null?"":String(e)}function k0(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 gO(e,t,n,i){const r=n.enter("blockquote"),l=n.createTracker(i);l.move("> "),l.shift(2);const o=n.indentLines(n.containerFlow(e,l.current()),yO);return r(),o}function yO(e,t,n){return">"+(n?"":" ")+e}function vO(e,t){return T0(e,t.inConstruct,!0)&&!T0(e,t.notInConstruct,!1)}function T0(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 R0(e,t,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
|
|
65
|
+
`&&vO(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
66
|
+
`}function xO(e,t){const n=String(e);let i=n.indexOf(t),r=i,l=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++l>o&&(o=l):l=1,r=i+t.length,i=n.indexOf(t,r);return o}function bO(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 _O(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 SO(e,t,n,i){const r=_O(n),l=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(bO(e,n)){const p=n.enter("codeIndented"),y=n.indentLines(l,wO);return p(),y}const u=n.createTracker(i),f=r.repeat(Math.max(xO(l,r)+1,3)),m=n.enter("codeFenced");let g=u.move(f);if(e.lang){const p=n.enter(`codeFencedLang${o}`);g+=u.move(n.safe(e.lang,L({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,L({before:g,after:`
|
|
67
|
+
`,encode:["`"]},u.current()))),p()}return g+=u.move(`
|
|
68
|
+
`),l&&(g+=u.move(l+`
|
|
69
|
+
`)),g+=u.move(f),m(),g}function wO(e,t,n){return(n?"":" ")+e}function Yg(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 NO(e,t,n,i){const r=Yg(n),l=r==='"'?"Quote":"Apostrophe",o=n.enter("definition");let u=n.enter("label");const f=n.createTracker(i);let m=f.move("[");return m+=f.move(n.safe(n.associationId(e),L({before:m,after:"]"},f.current()))),m+=f.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),m+=f.move("<"),m+=f.move(n.safe(e.url,L({before:m,after:">"},f.current()))),m+=f.move(">")):(u=n.enter("destinationRaw"),m+=f.move(n.safe(e.url,L({before:m,after:e.title?" ":`
|
|
70
|
+
`},f.current())))),u(),e.title&&(u=n.enter(`title${l}`),m+=f.move(" "+r),m+=f.move(n.safe(e.title,L({before:m,after:r},f.current()))),m+=f.move(r),u()),o(),m}function CO(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 xc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ad(e,t,n){const i=Ul(e),r=Ul(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}}Tw.peek=EO;function Tw(e,t,n,i){const r=CO(n),l=n.enter("emphasis"),o=n.createTracker(i),u=o.move(r);let f=o.move(n.containerPhrasing(e,L({after:r,before:u},o.current())));const m=f.charCodeAt(0),g=Ad(i.before.charCodeAt(i.before.length-1),m,r);g.inside&&(f=xc(m)+f.slice(1));const p=f.charCodeAt(f.length-1),y=Ad(i.after.charCodeAt(0),p,r);y.inside&&(f=f.slice(0,-1)+xc(p));const x=o.move(r);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},u+f+x}function EO(e,t,n){return n.options.emphasis||"*"}function jO(e,t){let n=!1;return Gg(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,Ap}),!!((!e.depth||e.depth<3)&&Ug(e)&&(t.options.setext||n))}function kO(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(i);if(jO(e,n)){const g=n.enter("headingSetext"),p=n.enter("phrasing"),y=n.containerPhrasing(e,V(L({},l.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"),f=n.enter("phrasing");l.move(o+" ");let m=n.containerPhrasing(e,L({before:"# ",after:`
|
|
75
|
+
`},l.current()));return/^[\t ]/.test(m)&&(m=xc(m.charCodeAt(0))+m.slice(1)),m=m?o+" "+m:o,n.options.closeAtx&&(m+=" "+o),f(),u(),m}Rw.peek=TO;function Rw(e){return e.value||""}function TO(){return"<"}Mw.peek=RO;function Mw(e,t,n,i){const r=Yg(n),l=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let u=n.enter("label");const f=n.createTracker(i);let m=f.move("![");return m+=f.move(n.safe(e.alt,L({before:m,after:"]"},f.current()))),m+=f.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),m+=f.move("<"),m+=f.move(n.safe(e.url,L({before:m,after:">"},f.current()))),m+=f.move(">")):(u=n.enter("destinationRaw"),m+=f.move(n.safe(e.url,L({before:m,after:e.title?" ":")"},f.current())))),u(),e.title&&(u=n.enter(`title${l}`),m+=f.move(" "+r),m+=f.move(n.safe(e.title,L({before:m,after:r},f.current()))),m+=f.move(r),u()),m+=f.move(")"),o(),m}function RO(){return"!"}Aw.peek=MO;function Aw(e,t,n,i){const r=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const u=n.createTracker(i);let f=u.move("![");const m=n.safe(e.alt,L({before:f,after:"]"},u.current()));f+=u.move(m+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),L({before:f,after:"]"},u.current()));return o(),n.stack=g,l(),r==="full"||!m||m!==p?f+=u.move(p+"]"):r==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function MO(){return"!"}Lw.peek=AO;function Lw(e,t,n){let i=e.value||"",r="`",l=-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+" ");++l<n.unsafe.length;){const o=n.unsafe[l],u=n.compilePattern(o);let f;if(o.atBreak)for(;f=u.exec(i);){let m=f.index;i.charCodeAt(m)===10&&i.charCodeAt(m-1)===13&&m--,i=i.slice(0,m)+" "+i.slice(f.index+1)}}return r+i+r}function AO(){return"`"}function Dw(e,t){const n=Ug(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))}Ow.peek=LO;function Ow(e,t,n,i){const r=Yg(n),l=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let u,f;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,L({before:p,after:">"},o.current()))),p+=o.move(">"),u(),n.stack=g,p}u=n.enter("link"),f=n.enter("label");let m=o.move("[");return m+=o.move(n.containerPhrasing(e,L({before:m,after:"]("},o.current()))),m+=o.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),m+=o.move("<"),m+=o.move(n.safe(e.url,L({before:m,after:">"},o.current()))),m+=o.move(">")):(f=n.enter("destinationRaw"),m+=o.move(n.safe(e.url,L({before:m,after:e.title?" ":")"},o.current())))),f(),e.title&&(f=n.enter(`title${l}`),m+=o.move(" "+r),m+=o.move(n.safe(e.title,L({before:m,after:r},o.current()))),m+=o.move(r),f()),m+=o.move(")"),u(),m}function LO(e,t,n){return Dw(e,n)?"<":"["}Iw.peek=DO;function Iw(e,t,n,i){const r=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const u=n.createTracker(i);let f=u.move("[");const m=n.containerPhrasing(e,L({before:f,after:"]"},u.current()));f+=u.move(m+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),L({before:f,after:"]"},u.current()));return o(),n.stack=g,l(),r==="full"||!m||m!==p?f+=u.move(p+"]"):r==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function DO(){return"["}function Xg(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 OO(e){const t=Xg(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 IO(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 zw(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 zO(e,t,n,i){const r=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?IO(n):Xg(n);const u=e.ordered?o==="."?")":".":OO(n);let f=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&&(f=!0),zw(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"){f=!0;break}}}}f&&(o=u),n.bulletCurrent=o;const m=n.containerFlow(e,i);return n.bulletLastUsed=o,n.bulletCurrent=l,r(),m}function BO(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 UO(e,t,n,i){const r=BO(n);let l=n.bulletCurrent||Xg(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.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(l+" ".repeat(o-l.length)),u.shift(o);const f=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,u.current()),g);return f(),m;function g(p,y,x){return y?(x?"":" ".repeat(o))+p:(x?l:l+" ".repeat(o-l.length))+p}}function FO(e,t,n,i){const r=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,i);return l(),r(),o}const $O=Qd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function HO(e,t,n,i){return(e.children.some(function(r){return $O(r)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function PO(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Bw.peek=qO;function Bw(e,t,n,i){const r=PO(n),l=n.enter("strong"),o=n.createTracker(i),u=o.move(r+r);let f=o.move(n.containerPhrasing(e,L({after:r,before:u},o.current())));const m=f.charCodeAt(0),g=Ad(i.before.charCodeAt(i.before.length-1),m,r);g.inside&&(f=xc(m)+f.slice(1));const p=f.charCodeAt(f.length-1),y=Ad(i.after.charCodeAt(0),p,r);y.inside&&(f=f.slice(0,-1)+xc(p));const x=o.move(r+r);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},u+f+x}function qO(e,t,n){return n.options.strong||"*"}function VO(e,t,n,i){return n.safe(e.value,i)}function GO(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 KO(e,t,n){const i=(zw(n)+(n.options.ruleSpaces?" ":"")).repeat(GO(n));return n.options.ruleSpaces?i.slice(0,-1):i}const Uw={blockquote:gO,break:R0,code:SO,definition:NO,emphasis:Tw,hardBreak:R0,heading:kO,html:Rw,image:Mw,imageReference:Aw,inlineCode:Lw,link:Ow,linkReference:Iw,list:zO,listItem:UO,paragraph:FO,root:HO,strong:Bw,text:VO,thematicBreak:KO};function YO(){return{enter:{table:XO,tableData:M0,tableHeader:M0,tableRow:ZO},exit:{codeText:JO,table:QO,tableData:Km,tableHeader:Km,tableRow:Km}}}function XO(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 QO(e){this.exit(e),this.data.inTable=void 0}function ZO(e){this.enter({type:"tableRow",children:[]},e)}function Km(e){this.exit(e)}function M0(e){this.enter({type:"tableCell",children:[]},e)}function JO(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,WO));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function WO(e,t){return t==="|"?t:e}function e4(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,l=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:f,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),R=m([N]);return R.slice(0,R.indexOf(`
|
|
77
|
+
`))}function f(x,_,S,w){const N=S.enter("tableCell"),R=S.enter("phrasing"),C=S.containerPhrasing(x,V(L({},w),{before:l,after:l}));return R(),N(),C}function m(x,_){return mO(x,{align:_,alignDelimiters:i,padding:n,stringLength:r})}function g(x,_,S){const w=x.children;let N=-1;const R=[],C=_.enter("table");for(;++N<w.length;)R[N]=p(w[N],_,S);return C(),R}function p(x,_,S){const w=x.children;let N=-1;const R=[],C=_.enter("tableRow");for(;++N<w.length;)R[N]=f(w[N],x,_,S);return C(),R}function y(x,_,S){let w=Uw.inlineCode(x,_,S);return S.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function t4(){return{exit:{taskListCheckValueChecked:A0,taskListCheckValueUnchecked:A0,paragraph:a4}}}function n4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:i4}}}function A0(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function a4(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 l=-1,o;for(;++l<r.length;){const u=r[l];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 i4(e,t,n,i){const r=e.children[0],l=typeof e.checked=="boolean"&&r&&r.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",u=n.createTracker(i);l&&u.move(o);let f=Uw.listItem(e,t,n,L(L({},i),u.current()));return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),f;function m(g){return g+o}}function s4(){return[z3(),iO(),oO(),YO(),t4()]}function r4(e){return{extensions:[B3(),sO(e),cO(),e4(e),n4()]}}const l4={tokenize:h4,partial:!0},Fw={tokenize:m4,partial:!0},$w={tokenize:p4,partial:!0},Hw={tokenize:g4,partial:!0},o4={tokenize:y4,partial:!0},Pw={name:"wwwAutolink",tokenize:d4,previous:Vw},qw={name:"protocolAutolink",tokenize:f4,previous:Gw},Fi={name:"emailAutolink",tokenize:u4,previous:Kw},li={};function c4(){return{text:li}}let rr=48;for(;rr<123;)li[rr]=Fi,rr++,rr===58?rr=65:rr===91&&(rr=97);li[43]=Fi;li[45]=Fi;li[46]=Fi;li[95]=Fi;li[72]=[Fi,qw];li[104]=[Fi,qw];li[87]=[Fi,Pw];li[119]=[Fi,Pw];function u4(e,t,n){const i=this;let r,l;return o;function o(p){return!Ip(p)||!Kw.call(i,i.previous)||Qg(i.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return Ip(p)?(e.consume(p),u):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check(o4,g,m)(p):p===45||p===95||Nn(p)?(l=!0,e.consume(p),f):g(p)}function m(p){return e.consume(p),r=!0,f}function g(p){return l&&r&&An(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function d4(e,t,n){const i=this;return r;function r(o){return o!==87&&o!==119||!Vw.call(i,i.previous)||Qg(i.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(l4,e.attempt(Fw,e.attempt($w,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function f4(e,t,n){const i=this;let r="",l=!1;return o;function o(p){return(p===72||p===104)&&Gw.call(i,i.previous)&&!Qg(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(An(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),f}return n(p)}function f(p){return p===47?(e.consume(p),l?m:(l=!0,f)):n(p)}function m(p){return p===null||Td(p)||It(p)||Mr(p)||Kd(p)?n(p):e.attempt(Fw,e.attempt($w,g),n)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function h4(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),l):n(o)}function l(o){return o===null?n(o):t(o)}}function m4(e,t,n){let i,r,l;return o;function o(m){return m===46||m===95?e.check(Hw,f,u)(m):m===null||It(m)||Mr(m)||m!==45&&Kd(m)?f(m):(l=!0,e.consume(m),o)}function u(m){return m===95?i=!0:(r=i,i=void 0),e.consume(m),o}function f(m){return r||i||!l?n(m):t(m)}}function p4(e,t){let n=0,i=0;return r;function r(o){return o===40?(n++,e.consume(o),r):o===41&&i<n?l(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(Hw,t,l)(o):o===null||It(o)||Mr(o)?t(o):(e.consume(o),r)}function l(o){return o===41&&i++,e.consume(o),r}}function g4(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),l):u===93?(e.consume(u),r):u===60||u===null||It(u)||Mr(u)?t(u):n(u)}function r(u){return u===null||u===40||u===91||It(u)||Mr(u)?t(u):i(u)}function l(u){return An(u)?o(u):n(u)}function o(u){return u===59?(e.consume(u),i):An(u)?(e.consume(u),o):n(u)}}function y4(e,t,n){return i;function i(l){return e.consume(l),r}function r(l){return Nn(l)?n(l):t(l)}}function Vw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||It(e)}function Gw(e){return!An(e)}function Kw(e){return!(e===47||Ip(e))}function Ip(e){return e===43||e===45||e===46||e===95||Nn(e)}function Qg(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 v4={tokenize:E4,partial:!0};function x4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:w4,continuation:{tokenize:N4},exit:C4}},text:{91:{name:"gfmFootnoteCall",tokenize:S4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:b4,resolveTo:_4}}}}function b4(e,t,n){const i=this;let r=i.events.length;const l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const f=i.events[r][1];if(f.type==="labelImage"){o=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return u;function u(f){if(!o||!o._balanced)return n(f);const m=Va(i.sliceSerialize({start:o.end,end:i.now()}));return m.codePointAt(0)!==94||!l.includes(m.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function _4(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 l={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},u=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...u),e}function S4(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l=0,o;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(p){if(l>999||p===93&&!o||p===null||p===91||It(p))return n(p);if(p===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return r.includes(Va(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return It(p)||(o=!0),l++,e.consume(p),p===92?g:m}function g(p){return p===91||p===92||p===93?(e.consume(p),l++,m):m(p)}}function w4(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l,o=0,u;return f;function f(_){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||It(_))return n(_);if(_===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return l=Va(i.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return It(_)||(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(l)||r.push(l),ht(e,x,"gfmFootnoteDefinitionWhitespace")):n(_)}function x(_){return t(_)}}function N4(e,t,n){return e.check(Rc,t,e.attempt(v4,t,n))}function C4(e){e.exit("gfmFootnoteDefinition")}function E4(e,t,n){const i=this;return ht(e,r,"gfmFootnoteDefinitionIndent",5);function r(l){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(l):n(l)}}function j4(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(l,o){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let f=u;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[u][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[u][1].end)},g={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[u][1].start)},p=[["enter",m,o],["enter",l[f][1],o],["exit",l[f][1],o],["enter",g,o]],y=o.parser.constructs.insideSpan.null;y&&fa(p,p.length,0,Yd(y,l.slice(f+1,u),o)),fa(p,p.length,0,[["exit",g,o],["enter",l[u][1],o],["exit",l[u][1],o],["exit",m,o]]),fa(l,f-1,u-f+3,p),u=f+p.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function r(l,o,u){const f=this.previous,m=this.events;let g=0;return p;function p(x){return f===126&&m[m.length-1][1].type!=="characterEscape"?u(x):(l.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const _=Ul(f);if(x===126)return g>1?u(x):(l.consume(x),g++,y);if(g<2&&!t)return u(x);const S=l.exit("strikethroughSequenceTemporary"),w=Ul(x);return S._open=!w||w===2&&!!_,S._close=!_||_===2&&!!w,o(x)}}}class k4{constructor(){this.map=[]}add(t,n,i){T4(this,t,n,i)}consume(t){if(this.map.sort(function(l,o){return l[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 l of r)t.push(l);r=i.pop()}this.map.length=0}}function T4(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 R4(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 l=i.length-1;i[l]=i[l]==="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 M4(){return{flow:{null:{name:"table",tokenize:A4,resolveAll:L4}}}}function A4(e,t,n){const i=this;let r=0,l=0,o;return u;function u(M){let B=i.events.length-1;for(;B>-1;){const $=i.events[B][1].type;if($==="lineEnding"||$==="linePrefix")B--;else break}const H=B>-1?i.events[B][1].type:null,G=H==="tableHead"||H==="tableRow"?D:f;return G===D&&i.parser.lazy[i.now().line]?n(M):G(M)}function f(M){return e.enter("tableHead"),e.enter("tableRow"),m(M)}function m(M){return M===124||(o=!0,l+=1),g(M)}function g(M){return M===null?n(M):qe(M)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),x):n(M):rt(M)?ht(e,g,"whitespace")(M):(l+=1,o&&(o=!1,r+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),o=!0,g):(e.enter("data"),p(M)))}function p(M){return M===null||M===124||It(M)?(e.exit("data"),g(M)):(e.consume(M),M===92?y:p)}function y(M){return M===92||M===124?(e.consume(M),p):p(M)}function x(M){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(M):(e.enter("tableDelimiterRow"),o=!1,rt(M)?ht(e,_,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):_(M))}function _(M){return M===45||M===58?w(M):M===124?(o=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),S):T(M)}function S(M){return rt(M)?ht(e,w,"whitespace")(M):w(M)}function w(M){return M===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),N):M===45?(l+=1,N(M)):M===null||qe(M)?E(M):T(M)}function N(M){return M===45?(e.enter("tableDelimiterFiller"),R(M)):T(M)}function R(M){return M===45?(e.consume(M),R):M===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(M))}function C(M){return rt(M)?ht(e,E,"whitespace")(M):E(M)}function E(M){return M===124?_(M):M===null||qe(M)?!o||r!==l?T(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):T(M)}function T(M){return n(M)}function D(M){return e.enter("tableRow"),O(M)}function O(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),O):M===null||qe(M)?(e.exit("tableRow"),t(M)):rt(M)?ht(e,O,"whitespace")(M):(e.enter("data"),F(M))}function F(M){return M===null||M===124||It(M)?(e.exit("data"),O(M)):(e.consume(M),M===92?A:F)}function A(M){return M===92||M===124?(e.consume(M),F):F(M)}}function L4(e,t){let n=-1,i=!0,r=0,l=[0,0,0,0],o=[0,0,0,0],u=!1,f=0,m,g,p;const y=new k4;for(;++n<e.length;){const x=e[n],_=x[1];x[0]==="enter"?_.type==="tableHead"?(u=!1,f!==0&&(L0(y,t,f,m,g),g=void 0,f=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,l=[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&&(l[1]!==0&&(o[0]=o[1],p=ad(y,t,l,r,void 0,p),l=[0,0,0,0]),o[2]=n)):_.type==="tableCellDivider"&&(i?i=!1:(l[1]!==0&&(o[0]=o[1],p=ad(y,t,l,r,void 0,p)),l=o,o=[l[1],n,0,0])):_.type==="tableHead"?(u=!0,f=n):_.type==="tableRow"||_.type==="tableDelimiterRow"?(f=n,l[1]!==0?(o[0]=o[1],p=ad(y,t,l,r,n,p)):o[1]!==0&&(p=ad(y,t,o,r,n,p)),r=0):r&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(o[3]=n)}for(f!==0&&L0(y,t,f,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=R4(t.events,n))}return e}function ad(e,t,n,i,r,l){const o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(l.end=Object.assign({},xl(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const f=xl(t.events,n[1]);if(l={type:o,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const m=xl(t.events,n[2]),g=xl(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&&(l.end=Object.assign({},xl(t.events,r)),e.add(r,0,[["exit",l,t]]),l=void 0),l}function L0(e,t,n,i,r){const l=[],o=xl(t.events,n);r&&(r.end=Object.assign({},o),l.push(["exit",r,t])),i.end=Object.assign({},o),l.push(["exit",i,t]),e.add(n+1,0,l)}function xl(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const D4={name:"tasklistCheck",tokenize:I4};function O4(){return{text:{91:D4}}}function I4(e,t,n){const i=this;return r;function r(f){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),l)}function l(f){return It(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),o):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),o):n(f)}function o(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(f)}function u(f){return qe(f)?t(f):rt(f)?e.check({tokenize:z4},t,n)(f):n(f)}}function z4(e,t,n){return ht(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function B4(e){return aw([c4(),x4(),j4(e),M4(),O4()])}const U4={};function F4(e){const t=this,n=e||U4,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),l=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(B4(n)),l.push(s4()),o.push(r4(n))}const Yw=k.memo(({content:e,isStreaming:t=!1,className:n,syntaxHighlighter:i})=>{const r=k.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 f=/language-(\w+)/.exec(u!=null?u:"");if(!f)return d.jsx("code",{className:"chat-markdown__code-inline",children:o});const m=f[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]),l=["chat-markdown",t&&"chat-markdown--streaming",n].filter(Boolean).join(" ");return d.jsx("div",{className:l,"aria-busy":t||void 0,children:d.jsx(j3,{remarkPlugins:[F4],components:r,children:e})})});Yw.displayName="ChatMarkdownContent";const zp=re.forwardRef((y,p)=>{var x=y,{query:e,onQueryChange:t,results:n=[],onSelect:i,onClear:r,placeholder:l="Search entities...",disabled:o=!1,inputId:u,placement:f="bottom-start",className:m}=x,g=pe(x,["query","onQueryChange","results","onSelect","onClear","placeholder","disabled","inputId","placement","className"]);const[_,S]=k.useState(!1),w=k.useRef(null),N=k.useRef(null),R=k.useRef(null),C=re.useId(),E=$=>`${C}-option-${$}`,T=k.useCallback(()=>S(!1),[]),{focusedValue:D,setFocusedValue:O}=Hd({triggerRef:w,panelRef:R,isOpen:_,onClose:T,restoreFocus:!1});k.useEffect(()=>{n.length===0?O(null):n.some($=>$.id===D)||O(n[0].id)},[n,D,O]),k.useEffect(()=>{if(!_)return;const $=q=>{var P;if(q.key!=="Enter"||!((P=w.current)!=null&&P.contains(q.target)))return;const Q=n.find(K=>K.id===D);Q&&(q.preventDefault(),i(Q),S(!1))};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[_,n,D,i]),k.useImperativeHandle(p,()=>N.current);const F=$=>{o||(t($.target.value),S(!0))},A=()=>{o||e.length>0&&n.length>0&&S(!0)},M=()=>{var $;r(),S(!1),($=w.current)==null||$.focus()},B=$=>{i($),S(!1)},H=_&&n.length>0,G=H&&D?E(D):void 0;return d.jsxs("div",V(L({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":H,"aria-controls":C,"aria-activedescendant":G,className:"entity-picker__input",placeholder:l,value:e,disabled:o,onChange:F,onFocus:A,"data-testid":"entity-picker-input"}),e&&!o&&d.jsx("button",{type:"button",className:"entity-picker__clear",onClick:M,"aria-label":"Clear search","data-testid":"entity-picker-clear",children:d.jsx(je,{name:"x",size:16})})]}),H&&d.jsx("div",{ref:R,id:C,role:"listbox",className:`dropdown-panel ${Pd(f)} entity-picker__dropdown`,"data-testid":"entity-picker-dropdown",children:n.map($=>{const q=$.id===D;return d.jsxs("div",{id:E($.id),role:"option","aria-selected":q,"data-dropdown-item":$.id,className:["dropdown-item","entity-picker__result",q&&"dropdown-item--focused"].filter(Boolean).join(" "),onMouseEnter:()=>O($.id),onMouseDown:P=>{P.preventDefault(),B($)},"data-testid":`entity-picker-result-${$.id}`,children:[$.domain&&$.domainColor&&d.jsx(Xn,{variant:$.domainColor,className:"entity-picker__badge",children:$.domain}),d.jsx("span",{className:"dropdown-item__label entity-picker__label",children:$.label})]},$.id)})})]}))});zp.displayName="EntityPicker";const $4=re.forwardRef((p,g)=>{var y=p,{rows:e,onChange:t,datatypeColumn:n=!1,datatypes:i=["string","number","boolean"],disabled:r=!1,keyPlaceholder:l="Key",valuePlaceholder:o="Value",addLabel:u="Add row",className:f}=y,m=pe(y,["rows","onChange","datatypeColumn","datatypes","disabled","keyPlaceholder","valuePlaceholder","addLabel","className"]);const x=re.useId(),_=re.useRef(0),S=(E,T)=>{t(e.map(D=>D.id===E?V(L({},D),{key:T}):D))},w=(E,T)=>{t(e.map(D=>D.id===E?V(L({},D),{value:T}):D))},N=(E,T)=>{t(e.map(D=>D.id===E?V(L({},D),{datatype:T}):D))},R=E=>{t(e.filter(T=>T.id!==E))},C=()=>{const E=L({id:`${x}-${_.current++}`,key:"",value:""},n&&{datatype:"string"});t([...e,E])};return d.jsxs("div",V(L({ref:g,className:["key-value-editor",n&&"key-value-editor--has-datatype",r&&"key-value-editor--disabled",f].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(E=>d.jsxs("div",{className:"key-value-editor__row","data-testid":`key-value-row-${E.id}`,children:[d.jsx(pc,{className:"key-value-editor__input",placeholder:l,value:E.key,onChange:T=>S(E.id,T.target.value),disabled:r,"data-testid":`key-input-${E.id}`}),d.jsx(pc,{className:"key-value-editor__input",placeholder:o,value:E.value,onChange:T=>w(E.id,T.target.value),disabled:r,"data-testid":`value-input-${E.id}`}),n&&d.jsx(jd,{className:"key-value-editor__input key-value-editor__select",value:E.datatype||"string",onChange:T=>N(E.id,T),disabled:r,"data-testid":`datatype-select-${E.id}`,children:i.map(T=>d.jsx(jd.Item,{value:T,children:T},T))}),d.jsx("button",{type:"button",className:"key-value-editor__remove-btn",onClick:()=>R(E.id),"aria-label":"Remove row",disabled:r,"data-testid":`remove-row-${E.id}`,children:d.jsx(je,{name:"trash",size:16})})]},E.id))]}),d.jsxs(En,{variant:"ghost",size:"sm",className:"key-value-editor__add-btn",onClick:C,disabled:r,"data-testid":"add-row-btn",children:[d.jsx(je,{name:"plus",size:16}),u]})]}))});$4.displayName="KeyValueEditor";const H4=re.forwardRef((u,o)=>{var f=u,{items:e,onChange:t,primaryItemId:n,disabled:i=!1,className:r}=f,l=pe(f,["items","onChange","primaryItemId","disabled","className"]);const m=k.useCallback(p=>{if(p>0){const y=[...e];[y[p-1],y[p]]=[y[p],y[p-1]],t(y)}},[e,t]),g=k.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(L({ref:o,className:["ordered-list",i&&"ordered-list--disabled",r].filter(Boolean).join(" "),role:"list","aria-disabled":i||void 0,"data-testid":"ordered-list"},l),{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(je,{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(En,{variant:"ghost",size:"sm",disabled:i||y===0,onClick:()=>m(y),"aria-label":"Move up","data-testid":`move-up-${p.id}`,children:d.jsx(je,{name:"arrowUp",size:16})}),d.jsx(En,{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(je,{name:"arrowDown",size:16})})]})]},p.id))}))});H4.displayName="OrderedList";const P4=re.forwardRef((S,_)=>{var w=S,{value:e,onChange:t,sourceResults:n=[],targetResults:i=[],sourceQuery:r,onSourceQueryChange:l,targetQuery:o,onTargetQueryChange:u,predicates:f=["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(),R=`${N}-source`,C=`${N}-predicate`,E=`${N}-target`,T=re.useCallback(F=>{t(V(L({},e),{source:F})),l("")},[t,l,e]),D=re.useCallback(F=>{t(V(L({},e),{target:F})),u("")},[t,u,e]),O=re.useCallback(F=>{t(V(L({},e),{predicate:F}))},[t,e]);return d.jsxs("div",V(L({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:R,className:"relationship-builder__label",children:"Source"}),d.jsx(zp,{inputId:R,query:r,onQueryChange:l,results:n,onSelect:T,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(jd,{id:C,value:e.predicate,placeholder:"Select relation type...",onChange:O,disabled:p,"data-testid":"predicate-select",children:f.map(F=>d.jsx(jd.Item,{value:F,children:F},F))})]}),d.jsxs("div",{className:"relationship-builder__column",children:[d.jsx("label",{htmlFor:E,className:"relationship-builder__label",children:"Target"}),d.jsx(zp,{inputId:E,query:o,onQueryChange:u,results:i,onSelect:D,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})]})]})]}))});P4.displayName="RelationshipBuilder";const q4=e=>"type"in e&&e.type==="separator",Xw=re.forwardRef((m,f)=>{var g=m,{actions:e,onAction:t,trigger:n,triggerIcon:i="moreVertical",triggerLabel:r="Menu",placement:l="bottom-start",className:o}=g,u=pe(g,["actions","onAction","trigger","triggerIcon","triggerLabel","placement","className"]);const[p,y]=k.useState(!1),x=k.useRef(null),_=k.useRef(null),S=k.useRef(null),w=k.useCallback(()=>y(!1),[]),{focusedValue:N,setFocusedValue:R}=Hd({triggerRef:S,panelRef:_,isOpen:p,onClose:w});k.useImperativeHandle(f,()=>x.current);const C=k.useCallback(E=>{t(E),y(!1)},[t]);return d.jsxs("div",V(L({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(E=>!E),"aria-label":r,"aria-haspopup":"menu","aria-expanded":p,"data-testid":"row-menu-trigger",children:n||d.jsx(je,{name:i,size:16})}),p&&d.jsx("div",{ref:_,role:"menu","aria-label":r,className:`dropdown-panel ${Pd(l)} row-menu__dropdown`,"data-testid":"row-menu-dropdown",children:e.map((E,T)=>q4(E)?d.jsx("div",{role:"separator",className:"dropdown-separator","data-testid":`row-menu-separator-${T}`},`separator-${T}`):d.jsx(V4,{action:E,isFocused:N===E.id,onFocus:()=>R(E.id),onClick:()=>C(E.id)},E.id))})]}))});Xw.displayName="RowMenu";function V4({action:e,isFocused:t,onFocus:n,onClick:i}){const r=k.useRef(null);return k.useEffect(()=>{var l;t&&((l=r.current)==null||l.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(je,{name:e.icon,size:16})}),d.jsx("span",{className:"dropdown-item__label",children:e.label})]})}const G4={running:"cyan",success:"emerald",idle:"neutral",failed:"rose"},K4=re.forwardRef((y,p)=>{var x=y,{pipeline:e,onRun:t,onCancel:n,onOptions:i,compact:r=!1,selected:l=!1,headerAction:o,footerContent:u,flowLayout:f="fill",className:m}=x,g=pe(x,["pipeline","onRun","onCancel","onOptions","compact","selected","headerAction","footerContent","flowLayout","className"]);const _=G4[e.status];return d.jsxs("div",V(L({ref:p,className:["pipeline-card",r&&"pipeline-card--compact",l&&"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(Xn,{variant:_,children:e.status}),e.target&&d.jsx(Xn,{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(Xn,{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(je,{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":f,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(je,{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})]})]})})]}))});K4.displayName="PipelineCard";const Y4=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]},X4=re.forwardRef((u,o)=>{var f=u,{variant:e="info",icon:t,children:n,className:i="",role:r}=f,l=pe(f,["variant","icon","children","className","role"]);const m=typeof n=="string"?Y4(n):n,g=r!=null?r:e==="error"||e==="warn"?"alert":"note";return d.jsxs("div",V(L({ref:o,className:["form-callout",`form-callout--${e}`,i].filter(Boolean).join(" "),"data-testid":"form-callout",role:g},l),{children:[t&&d.jsx("div",{className:"form-callout__icon",children:d.jsx(je,{name:t,size:16})}),d.jsx("div",{className:"form-callout__body",children:m})]}))});X4.displayName="FormCallout";function Q4(e,t,n,i,r,l){const o=r-e,u=l-t;if(o===0&&u===0)return{x:e,y:t};const f=Math.abs(o),m=Math.abs(u),g=n/2,p=i/2;if(f*p>m*g){const y=o>0?1:-1;return{x:e+y*g,y:t+u*g/f}}else{const y=u>0?1:-1;return{x:e+o*p/m,y:t+y*p}}}function Ym(e,t,n,i,r,l){const o=e.maxX-e.minX,u=e.maxY-e.minY,f=Math.min(l,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:f,panX:t/2-m*f,panY:n/2-g*f}}const Qw=.22;function Z4(e,t,n=Qw){const i=t.x-e.x,r=t.y-e.y,l=Math.hypot(i,r),o=-r/(l||1),u=i/(l||1),f=Math.min(80,l*n),m=(e.x+t.x)/2+o*f,g=(e.y+t.y)/2+u*f;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 D0={left:{x:-1,y:0},right:{x:1,y:0},top:{x:0,y:-1},bottom:{x:0,y:1}};function O0(e,t,n,i,r,l){const o=r-e,u=l-t;if(o===0&&u===0)return{x:0,y:0};const f=Math.abs(o),m=Math.abs(u),g=n/2,p=i/2;return f*p>m*g?{x:o>0?1:-1,y:0}:{x:0,y:u>0?1:-1}}function I0(e,t,n,i,r,l,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 Q4(e,t,n,i,l,o)}}const Zw=.22;function J4(e,t,n="auto",i="auto",r=Zw,l,o){const u=t.x-e.x,f=t.y-e.y,m=Math.hypot(u,f)||1,g=Math.min(120,m*r),p=-f/m,y=u/m,x=l!=null?l:n==="auto"?{x:p,y}:D0[n],_=o!=null?o:i==="auto"?{x:p,y}:D0[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},R={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},E={x:(N.x+R.x)/2,y:(N.y+R.y)/2},T={x:(R.x+C.x)/2,y:(R.y+C.y)/2},D={x:(E.x+T.x)/2,y:(E.y+T.y)/2};return{d:`M ${e.x} ${e.y} C ${S.x} ${S.y} ${w.x} ${w.y} ${t.x} ${t.y}`,mid:D,angle:Math.atan2(T.y-E.y,T.x-E.x),points:[e,S,w,t]}}function Zg(e,t,n={}){var m,g,p,y;const i=(m=n.sourceAnchor)!=null?m:"auto",r=(g=n.targetAnchor)!=null?g:"auto",l=I0(e.x,e.y,e.width,e.height,i,t.x,t.y),o=I0(t.x,t.y,t.width,t.height,r,e.x,e.y);if(i==="auto"&&r==="auto")return Z4(l,o,(p=n.curvature)!=null?p:Qw);const u=i==="auto"?O0(e.x,e.y,e.width,e.height,t.x,t.y):void 0,f=r==="auto"?O0(t.x,t.y,t.width,t.height,e.x,e.y):void 0;return J4(l,o,i,r,(y=n.curvature)!=null?y:Zw,u,f)}const W4=6.6,e6=14,t6=18;function Jg(e){return{width:e.length*W4+e6,height:t6}}function n6(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 a6(e,t,n,i,r){const l=1-r;return{x:l*l*l*e.x+3*l*l*r*t.x+3*l*r*r*n.x+r*r*r*i.x,y:l*l*l*e.y+3*l*l*r*t.y+3*l*r*r*n.y+r*r*r*i.y}}const i6=[.5,.38,.62,.26,.74,.15,.85];function Jw(e,t,n,i=6){const r=e.length>=4?u=>a6(e[0],e[1],e[2],e[3],u):u=>n6(e[0],e[1],e[2],u),l=t.width/2+i,o=t.height/2+i;for(const u of i6){const f=r(u);if(n.every(m=>{const g=m.width/2,p=m.height/2;return Math.abs(f.x-m.x)>=l+g||Math.abs(f.y-m.y)>=o+p}))return f}return r(.5)}const s6=10,r6=100;function l6(e,t){var l,o,u;const n=new Map(e.map((f,m)=>[f,m])),i=e.map(()=>new Map),r=e.map(()=>0);for(const f of t){const m=n.get(f.source),g=n.get(f.target);if(m===void 0||g===void 0)continue;const p=(l=f.weight)!=null?l: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 o6(e,t){var f;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),l=Array.from({length:n},(m,g)=>g),o=[...i];let u=!1;if(r===0)return{comm:l,moved:!1};for(let m=0;m<t;m++){let g=!1;for(let p=0;p<n;p++){const y=l[p];o[y]-=i[p];const x=new Map([[y,0]]);for(const[w,N]of e.adj[p]){const R=l[w];x.set(R,((f=x.get(R))!=null?f:0)+N)}let _=y,S=-1/0;for(const[w,N]of x){const R=N-o[w]*i[p]/r;(R>S||R===S&&w<_)&&(S=R,_=w)}l[p]=_,o[_]+=i[p],_!==y&&(g=!0)}if(g)u=!0;else break}return{comm:l,moved:u}}function c6(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,l=new Map;for(const[p,y]of i){y.sort();const x=`cluster-L${n}-${y[0]}`;r.set(p,x),l.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])),f={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]);f.selfLoop[y]+=e.selfLoop[p];for(const[x,_]of e.adj[p]){if(x<=p)continue;const S=u.get(t[x]);y===S?f.selfLoop[y]+=_:(f.adj[y].set(S,((m=f.adj[y].get(S))!=null?m:0)+_),f.adj[S].set(y,((g=f.adj[S].get(y))!=null?g:0)+_))}}return{coarse:f,membersOf:l}}function u6(e,t,n={}){var p,y;const i=(p=n.maxLevels)!=null?p:s6,r=(y=n.maxLocalPasses)!=null?y:r6,l="cluster-root";if(e.length===0)return{id:l,children:[]};let o=new Map,u=l6(e,t),f=0,m=[...e];for(;f<i;){const{comm:x,moved:_}=o6(u,r);if(!_)break;const{coarse:S,membersOf:w}=c6(u,x,f);if(S.id.length===u.id.length)break;const N=new Map;for(const[R,C]of w){const E=C.map(T=>{var D;return(D=o.get(T))!=null?D:{id:T}});N.set(R,{id:R,children:E})}o=N,m=S.id,u=S,f++}const g=m.map(x=>{var _;return(_=o.get(x))!=null?_:{id:x}});return{id:l,children:g}}function d6(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 f6(){return this.eachAfter(d6)}function h6(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function m6(e,t){for(var n=this,i=[n],r,l,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(l=r.length-1;l>=0;--l)i.push(r[l]);return this}function p6(e,t){for(var n=this,i=[n],r=[],l,o,u,f=-1;n=i.pop();)if(r.push(n),l=n.children)for(o=0,u=l.length;o<u;++o)i.push(l[o]);for(;n=r.pop();)e.call(t,n,++f,this);return this}function g6(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function y6(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 v6(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function x6(e){for(var t=this,n=b6(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 b6(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 _6(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function S6(){return Array.from(this)}function w6(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function N6(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*C6(){var e=this,t,n=[e],i,r,l;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,l=i.length;r<l;++r)n.push(i[r]);while(n.length)}function Wg(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=k6)):t===void 0&&(t=j6);for(var n=new Ld(e),i,r=[n],l,o,u,f;i=r.pop();)if((o=t(i.data))&&(f=(o=Array.from(o)).length))for(i.children=o,u=f-1;u>=0;--u)r.push(l=o[u]=new Ld(o[u])),l.parent=i,l.depth=i.depth+1;return n.eachBefore(R6)}function E6(){return Wg(this).eachBefore(T6)}function j6(e){return e.children}function k6(e){return Array.isArray(e)?e[1]:null}function T6(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function R6(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ld(e){this.data=e,this.depth=this.height=0,this.parent=null}Ld.prototype=Wg.prototype={constructor:Ld,count:f6,each:h6,eachAfter:p6,eachBefore:m6,find:g6,sum:y6,sort:v6,path:x6,ancestors:_6,descendants:S6,leaves:w6,links:N6,copy:E6,[Symbol.iterator]:C6};function M6(e){return e==null?null:A6(e)}function A6(e){if(typeof e!="function")throw new Error;return e}function z0(){return 0}function L6(e){return function(){return e}}const D6=1664525,O6=1013904223,B0=4294967296;function I6(){let e=1;return()=>(e=(D6*e+O6)%B0)/B0}function z6(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function B6(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 U6(e,t){for(var n=0,i=(e=B6(Array.from(e),t)).length,r=[],l,o;n<i;)l=e[n],o&&Ww(o,l)?++n:(o=$6(r=F6(r,l)),n=0);return o}function F6(e,t){var n,i;if(Xm(t,e))return[t];for(n=0;n<e.length;++n)if(id(t,e[n])&&Xm(ec(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(id(ec(e[n],e[i]),t)&&id(ec(e[n],t),e[i])&&id(ec(e[i],t),e[n])&&Xm(eN(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function id(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 Ww(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 Xm(e,t){for(var n=0;n<t.length;++n)if(!Ww(e,t[n]))return!1;return!0}function $6(e){switch(e.length){case 1:return H6(e[0]);case 2:return ec(e[0],e[1]);case 3:return eN(e[0],e[1],e[2])}}function H6(e){return{x:e.x,y:e.y,r:e.r}}function ec(e,t){var n=e.x,i=e.y,r=e.r,l=t.x,o=t.y,u=t.r,f=l-n,m=o-i,g=u-r,p=Math.sqrt(f*f+m*m);return{x:(n+l+f/p*g)/2,y:(i+o+m/p*g)/2,r:(p+r+u)/2}}function eN(e,t,n){var i=e.x,r=e.y,l=e.r,o=t.x,u=t.y,f=t.r,m=n.x,g=n.y,p=n.r,y=i-o,x=i-m,_=r-u,S=r-g,w=f-l,N=p-l,R=i*i+r*r-l*l,C=R-o*o-u*u+f*f,E=R-m*m-g*g+p*p,T=x*_-y*S,D=(_*E-S*C)/(T*2)-i,O=(S*w-_*N)/T,F=(x*C-y*E)/(T*2)-r,A=(y*N-x*w)/T,M=O*O+A*A-1,B=2*(l+D*O+F*A),H=D*D+F*F-l*l,G=-(Math.abs(M)>1e-6?(B+Math.sqrt(B*B-4*M*H))/(2*M):H/B);return{x:i+D+O*G,y:r+F+A*G,r:G}}function U0(e,t,n){var i=e.x-t.x,r,l,o=e.y-t.y,u,f,m=i*i+o*o;m?(l=t.r+n.r,l*=l,f=e.r+n.r,f*=f,l>f?(r=(m+f-l)/(2*m),u=Math.sqrt(Math.max(0,f/m-r*r)),n.x=e.x-r*i-u*o,n.y=e.y-r*o+u*i):(r=(m+l-f)/(2*m),u=Math.sqrt(Math.max(0,l/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 F0(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 $0(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,l=(t.y*n.r+n.y*t.r)/i;return r*r+l*l}function sd(e){this._=e,this.next=null,this.previous=null}function P6(e,t){if(!(l=(e=z6(e)).length))return 0;var n,i,r,l,o,u,f,m,g,p,y;if(n=e[0],n.x=0,n.y=0,!(l>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(l>2))return n.r+i.r;U0(i,n,r=e[2]),n=new sd(n),i=new sd(i),r=new sd(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(f=3;f<l;++f){U0(n._,i._,r=e[f]),r=new sd(r),m=i.next,g=n.previous,p=i._.r,y=n._.r;do if(p<=y){if(F0(m._,r._)){i=m,n.next=i,i.previous=n,--f;continue e}p+=m._.r,m=m.next}else{if(F0(g._,r._)){n=g,n.next=i,i.previous=n,--f;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=$0(n);(r=r.next)!==i;)(u=$0(r))<o&&(n=r,o=u);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=U6(n,t),f=0;f<l;++f)n=e[f],n.x-=r.x,n.y-=r.y;return r.r}function q6(e){return Math.sqrt(e.value)}function V6(){var e=null,t=1,n=1,i=z0;function r(l){const o=I6();return l.x=t/2,l.y=n/2,e?l.eachBefore(H0(e)).eachAfter(Qm(i,.5,o)).eachBefore(P0(1)):l.eachBefore(H0(q6)).eachAfter(Qm(z0,1,o)).eachAfter(Qm(i,l.r/Math.min(t,n),o)).eachBefore(P0(Math.min(t,n)/(2*l.r))),l}return r.radius=function(l){return arguments.length?(e=M6(l),r):e},r.size=function(l){return arguments.length?(t=+l[0],n=+l[1],r):[t,n]},r.padding=function(l){return arguments.length?(i=typeof l=="function"?l:L6(+l),r):i},r}function H0(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Qm(e,t,n){return function(i){if(r=i.children){var r,l,o=r.length,u=e(i)*t||0,f;if(u)for(l=0;l<o;++l)r[l].r+=u;if(f=P6(r,n),u)for(l=0;l<o;++l)r[l].r-=u;i.r=f+u}}}function P0(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 G6=6;function K6(e,t){const{radiusOf:n,padding:i=G6}=t,r=V6().radius(u=>u.children?0:n(u.data.id));typeof i=="function"?r.padding(u=>i(u.depth)):r.padding(i);const l=r(Wg(e)),o=new Map;return l.each(u=>{o.set(u.data.id,{x:u.x,y:u.y,r:u.r})}),o}function Bp(e,t,n={}){var C,E,T;var i,r;const{iterations:l=300,springLength:o=160,springStrength:u=.04,repulsion:f=8e3,damping:m=.85,centerStrength:g=.005,collisionStrength:p=.3,nodeMargin:y}=n;if(e.length===0)return new Map;const x=D=>y!=null?y:D.width,_=(D,O)=>Math.max(o,(Math.hypot(D.width,D.height)+Math.hypot(O.width,O.height))/2*1.1+(x(D)+x(O))/2),S=new Map(e.map(D=>[D.id,0])),w=new Map(e.map(D=>[D.id,0])),N=new Map(e.map(D=>[D.id,{x:D.x,y:D.y}])),R=new Map(e.map(D=>[D.id,D]));for(let D=0;D<l;D++){for(let O=0;O<e.length;O++)for(let F=O+1;F<e.length;F++){const A=e[O],M=e[F];if(A.pinned&&M.pinned)continue;const B=N.get(A.id),H=N.get(M.id),G=H.x-B.x||.1,$=H.y-B.y||.1,q=Math.max(Math.hypot(G,$),1),P=f/(q*q),Q=G/q*P,K=$/q*P;A.pinned||(S.set(A.id,S.get(A.id)-Q),w.set(A.id,w.get(A.id)-K)),M.pinned||(S.set(M.id,S.get(M.id)+Q),w.set(M.id,w.get(M.id)+K));const W=A.width+x(A),z=M.width+x(M),se=A.height+x(A),ue=M.height+x(M),I=(W+z)/2-Math.abs(G),ae=(se+ue)/2-Math.abs($);if(I>0&&ae>0){const ye=Math.min(I,ae)*p,xe=G/q*ye,he=$/q*ye;A.pinned||(S.set(A.id,S.get(A.id)-xe),w.set(A.id,w.get(A.id)-he)),M.pinned||(S.set(M.id,S.get(M.id)+xe),w.set(M.id,w.get(M.id)+he))}}for(const O of t){const F=R.get(O.source),A=R.get(O.target);if(!F||!A||F.pinned&&A.pinned)continue;const M=N.get(F.id),B=N.get(A.id),H=B.x-M.x||.1,G=B.y-M.y||.1,$=Math.max(Math.hypot(H,G),1),q=u*($-_(F,A)),P=H/$*q,Q=G/$*q;F.pinned||(S.set(F.id,S.get(F.id)+P),w.set(F.id,w.get(F.id)+Q)),A.pinned||(S.set(A.id,S.get(A.id)-P),w.set(A.id,w.get(A.id)-Q))}for(const O of e){if(O.pinned)continue;const F=N.get(O.id),A=(C=(i=O.gravityTarget)==null?void 0:i.x)!=null?C:0,M=(E=(r=O.gravityTarget)==null?void 0:r.y)!=null?E:0,B=(T=O.gravityStrength)!=null?T:1,H=(S.get(O.id)-(F.x-A)*g*B)*m,G=(w.get(O.id)-(F.y-M)*g*B)*m;S.set(O.id,H),w.set(O.id,G),N.set(O.id,{x:F.x+H,y:F.y+G})}}return Q6(e,t,N,S,w,R,{restLength:_,springStrength:u,damping:m}),N}const Y6=40,X6=3,Jd=400,q0=6;function Q6(e,t,n,i,r,l,o){for(let u=0;u<Y6;u++){Fl(e,n);for(let f=0;f<X6;f++)Z6(e,t,n,i,r,l,o)}for(let u=0;u<Jd&&Fl(e,n);u++);}function Fl(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 l=r+1;l<e.length;l++){const o=e[r],u=e[l];if(o.pinned&&u.pinned)continue;const f=t.get(o.id),m=t.get(u.id),g=m.x-f.x,p=m.y-f.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 R=Math.hypot(w,N);if(R>q0){const C=q0/R;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 l=i.get(r.id);if(l.x===0&&l.y===0)continue;const o=t.get(r.id);t.set(r.id,{x:o.x+l.x,y:o.y+l.y})}return n}function Z6(e,t,n,i,r,l,{restLength:o,springStrength:u,damping:f}){for(const m of t){const g=l.get(m.source),p=l.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)),R=_/w*N,C=S/w*N;g.pinned||(i.set(g.id,i.get(g.id)+R),r.set(g.id,r.get(g.id)+C)),p.pinned||(i.set(p.id,i.get(p.id)-R),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)*f,y=r.get(m.id)*f;i.set(m.id,p),r.set(m.id,y),n.set(m.id,{x:g.x+p,y:g.y+y})}}const J6=1.2,W6=160,e5=160,t5=8e3,n5=8,a5=40,i5=.3,s5=1;function r5(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 l5(e){const t=new Map,n=(i,r)=>{if(!i.children){t.set(i.id,r);return}for(const l of i.children)n(l,r)};for(const i of e)n(i,i.id);return t}function o5(e,t,n={}){var B,H,G,$,q,P,Q,K;var i,r,l,o,u,f;if(e.length===0)return{positions:new Map,clusterBoundaries:new Map};const m=new Map(e.map(W=>[W.id,W])),g=u6(e.map(W=>W.id),t),p=W=>{const z=m.get(W);return z?Math.hypot(z.width,z.height)/2:20},y=K6(g,{radiusOf:p,padding:n.clusterPadding}),x=(B=g.children)!=null?B:[],_=l5(x),S=x.map(W=>{const z=y.get(W.id);return{id:W.id,x:z.x,y:z.y,width:z.r*2,height:z.r*2}}),w=new Map,N=[];for(const W of t){const z=_.get(W.source),se=_.get(W.target);if(!z||!se||z===se)continue;const ue=z<se?`${z}\0${se}`:`${se}\0${z}`,I=(H=w.get(ue))!=null?H:0;I>=n5||(w.set(ue,I+1),N.push({source:z,target:se}))}const R=S.reduce((W,z)=>Math.max(W,z.width),0),C=(G=(i=n.macro)==null?void 0:i.springLength)!=null?G:Math.max(R*J6,W6),E=Gu(C/e5,2),T={iterations:($=(r=n.macro)==null?void 0:r.iterations)!=null?$:300,springLength:C,springStrength:(q=(l=n.macro)==null?void 0:l.springStrength)!=null?q:.04,repulsion:(P=(o=n.macro)==null?void 0:o.repulsion)!=null?P:t5*E,damping:(Q=(u=n.macro)==null?void 0:u.damping)!=null?Q:.85,centerStrength:(K=(f=n.macro)==null?void 0:f.centerStrength)!=null?K:.005},D=S.length>0?Bp(S,N,T):new Map,O=r5(x),F=e.map(W=>{var Ce;const z=_.get(W.id),se=z?D.get(z):void 0,ue=y.get(W.id),I=z?y.get(z):void 0,ae=se!=null?se:{x:0,y:0},ye=ue&&I?ue.x-I.x:0,xe=ue&&I?ue.y-I.y:0,he=z&&(Ce=O.get(z))!=null?Ce:1,we=Math.min(s5,Math.max(i5,he/a5));return V(L({},W),{x:W.pinned?W.x:ae.x+ye,y:W.pinned?W.y:ae.y+xe,gravityTarget:ae,gravityStrength:we})}),A=Bp(F,t,n),M=cc(e,A,_,p);return{positions:A,clusterBoundaries:M}}function cc(e,t,n,i,r=!1){const l=new Map;for(const u of e){const f=n.get(u.id);f&&(l.has(f)||l.set(f,[]),l.get(f).push(u))}const o=new Map;for(const[u,f]of l){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 f){const _=t.get(x.id);_&&(m+=_.x,g+=_.y)}m/=f.length,g/=f.length}let y=0;for(const x of f){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 ey(e,t){const n=new Set(e),i=new Map,r=new Map;for(const f of t){if(!f.structural||f.source===f.target||!n.has(f.source)||!n.has(f.target)||i.has(f.target))continue;i.set(f.target,f.source);const m=r.get(f.source);m?m.push(f.target):r.set(f.source,[f.target])}const l=e.filter(f=>!i.has(f)),o=new Set,u=f=>{var m;if(!o.has(f)){o.add(f);for(const g of(m=r.get(f))!=null?m:[])u(g)}};l.forEach(u);for(const f of e){if(o.has(f))continue;const m=i.get(f);if(m!==void 0){i.delete(f);const g=r.get(m);g&&r.set(m,g.filter(p=>p!==f))}l.push(f),u(f)}return{parentOf:i,childrenOf:r,roots:l}}function c5(e,t){return e.flatMap(n=>{const i=t.get(n);return i&&i.length>1?i:[n]})}function Up(e,t){var l,o;const n=new Set,i=[...(l=t.get(e))!=null?l:[]];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 uc(e,t){var n;const i=c5(e,t),r=new Map;for(const l of i){r.set(l,l);for(const o of Up(l,t))r.set(o,l)}for(const l of e){if(r.has(l))continue;const o=(n=t.get(l))==null?void 0:n[0],u=o!==void 0?r.get(o):void 0;u!==void 0&&r.set(l,u)}return{groupHeads:i,leafToGroup:r}}function u5(e,t,n,i,r,l){const o=u=>{var p;const f=(p=t.get(u))!=null?p:[];if(f.length===0)return 0;const m=i(e.get(u));let g=0;for(const y of f){const x=i(e.get(y)),_=m+x*r;g=Math.max(g,_+o(y))}return g};return(u,f)=>{const m=new Map,g=(x,_)=>({x:x*u*Math.cos(_),y:x*f*Math.sin(_)}),p=(x,_,S,w,N)=>{var A;const R=e.get(x),C=R.pinned&&R.x!==void 0&&R.y!==void 0,E=C?R.x:_,T=C?R.y:S;m.set(x,{x:E,y:T});const D=(A=t.get(x))!=null?A:[],O=D.length;if(O===0)return;const F=i(R);D.forEach((M,B)=>{const H=i(e.get(M)),G=F+H*r,$=O%2===0&&N>0?Math.PI/O:0,q=w+2*Math.PI*B/O+$,P=g(G,q);p(M,E+P.x,T+P.y,q,N+1)})},y=n.length;return n.forEach((x,_)=>{const S=i(e.get(x))*r+o(x),w=l+2*Math.PI*_/y,N=g(S,w);p(x,N.x,N.y,w,0)}),m}}function V0(e,t,n){let i=1/0,r=-1/0,l=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),l=Math.min(l,g.y-p),o=Math.max(o,g.y+p)}const u=r-i||1,f=o-l||1;return{width:u,height:f,ratio:u/f,area:u*f}}function ty(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])),l=S=>Math.hypot(S.width,S.height)/2,o=bc(e,t,void 0,V(L({},n),{resolvedAspectScale:{x:1,y:1}})),u=V0(o,r,l),f=Math.min(8,Math.max(1/8,i)),m=Math.min(8,Math.max(1/8,f/u.ratio)),g=2,p=S=>{const w=Math.pow(m,S),N=bc(e,t,void 0,V(L({},n),{resolvedAspectScale:{x:w,y:1/w}}));return V0(N,r,l).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 bc(e,t,n,i={}){var F;const{nodeSpread:r=3.2,startAngle:l=-Math.PI/2,homeStrength:o=.18,nodeMargin:u,separateGroups:f=!0,resolvedAspectScale:m}=i;if(e.length===0)return new Map;const g=new Map(e.map(A=>[A.id,A])),p=A=>Math.hypot(A.width,A.height)/2,{childrenOf:y,roots:x}=ey(e.map(A=>A.id),t),_=u5(g,y,x,p,r,l),{groupHeads:S,leafToGroup:w}=f?uc(x,y):{groupHeads:[],leafToGroup:new Map},N=m!=null?m:ty(e,t,i),R=_(N.x,N.y),C=f?Fp(g,S,w,R):R,E=new Map;for(const A of e)A.pinned&&A.x!==void 0&&A.y!==void 0?E.set(A.id,{x:A.x,y:A.y}):E.set(A.id,(F=n==null?void 0:n.get(A.id))!=null?F:C.get(A.id));const T=e.map(A=>({id:A.id,width:A.width,height:A.height,pinned:A.pinned,x:0,y:0})),D=u!=null?u:0,O=D===0?T:e.map(A=>({id:A.id,width:A.width+D,height:A.height+D,pinned:A.pinned,x:0,y:0}));Fl(O,E);for(const A of e){if(A.pinned)continue;const M=E.get(A.id),B=C.get(A.id);E.set(A.id,{x:M.x+(B.x-M.x)*o,y:M.y+(B.y-M.y)*o})}if(f&&S.length>1){const A=new Set;for(const M of e){if(!M.pinned||M.x===void 0||M.y===void 0)continue;const B=w.get(M.id);B&&A.add(B)}if(A.size>0)return Fp(g,S,w,E,A)}return E}function G0(e,t,n={}){const{settleCycles:i=24,separateGroups:r=!0}=n;if(e.length===0)return new Map;const l=ty(e,t,n),o=V(L({},n),{resolvedAspectScale:l});let u;for(let m=0;m<i;m++)u=bc(e,t,u,o);u||(u=bc(e,t,void 0,o));const f=e.map(m=>({id:m.id,width:m.width,height:m.height,pinned:m.pinned,x:0,y:0}));for(let m=0;m<Jd&&Fl(f,u);m++);return r&&(u=d5(e,t,u)),u}function Fp(e,t,n,i,r){if(t.length<=1)return i;const l=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=cc(o,i,n,l,!0),f=[...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<Jd&&Fl(f,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 R=g.get(w);R&&g.set(w,{x:R.x+_,y:R.y+S})}}return g}function d5(e,t,n){const{childrenOf:i,roots:r}=ey(e.map(p=>p.id),t),l=new Map(e.map(p=>[p.id,p])),{groupHeads:o,leafToGroup:u}=uc(r,i),f=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&&f.add(y)}const m=Fp(l,o,u,n,f.size>0?f: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<Jd&&Fl(g,m);p++);return m}const f5=.25,h5=4,K0=.1,rd=20,Y0=.95,X0=.1,m5=.002,p5=.05,g5=1,y5=10;function v5(e){const t=e.deltaMode===1?p5:e.deltaMode===2?g5:m5,n=e.ctrlKey?y5:1;return Math.pow(2,-e.deltaY*t*n)}function Q0(e,t,n,i,r){const l=i/n;return{x:e-l*(e-r.x),y:t-l*(t-r.y)}}function x5(){return typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function tN({minZoom:e=f5,maxZoom:t=h5,bounds:n,onViewportChange:i,containerRef:r,locked:l=!1}){const[o,u]=k.useState(1),[f,m]=k.useState({x:0,y:0}),g=k.useRef(1),p=k.useRef({x:0,y:0}),y=k.useRef(l);k.useEffect(()=>{y.current=l},[l]);const x=k.useRef(null),_=k.useRef(!1),S=k.useRef(),w=k.useRef(),N=k.useRef(null),R=k.useRef(null),C=k.useRef(null),E=k.useRef(null);k.useEffect(()=>{g.current=o},[o]),k.useEffect(()=>{p.current=f},[f]),k.useEffect(()=>{i==null||i({x:f.x,y:f.y,zoom:o})},[f,o,i]);const T=k.useCallback((K,W)=>{if(!n)return{x:K,y:W};const z=-n.maxX*g.current,se=-n.minX*g.current,ue=-n.maxY*g.current,I=-n.minY*g.current;return{x:Math.max(z,Math.min(se,K)),y:Math.max(ue,Math.min(I,W))}},[n]),D=k.useCallback(K=>{var W;(W=S.current)==null||W.call(S,K)},[]),O=k.useCallback(()=>{var K;(K=w.current)==null||K.call(w)},[]),F=k.useCallback(()=>{_.current||(document.addEventListener("pointermove",D),document.addEventListener("pointerup",O),_.current=!0)},[D,O]),A=k.useCallback(()=>{_.current&&(document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",O),_.current=!1)},[D,O]),M=k.useCallback(K=>{if(!x.current)return;const W=K.clientX-x.current.lastX,z=K.clientY-x.current.lastY,se=performance.now(),ue=Math.max(1,se-x.current.time)/1e3;x.current.vx=W/ue,x.current.vy=z/ue,x.current.time=se,x.current.lastX=K.clientX,x.current.lastY=K.clientY,N.current!==null&&cancelAnimationFrame(N.current),N.current=requestAnimationFrame(()=>{if(!x.current)return;const I=T(x.current.panX+(K.clientX-x.current.x),x.current.panY+(K.clientY-x.current.y));m(I),N.current=null})},[T]),B=k.useCallback(()=>{if(!x.current){A();return}const K=x5(),W=x.current.vx,z=x.current.vy,se=Math.sqrt(W*W+z*z);if(x.current=null,A(),K||se<X0)return;let ue=W,I=z,ae=p.current,ye=performance.now();const xe=()=>{const he=performance.now(),we=(he-ye)/1e3;if(ye=he,ue*=Math.pow(Y0,we*60),I*=Math.pow(Y0,we*60),Math.sqrt(ue*ue+I*I)<X0){E.current=null;return}ae=T(ae.x+ue*we,ae.y+I*we),m(ae),E.current=requestAnimationFrame(xe)};E.current=requestAnimationFrame(xe)},[A,T]),H=k.useCallback(K=>{y.current||(E.current!==null&&(cancelAnimationFrame(E.current),E.current=null),x.current={x:K.clientX,y:K.clientY,lastX:K.clientX,lastY:K.clientY,panX:p.current.x,panY:p.current.y,vx:0,vy:0,time:performance.now()},F())},[F]);k.useEffect(()=>{S.current=M},[M]),k.useEffect(()=>{w.current=B},[B]),k.useEffect(()=>()=>{A(),N.current!==null&&cancelAnimationFrame(N.current),R.current!==null&&cancelAnimationFrame(R.current),C.current!==null&&cancelAnimationFrame(C.current),E.current!==null&&cancelAnimationFrame(E.current)},[A]);const G=k.useCallback(K=>{if(y.current)return;K.preventDefault();const W=K.currentTarget.getBoundingClientRect(),z=K.clientX-W.left,se=K.clientY-W.top;if(!Number.isFinite(z)||!Number.isFinite(se))return;const ue=g.current,I=Math.min(t,Math.max(e,ue*v5(K))),ae=Q0(z,se,ue,I,p.current),ye=T(ae.x,ae.y);R.current!==null&&cancelAnimationFrame(R.current),R.current=requestAnimationFrame(()=>{u(I),m(ye),R.current=null})},[T,e,t]);k.useEffect(()=>{const K=r.current;if(K)return K.addEventListener("wheel",G,{passive:!1}),()=>K.removeEventListener("wheel",G)},[r,G]);const $=k.useCallback(K=>{if(y.current)return;const W=K.key;let z=null,se=null;W==="+"||W==="="?(K.preventDefault(),z=Math.min(t,g.current+K0)):W==="-"||W==="_"?(K.preventDefault(),z=Math.max(e,g.current-K0)):W==="ArrowUp"?(K.preventDefault(),se=T(p.current.x,p.current.y+rd)):W==="ArrowDown"?(K.preventDefault(),se=T(p.current.x,p.current.y-rd)):W==="ArrowLeft"?(K.preventDefault(),se=T(p.current.x+rd,p.current.y)):W==="ArrowRight"&&(K.preventDefault(),se=T(p.current.x-rd,p.current.y)),(z!==null||se!==null)&&(C.current!==null&&cancelAnimationFrame(C.current),C.current=requestAnimationFrame(()=>{z!==null&&u(z),se!==null&&m(se),C.current=null}))},[T,e,t]),q=k.useCallback((K,W,z)=>{const se=Math.min(t,Math.max(e,K)),ue=g.current;if(u(se),W!==void 0&&z!==void 0){const I=Q0(W,z,ue,se,p.current);m(T(I.x,I.y))}},[T,e,t]),P=k.useCallback((K,W)=>{const z=T(K,W);m(z)},[T]),Q=k.useCallback(()=>{u(1),m({x:0,y:0})},[]);return{transform:`matrix(${o}, 0, 0, ${o}, ${f.x}, ${f.y})`,viewport:{x:f.x,y:f.y,zoom:o},bind:{onPointerDown:H,onKeyDown:$,tabIndex:0,role:"region"},zoomTo:q,panTo:P,reset:Q}}const b5=.15,_5=30;function S5({active:e,nodes:t,edges:n,options:i,onTick:r,initialPositions:l}){const o=k.useRef({nodes:t,edges:n,options:i}),u=k.useRef(r),f=k.useRef(void 0),m=k.useRef(null),g=k.useRef(0);k.useEffect(()=>{o.current={nodes:t,edges:n,options:i}},[t,n,i]),k.useEffect(()=>{u.current=r},[r]);const p=k.useCallback(()=>{const{nodes:_,edges:S,options:w}=o.current,N=f.current,R=bc(_,S,N,w);let C=0;if(N)for(const[E,T]of R){const D=N.get(E);if(!D)continue;const O=Math.hypot(T.x-D.x,T.y-D.y);O>C&&(C=O)}else C=1/0;if(f.current=R,u.current(R),g.current=C<b5?g.current+1:0,g.current>=_5){m.current=null;return}m.current=requestAnimationFrame(p)},[]),y=k.useCallback(()=>{g.current=0,m.current===null&&e&&(m.current=requestAnimationFrame(p))},[e,p]),x=k.useRef(null);return k.useEffect(()=>{const _=t.map(w=>w.id).sort().join(" "),S=x.current!==null&&x.current!==_;x.current=_,S&&y()},[t,y]),k.useEffect(()=>{if(!e){m.current!==null&&(cancelAnimationFrame(m.current),m.current=null);return}return f.current=l&&l.size>0?new Map(l):void 0,g.current=0,m.current=requestAnimationFrame(p),()=>{m.current!==null&&(cancelAnimationFrame(m.current),m.current=null)}},[e]),{wake:y}}const nN=k.createContext(null);function ny(){const e=k.useContext(nN);if(!e)throw new Error("useGraphCanvas must be used within a GraphCanvas");return e}const aN=re.forwardRef((_,x)=>{var S=_,{id:e,label:t,kind:n,domainColor:i="default",selected:r=!1,onSelect:l,hasChildren:o=!1,collapsed:u=!1,hiddenDescendantCount:f=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(L({ref:x,className:w,"data-domain":i,"data-kind":n,onClick:N=>{N.stopPropagation(),l==null||l(e)},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),N.stopPropagation(),l==null||l(e))},role:l?"button":void 0,tabIndex:l?0:void 0,"aria-pressed":l?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&&f>0&&d.jsx("span",{className:"graph-node__hidden-badge",children:f}),d.jsx(je,{name:u?"chevronRight":"chevronDown",size:12})]})]}))});aN.displayName="GraphNode";const Z0=1,w5=8,N5=20,C5={default:1.25,hot:1.75,irrelevant:1.25},Zm={default:7,hot:8,irrelevant:7};function E5(e){const t=Number.isFinite(e)?e:0,n=Math.min(100,Math.max(0,t)),i=w5-Z0;return Z0+i*Math.sqrt(n/100)}function j5(e,t,n){return Math.min(e*(n/t),N5)}function k5(e){return Array.isArray(e)?`${e[0]} ${e[1]}`:`${e} ${e}`}function ay({id:e,d:t,mid:n,label:i,variant:r,weight:l,opacity:o,strokeDash:u,detailedTestIds:f=!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})`,_=l!==void 0?E5(l):void 0,S=C5[r],w=A=>_!==void 0?j5(A,S,_):A,N=_!==void 0?"userSpaceOnUse":void 0,R={};_!==void 0&&(R.strokeWidth=_),o!==void 0&&(R.opacity=o),u!==void 0&&(R.strokeDasharray=k5(u));const C=o!==void 0?{opacity:o}:void 0,E=w(Zm.default),T=w(Zm.irrelevant),D=w(Zm.hot),O=m?A=>{A.stopPropagation(),m(e)}:void 0,F=i?Jg(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:E,markerHeight:E,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:T,markerHeight:T,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:D,markerHeight:D,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:O,"data-testid":f?`graph-edge-hit-${e}`:void 0}),d.jsx("path",{className:"graph-edge__line",d:t,markerEnd:x,style:Object.keys(R).length?R:void 0,"data-testid":f?`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:O,children:[d.jsx("rect",{width:F.width,height:F.height,rx:"3",className:"graph-edge__label-bg","data-testid":f?`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":f?`graph-edge-label-text-${e}`:void 0,children:i})]})]})}ay.displayName="GraphEdgeShape";const J0=1.3,iN=re.forwardRef((r,i)=>{var l=r,{position:e="bottom-right",className:t=""}=l,n=pe(l,["position","className"]);const{zoomBy:o,zoomToFit:u,locked:f,setLocked:m,isFullscreen:g,toggleFullscreen:p,layout:y,liveSimulation:x,setLiveSimulation:_}=ny(),S=k.useCallback(()=>o(J0),[o]),w=k.useCallback(()=>o(1/J0),[o]),N=k.useCallback(()=>u(),[u]),R=k.useCallback(()=>m(T=>!T),[m]),C=k.useCallback(()=>_(T=>!T),[_]),E=["graph-toolbar",`graph-toolbar--${e}`,t].filter(Boolean).join(" ");return d.jsxs("div",V(L({ref:i,className:E,"data-no-drag":!0},n),{children:[d.jsx("button",{type:"button",className:"graph-toolbar__btn",onClick:S,"aria-label":"Zoom in",children:d.jsx(je,{name:"zoomIn",size:16})}),d.jsx("button",{type:"button",className:"graph-toolbar__btn",onClick:w,"aria-label":"Zoom out",children:d.jsx(je,{name:"zoomOut",size:16})}),d.jsx("button",{type:"button",className:"graph-toolbar__btn",onClick:N,"aria-label":"Zoom to fit",children:d.jsx(je,{name:"maximize",size:16})}),d.jsx("div",{className:"graph-toolbar__divider"}),d.jsx("button",{type:"button",className:"graph-toolbar__btn",onClick:R,"aria-pressed":f,"aria-label":f?"Unlock pan and zoom":"Lock pan and zoom",children:d.jsx(je,{name:f?"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(je,{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(je,{name:"orbit",size:16})})]})]}))});iN.displayName="GraphToolbar";const W0=200,Wa=138,ei=30,T5=.05,R5=8,e_=3;function M5(e,t,n){try{return e(t,n)}catch(i){return console.error("Error in renderEdge callback:",i),null}}function A5(e,t,n,i){try{return e(t,n,i)}catch(r){return console.error("Error in renderNode callback:",r),null}}function Xo(e,t){if(!e)return!0;try{return e(t)}catch(n){return console.error("Error in isStructuralEdge callback:",n),!0}}const L5=6;function D5({id:e,sourceId:t,targetId:n,label:i,variant:r="default",weight:l,opacity:o,strokeDash:u,sourceAnchor:f,targetAnchor:m,curvature:g,selected:p,hovered:y,onSelect:x,onHoverStart:_,onHoverEnd:S,renderEdge:w}){const{getNodeRect:N,nodeRects:R}=ny(),C=k.useMemo(()=>{const F=N(t),A=N(n);if(!F||!A)return null;const M=Zg(F,A,{sourceAnchor:f,targetAnchor:m,curvature:g}),B=i?Jw(M.points,Jg(i),R,L5):M.mid;return V(L({},M),{labelPos:B})},[N,t,n,f,m,g,i,R]);if(!C)return null;const E=["graph-edge",r!=="default"&&`graph-edge--${r}`,p&&"selected"].filter(Boolean).join(" "),T=!!x,D={id:e,sourceId:t,targetId:n,label:i,variant:r,weight:l,opacity:o,strokeDash:u,sourceAnchor:f,targetAnchor:m,curvature:g},O=x?F=>{F.stopPropagation(),x(e)}:void 0;return d.jsx("g",{className:E,role:T?"button":"presentation","aria-hidden":T?void 0:!0,"aria-pressed":T?!!p:void 0,"aria-label":T?i?`${i}: ${t} to ${n}`:`${t} to ${n}`:void 0,tabIndex:T?0:void 0,onClick:O,onKeyDown:T?F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),x(e))}:void 0,onPointerEnter:_?()=>_(e):void 0,onPointerLeave:S?()=>S(e):void 0,"data-testid":`graph-edge-${e}`,children:w?d.jsxs(d.Fragment,{children:[M5(w,D,{path:C.d,mid:C.mid,labelPos:C.labelPos,angle:C.angle,selected:!!p,hovered:!!y}),d.jsx("path",{className:"graph-edge__hit",d:C.d,onClick:O})]}):d.jsx(ay,{id:e,d:C.d,mid:C.labelPos,label:i,variant:r,weight:l,opacity:o,strokeDash:u,onSelect:x})})}const iy=re.forwardRef((Q,P)=>{var K=Q,{nodes:e=[],edges:t=[],selectedNodeId:n,onNodeSelect:i,onNodeHover:r,nodeTooltip:l,edgeTooltip:o,centerOnSelect:u=!1,renderNode:f,renderEdge:m,layout:g="manual",nodeMargin:p,showClusterBoundaries:y=!0,isStructuralEdge:x,showAllRelations:_=!1,collapsedNodeIds:S,onToggleCollapse:w,fitView:N=!1,fitPadding:R=40,minZoom:C=T5,maxZoom:E=R5,selectedEdgeId:T,onEdgeSelect:D,onEdgeHover:O,onBackgroundClick:F,draggable:A=!0,onNodeDragEnd:M,showToolbar:B=!0,toolbarPosition:H="bottom-right",fullscreenContainerRef:G,className:$=""}=K,q=pe(K,["nodes","edges","selectedNodeId","onNodeSelect","onNodeHover","nodeTooltip","edgeTooltip","centerOnSelect","renderNode","renderEdge","layout","nodeMargin","showClusterBoundaries","isStructuralEdge","showAllRelations","collapsedNodeIds","onToggleCollapse","fitView","fitPadding","minZoom","maxZoom","selectedEdgeId","onEdgeSelect","onEdgeHover","onBackgroundClick","draggable","onNodeDragEnd","showToolbar","toolbarPosition","fullscreenContainerRef","className"]);const[W,z]=k.useState(new Map),[se,ue]=k.useState(new Map),[I,ae]=k.useState(),[ye,xe]=k.useState(),[he,we]=k.useState(),[Ce,at]=k.useState(),Ze=k.useRef({});k.useEffect(()=>{try{r==null||r(I)}catch(Z){console.error("Error in onNodeHover callback:",Z)}},[I,r]),k.useEffect(()=>{try{O==null||O(ye)}catch(Z){console.error("Error in onEdgeHover callback:",Z)}},[ye,O]),k.useEffect(()=>{ye&&((t!=null?t:[]).some(Z=>Z.id===ye)||(xe(void 0),Ze.current.edgeTimer&&clearTimeout(Ze.current.edgeTimer),at(void 0)))},[ye,t]),k.useEffect(()=>()=>{Ze.current.nodeTimer&&clearTimeout(Ze.current.nodeTimer),Ze.current.edgeTimer&&clearTimeout(Ze.current.edgeTimer)},[]);const[Ht,ct]=k.useState(new Map),Ie=k.useRef(null),Ke=k.useCallback(Z=>{var _e;const oe=Ie.current;if(oe)try{if(oe.dragging){if(Z){const Pe=oe.target,Xe=ft=>{ft.stopPropagation(),ft.preventDefault()};Pe.addEventListener("click",Xe,{capture:!0,once:!0})}const De=(_e=Ht.get(oe.id))!=null?_e:{x:oe.startX,y:oe.startY};M==null||M(oe.id,De)}}finally{Ie.current=null}},[Ht,M]),St=k.useRef(Ke);k.useEffect(()=>{St.current=Ke},[Ke]);const Oe=k.useMemo(()=>e.map(Z=>Z.id).sort().join(" "),[e]),pt=k.useRef(!1);k.useEffect(()=>{if(!pt.current){pt.current=!0;return}const Z=Ie.current;if(Z!=null&&Z.dragging)try{Z.target.releasePointerCapture(Z.pointerId)}catch(oe){oe instanceof DOMException||console.warn("GraphCanvas: releasePointerCapture failed",oe)}St.current(!1),ct(new Map)},[Oe]);const[$e,ha]=k.useState(!1),[Jn,Ia]=k.useState(!1),Ln=k.useRef(!1),xt=k.useRef(null),[za,de]=k.useState(!1),ve=za&&g==="galaxy",Re=k.useRef(ve);k.useEffect(()=>{Re.current=ve},[ve]);const Ge=k.useMemo(()=>{const Z=t.map(oe=>({source:oe.sourceId,target:oe.targetId,structural:Xo(x,oe)}));return ey(e.map(oe=>oe.id),Z)},[e,t,x]),Me=k.useMemo(()=>{if(!S||S.size===0)return new Set;const Z=new Set;for(const oe of S)for(const _e of Up(oe,Ge.childrenOf))Z.add(_e);return Z},[S,Ge]),ze=k.useMemo(()=>Me.size===0?e:e.filter(Z=>!Me.has(Z.id)),[e,Me]);k.useEffect(()=>{I&&(ze.some(Z=>Z.id===I)||(ae(void 0),Ze.current.nodeTimer&&clearTimeout(Ze.current.nodeTimer),we(void 0)))},[I,ze]);const[Et,wt]=k.useState(new Map),gt=k.useRef(null),bt=k.useRef({}),mt=k.useRef(!1),[Wn,un]=k.useState(!1),[We,Pi]=k.useState(null),oi=k.useRef(null),sn=k.useMemo(()=>{if(!(g!=="galaxy"||!We||We.height===0))return Math.round(We.width/We.height*20)/20},[g,We]),dn=k.useRef(sn);k.useEffect(()=>{dn.current=sn});const{transform:Ba,viewport:Ye,bind:ma,panTo:Qt,zoomTo:_n}=tN({minZoom:C,maxZoom:E,containerRef:gt,locked:$e}),pa=k.useRef(null),Kl=k.useCallback(Z=>{if(Z.target instanceof Element&&Z.target.closest(".graph-node, .graph-edge, [data-no-drag]")){pa.current=null;return}pa.current={x:Z.clientX,y:Z.clientY},ma.onPointerDown(Z)},[ma]),$s=k.useCallback(Z=>{const oe=pa.current;pa.current=null,!(!oe||!F)&&Math.hypot(Z.clientX-oe.x,Z.clientY-oe.y)<e_&&F()},[F]),qi=`grid${k.useId().replace(/:/g,"")}`;k.useLayoutEffect(()=>{const Z=new Map;for(const oe of ze){const _e=bt.current[oe.id];Z.set(oe.id,{width:(_e==null?void 0:_e.offsetWidth)||Wa,height:(_e==null?void 0:_e.offsetHeight)||ei})}z(Z)},[ze,f]),k.useEffect(()=>{if(g!=="force"&&g!=="galaxy"&&g!=="force-clustered"||W.size===0||g==="galaxy"&&Re.current)return;const Z=ze.map((oe,_e)=>{var Xe,ft,rn,Sn;var De,Pe;return{id:oe.id,x:(Xe=oe.x)!=null?Xe:Math.cos(2*Math.PI*_e/ze.length)*120,y:(ft=oe.y)!=null?ft:Math.sin(2*Math.PI*_e/ze.length)*120,width:(rn=(De=W.get(oe.id))==null?void 0:De.width)!=null?rn:Wa,height:(Sn=(Pe=W.get(oe.id))==null?void 0:Pe.height)!=null?Sn:ei,pinned:oe.x!==void 0&&oe.y!==void 0}});if(g==="force"){const oe=(t!=null?t:[]).map(_e=>({source:_e.sourceId,target:_e.targetId}));ue(Bp(Z,oe,{nodeMargin:p})),wt(new Map)}else if(g==="force-clustered"){const oe=(t!=null?t:[]).map(Pe=>({source:Pe.sourceId,target:Pe.targetId})),{positions:_e,clusterBoundaries:De}=o5(Z,oe,{nodeMargin:p});ue(_e),wt(De)}else{const oe=(t!=null?t:[]).map(Pe=>({source:Pe.sourceId,target:Pe.targetId,structural:Xo(x,Pe)})),_e=G0(Z,oe,{nodeMargin:p,aspectRatio:dn.current});ue(_e);const{leafToGroup:De}=uc(Ge.roots,Ge.childrenOf);wt(cc(Z,_e,De,Pe=>{const Xe=W.get(Pe);return Xe?Math.hypot(Xe.width,Xe.height)/2:20},!0))}},[ze,t,W,g,p,x,Ge]);const ga=k.useCallback(()=>ze.map(Z=>{var ft,rn,Sn,ea;var oe,_e;const De=Ht.get(Z.id),Pe=(ft=De==null?void 0:De.x)!=null?ft:Z.x,Xe=(rn=De==null?void 0:De.y)!=null?rn:Z.y;return{id:Z.id,width:(Sn=(oe=W.get(Z.id))==null?void 0:oe.width)!=null?Sn:Wa,height:(ea=(_e=W.get(Z.id))==null?void 0:_e.height)!=null?ea:ei,x:Pe,y:Xe,pinned:Pe!==void 0&&Xe!==void 0}}),[ze,W,Ht]),Vi=k.useMemo(()=>ve?ga():[],[ve,ga]),ci=k.useMemo(()=>ve?(t!=null?t:[]).map(Z=>({source:Z.sourceId,target:Z.targetId,structural:Xo(x,Z)})):[],[ve,t,x]),Hs=k.useMemo(()=>ve?ze.map(Z=>{var De,Pe;var oe,_e;return{id:Z.id,width:(De=(oe=W.get(Z.id))==null?void 0:oe.width)!=null?De:Wa,height:(Pe=(_e=W.get(Z.id))==null?void 0:_e.height)!=null?Pe:ei}}):[],[ve,ze,W]),Ka=k.useMemo(()=>{if(!(!ve||sn===void 0))return ty(Hs,ci,{nodeMargin:p,aspectRatio:sn})},[ve,Hs,ci,p,sn]),kn=k.useMemo(()=>ve?uc(Ge.roots,Ge.childrenOf).leafToGroup:null,[ve,Ge]),le=k.useCallback(Z=>{if(ue(Z),!y||!kn)return;const oe=ze.map(_e=>{var Xe,ft;var De,Pe;return{id:_e.id,width:(Xe=(De=W.get(_e.id))==null?void 0:De.width)!=null?Xe:Wa,height:(ft=(Pe=W.get(_e.id))==null?void 0:Pe.height)!=null?ft:ei,x:0,y:0}});wt(cc(oe,Z,kn,_e=>{const De=W.get(_e);return De?Math.hypot(De.width,De.height)/2:20},!0))},[y,kn,ze,W]),{wake:Ee}=S5({active:ve,nodes:Vi,edges:ci,options:{nodeMargin:p,aspectRatio:sn,resolvedAspectScale:Ka},onTick:le,initialPositions:se});k.useEffect(()=>{const Z=gt.current;if(!Z)return;const oe=new ResizeObserver(_e=>{const{width:De,height:Pe}=_e[0].contentRect;De>0&&Pe>0&&Pi({width:De,height:Pe})});return oe.observe(Z),()=>oe.disconnect()},[]),k.useEffect(()=>{const Z=()=>{var De;const oe=(De=G==null?void 0:G.current)!=null?De:gt.current,_e=document.fullscreenElement===oe;Ia(_e),xt.current!==null&&(clearTimeout(xt.current),xt.current=null),_e?(Ln.current=!0,xt.current=setTimeout(()=>{Ln.current=!1,xt.current=null},500)):Ln.current=!1};return document.addEventListener("fullscreenchange",Z),()=>{document.removeEventListener("fullscreenchange",Z),xt.current!==null&&clearTimeout(xt.current)}},[G]);const Le=k.useCallback(()=>{var Xe;var Z,oe,_e,De;const Pe=(Xe=G==null?void 0:G.current)!=null?Xe:gt.current;document.fullscreenElement===Pe?(oe=(Z=document.exitFullscreen)==null?void 0:Z.call(document))==null||oe.catch(ft=>{console.warn("GraphCanvas: exitFullscreen() was rejected",ft)}):(De=(_e=Pe==null?void 0:Pe.requestFullscreen)==null?void 0:_e.call(Pe))==null||De.catch(ft=>{console.warn("GraphCanvas: requestFullscreen() was rejected for the fullscreenContainerRef (or default root) target",ft)})},[G]),He=k.useCallback(Z=>{var _e;return Ht.get(Z.id)||(Z.x!==void 0&&Z.y!==void 0?{x:Z.x,y:Z.y}:(_e=se.get(Z.id))!=null?_e:{x:0,y:0})},[Ht,se]),zt=k.useCallback(()=>{var Pe;let Z=1/0,oe=-1/0,_e=1/0,De=-1/0;for(const Xe of ze){const ft=He(Xe),rn=(Pe=W.get(Xe.id))!=null?Pe:{width:Wa,height:ei};Z=Math.min(Z,ft.x-rn.width/2),oe=Math.max(oe,ft.x+rn.width/2),_e=Math.min(_e,ft.y-rn.height/2),De=Math.max(De,ft.y+rn.height/2)}return Number.isFinite(Z)?{minX:Z,maxX:oe,minY:_e,maxY:De}:null},[ze,W,He]);k.useEffect(()=>{if(mt.current||!We||W.size===0||ze.length===0||(g==="force"||g==="galaxy"||g==="force-clustered")&&se.size===0)return;const Z=zt();if(Z)if(mt.current=!0,un(!0),N){const oe=Ym(Z,We.width,We.height,R,C,E);_n(oe.zoom),Qt(oe.panX,oe.panY)}else{const oe=(Z.minX+Z.maxX)/2,_e=(Z.minY+Z.maxY)/2;Qt(We.width/2-oe*Ye.zoom,We.height/2-_e*Ye.zoom)}},[We,W,se,ze,g,Ye.zoom,Qt,_n,N,R,zt]);const Dn=k.useRef(void 0);k.useEffect(()=>{if(!u||!Wn||$e||n===Dn.current)return;if(!n){Dn.current=void 0;return}if(!We)return;const Z=ze.find(_e=>_e.id===n);if(!Z)return;Dn.current=n;const oe=He(Z);Qt(We.width/2-oe.x*Ye.zoom,We.height/2-oe.y*Ye.zoom)},[u,Wn,n,$e,We,ze,He,Ye.zoom,Qt]),k.useEffect(()=>{const Z=oi.current;if(oi.current=We,!mt.current||!Z||!We||Z.width===We.width&&Z.height===We.height)return;const oe=(Z.width/2-Ye.x)/Ye.zoom,_e=(Z.height/2-Ye.y)/Ye.zoom;Qt(We.width/2-oe*Ye.zoom,We.height/2-_e*Ye.zoom)},[We,Ye.x,Ye.y,Ye.zoom,Qt]);const ya=k.useRef(void 0);k.useEffect(()=>{var Ql,Zl,fi;if(g!=="galaxy"||sn===void 0||ya.current===sn||$e||W.size===0)return;if(ya.current=sn,Re.current){Ee();return}const Z=ga(),oe=(t!=null?t:[]).map(Kt=>({source:Kt.sourceId,target:Kt.targetId,structural:Xo(x,Kt)})),_e=G0(Z,oe,{nodeMargin:p,aspectRatio:sn});ue(_e);const{leafToGroup:De}=uc(Ge.roots,Ge.childrenOf),Pe=Kt=>{const gn=W.get(Kt);return gn?Math.hypot(gn.width,gn.height)/2:20},Xe=Z.map(Kt=>({id:Kt.id,width:Kt.width,height:Kt.height,x:0,y:0}));wt(cc(Xe,_e,De,Pe,!0));let ft=1/0,rn=-1/0,Sn=1/0,ea=-1/0;for(const Kt of ze){const gn=(Zl=(Ql=Ht.get(Kt.id))!=null?Ql:_e.get(Kt.id))!=null?Zl:{x:0,y:0},hi=(fi=W.get(Kt.id))!=null?fi:{width:Wa,height:ei};ft=Math.min(ft,gn.x-hi.width/2),rn=Math.max(rn,gn.x+hi.width/2),Sn=Math.min(Sn,gn.y-hi.height/2),ea=Math.max(ea,gn.y+hi.height/2)}if(Number.isFinite(ft)&&We){const Kt={minX:ft,maxX:rn,minY:Sn,maxY:ea};if(N){const gn=Ym(Kt,We.width,We.height,R,C,E);_n(gn.zoom),Qt(gn.panX,gn.panY)}else{const gn=(Kt.minX+Kt.maxX)/2,hi=(Kt.minY+Kt.maxY)/2;Qt(We.width/2-gn*Ye.zoom,We.height/2-hi*Ye.zoom)}}},[sn,g,$e]);const Zt=k.useCallback(Z=>{const oe=zt();if(!oe||!We)return;const _e=Ym(oe,We.width,We.height,Z!=null?Z:R,C,E);_n(_e.zoom),Qt(_e.panX,_e.panY)},[zt,We,R,C,E,_n,Qt]);k.useEffect(()=>{!Ln.current||!We||(Ln.current=!1,!$e&&Zt())},[We,Zt,$e]);const On=k.useCallback(Z=>{if(!We){_n(Ye.zoom*Z);return}_n(Ye.zoom*Z,We.width/2,We.height/2)},[We,Ye.zoom,_n]),Ua=k.useCallback(Z=>{xe(oe=>oe===Z?void 0:oe)},[]),Gi=k.useCallback(Z=>{xe(Z),o&&(Ze.current.edgeTimer&&clearTimeout(Ze.current.edgeTimer),Ze.current.edgeTimer=setTimeout(()=>{at(Z)},W0))},[o]),Ps=k.useCallback(Z=>{Ua(Z),Ze.current.edgeTimer&&clearTimeout(Ze.current.edgeTimer),at(void 0)},[Ua]),Ki=k.useCallback(Z=>{ae(Z),l&&(Ze.current.nodeTimer&&clearTimeout(Ze.current.nodeTimer),Ze.current.nodeTimer=setTimeout(()=>{we(Z)},W0))},[l]),Jt=k.useCallback(Z=>{ae(oe=>oe===Z?void 0:oe),Ze.current.nodeTimer&&clearTimeout(Ze.current.nodeTimer),we(void 0)},[]),Ya=k.useCallback(Z=>{var Pe;const oe=ze.find(Xe=>Xe.id===Z);if(!oe)return e.some(Xe=>Xe.id===Z)||console.warn(`GraphCanvas: node "${Z}" not found`),null;const _e=He(oe),De=(Pe=W.get(Z))!=null?Pe:{width:Wa,height:ei};return{x:_e.x,y:_e.y,width:De.width,height:De.height}},[e,ze,W,He]),Lc=k.useCallback((Z,oe)=>{if(!A)return;Z.stopPropagation();const _e=He(oe);Ie.current={id:oe.id,pointerId:Z.pointerId,startClientX:Z.clientX,startClientY:Z.clientY,startX:_e.x,startY:_e.y,dragging:!1,target:Z.currentTarget}},[A,He]),ui=k.useCallback(Z=>{const oe=Ie.current;if(!oe||oe.pointerId!==Z.pointerId)return;const _e=Z.clientX-oe.startClientX,De=Z.clientY-oe.startClientY;if(!oe.dragging&&Math.hypot(_e,De)<e_)return;const Pe=_e/Ye.zoom,Xe=De/Ye.zoom;oe.dragging||Z.currentTarget.setPointerCapture(Z.pointerId),oe.dragging=!0;const ft={x:oe.startX+Pe,y:oe.startY+Xe};ct(rn=>{const Sn=new Map(rn);return Sn.set(oe.id,ft),Sn}),Ee()},[Ye.zoom,Ee]),di=k.useCallback(Z=>{const oe=Ie.current;!oe||oe.pointerId!==Z.pointerId||Ke(Z.type==="pointerup")},[Ke]);k.useEffect(()=>{if(A)return;const Z=Ie.current;if(Z){if(Z.dragging)try{Z.target.releasePointerCapture(Z.pointerId)}catch(oe){oe instanceof DOMException||console.warn("GraphCanvas: releasePointerCapture failed",oe)}Ke(!1)}},[A,Ke]);const Dc=k.useMemo(()=>ze.map(Z=>Ya(Z.id)).filter(Z=>Z!==null),[ze,Ya]),Yl=k.useCallback(Z=>{var Xe,ft;var oe;const _e=((Xe=(oe=Ge.childrenOf.get(Z))==null?void 0:oe.length)!=null?Xe:0)>0,De=(ft=S==null?void 0:S.has(Z))!=null?ft:!1,Pe=De?Up(Z,Ge.childrenOf).size:0;return{hasChildren:_e,collapsed:De,hiddenDescendantCount:Pe,onToggleCollapse:w?()=>w(Z):void 0}},[Ge,S,w]),Xl=k.useCallback((Z,oe)=>{const _e=Yl(Z.id);return f?A5(f,Z,oe,_e):d.jsx(aN,{id:Z.id,label:Z.label,kind:Z.kind,domainColor:Z.domainColor,selected:oe,onSelect:i,hasChildren:_e.hasChildren,collapsed:_e.collapsed,hiddenDescendantCount:_e.hiddenDescendantCount,onToggleCollapse:_e.onToggleCollapse})},[f,i,Yl]),Dr=k.useMemo(()=>{var Z;if(l&&he){const oe=ze.find(_e=>_e.id===he);if(oe){const _e=He(oe),De=(Z=W.get(oe.id))!=null?Z:{width:Wa,height:ei};try{return{content:l(oe),worldX:_e.x,worldY:_e.y-De.height/2}}catch(Pe){return console.error("Error in nodeTooltip callback:",Pe),null}}}if(o&&Ce){const oe=t.find(Pe=>Pe.id===Ce),_e=oe&&Ya(oe.sourceId),De=oe&&Ya(oe.targetId);if(oe&&_e&&De){const Pe=Zg(_e,De,{sourceAnchor:oe.sourceAnchor,targetAnchor:oe.targetAnchor,curvature:oe.curvature});try{return{content:o(oe),worldX:Pe.mid.x,worldY:Pe.mid.y}}catch(Xe){return console.error("Error in edgeTooltip callback:",Xe),null}}}return null},[l,o,he,Ce,ze,W,He,t,Ya]),Or=k.useMemo(()=>({getNodeRect:Ya,nodeRects:Dc,zoom:Ye.zoom,pan:{x:Ye.x,y:Ye.y},selectedNodeId:n,zoomToFit:Zt,setZoom:_n,zoomBy:On,setPan:Qt,locked:$e,setLocked:ha,isFullscreen:Jn,toggleFullscreen:Le,layout:g,liveSimulation:za,setLiveSimulation:de,hoveredNodeId:I,hoveredEdgeId:ye}),[Ya,Dc,Ye,n,Zt,_n,On,Qt,$e,Jn,Le,g,za,I,ye]),Ir=Z=>{typeof P=="function"?P(Z):P&&(P.current=Z),gt.current=Z},fn=18*Ye.zoom,In=(Ye.x%fn+fn)%fn,Oc=(Ye.y%fn+fn)%fn;return d.jsxs("div",V(L({ref:Ir,"aria-label":"Graph canvas",className:["graph-canvas",$].filter(Boolean).join(" "),onPointerDown:Kl,onPointerUp:$s,onKeyDown:ma.onKeyDown,tabIndex:ma.tabIndex,role:ma.role},q),{children:[d.jsx("div",{className:"graph-measure","aria-hidden":"true",children:ze.map(Z=>d.jsx("div",{ref:oe=>{bt.current[Z.id]=oe},style:{display:"inline-block"},children:Xl(Z,!1)},Z.id))}),d.jsxs(nN.Provider,{value:Or,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:qi,x:In,y:Oc,width:fn,height:fn,patternUnits:"userSpaceOnUse",children:d.jsx("circle",{cx:"0",cy:"0",r:Math.min(1,.5*Ye.zoom),className:"graph-grid-dot"})})}),d.jsx("rect",{width:"100%",height:"100%",fill:`url(#${qi})`,className:"graph-grid"}),d.jsxs("g",{className:"graph-viewport","data-testid":"graph-viewport",transform:Ba,children:[y&&Et.size>0&&d.jsx("g",{className:"graph-clusters","aria-hidden":"true",children:[...Et.entries()].map(([Z,oe])=>d.jsx("circle",{className:"graph-cluster-boundary",cx:oe.x,cy:oe.y,r:oe.r},Z))}),d.jsx("g",{className:"graph-edges",children:t==null?void 0:t.map(Z=>{const oe=Xo(x,Z),_e=Z.sourceId===I||Z.targetId===I||Z.id===ye||Z.sourceId===n||Z.targetId===n||Z.id===T;return!oe&&!_&&!_e?null:d.jsx(D5,{id:Z.id,sourceId:Z.sourceId,targetId:Z.targetId,label:Z.label,variant:Z.variant,weight:Z.weight,opacity:Z.opacity,strokeDash:Z.strokeDash,sourceAnchor:Z.sourceAnchor,targetAnchor:Z.targetAnchor,curvature:Z.curvature,selected:Z.id===T,hovered:Z.id===ye,onSelect:D,onHoverStart:Gi,onHoverEnd:Ps,renderEdge:m},Z.id)})}),d.jsx("g",{className:"graph-nodes",children:ze.map(Z=>{var Pe;const oe=He(Z),_e=(Pe=W.get(Z.id))!=null?Pe:{width:Wa,height:ei},De=Z.id===n;return d.jsx("g",{transform:`translate(${oe.x} ${oe.y})`,"data-node-id":Z.id,"data-testid":`graph-node-${Z.id}`,"data-domain":Z.domainColor,className:["graph-canvas-node",A&&"draggable",De&&"selected"].filter(Boolean).join(" "),onPointerEnter:()=>Ki(Z.id),onPointerLeave:()=>Jt(Z.id),onPointerDown:A?Xe=>Lc(Xe,Z):void 0,onPointerMove:A?ui:void 0,onPointerUp:A?di:void 0,onPointerCancel:A?di:void 0,children:d.jsx("foreignObject",{x:-_e.width/2,y:-_e.height/2,width:_e.width,height:_e.height,overflow:"visible",children:Xl(Z,De)})},Z.id)})})]})]}),B&&d.jsx(iN,{position:H}),Dr&&d.jsx("div",{className:"graph-tooltip-layer","aria-hidden":"true",children:d.jsx("div",{className:"graph-tooltip-anchor",style:{left:Dr.worldX*Ye.zoom+Ye.x,top:Dr.worldY*Ye.zoom+Ye.y},children:d.jsx(_S,{open:!0,content:Dr.content,placement:"top",children:d.jsx("span",{})})})})]})]}))});iy.displayName="GraphCanvas";const O5=re.forwardRef((w,S)=>{var N=w,{id:e,sourceId:t,targetId:n,label:i,variant:r="default",weight:l,opacity:o,strokeDash:u,sourceAnchor:f,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:R,nodeRects:C}=ny(),E=k.useMemo(()=>{const O=R(t),F=R(n);if(!O)return console.warn(`GraphEdge: source node "${t}" not found`),null;if(!F)return console.warn(`GraphEdge: target node "${n}" not found`),null;const A=Zg(O,F,{sourceAnchor:f,targetAnchor:m,curvature:g}),M=i?Jw(A.points,Jg(i),C,6):A.mid;return V(L({},A),{labelPos:M})},[R,t,n,f,m,g,i,C]);if(!E)return null;const T=["graph-edge",r!=="default"&&`graph-edge--${r}`,p&&"selected",x].filter(Boolean).join(" "),D=!!y;return d.jsx("g",V(L({ref:S,className:T,role:D?"button":"presentation","aria-hidden":D?void 0:!0,"aria-pressed":D?p:void 0,"aria-label":D?i?`${i}: ${t} to ${n}`:`${t} to ${n}`:void 0,tabIndex:D?0:void 0,onKeyDown:D?O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),y(e))}:void 0,"data-testid":`graph-edge-${e}`},_),{children:d.jsx(ay,{id:e,d:E.d,mid:E.labelPos,label:i,variant:r,weight:l,opacity:o,strokeDash:u,onSelect:y,detailedTestIds:!0})}))});O5.displayName="GraphEdge";const I5=360,z5=260,B5=640,sN=re.forwardRef((m,f)=>{var g=m,{open:e,width:t=I5,onWidthChange:n,minWidth:i=z5,maxWidth:r=B5,children:l,className:o=""}=g,u=pe(g,["open","width","onWidthChange","minWidth","maxWidth","children","className"]);const[p,y]=k.useState(t),[x,_]=k.useState(!1),S=!!n,w=S?p:t,N=k.useRef(null),R=k.useCallback(A=>M=>{A.forEach(B=>{typeof B=="function"?B(M):B&&(B.current=M)})},[]);k.useEffect(()=>{N.current&&(N.current.inert=!e)},[e]);const C=k.useRef(null),E=k.useRef(null),T=k.useCallback(A=>{const M=C.current;if(!M)return;const B=Math.min(r,Math.max(i,M.startWidth-(A.clientX-M.startX)));y(B),n==null||n(B)},[i,r,n]),D=k.useCallback(()=>{C.current=null,_(!1);const A=E.current;A&&(document.removeEventListener("mousemove",A.move),document.removeEventListener("mouseup",A.up),E.current=null)},[]),O=k.useCallback(A=>{A.preventDefault(),C.current={startX:A.clientX,startWidth:w},_(!0),E.current={move:T,up:D},document.addEventListener("mousemove",T),document.addEventListener("mouseup",D)},[w,T,D]);k.useEffect(()=>()=>{const A=E.current;A&&(document.removeEventListener("mousemove",A.move),document.removeEventListener("mouseup",A.up))},[]);const F=k.useCallback(A=>{const M=A.shiftKey?40:10;if(A.key==="ArrowLeft"){A.preventDefault();const B=Math.min(r,w+M);y(B),n==null||n(B)}else if(A.key==="ArrowRight"){A.preventDefault();const B=Math.max(i,w-M);y(B),n==null||n(B)}},[w,i,r,n]);return d.jsxs("div",V(L({ref:R([N,f]),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:O,onKeyDown:F}),d.jsx("div",{className:"detail-drawer__content",style:{width:w},children:l})]}))});sN.displayName="DetailDrawer";const _c=re.forwardRef((u,o)=>{var f=u,{node:e,relationships:t=[],onNodeSelect:n,emptyStateText:i="Select a node to inspect.",className:r=""}=f,l=pe(f,["node","relationships","onNodeSelect","emptyStateText","className"]);const m=["graph-inspector",r].filter(Boolean).join(" ");if(!e)return d.jsx("div",V(L({ref:o,className:m},l),{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(L({ref:o,className:m},l),{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."})]})]}))});_c.displayName="GraphInspector";const rN=re.forwardRef((o,l)=>{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 f=["graph-edge-inspector",i].filter(Boolean).join(" ");if(!e)return d.jsx("div",V(L({ref:l,className:f},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(L({ref:l,className:f},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(je,{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))]})]})]}))});rN.displayName="GraphEdgeInspector";const U5={ok:"rgb(var(--status-emerald))",warning:"rgb(var(--status-amber))",error:"rgb(var(--status-rose))",idle:"rgb(var(--status-neutral))"},F5=re.forwardRef((y,p)=>{var x=y,{title:e,nodeRole:t="",status:n="idle",metrics:i=[],selected:r=!1,x:l,y:o,onSelect:u,className:f="",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":"",f].filter(Boolean).join(" "),S=L(L({},l!==void 0&&o!==void 0?{position:"absolute",left:`${l}px`,top:`${o}px`}:{}),m),w=e.replace(/\s+/g,"-").toLowerCase(),N=R=>{u&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),u())};return d.jsxs("div",V(L({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:U5[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((R,C)=>d.jsxs("div",{className:"topology-node__metric-row",children:[d.jsx("div",{className:"topology-node__metric-label",children:R.label}),d.jsxs("div",{className:"topology-node__metric-value",children:[R.value,R.unit&&d.jsx("span",{className:"topology-node__metric-unit",children:R.unit})]}),d.jsx("div",{className:"topology-node__metric-bar",children:d.jsx("div",{className:"topology-node__metric-fill",style:{width:`${Number.isFinite(R.percent)?Math.max(0,Math.min(100,R.percent)):0}%`,backgroundColor:R.color?`rgb(var(--status-${R.color}))`:"rgb(var(--accent-primary))"}})})]},C))})]}))});F5.displayName="TopologyNode";const t_={life:"var(--dom-life)",climate:"var(--dom-climate)",software:"var(--dom-software)",default:"var(--dom-default)"},$5=re.forwardRef((y,p)=>{var x=y,{depth:e=0,domain:t,kind:n,label:i,meta:r,description:l,selected:o=!1,onSelect:u,showKind:f=!0,className:m=""}=x,g=pe(x,["depth","domain","kind","label","meta","description","selected","onSelect","showKind","className"]);const _=t_[t]||t_.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(L({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"}),f&&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})]})]}),l&&d.jsx("div",{className:"hierarchy-row__right",children:d.jsx("span",{className:"hierarchy-row__description",children:l})})]}))});$5.displayName="HierarchyRow";const H5=re.forwardRef((r,i)=>{var l=r,{className:e="",children:t}=l,n=pe(l,["className","children"]);const o=["hierarchy-tree",e].filter(Boolean).join(" ");return d.jsx("div",V(L({ref:i,className:o},n),{children:t}))});H5.displayName="HierarchyTree";const P5=re.forwardRef((o,l)=>{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 f=["lineage-rail",t&&"lineage-rail--wrap",n].filter(Boolean).join(" "),m=i||`Lineage: ${e.map(g=>g.label).join(" → ")}`;return d.jsx("div",V(L({ref:l,className:f,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(q5,{node:g,isHead:y})]},`${g.label}-${p}`)})}))});P5.displayName="LineageRail";const q5=({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(Xn,{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(je,{name:e.icon,size:14}),d.jsx("span",{className:"lineage-rail__label",children:e.label})]})},V5=re.forwardRef((m,f)=>{var g=m,{thumb:e,title:t,subtitle:n,meta:i,badge:r,selected:l=!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",l&&"asset-card--selected",o].filter(Boolean).join(" ");return d.jsxs("div",V(L({ref:f,className:S,"aria-selected":l},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(je,{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(je,{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})]})]}))});V5.displayName="AssetCard";const G5=re.forwardRef((o,l)=>{var u=o,{columns:e=3,gap:t=14,className:n="",children:i}=u,r=pe(u,["columns","gap","className","children"]);const f=["asset-grid",n].filter(Boolean).join(" ");return d.jsx("div",V(L({ref:l,className:f,style:{"--asset-columns":e,"--asset-gap":`${t}px`}},r),{children:i}))});G5.displayName="AssetGrid";const sy=(e,t=[])=>t.filter(n=>{const i=typeof n.startDate=="string"?new Date(n.startDate):new Date(n.startDate);return zl(e,i)}),K5=({focusedDate:e,selectedDate:t,grid:n,events:i,calendarColors:r,weekStartsOn:l,onSelectDate:o,onSelectEvent:u,renderEvent:f,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 l===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(),R=zl(S,g),C=p?zl(S,p):!1,E=TS(S),T=sy(S,i),D=3,O=T.length-D;return d.jsxs("div",{className:`calendar-month__cell ${N?"calendar-month__cell--out-of-month":""} ${R?"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":E?"date":void 0,children:E?d.jsx(Xn,{variant:"amber",form:"default",children:S.getDate()}):d.jsx("span",{children:S.getDate()})}),d.jsxs("div",{className:"calendar-month__events",children:[T.slice(0,D).map(F=>{const A=(r==null?void 0:r[F.calendarId])||"rgb(var(--status-cyan))";return d.jsx("div",{className:"calendar-month__event-bar",style:{borderLeftColor:A},onClick:M=>{M.stopPropagation(),u==null||u(F.id)},role:"button",tabIndex:0,onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),M.stopPropagation(),u==null||u(F.id))},children:f?f(F,A):d.jsx("span",{className:"calendar-month__event-title",children:F.title||"Event"})},F.id)}),O>0&&d.jsxs("div",{className:"calendar-month__event-overflow",children:["+",O," more"]})]})]},`${_}-${w}`)})},_))]})},Y5=({focusedDate:e,weekStartsOn:t,events:n,calendarColors:i,onSelectDate:r,onSelectEvent:l,renderEvent:o})=>{const u=Bl(e,t);return d.jsx("div",{className:"calendar-week",children:d.jsx("div",{className:"calendar-week__days",children:u.map(f=>{const m=sy(f,n);return d.jsxs("div",{className:"calendar-week__day",role:"button",tabIndex:0,onClick:()=>r==null?void 0:r(f),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),r==null||r(f))},children:[d.jsx("div",{className:"calendar-week__header",children:f.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(),l==null||l(g.id)},onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),y.stopPropagation(),l==null||l(g.id))},children:o?o(g,p):d.jsx("span",{children:g.title||"Event"})},g.id)})})]},f.toISOString())})})})},X5=({focusedDate:e,events:t,calendarColors:n,onSelectEvent:i,renderEvent:r})=>{const l=sy(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:l.length===0?d.jsx("div",{className:"calendar-day__empty",children:"No events scheduled"}):l.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:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),i==null||i(o.id))},children:r?r(o,u):d.jsx("span",{children:o.title||"Event"})},o.id)})})]})},Q5=({focusedDate:e,events:t=[],calendarColors:n,onSelectEvent:i,renderEvent:r})=>{const l=typeof e=="string"?new Date(e):e,o=t.filter(u=>(typeof u.startDate=="string"?new Date(u.startDate):new Date(u.startDate))>=l).sort((u,f)=>{const m=typeof u.startDate=="string"?new Date(u.startDate):new Date(u.startDate),g=typeof f.startDate=="string"?new Date(f.startDate):new Date(f.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 f=(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:f},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,f):d.jsx("span",{children:u.title||"Event"})})]},u.id)})})})},Z5=re.forwardRef((_,x)=>{var S=_,{view:e,focusedDate:t,selectedDate:n,events:i,calendarColors:r,weekStartsOn:l=0,onChangeView:o,onNavigate:u,onSelectDate:f,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=k.useMemo(()=>RS(w,l),[w.getTime(),l]),R=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"},{value:"agenda",label:"Agenda"}],C=k.useCallback(O=>{if(e!=="month")return;const F=new Date(w);if(O.key==="ArrowLeft"||O.key==="ArrowRight"||O.key==="ArrowUp"||O.key==="ArrowDown"){O.preventDefault();const A=O.key==="ArrowLeft"?-1:O.key==="ArrowRight"?1:O.key==="ArrowUp"?-7:7;F.setDate(F.getDate()+A),u==null||u(F)}else if(O.key==="PageUp")O.preventDefault(),F.setMonth(F.getMonth()-1),u==null||u(F);else if(O.key==="PageDown")O.preventDefault(),F.setMonth(F.getMonth()+1),u==null||u(F);else if(O.key==="Home"){O.preventDefault();const A=Bl(F,l);u==null||u(A[0])}else if(O.key==="End"){O.preventDefault();const A=Bl(F,l);u==null||u(A[6])}},[w.getTime(),u,e,l]),E=k.useCallback(()=>{const O=new Date(w);e==="month"?O.setMonth(O.getMonth()-1):e==="week"?O.setDate(O.getDate()-7):(e==="day"||e==="agenda")&&O.setDate(O.getDate()-1),u==null||u(O)},[w.getTime(),u,e]),T=k.useCallback(()=>{const O=new Date(w);e==="month"?O.setMonth(O.getMonth()+1):e==="week"?O.setDate(O.getDate()+7):(e==="day"||e==="agenda")&&O.setDate(O.getDate()+1),u==null||u(O)},[w.getTime(),u,e]),D=k.useCallback(()=>{u==null||u(new Date)},[u]);return d.jsxs("div",V(L({ref:x,className:`calendar ${p}`.trim()},y),{children:[d.jsxs("div",{className:"calendar__header",children:[d.jsxs("div",{className:"calendar__title",children:[e==="month"&&OR(w),e==="week"&&IR(w,l),e==="day"&&Np(w),e==="agenda"&&"Agenda"]}),d.jsxs("div",{className:"calendar__controls",children:[d.jsx(En,{variant:"secondary",size:"sm",onClick:E,"aria-label":"Previous",children:d.jsx(je,{name:"chevronLeft",size:16})}),d.jsx(En,{variant:"secondary",size:"sm",onClick:D,children:"Today"}),d.jsx(En,{variant:"secondary",size:"sm",onClick:T,"aria-label":"Next",children:d.jsx(je,{name:"chevronRight",size:16})})]})]}),d.jsx("div",{className:"calendar__view-selector",children:d.jsx(Ii,{value:e,onChange:O=>o==null?void 0:o(O),options:R})}),d.jsxs("div",{className:"calendar__content",children:[e==="month"&&d.jsx(K5,{focusedDate:w,selectedDate:n,grid:N,events:i,calendarColors:r,weekStartsOn:l,onSelectDate:f,onSelectEvent:m,renderEvent:g,onKeyDown:C}),e==="week"&&d.jsx(Y5,{focusedDate:w,weekStartsOn:l,events:i,calendarColors:r,onSelectDate:f,onSelectEvent:m,renderEvent:g}),e==="day"&&d.jsx(X5,{focusedDate:w,events:i,calendarColors:r,onSelectEvent:m,renderEvent:g}),e==="agenda"&&d.jsx(Q5,{focusedDate:w,events:i,calendarColors:r,onSelectEvent:m,renderEvent:g})]})]}))});Z5.displayName="Calendar";const J5=({card:e,isSelected:t,renderCard:n,onSelect:i,onCardPointerDown:r,onCardKeyDown:l})=>n?d.jsx("div",{className:`kanban-card ${t?"kanban-card--selected":""}`,onPointerDown:o=>r(o,e.id),onKeyDown:o=>l(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=>l(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(da,{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(je,{name:"alert",size:16}),e.blocked]})]}),W5=({column:e,cards:t,selectedId:n,onSelectCard:i,renderCard:r,draggedCardId:l,insertionIndex:o,onCardPointerDown:u,onCardKeyDown:f})=>{const m=k.useRef(null),g=e.wipLimit&&t.length>e.wipLimit;return d.jsxs(SS,{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:gc[e.statusColor]}}),d.jsx("div",{className:"kanban-column__title",children:e.title})]}),d.jsxs("div",{className:"kanban-column__header-right",children:[d.jsx(Xn,{variant:"neutral",children:t.length}),g&&d.jsx("div",{className:"kanban-column__wip-warning",title:`Over WIP limit of ${e.wipLimit}`,children:d.jsx(je,{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:[l&&o===y&&d.jsx("div",{className:"kanban-column__insertion-line"}),d.jsx(J5,{card:p,isSelected:n===p.id,renderCard:r,onSelect:x=>i==null?void 0:i(x),onCardPointerDown:u,onCardKeyDown:f})]},p.id)),l&&o===t.length&&d.jsx("div",{className:"kanban-column__insertion-line"})]})]})},eI=re.forwardRef((m,f)=>{var g=m,{columns:e,cards:t,selectedId:n,onSelectCard:i,onMoveCard:r,renderCard:l,className:o=""}=g,u=pe(g,["columns","cards","selectedId","onSelectCard","onMoveCard","renderCard","className"]);const p=k.useRef(null),[y,x]=k.useState(null),[_,S]=k.useState(null),[w,N]=k.useState(null),R=k.useRef(null),C=k.useRef(null),E=k.useMemo(()=>{const M={};return e.forEach(B=>{M[B.id]=t.filter(H=>H.columnId===B.id)}),M},[e,t]),T=k.useCallback((M,B,H)=>{R.current&&(R.current.textContent=`Card "${M}" moved to ${B} at position ${H+1}`)},[]),D=k.useCallback((M,B)=>{const H=t.find($=>$.id===B);if(!H)return;const G=M.currentTarget;G.setPointerCapture(M.pointerId),p.current={cardId:B,sourceColumnId:H.columnId,sourceIndex:E[H.columnId].findIndex($=>$.id===B),offsetY:M.clientY,pointerId:M.pointerId,capturingElement:G},x(B),N(H.columnId)},[t,E]),O=k.useCallback(M=>{var B;if(!p.current||!((B=C.current)!=null&&B.getBoundingClientRect()))return;let H=null;for(const K of e){const W=document.querySelector(`[data-column-id="${CSS.escape(K.id)}"]`);if(W){const z=W.getBoundingClientRect();if(M.clientX>=z.left&&M.clientX<z.right){H=K,N(K.id);break}}}if(!H)return;const G=document.querySelector(`[data-column-id="${CSS.escape(H.id)}"] .kanban-column__body`);if(!G)return;const $=G.getBoundingClientRect(),q=M.clientY-$.top,P=G.querySelectorAll(".kanban-card");let Q=0;for(let K=0;K<P.length;K++){const W=P[K].getBoundingClientRect(),z=W.top-$.top;if(q<z+W.height/2){Q=K;break}else Q=K+1}S(Q)},[e]),F=k.useCallback(M=>{if(!p.current)return;const B=p.current;if(p.current=null,w&&_!==null){const H=e.find($=>$.id===B.sourceColumnId),G=e.find($=>$.id===w);if(G&&H){const $=t.find(q=>q.id===B.cardId);$&&(r(B.cardId,w,_),T($.title,G.title,_))}}if(x(null),S(null),N(null),B.capturingElement&&B.pointerId!==void 0)try{B.capturingElement.releasePointerCapture(B.pointerId)}catch(H){}},[e,t,w,_,r,T]),A=k.useCallback((M,B)=>{var H,G;const $=t.find(q=>q.id===B);if($){if(M.key===" "){M.preventDefault();const q=p.current;if(q!=null&&q.isKeyboardGrab){r(q.cardId,q.sourceColumnId,q.sourceIndex);const P=e.find(Q=>Q.id===q.sourceColumnId);T($.title,(P==null?void 0:P.title)||"",q.sourceIndex),p.current=null,x(null),S(null),N(null)}else{const P=E[$.columnId].findIndex(Q=>Q.id===B);p.current={cardId:B,sourceColumnId:$.columnId,sourceIndex:P,offsetY:0,isKeyboardGrab:!0,originalColumnId:$.columnId,originalIndex:P},x(B),N($.columnId)}}else if(M.key==="ArrowUp"||M.key==="ArrowDown"||M.key==="ArrowLeft"||M.key==="ArrowRight"){M.preventDefault();const q=p.current;if(!q||!q.isKeyboardGrab)return;const P=e.findIndex(se=>se.id===q.sourceColumnId),Q=E[q.sourceColumnId];if(!Q){p.current=null,x(null),S(null),N(null);return}const K=q.sourceIndex;let W=q.sourceColumnId,z=K;M.key==="ArrowUp"&&K>0?z=K-1:M.key==="ArrowDown"&&K<Q.length-1?z=K+1:M.key==="ArrowLeft"&&P>0?(W=e[P-1].id,z=0):M.key==="ArrowRight"&&P<e.length-1&&(W=e[P+1].id,z=0),p.current=V(L({},q),{sourceColumnId:W,sourceIndex:z}),N(W),S(z),T($.title,((H=e.find(se=>se.id===W))==null?void 0:H.title)||"",z)}else if(M.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),T($.title,((G=e.find(P=>P.id===q.originalColumnId))==null?void 0:G.title)||"",q.originalIndex)),p.current=null,x(null),S(null),N(null)}}},[t,E,e,r,T]);return d.jsxs("div",V(L({ref:f,className:`kanban-board ${o}`,onPointerMove:O,onPointerUp:F},u),{children:[d.jsx("div",{ref:C,className:"kanban-board__columns",children:e.map(M=>d.jsx("div",{"data-column-id":M.id,className:"kanban-board__column-wrapper",children:d.jsx(W5,{column:M,cards:E[M.id]||[],selectedId:n,onSelectCard:B=>i==null?void 0:i(B),renderCard:l,draggedCardId:y||void 0,insertionIndex:w===M.id?_!=null?_:0:void 0,onCardPointerDown:D,onCardKeyDown:A})},M.id))}),d.jsx("div",{ref:R,className:"kanban-board__live-region",role:"status","aria-live":"polite","aria-atomic":"true"})]}))});eI.displayName="KanbanBoard";const tI=re.forwardRef((f,u)=>{var m=f,{entries:e=[],follow:t=!0,maxRows:n=500,showOps:i=!1,className:r="","aria-label":l}=m,o=pe(m,["entries","follow","maxRows","showOps","className","aria-label"]);const g=k.useRef(null),p=k.useRef(null),[y,x]=k.useState(t);k.useEffect(()=>{u&&(typeof u=="function"?u(g.current):u.current=g.current)},[u]),k.useEffect(()=>{if(!t||!p.current)return;const N=new IntersectionObserver(R=>{R.forEach(C=>{C.isIntersecting&&x(!0)})},{threshold:.1});return N.observe(p.current),()=>{N.disconnect()}},[t]),k.useEffect(()=>{y&&t&&g.current&&(g.current.scrollTop=g.current.scrollHeight)},[e,t,y]),k.useEffect(()=>{if(!t||!g.current)return;const N=()=>{const{scrollTop:C,scrollHeight:E,clientHeight:T}=g.current;E-C-T<50||x(!1)},R=g.current;return R.addEventListener("scroll",N),()=>{R.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(L({ref:g,className:w,role:"log","aria-live":y&&t?"polite":void 0,"aria-label":l!=null?l:"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 R=typeof N.timestamp=="string"?new Date(N.timestamp):N.timestamp,C=LR(R),E=`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:E,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"})]}))});tI.displayName="LogStream";function $p(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))),f=Math.max(0,Math.min(255,parseInt(n[3],10)));return"#"+[o,u,f].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,f=parseFloat(i[3])/100,m=(1-Math.abs(2*f-1))*u,g=m*(1-Math.abs(o*6%2-1)),p=f-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"},l=t.toLowerCase();return l in r?r[l]:"#10b981"}function nI(e,t,n,i){const r=(e-t)/(n-t||1),l=Math.round((.12+r*.88)*255).toString(16).padStart(2,"0");return`${$p(i)}${l}`}function vs(e,t,n){const i=Math.pow(2,n),r=(t+180)/360*i*256,l=Math.max(-85.05112878,Math.min(85.05112878,e)),o=(1-Math.log(Math.tan(l*Math.PI/180)+1/Math.cos(l*Math.PI/180))/Math.PI)/2*i*256;return{x:r,y:o}}function aI(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 iI({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 sI({pin:e,x:t,y:n,onClose:i}){const r=k.useRef(null);return qd(r,!0,{mode:"popup"}),k.useEffect(()=>{const l=o=>{o.key==="Escape"&&i()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[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 rI=re.forwardRef((N,w)=>{var R=N,{mode:e,pins:t=[],selectedPinId:n,onSelectPin:i,trackPoints:r=[],heatmapData:l=[],heatmapColor:o="#10b981",tileUrl:u,bounds:f,scaleBar:m=!1,minZoom:g=0,maxZoom:p=18,onViewportChange:y,onModeChange:x,className:_=""}=R,S=pe(R,["mode","pins","selectedPinId","onSelectPin","trackPoints","heatmapData","heatmapColor","tileUrl","bounds","scaleBar","minZoom","maxZoom","onViewportChange","onModeChange","className"]);const C=k.useRef(null),[E,T]=k.useState(null),[D,O]=k.useState(null),F=k.useRef(!1),A=k.useCallback(z=>{const se=aI(z.x/z.zoom,z.y/z.zoom,Math.round(z.zoom*4));y==null||y({center:{lat:se.lat,lng:se.lng},zoom:z.zoom})},[y]),{transform:M,viewport:B,bind:H,panTo:G}=tN({minZoom:g,maxZoom:p,onViewportChange:A,containerRef:C}),$=`map-grid-${k.useId().replace(/:/g,"")}`;k.useEffect(()=>{const z=C.current;if(!z)return;const se=new ResizeObserver(ue=>{const{width:I,height:ae}=ue[0].contentRect;I>0&&ae>0&&T({width:I,height:ae})});return se.observe(z),()=>se.disconnect()},[]),k.useEffect(()=>{if(F.current||!E||!f&&t.length===0&&r.length===0&&l.length===0)return;const z=[...t.map(Oe=>({lat:Oe.lat,lng:Oe.lng})),...r.map(Oe=>({lat:Oe.lat,lng:Oe.lng})),...l.map(Oe=>({lat:Oe.lat,lng:Oe.lng}))];let se=null;if(f)se={north:Math.max(f[0].lat,f[1].lat),south:Math.min(f[0].lat,f[1].lat),east:Math.max(f[0].lng,f[1].lng),west:Math.min(f[0].lng,f[1].lng)};else if(z.length>0){const Oe=z.map($e=>$e.lat),pt=z.map($e=>$e.lng);se={north:Math.max(...Oe),south:Math.min(...Oe),east:Math.max(...pt),west:Math.min(...pt)}}if(!se)return;const ue=60,I=vs(se.north,se.west,10).y,ae=vs(se.south,se.east,10).y,ye=vs(se.north,se.west,10).x,xe=vs(se.north,se.east,10).x,he=Math.abs(ae-I),we=Math.abs(xe-ye);if(he===0||we===0||E.height<=ue*2||E.width<=ue*2){G(E.width/2,E.height/2),F.current=!0;return}const Ce=Math.log2((E.height-ue*2)/he),at=Math.log2((E.width-ue*2)/we);if(!Number.isFinite(Ce)||!Number.isFinite(at)){G(E.width/2,E.height/2),F.current=!0;return}const Ze=Math.max(g,Math.min(p,Math.floor(Math.min(Ce,at)))),Ht=(se.north+se.south)/2,ct=(se.east+se.west)/2,Ie=vs(Ht,ct,Ze),Ke=E.width/2-Ie.x*Ze,St=E.height/2-Ie.y*Ze;G(Ke,St),F.current=!0},[E,f,t.length,r.length,l.length,g,p,G]);const q=k.useCallback(z=>{z.target instanceof Element&&(z.target.closest(".map-pin")||z.target.closest(".map-popover")||z.target.closest("[data-no-drag]"))||H.onPointerDown(z)},[H]),P=k.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(z=>{const se=vs(z.lat,z.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===z.id&&"map-pin--selected"].filter(Boolean).join(" "),onClick:ae=>{ae.stopPropagation(),i==null||i(z.id);const ye=ae.target.getBoundingClientRect();O({x:ye.right+8,y:ye.top})},"aria-label":`${z.label||"Pin"} at latitude ${z.lat.toFixed(4)}, longitude ${z.lng.toFixed(4)}${z.timestamp?` on ${z.timestamp}`:""}`,"data-testid":`map-pin-${z.id}`,"data-no-drag":!0,style:{position:"absolute",left:`${ue}px`,top:`${I}px`,pointerEvents:"auto"},children:[d.jsx("span",{className:"map-pin__dot"}),z.label&&d.jsx("span",{className:"map-pin__label",children:z.label})]},z.id)})}),[e,t,B.zoom,B.x,B.y,n,i]),Q=k.useCallback(()=>{if(e!=="track"||!r.length)return null;const z=r.map(se=>vs(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:z,className:"map-track__line"})})},[e,r,B.zoom]),K=k.useCallback(()=>{if(e!=="heatmap"||!l.length)return null;const z=l.map(I=>I.value).filter(I=>I!=null),se=Math.min(...z),ue=Math.max(...z);return d.jsx("g",{className:"map-heatmap","data-testid":"map-heatmap",children:l.map((I,ae)=>{const ye=vs(I.lat,I.lng,Math.round(B.zoom*4)),xe=(I.value-se)/(ue-se||1),he=nI(I.value,se,ue,o);return d.jsx("circle",{cx:ye.x,cy:ye.y,r:8+xe*4,fill:he,opacity:.6,"data-testid":`heatmap-point-${ae}`},ae)})})},[e,l,o,B.zoom]),W=k.useCallback(()=>{if(!u||!E)return null;const z=Math.min(Math.max(Math.floor(B.zoom*4),0),28),se=Math.pow(2,z),ue=Math.max(0,Math.floor(-B.x/(256*B.zoom))),I=Math.max(0,Math.floor(-B.y/(256*B.zoom))),ae=Math.min(se,Math.ceil((E.width-B.x)/(256*B.zoom))),ye=Math.min(se,Math.ceil((E.height-B.y)/(256*B.zoom))),xe=typeof u=="function"?u:(we,Ce,at)=>u.replace("{x}",String(we)).replace("{y}",String(Ce)).replace("{z}",String(at)),he=[];for(let we=ue;we<ae;we++)for(let Ce=I;Ce<ye;Ce++){const at=xe(we,Ce,z);he.push(d.jsx("image",{href:at,x:we*256,y:Ce*256,width:256,height:256,"data-testid":`tile-${we}-${Ce}`},`${z}-${we}-${Ce}`))}return he},[u,E,B]);return d.jsxs("div",V(L(V(L({ref:z=>{typeof w=="function"?w(z):w&&(w.current=z),C.current=z},className:["map-canvas",_].filter(Boolean).join(" ")},H),{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(iI,{patternId:$,zoomLevel:B.zoom})}),u?d.jsx("g",{className:"map-tiles",transform:M,children:W()}):d.jsx("rect",{width:"100%",height:"100%",fill:`url(#${$})`,className:"map-grid"}),d.jsxs("g",{className:"map-viewport",transform:M,children:[Q(),K()]})]}),P(),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, ${$p(o)}20, ${$p(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&&D&&(()=>{const z=t.find(se=>se.id===n);return z?d.jsx(sI,{pin:z,x:D.x,y:D.y,onClose:()=>{i==null||i(null),O(null)}}):null})()]}))});rI.displayName="MapCanvas";const lI=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"short",year:"numeric"}),oI=re.forwardRef((f,u)=>{var m=f,{focusedDate:e,selectedDate:t,markers:n=[],weekStartsOn:i=0,onSelect:r,className:l=""}=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=k.useMemo(()=>RS(g,i),[g.getTime(),i]),x=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];i===1&&x.push(x.shift());const _=S=>n.some(w=>zl(S,w));return d.jsxs("div",V(L({ref:u,className:`mini-calendar ${l}`.trim()},o),{children:[d.jsx("div",{className:"mini-calendar__header",children:d.jsx("div",{className:"mini-calendar__title",children:lI(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(),R=p?zl(w,p):!1,C=TS(w),E=_(w);return d.jsxs("button",{className:`mini-calendar__date ${N?"mini-calendar__date--out-of-month":""} ${R?"mini-calendar__date--selected":""} ${C?"mini-calendar__date--today":""} ${E?"mini-calendar__date--has-marker":""}`,onClick:()=>!N&&(r==null?void 0:r(w)),type:"button","aria-current":C?"date":void 0,"aria-selected":R,children:[d.jsx("span",{className:"mini-calendar__date-number",children:w.getDate()}),E&&d.jsx("span",{className:"mini-calendar__marker"})]},w.toISOString())}))})]})]}))});oI.displayName="MiniCalendar";const cI={life:"var(--dom-life)",climate:"var(--dom-climate)",software:"var(--dom-software)",data:"var(--dom-default)",infrastructure:"var(--dom-default)"},uI=e=>cI[e]||"var(--accent-primary)",dI=e=>{const t=["emerald","cyan","amber","rose","violet"],n=e.split("").reduce((i,r)=>i+r.charCodeAt(0),0);return t[n%t.length]},fI=re.forwardRef((y,p)=>{var x=y,{domain:e,source:t,version:n,snippet:i,provenance:r,score:l,onOpen:o,actions:u,selected:f=!1,className:m=""}=x,g=pe(x,["domain","source","version","snippet","provenance","score","onOpen","actions","selected","className"]);const _=uI(e),S=dI(e),w=re.useCallback(C=>{(C.key==="Enter"||C.key===" ")&&o&&(C.preventDefault(),o())},[o]),N=["result-card",f&&"result-card--selected",m].filter(Boolean).join(" "),R=n?`${t} v${n}`:t;return d.jsxs("div",V(L({ref:p,className:N,role:"article","aria-label":R,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(da,{children:n})]}),l!==void 0&&d.jsx("span",{className:"result-card__score-label",children:l.toFixed(2)})]}),l!==void 0&&d.jsx("div",{className:"result-card__score-bar",children:d.jsx(jg,{percent:l*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,E)=>d.jsx(En,{variant:"ghost",size:"sm",icon:!!C.icon,title:C.label,onClick:T=>{T.stopPropagation(),C.onClick()},children:C.icon?d.jsx(je,{name:C.icon,size:16}):C.label},E))})]}))});fI.displayName="ResultCard";const hI=/^[0-9a-fA-F]+$/;function lN(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 Jm(e,t){if(!e)return"";if(hI.test(e)&&e.length===t)return e.toLowerCase();try{return lN(e).toLowerCase()}catch(n){return e.toLowerCase()}}function mI(e){return!e||/^0+$/.test(e)?null:e}const Wm=["UNSPECIFIED","INTERNAL","SERVER","CLIENT","PRODUCER","CONSUMER"];function pI(e){var t,n;if(typeof e=="number")return(t=Wm[e])!=null?t:"UNSPECIFIED";if(typeof e=="string"){if(/^\d+$/.test(e))return(n=Wm[Number(e)])!=null?n:"UNSPECIFIED";const i=e.replace(/^SPAN_KIND_/,"").toUpperCase();return Wm.includes(i)?i:"UNSPECIFIED"}return"UNSPECIFIED"}function gI(e){const t=typeof e=="string"&&/^\d+$/.test(e)?Number(e):e;return t===2||t==="STATUS_CODE_ERROR"?"error":"ok"}function ld(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 ry(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 lN(e.bytesValue)}catch(n){return e.bytesValue}return e.arrayValue?JSON.stringify(((t=e.arrayValue.values)!=null?t:[]).map(ry)):e.kvlistValue?JSON.stringify(Hp(e.kvlistValue.values)):""}function Hp(e){const t={};return(e!=null?e:[]).forEach(n=>{n&&n.key&&(t[n.key]=ry(n.value))}),t}function ep(e,t){const n=(e!=null?e:[]).find(i=>i.key===t);return n?ry(n.value):void 0}const yI=["http.response.status_code","http.status_code","rpc.grpc.status_code"];function vI(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={},l=[];if(i.forEach(_=>{var R,C,E,T;var S;const w=(S=_.resource)==null?void 0:S.attributes,N=String((R=ep(w,n))!=null?R:"unknown_service");if(!r[N]){const D=(C=ep(w,"host.name"))!=null?C:ep(w,"service.instance.id");r[N]={label:N,host:D!=null?String(D):void 0}}((T=(E=_.scopeSpans)!=null?E:_.instrumentationLibrarySpans)!=null?T:[]).forEach(D=>{var O;((O=D.spans)!=null?O:[]).forEach(F=>l.push({span:F,service:N}))})}),l.length===0)return{spans:[],services:r,meta:{traceId:""}};let o=null;l.forEach(({span:_})=>{const S=ld(_.startTimeUnixNano);S!==null&&(o===null||S<o)&&(o=S)});const u=o!=null?o:BigInt(0),f=l.map(({span:_,service:S})=>{var M,B,H,G;var w;const N=(M=ld(_.startTimeUnixNano))!=null?M:u,R=(B=ld(_.endTimeUnixNano))!=null?B:N,C=Number(N-u)/1e6,E=Number(R-N)/1e6,T=Hp(_.attributes);let D;const O=((H=_.events)!=null?H:[]).map($=>{var K;const q=Hp($.attributes),P=ld($.timeUnixNano),Q=P!==null?Number(P-u)/1e6:C;return $.name==="exception"&&!D&&(D={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:(K=$.name)!=null?K:"event",attributes:q}});let F;for(const $ of yI){const q=T[$];if(q!==void 0){F=typeof q=="boolean"?String(q):q;break}}const A={id:Jm(_.spanId,16),parentId:mI(Jm(_.parentSpanId,16)),name:(G=_.name)!=null?G:"(unnamed)",service:S,kind:pI(_.kind),start:C,duration:E,status:gI((w=_.status)==null?void 0:w.code),statusCode:F,attributes:T,exception:D,events:O.length?O:void 0};return t.deriveStatus?V(L({},A),{status:t.deriveStatus(A)}):A}),m=(x=f.find(_=>_.parentId===null))!=null?x:f[0],g={traceId:Jm(l[0].span.traceId,32),name:m==null?void 0:m.name,rootService:m==null?void 0:m.service};return{spans:f,services:r,meta:g}}function xI(e){if(!e)return"";const t=e.split("-");return t.length===3?(t[1]+t[2]).toLowerCase():e.replace(/-/g,"").toLowerCase()}function bI(e,t){return t?"SERVER":e.namespace==="aws"||e.namespace==="remote"?"CLIENT":"INTERNAL"}function _I(e){return e.fault||e.error||e.throttle?"error":"ok"}function Pp(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 l=t?`${t}.${i}`:i;typeof r=="object"&&!Array.isArray(r)?Pp(e,l,r):e[l]=Array.isArray(r)?JSON.stringify(r):r})}}function SI(e){var t,n;const i={},r=(t=e.http)==null?void 0:t.request,l=(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),(l==null?void 0:l.status)!=null&&(i["http.response.status_code"]=l.status),(l==null?void 0:l.content_length)!=null&&(i["http.response.body.size"]=l.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&&Pp(i,"aws",e.aws),e.annotations&&Object.entries(e.annotations).forEach(([o,u])=>{i[o]=u}),e.metadata&&Pp(i,"metadata",e.metadata),i}function wI(e){var o,u;var t,n,i,r;let l;if(e.cause&&typeof e.cause=="object"&&(t=e.cause.exceptions)!=null&&t.length){const f=e.cause.exceptions[0],m=(n=f.stack)!=null&&n.length?`${(o=f.type)!=null?o:"Error"}: ${(u=f.message)!=null?u:""}
|
|
78
|
+
`+f.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;l={type:f.type,message:f.message,stacktrace:m}}else typeof e.cause=="string"&&(l={type:"Error",message:`exception ${e.cause}`});return{exception:l,statusCode:(r=(i=e.http)==null?void 0:i.response)==null?void 0:r.status}}function oN(e){var t,n;if(e==null)return[];if(Array.isArray(e))return e.flatMap(oN);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(l=>{var o;return((o=l.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 NI(e,t={}){var p;const n=oN(e);if(n.length===0)return{spans:[],services:{},meta:{traceId:""}};const i=[],r={},l=(y,x,_,S)=>{var w;i.push({node:y,parentId:x,service:_,isRoot:S}),((w=y.subsegments)!=null?w:[]).forEach(N=>l(N,y.id,_,!1))};n.forEach(y=>{var S;const x=y.type==="subsegment",_=y.name;r[_]||(r[_]={label:_}),l(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 f=i.map(({node:y,parentId:x,service:_,isRoot:S})=>{var A,M,B,H;const w=typeof y.start_time=="number"?y.start_time:o,N=(w-o)*1e3,R=typeof y.end_time=="number"?y.end_time:u,C=Math.max(0,(R-w)*1e3),E=SI(y),{exception:T,statusCode:D}=wI(y),O=T?[{time:N,name:"exception",attributes:{"exception.type":(A=T.type)!=null?A:"","exception.message":(M=T.message)!=null?M:""}}]:void 0,F={id:String((B=y.id)!=null?B:"").toLowerCase(),parentId:x!=null?String(x).toLowerCase():null,name:String((H=y.name)!=null?H:"(unnamed)"),service:_,kind:bI(y,S),start:N,duration:C,status:_I(y),statusCode:D,attributes:E,exception:T,events:O};return t.deriveStatus?V(L({},F),{status:t.deriveStatus(F)}):F}),m=(p=n.find(y=>y.type!=="subsegment"))!=null?p:n[0],g={traceId:xI(m.trace_id),name:m.name,rootService:m.name};return{spans:f,services:r,meta:g}}function CI(e){const t={};e.forEach(f=>{t[f.id]=V(L({},f),{end:f.start+f.duration,depth:0,children:[],hasChildren:!1})});const n=[];e.forEach(f=>{const m=t[f.id];f.parentId&&t[f.parentId]&&f.parentId!==f.id?t[f.parentId].children.push(m):n.push(m)});const i=(f,m)=>f.start-m.start||f.end-m.end;n.sort(i);const r=[];let l=0;const o=(f,m)=>{f.depth=m,f.hasChildren=f.children.length>0,m>l&&(l=m),r.push(f),f.children.sort(i),f.children.forEach(g=>o(g,m+1))};n.forEach(f=>o(f,0));const u=r.reduce((f,m)=>m.end>f?m.end:f,0);return{byId:t,ordered:r,roots:n,total:u,maxDepth:l}}function cN(e){if(!e.children.length)return e.duration;const t=e.children.map(l=>[Math.max(l.start,e.start),Math.min(l.end,e.end)]).filter(([l,o])=>o>l).sort((l,o)=>l[0]-o[0]);let n=0,i=null,r=0;return t.forEach(([l,o])=>{i===null?(i=l,r=o):l<=r?r=Math.max(r,o):(n+=r-i,i=l,r=o)}),i!==null&&(n+=r-i),Math.max(0,e.duration-n)}function EI(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 jI(e){let t=0;const n=i=>{i.children.forEach(r=>{t++,n(r)})};return n(e),t}const qp=2;function uN(e,t,n=qp){const i=Math.max(1e-6,t-e),r=100-2*n;return{x:l=>n+(l-e)/i*r,w:l=>Math.max(.5,l/i*r)}}function kI(e,t){const n=Math.max(1e-6,t-e)/8,i=Math.pow(10,Math.floor(Math.log10(n))),r=n/i,l=i*(r<1.5?1:r<3?2:r<7?5:10),o=[],u=Math.ceil(e/l-1e-9)*l;for(let f=u;f<=t+1e-6;f+=l)o.push(+f.toFixed(3));return{ticks:o,step:l}}function Yn(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 dN=["#22D3EE","#818CF8","#10B981","#8B5CF6","#14B8A6","#F59E0B","#38BDF8","#A3E635","#E879F9","#2DD4BF"];function TI(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 RI(e,t=dN){return t[TI(e)%t.length]}function MI(e,t,n,i=dN){var r;return(n==null?void 0:n(e))||((r=t==null?void 0:t[e])==null?void 0:r.color)||RI(e,i)}function AI(e,t){var n;return((n=t==null?void 0:t[e])==null?void 0:n.label)||e}const LI={SERVER:"server",CLIENT:"client",INTERNAL:"internal",PRODUCER:"producer",CONSUMER:"consumer",UNSPECIFIED:"internal"},DI={ok:"OK",warn:"WARN",error:"ERROR"};function OI({model:e,resolveColor:t,selectedId:n}){const{ordered:i,total:r}=e,l=100,o=2,u=1,f=3,m=i.length,g=f*2+m*(o+u),p=i.findIndex(x=>x.id===n),y=re.useMemo(()=>{const x=uN(0,r);return i.map((_,S)=>d.jsx("rect",{x:x.x(_.start),y:f+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 ${l} ${g}`,preserveAspectRatio:"none",children:[p>=0&&d.jsx("rect",{x:"0",y:f+p*(o+u)-1,width:l,height:o+2,className:"trace-detail__minimap-band"}),y]})}function n_({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 lr({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 fN=re.forwardRef(function({span:e,model:t,traceId:n,resolveColor:i,serviceLabel:r,serviceHost:l,onClose:o,onSelect:u,renderAttributes:f,closeButtonRef:m},g){var O,F,A,M;var p;const y=i(e.service),x=t.total,_=cN(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,R=(O=LI[e.kind])!=null?O:"internal",C=t.ordered.findIndex(B=>B.id===e.id)+1,E=e.attributes?Object.entries(e.attributes):[],T=((F=e.events)!=null?F:[]).filter(B=>B.name!=="exception"),D=({label:B,value:H,sub:G})=>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:[H,G&&d.jsxs("span",{className:"trace-detail__timing-sub",children:[" ",G]})]})]});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"}),DI[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(je,{name:"x",size:14})})]}),d.jsxs("div",{className:"trace-detail__scroll",children:[d.jsxs(lr,{title:"TRACE MAP",children:[d.jsx("div",{className:"trace-detail__minimap-wrap",children:d.jsx(OI,{model:t,resolveColor:i,selectedId:e.id})}),d.jsxs("div",{className:"trace-detail__minimap-caption",children:["row ",C," of ",t.ordered.length]})]}),d.jsxs(lr,{title:"TIMING",children:[d.jsx(D,{label:"start offset",value:Yn(e.start)}),d.jsx(D,{label:"duration",value:Yn(e.duration)}),d.jsx(D,{label:"self time",value:Yn(_),sub:`· ${w.toFixed(0)}%`}),d.jsx(D,{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 ",Yn(_)]}),d.jsxs("span",{children:["IN CHILDREN ",Yn(e.duration-_)]})]})]}),d.jsx(lr,{title:"IDENTITY",children:d.jsx(n_,{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]})],...l?[["host",l]]:[],["kind",d.jsx("span",{className:`trace-detail__kind trace-detail__kind--${R}`,children:e.kind})],...n?[["trace_id",n]]:[]]})}),f?d.jsx(lr,{title:"ATTRIBUTES",children:f(e)}):E.length>0?d.jsx(lr,{title:"ATTRIBUTES",right:d.jsx("span",{className:"trace-detail__count",children:E.length}),children:d.jsx(n_,{rows:E.map(([B,H])=>[B,String(H)])})}):null,T.length>0&&d.jsx(lr,{title:"EVENTS",right:d.jsx("span",{className:"trace-detail__count",children:T.length}),children:d.jsx("div",{className:"trace-detail__events",children:T.map((B,H)=>d.jsxs("div",{className:"trace-detail__event",children:[d.jsx("span",{className:"trace-detail__event-time",children:Yn(B.time)}),d.jsx("span",{className:"trace-detail__event-name",children:B.name})]},H))})}),d.jsx(lr,{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(je,{name:"alert",size:14}),d.jsx("span",{children:(A=e.exception.type)!=null?A:"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(je,{name:"alert",size:13}),"degraded — ",String((M=(p=e.attributes)==null?void 0:p.note)!=null?M:"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"})]})]})});fN.displayName="TraceDetailPanel";const a_=14,i_=16;function II({node:e,rowHeight:t,treeWidth:n,selected:i,hovered:r,collapsed:l,color:o,onSelect:u,onHover:f,onToggle:m,registerRef:g}){const p=a_+e.depth*i_,y=[];for(let _=0;_<e.depth;_++)y.push(a_+_*i_+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?!l:void 0,tabIndex:i?0:-1,style:{height:t,paddingLeft:p,width:n},onClick:()=>u(e.id),onMouseEnter:()=>f(e.id),onMouseLeave:()=>f(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"+(l?"":" is-open"),onClick:_=>{_.stopPropagation(),m(e.id)},tabIndex:-1,"aria-label":l?"Expand":"Collapse",children:d.jsx(je,{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}),l&&e.hasChildren&&d.jsxs("span",{className:"trace-viewer__desc-count",children:["+",jI(e)]}),d.jsx("span",{className:"trace-viewer__tree-dur",children:Yn(e.duration)})]})}function zI({node:e,rowHeight:t,scaleX:n,scaleW:i,selected:r,hovered:l,color:o,onSelect:u,onHover:f}){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",l&&"is-hovered"].filter(Boolean).join(" ");return d.jsxs("div",{className:_,style:{height:t},onClick:()=>u(e.id),onMouseEnter:()=>f(e.id),onMouseLeave:()=>f(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(je,{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:Yn(e.duration)}),d.jsx("span",{className:"trace-viewer__bar-name",children:e.name})]})]})}const BI=re.memo(function({model:e,resolveColor:t,resolveLabel:n}){const{ordered:i,total:r}=e,l=new Set(i.map(y=>y.service)),o=i.filter(y=>y.status==="error").length,u=i.filter(y=>y.status==="warn").length,f={};i.forEach(y=>{f[y.service]=(f[y.service]||0)+cN(y)});const m=Object.entries(f).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:Yn(r),tone:"accent"}),d.jsx(p,{label:"SPANS",value:i.length}),d.jsx(p,{label:"SERVICES",value:l.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)} · ${Yn(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:Yn(x)})]},y))})]})]})}),UI=re.forwardRef(function(F,O){var A=F,{trace:e,otlp:t,xray:n,selectedSpanId:i,defaultSelectedSpanId:r=null,onSelectSpan:l,collapsedSpanIds:o,defaultCollapsedSpanIds:u,onToggleSpan:f,showSummary:m=!0,showToolbar:g=!0,showDetailPanel:p=!0,treeWidth:y=336,detailPanelWidth:x=360,rowHeight:_=30,services:S,serviceColor:w,deriveStatus:N,renderAttributes:R,enableZoom:C=!0,virtualizeThreshold:E=80,className:T=""}=A,D=pe(A,["trace","otlp","xray","selectedSpanId","defaultSelectedSpanId","onSelectSpan","collapsedSpanIds","defaultCollapsedSpanIds","onToggleSpan","showSummary","showToolbar","showDetailPanel","treeWidth","detailPanelWidth","rowHeight","services","serviceColor","deriveStatus","renderAttributes","enableZoom","virtualizeThreshold","className"]);var M,B;const H=k.useMemo(()=>{let le;return t?le=vI(t):n?le=NI(n):le=e!=null?e:{spans:[]},N&&(le=V(L({},le),{spans:le.spans.map(Ee=>V(L({},Ee),{status:N(Ee)}))})),le},[t,n,e,N]),G=k.useMemo(()=>CI(H.spans),[H]),{ordered:$,byId:q,total:P}=G,Q=k.useMemo(()=>{var le;return L(L({},(le=H.services)!=null?le:{}),S!=null?S:{})},[H.services,S]),K=k.useCallback(le=>MI(le,Q,w),[Q,w]),W=k.useCallback(le=>AI(le,Q),[Q]),[z,se]=k.useState(r),ue=i!==void 0?i:z,I=ue&&q[ue]?ue:null,ae=k.useCallback(le=>{i===void 0&&se(le),l==null||l(le)},[i,l]),[ye,xe]=k.useState(()=>new Set(u!=null?u:[])),he=k.useMemo(()=>o?new Set(o):ye,[o,ye]),we=k.useCallback(le=>{const Ee=!he.has(le);o===void 0&&xe(Le=>{const He=new Set(Le);return He.has(le)?He.delete(le):He.add(le),He}),f==null||f(le,Ee)},[he,o,f]),Ce=k.useCallback(le=>{var Ee;if(o!==void 0)return;const Le=[];let He=(Ee=q[le])!=null&&Ee.parentId?q[q[le].parentId]:null;for(;He;)Le.push(He.id),He=He.parentId?q[He.parentId]:null;Le.length&&xe(zt=>{const Dn=new Set(zt);return Le.forEach(ya=>Dn.delete(ya)),Dn})},[q,o]),[at,Ze]=k.useState(null),[Ht,ct]=k.useState(null),Ie=Ht!=null?Ht:[0,P||1],Ke=k.useMemo(()=>uN(Ie[0],Ie[1]),[Ie[0],Ie[1]]),St=k.useMemo(()=>kI(Ie[0],Ie[1]).ticks,[Ie[0],Ie[1]]),Oe=k.useMemo(()=>EI($,he),[$,he]),pt=k.useMemo(()=>{const le=new Map;return Oe.forEach((Ee,Le)=>le.set(Ee.id,Le)),le},[Oe]),$e=Oe.length*_,[ha,Jn]=k.useState(600),Ia=Oe.length>=E,{visibleRange:Ln,containerRef:xt,sentinelRef:za}=Tg({itemCount:Oe.length,itemHeight:_,containerHeight:ha,overscan:16}),de=Ia?Math.max(0,Ln[0]):0,ve=Ia?Math.min(Oe.length,Ln[1]):Oe.length,Re=Oe.slice(de,ve);k.useEffect(()=>{const le=xt.current;if(!le||typeof ResizeObserver>"u")return;const Ee=new ResizeObserver(()=>Jn(le.clientHeight||600));return Ee.observe(le),Jn(le.clientHeight||600),()=>Ee.disconnect()},[xt]);const Ge=k.useMemo(()=>{const le=new Set;let Ee=I?q[I]:null;for(;Ee;)le.add(Ee.id),Ee=Ee.parentId?q[Ee.parentId]:null;return le},[I,q]),Me=k.useRef(new Map),ze=k.useCallback((le,Ee)=>{Ee?Me.current.set(le,Ee):Me.current.delete(le)},[]),Et=k.useRef(null),wt=k.useCallback(le=>{const Ee=pt.get(le),Le=xt.current;if(Ee==null||!Le)return;const He=Ee*_,zt=He+_;He<Le.scrollTop?Le.scrollTop=Math.max(0,He-_):zt>Le.scrollTop+Le.clientHeight&&(Le.scrollTop=zt-Le.clientHeight+_)},[pt,_,xt]),gt=k.useCallback((le,Ee=6)=>{const Le=Me.current.get(le);if(Le){Le.focus();return}Ee>0&&requestAnimationFrame(()=>gt(le,Ee-1))},[]);k.useEffect(()=>{I&&(wt(I),Et.current===I&&(gt(I),Et.current=null))},[I,wt,gt]);const bt=k.useCallback((le,Ee=!0)=>{Ce(le),Ee&&(Et.current=le),ae(le)},[Ce,ae]),mt=k.useCallback(le=>{var Ee;const Le=I!=null?I:(Ee=Oe[0])==null?void 0:Ee.id;if(!Le)return;const He=pt.get(Le);if(He==null)return;const zt=q[Le];switch(le.key){case"ArrowDown":le.preventDefault(),Oe[He+1]&&bt(Oe[He+1].id);break;case"ArrowUp":le.preventDefault(),Oe[He-1]&&bt(Oe[He-1].id);break;case"ArrowRight":le.preventDefault(),zt.hasChildren&&he.has(Le)?we(Le):Oe[He+1]&&Oe[He+1].parentId===Le&&bt(Oe[He+1].id);break;case"ArrowLeft":le.preventDefault(),zt.hasChildren&&!he.has(Le)?we(Le):zt.parentId&&bt(zt.parentId);break;case"Home":le.preventDefault(),Oe[0]&&bt(Oe[0].id);break;case"End":le.preventDefault(),Oe[Oe.length-1]&&bt(Oe[Oe.length-1].id);break;case"Enter":case" ":le.preventDefault(),bt(Le);break;case"Escape":I&&(le.preventDefault(),ae(null));break}},[I,Oe,pt,q,he,we,bt,ae]),Wn=k.useMemo(()=>{const le=new Map;return $.forEach((Ee,Le)=>le.set(Ee.id,Le)),le},[$]),un=k.useMemo(()=>$.filter(le=>le.status==="error").map(le=>le.id),[$]),We=k.useCallback(le=>{var Dn,ya;if(!un.length)return;const Ee=Zt=>{var On;return(On=Wn.get(Zt))!=null?On:-1},Le=I?Ee(I):-1,He=un.map(Ee).sort((Zt,On)=>Zt-On);let zt;le===1?zt=(Dn=He.find(Zt=>Zt>Le))!=null?Dn:He[0]:zt=(ya=[...He].reverse().find(Zt=>Zt<Le))!=null?ya:He[He.length-1],zt!=null&&bt($[zt].id)},[un,$,I,bt]),Pi=k.useCallback(()=>{o===void 0&&xe(new Set($.filter(le=>le.hasChildren).map(le=>le.id)))},[o,$]),oi=k.useCallback(()=>{o===void 0&&xe(new Set)},[o]),sn=k.useRef(null),[dn,Ba]=k.useState(null),Ye=k.useRef(null),ma=k.useCallback(le=>{const Ee=sn.current;if(!Ee)return 0;const Le=Ee.getBoundingClientRect();return Math.min(100,Math.max(0,(le-Le.left)/Le.width*100))},[]),Qt=k.useCallback(le=>{const Ee=100-2*qp,Le=(le-qp)/Ee;return Ie[0]+Le*(Ie[1]-Ie[0])},[Ie]),_n=k.useCallback(le=>{if(!C||P<=0)return;le.currentTarget.setPointerCapture(le.pointerId);const Ee=ma(le.clientX);Ye.current=Ee,Ba({a:Ee,b:Ee})},[C,P,ma]),pa=k.useCallback(le=>{Ye.current!=null&&Ba({a:Ye.current,b:ma(le.clientX)})},[ma]),Kl=k.useCallback(()=>{if(Ye.current==null)return;const le=dn;if(Ye.current=null,Ba(null),!le||Math.abs(le.b-le.a)<1.5)return;const Ee=Qt(Math.min(le.a,le.b)),Le=Qt(Math.max(le.a,le.b)),He=Math.max(0,Math.min(Ee,Le)),zt=Math.min(P,Math.max(Ee,Le));zt-He>P*.005&&ct([He,zt])},[dn,Qt,P]),$s=k.useCallback(()=>{Ye.current=null,Ba(null)},[]),qi=Ht!=null;k.useEffect(()=>{i===void 0&&z&&!q[z]&&se(null)},[q,z,i]);const ga=I?q[I]:null,Vi=p&&!!ga,ci=k.useRef(null),Hs=k.useCallback(()=>{const le=I;ae(null),le&>(le)},[I,ae,gt]),Ka=un.length,kn=["trace-viewer",T].filter(Boolean).join(" ");return $.length?d.jsxs("div",V(L({ref:O,className:kn},D),{children:[m&&d.jsx(BI,{model:G,resolveColor:K,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:oi,title:"Expand all","aria-label":"Expand all",children:d.jsx(je,{name:"chevronDown",size:14})}),d.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:Pi,title:"Collapse all","aria-label":"Collapse all",children:d.jsx(je,{name:"chevronRight",size:14})})]}),d.jsxs("div",{className:"trace-viewer__toolbar-group",children:[d.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:()=>We(-1),disabled:!Ka,title:"Previous error","aria-label":"Previous error",children:d.jsx(je,{name:"arrowUp",size:14})}),d.jsxs("span",{className:"trace-viewer__error-count"+(Ka?" is-active":""),children:[Ka," error",Ka!==1?"s":""]}),d.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:()=>We(1),disabled:!Ka,title:"Next error","aria-label":"Next error",children:d.jsx(je,{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:()=>ct(null),disabled:!qi,title:"Reset zoom","aria-label":"Reset zoom",children:d.jsx(je,{name:"reload",size:14})}),d.jsx("span",{className:"trace-viewer__zoom-hint",children:qi?`${Yn(Ie[0])} – ${Yn(Ie[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 · ",Oe.length,"/",$.length]}),d.jsx("span",{className:"trace-viewer__eyebrow",children:"DURATION"})]}),d.jsxs("div",{className:"trace-viewer__axis"+(C?" is-zoomable":""),ref:sn,onPointerDown:_n,onPointerMove:pa,onPointerUp:Kl,onPointerCancel:$s,onLostPointerCapture:$s,onDoubleClick:()=>ct(null),children:[St.map((le,Ee)=>d.jsx("div",{className:"trace-viewer__tick-label",style:{left:`${Ke.x(le)}%`},children:le===0?"0":Yn(le)},Ee)),dn&&d.jsx("div",{className:"trace-viewer__brush",style:{left:`${Math.min(dn.a,dn.b)}%`,width:`${Math.abs(dn.b-dn.a)}%`}})]})]}),d.jsx("div",{className:"trace-viewer__scroll",ref:xt,children:d.jsxs("div",{className:"trace-viewer__rows",style:{height:$e},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:mt,style:{width:y,height:$e},children:Re.map((le,Ee)=>{const Le=de+Ee;return d.jsx("div",{className:"trace-viewer__row-abs",style:{top:Le*_},children:d.jsx(II,{node:le,rowHeight:_,treeWidth:y,selected:I===le.id,hovered:at===le.id,collapsed:he.has(le.id),color:K(le.service),onSelect:He=>bt(He,!1),onHover:Ze,onToggle:we,registerRef:ze})},le.id)})}),d.jsxs("div",{className:"trace-viewer__wf",style:{height:$e},children:[St.map((le,Ee)=>d.jsx("div",{className:"trace-viewer__gridline",style:{left:`${Ke.x(le)}%`}},Ee)),d.jsx("svg",{className:"trace-viewer__connectors",width:"100%",height:$e,viewBox:`0 0 100 ${$e}`,preserveAspectRatio:"none",children:Oe.map(le=>{if(!le.parentId)return null;const Ee=pt.get(le.id),Le=pt.get(le.parentId);if(Ee==null||Le==null)return null;const He=Math.min(Ee,Le);if(Math.max(Ee,Le)<de-24||He>ve+24)return null;const zt=q[le.parentId],Dn=Ke.x(zt.start),ya=Ke.x(le.start),Zt=Le*_+_/2+5,On=Ee*_+_/2,Ua=Ge.has(le.id)&&Ge.has(le.parentId);return d.jsx("path",{d:`M ${Dn} ${Zt} L ${Dn} ${On} L ${ya} ${On}`,className:"trace-viewer__connector"+(Ua?" is-active":""),vectorEffect:"non-scaling-stroke"},le.id)})}),Re.map((le,Ee)=>{const Le=de+Ee;return d.jsx("div",{className:"trace-viewer__row-abs",style:{top:Le*_},children:d.jsx(zI,{node:le,rowHeight:_,scaleX:Ke.x,scaleW:Ke.w,selected:I===le.id,hovered:at===le.id,color:K(le.service),onSelect:He=>bt(He,!1),onHover:Ze})},le.id)})]})]})})]}),p&&d.jsx("div",{className:"trace-viewer__panel"+(Vi?" is-open":""),style:{width:Vi?x:0},children:ga&&d.jsx(fN,{span:ga,model:G,traceId:(M=H.meta)==null?void 0:M.traceId,resolveColor:K,serviceLabel:W(ga.service),serviceHost:(B=Q[ga.service])==null?void 0:B.host,onClose:Hs,onSelect:le=>bt(le,!1),renderAttributes:R,closeButtonRef:ci})})]})]})):d.jsx("div",V(L({ref:O,className:kn},D),{children:d.jsx("div",{className:"trace-viewer__empty",children:"No spans in this trace."})}))});UI.displayName="TraceViewer";function hN(e,t){let n;try{n=e()}catch(r){return}return{getItem:r=>{var l;const o=f=>f===null?null:JSON.parse(f,void 0),u=(l=n.getItem(r))!=null?l:null;return u instanceof Promise?u.then(o):o(u)},setItem:(r,l)=>n.setItem(r,JSON.stringify(l,void 0)),removeItem:r=>n.removeItem(r)}}const Vp=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(i){return Vp(i)(n)},catch(i){return this}}}catch(n){return{then(i){return this},catch(i){return Vp(i)(n)}}}},FI=(e,t)=>(n,i,r)=>{let l=L({storage:hN(()=>window.localStorage),partialize:w=>w,version:0,merge:(w,N)=>L(L({},N),w)},t),o=!1,u=0;const f=new Set,m=new Set;let g=l.storage;if(!g)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...w)},i,r);const p=()=>{const w=l.partialize(L({},i()));return g.setItem(l.name,{state:w,version:l.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 R=++u;o=!1,f.forEach(E=>{var T;return E((T=i())!=null?T:x)});const C=((N=l.onRehydrateStorage)==null?void 0:N.call(l,(w=i())!=null?w:x))||void 0;return Vp(g.getItem.bind(g))(l.name).then(E=>{if(E)if(typeof E.version=="number"&&E.version!==l.version){if(l.migrate){const T=l.migrate(E.state,E.version);return T instanceof Promise?T.then(D=>[!0,D]):[!0,T]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,E.state];return[!1,void 0]}).then(E=>{var T;if(R!==u)return;const[D,O]=E;if(_=l.merge(O,(T=i())!=null?T:x),n(_,!0),D)return p()}).then(()=>{R===u&&(C==null||C(_,void 0),_=i(),o=!0,m.forEach(E=>E(_)))}).catch(E=>{R===u&&(C==null||C(void 0,E))})};return r.persist={setOptions:w=>{l=L(L({},l),w),w.storage&&(g=w.storage)},clearStorage:()=>{g==null||g.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>S(),hasHydrated:()=>o,onHydrate:w=>(f.add(w),()=>{f.delete(w)}),onFinishHydration:w=>(m.add(w),()=>{m.delete(w)})},l.skipHydration||S(),_||x},$I=FI,s_=typeof window!="undefined"?window.innerWidth>=1300:!1;function Gp(e){typeof document!="undefined"&&document.body.classList.toggle("dark-canvas",e)}const yl=(e,t)=>`${e}:${t}`,HI="dr-viewer-ui-preferences",PI={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)}},Se=Od()($I(e=>({view:"model",layerId:null,selectedId:null,selectedEdgeId:null,highlightedEdgeId:null,changesetId:null,canvasDark:!0,chatOpen:s_,wide:s_,mode:"graph",focus:"layer",expandedSections:new Set(["model"]),expandedLayers:new Set,graphLayout:"force",showClusterBoundaries:!0,showAllRelations:!0,nodeMarginPreset:"default",nodeDisplay:"card",setView:t=>e({view:t}),selectLayer:t=>e(n=>{const i=new Set(n.expandedLayers);return i.add(yl(n.view,t)),{layerId:t,selectedId:null,selectedEdgeId:null,highlightedEdgeId:null,focus:"layer",expandedSections:new Set(n.expandedSections).add(n.view),expandedLayers:i}}),selectNode:t=>e({selectedId:t,selectedEdgeId:null,highlightedEdgeId:null,focus:"node"}),selectGraphNode:t=>e(n=>({selectedId:t,selectedEdgeId:null,highlightedEdgeId:null,focus:"node",expandedSections:new Set(n.expandedSections).add(n.view),expandedLayers:n.layerId?new Set(n.expandedLayers).add(yl(n.view,n.layerId)):n.expandedLayers})),selectEdge:t=>e({selectedEdgeId:t,selectedId:null,highlightedEdgeId:null,focus:"layer"}),setHighlightedEdgeId:t=>e({highlightedEdgeId:t}),clearEdgeSelection:()=>e({selectedEdgeId:null,highlightedEdgeId:null}),navigateToElement:(t,n)=>e(i=>{const l=i.layerId===n?i.expandedLayers:new Set(i.expandedLayers).add(yl("model",n));return{view:"model",layerId:n,selectedId:t,selectedEdgeId:null,highlightedEdgeId:null,focus:"node",expandedSections:new Set(i.expandedSections).add("model"),expandedLayers:l}}),navigateToElementWithEdge:(t,n,i)=>e(r=>{const o=r.layerId===n?r.expandedLayers:new Set(r.expandedLayers).add(yl("model",n));return{view:"model",mode:"graph",layerId:n,selectedId:t,selectedEdgeId:null,highlightedEdgeId:i,focus:"node",expandedSections:new Set(r.expandedSections).add("model"),expandedLayers:o}}),navigateToSpecNode:(t,n)=>e(i=>{const l=i.layerId===n?i.expandedLayers:new Set(i.expandedLayers).add(yl("spec",n));return{view:"spec",layerId:n,selectedId:t,selectedEdgeId:null,highlightedEdgeId:null,focus:"node",expandedSections:new Set(i.expandedSections).add("spec"),expandedLayers:l}}),selectChangeset:t=>e(n=>({view:"changesets",changesetId:t,highlightedEdgeId:null,expandedSections:new Set(n.expandedSections).add("changesets")})),setMode:t=>e({mode:t}),toggleCanvasDark:()=>e(t=>{const n=!t.canvasDark;return Gp(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 L({view:t,expandedSections:i},r?{selectedId:null,selectedEdgeId:null,highlightedEdgeId:null,focus:"layer"}:{})}),toggleLayer:(t,n)=>e(i=>{const r=yl(t,n),l=new Set(i.expandedLayers),o=l.has(r);return o?l.delete(r):l.add(r),{view:t,layerId:n,selectedId:o?i.selectedId:null,selectedEdgeId:o?i.selectedEdgeId:null,highlightedEdgeId:o?i.highlightedEdgeId:null,focus:o?i.focus:"layer",expandedSections:new Set(i.expandedSections).add(t),expandedLayers:l}}),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}),setNodeDisplay:t=>e({nodeDisplay:t})}),{name:HI,version:1,storage:hN(()=>PI),partialize:e=>({canvasDark:e.canvasDark,chatOpen:e.chatOpen,graphLayout:e.graphLayout,showClusterBoundaries:e.showClusterBoundaries,showAllRelations:e.showAllRelations,nodeMarginPreset:e.nodeMarginPreset,nodeDisplay:e.nodeDisplay}),onRehydrateStorage:()=>e=>{e&&Gp(e.canvasDark)}}));typeof document!="undefined"&&Gp(Se.getState().canvasDark);const qI=new Set(["force","galaxy","force-clustered"]),VI=new Set(["tight","default","wide"]),GI=new Set(["card","pill"]);{const e=Se.getState(),t={};qI.has(e.graphLayout)||(t.graphLayout="force"),VI.has(e.nodeMarginPreset)||(t.nodeMarginPreset="default"),GI.has(e.nodeDisplay)||(t.nodeDisplay="card"),Object.keys(t).length>0&&Se.setState(t)}typeof window!="undefined"&&window.addEventListener("resize",()=>{const e=window.innerWidth>=1300;e!==Se.getState().wide&&Se.getState().setWide(e)});const tc=Od(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})})),KI={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"}},YI=[{value:"light",label:"light"},{value:"dark",label:"dark"}];function XI(){const e=Se(o=>o.canvasDark),t=Se(o=>o.toggleCanvasDark),n=Se(o=>o.chatOpen),i=Se(o=>o.toggleChat),r=tc(o=>o.state),l=KI[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(Ii,{value:e?"dark":"light",onChange:o=>{o==="dark"!==e&&t()},options:YI,"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:l.color}})}),d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--shell-fg-2))"},children:l.label})]})]})}const mN=["motivation","business","security","application","technology","api","data-model","data-store","ux","navigation","apm","testing"],pN={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"},QI={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"},ZI={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"},JI="#6B7280";function Wd(e){return e in pN}function La(e){return e&&Wd(e)?pN[e]:JI}function Da(e){return e&&Wd(e)?QI[e]:e?e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):""}function ef(e){return e&&Wd(e)?ZI[e]:""}const WI={nodes:[],links:[],countsByLayer:{},nodesByLayer:{},relCount:0};function $i(){const e=kT(),t=e.data,n=k.useMemo(()=>{var l,o,u,f,m;if(!(t!=null&&t.nodes))return WI;const i={},r={};for(const g of t.nodes){const p=g.layer_id;p&&(i[p]=((l=i[p])!=null?l: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=(f=t.links)==null?void 0:f.length)!=null?m:0}},[t]);return V(L({},e),{derived:n})}const ez={version:"",byLayer:{}};function Hi(){const e=TT(),t=e.data,n=k.useMemo(()=>{var r,l,o,u;if(!(t!=null&&t.schemas))return ez;const i={};for(const f of Object.values(t.schemas)){const m=f,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=(l=g.inspired_by)==null?void 0:l.standard)!=null?o:ef(g.id)}}return{version:(u=t.version)!=null?u:"",byLayer:i}},[t]);return V(L({},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 gN(e){const t=(e!=null?e:"").toLowerCase();return t.includes("delete")||t==="del"||t==="remove"?"delete":t.includes("add")||t==="create"?"add":"update"}function tp(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 Dd(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(Dd).join(",")}]`;const t=e;return`{${Object.keys(t).sort().map(n=>`${JSON.stringify(n)}:${Dd(t[n])}`).join(",")}}`}function nz(e,t){if(!e||!t)return[];const n=new Set([...Object.keys(e),...Object.keys(t)]),i=[];for(const r of n)Dd(e[r])!==Dd(t[r])&&i.push(r);return i}function az(e){var l,o,u;const t=gN(e.type);if(t==="add")return((l=e.type)!=null?l:"").includes("relationship")?"Added relationship":`Added ${tp(e.after)}`;if(t==="delete")return((o=e.type)!=null?o:"").includes("relationship")?"Removed relationship":`Removed ${tp(e.before)}`;const n=nz(e.before,e.after);if(n.length===0)return`Updated ${tp((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 iz(e,t){var r,l,o;const n=gN(e.type),i=(r=e.elementId)!=null?r:"(unknown)";return{key:`${i}::${(l=e.sequenceNumber)!=null?l: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 sz(e){return e?e.map(iz):[]}function rz(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
|
+
`):[],l=new Set(i),o=new Set(r),u=[];for(const f of i)o.has(f)||u.push({type:"removed",content:f});for(const f of r)l.has(f)||u.push({type:"added",content:f});return u}function lz(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 oz={list:[]};function Ac(){const e=RT(),t=e.data,n=k.useMemo(()=>{const i=t==null?void 0:t.changesets;if(!i)return oz;const r=Object.entries(i).map(([l,o])=>{var u,f,m,g;return{id:l,name:(u=o.name)!=null?u:l,status:(f=o.status)!=null?f:"unknown",created:(m=o.created)!=null?m:"",changesCount:(g=o.changes_count)!=null?g:0}});return r.sort((l,o)=>o.created.localeCompare(l.created)),{list:r}},[t]);return V(L({},e),{derived:n})}const cz={additions:0,modifications:0,deletions:0};function yN(e){const t=MT(e!=null?e:"",{enabled:!!e}),n=t.data,i=k.useMemo(()=>{var r,l,o,u,f,m,g,p,y,x,_,S,w,N,R,C;return n?{id:(l=(r=n.id)!=null?r:e)!=null?l:"",name:(u=(o=n.name)!=null?o:n.id)!=null?u:"",status:(f=n.status)!=null?f:"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:sz(n.changes),changesCount:(C=(R=n.changes)==null?void 0:R.length)!=null?C:0}:null},[n,e]);return V(L({},t),{detail:i,emptyStats:cz})}const uz=[{id:"model",label:"Model",icon:"graph"},{id:"spec",label:"Schema",icon:"schema"},{id:"changesets",label:"Changesets",icon:"clock"}];function vN({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 dz({section:e}){const t=Se(u=>u.view),n=Se(u=>u.expandedSections),i=Se(u=>u.toggleSection),{derived:r}=Ac(),l=n.has(e.id),o=e.id==="changesets"?r.list.length:12;return d.jsxs("div",{style:{position:"relative"},children:[d.jsx(yc,{icon:e.icon,label:e.label,count:o,active:t===e.id,depth:0,onClick:()=>i(e.id)}),d.jsx(vN,{open:l})]})}function fz({sectionId:e,slug:t}){var R,C,E;const n=Se(T=>T.view),i=Se(T=>T.layerId),r=Se(T=>T.selectedId),l=Se(T=>T.expandedLayers),o=Se(T=>T.toggleLayer),u=Se(T=>T.navigateToElement),f=Se(T=>T.navigateToSpecNode),{derived:m}=$i(),{derived:g}=Hi(),p=`${e}:${t}`,y=l.has(p),x=n===e&&i===t,_=g.byLayer[t],S=(R=m.nodesByLayer[t])!=null?R:[],w=e==="spec"?(C=_==null?void 0:_.typeCount)!=null?C:0:S.length,N=e==="spec"?((E=_==null?void 0:_.typeIds)!=null?E:[]).map((T,D)=>{var O;return{id:`${t}.${T}`,label:(O=_==null?void 0:_.typeTitles[D])!=null?O:T}}):S.map(T=>({id:T.id,label:T.name}));return d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:{position:"relative"},children:[d.jsx(yc,{label:Da(t),count:w,active:x,depth:1,onClick:()=>o(e,t)}),d.jsx(vN,{open:y})]}),y&&N.map(T=>{const D=n===e&&i===t&&r===T.id;return d.jsx("div",{style:{position:"relative"},children:d.jsx(yc,{label:T.label,active:D,depth:1,className:"drv-nav-l2",onClick:()=>e==="model"?u(T.id,t):f(T.id,t),title:T.label})},T.id)})]})}function hz(){const e=Se(r=>r.view),t=Se(r=>r.changesetId),n=Se(r=>r.selectChangeset),{derived:i}=Ac();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 l=e==="changesets"&&t===r.id;return d.jsx("div",{style:{position:"relative"},children:d.jsx(yc,{label:r.name,count:r.changesCount,active:l,depth:1,onClick:()=>n(r.id),title:r.name})},r.id)})})}function mz(){const e=Se(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(dz,{section:t}),n&&t.id==="changesets"&&d.jsx(hz,{}),n&&t.id!=="changesets"&&mN.map(i=>d.jsx(fz,{sectionId:t.id,slug:i},i))]},t.id)})})}function pz(){const{derived:e}=$i(),{derived:t}=Hi(),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(mz,{}),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))"},r_=V(L({},Kp),{color:"rgb(var(--shell-fg-4))"});function gz(){var u;const e=Se(f=>f.layerId),{derived:t}=$i(),{derived:n}=Hi(),i=e&&(u=t.countsByLayer[e])!=null?u:0,r=e?Da(e).toLowerCase():"",l=e?`${i} ${r} elements`:`${t.nodes.length} elements`,o=n.version||"—";return d.jsx(Ng,{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:l}),d.jsx("span",{style:r_,children:"·"}),d.jsxs("span",{style:Kp,children:[t.relCount," refs indexed · 0 unresolved"]})]}),right:d.jsxs("span",{style:r_,children:["cli ",o," · refs ok"]})})}function Zn(e,t){var i;return(i=e==null?void 0:e.schemas)==null?void 0:i[`${t}.json`]}function si(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 Bs(e,t,n){var l,o,u;const i=si(t,n),r=Zn(e,t);return(u=(o=(l=r==null?void 0:r.nodeSchemas)==null?void 0:l[i])==null?void 0:o.title)!=null?u:i}function yz(e,t){var l;const n=Zn(e,t),i=(l=n==null?void 0:n.nodeSchemas)!=null?l:{};return Object.entries(i).map(([o,u])=>{var f;return{id:`${t}.${o}`,label:(f=u.title)!=null?f:o,kind:"spec node",domainColor:t}})}const vz={"many-to-many":"N:N","one-to-many":"1:N","many-to-one":"N:1","one-to-one":"1:1"};function Yp(e){var t;return e&&(t=vz[e])!=null?t:""}function xz(e,t){var l;const n=Zn(e,t),i=(l=n==null?void 0:n.relationshipSchemas)!=null?l:{},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 xN(e,t){var l;const n=Zn(e,t),i=(l=n==null?void 0:n.relationshipSchemas)!=null?l:{};let r=0;for(const o of Object.values(i))o.source_layer===t&&o.destination_layer===t&&(r+=1);return r}function bN(e){var n,i,r;const t=[];for(const l of Object.values((n=e==null?void 0:e.schemas)!=null?n:{})){const o=l;(i=o==null?void 0:o.layer)!=null&&i.id&&t.push(...Object.values((r=o.relationshipSchemas)!=null?r:{}))}return t}function bz(e,t,n){var u;const i=Zn(e,t),r=(u=i==null?void 0:i.relationshipSchemas)!=null?u:{},l=[];let o=0;for(const f of Object.values(r)){const m=Yp(f.cardinality),g=m?`${f.predicate} ${m}`:f.predicate;f.source_spec_node_id===n?l.push({id:`out-${o++}-${f.id}`,target:f.destination_spec_node_id,targetTitle:Bs(e,f.destination_layer,f.destination_spec_node_id),targetDomain:f.destination_layer,predicate:g,direction:"out"}):f.destination_spec_node_id===n&&l.push({id:`in-${o++}-${f.id}`,target:f.source_spec_node_id,targetTitle:Bs(e,f.source_layer,f.source_spec_node_id),targetDomain:f.source_layer,predicate:g,direction:"in"})}return l}function ly(e){var r,l,o;const t=(r=e==null?void 0:e.properties)==null?void 0:r.attributes,n=new Set((l=t==null?void 0:t.required)!=null?l:[]),i=(o=t==null?void 0:t.properties)!=null?o:{};return Object.entries(i).map(([u,f])=>{var m;return{name:u,type:(m=f==null?void 0:f.type)!=null?m:"object",required:n.has(u)}})}function _z(e,t,n){var u,f;const i=Zn(e,t),r=si(t,n),l=(u=i==null?void 0:i.nodeSchemas)==null?void 0:u[r];if(!l)return null;const o={};for(const m of ly(l))o[m.name]=m.required?"required":"—";return{id:n,title:(f=l.title)!=null?f:r,kind:"SPEC NODE",domain:t,description:l.description,metadata:o}}function Sz(e,t,n){var u;const i=Zn(e,t),r=(u=i==null?void 0:i.relationshipSchemas)!=null?u:{},l=[],o=[];for(const f of Object.values(r))f.source_spec_node_id===n&&o.push({predicate:f.predicate,typeId:f.destination_spec_node_id,typeLabel:Bs(e,f.destination_layer,f.destination_spec_node_id),domain:f.destination_layer}),f.destination_spec_node_id===n&&l.push({predicate:f.predicate,typeId:f.source_spec_node_id,typeLabel:Bs(e,f.source_layer,f.source_spec_node_id),domain:f.source_layer});return{inbound:l,outbound:o}}function wz(e,t,n){var f,m;const i=Zn(e,t),r=si(t,n),l=(f=i==null?void 0:i.nodeSchemas)==null?void 0:f[r];if(!l)return null;const{inbound:o,outbound:u}=Sz(e,t,n);return{specifier:n,title:(m=l.title)!=null?m:r,description:l.description,inbound:o,outbound:u}}function Nz(e,t){var r;const n=Zn(e,t),i=Object.keys((r=n==null?void 0:n.nodeSchemas)!=null?r:{})[0];return i?`${t}.${i}`:void 0}function Cz(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\./g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function tf(e){return`${e.layer_id}.${e.type}.${Cz(e.name)}`}function nf(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(tf(i),i);return{byEndpoint:t,byUuid:n}}function Cn(e,t){return e.byEndpoint.get(t)}function Ez(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 jz(e,t,n){const i=[];for(const r of e.links){const l=Cn(n,r.source),o=Cn(n,r.target);!l||!o||l.layer_id!==t||o.layer_id!==t||i.push({id:r.id,sourceId:l.id,targetId:o.id,label:r.type})}return i}const kz=5;function Tz(e,t,n){const i=Ez(e,t),r=new Set(i.map(u=>u.id)),l=new Map;for(const u of r)l.set(u,{intraCount:0,crossLinks:[],crossTotal:0});const o=(u,f,m)=>{const g=l.get(u);g&&(g.crossTotal+=1,g.crossLinks.length<kz&&g.crossLinks.push({predicate:f,targetId:m.id,targetName:m.name,targetLayer:m.layer_id}))};for(const u of e.links){const f=Cn(n,u.source),m=Cn(n,u.target);if(!f||!m)continue;const g=r.has(f.id),p=r.has(m.id);if(!(!g&&!p)){if(g&&p){const y=l.get(f.id),x=l.get(m.id);if(!y||!x)continue;y.intraCount+=1,x.intraCount+=1;continue}g?o(f.id,u.type,m):o(m.id,u.type,f)}}return{nodes:i,cardData:l}}function l_(e){return{id:e.id,name:e.name,type:e.type,layer:e.layer_id}}function Rz(e,t,n,i){var u;const r=`${t.layer_id}.${t.type}`,l=`${n.layer_id}.${n.type}`,o=f=>{var g,p;const m=(p=(g=Zn(e,f))==null?void 0:g.relationshipSchemas)!=null?p:{};return Object.values(m).find(y=>y.source_spec_node_id===r&&y.destination_spec_node_id===l&&y.predicate===i)};return(u=o(t.layer_id))!=null?u:o(n.layer_id)}function _N(e,t,n,i){const r=e.links.find(u=>u.id===t);if(!r)return;const l=Cn(n,r.source),o=Cn(n,r.target);if(!(!l||!o))return{predicate:r.type,sourceNode:l_(l),targetNode:l_(o),specRelationship:Rz(i,l,o,r.type)}}function Xp(e,t,n){const i=n.byUuid.get(t);if(!i)return[];const r=[];let l=0;for(const o of e.links){const u=Cn(n,o.source),f=Cn(n,o.target);!u||!f||(u.id===t?r.push({id:`out-${l++}-${o.id}`,target:f.id,targetTitle:f.name,targetDomain:f.layer_id,predicate:o.type,direction:"out",sourceTypeLabel:i.type,destinationTypeLabel:f.type}):f.id===t&&r.push({id:`in-${l++}-${o.id}`,target:u.id,targetTitle:u.name,targetDomain:u.layer_id,predicate:o.type,direction:"in",sourceTypeLabel:u.type,destinationTypeLabel:i.type}))}return r}function SN(e){var t;return(t=e==null?void 0:e.provenance)!=null?t:"authored"}function wN(e){var t,n;return(n=(t=e==null?void 0:e.locations)==null?void 0:t.find(i=>i.symbol||i.file))!=null?n:{}}function Mz(e){var n;const t=wN(e);return(n=t.symbol)!=null?n:t.file}function Qp(e,t){const n=e.source_reference,i={layer:t,type:e.type,provenance:SN(n)},r=Mz(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 Az(e,t,n){const i=n.byUuid.get(e);if(!i)return{nodes:[],edges:[],empty:!0};const r=new Map,l=new Map;for(const f of t.links){const m=Cn(n,f.source),g=Cn(n,f.target);if(!m||!g)continue;let p=!1,y;m.id===e?(p=!0,y=g):g.id===e&&(p=!1,y=m),y&&y.id!==e&&(r.set(y.id,y),l.has(y.id)||l.set(y.id,[]),l.get(y.id).push({id:f.id,predicate:f.type,direction:p?"out":"in",targetId:y.id}))}const o=[{id:i.id,name:i.name,kind:i.type,layer:i.layer_id,isCenter:!0}];for(const f of r.values())o.push({id:f.id,name:f.name,kind:f.type,layer:f.layer_id,isCenter:!1});const u=[];for(const f of l.values())for(const m of f)u.push(m);return{nodes:o,edges:u,empty:r.size===0}}function Lz(e,t,n){var p,y;const i=Zn(n,e),r=si(e,t),l=(p=i==null?void 0:i.nodeSchemas)==null?void 0:p[r];if(!l)return{nodes:[],edges:[],empty:!0};const o=new Map,u=new Map,f=bN(n);for(const x of f)if(x.source_spec_node_id===t){const _=x.destination_spec_node_id;if(_===t)continue;const S=x.destination_layer,w=Bs(n,S,_);o.has(_)||o.set(_,{layerId:S,title:w}),u.has(_)||u.set(_,[]),u.get(_).push({id:x.id,predicate:x.predicate,direction:"out",targetId:_})}for(const x of f)if(x.destination_spec_node_id===t){const _=x.source_spec_node_id;if(_===t)continue;const S=x.source_layer,w=Bs(n,S,_);o.has(_)||o.set(_,{layerId:S,title:w}),u.has(_)||u.set(_,[]),u.get(_).push({id:x.id,predicate:x.predicate,direction:"in",targetId:_})}const m=[{id:t,name:(y=l.title)!=null?y:r,kind:"spec node",layer:e,isCenter:!0}];for(const[x,_]of o)m.push({id:x,name:_.title,kind:"spec node",layer:_.layerId,isCenter:!1});const g=[];for(const x of u.values())for(const _ of x)g.push(_);return{nodes:m,edges:g,empty:o.size===0}}const oy=La("application"),NN=La("navigation"),CN="rgb(var(--status-emerald))",EN="rgb(var(--accent-primary))",jN="rgb(var(--accent-primary-deep))",Zp="—";function Is(e){return e==null||e===""?Zp:String(e)}function Nt(e,t,n){return{text:Is(e),kind:t,color:n}}function Cr(e,t,n,i,r){return V(L({},Nt(e,t,r)),{tooltip:{kind:"nodeType",layerId:n,typeId:i}})}function Sc(e,t,n,i,r,l,o){return V(L({},Nt(e,t,l)),{tooltip:{kind:"predicate",predicate:n,sourceTypeLabel:i,destinationTypeLabel:r,edge:o}})}function Rt(e,t,n){return{key:e,value:Is(t),prose:n}}function cy(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 Dz="minmax(0,1.1fr) minmax(0,1.5fr) 78px",Oz="minmax(0,1.3fr) minmax(0,1fr) minmax(0,0.9fr) 96px",Iz="minmax(0,1fr) minmax(0,0.9fr) minmax(0,1.2fr)";function zz(e,t,n,i,r){var R,C,E,T,D,O;if(!Wd(t))return null;const l=Zn(r,t),o=l==null?void 0:l.layer,u=o==null?void 0:o.number,f=(C=(R=o==null?void 0:o.inspired_by)==null?void 0:R.standard)!=null?C:ef(t),m=(E=l==null?void 0:l.nodeSchemas)!=null?E:{},g=Object.keys(m).length,p=xN(r,t),y=(T=n.nodesByLayer[t])!=null?T:[],x=La(t),_=Da(t),S=Object.entries(m).map(([F,A])=>{var B;const M=y.filter(H=>H.type===F).length;return{target:{kind:"specNode",specNodeId:`${t}.${F}`,layerId:t},cells:[Cr((B=A.title)!=null?B:F,"name",t,F),Nt(`${t}.${F}`,"dim"),Nt(M,"num")]}}),w=y.map(F=>{let A=0,M=0;for(const B of n.links){const H=Cn(i,B.source);if(!H||H.id!==F.id)continue;const G=Cn(i,B.target);G&&(G.layer_id===t?A+=1:M+=1)}return{target:{kind:"element",elementId:F.id,layerId:t},cells:[Nt(F.name,"name"),Cr(F.type,"mono",t,F.type),Nt(uy(F),"dim"),Nt(`${A} · ${M}`,"num")]}}),N=[];for(const F of y)for(const A of n.links){const M=Cn(i,A.source);if(!M||M.id!==F.id)continue;const B=Cn(i,A.target);!B||B.layer_id===t||N.push({target:{kind:"element",elementId:B.id,layerId:B.layer_id},cells:[Nt(F.name,"name"),Sc(A.type,"dim",A.type,F.type,B.type),Cr(`${B.layer_id}.${B.type}`,"mono",B.layer_id,B.type,La(B.layer_id))]})}return{eyebrow:`LAYER ${Is(u)} · ${f}`,title:_,idChip:t,meta:`${g} node types · ${p} relationship schemas`,color:x,crumbs:cy(e,t,!0),description:`${_} is layer ${Is(u)} of 12 in the federated model, inspired by ${f}. 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:oy},{label:"ELEMENTS",value:y.length,color:CN},{label:"LAYER",value:`${Is(u)} / 12`,color:EN}],factsTitle:"LAYER SPEC",facts:[Rt("layer_id",t),Rt("number",u),Rt("name",_,!0),Rt("description",o==null?void 0:o.description,!0),Rt("inspired_by.standard",f),Rt("inspired_by.version",(D=o==null?void 0:o.inspired_by)==null?void 0:D.version),Rt("inspired_by.url",(O=o==null?void 0:o.inspired_by)==null?void 0:O.url),Rt("spec source",`spec/dist/${t}.json`)],tables:[{title:"Spec node types",columns:["node type","spec_node_id","instances"],widths:Dz,rows:S,emptyText:"No node types are published for this layer."},{title:"Elements in model",columns:["name","type","provenance","rels · xrefs"],widths:Oz,rows:w,emptyText:"No elements of this layer in the loaded model."},{title:"Cross-layer references",columns:["from","predicate","to"],widths:Iz,rows:N,emptyText:"This layer emits no cross-layer references."}]}}const kN="minmax(0,1fr) minmax(0,0.8fr) 96px",Bz="minmax(0,1fr) minmax(0,1.2fr) minmax(0,0.8fr) minmax(0,1fr) minmax(0,0.7fr) 62px",Uz="minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr) minmax(0,0.8fr)",Fz="minmax(0,1fr) minmax(0,1.5fr) 96px";function $z(e,t,n,i){var R,C,E,T,D,O,F,A,M,B,H,G;const r=Zn(n,e),l=si(e,t),o=(R=r==null?void 0:r.nodeSchemas)==null?void 0:R[l];if(!o)return null;const u=La(e),f=(T=(E=(C=r==null?void 0:r.layer)==null?void 0:C.inspired_by)==null?void 0:E.standard)!=null?T:ef(e),m=ly(o),g=((D=i.nodesByLayer[e])!=null?D:[]).filter($=>$.type===l),p=bN(n),y=p.filter($=>$.source_spec_node_id===t),x=p.filter($=>$.destination_spec_node_id===t),_=m.map($=>({cells:[Nt($.name,"mono"),Nt($.type,"dim"),Nt($.required?"required":"optional","dim",$.required?jN:void 0)]})),S=y.map($=>({target:{kind:"specNode",specNodeId:$.destination_spec_node_id,layerId:$.destination_layer},cells:[Sc($.predicate,"mono",$.predicate,l,si($.destination_layer,$.destination_spec_node_id)),Cr(Bs(n,$.destination_layer,$.destination_spec_node_id),"name",$.destination_layer,si($.destination_layer,$.destination_spec_node_id)),Nt($.destination_layer,"dim",La($.destination_layer)),Nt($.cardinality?Yp($.cardinality)||$.cardinality:Zp,"dim"),Nt($.strength,"dim"),Nt($.required?"yes":"no","num")]})),w=x.map($=>({target:{kind:"specNode",specNodeId:$.source_spec_node_id,layerId:$.source_layer},cells:[Cr(Bs(n,$.source_layer,$.source_spec_node_id),"name",$.source_layer,si($.source_layer,$.source_spec_node_id)),Sc($.predicate,"mono",$.predicate,si($.source_layer,$.source_spec_node_id),l),Nt($.cardinality?Yp($.cardinality)||$.cardinality:Zp,"dim"),Nt($.strength,"dim")]})),N=g.map($=>({target:{kind:"element",elementId:$.id,layerId:e},cells:[Nt($.name,"name"),Nt(tf($),"dim"),Nt(uy($),"dim")]}));return{eyebrow:`SPEC NODE · ${f}`,title:(O=o.title)!=null?O:l,idChip:t,meta:`${m.length} attributes · ${g.length} instances`,color:u,crumbs:[...cy("spec",e,!1),{label:l,current:!0}],description:(F=o.description)!=null?F:"",stats:[{label:"ATTRIBUTES",value:m.length,color:u},{label:"OUTGOING TYPES",value:y.length,color:oy},{label:"INCOMING TYPES",value:x.length,color:NN},{label:"INSTANCES",value:g.length,color:CN}],factsTitle:"SPEC NODE",facts:[Rt("spec_node_id",t),Rt("layer_id",e),Rt("type",l),Rt("title",o.title,!0),Rt("extends",(M=(A=o.allOf)==null?void 0:A[0])==null?void 0:M.$ref),Rt("schema",o.$id),Rt("inspired_by",(H=(B=r==null?void 0:r.layer)==null?void 0:B.inspired_by)!=null&&H.version?`${f} ${r.layer.inspired_by.version}`:f),Rt("required",(G=o.required)==null?void 0:G.join(", "))],tables:[{title:"Attributes",columns:["attribute","type","constraint"],widths:kN,rows:_,emptyText:"No attribute schema is published for this node type."},{title:"Valid outgoing relationships",columns:["predicate","destination","layer","cardinality","strength","required"],widths:Bz,rows:S,emptyText:"This node type declares no outgoing relationships."},{title:"Valid incoming relationships",columns:["source","predicate","cardinality","strength"],widths:Uz,rows:w,emptyText:"No other node type declares a relationship into this one."},{title:"Instances in model",columns:["name","path","provenance"],widths:Fz,rows:N,emptyText:"No instances of this node type in the loaded model."}],neighborhoodGraph:Lz(e,t,n)}}const Hz="minmax(0,1fr) minmax(0,1.5fr) 88px",Pz="minmax(0,1fr) minmax(0,1.3fr) minmax(0,0.8fr) minmax(0,1.4fr)",qz="minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr) minmax(0,0.8fr)";function uy(e){return SN(e.source_reference)}function Vz(e,t,n,i,r){var E,T,D,O,F;const l=i.byUuid.get(t);if(!l||l.layer_id!==e)return null;const o=La(e),u=Da(e),f=Zn(r,e),m=(E=f==null?void 0:f.nodeSchemas)==null?void 0:E[l.type],g=ly(m),p=[],y=[];for(const A of n.links){const M=Cn(i,A.source),B=Cn(i,A.target);if(!(!M||!B)){if(M.id===l.id){const H=`${Is(M.spec_node_id)}.${A.type}.${Is(B.spec_node_id)}`,G=B.layer_id===e?{edgeId:A.id,sourceElementId:l.id,sourceLayerId:e}:void 0;p.push({target:{kind:"element",elementId:B.id,layerId:B.layer_id},cells:[Sc(A.type,"mono",A.type,l.type,B.type,void 0,G),Nt(B.name,"name"),Nt(B.layer_id,"dim",La(B.layer_id)),Nt(H,"dim")]})}else if(B.id===l.id){const H=M.layer_id===e?{edgeId:A.id,sourceElementId:M.id,sourceLayerId:M.layer_id}:void 0;y.push({target:{kind:"element",elementId:M.id,layerId:M.layer_id},cells:[Nt(M.name,"name"),Sc(A.type,"mono",A.type,M.type,l.type,void 0,H),Cr(M.type,"dim",M.layer_id,M.type),Nt(M.layer_id,"dim",La(M.layer_id))]})}}}const x=p.filter(A=>{var M;return((M=A.target)==null?void 0:M.kind)==="element"&&A.target.layerId===e}).length,_=p.length-x,S=[{target:{kind:"specNode",specNodeId:`${e}.${l.type}`,layerId:e},cells:[Cr((T=m==null?void 0:m.title)!=null?T:l.type,"name",e,l.type),Nt(`${e}.${l.type}`,"dim"),Nt(`${g.length} attrs`,"num")]}],w=g.map(A=>({cells:[Nt(A.name,"mono"),Nt(A.type,"dim"),Nt(A.required?"required":"optional","dim",A.required?jN:void 0)]})),N=tf(l),R=wN(l.source_reference),C=(D=l.metadata)!=null?D:{};return{eyebrow:`ELEMENT · ${u}`,title:l.name,idChip:l.id,meta:`${p.length} outgoing · ${y.length} incoming`,color:o,crumbs:[...cy("model",e,!1),{label:l.id,current:!0}],description:(O=l.description)!=null?O:"",stats:[{label:"INTRA-LAYER",value:x,color:o},{label:"CROSS-LAYER",value:_,color:oy},{label:"INCOMING",value:y.length,color:NN},{label:"VERSION",value:Is(C.version),color:EN}],factsTitle:"NODE",facts:[Rt("path",N),Rt("id",l.id),Rt("spec_node_id",(F=l.spec_node_id)!=null?F:`${e}.${l.type}`),Rt("type",l.type),Rt("layer_id",e),Rt("name",l.name,!0),Rt("source_reference.provenance",uy(l)),Rt("source_reference.file",R.file),Rt("source_reference.symbol",R.symbol),Rt("metadata.created_at",C.created_at),Rt("metadata.updated_at",C.updated_at),Rt("metadata.created_by",C.created_by),Rt("metadata.version",C.version)],tables:[{title:"Conforms to",columns:["spec node","spec_node_id","attributes"],widths:Hz,rows:S,emptyText:"No spec node type resolved for this element."},{title:"Attributes",columns:["attribute","type","constraint"],widths:kN,rows:w,emptyText:"No attribute schema is published for this node type."},{title:"Outgoing relationships",columns:["predicate","target","layer","spec_relationship_id"],widths:Pz,rows:p,emptyText:"This element has no outgoing relationships."},{title:"Incoming relationships",columns:["source","predicate","type","layer"],widths:qz,rows:y,emptyText:"No other element references this one."}],neighborhoodGraph:Az(t,n,i)}}const Pn=8,Gz={top:"bottom",bottom:"top",left:"right",right:"left"};function Kz(e,t,n,i={width:typeof window!="undefined"?window.innerWidth:1024,height:typeof window!="undefined"?window.innerHeight:768}){const l=(g=>{switch(g){case"top":return e.top-t.height-Pn>=0;case"bottom":return e.bottom+t.height+Pn<=i.height;case"left":return e.left-t.width-Pn>=0;case"right":return e.right+t.width+Pn<=i.width}})(n)?n:Gz[n];let o,u;l==="top"||l==="bottom"?(o=l==="top"?e.top-t.height-Pn:e.bottom+Pn,u=e.left+e.width/2-t.width/2):(u=l==="left"?e.left-t.width-Pn:e.right+Pn,o=e.top+e.height/2-t.height/2);const f=Math.max(Pn,i.width-t.width-Pn),m=Math.max(Pn,i.height-t.height-Pn);return u=Math.min(Math.max(Pn,u),f),o=Math.min(Math.max(Pn,o),m),{top:o,left:u,placement:l}}function TN({content:e,children:t,placement:n="top",openDelay:i=300,closeDelay:r=150,className:l,"data-testid":o}){var O,F,A;const f=`rich-tooltip-${k.useId()}`,[m,g]=k.useState(!1),[p,y]=k.useState(null),x=k.useRef(null),_=k.useRef(null),S=k.useRef(null),w=k.useRef(null),N=()=>{S.current&&(clearTimeout(S.current),S.current=null)},R=()=>{w.current&&(clearTimeout(w.current),w.current=null)},C=()=>{N(),R(),g(!0)},E=()=>{R(),!m&&(S.current=setTimeout(()=>{S.current=null,g(!0)},i))},T=()=>{N(),w.current=setTimeout(()=>{w.current=null,g(!1)},r)},D=()=>{N(),R(),g(!1)};return k.useEffect(()=>()=>{N(),R()},[]),k.useLayoutEffect(()=>{if(!m||!x.current||!_.current)return;const M=()=>{if(!x.current||!_.current)return;const B=x.current.getBoundingClientRect(),H={width:_.current.offsetWidth,height:_.current.offsetHeight};y(Kz(B,H,n))};return M(),window.addEventListener("resize",M),window.addEventListener("scroll",M,!0),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,!0)}},[m,n]),k.useEffect(()=>{if(!m)return;const M=B=>{B.key==="Escape"&&D()};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[m]),d.jsxs("span",{ref:x,className:l,style:{display:"inline-block"},onMouseEnter:E,onMouseLeave:T,onFocus:C,onBlur:D,"aria-describedby":m?f:void 0,"data-testid":o,children:[t,m&&Y_.createPortal(d.jsx("div",{ref:_,id:f,role:"tooltip",className:"rich-tooltip","data-placement":(O=p==null?void 0:p.placement)!=null?O:n,style:{position:"fixed",top:(F=p==null?void 0:p.top)!=null?F:0,left:(A=p==null?void 0:p.left)!=null?A:0,visibility:p?"visible":"hidden"},onMouseEnter:R,onMouseLeave:T,"data-testid":o?`${o}-card`:"rich-tooltip-card",children:e}),document.body)]})}const Yz=6;function o_({items:e,max:t,testId:n,emptyLabel:i}){if(e.length===0)return d.jsx("div",{className:"rich-tooltip__empty","data-testid":n,children:i});const r=e.slice(0,t),l=e.length-r.length;return d.jsxs("ul",{className:"rich-tooltip__connections","data-testid":n,children:[r.map((o,u)=>d.jsxs("li",{className:"rich-tooltip__connection",title:`${o.predicate} · ${o.typeLabel}${o.domain?` (${Da(o.domain)})`:""}`,children:[d.jsx("span",{className:"rich-tooltip__connection-swatch",style:{background:La(o.domain)}}),d.jsx("span",{className:"rich-tooltip__connection-predicate",children:o.predicate}),d.jsx("span",{className:"rich-tooltip__connection-type",children:o.typeLabel})]},`${o.predicate}-${o.typeId}-${u}`)),l>0&&d.jsxs("li",{className:"rich-tooltip__overflow","data-testid":`${n}-overflow`,children:["+",l," more"]})]})}function Xz({children:e,specifier:t,title:n,description:i,inbound:r,outbound:l,maxConnections:o=Yz,placement:u,className:f,"data-testid":m="node-type-tooltip"}){const g=d.jsxs("div",{className:"rich-tooltip__body","data-testid":`${m}-content`,children:[d.jsx("div",{className:"rich-tooltip__title",children:n}),d.jsx("div",{className:"rich-tooltip__specifier",children:t}),i&&d.jsx("p",{className:"rich-tooltip__description",children:i}),d.jsx("div",{className:"rich-tooltip__section-label",children:"Inbound connections"}),d.jsx(o_,{items:r,max:o,testId:`${m}-inbound`,emptyLabel:"No inbound connection types"}),d.jsx("div",{className:"rich-tooltip__section-label",children:"Outbound connections"}),d.jsx(o_,{items:l,max:o,testId:`${m}-outbound`,emptyLabel:"No outbound connection types"})]});return d.jsx(TN,{content:g,placement:u,className:f,"data-testid":m,children:e})}function $l({spec:e,layerId:t,typeId:n,children:i,placement:r,className:l,"data-testid":o}){const u=wz(e,t,`${t}.${n}`);return u?d.jsx(Xz,{specifier:u.specifier,title:u.title,description:u.description,inbound:u.inbound,outbound:u.outbound,placement:r,className:l,"data-testid":o,children:i}):d.jsx(d.Fragment,{children:i})}const Qz={supports:{description:"Element contributes to achieving or enabling another element",category:"motivation",archimateAlignment:"Influence"},realizes:{description:"Element implements or makes concrete another element",category:"structural",archimateAlignment:"Realization"},fulfills:{description:"Element satisfies the needs specified by another element",category:"motivation",archimateAlignment:"Realization"},delivers:{description:"Element provides value or benefit",category:"motivation",archimateAlignment:"Realization"},constrains:{description:"Element limits or restricts another element",category:"motivation",archimateAlignment:"Influence"},governs:{description:"Element provides rules or guidelines for another element",category:"motivation",archimateAlignment:"Influence"},owns:{description:"Element has responsibility or authority over another element",category:"business",archimateAlignment:"Assignment"},performs:{description:"Element executes or carries out another element",category:"business",archimateAlignment:"Assignment"},provides:{description:"Element makes functionality available",category:"structural",archimateAlignment:"Serving"},consumes:{description:"Element uses or depends on another element's functionality",category:"dependency",archimateAlignment:"Serving"},requires:{description:"Element needs another element to function correctly",category:"security",archimateAlignment:"Access"},protects:{description:"Element provides security for another element",category:"security",archimateAlignment:"Influence"},mitigates:{description:"Element reduces or addresses a risk or threat",category:"security",archimateAlignment:"Influence"},accesses:{description:"Element can read or modify another element",category:"security",archimateAlignment:"Access"},uses:{description:"Element depends on or utilizes another element",category:"dependency",archimateAlignment:"Serving"},implements:{description:"Element provides concrete implementation of another element",category:"structural",archimateAlignment:"Realization"},composes:{description:"Whole-part relationship where part cannot exist without whole",category:"structural",archimateAlignment:"Composition"},aggregates:{description:"Whole-part relationship where part can exist independently",category:"structural",archimateAlignment:"Aggregation"},triggers:{description:"Element causes or initiates another element",category:"behavioral",archimateAlignment:"Triggering"},"flows-to":{description:"Data or control flows from one element to another",category:"behavioral",archimateAlignment:"Flow"},monitors:{description:"Element observes or tracks another element",category:"apm",archimateAlignment:"Serving"},tests:{description:"Element validates or verifies another element",category:"testing",archimateAlignment:"Serving"},specializes:{description:"Type-subtype relationship (inheritance)",category:"structural",archimateAlignment:"Specialization"},"assigned-to":{description:"Active element assigned to behavior or role",category:"structural",archimateAlignment:"Assignment"},"associated-with":{description:"Generic relationship indicating elements are related or connected",category:"structural",archimateAlignment:"Association"},influence:{description:"Element affects or impacts another element",category:"behavioral",archimateAlignment:"Influence"},serves:{description:"Service available to consumer",category:"behavioral",archimateAlignment:"Serving"},references:{description:"Pointer reference without functional dependency",category:"dependency"},"depends-on":{description:"Element requires another to function",category:"dependency"},"supports-goals":{description:"Implementation contributes to achieving goal",category:"traceability"},"fulfills-requirements":{description:"Implementation satisfies requirement",category:"traceability"},"delivers-value":{description:"Implementation provides business value",category:"traceability"},"measures-outcome":{description:"Metric validates outcome achievement",category:"traceability"},"governed-by-principles":{description:"Element follows architectural principle",category:"governance"},"constrained-by":{description:"Element limited by constraint",category:"governance"},"enforces-requirement":{description:"Element actively enforces requirement",category:"governance"},traces:{description:"Distributed tracing relationships",category:"apm"},measures:{description:"Metric collection relationships",category:"apm"},authenticates:{description:"Authentication flows",category:"security"},authorizes:{description:"Permission grants",category:"security"},renders:{description:"UI rendering relationships",category:"ux"},"binds-to":{description:"Data binding relationships",category:"ux"},"navigates-to":{description:"Navigation flows",category:"ux"},"maps-to":{description:"Schema/table mapping",category:"data"},"references-table":{description:"Foreign key relationships",category:"data"},"derives-from":{description:"Calculated field relationships",category:"data"},validates:{description:"Test element validates that a requirement or target is satisfied",category:"testing"},applies:{description:"Element applies a rule, pattern, or style to another element",category:"ux"},"archives-to":{description:"Element archives data to a target store",category:"data"},"cascades-to":{description:"A change to element cascades to a dependent element",category:"data"},connects:{description:"Element establishes a connection to another element",category:"structural",archimateAlignment:"Association"},covers:{description:"Test element provides coverage for another element",category:"testing"},enforces:{description:"Element actively enforces a policy or requirement on another element",category:"governance"},evaluates:{description:"Element assesses or scores another element",category:"behavioral"},exposes:{description:"Element makes an interface or capability externally available",category:"structural",archimateAlignment:"Serving"},extends:{description:"Element extends the definition or capability of another element",category:"structural",archimateAlignment:"Specialization"},federates:{description:"Element federates identity or access with another element",category:"security"},generates:{description:"Element produces or creates another element",category:"data"},"governed-by":{description:"Element operates under the governance of another element",category:"governance"},intercepts:{description:"Element intercepts a request or action directed at another element",category:"behavioral"},"lazy-loads":{description:"Element defers loading of another element until needed",category:"behavioral"},manages:{description:"Element administers or oversees another element",category:"business"},mandates:{description:"Element requires compliance with another element",category:"governance"},migrates:{description:"Element transforms or moves data to another element",category:"data"},optimizes:{description:"Element improves the performance or efficiency of another element",category:"apm"},replicates:{description:"Element duplicates data to another element",category:"data"},"resolves-with":{description:"Element resolves an ambiguity or conflict together with another element",category:"behavioral"},satisfies:{description:"Element meets the criteria or requirement defined by another element",category:"traceability"},targets:{description:"Element is the target or subject of another element's action",category:"security"},tracks:{description:"Element records or follows the state of another element",category:"apm"},"scheduled-for":{description:"Element is scheduled to occur at or by a target element",category:"structural",archimateAlignment:"Assignment"}};function Zz(e){return e?Qz[e]:void 0}function RN({predicate:e,sourceTypeLabel:t,destinationTypeLabel:n,"data-testid":i="predicate-tooltip"}){var l;const r=Zz(e);return d.jsxs("div",{className:"rich-tooltip__body","data-testid":`${i}-content`,children:[d.jsx("div",{className:"rich-tooltip__title",children:e}),d.jsx("p",{className:"rich-tooltip__description",children:(l=r==null?void 0:r.description)!=null?l:"No definition available for this predicate."}),d.jsx("div",{className:"rich-tooltip__section-label",children:"Relationship"}),d.jsxs("div",{className:"rich-tooltip__diagram","data-testid":`${i}-diagram`,children:[d.jsx("span",{className:"rich-tooltip__diagram-node",children:t}),d.jsx("span",{className:"rich-tooltip__diagram-arrow","aria-hidden":"true",children:"→"}),d.jsx("span",{className:"rich-tooltip__diagram-predicate",children:e}),d.jsx("span",{className:"rich-tooltip__diagram-arrow","aria-hidden":"true",children:"→"}),d.jsx("span",{className:"rich-tooltip__diagram-node",children:n})]})]})}function dy({children:e,predicate:t,sourceTypeLabel:n,destinationTypeLabel:i,placement:r,className:l,"data-testid":o="predicate-tooltip"}){return d.jsx(TN,{content:d.jsx(RN,{predicate:t,sourceTypeLabel:n,destinationTypeLabel:i,"data-testid":o}),placement:r,className:l,"data-testid":o,children:e})}function MN({id:e,label:t,kind:n,domainColor:i="default",selected:r=!1,onSelect:l,spec:o,typeId:u,hasChildren:f=!1,collapsed:m=!1,hiddenDescendantCount:g=0,onToggleCollapse:p}){const y=u!=null?u:n,x=["graph-node",r&&"selected"].filter(Boolean).join(" ");return d.jsxs("div",{className:x,"data-domain":i,"data-kind":n,"data-testid":`pill-node-${e}`,onClick:_=>{_.stopPropagation(),l==null||l(e)},onKeyDown:_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),_.stopPropagation(),l==null||l(e))},role:l?"button":void 0,tabIndex:l?0:void 0,"aria-pressed":l?r:void 0,children:[d.jsx("span",{className:"graph-node__swatch"}),d.jsx("span",{className:"graph-node__label",children:t}),n&&(y?d.jsx($l,{spec:o,layerId:i,typeId:y,"data-testid":`pill-node-kind-tooltip-${e}`,children:d.jsx("span",{className:"graph-node__kind",tabIndex:0,children:n})}):d.jsx("span",{className:"graph-node__kind",children:n})),f&&p&&d.jsxs("button",{type:"button",className:"graph-node__collapse-toggle","aria-label":m?"Expand":"Collapse","aria-expanded":!m,onClick:_=>{_.stopPropagation(),p()},children:[m&&g>0&&d.jsx("span",{className:"graph-node__hidden-badge",children:g}),d.jsx(je,{name:m?"chevronRight":"chevronDown",size:12})]})]})}const Jz=new Set(["realizes","provides","extends","connects","exposes","implements","composes","aggregates","specializes","assigned-to","associated-with","scheduled-for"]);function Wz(e){return!!e&&Jz.has(e)}function AN(e){return Wz(e.label)}function e8(e){return e.map(t=>({id:t.id,label:t.name,kind:t.kind,domainColor:t.layer}))}function t8(e,t){const n=e.find(i=>i.isCenter);return n?t.map(i=>({id:i.id,sourceId:i.direction==="out"?n.id:i.targetId,targetId:i.direction==="out"?i.targetId:n.id,label:i.predicate})):[]}function n8(e,t,n,i,r){const l=t.find(o=>o.id===e);l&&(l.isCenter||(n?r(e,l.layer):i(e,l.layer)))}function a8({neighborhood:e,isSpecView:t}){const n=Se(g=>g.navigateToElement),i=Se(g=>g.navigateToSpecNode),{raw:r}=Hi(),l=k.useMemo(()=>{const g=e.nodes.find(p=>p.isCenter);return g==null?void 0:g.id},[e.nodes]),o=k.useMemo(()=>e8(e.nodes),[e.nodes]),u=k.useMemo(()=>t8(e.nodes,e.edges),[e.nodes,e.edges]),f=k.useCallback(g=>{n8(g,e.nodes,t,n,i)},[e.nodes,t,n,i]),m=k.useCallback((g,p)=>{var _;const y=e.nodes.find(S=>S.id===g.id),x=(_=y==null?void 0:y.isCenter)!=null?_:!1;return d.jsx(MN,{id:g.id,label:g.label,kind:g.kind,domainColor:g.domainColor,selected:p,onSelect:x?void 0:f,spec:r,typeId:t?g.id.split(".")[1]:void 0})},[e.nodes,t,f,r]);return d.jsx("div",{style:{height:280,width:"100%",position:"relative",border:"1px solid rgb(var(--canvas-border))",borderRadius:8,background:"rgb(var(--canvas-card))",marginBottom:20},"data-testid":"neighborhood-graph-view",children:e.empty?d.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"rgb(var(--canvas-fg-3))",fontFamily:"'JetBrains Mono',monospace",fontSize:12},"data-testid":"neighborhood-empty-state",children:"no connections"}):d.jsx(iy,{nodes:o,edges:u,selectedNodeId:l,renderNode:m,onNodeSelect:f,layout:"force",nodeMargin:40,centerOnSelect:!0,fitView:!0,fitPadding:20,showToolbar:!1,isStructuralEdge:AN,style:{position:"absolute",inset:0,width:"100%",height:"100%"}})})}const Ga="'JetBrains Mono',monospace";function i8(){const e=Se(u=>u.view),t=Se(u=>u.layerId),n=Se(u=>u.selectedId),i=Se(u=>u.focus),{derived:r}=$i(),{raw:l}=Hi(),o=k.useMemo(()=>nf(r),[r]);return k.useMemo(()=>!t||e==="changesets"?null:i==="layer"?zz(e,t,r,o,l):n?e==="spec"?$z(t,n,l,r):Vz(t,n,r,o,l):null,[e,t,n,i,r,o,l])}function s8(){const e=Se(l=>l.setView),t=Se(l=>l.selectLayer),n=Se(l=>l.navigateToElement),i=Se(l=>l.navigateToElementWithEdge),r=Se(l=>l.navigateToSpecNode);return l=>{if(l)switch(l.kind){case"section":e(l.view);return;case"layer":e(l.view),t(l.layerId);return;case"element":n(l.elementId,l.layerId);return;case"elementWithEdge":i(l.elementId,l.layerId,l.edgeId);return;case"specNode":r(l.specNodeId,l.layerId);return;default:return l}}}function r8(e){var t,n;if(((t=e.tooltip)==null?void 0:t.kind)==="nodeType")return{kind:"specNode",specNodeId:`${e.tooltip.layerId}.${e.tooltip.typeId}`,layerId:e.tooltip.layerId};if(((n=e.tooltip)==null?void 0:n.kind)==="predicate"&&e.tooltip.edge)return{kind:"elementWithEdge",elementId:e.tooltip.edge.sourceElementId,layerId:e.tooltip.edge.sourceLayerId,edgeId:e.tooltip.edge.edgeId}}const l8={name:{fontSize:13,color:"rgb(var(--canvas-fg-1))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},mono:{fontFamily:Ga,fontSize:11,color:"rgb(var(--canvas-fg-2))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},dim:{fontFamily:Ga,fontSize:11,color:"rgb(var(--canvas-fg-3))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},num:{fontFamily:Ga,fontSize:11,color:"rgb(var(--canvas-fg-2))",textAlign:"right"}};function o8({cell:e,spec:t,target:n,onNavigate:i}){var o,u,f;const r=L(L({},l8[e.kind]),e.color?{color:e.color}:null),l=n?d.jsx("span",{role:"cell",style:r,children:d.jsx("button",{type:"button",className:"drv-cell-link",style:{overflow:r.overflow,textOverflow:r.textOverflow,whiteSpace:r.whiteSpace,textAlign:(o=r.textAlign)!=null?o:"left",display:"block",width:"100%",border:"none",padding:0,margin:0,cursor:"pointer"},onClick:()=>i(n),"data-testid":"page-cell-link",children:e.text})}):d.jsx("span",{role:"cell",style:r,tabIndex:e.tooltip?0:void 0,children:e.text});return((u=e.tooltip)==null?void 0:u.kind)==="nodeType"?d.jsx($l,{spec:t,layerId:e.tooltip.layerId,typeId:e.tooltip.typeId,"data-testid":"page-cell-node-type-tooltip",children:l}):((f=e.tooltip)==null?void 0:f.kind)==="predicate"?d.jsx(dy,{predicate:e.tooltip.predicate,sourceTypeLabel:e.tooltip.sourceTypeLabel,destinationTypeLabel:e.tooltip.destinationTypeLabel,"data-testid":"page-cell-predicate-tooltip",children:l}):l}function c8({pg:e,onNavigate:t}){const n={fontFamily:Ga,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(L({},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:L({background:"none",border:"none",padding:0},n),children:i.label}):d.jsx("span",{style:V(L({},n),{color:i.current?"rgb(var(--canvas-fg-1))":"rgb(var(--canvas-fg-3))"}),children:i.label})]},`${i.label}-${r}`))})}function u8({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:Ga,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 d8({pg:e}){return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[d.jsx("span",{style:{fontFamily:Ga,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:Ga,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:Ga,fontSize:11,color:"rgb(var(--canvas-fg-1))",overflowWrap:"anywhere"},children:t.value})]},t.key))})]})}const f8={display:"grid",gap:14,alignItems:"center",padding:"9px 10px",borderBottom:"1px solid rgb(var(--canvas-border))",borderRadius:4};function h8({row:e,widths:t,spec:n,onNavigate:i}){let r=!1,l=!1;const o=e.cells.map((u,f)=>{let m=r8(u);return!m&&e.target&&!r&&(m=e.target,r=!0),m&&(l=!0),d.jsx(o8,{cell:u,spec:n,target:m,onNavigate:i},f)});return d.jsx("div",{role:"row",className:l?"drv-row":void 0,style:V(L({},f8),{gridTemplateColumns:t}),"data-testid":e.target?"page-row":void 0,children:o})}function m8({pg:e,spec:t,onNavigate:n}){return d.jsx(d.Fragment,{children:e.tables.map(i=>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:Ga,fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:i.title}),d.jsx("span",{style:{fontFamily:Ga,fontSize:10,color:"rgb(var(--canvas-fg-3))"},children:i.rows.length?i.rows.length:""})]}),i.rows.length===0?d.jsx("span",{style:{fontSize:13,color:"rgb(var(--canvas-fg-3))"},children:i.emptyText}):d.jsxs("div",{role:"table","aria-label":i.title,children:[d.jsx("div",{role:"row",style:{display:"grid",gridTemplateColumns:i.widths,gap:14,alignItems:"center",padding:"0 10px 7px",fontFamily:Ga,fontSize:10,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",borderBottom:"1px solid rgb(var(--canvas-border))"},children:i.columns.map(r=>d.jsx("span",{role:"columnheader",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r},r))}),i.rows.map((r,l)=>d.jsx(h8,{row:r,widths:i.widths,spec:t,onNavigate:n},l))]})]},i.title))})}function p8({pg:e}){const t=s8(),{raw:n}=Hi(),i=Se(r=>r.view);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(c8,{pg:e,onNavigate:t}),e.neighborhoodGraph&&d.jsx(a8,{neighborhood:e.neighborhoodGraph,isSpecView:i==="spec"},`${e.title}-neighborhood`),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(u8,{pg:e}),d.jsx(d8,{pg:e}),d.jsx(m8,{pg:e,spec:n,onNavigate:t})]})})}const LN="You",g8=/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/;function y8(e){return g8.test(e)}function af(e){return["annotations",e!=null?e:""]}function DN(e){return["annotation-replies",e]}function v8(e){return ql({queryKey:af(e),enabled:!!e,queryFn:()=>Qe(null,null,function*(){var n;return(n=(yield Ar().getapiannotations({elementId:e})).annotations)!=null?n:[]})})}function x8(e,t=!0){return ql({queryKey:DN(e),enabled:t,queryFn:()=>Qe(null,null,function*(){var i;return(i=(yield Ar().getapiannotationsannotationIdreplies(e)).replies)!=null?i:[]})})}function b8(){const e=Pl();return Fd({mutationFn:t=>{var n,i;return Ar().postapiannotations({elementId:t.elementId,author:(n=t.author)!=null?n:LN,content:t.content,tags:(i=t.tags)!=null?i:[]})},onSuccess:(t,n)=>{e.invalidateQueries({queryKey:af(n.elementId)})}})}function _8(){const e=Pl();return Fd({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),Ar().patchapiannotationsannotationId(t.id,n)},onSuccess:(t,n)=>{e.invalidateQueries({queryKey:af(n.elementId)})}})}function S8(){const e=Pl();return Fd({mutationFn:t=>Ar().deleteapiannotationsannotationId(t.id),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:af(n.elementId)})}})}function w8(){const e=Pl();return Fd({mutationFn:t=>{var n;return Ar().postapiannotationsannotationIdreplies(t.annotationId,{author:(n=t.author)!=null?n:LN,content:t.content})},onSuccess:(t,n)=>{e.invalidateQueries({queryKey:DN(n.annotationId)})}})}function ON(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 l=Math.round(r/60);if(l<24)return`${l}h ago`;const o=Math.round(l/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 N8(e){const t=new Set;for(const n of e.split(/[\s,]+/)){const i=n.trim().toLowerCase();i&&t.add(i)}return[...t]}const C8={display:"block",fontFamily:"'JetBrains Mono', monospace",fontSize:10.5,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",fontWeight:500},Er={fontFamily:"'JetBrains Mono', monospace",fontSize:10.5,color:"rgb(var(--canvas-fg-3))"},E8={background:"rgb(var(--canvas-card))",border:"1px solid rgb(var(--canvas-border))",borderRadius:8,padding:"10px 12px"};function j8({elementId:e,notify:t}){const[n,i]=k.useState(""),[r,l]=k.useState(""),o=b8(),u=n.trim(),f=k.useMemo(()=>N8(r),[r]),m=f.filter(y=>!y8(y)),g=u.length>=1&&u.length<=5e3&&m.length===0&&!o.isPending,p=()=>{g&&o.mutate({elementId:e,content:u,tags:f},{onSuccess:()=>{i(""),l(""),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(bg,{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(pc,{mono:!0,value:r,onChange:y=>l(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(L({},Er),{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(En,{variant:"accent",size:"sm",disabled:!g,onClick:p,"data-testid":"annotation-add-submit",children:o.isPending?"Adding…":"Add"})})]})}function k8({annotationId:e,expanded:t,notify:n}){const{data:i=[],isLoading:r}=x8(e,t),l=w8(),[o,u]=k.useState(""),f=o.trim(),m=f.length>=1&&f.length<=5e3&&!l.isPending,g=()=>{m&&l.mutate({annotationId:e,content:f},{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:Er,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:Er,title:p.createdAt,children:ON(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(pc,{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(En,{variant:"secondary",size:"sm",disabled:!m,onClick:g,"data-testid":"annotation-reply-submit",children:"Reply"})]})]})}function T8({annotation:e,elementId:t,notify:n}){const i=_8(),r=S8(),[l,o]=k.useState(!1),[u,f]=k.useState(e.content),[m,g]=k.useState(!1),[p,y]=k.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")}})},R=C=>{C==="edit"?(f(e.content),o(!0)):C==="resolve"?w():C==="delete"&&g(!0)};return d.jsxs("div",{style:E8,"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:Er,title:e.createdAt,children:ON(e.createdAt)}),e.resolved&&d.jsx(Xn,{variant:"emerald","data-testid":"annotation-resolved-chip",children:"resolved"}),d.jsx("div",{style:{marginLeft:"auto"},children:d.jsx(Xw,{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:R})})]}),l?d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[d.jsx(bg,{value:u,onChange:C=>f(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(En,{variant:"ghost",size:"sm",onClick:()=>o(!1),"data-testid":"annotation-edit-cancel",children:"Cancel"}),d.jsx(En,{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(Xn,{form:"id-tag",children:C},C))}),d.jsx("div",{style:{marginTop:8},children:d.jsx(En,{variant:"ghost",size:"sm",onClick:()=>y(C=>!C),"aria-expanded":p,"data-testid":"annotation-replies-toggle",children:p?"Hide replies":"Replies"})}),p&&d.jsx(k8,{annotationId:e.id,expanded:p,notify:n}),d.jsx(yS,{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 R8({elementId:e}){const{data:t=[],isLoading:n,isError:i}=v8(e),[r,l]=k.useState({open:!1,variant:"success",title:""}),o=(u,f)=>l({open:!0,variant:u,title:f});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:C8,children:"Annotations"}),d.jsxs("span",{style:Er,"data-testid":"annotations-count",children:["· ",t.length]})]}),d.jsx(j8,{elementId:e,notify:o}),n?d.jsx("span",{style:Er,children:"loading…"}):i?d.jsx("span",{style:V(L({},Er),{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(T8,{annotation:u,elementId:e,notify:o},u.id))}),d.jsx(bS,{isOpen:r.open,onClose:()=>l(u=>V(L({},u),{open:!1})),variant:r.variant,title:r.title})]})}function Jp({relationships:e,onNodeSelect:t}){if(e.length===0)return null;const n=e.filter(r=>r.direction==="out"),i=e.filter(r=>r.direction==="in");return d.jsxs(d.Fragment,{children:[n.length>0&&d.jsxs("div",{"data-testid":"inspector-outgoing",children:[d.jsxs("div",{className:"graph-inspector__section-label",children:["Outgoing · ",n.length]}),d.jsx("ul",{className:"graph-inspector__rels",children:n.map(r=>d.jsx(c_,{rel:r,onNodeSelect:t},r.id))})]}),i.length>0&&d.jsxs("div",{"data-testid":"inspector-incoming",children:[d.jsxs("div",{className:"graph-inspector__section-label",children:["Incoming · ",i.length]}),d.jsx("ul",{className:"graph-inspector__rels",children:i.map(r=>d.jsx(c_,{rel:r,onNodeSelect:t},r.id))})]})]})}function c_({rel:e,onNodeSelect:t}){const n=()=>t(e.target),i=e.sourceTypeLabel&&e.destinationTypeLabel?d.jsx(dy,{predicate:e.predicate,sourceTypeLabel:e.sourceTypeLabel,destinationTypeLabel:e.destinationTypeLabel,"data-testid":`relationship-predicate-tooltip-${e.id}`,children:d.jsx("span",{className:"graph-inspector__rel-pred",children:e.predicate})}):d.jsx("span",{className:"graph-inspector__rel-pred",children:e.predicate}),r=e.direction==="out"?"→":"←",l=`graph-inspector__rel-dir--${e.direction}`;return d.jsxs("li",{className:"graph-inspector__rel",children:[d.jsx("div",{className:`graph-inspector__rel-dir ${l}`,children:r}),i,d.jsxs("button",{type:"button",className:"graph-inspector__rel-target","data-domain":e.targetDomain,onClick:n,"aria-label":`Navigate to ${e.targetTitle}`,children:[d.jsx("span",{className:"graph-inspector__rel-swatch"}),e.targetTitle]})]})}const np={border:"none",cursor:"pointer"};function M8({edgeId:e,edge:t,model:n,index:i,spec:r,onNodeSelect:l,navigateToSpecNode:o,navigateToElementWithEdge:u}){var S;const f=i.byUuid.get(t.sourceNode.id),m=i.byUuid.get(t.targetNode.id),g=k.useMemo(()=>f?V(L({},Qp(f,Da(f.layer_id))),{kind:void 0}):null,[f]),p=k.useMemo(()=>m?V(L({},Qp(m,Da(m.layer_id))),{kind:void 0}):null,[m]),y=k.useMemo(()=>f?Xp(n,f.id,i):[],[n,f,i]),x=k.useMemo(()=>m?Xp(n,m.id,i):[],[n,m,i]),_={id:e,predicate:t.predicate,sourceId:t.sourceNode.id,sourceTitle:t.sourceNode.name,sourceDomain:t.sourceNode.layer,targetId:t.targetNode.id,targetTitle:t.targetNode.name,targetDomain:t.targetNode.layer,variant:"hot",metadata:(S=t.specRelationship)!=null&&S.cardinality?{cardinality:t.specRelationship.cardinality}:void 0};return d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},"data-testid":"edge-inspector",children:[d.jsxs("div",{"data-testid":"edge-inspector-source-node",children:[f&&d.jsx("div",{className:"graph-inspector__head-eyebrow","data-testid":"edge-inspector-source-type-row",children:d.jsx($l,{spec:r,layerId:f.layer_id,typeId:f.type,"data-testid":"edge-inspector-source-type-tooltip",children:d.jsx("button",{type:"button",className:"graph-inspector__badge",style:np,onClick:()=>o(`${f.layer_id}.${f.type}`,f.layer_id),children:f.type})})}),d.jsxs("div",{className:"graph-inspector--custom-relationships",children:[d.jsx(_c,{node:g,relationships:[],onNodeSelect:l,emptyStateText:"Source element unavailable."}),d.jsx(Jp,{relationships:y,onNodeSelect:l})]})]}),d.jsx("div",{className:"graph-edge-inspector__head-eyebrow","data-testid":"edge-inspector-predicate-row",children:d.jsx(dy,{predicate:t.predicate,sourceTypeLabel:t.sourceNode.type,destinationTypeLabel:t.targetNode.type,"data-testid":"edge-inspector-predicate-tooltip",children:d.jsx("button",{type:"button",className:"graph-edge-inspector__badge",style:np,onClick:()=>u(t.sourceNode.id,t.sourceNode.layer,e),children:t.predicate})})}),d.jsx(rN,{edge:_,onNodeSelect:l,"data-testid":"edge-inspector-edge"}),d.jsxs("div",{"data-testid":"edge-inspector-destination-node",children:[m&&d.jsx("div",{className:"graph-inspector__head-eyebrow","data-testid":"edge-inspector-destination-type-row",children:d.jsx($l,{spec:r,layerId:m.layer_id,typeId:m.type,"data-testid":"edge-inspector-destination-type-tooltip",children:d.jsx("button",{type:"button",className:"graph-inspector__badge",style:np,onClick:()=>o(`${m.layer_id}.${m.type}`,m.layer_id),children:m.type})})}),d.jsxs("div",{className:"graph-inspector--custom-relationships",children:[d.jsx(_c,{node:p,relationships:[],onNodeSelect:l,emptyStateText:"Destination element unavailable."}),d.jsx(Jp,{relationships:x,onNodeSelect:l})]})]})]})}function A8(e){const t=e.lastIndexOf(".");return t>0?e.slice(0,t):e}const L8=320;function D8(){const[e,t]=k.useState(L8),n=Se(A=>A.view),i=Se(A=>A.layerId),r=Se(A=>A.selectedId),l=Se(A=>A.selectedEdgeId),o=Se(A=>A.navigateToElement),u=Se(A=>A.navigateToSpecNode),f=Se(A=>A.navigateToElementWithEdge),m=Se(A=>A.clearEdgeSelection),{derived:g,isSuccess:p}=$i(),{raw:y}=Hi(),x=k.useMemo(()=>nf(g),[g]),_=n==="spec",S=k.useMemo(()=>!_&&l?_N(g,l,x,y):void 0,[_,g,l,x,y]);k.useEffect(()=>{_||!l||!p||S||m()},[_,l,p,S,m]);const w=!_&&r?x.byUuid.get(r):void 0,N=k.useMemo(()=>w?V(L({},Qp(w,Da(w.layer_id))),{kind:void 0}):null,[w]),R=k.useMemo(()=>w?Xp(g,w.id,x):[],[g,w,x]),C=k.useMemo(()=>_&&i&&r?_z(y,i,r):null,[_,y,i,r]),E=k.useMemo(()=>_&&i&&r?bz(y,i,r):[],[_,y,i,r]),T=_?C:N,D=_?E:R,O=A=>{if(_){u(A,A8(A));return}const M=x.byUuid.get(A);M&&o(M.id,M.layer_id)},F=w?tf(w):null;return d.jsx(sN,{open:!!T||!!S,width:e,onWidthChange:t,"data-testid":"inspector",className:_?"":"inspector-model-branch",children:S&&l?d.jsx(M8,{edgeId:l,edge:S,model:g,index:x,spec:y,onNodeSelect:O,navigateToSpecNode:u,navigateToElementWithEdge:f}):d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[!_&&w&&d.jsx("div",{className:"graph-inspector__head-eyebrow","data-testid":"inspector-kind-tooltip-row",children:d.jsx($l,{spec:y,layerId:w.layer_id,typeId:w.type,"data-testid":"inspector-kind-tooltip",children:d.jsx("button",{type:"button",className:"graph-inspector__badge",style:{border:"none",cursor:"pointer"},onClick:()=>u(`${w.layer_id}.${w.type}`,w.layer_id),children:w.type})})}),_?d.jsx(_c,{node:T,relationships:D,onNodeSelect:O,emptyStateText:"Select a node type to inspect."}):d.jsxs("div",{className:"graph-inspector--custom-relationships",children:[d.jsx(_c,{node:T,relationships:[],onNodeSelect:O,emptyStateText:"Select an element to inspect."}),d.jsx(Jp,{relationships:D,onNodeSelect:O})]}),F&&d.jsx(R8,{elementId:F})]})})}function O8({id:e,label:t,kind:n,domainColor:i="default",selected:r=!1,onSelect:l,cardData:o,spec:u,hasChildren:f=!1,collapsed:m=!1,hiddenDescendantCount:g=0,onToggleCollapse:p}){var N,R,C;const y=(N=o==null?void 0:o.intraCount)!=null?N:0,x=(R=o==null?void 0:o.crossLinks)!=null?R:[],_=(C=o==null?void 0:o.crossTotal)!=null?C:0,S=_>x.length,w=["graph-node","graph-node--card",r&&"selected"].filter(Boolean).join(" ");return d.jsxs("div",{className:w,"data-domain":i,"data-kind":n,"data-testid":`model-card-node-${e}`,onClick:E=>{E.stopPropagation(),l==null||l(e)},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),E.stopPropagation(),l==null||l(e))},role:l?"button":void 0,tabIndex:l?0:void 0,"aria-pressed":l?r:void 0,children:[d.jsxs("div",{className:"graph-node__card-header",children:[d.jsx("span",{className:"graph-node__swatch"}),d.jsx("span",{className:"graph-node__label",children:t}),n&&d.jsx($l,{spec:u,layerId:i,typeId:n,"data-testid":`model-card-kind-tooltip-${e}`,children:d.jsx("span",{className:"graph-node__kind",tabIndex:0,children:n})}),f&&p&&d.jsx("button",{type:"button",className:"graph-node__collapse-toggle","aria-label":m?"Expand":"Collapse","aria-expanded":!m,onClick:E=>{E.stopPropagation(),p()},children:m&&g>0&&d.jsx("span",{className:"graph-node__hidden-badge",children:g})})]}),d.jsxs("div",{className:"graph-node__card-stats","data-testid":`model-card-stats-${e}`,children:[d.jsxs("span",{className:"graph-node__card-stat","data-testid":`model-card-intra-count-${e}`,children:[y," intra-layer"]}),d.jsxs("span",{className:"graph-node__card-stat","data-testid":`model-card-cross-count-${e}`,children:[_," inter-layer"]})]}),x.length>0&&d.jsxs("ul",{className:"graph-node__cross-links","data-testid":`model-card-cross-links-${e}`,children:[x.map((E,T)=>d.jsxs("li",{className:"graph-node__cross-link",title:`${E.predicate} · ${E.targetName} (${Da(E.targetLayer)})`,children:[d.jsx("span",{className:"graph-node__cross-link-swatch",style:{background:La(E.targetLayer)}}),d.jsxs("span",{className:"graph-node__cross-link-label",children:[E.predicate," · ",E.targetName]})]},`${E.predicate}-${E.targetId}-${T}`)),S&&d.jsx("li",{className:"graph-node__cross-link graph-node__cross-link--overflow","data-testid":`model-card-overflow-${e}`,"aria-label":`${_-x.length} more inter-layer connections`,children:"…"})]})]})}function I8(){const e=Se(n=>n.selectedEdgeId),t=Se(n=>n.selectEdge);return{selectedEdgeId:e,edgeSelectionProps:{selectedEdgeId:e!=null?e:void 0,onEdgeSelect:t}}}const z8=[{value:"graph",label:"graph"},{value:"page",label:"page"}],B8=[{value:"force",label:"Force"},{value:"galaxy",label:"Galaxy"},{value:"force-clustered",label:"Clustered"}],U8=[{value:"on",label:"On"},{value:"off",label:"Off"}],F8=[{value:"tight",label:"Tight"},{value:"default",label:"Default"},{value:"wide",label:"Wide"}],$8=[{value:"structural",label:"Structural"},{value:"all",label:"All"}],H8=[{value:"card",label:"Card"},{value:"pill",label:"Pill"}],P8=120;function q8(e){if(e==="tight")return 0;if(e==="wide")return P8}function V8(){const[e,t]=k.useState(!1),n=k.useRef(null),i=k.useRef(!1),r=Se(w=>w.graphLayout),l=Se(w=>w.setGraphLayout),o=Se(w=>w.showClusterBoundaries),u=Se(w=>w.toggleClusterBoundaries),f=Se(w=>w.nodeMarginPreset),m=Se(w=>w.setNodeMarginPreset),g=Se(w=>w.showAllRelations),p=Se(w=>w.toggleShowAllRelations),y=Se(w=>w.nodeDisplay),x=Se(w=>w.setNodeDisplay),_=Se(w=>w.view),S=w=>{w.currentTarget.contains(w.relatedTarget)||t(!1)};return d.jsxs("div",{onMouseEnter:()=>t(!0),onMouseLeave:S,onFocus:()=>{if(i.current){i.current=!1;return}t(!0)},onBlur:S,onKeyDown:w=>{var N;w.key==="Escape"&&(t(!1),i.current=!0,(N=n.current)==null||N.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(je,{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(Qo,{label:"Layout",testId:"graph-layout-control",children:d.jsx(Ii,{value:r,onChange:w=>l(w),options:B8})}),_==="model"&&d.jsx(Qo,{label:"Display",testId:"graph-display-control",children:d.jsx(Ii,{value:y,onChange:w=>x(w),options:H8})}),r!=="force"&&d.jsx(Qo,{label:"Boundaries",testId:"graph-boundaries-control",children:d.jsx(Ii,{value:o?"on":"off",onChange:w=>{w==="on"!==o&&u()},options:U8})}),r!=="galaxy"&&d.jsx(Qo,{label:"Node margin",testId:"graph-margin-control",children:d.jsx(Ii,{value:f,onChange:w=>m(w),options:F8})}),d.jsx(Qo,{label:"Relations",testId:"graph-relations-control",children:d.jsx(Ii,{value:g?"all":"structural",onChange:w=>{w==="all"!==g&&p()},options:$8})})]})]})}function Qo({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 od({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 G8(){var xe;const e=Se(he=>he.view),t=Se(he=>he.layerId),n=Se(he=>he.selectedId),i=Se(he=>he.highlightedEdgeId),r=Se(he=>he.selectGraphNode),l=Se(he=>he.selectLayer),o=Se(he=>he.mode),u=Se(he=>he.setMode),f=Se(he=>he.graphLayout),m=Se(he=>he.showClusterBoundaries),g=Se(he=>he.showAllRelations),p=Se(he=>he.nodeMarginPreset),y=Se(he=>he.nodeDisplay),x=i8(),_=o==="page",S=q8(p),w=k.useRef(null),{derived:N}=$i(),{derived:R,raw:C}=Hi(),E=e==="spec",T=k.useMemo(()=>nf(N),[N]),{nodes:D,cardData:O}=k.useMemo(()=>t?E?{nodes:yz(C,t),cardData:new Map}:Tz(N,t,T):{nodes:[],cardData:new Map},[E,C,N,t,T]),F=k.useCallback((he,we,Ce)=>d.jsx(O8,{id:he.id,label:he.label,kind:he.kind,domainColor:he.domainColor,selected:we,onSelect:r,cardData:O.get(he.id),spec:C,hasChildren:Ce==null?void 0:Ce.hasChildren,collapsed:Ce==null?void 0:Ce.collapsed,hiddenDescendantCount:Ce==null?void 0:Ce.hiddenDescendantCount,onToggleCollapse:Ce==null?void 0:Ce.onToggleCollapse}),[r,O,C]),A=k.useCallback((he,we,Ce)=>{var at;return d.jsx(MN,{id:he.id,label:he.label,kind:he.kind,domainColor:he.domainColor,selected:we,onSelect:r,spec:C,typeId:E?si((at=he.domainColor)!=null?at:"",he.id):void 0,hasChildren:Ce==null?void 0:Ce.hasChildren,collapsed:Ce==null?void 0:Ce.collapsed,hiddenDescendantCount:Ce==null?void 0:Ce.hiddenDescendantCount,onToggleCollapse:Ce==null?void 0:Ce.onToggleCollapse})},[r,C,E]),{selectedEdgeId:M,edgeSelectionProps:B}=I8(),H=k.useMemo(()=>t?E?xz(C,t):jz(N,t,T).map(he=>he.id===M||he.id===i?V(L({},he),{variant:"hot"}):he):[],[E,C,N,t,T,M,i]),G=k.useCallback(he=>{const we=_N(N,he.id,T,C);return we?d.jsx(RN,{predicate:we.predicate,sourceTypeLabel:we.sourceNode.type,destinationTypeLabel:we.targetNode.type,"data-testid":"edge-predicate-tooltip"}):null},[N,T,C]),$=t!=null?t:"",q=((xe=R.byLayer[$])==null?void 0:xe.standard)||ef($),P=E?`META-MODEL${q?` · ${q}`:""}`:`INSTANCE MODEL${q?` · ${q}`:""}`,Q=t?E?`${Da($)} schema`:Da($):E?"Schema":"Model",K=k.useMemo(()=>{var he,we,Ce;if(!t)return"";if(E){const at=(we=(he=R.byLayer[$])==null?void 0:he.typeCount)!=null?we:0,Ze=xN(C,$);return`${at} node types · ${Ze} relationships`}return`${(Ce=N.countsByLayer[$])!=null?Ce:0} elements`},[E,t,$,R,C,N]),W=E?"select a layer to view its schema":"select a layer to view its instance model",z=E?"no node types in this layer":"no elements in this layer",se=_&&x?x.color:La($),ue=_&&x?x.eyebrow:P,I=_&&x?x.title:Q,ae=_&&x?x.idChip:t!=null?t:e,ye=_&&x?x.meta:K;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(kg,{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:se,display:"inline-block"}}),d.jsx("span",{children:ue})]}),title:I,idChip:ae,actions:d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))"},children:ye}),d.jsx(Ii,{value:o,onChange:he=>u(he),options:z8,"data-testid":"canvas-mode-toggle"})]})}),d.jsx("div",{ref:w,style:{flex:1,position:"relative",minHeight:0},children:_?t?x?d.jsx(p8,{pg:x}):d.jsx(od,{message:"select a node to view its page"}):d.jsx(od,{message:W}):d.jsxs(d.Fragment,{children:[t?D.length===0?d.jsx(od,{message:z}):d.jsxs(d.Fragment,{children:[d.jsx(iy,V(L({nodes:D,edges:H,selectedNodeId:n!=null?n:void 0,onNodeSelect:he=>r(he)},E?{}:B),{edgeTooltip:E?void 0:G,onBackgroundClick:()=>l(t),renderNode:!E&&y==="card"?F:A,centerOnSelect:!0,fullscreenContainerRef:w,layout:f,nodeMargin:S,showClusterBoundaries:m,isStructuralEdge:AN,showAllRelations:g,toolbarPosition:"bottom-left",fitView:f!=="force",fitPadding:40,style:{position:"absolute",inset:0,width:"100%",height:"100%"}}),`${e}:${t}:${f}:${p}:${y}`),d.jsx(V8,{})]}):d.jsx(od,{message:W}),d.jsx(D8,{})]})})]})}function K8(e){return e==="staged"?"#FBBF24":"#10B981"}function u_({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 Y8({row:e}){const[t,n]=k.useState(!1),i=Se(l=>l.canvasDark),r=t&&e.hasDiff?rz(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(l=>!l):void 0,onKeyDown:e.hasDiff?l=>{(l.key==="Enter"||l.key===" ")&&(l.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 X8(){var u,f,m,g,p,y;const e=Se(x=>x.changesetId),{derived:t}=Ac(),{detail:n}=yN(e),i=t.list.find(x=>x.id===e),r=(f=(u=n==null?void 0:n.name)!=null?u:i==null?void 0:i.name)!=null?f:"",l=(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(kg,{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:K8(l),display:"inline-block"}}),d.jsx("span",{children:"CHANGESET"})]}),title:r,idChip:l,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:lz(n.name,n.stats)}),d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,maxWidth:760},children:n.rows.map(x=>d.jsx(Y8,{row:x},x.key))})]}):d.jsx(u_,{message:"loading changeset…"}):d.jsx(u_,{message:"select a changeset to view its changes"})})]})}function d_(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 f_(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 ap({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 Q8(){const e=Se(n=>n.changesetId),{detail:t}=yN(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(uS,{color:d_(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:d_(t.status).label})]}),d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx(pd,{label:"Added",value:t.stats.additions,color:"emerald",style:{flex:1,padding:11}}),d.jsx(pd,{label:"Modified",value:t.stats.modifications,color:"cyan",style:{flex:1,padding:11}}),d.jsx(pd,{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(ap,{label:"Created",value:f_(t.created)}),d.jsx(ap,{label:"Modified",value:f_(t.modified)}),t.baseSnapshot&&d.jsx(ap,{label:"Base Snapshot",value:t.baseSnapshot})]})]})]})})}class Fe extends Error{constructor(t,n,i){super(n),this.code=t,this.context=i,this.name="ChatValidationError"}}function cd(e){if(typeof e!="string"||e.trim().length===0)throw new Fe("INVALID_MESSAGE_ID","Message ID must be a non-empty string",{id:e})}function IN(e){if(!e||typeof e!="object")throw new Fe("INVALID_CONTENT","Content must be an object",{content:e});const t=e,n=t.type;if(typeof n!="string")throw new Fe("INVALID_CONTENT_TYPE","Content must have a type field that is a string",{type:n});if(typeof t.timestamp!="string")throw new Fe("MISSING_TIMESTAMP","Content must have a timestamp field",{timestamp:t.timestamp});switch(n){case"text":{if(typeof t.content!="string")throw new Fe("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 Fe("INVALID_TOOL_USE_ID","Tool invocation must have a non-empty toolUseId",{toolUseId:t.toolUseId});if(typeof t.toolName!="string")throw new Fe("INVALID_TOOL_NAME","Tool invocation must have a toolName field",{toolName:t.toolName});if(!t.toolInput||typeof t.toolInput!="object")throw new Fe("INVALID_TOOL_INPUT","Tool invocation must have a toolInput field",{toolInput:t.toolInput});if(!t.status||typeof t.status!="object")throw new Fe("INVALID_TOOL_STATUS","Tool invocation must have a status field",{status:t.status});break}case"thinking":{if(typeof t.content!="string")throw new Fe("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 Fe("INVALID_USAGE","Usage content must have an inputTokens field that is a number",{inputTokens:t.inputTokens});if(typeof t.outputTokens!="number")throw new Fe("INVALID_USAGE","Usage content must have an outputTokens field that is a number",{outputTokens:t.outputTokens});if(typeof t.totalTokens!="number")throw new Fe("INVALID_USAGE","Usage content must have a totalTokens field that is a number",{totalTokens:t.totalTokens});if(typeof t.totalCostUsd!="number")throw new Fe("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 Fe("INVALID_ERROR","Error content must have a code field that is a string",{code:t.code});if(typeof t.message!="string")throw new Fe("INVALID_ERROR","Error content must have a message field that is a string",{message:t.message});break}default:throw new Fe("UNKNOWN_CONTENT_TYPE",`Unknown content type: ${n}. Must be one of: text, tool_invocation, thinking, usage, error`,{type:n})}}function Z8(e){if(!e||typeof e!="object")throw new Fe("INVALID_MESSAGE","Message must be an object",{message:e});const t=e;if(typeof t.id!="string"||t.id.length===0)throw new Fe("INVALID_MESSAGE_ID","Message must have a non-empty id field",{id:t.id});if(typeof t.role!="string")throw new Fe("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 Fe("INVALID_ROLE_VALUE",`Role must be one of: ${n.join(", ")}`,{role:t.role});if(typeof t.conversationId!="string"||t.conversationId.length===0)throw new Fe("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 Fe("INVALID_TIMESTAMP","Message must have a non-empty timestamp field",{timestamp:t.timestamp});if(!Array.isArray(t.parts))throw new Fe("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{IN(t.parts[i])}catch(r){throw r instanceof Fe?new Fe(r.code,`Invalid content at parts[${i}]: ${r.message}`,V(L({},r.context),{partIndex:i})):r}if(t.isStreaming!==void 0&&typeof t.isStreaming!="boolean")throw new Fe("INVALID_STREAMING_FLAG","isStreaming must be a boolean",{isStreaming:t.isStreaming})}function J8(e){if(!e||typeof e!="object")throw new Fe("INVALID_SDK_STATUS","SDK status must be an object",{status:e});const t=e;if(typeof t.sdkAvailable!="boolean")throw new Fe("INVALID_SDK_AVAILABLE","sdkAvailable must be a boolean",{sdkAvailable:t.sdkAvailable});if(t.sdkVersion!==null&&typeof t.sdkVersion!="string")throw new Fe("INVALID_SDK_VERSION","sdkVersion must be a string or null",{sdkVersion:t.sdkVersion});if(t.errorMessage!==null&&typeof t.errorMessage!="string")throw new Fe("INVALID_ERROR_MESSAGE","errorMessage must be a string or null",{errorMessage:t.errorMessage})}function W8(e){if(e!==null&&(typeof e!="string"||e.length===0))throw new Fe("INVALID_CONVERSATION_ID","Conversation ID must be a non-empty string or null",{id:e})}function e9(e){if(e!==null&&typeof e!="string")throw new Fe("INVALID_ERROR_MESSAGE","Error message must be a string or null",{error:e})}function t9(e){if(!e||typeof e!="object")throw new Fe("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 Fe("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 Fe("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 Fe("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 Fe("INVALID_TIMESTAMP_UPDATE","Updated timestamp must be a string",{timestamp:t.timestamp});if(t.isStreaming!==void 0&&typeof t.isStreaming!="boolean")throw new Fe("INVALID_STREAMING_UPDATE","Updated isStreaming must be a boolean",{isStreaming:t.isStreaming});if(t.parts!==void 0)throw new Fe("INVALID_PARTS_UPDATE","Parts cannot be directly updated - use appendPart or appendTextContent instead",{parts:t.parts})}function n9(e){if(!e||typeof e!="object")throw new Fe("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 Fe("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 Fe("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 Fe("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 Fe("INVALID_STATUS_STATE",`Updated status state must be one of: ${i.join(", ")}`,{state:n.state})}}const Kn=Od((e,t)=>({messages:[],activeConversationId:null,isStreaming:!1,sdkStatus:null,error:null,setActiveConversationId:n=>{W8(n),e({activeConversationId:n})},setStreaming:n=>{if(typeof n!="boolean")throw new Fe("INVALID_STREAMING_FLAG","isStreaming must be a boolean",{isStreaming:n});e({isStreaming:n})},setSdkStatus:n=>{n!==null&&J8(n),e({sdkStatus:n})},setError:n=>{e9(n),e({error:n})},reset:()=>e({messages:[],activeConversationId:null,isStreaming:!1,sdkStatus:null,error:null}),addMessage:n=>{Z8(n);const r=t();if(r.messages.length>=1e3)throw new Fe("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(l=>({messages:[...l.messages,n]}))},updateMessage:(n,i)=>{if(cd(n),t9(i),!t().messages.some(o=>o.id===n))throw new Fe("MESSAGE_NOT_FOUND",`Message with id "${n}" not found`,{id:n});e(o=>({messages:o.messages.map(u=>u.id===n?L(L({},u),i):u)}))},deleteMessage:n=>{cd(n),e(i=>({messages:i.messages.filter(r=>r.id!==n)}))},appendPart:(n,i)=>{cd(n),IN(i);const o=t().messages.find(u=>u.id===n);if(!o)throw new Fe("MESSAGE_NOT_FOUND",`Message with id "${n}" not found`,{messageId:n});if(o.parts.length>=500)throw new Fe("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(f=>{if(f.id===n){const m=V(L({},i),{timestamp:i.timestamp&&i.timestamp.length>0?i.timestamp:new Date().toISOString()});return V(L({},f),{parts:[...f.parts,m]})}return f})}))},appendTextContent:(n,i)=>{if(cd(n),typeof i!="string")throw new Fe("INVALID_TEXT_CONTENT","Content must be a string",{content:i});const o=t().messages.find(m=>m.id===n);if(!o)throw new Fe("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 Fe("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(L({},p),{content:p.content+i}),V(L({},g),{parts:x})}const y={type:"text",content:i,timestamp:new Date().toISOString()};return V(L({},g),{parts:[...g.parts,y]})}return g})}))},updateToolInvocation:(n,i)=>{if(typeof n!="string"||n.length===0)throw new Fe("INVALID_TOOL_USE_ID","toolUseId must be a non-empty string",{toolUseId:n});n9(i);const r=t();let l=!1;for(const o of r.messages){for(const u of o.parts)if(u.type==="tool_invocation"&&"toolUseId"in u&&u.toolUseId===n){l=!0;break}if(l)break}if(!l)throw new Fe("TOOL_NOT_FOUND",`Tool invocation with toolUseId "${n}" not found`,{toolUseId:n});e(o=>({messages:o.messages.map(u=>V(L({},u),{parts:u.parts.map(f=>f.type==="tool_invocation"&&"toolUseId"in f&&f.toolUseId===n?L(L({},f),i):f)}))}))},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]}})),a9="modulepreload",i9=function(e){return"/"+e},h_={},s9=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]"),f=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));r=o(n.map(m=>{if(m=i9(m),m in h_)return;h_[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":a9,g||(y.as="script"),y.crossOrigin="",y.href=m,f&&y.setAttribute("nonce",f),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 l(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"&&l(u.reason);return t().catch(l)})},Bt={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 be=(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))(be||{}),or=(e=>(e.LOW="low",e.MEDIUM="medium",e.HIGH="high",e.CRITICAL="critical",e))(or||{}),Ea=(e=>(e.RETRY="retry",e.EXPONENTIAL_BACKOFF="exponential_backoff",e.FALLBACK="fallback",e.USER_ACTION="user_action",e.RELOAD="reload",e.NONE="none",e))(Ea||{});const mn={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 r9(e,t,n,i){const r=Date.now(),l=n==null?void 0:n.stack,o=`${t} ${(n==null?void 0:n.message)||""}`.toLowerCase(),u=l9(o,n),f=o9(u,i),m=c9(u),g=u9(u,o),p=d9(u,g),y=g&&f9(u),x=p9(u,t),_=y9(i,u);return{errorId:e,message:t,originalError:n,category:u,severity:f,isExpectedFailure:m,isTransient:g,recoveryStrategy:p,canRetry:y,maxRetryAttempts:h9(u),retryDelayMs:m9(u),context:i,userFacingMessage:x,devMessage:g9(u,t,n),timestamp:r,stackTrace:l,affectedFeatures:_}}function l9(e,t){return t instanceof TypeError?be.TYPE_ERROR:t instanceof SyntaxError?be.PARSE_ERROR:t instanceof RangeError?be.RESOURCE_EXHAUSTED:mn.network.test(e)?mn.networkDetail.timeout.test(e)?be.TIMEOUT:(mn.networkDetail.dns.test(e),be.NETWORK_ERROR):mn.timeout.test(e)?be.TIMEOUT:mn.unauthorized.test(e)?be.UNAUTHORIZED:mn.notFound.test(e)?be.NOT_FOUND:mn.rateLimited.test(e)?be.RATE_LIMITED:mn.conflict.test(e)?be.CONFLICT:mn.serverError.test(e)?be.EXTERNAL_SERVICE_ERROR:mn.assertionFailed.test(e)?be.ASSERTION_FAILED:mn.validation.test(e)&&!mn.invalidState.test(e)&&!mn.assertionFailed.test(e)?be.VALIDATION_ERROR:mn.invalidState.test(e)?be.INVALID_STATE:mn.parseError.test(e)?be.PARSE_ERROR:mn.typeError.test(e)?be.TYPE_ERROR:mn.resourceExhausted.test(e)?be.RESOURCE_EXHAUSTED:mn.externalService.test(e)?be.EXTERNAL_SERVICE_ERROR:be.INTERNAL_ERROR}function o9(e,t){return t!=null&&t.isCritical||e===be.ASSERTION_FAILED||e===be.INVALID_STATE||e===be.NULL_REFERENCE||e===be.TYPE_ERROR?or.CRITICAL:e===be.UNAUTHORIZED||e===be.NETWORK_ERROR||e===be.TIMEOUT||e===be.EXTERNAL_SERVICE_ERROR?or.HIGH:e===be.VALIDATION_ERROR||e===be.NOT_FOUND||e===be.PARSE_ERROR||e===be.CONFLICT?or.MEDIUM:e===be.RATE_LIMITED||e===be.RESOURCE_EXHAUSTED?or.LOW:or.MEDIUM}function c9(e){return[be.VALIDATION_ERROR,be.NOT_FOUND,be.NETWORK_ERROR,be.TIMEOUT,be.UNAUTHORIZED,be.RATE_LIMITED,be.RESOURCE_EXHAUSTED,be.CONFLICT,be.EXTERNAL_SERVICE_ERROR,be.PARSE_ERROR].includes(e)}function u9(e,t){const n=[be.NETWORK_ERROR,be.TIMEOUT,be.RATE_LIMITED,be.EXTERNAL_SERVICE_ERROR];return e===be.RESOURCE_EXHAUSTED?!t.includes("permanent")&&!t.includes("quota"):n.includes(e)}function d9(e,t){return e===be.ASSERTION_FAILED||e===be.INVALID_STATE||e===be.NOT_IMPLEMENTED||e===be.TYPE_ERROR||e===be.NULL_REFERENCE||e===be.LOGIC_ERROR?Ea.NONE:e===be.NETWORK_ERROR&&t||e===be.TIMEOUT&&t||e===be.EXTERNAL_SERVICE_ERROR&&t||e===be.RATE_LIMITED?Ea.EXPONENTIAL_BACKOFF:e===be.UNAUTHORIZED||e===be.VALIDATION_ERROR||e===be.NOT_FOUND?Ea.USER_ACTION:e===be.CONFLICT?Ea.FALLBACK:(e===be.PARSE_ERROR,Ea.NONE)}function f9(e){return[be.NETWORK_ERROR,be.TIMEOUT,be.RATE_LIMITED,be.EXTERNAL_SERVICE_ERROR,be.RESOURCE_EXHAUSTED].includes(e)}function h9(e){switch(e){case be.NETWORK_ERROR:case be.TIMEOUT:return 3;case be.EXTERNAL_SERVICE_ERROR:return 2;case be.RATE_LIMITED:return 1;case be.RESOURCE_EXHAUSTED:return 2;default:return}}function m9(e){switch(e){case be.NETWORK_ERROR:return 500;case be.TIMEOUT:return 1e3;case be.EXTERNAL_SERVICE_ERROR:return 1e3;case be.RATE_LIMITED:return 5e3;case be.RESOURCE_EXHAUSTED:return 2e3;default:return}}function p9(e,t){switch(e){case be.NETWORK_ERROR:return"Network connection failed. Please check your internet connection.";case be.TIMEOUT:return"The operation took too long. Please try again.";case be.UNAUTHORIZED:return"Your session has expired. Please log in again.";case be.NOT_FOUND:return"The requested resource was not found.";case be.RATE_LIMITED:return"Too many requests. Please wait before trying again.";case be.RESOURCE_EXHAUSTED:return"System resources are temporarily exhausted. Please try again.";case be.VALIDATION_ERROR:return`Invalid input: ${t}`;case be.CONFLICT:return"This resource has been modified by someone else. Please refresh and try again.";case be.EXTERNAL_SERVICE_ERROR:return"External service is temporarily unavailable. Please try again.";case be.PARSE_ERROR:return"Unable to process the response. Please try again or contact support.";case be.ASSERTION_FAILED:case be.INVALID_STATE:case be.TYPE_ERROR:case be.NULL_REFERENCE:case be.INTERNAL_ERROR:return"An unexpected error occurred. Please refresh the page or contact support.";default:return"An error occurred. Please try again."}}function g9(e,t,n){var l;return[`[${((l=Object.entries(be).find(([,o])=>o===e))==null?void 0:l[0])||"UNKNOWN"}] ${t}`,n!=null&&n.message?`Original: ${n.message}`:""].filter(Boolean).join(" | ")}function y9(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===be.NETWORK_ERROR?n.push("data_sync","websocket","api_calls"):t===be.EXTERNAL_SERVICE_ERROR&&n.push("export","integrations"),[...new Set(n)]}function $t(e,t,n,i){const r=new Date().toISOString(),l=r9(e,t,i,n),o={errorId:e,message:t,timestamp:r,context:n||{},category:l.category,severity:l.severity,isExpectedFailure:l.isExpectedFailure,isTransient:l.isTransient,recoveryStrategy:l.recoveryStrategy,canRetry:l.canRetry,affectedFeatures:l.affectedFeatures};if(typeof window!="undefined")try{const u=window.__SENTRY__;if(u&&u.captureException){const f=i||new Error(t);f.errorId=e,f.context=n,f.category=l.category,f.severity=l.severity,f.isExpectedFailure=l.isExpectedFailure,f.isTransient=l.isTransient,f.recoveryStrategy=l.recoveryStrategy,u.setTag("error_id",e),u.setTag("error_category",l.category),u.setTag("error_severity",l.severity),u.setTag("is_expected",String(l.isExpectedFailure)),u.setTag("is_transient",String(l.isTransient)),u.captureException(f)}}catch(u){console.warn("[ErrorTracker] Failed to capture error in Sentry:",u instanceof Error?u.message:String(u),{errorId:e,message:t})}if(e!==Bt.SESSION_STORAGE_PARSE_ERROR&&typeof sessionStorage!="undefined")try{const u="app:error_log",f=sessionStorage.getItem(u),m=f?JSON.parse(f):[];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 l}function nc(e,t){const n=new Date().toISOString();if(console.warn(e),typeof sessionStorage!="undefined")try{const i="app:warning_log",r=sessionStorage.getItem(i),l=r?JSON.parse(r):[];l.push({message:e,timestamp:n,context:t||{}}),l.length>50&&l.shift(),sessionStorage.setItem(i,JSON.stringify(l))}catch(i){console.warn("[ErrorTracker] Failed to store warning log in session storage:",i instanceof Error?i.message:String(i),{message:e})}}class fy extends Error{constructor(t,n,i){super(i),this.code=t,this.rpcError=n,this.name="JsonRpcErrorResult",Object.setPrototypeOf(this,fy.prototype)}}class v9{constructor(){Tt(this,"pendingRequests",new Map);Tt(this,"notificationHandlers",new Map);Tt(this,"requestTimeout",3e4);Tt(this,"requestIdCounter",1);Tt(this,"messageListenerAttached",!1);Tt(this,"messageListenerAttachmentInProgress",!1);Tt(this,"cachedWebSocketClient",null);this.ensureMessageListenerAttached()}getWebSocketClient(){return Qe(this,null,function*(){if(this.cachedWebSocketClient)return this.cachedWebSocketClient;try{const t=yield s9(()=>Promise.resolve().then(()=>H9),void 0);return this.cachedWebSocketClient=t.websocketClient,this.cachedWebSocketClient}catch(t){throw $t(Bt.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 Qe(this,null,function*(){if(!this.messageListenerAttached&&!this.messageListenerAttachmentInProgress){this.messageListenerAttachmentInProgress=!0;try{(yield this.getWebSocketClient()).on("message",n=>{try{if(!this.isValidJsonRpcMessage(n)){$t(Bt.JSONRPC_MESSAGE_PARSE_FAILED,"Invalid JSON-RPC message structure - missing required fields",{message:String(n)});return}this.handleMessage(n)}catch(i){i instanceof TypeError?$t(Bt.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))):$t(Bt.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){$t(Bt.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=>{$t(Bt.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 Qe(this,null,function*(){const r=this.generateRequestId(),l={jsonrpc:"2.0",method:t,id:r};return n&&(l.params=n),new Promise((o,u)=>{const f=i!=null?i:this.requestTimeout,m=setTimeout(()=>{this.pendingRequests.delete(r),u(new Error(`JSON-RPC request timeout for method '${t}' after ${f}ms`))},f);this.pendingRequests.set(r,{id:r,method:t,resolve:g=>o(g),reject:u,timeout:m}),this._sendRequestMessage(l,r,m,u)})})}sendNotification(t,n){const i=L({jsonrpc:"2.0",method:t},n&&{params:n});this._sendNotificationMessage(i,t)}_sendRequestMessage(t,n,i,r){return Qe(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";$t(Bt.JSONRPC_SEND_REQUEST_FAILED,u,{method:t.method}),r(new Error(u))}}catch(l){this.pendingRequests.delete(n),clearTimeout(i);const o=`Failed to send JSON-RPC request: ${l instanceof Error?l.message:"Unknown error"}`;$t(Bt.JSONRPC_SEND_REQUEST_FAILED,o,{error:l instanceof Error?l.message:String(l),method:t.method}),r(new Error(o))}})}_sendNotificationMessage(t,n){return Qe(this,null,function*(){try{(yield this.getWebSocketClient()).send(t)||$t(Bt.JSONRPC_SEND_NOTIFICATION_FAILED,`Failed to send notification for method '${n}': WebSocket not connected`,{method:n})}catch(i){$t(Bt.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.`;$t(Bt.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){nc("Received notification without method");return}const r=this.notificationHandlers.get(n);!r||r.size===0||r.forEach(l=>{try{const o=l(i!=null?i:{});o&&typeof o.then=="function"&&o.catch(u=>{$t(Bt.JSONRPC_NOTIFICATION_HANDLER_ERROR,`Error in notification handler for '${n}'`,{error:u instanceof Error?u.message:String(u),method:n})})}catch(o){$t(Bt.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 fy(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,l="result"in n,o="error"in n;return i&&(l||o)?l&&!o||!l&&o:!!(r&&!i)}}const xs=new v9;function x9(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 b9{constructor(){Tt(this,"currentConversationId",null);Tt(this,"currentRequestId",null);this.setupNotificationHandlers()}setupNotificationHandlers(){xs.onNotification("chat.response.chunk",t=>{this.handleResponseChunk(t)}),xs.onNotification("chat.tool.invoke",t=>{this.handleToolInvoke(t)}),xs.onNotification("chat.thinking",t=>{this.handleThinking(t)}),xs.onNotification("chat.usage",t=>{this.handleUsage(t)}),xs.onNotification("chat.error",t=>{this.handleError(t)})}getStatus(){return Qe(this,null,function*(){var t,n,i,r,l,o;try{const u=yield xs.sendRequest("chat.status",{}),f={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=(l=u.errorMessage)!=null?l:u.error_message)!=null?o:null};return Kn.getState().setSdkStatus(f),f}catch(u){const f=u instanceof Error?u.message:"Unknown error";$t(Bt.CHAT_GET_STATUS_FAILED,"Failed to get status",{error:f});const m={sdkAvailable:!1,sdkVersion:null,errorMessage:f};throw Kn.getState().setSdkStatus(m),u}})}sendMessage(t){return Qe(this,null,function*(){if(!t.trim())throw new Error("Message cannot be empty");const n=Kn.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 l=this.generateMessageId(),o={id:l,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 xs.sendRequest("chat.send",{message:t},6e4);return n.updateMessage(l,{isStreaming:!1}),n.setStreaming(!1),u}catch(u){n.setStreaming(!1);const f=u instanceof Error?u.message:"Unknown error";throw n.setError(f),$t(Bt.CHAT_SEND_FAILED,"Failed to send message",{error:f,message:t}),n.appendPart(l,{type:"error",code:"SEND_FAILED",message:f,timestamp:new Date().toISOString()}),u}})}cancelMessage(){return Qe(this,null,function*(){const t=Kn.getState();try{const n=yield xs.sendRequest("chat.cancel",{},5e3);return t.setStreaming(!1),n}catch(n){const i=n instanceof Error?n.message:"Unknown error";throw $t(Bt.CHAT_CANCEL_FAILED,"Failed to cancel",{error:i}),t.setStreaming(!1),n}})}handleResponseChunk(t){const n=Kn.getState(),i=n.getCurrentStreamingMessage();if(!i){nc("Received response chunk but no streaming message");return}n.appendTextContent(i.id,t.content)}handleToolInvoke(t){const n=Kn.getState(),i=n.getCurrentStreamingMessage();if(!i){nc("Received tool invoke but no streaming message");return}const r=x9(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=Kn.getState(),i=n.getCurrentStreamingMessage();if(!i){nc("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=Kn.getState(),i=n.getCurrentStreamingMessage();if(!i){nc("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=Kn.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,Kn.getState().reset()}}const _9=new b9;function S9(e){return e==="user"?"user":"bot"}function w9(e){return e==="user"?"You":"DrBot"}function N9(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function C9(e){switch(e.state){case"executing":return"running";case"completed":return"success";case"failed":return"error";default:return"running"}}function m_(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch(t){return String(e)}}function E9(e){var i;const t=[],n=(i=e.toolInput)!=null?i:{};for(const[r,l]of Object.entries(n))t.push({key:r,value:m_(l)});return e.status.state==="completed"&&e.status.result!==void 0?t.push({key:"result",value:m_(e.status.result)}):e.status.state==="failed"&&t.push({key:"error",value:e.status.error}),t}function j9(e){return{name:e.toolName,status:C9(e.status),output:E9(e)}}function k9(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 T9(e){var g,p;const t=S9(e.role),n=w9(e.role),i=N9(e.timestamp),r=!!e.isStreaming,l=[];let o=0,u=null;const f=(y={})=>L({id:`${e.id}:${o++}`,role:t,senderName:n,timestamp:i,body:"",bodyKind:"markdown",isStreaming:r},y),m=()=>{u&&(l.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=f({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(),l.push(f({thinkingBlock:x})));break}case"tool_invocation":{const x=j9(y);u&&u.bodyKind==="markdown"&&!u.toolBlock?(u.toolBlock=x,m()):(m(),l.push(f({toolBlock:x})));break}case"error":{m(),l.push(f({body:y.message,bodyKind:"error",isStreaming:!1}));break}case"usage":{m(),l.push(f({body:k9(y),bodyKind:"usage",isStreaming:!1}));break}}return m(),l.length===0&&l.push(f({})),l}function R9(e){const t=[];for(const n of e)t.push(...T9(n));return t}const ip=["What does this element do?","Show cross-layer references","Any unresolved references?","Explain the data-model layer"];function M9({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(Yw,{content:e.body,isStreaming:e.isStreaming})}function A9(){const e=Se(T=>T.view),t=Se(T=>T.layerId),n=Se(T=>T.selectedId),i=Se(T=>T.changesetId),r=Kn(T=>T.messages),l=Kn(T=>T.isStreaming),o=Kn(T=>T.error),{derived:u}=$i(),{derived:f}=Ac(),m=k.useMemo(()=>nf(u),[u]),g=e==="model"&&n?m.byUuid.get(n):void 0,p=g==null?void 0:g.name,y=t?Da(t):"",x=k.useMemo(()=>{if(e==="changesets"){const T=f.list.find(D=>D.id===i);return T?T.name:"changesets"}return p||(y?`${y} layer`:"meta-model")},[e,f.list,i,p,y]),_=k.useMemo(()=>p?[`What does ${p} do?`,"Show cross-layer references","Any unresolved references?",y?`Explain the ${y} layer`:ip[3]]:y?[...ip.slice(0,3),`Explain the ${y} layer`]:ip,[p,y]),S=k.useMemo(()=>R9(r),[r]),[w,N]=k.useState(""),R=T=>{const D=T.trim();!D||l||(N(""),_9.sendMessage(D).catch(()=>{}))},C=r.length<=1,E=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(US,{suggestions:_,onSelect:T=>R(T)})}),d.jsx("div",{style:{flex:"none",padding:"0 8px 10px 8px"},children:d.jsx(FS,{value:w,onChange:N,onSubmit:T=>R(T),scopeLabel:x,placeholder:"Ask about the model…",loading:l})})]});return d.jsx($S,{composer:E,children:S.map(T=>d.jsx(IS,{role:T.role,senderName:T.senderName,timestamp:T.timestamp,body:d.jsx(M9,{row:T}),toolBlock:T.toolBlock,thinkingBlock:T.thinkingBlock},T.id))})}const p_={width:372,flex:"none",background:"rgb(var(--canvas-bg))",display:"flex",flexDirection:"column",minHeight:0,borderLeft:"1px solid rgb(var(--canvas-border))"},L9={position:"absolute",right:0,top:0,bottom:0,zIndex:30,boxShadow:"-16px 0 44px -22px rgba(0,0,0,0.5)"};function D9(){const e=Se(i=>i.chatOpen),t=Se(i=>i.wide);if(!e)return null;const n=t?p_:L(L({},p_),L9);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(A9,{})})})]})}const ud="data-model",O9="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 I9(){k.useEffect(()=>{var i;const e=Kn.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:O9,timestamp:t}]};e.addMessage(n)},[])}function z9(){const e=Se(g=>g.view),t=Se(g=>g.layerId),n=Se(g=>g.changesetId),i=Se(g=>g.navigateToElement),r=Se(g=>g.navigateToSpecNode),l=Se(g=>g.selectChangeset),{derived:o}=$i(),{derived:u,raw:f}=Hi(),{derived:m}=Ac();k.useEffect(()=>{var g,p,y;if(e==="changesets"){if(n)return;const x=m.list[0];x&&l(x.id);return}if(!t){if(e==="model"){if(o.nodes.length===0)return;const x=(g=o.nodesByLayer[ud])!=null&&g.length?ud: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[ud])!=null&&y.typeCount?ud:mN.find(S=>{var w;return(w=u.byLayer[S])==null?void 0:w.typeCount});if(!x)return;const _=Nz(f,x);_&&r(_,x)}}},[e,t,n,o,u,f,m,i,r,l])}function B9(){const t=Se(n=>n.view)==="changesets";return z9(),I9(),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(XI,{}),d.jsxs("div",{style:{flex:1,display:"flex",minHeight:0,position:"relative"},children:[d.jsx(pz,{}),t?d.jsx(X8,{}):d.jsx(G8,{}),t&&d.jsx(Q8,{}),d.jsx(D9,{})]}),d.jsx(gz,{})]})}const U9=0,bs=1,F9=2,$9=3;class zN{constructor(t,n=null){Tt(this,"ws",null);Tt(this,"url");Tt(this,"token",null);Tt(this,"reconnectAttempts",0);Tt(this,"maxReconnectAttempts",10);Tt(this,"reconnectDelay",1e3);Tt(this,"maxReconnectDelay",3e4);Tt(this,"reconnectTimer",null);Tt(this,"heartbeatTimer",null);Tt(this,"heartbeatInterval",3e4);Tt(this,"eventHandlers",new Map);Tt(this,"isIntentionallyClosed",!1);Tt(this,"subscribedTopics",[]);Tt(this,"mode","detecting");Tt(this,"connectionTimeout",null);Tt(this,"maxConnectionAttempts",3);Tt(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===bs){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!==bs&&(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)))):($t(Bt.WS_CONNECTION_ERROR,"WebSocket connection error",{error:t instanceof Error?t.message:String(t)}),this.scheduleReconnect())}}getConnectionErrors(){return[...this.connectionErrors]}isTestEnvironment(){return Wp()}triggerCloseForTesting(){this.isTestEnvironment()&&(this.ws&&this.ws.readyState===bs?(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,$t(Bt.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===bs&&this.send({type:"subscribe",topics:t})}send(t){var n;if(this.ws&&this.ws.readyState===bs)try{return this.ws.send(JSON.stringify(t)),!0}catch(i){return $t(Bt.WS_SEND_FAILED,"Failed to send WebSocket message",{error:i instanceof Error?i.message:String(i),message:t}),!1}else return $t(Bt.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===bs}get connectionState(){if(!this.ws)return this.reconnectTimer?"reconnecting":"disconnected";switch(this.ws.readyState){case U9:return"connecting";case bs:return"connected";case F9:case $9: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){$t(Bt.WS_MESSAGE_PARSE_FAILED,"Failed to parse WebSocket message",{error:i instanceof Error?i.message:String(i),data:t.data})}}handleError(t){const n=Wp();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):$t(Bt.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){$t(Bt.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===bs&&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(l){$t(Bt.WS_EVENT_HANDLER_ERROR,`Error in WebSocket event handler for '${t}'`,{error:l instanceof Error?l.message:String(l),event:t})}})}}function Wp(){return typeof window=="undefined"?!1:!!(window.__PLAYWRIGHT__||window.__STORYBOOK_MOCK_WEBSOCKET__||window.__karma__||window.jasmine||window.jest)}let on;if(typeof window!="undefined"){const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;on=new zN(t,null)}else{const e=new Map;on={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:()=>($t(Bt.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"&&Wp()&&(window.__WEBSOCKET_CLIENT__=on);const H9=Object.freeze(Object.defineProperty({__proto__:null,WebSocketClient:zN,get websocketClient(){return on}},Symbol.toStringTag,{value:"Module"}));function P9(){const e=vg(g=>g.token),t=tc(g=>g.setConnected),n=tc(g=>g.setDisconnected),i=tc(g=>g.setReconnecting),r=tc(g=>g.setError),l=k.useCallback(()=>{console.log("[RootShell] WebSocket connected"),t(),on.transportMode==="websocket"&&on.subscribe(["model","changesets","annotations"])},[t]),o=k.useCallback(()=>{console.log("[RootShell] Using REST mode"),t()},[t]),u=k.useCallback(()=>{console.log("[RootShell] WebSocket disconnected"),n()},[n]),f=k.useCallback(g=>{i(g.attempt,g.delay)},[i]),m=k.useCallback(g=>{const p=g.kind==="event"?g.error:`${g.code}: ${g.message}`;console.error("[RootShell] WebSocket error:",p),r("Connection error")},[r]);return k.useEffect(()=>(console.log("[RootShell] Initializing WebSocket connection"),e&&(console.log("[RootShell] Setting authentication token for WebSocket"),on.setToken(e)),on.on("connect",l),on.on("disconnect",u),on.on("reconnecting",f),on.on("error",m),on.on("rest-mode",o),on.connect(),()=>{on.off("connect",l),on.off("disconnect",u),on.off("reconnecting",f),on.off("error",m),on.off("rest-mode",o),on.disconnect()}),[e,l,u,f,m,o]),d.jsx(J_,{})}const q9={model:"model",spec:"spec",changesets:"changesets"},V9={model:"model",spec:"spec",changesets:"changesets"},G9={model:"graph",spec:"graph",changesets:"list"};function g_(e,t,n,i){return`${e!=null?e:""}|${t!=null?t:""}|${n!=null?n:""}|${i!=null?i:""}`}function K9(){const{section:e}=Ud({strict:!1}),t=kc({strict:!1}),n=Se(N=>N.view),i=Se(N=>N.setView),r=Se(N=>N.layerId),l=Se(N=>N.selectedId),o=Se(N=>N.selectedEdgeId),u=Se(N=>N.changesetId),f=Se(N=>N.selectLayer),m=Se(N=>N.selectNode),g=Se(N=>N.selectEdge),p=Se(N=>N.selectChangeset),{derived:y,isSuccess:x}=$i(),_=k.useRef(!1),S=k.useRef(n),w=k.useRef(g_(r,l,o,u));return k.useEffect(()=>{const N=e?q9[e]:void 0;N&&i(N)},[e,i]),k.useEffect(()=>{if(t.changeset&&t.changeset!==u){p(t.changeset);return}if(t.layer&&t.layer!==r&&f(t.layer),t.edge&&t.edge!==o){if(!x)return;y.links.some(N=>N.id===t.edge)?g(t.edge):eg.navigate({to:".",search:N=>V(L({},N),{edge:void 0}),replace:!0})}else t.node&&t.node!==l&&m(t.node)},[t.layer,t.node,t.edge,t.changeset,x,y.links]),k.useEffect(()=>{const N=g_(r,l,o,u);if(!_.current){_.current=!0,S.current=n,w.current=N;return}const R=S.current!==n,C=w.current!==N;if(!R&&!C)return;S.current=n,w.current=N;const E=V9[n],T=e!==E;!T&&!C||eg.navigate({to:"/$section/$view",params:{section:E,view:G9[E]},search:n==="changesets"?{changeset:u!=null?u:void 0}:{layer:r!=null?r:void 0,node:l!=null?l:void 0,edge:o!=null?o:void 0},replace:!T})},[n,r,l,o,u,e]),d.jsx(B9,{})}const hy=Rk({component:P9}),Y9=fg({getParentRoute:()=>hy,path:"/",validateSearch:e=>({token:typeof e.token=="string"?e.token:void 0}),component:DT}),X9=fg({getParentRoute:()=>hy,path:"/$section/$view",validateSearch:e=>({layer:typeof e.layer=="string"?e.layer:void 0,node:typeof e.node=="string"?e.node:void 0,edge:typeof e.edge=="string"?e.edge:void 0,changeset:typeof e.changeset=="string"?e.changeset:void 0}),component:K9}),Q9=hy.addChildren([Y9,X9]),eg=Bk({routeTree:Q9,history:cj()}),Z9=new URLSearchParams(window.location.search),sp=Z9.get("token");if(sp){console.log("[main] Found token in URL query string, storing to localStorage"),localStorage.setItem("dr_auth_token",sp),vg.getState().setToken(sp),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")}CT();const BN=document.getElementById("root");if(!BN)throw new Error("Root element not found");const J9=AT();tj.createRoot(BN).render(d.jsx(re.StrictMode,{children:d.jsx(fT,{client:J9,children:d.jsx($k,{router:eg})})}))});export default W9();
|