@neuroverseos/nv-sim 0.1.9 → 0.1.11
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 +187 -535
- package/connectors/nv_mirofish_wrapper.py +841 -0
- package/connectors/nv_scienceclaw_wrapper.py +453 -0
- package/dist/adapters/scienceclaw.js +52 -2
- package/dist/assets/index-CH_VswRM.css +1 -0
- package/dist/assets/index-sT4b_z7w.js +686 -0
- package/dist/assets/{reportEngine-D2ZrMny8.js → reportEngine-Bu8bB5Yq.js} +1 -1
- package/dist/connectors/nv-scienceclaw-post.js +363 -0
- package/dist/engine/aiProvider.js +82 -3
- package/dist/engine/analyzer.js +12 -24
- package/dist/engine/cli.js +89 -114
- package/dist/engine/dynamicsGovernance.js +4 -0
- package/dist/engine/fullGovernedLoop.js +16 -1
- package/dist/engine/goalEngine.js +3 -4
- package/dist/engine/governance.js +18 -0
- package/dist/engine/index.js +19 -28
- package/dist/engine/intentTranslator.js +281 -0
- package/dist/engine/liveAdapter.js +100 -18
- package/dist/engine/liveVisualizer.js +2071 -1023
- package/dist/engine/primeRadiant.js +2 -8
- package/dist/engine/reasoningEngine.js +2 -7
- package/dist/engine/scenarioCapsule.js +5 -5
- package/dist/engine/swarmSimulation.js +1 -9
- package/dist/engine/universalAdapter.js +371 -0
- package/dist/engine/worldBridge.js +22 -8
- package/dist/index.html +2 -2
- package/dist/lib/reasoningEngine.js +17 -1
- package/dist/lib/simulationAdapter.js +11 -11
- package/dist/lib/swarmParser.js +1 -1
- package/dist/runtime/govern.js +160 -7
- package/dist/runtime/index.js +1 -4
- package/dist/runtime/types.js +91 -0
- package/package.json +23 -6
- package/dist/adapters/mirofish.js +0 -461
- package/dist/assets/index-B64NuIXu.css +0 -1
- package/dist/assets/index-BMkPevVr.js +0 -532
- package/dist/assets/mirotir-logo-DUexumBH.svg +0 -185
- package/dist/engine/mirofish.js +0 -295
|
@@ -1,532 +0,0 @@
|
|
|
1
|
-
var i1=Object.defineProperty;var Mm=e=>{throw TypeError(e)};var o1=(e,t,n)=>t in e?i1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Gt=(e,t,n)=>o1(e,typeof t!="symbol"?t+"":t,n),yc=(e,t,n)=>t.has(e)||Mm("Cannot "+n);var M=(e,t,n)=>(yc(e,t,"read from private field"),n?n.call(e):t.get(e)),ue=(e,t,n)=>t.has(e)?Mm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ne=(e,t,n,r)=>(yc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ze=(e,t,n)=>(yc(e,t,"access private method"),n);var Vo=(e,t,n,r)=>({set _(s){ne(e,t,s,n)},get _(){return M(e,t,r)}});function a1(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function wg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sg={exports:{}},wl={},Ng={exports:{}},ae={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its 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 jo=Symbol.for("react.element"),l1=Symbol.for("react.portal"),c1=Symbol.for("react.fragment"),d1=Symbol.for("react.strict_mode"),u1=Symbol.for("react.profiler"),f1=Symbol.for("react.provider"),m1=Symbol.for("react.context"),p1=Symbol.for("react.forward_ref"),h1=Symbol.for("react.suspense"),g1=Symbol.for("react.memo"),v1=Symbol.for("react.lazy"),Om=Symbol.iterator;function x1(e){return e===null||typeof e!="object"?null:(e=Om&&e[Om]||e["@@iterator"],typeof e=="function"?e:null)}var kg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},jg=Object.assign,Cg={};function fi(e,t,n){this.props=e,this.context=t,this.refs=Cg,this.updater=n||kg}fi.prototype.isReactComponent={};fi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};fi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Eg(){}Eg.prototype=fi.prototype;function Vu(e,t,n){this.props=e,this.context=t,this.refs=Cg,this.updater=n||kg}var Uu=Vu.prototype=new Eg;Uu.constructor=Vu;jg(Uu,fi.prototype);Uu.isPureReactComponent=!0;var Lm=Array.isArray,_g=Object.prototype.hasOwnProperty,Wu={current:null},Rg={key:!0,ref:!0,__self:!0,__source:!0};function Pg(e,t,n){var r,s={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)_g.call(t,r)&&!Rg.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:jo,type:e,key:i,ref:a,props:s,_owner:Wu.current}}function y1(e,t){return{$$typeof:jo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Hu(e){return typeof e=="object"&&e!==null&&e.$$typeof===jo}function b1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $m=/\/+/g;function bc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?b1(""+e.key):t.toString(36)}function ga(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case jo:case l1:a=!0}}if(a)return a=e,s=s(a),e=r===""?"."+bc(a,0):r,Lm(s)?(n="",e!=null&&(n=e.replace($m,"$&/")+"/"),ga(s,t,n,"",function(d){return d})):s!=null&&(Hu(s)&&(s=y1(s,n+(!s.key||a&&a.key===s.key?"":(""+s.key).replace($m,"$&/")+"/")+e)),t.push(s)),1;if(a=0,r=r===""?".":r+":",Lm(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+bc(i,l);a+=ga(i,t,n,c,s)}else if(c=x1(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+bc(i,l++),a+=ga(i,t,n,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Uo(e,t,n){if(e==null)return e;var r=[],s=0;return ga(e,r,"","",function(i){return t.call(n,i,s++)}),r}function w1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var dt={current:null},va={transition:null},S1={ReactCurrentDispatcher:dt,ReactCurrentBatchConfig:va,ReactCurrentOwner:Wu};function Tg(){throw Error("act(...) is not supported in production builds of React.")}ae.Children={map:Uo,forEach:function(e,t,n){Uo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Uo(e,function(){t++}),t},toArray:function(e){return Uo(e,function(t){return t})||[]},only:function(e){if(!Hu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Component=fi;ae.Fragment=c1;ae.Profiler=u1;ae.PureComponent=Vu;ae.StrictMode=d1;ae.Suspense=h1;ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=S1;ae.act=Tg;ae.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=jg({},e.props),s=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=Wu.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)_g.call(t,c)&&!Rg.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];r.children=l}return{$$typeof:jo,type:e.type,key:s,ref:i,props:r,_owner:a}};ae.createContext=function(e){return e={$$typeof:m1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:f1,_context:e},e.Consumer=e};ae.createElement=Pg;ae.createFactory=function(e){var t=Pg.bind(null,e);return t.type=e,t};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:p1,render:e}};ae.isValidElement=Hu;ae.lazy=function(e){return{$$typeof:v1,_payload:{_status:-1,_result:e},_init:w1}};ae.memo=function(e,t){return{$$typeof:g1,type:e,compare:t===void 0?null:t}};ae.startTransition=function(e){var t=va.transition;va.transition={};try{e()}finally{va.transition=t}};ae.unstable_act=Tg;ae.useCallback=function(e,t){return dt.current.useCallback(e,t)};ae.useContext=function(e){return dt.current.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e){return dt.current.useDeferredValue(e)};ae.useEffect=function(e,t){return dt.current.useEffect(e,t)};ae.useId=function(){return dt.current.useId()};ae.useImperativeHandle=function(e,t,n){return dt.current.useImperativeHandle(e,t,n)};ae.useInsertionEffect=function(e,t){return dt.current.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return dt.current.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return dt.current.useMemo(e,t)};ae.useReducer=function(e,t,n){return dt.current.useReducer(e,t,n)};ae.useRef=function(e){return dt.current.useRef(e)};ae.useState=function(e){return dt.current.useState(e)};ae.useSyncExternalStore=function(e,t,n){return dt.current.useSyncExternalStore(e,t,n)};ae.useTransition=function(){return dt.current.useTransition()};ae.version="18.3.1";Ng.exports=ae;var h=Ng.exports;const U=wg(h),Gu=a1({__proto__:null,default:U},[h]);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its 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 N1=h,k1=Symbol.for("react.element"),j1=Symbol.for("react.fragment"),C1=Object.prototype.hasOwnProperty,E1=N1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_1={key:!0,ref:!0,__self:!0,__source:!0};function Ag(e,t,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)C1.call(t,r)&&!_1.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:k1,type:e,key:i,ref:a,props:s,_owner:E1.current}}wl.Fragment=j1;wl.jsx=Ag;wl.jsxs=Ag;Sg.exports=wl;var o=Sg.exports,Ig={exports:{}},Rt={},Mg={exports:{}},Og={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its 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
|
-
*/(function(e){function t(_,A){var D=_.length;_.push(A);e:for(;0<D;){var Y=D-1>>>1,G=_[Y];if(0<s(G,A))_[Y]=A,_[D]=G,D=Y;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var A=_[0],D=_.pop();if(D!==A){_[0]=D;e:for(var Y=0,G=_.length,J=G>>>1;Y<J;){var Z=2*(Y+1)-1,me=_[Z],be=Z+1,W=_[be];if(0>s(me,D))be<G&&0>s(W,me)?(_[Y]=W,_[be]=D,Y=be):(_[Y]=me,_[Z]=D,Y=Z);else if(be<G&&0>s(W,D))_[Y]=W,_[be]=D,Y=be;else break e}}return A}function s(_,A){var D=_.sortIndex-A.sortIndex;return D!==0?D:_.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],d=[],u=1,f=null,p=3,m=!1,y=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(_){for(var A=n(d);A!==null;){if(A.callback===null)r(d);else if(A.startTime<=_)r(d),A.sortIndex=A.expirationTime,t(c,A);else break;A=n(d)}}function S(_){if(g=!1,w(_),!y)if(n(c)!==null)y=!0,O(N);else{var A=n(d);A!==null&&V(S,A.startTime-_)}}function N(_,A){y=!1,g&&(g=!1,x(C),C=-1),m=!0;var D=p;try{for(w(A),f=n(c);f!==null&&(!(f.expirationTime>A)||_&&!P());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,p=f.priorityLevel;var G=Y(f.expirationTime<=A);A=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(c)&&r(c),w(A)}else r(c);f=n(c)}if(f!==null)var J=!0;else{var Z=n(d);Z!==null&&V(S,Z.startTime-A),J=!1}return J}finally{f=null,p=D,m=!1}}var k=!1,j=null,C=-1,E=5,R=-1;function P(){return!(e.unstable_now()-R<E)}function T(){if(j!==null){var _=e.unstable_now();R=_;var A=!0;try{A=j(!0,_)}finally{A?L():(k=!1,j=null)}}else k=!1}var L;if(typeof v=="function")L=function(){v(T)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,F=I.port2;I.port1.onmessage=T,L=function(){F.postMessage(null)}}else L=function(){b(T,0)};function O(_){j=_,k||(k=!0,L())}function V(_,A){C=b(function(){_(e.unstable_now())},A)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(_){_.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,O(N))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(_){switch(p){case 1:case 2:case 3:var A=3;break;default:A=p}var D=p;p=A;try{return _()}finally{p=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,A){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var D=p;p=_;try{return A()}finally{p=D}},e.unstable_scheduleCallback=function(_,A,D){var Y=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?Y+D:Y):D=Y,_){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=D+G,_={id:u++,callback:A,priorityLevel:_,startTime:D,expirationTime:G,sortIndex:-1},D>Y?(_.sortIndex=D,t(d,_),n(c)===null&&_===n(d)&&(g?(x(C),C=-1):g=!0,V(S,D-Y))):(_.sortIndex=G,t(c,_),y||m||(y=!0,O(N))),_},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(_){var A=p;return function(){var D=p;p=A;try{return _.apply(this,arguments)}finally{p=D}}}})(Og);Mg.exports=Og;var R1=Mg.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var P1=h,_t=R1;function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Lg=new Set,Xi={};function cs(e,t){ei(e,t),ei(e+"Capture",t)}function ei(e,t){for(Xi[e]=t,e=0;e<t.length;e++)Lg.add(t[e])}var Fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hd=Object.prototype.hasOwnProperty,T1=/^[: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]*$/,Dm={},Fm={};function A1(e){return hd.call(Fm,e)?!0:hd.call(Dm,e)?!1:T1.test(e)?Fm[e]=!0:(Dm[e]=!0,!1)}function I1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function M1(e,t,n,r){if(t===null||typeof t>"u"||I1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ut(e,t,n,r,s,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Qe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qe[e]=new ut(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qe[t]=new ut(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qe[e]=new ut(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qe[e]=new ut(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Qe[e]=new ut(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qe[e]=new ut(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qe[e]=new ut(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qe[e]=new ut(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qe[e]=new ut(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ku=/[\-:]([a-z])/g;function Yu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ku,Yu);Qe[t]=new ut(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ku,Yu);Qe[t]=new ut(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ku,Yu);Qe[t]=new ut(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qe[e]=new ut(e,1,!1,e.toLowerCase(),null,!1,!1)});Qe.xlinkHref=new ut("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qe[e]=new ut(e,1,!1,e.toLowerCase(),null,!0,!0)});function qu(e,t,n,r){var s=Qe.hasOwnProperty(t)?Qe[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(M1(t,n,s,r)&&(n=null),r||s===null?A1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Gn=P1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Wo=Symbol.for("react.element"),ws=Symbol.for("react.portal"),Ss=Symbol.for("react.fragment"),Qu=Symbol.for("react.strict_mode"),gd=Symbol.for("react.profiler"),$g=Symbol.for("react.provider"),Dg=Symbol.for("react.context"),Xu=Symbol.for("react.forward_ref"),vd=Symbol.for("react.suspense"),xd=Symbol.for("react.suspense_list"),Ju=Symbol.for("react.memo"),nr=Symbol.for("react.lazy"),Fg=Symbol.for("react.offscreen"),zm=Symbol.iterator;function bi(e){return e===null||typeof e!="object"?null:(e=zm&&e[zm]||e["@@iterator"],typeof e=="function"?e:null)}var Me=Object.assign,wc;function Ai(e){if(wc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);wc=t&&t[1]||""}return`
|
|
34
|
-
`+wc+e}var Sc=!1;function Nc(e,t){if(!e||Sc)return"";Sc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var s=d.stack.split(`
|
|
35
|
-
`),i=r.stack.split(`
|
|
36
|
-
`),a=s.length-1,l=i.length-1;1<=a&&0<=l&&s[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(s[a]!==i[l]){if(a!==1||l!==1)do if(a--,l--,0>l||s[a]!==i[l]){var c=`
|
|
37
|
-
`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Sc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ai(e):""}function O1(e){switch(e.tag){case 5:return Ai(e.type);case 16:return Ai("Lazy");case 13:return Ai("Suspense");case 19:return Ai("SuspenseList");case 0:case 2:case 15:return e=Nc(e.type,!1),e;case 11:return e=Nc(e.type.render,!1),e;case 1:return e=Nc(e.type,!0),e;default:return""}}function yd(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ss:return"Fragment";case ws:return"Portal";case gd:return"Profiler";case Qu:return"StrictMode";case vd:return"Suspense";case xd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Dg:return(e.displayName||"Context")+".Consumer";case $g:return(e._context.displayName||"Context")+".Provider";case Xu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ju:return t=e.displayName||null,t!==null?t:yd(e.type)||"Memo";case nr:t=e._payload,e=e._init;try{return yd(e(t))}catch{}}return null}function L1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return yd(t);case 8:return t===Qu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Sr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $1(e){var t=zg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ho(e){e._valueTracker||(e._valueTracker=$1(e))}function Bg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=zg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Oa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function bd(e,t){var n=t.checked;return Me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Bm(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Sr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vg(e,t){t=t.checked,t!=null&&qu(e,"checked",t,!1)}function wd(e,t){Vg(e,t);var n=Sr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Sd(e,t.type,n):t.hasOwnProperty("defaultValue")&&Sd(e,t.type,Sr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vm(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Sd(e,t,n){(t!=="number"||Oa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ii=Array.isArray;function Is(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Sr(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Nd(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return Me({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Um(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(Ii(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Sr(n)}}function Ug(e,t){var n=Sr(t.value),r=Sr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Wm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Wg(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function kd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Wg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Go,Hg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Go=Go||document.createElement("div"),Go.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Go.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ji(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Di={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},D1=["Webkit","ms","Moz","O"];Object.keys(Di).forEach(function(e){D1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Di[t]=Di[e]})});function Gg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Di.hasOwnProperty(e)&&Di[e]?(""+t).trim():t+"px"}function Kg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Gg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var F1=Me({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function jd(e,t){if(t){if(F1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function Cd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 Ed=null;function Zu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _d=null,Ms=null,Os=null;function Hm(e){if(e=_o(e)){if(typeof _d!="function")throw Error(B(280));var t=e.stateNode;t&&(t=Cl(t),_d(e.stateNode,e.type,t))}}function Yg(e){Ms?Os?Os.push(e):Os=[e]:Ms=e}function qg(){if(Ms){var e=Ms,t=Os;if(Os=Ms=null,Hm(e),t)for(e=0;e<t.length;e++)Hm(t[e])}}function Qg(e,t){return e(t)}function Xg(){}var kc=!1;function Jg(e,t,n){if(kc)return e(t,n);kc=!0;try{return Qg(e,t,n)}finally{kc=!1,(Ms!==null||Os!==null)&&(Xg(),qg())}}function Zi(e,t){var n=e.stateNode;if(n===null)return null;var r=Cl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(B(231,t,typeof n));return n}var Rd=!1;if(Fn)try{var wi={};Object.defineProperty(wi,"passive",{get:function(){Rd=!0}}),window.addEventListener("test",wi,wi),window.removeEventListener("test",wi,wi)}catch{Rd=!1}function z1(e,t,n,r,s,i,a,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(u){this.onError(u)}}var Fi=!1,La=null,$a=!1,Pd=null,B1={onError:function(e){Fi=!0,La=e}};function V1(e,t,n,r,s,i,a,l,c){Fi=!1,La=null,z1.apply(B1,arguments)}function U1(e,t,n,r,s,i,a,l,c){if(V1.apply(this,arguments),Fi){if(Fi){var d=La;Fi=!1,La=null}else throw Error(B(198));$a||($a=!0,Pd=d)}}function ds(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Zg(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Gm(e){if(ds(e)!==e)throw Error(B(188))}function W1(e){var t=e.alternate;if(!t){if(t=ds(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Gm(s),e;if(i===r)return Gm(s),t;i=i.sibling}throw Error(B(188))}if(n.return!==r.return)n=s,r=i;else{for(var a=!1,l=s.child;l;){if(l===n){a=!0,n=s,r=i;break}if(l===r){a=!0,r=s,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,r=s;break}if(l===r){a=!0,r=i,n=s;break}l=l.sibling}if(!a)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function ev(e){return e=W1(e),e!==null?tv(e):null}function tv(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=tv(e);if(t!==null)return t;e=e.sibling}return null}var nv=_t.unstable_scheduleCallback,Km=_t.unstable_cancelCallback,H1=_t.unstable_shouldYield,G1=_t.unstable_requestPaint,$e=_t.unstable_now,K1=_t.unstable_getCurrentPriorityLevel,ef=_t.unstable_ImmediatePriority,rv=_t.unstable_UserBlockingPriority,Da=_t.unstable_NormalPriority,Y1=_t.unstable_LowPriority,sv=_t.unstable_IdlePriority,Sl=null,Sn=null;function q1(e){if(Sn&&typeof Sn.onCommitFiberRoot=="function")try{Sn.onCommitFiberRoot(Sl,e,void 0,(e.current.flags&128)===128)}catch{}}var nn=Math.clz32?Math.clz32:J1,Q1=Math.log,X1=Math.LN2;function J1(e){return e>>>=0,e===0?32:31-(Q1(e)/X1|0)|0}var Ko=64,Yo=4194304;function Mi(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~s;l!==0?r=Mi(l):(i&=a,i!==0&&(r=Mi(i)))}else a=n&~s,a!==0?r=Mi(a):i!==0&&(r=Mi(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-nn(t),s=1<<n,r|=e[n],t&=~s;return r}function Z1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function eS(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-nn(i),l=1<<a,c=s[a];c===-1?(!(l&n)||l&r)&&(s[a]=Z1(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Td(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function iv(){var e=Ko;return Ko<<=1,!(Ko&4194240)&&(Ko=64),e}function jc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Co(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-nn(t),e[t]=n}function tS(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-nn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function tf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-nn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var pe=0;function ov(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var av,nf,lv,cv,dv,Ad=!1,qo=[],pr=null,hr=null,gr=null,eo=new Map,to=new Map,sr=[],nS="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 submit".split(" ");function Ym(e,t){switch(e){case"focusin":case"focusout":pr=null;break;case"dragenter":case"dragleave":hr=null;break;case"mouseover":case"mouseout":gr=null;break;case"pointerover":case"pointerout":eo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":to.delete(t.pointerId)}}function Si(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=_o(t),t!==null&&nf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function rS(e,t,n,r,s){switch(t){case"focusin":return pr=Si(pr,e,t,n,r,s),!0;case"dragenter":return hr=Si(hr,e,t,n,r,s),!0;case"mouseover":return gr=Si(gr,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return eo.set(i,Si(eo.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,to.set(i,Si(to.get(i)||null,e,t,n,r,s)),!0}return!1}function uv(e){var t=Dr(e.target);if(t!==null){var n=ds(t);if(n!==null){if(t=n.tag,t===13){if(t=Zg(n),t!==null){e.blockedOn=t,dv(e.priority,function(){lv(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function xa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Id(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ed=r,n.target.dispatchEvent(r),Ed=null}else return t=_o(n),t!==null&&nf(t),e.blockedOn=n,!1;t.shift()}return!0}function qm(e,t,n){xa(e)&&n.delete(t)}function sS(){Ad=!1,pr!==null&&xa(pr)&&(pr=null),hr!==null&&xa(hr)&&(hr=null),gr!==null&&xa(gr)&&(gr=null),eo.forEach(qm),to.forEach(qm)}function Ni(e,t){e.blockedOn===t&&(e.blockedOn=null,Ad||(Ad=!0,_t.unstable_scheduleCallback(_t.unstable_NormalPriority,sS)))}function no(e){function t(s){return Ni(s,e)}if(0<qo.length){Ni(qo[0],e);for(var n=1;n<qo.length;n++){var r=qo[n];r.blockedOn===e&&(r.blockedOn=null)}}for(pr!==null&&Ni(pr,e),hr!==null&&Ni(hr,e),gr!==null&&Ni(gr,e),eo.forEach(t),to.forEach(t),n=0;n<sr.length;n++)r=sr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<sr.length&&(n=sr[0],n.blockedOn===null);)uv(n),n.blockedOn===null&&sr.shift()}var Ls=Gn.ReactCurrentBatchConfig,za=!0;function iS(e,t,n,r){var s=pe,i=Ls.transition;Ls.transition=null;try{pe=1,rf(e,t,n,r)}finally{pe=s,Ls.transition=i}}function oS(e,t,n,r){var s=pe,i=Ls.transition;Ls.transition=null;try{pe=4,rf(e,t,n,r)}finally{pe=s,Ls.transition=i}}function rf(e,t,n,r){if(za){var s=Id(e,t,n,r);if(s===null)Oc(e,t,r,Ba,n),Ym(e,r);else if(rS(s,e,t,n,r))r.stopPropagation();else if(Ym(e,r),t&4&&-1<nS.indexOf(e)){for(;s!==null;){var i=_o(s);if(i!==null&&av(i),i=Id(e,t,n,r),i===null&&Oc(e,t,r,Ba,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Oc(e,t,r,null,n)}}var Ba=null;function Id(e,t,n,r){if(Ba=null,e=Zu(r),e=Dr(e),e!==null)if(t=ds(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Zg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ba=e,null}function fv(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(K1()){case ef:return 1;case rv:return 4;case Da:case Y1:return 16;case sv:return 536870912;default:return 16}default:return 16}}var ur=null,sf=null,ya=null;function mv(){if(ya)return ya;var e,t=sf,n=t.length,r,s="value"in ur?ur.value:ur.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===s[i-r];r++);return ya=s.slice(e,1<r?1-r:void 0)}function ba(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Qo(){return!0}function Qm(){return!1}function Pt(e){function t(n,r,s,i,a){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Qo:Qm,this.isPropagationStopped=Qm,this}return Me(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Qo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Qo)},persist:function(){},isPersistent:Qo}),t}var mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},of=Pt(mi),Eo=Me({},mi,{view:0,detail:0}),aS=Pt(Eo),Cc,Ec,ki,Nl=Me({},Eo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:af,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ki&&(ki&&e.type==="mousemove"?(Cc=e.screenX-ki.screenX,Ec=e.screenY-ki.screenY):Ec=Cc=0,ki=e),Cc)},movementY:function(e){return"movementY"in e?e.movementY:Ec}}),Xm=Pt(Nl),lS=Me({},Nl,{dataTransfer:0}),cS=Pt(lS),dS=Me({},Eo,{relatedTarget:0}),_c=Pt(dS),uS=Me({},mi,{animationName:0,elapsedTime:0,pseudoElement:0}),fS=Pt(uS),mS=Me({},mi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pS=Pt(mS),hS=Me({},mi,{data:0}),Jm=Pt(hS),gS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vS={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"},xS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xS[e])?!!t[e]:!1}function af(){return yS}var bS=Me({},Eo,{key:function(e){if(e.key){var t=gS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ba(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:af,charCode:function(e){return e.type==="keypress"?ba(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ba(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),wS=Pt(bS),SS=Me({},Nl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zm=Pt(SS),NS=Me({},Eo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:af}),kS=Pt(NS),jS=Me({},mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),CS=Pt(jS),ES=Me({},Nl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),_S=Pt(ES),RS=[9,13,27,32],lf=Fn&&"CompositionEvent"in window,zi=null;Fn&&"documentMode"in document&&(zi=document.documentMode);var PS=Fn&&"TextEvent"in window&&!zi,pv=Fn&&(!lf||zi&&8<zi&&11>=zi),ep=" ",tp=!1;function hv(e,t){switch(e){case"keyup":return RS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ns=!1;function TS(e,t){switch(e){case"compositionend":return gv(t);case"keypress":return t.which!==32?null:(tp=!0,ep);case"textInput":return e=t.data,e===ep&&tp?null:e;default:return null}}function AS(e,t){if(Ns)return e==="compositionend"||!lf&&hv(e,t)?(e=mv(),ya=sf=ur=null,Ns=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return pv&&t.locale!=="ko"?null:t.data;default:return null}}var IS={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 np(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!IS[e.type]:t==="textarea"}function vv(e,t,n,r){Yg(r),t=Va(t,"onChange"),0<t.length&&(n=new of("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bi=null,ro=null;function MS(e){_v(e,0)}function kl(e){var t=Cs(e);if(Bg(t))return e}function OS(e,t){if(e==="change")return t}var xv=!1;if(Fn){var Rc;if(Fn){var Pc="oninput"in document;if(!Pc){var rp=document.createElement("div");rp.setAttribute("oninput","return;"),Pc=typeof rp.oninput=="function"}Rc=Pc}else Rc=!1;xv=Rc&&(!document.documentMode||9<document.documentMode)}function sp(){Bi&&(Bi.detachEvent("onpropertychange",yv),ro=Bi=null)}function yv(e){if(e.propertyName==="value"&&kl(ro)){var t=[];vv(t,ro,e,Zu(e)),Jg(MS,t)}}function LS(e,t,n){e==="focusin"?(sp(),Bi=t,ro=n,Bi.attachEvent("onpropertychange",yv)):e==="focusout"&&sp()}function $S(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kl(ro)}function DS(e,t){if(e==="click")return kl(t)}function FS(e,t){if(e==="input"||e==="change")return kl(t)}function zS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sn=typeof Object.is=="function"?Object.is:zS;function so(e,t){if(sn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!hd.call(t,s)||!sn(e[s],t[s]))return!1}return!0}function ip(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function op(e,t){var n=ip(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ip(n)}}function bv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wv(){for(var e=window,t=Oa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Oa(e.document)}return t}function cf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function BS(e){var t=wv(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&bv(n.ownerDocument.documentElement,n)){if(r!==null&&cf(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=op(n,i);var a=op(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var VS=Fn&&"documentMode"in document&&11>=document.documentMode,ks=null,Md=null,Vi=null,Od=!1;function ap(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Od||ks==null||ks!==Oa(r)||(r=ks,"selectionStart"in r&&cf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Vi&&so(Vi,r)||(Vi=r,r=Va(Md,"onSelect"),0<r.length&&(t=new of("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ks)))}function Xo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var js={animationend:Xo("Animation","AnimationEnd"),animationiteration:Xo("Animation","AnimationIteration"),animationstart:Xo("Animation","AnimationStart"),transitionend:Xo("Transition","TransitionEnd")},Tc={},Sv={};Fn&&(Sv=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function jl(e){if(Tc[e])return Tc[e];if(!js[e])return e;var t=js[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Sv)return Tc[e]=t[n];return e}var Nv=jl("animationend"),kv=jl("animationiteration"),jv=jl("animationstart"),Cv=jl("transitionend"),Ev=new Map,lp="abort auxClick 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(" ");function Er(e,t){Ev.set(e,t),cs(t,[e])}for(var Ac=0;Ac<lp.length;Ac++){var Ic=lp[Ac],US=Ic.toLowerCase(),WS=Ic[0].toUpperCase()+Ic.slice(1);Er(US,"on"+WS)}Er(Nv,"onAnimationEnd");Er(kv,"onAnimationIteration");Er(jv,"onAnimationStart");Er("dblclick","onDoubleClick");Er("focusin","onFocus");Er("focusout","onBlur");Er(Cv,"onTransitionEnd");ei("onMouseEnter",["mouseout","mouseover"]);ei("onMouseLeave",["mouseout","mouseover"]);ei("onPointerEnter",["pointerout","pointerover"]);ei("onPointerLeave",["pointerout","pointerover"]);cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));cs("onBeforeInput",["compositionend","keypress","textInput","paste"]);cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oi="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(" "),HS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oi));function cp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,U1(r,t,void 0,e),e.currentTarget=null}function _v(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var l=r[a],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==i&&s.isPropagationStopped())break e;cp(s,l,d),i=c}else for(a=0;a<r.length;a++){if(l=r[a],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&s.isPropagationStopped())break e;cp(s,l,d),i=c}}}if($a)throw e=Pd,$a=!1,Pd=null,e}function je(e,t){var n=t[zd];n===void 0&&(n=t[zd]=new Set);var r=e+"__bubble";n.has(r)||(Rv(t,e,2,!1),n.add(r))}function Mc(e,t,n){var r=0;t&&(r|=4),Rv(n,e,r,t)}var Jo="_reactListening"+Math.random().toString(36).slice(2);function io(e){if(!e[Jo]){e[Jo]=!0,Lg.forEach(function(n){n!=="selectionchange"&&(HS.has(n)||Mc(n,!1,e),Mc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jo]||(t[Jo]=!0,Mc("selectionchange",!1,t))}}function Rv(e,t,n,r){switch(fv(t)){case 1:var s=iS;break;case 4:s=oS;break;default:s=rf}n=s.bind(null,t,n,e),s=void 0,!Rd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Oc(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;a=a.return}for(;l!==null;){if(a=Dr(l),a===null)return;if(c=a.tag,c===5||c===6){r=i=a;continue e}l=l.parentNode}}r=r.return}Jg(function(){var d=i,u=Zu(n),f=[];e:{var p=Ev.get(e);if(p!==void 0){var m=of,y=e;switch(e){case"keypress":if(ba(n)===0)break e;case"keydown":case"keyup":m=wS;break;case"focusin":y="focus",m=_c;break;case"focusout":y="blur",m=_c;break;case"beforeblur":case"afterblur":m=_c;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Xm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=cS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=kS;break;case Nv:case kv:case jv:m=fS;break;case Cv:m=CS;break;case"scroll":m=aS;break;case"wheel":m=_S;break;case"copy":case"cut":case"paste":m=pS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Zm}var g=(t&4)!==0,b=!g&&e==="scroll",x=g?p!==null?p+"Capture":null:p;g=[];for(var v=d,w;v!==null;){w=v;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,x!==null&&(S=Zi(v,x),S!=null&&g.push(oo(v,S,w)))),b)break;v=v.return}0<g.length&&(p=new m(p,y,null,n,u),f.push({event:p,listeners:g}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&n!==Ed&&(y=n.relatedTarget||n.fromElement)&&(Dr(y)||y[zn]))break e;if((m||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,m?(y=n.relatedTarget||n.toElement,m=d,y=y?Dr(y):null,y!==null&&(b=ds(y),y!==b||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=d),m!==y)){if(g=Xm,S="onMouseLeave",x="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=Zm,S="onPointerLeave",x="onPointerEnter",v="pointer"),b=m==null?p:Cs(m),w=y==null?p:Cs(y),p=new g(S,v+"leave",m,n,u),p.target=b,p.relatedTarget=w,S=null,Dr(u)===d&&(g=new g(x,v+"enter",y,n,u),g.target=w,g.relatedTarget=b,S=g),b=S,m&&y)t:{for(g=m,x=y,v=0,w=g;w;w=gs(w))v++;for(w=0,S=x;S;S=gs(S))w++;for(;0<v-w;)g=gs(g),v--;for(;0<w-v;)x=gs(x),w--;for(;v--;){if(g===x||x!==null&&g===x.alternate)break t;g=gs(g),x=gs(x)}g=null}else g=null;m!==null&&dp(f,p,m,g,!1),y!==null&&b!==null&&dp(f,b,y,g,!0)}}e:{if(p=d?Cs(d):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var N=OS;else if(np(p))if(xv)N=FS;else{N=$S;var k=LS}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(N=DS);if(N&&(N=N(e,d))){vv(f,N,n,u);break e}k&&k(e,p,d),e==="focusout"&&(k=p._wrapperState)&&k.controlled&&p.type==="number"&&Sd(p,"number",p.value)}switch(k=d?Cs(d):window,e){case"focusin":(np(k)||k.contentEditable==="true")&&(ks=k,Md=d,Vi=null);break;case"focusout":Vi=Md=ks=null;break;case"mousedown":Od=!0;break;case"contextmenu":case"mouseup":case"dragend":Od=!1,ap(f,n,u);break;case"selectionchange":if(VS)break;case"keydown":case"keyup":ap(f,n,u)}var j;if(lf)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Ns?hv(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(pv&&n.locale!=="ko"&&(Ns||C!=="onCompositionStart"?C==="onCompositionEnd"&&Ns&&(j=mv()):(ur=u,sf="value"in ur?ur.value:ur.textContent,Ns=!0)),k=Va(d,C),0<k.length&&(C=new Jm(C,e,null,n,u),f.push({event:C,listeners:k}),j?C.data=j:(j=gv(n),j!==null&&(C.data=j)))),(j=PS?TS(e,n):AS(e,n))&&(d=Va(d,"onBeforeInput"),0<d.length&&(u=new Jm("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:d}),u.data=j))}_v(f,t)})}function oo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Va(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Zi(e,n),i!=null&&r.unshift(oo(e,i,s)),i=Zi(e,t),i!=null&&r.push(oo(e,i,s))),e=e.return}return r}function gs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function dp(e,t,n,r,s){for(var i=t._reactName,a=[];n!==null&&n!==r;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&d!==null&&(l=d,s?(c=Zi(n,i),c!=null&&a.unshift(oo(n,c,l))):s||(c=Zi(n,i),c!=null&&a.push(oo(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var GS=/\r\n?/g,KS=/\u0000|\uFFFD/g;function up(e){return(typeof e=="string"?e:""+e).replace(GS,`
|
|
38
|
-
`).replace(KS,"")}function Zo(e,t,n){if(t=up(t),up(e)!==t&&n)throw Error(B(425))}function Ua(){}var Ld=null,$d=null;function Dd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Fd=typeof setTimeout=="function"?setTimeout:void 0,YS=typeof clearTimeout=="function"?clearTimeout:void 0,fp=typeof Promise=="function"?Promise:void 0,qS=typeof queueMicrotask=="function"?queueMicrotask:typeof fp<"u"?function(e){return fp.resolve(null).then(e).catch(QS)}:Fd;function QS(e){setTimeout(function(){throw e})}function Lc(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),no(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);no(t)}function vr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function mp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var pi=Math.random().toString(36).slice(2),gn="__reactFiber$"+pi,ao="__reactProps$"+pi,zn="__reactContainer$"+pi,zd="__reactEvents$"+pi,XS="__reactListeners$"+pi,JS="__reactHandles$"+pi;function Dr(e){var t=e[gn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[zn]||n[gn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mp(e);e!==null;){if(n=e[gn])return n;e=mp(e)}return t}e=n,n=e.parentNode}return null}function _o(e){return e=e[gn]||e[zn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Cs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function Cl(e){return e[ao]||null}var Bd=[],Es=-1;function _r(e){return{current:e}}function Ce(e){0>Es||(e.current=Bd[Es],Bd[Es]=null,Es--)}function Se(e,t){Es++,Bd[Es]=e.current,e.current=t}var Nr={},it=_r(Nr),vt=_r(!1),Xr=Nr;function ti(e,t){var n=e.type.contextTypes;if(!n)return Nr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function xt(e){return e=e.childContextTypes,e!=null}function Wa(){Ce(vt),Ce(it)}function pp(e,t,n){if(it.current!==Nr)throw Error(B(168));Se(it,t),Se(vt,n)}function Pv(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(B(108,L1(e)||"Unknown",s));return Me({},n,r)}function Ha(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Nr,Xr=it.current,Se(it,e),Se(vt,vt.current),!0}function hp(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=Pv(e,t,Xr),r.__reactInternalMemoizedMergedChildContext=e,Ce(vt),Ce(it),Se(it,e)):Ce(vt),Se(vt,n)}var In=null,El=!1,$c=!1;function Tv(e){In===null?In=[e]:In.push(e)}function ZS(e){El=!0,Tv(e)}function Rr(){if(!$c&&In!==null){$c=!0;var e=0,t=pe;try{var n=In;for(pe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}In=null,El=!1}catch(s){throw In!==null&&(In=In.slice(e+1)),nv(ef,Rr),s}finally{pe=t,$c=!1}}return null}var _s=[],Rs=0,Ga=null,Ka=0,Mt=[],Ot=0,Jr=null,On=1,Ln="";function Lr(e,t){_s[Rs++]=Ka,_s[Rs++]=Ga,Ga=e,Ka=t}function Av(e,t,n){Mt[Ot++]=On,Mt[Ot++]=Ln,Mt[Ot++]=Jr,Jr=e;var r=On;e=Ln;var s=32-nn(r)-1;r&=~(1<<s),n+=1;var i=32-nn(t)+s;if(30<i){var a=s-s%5;i=(r&(1<<a)-1).toString(32),r>>=a,s-=a,On=1<<32-nn(t)+s|n<<s|r,Ln=i+e}else On=1<<i|n<<s|r,Ln=e}function df(e){e.return!==null&&(Lr(e,1),Av(e,1,0))}function uf(e){for(;e===Ga;)Ga=_s[--Rs],_s[Rs]=null,Ka=_s[--Rs],_s[Rs]=null;for(;e===Jr;)Jr=Mt[--Ot],Mt[Ot]=null,Ln=Mt[--Ot],Mt[Ot]=null,On=Mt[--Ot],Mt[Ot]=null}var Ct=null,kt=null,_e=!1,tn=null;function Iv(e,t){var n=Lt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function gp(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ct=e,kt=vr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ct=e,kt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Jr!==null?{id:On,overflow:Ln}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Lt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ct=e,kt=null,!0):!1;default:return!1}}function Vd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ud(e){if(_e){var t=kt;if(t){var n=t;if(!gp(e,t)){if(Vd(e))throw Error(B(418));t=vr(n.nextSibling);var r=Ct;t&&gp(e,t)?Iv(r,n):(e.flags=e.flags&-4097|2,_e=!1,Ct=e)}}else{if(Vd(e))throw Error(B(418));e.flags=e.flags&-4097|2,_e=!1,Ct=e}}}function vp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ct=e}function ea(e){if(e!==Ct)return!1;if(!_e)return vp(e),_e=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Dd(e.type,e.memoizedProps)),t&&(t=kt)){if(Vd(e))throw Mv(),Error(B(418));for(;t;)Iv(e,t),t=vr(t.nextSibling)}if(vp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kt=vr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kt=null}}else kt=Ct?vr(e.stateNode.nextSibling):null;return!0}function Mv(){for(var e=kt;e;)e=vr(e.nextSibling)}function ni(){kt=Ct=null,_e=!1}function ff(e){tn===null?tn=[e]:tn.push(e)}var eN=Gn.ReactCurrentBatchConfig;function ji(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=s.refs;a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function ta(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xp(e){var t=e._init;return t(e._payload)}function Ov(e){function t(x,v){if(e){var w=x.deletions;w===null?(x.deletions=[v],x.flags|=16):w.push(v)}}function n(x,v){if(!e)return null;for(;v!==null;)t(x,v),v=v.sibling;return null}function r(x,v){for(x=new Map;v!==null;)v.key!==null?x.set(v.key,v):x.set(v.index,v),v=v.sibling;return x}function s(x,v){return x=wr(x,v),x.index=0,x.sibling=null,x}function i(x,v,w){return x.index=w,e?(w=x.alternate,w!==null?(w=w.index,w<v?(x.flags|=2,v):w):(x.flags|=2,v)):(x.flags|=1048576,v)}function a(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,v,w,S){return v===null||v.tag!==6?(v=Wc(w,x.mode,S),v.return=x,v):(v=s(v,w),v.return=x,v)}function c(x,v,w,S){var N=w.type;return N===Ss?u(x,v,w.props.children,S,w.key):v!==null&&(v.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===nr&&xp(N)===v.type)?(S=s(v,w.props),S.ref=ji(x,v,w),S.return=x,S):(S=Ea(w.type,w.key,w.props,null,x.mode,S),S.ref=ji(x,v,w),S.return=x,S)}function d(x,v,w,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=Hc(w,x.mode,S),v.return=x,v):(v=s(v,w.children||[]),v.return=x,v)}function u(x,v,w,S,N){return v===null||v.tag!==7?(v=qr(w,x.mode,S,N),v.return=x,v):(v=s(v,w),v.return=x,v)}function f(x,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Wc(""+v,x.mode,w),v.return=x,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Wo:return w=Ea(v.type,v.key,v.props,null,x.mode,w),w.ref=ji(x,null,v),w.return=x,w;case ws:return v=Hc(v,x.mode,w),v.return=x,v;case nr:var S=v._init;return f(x,S(v._payload),w)}if(Ii(v)||bi(v))return v=qr(v,x.mode,w,null),v.return=x,v;ta(x,v)}return null}function p(x,v,w,S){var N=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return N!==null?null:l(x,v,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Wo:return w.key===N?c(x,v,w,S):null;case ws:return w.key===N?d(x,v,w,S):null;case nr:return N=w._init,p(x,v,N(w._payload),S)}if(Ii(w)||bi(w))return N!==null?null:u(x,v,w,S,null);ta(x,w)}return null}function m(x,v,w,S,N){if(typeof S=="string"&&S!==""||typeof S=="number")return x=x.get(w)||null,l(v,x,""+S,N);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Wo:return x=x.get(S.key===null?w:S.key)||null,c(v,x,S,N);case ws:return x=x.get(S.key===null?w:S.key)||null,d(v,x,S,N);case nr:var k=S._init;return m(x,v,w,k(S._payload),N)}if(Ii(S)||bi(S))return x=x.get(w)||null,u(v,x,S,N,null);ta(v,S)}return null}function y(x,v,w,S){for(var N=null,k=null,j=v,C=v=0,E=null;j!==null&&C<w.length;C++){j.index>C?(E=j,j=null):E=j.sibling;var R=p(x,j,w[C],S);if(R===null){j===null&&(j=E);break}e&&j&&R.alternate===null&&t(x,j),v=i(R,v,C),k===null?N=R:k.sibling=R,k=R,j=E}if(C===w.length)return n(x,j),_e&&Lr(x,C),N;if(j===null){for(;C<w.length;C++)j=f(x,w[C],S),j!==null&&(v=i(j,v,C),k===null?N=j:k.sibling=j,k=j);return _e&&Lr(x,C),N}for(j=r(x,j);C<w.length;C++)E=m(j,x,C,w[C],S),E!==null&&(e&&E.alternate!==null&&j.delete(E.key===null?C:E.key),v=i(E,v,C),k===null?N=E:k.sibling=E,k=E);return e&&j.forEach(function(P){return t(x,P)}),_e&&Lr(x,C),N}function g(x,v,w,S){var N=bi(w);if(typeof N!="function")throw Error(B(150));if(w=N.call(w),w==null)throw Error(B(151));for(var k=N=null,j=v,C=v=0,E=null,R=w.next();j!==null&&!R.done;C++,R=w.next()){j.index>C?(E=j,j=null):E=j.sibling;var P=p(x,j,R.value,S);if(P===null){j===null&&(j=E);break}e&&j&&P.alternate===null&&t(x,j),v=i(P,v,C),k===null?N=P:k.sibling=P,k=P,j=E}if(R.done)return n(x,j),_e&&Lr(x,C),N;if(j===null){for(;!R.done;C++,R=w.next())R=f(x,R.value,S),R!==null&&(v=i(R,v,C),k===null?N=R:k.sibling=R,k=R);return _e&&Lr(x,C),N}for(j=r(x,j);!R.done;C++,R=w.next())R=m(j,x,C,R.value,S),R!==null&&(e&&R.alternate!==null&&j.delete(R.key===null?C:R.key),v=i(R,v,C),k===null?N=R:k.sibling=R,k=R);return e&&j.forEach(function(T){return t(x,T)}),_e&&Lr(x,C),N}function b(x,v,w,S){if(typeof w=="object"&&w!==null&&w.type===Ss&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Wo:e:{for(var N=w.key,k=v;k!==null;){if(k.key===N){if(N=w.type,N===Ss){if(k.tag===7){n(x,k.sibling),v=s(k,w.props.children),v.return=x,x=v;break e}}else if(k.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===nr&&xp(N)===k.type){n(x,k.sibling),v=s(k,w.props),v.ref=ji(x,k,w),v.return=x,x=v;break e}n(x,k);break}else t(x,k);k=k.sibling}w.type===Ss?(v=qr(w.props.children,x.mode,S,w.key),v.return=x,x=v):(S=Ea(w.type,w.key,w.props,null,x.mode,S),S.ref=ji(x,v,w),S.return=x,x=S)}return a(x);case ws:e:{for(k=w.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(x,v.sibling),v=s(v,w.children||[]),v.return=x,x=v;break e}else{n(x,v);break}else t(x,v);v=v.sibling}v=Hc(w,x.mode,S),v.return=x,x=v}return a(x);case nr:return k=w._init,b(x,v,k(w._payload),S)}if(Ii(w))return y(x,v,w,S);if(bi(w))return g(x,v,w,S);ta(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(x,v.sibling),v=s(v,w),v.return=x,x=v):(n(x,v),v=Wc(w,x.mode,S),v.return=x,x=v),a(x)):n(x,v)}return b}var ri=Ov(!0),Lv=Ov(!1),Ya=_r(null),qa=null,Ps=null,mf=null;function pf(){mf=Ps=qa=null}function hf(e){var t=Ya.current;Ce(Ya),e._currentValue=t}function Wd(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function $s(e,t){qa=e,mf=Ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ht=!0),e.firstContext=null)}function Dt(e){var t=e._currentValue;if(mf!==e)if(e={context:e,memoizedValue:t,next:null},Ps===null){if(qa===null)throw Error(B(308));Ps=e,qa.dependencies={lanes:0,firstContext:e}}else Ps=Ps.next=e;return t}var Fr=null;function gf(e){Fr===null?Fr=[e]:Fr.push(e)}function $v(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,gf(t)):(n.next=s.next,s.next=n),t.interleaved=n,Bn(e,r)}function Bn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var rr=!1;function vf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Dv(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Dn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Bn(e,n)}return s=r.interleaved,s===null?(t.next=t,gf(r)):(t.next=s.next,s.next=t),r.interleaved=t,Bn(e,n)}function wa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tf(e,n)}}function yp(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Qa(e,t,n,r){var s=e.updateQueue;rr=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,d=c.next;c.next=null,a===null?i=d:a.next=d,a=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==a&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;a=0,u=d=c=null,l=i;do{var p=l.lane,m=l.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,g=l;switch(p=t,m=n,g.tag){case 1:if(y=g.payload,typeof y=="function"){f=y.call(m,f,p);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,p=typeof y=="function"?y.call(m,f,p):y,p==null)break e;f=Me({},f,p);break e;case 2:rr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[l]:p.push(l))}else m={eventTime:m,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=m,c=f):u=u.next=m,a|=p;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;p=l,l=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(u===null&&(c=f),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);es|=a,e.lanes=a,e.memoizedState=f}}function bp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(B(191,s));s.call(r)}}}var Ro={},Nn=_r(Ro),lo=_r(Ro),co=_r(Ro);function zr(e){if(e===Ro)throw Error(B(174));return e}function xf(e,t){switch(Se(co,t),Se(lo,e),Se(Nn,Ro),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:kd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=kd(t,e)}Ce(Nn),Se(Nn,t)}function si(){Ce(Nn),Ce(lo),Ce(co)}function Fv(e){zr(co.current);var t=zr(Nn.current),n=kd(t,e.type);t!==n&&(Se(lo,e),Se(Nn,n))}function yf(e){lo.current===e&&(Ce(Nn),Ce(lo))}var Pe=_r(0);function Xa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Dc=[];function bf(){for(var e=0;e<Dc.length;e++)Dc[e]._workInProgressVersionPrimary=null;Dc.length=0}var Sa=Gn.ReactCurrentDispatcher,Fc=Gn.ReactCurrentBatchConfig,Zr=0,Ie=null,Fe=null,Ge=null,Ja=!1,Ui=!1,uo=0,tN=0;function et(){throw Error(B(321))}function wf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sn(e[n],t[n]))return!1;return!0}function Sf(e,t,n,r,s,i){if(Zr=i,Ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Sa.current=e===null||e.memoizedState===null?iN:oN,e=n(r,s),Ui){i=0;do{if(Ui=!1,uo=0,25<=i)throw Error(B(301));i+=1,Ge=Fe=null,t.updateQueue=null,Sa.current=aN,e=n(r,s)}while(Ui)}if(Sa.current=Za,t=Fe!==null&&Fe.next!==null,Zr=0,Ge=Fe=Ie=null,Ja=!1,t)throw Error(B(300));return e}function Nf(){var e=uo!==0;return uo=0,e}function un(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?Ie.memoizedState=Ge=e:Ge=Ge.next=e,Ge}function Ft(){if(Fe===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=Ge===null?Ie.memoizedState:Ge.next;if(t!==null)Ge=t,Fe=e;else{if(e===null)throw Error(B(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},Ge===null?Ie.memoizedState=Ge=e:Ge=Ge.next=e}return Ge}function fo(e,t){return typeof t=="function"?t(e):t}function zc(e){var t=Ft(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=Fe,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var a=s.next;s.next=i.next,i.next=a}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var l=a=null,c=null,d=i;do{var u=d.lane;if((Zr&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var f={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=f,a=r):c=c.next=f,Ie.lanes|=u,es|=u}d=d.next}while(d!==null&&d!==i);c===null?a=r:c.next=l,sn(r,t.memoizedState)||(ht=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Ie.lanes|=i,es|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Bc(e){var t=Ft(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var a=s=s.next;do i=e(i,a.action),a=a.next;while(a!==s);sn(i,t.memoizedState)||(ht=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function zv(){}function Bv(e,t){var n=Ie,r=Ft(),s=t(),i=!sn(r.memoizedState,s);if(i&&(r.memoizedState=s,ht=!0),r=r.queue,kf(Wv.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ge!==null&&Ge.memoizedState.tag&1){if(n.flags|=2048,mo(9,Uv.bind(null,n,r,s,t),void 0,null),Ke===null)throw Error(B(349));Zr&30||Vv(n,t,s)}return s}function Vv(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uv(e,t,n,r){t.value=n,t.getSnapshot=r,Hv(t)&&Gv(e)}function Wv(e,t,n){return n(function(){Hv(t)&&Gv(e)})}function Hv(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sn(e,n)}catch{return!0}}function Gv(e){var t=Bn(e,1);t!==null&&rn(t,e,1,-1)}function wp(e){var t=un();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fo,lastRenderedState:e},t.queue=e,e=e.dispatch=sN.bind(null,Ie,e),[t.memoizedState,e]}function mo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Kv(){return Ft().memoizedState}function Na(e,t,n,r){var s=un();Ie.flags|=e,s.memoizedState=mo(1|t,n,void 0,r===void 0?null:r)}function _l(e,t,n,r){var s=Ft();r=r===void 0?null:r;var i=void 0;if(Fe!==null){var a=Fe.memoizedState;if(i=a.destroy,r!==null&&wf(r,a.deps)){s.memoizedState=mo(t,n,i,r);return}}Ie.flags|=e,s.memoizedState=mo(1|t,n,i,r)}function Sp(e,t){return Na(8390656,8,e,t)}function kf(e,t){return _l(2048,8,e,t)}function Yv(e,t){return _l(4,2,e,t)}function qv(e,t){return _l(4,4,e,t)}function Qv(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Xv(e,t,n){return n=n!=null?n.concat([e]):null,_l(4,4,Qv.bind(null,t,e),n)}function jf(){}function Jv(e,t){var n=Ft();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zv(e,t){var n=Ft();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ex(e,t,n){return Zr&21?(sn(n,t)||(n=iv(),Ie.lanes|=n,es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ht=!0),e.memoizedState=n)}function nN(e,t){var n=pe;pe=n!==0&&4>n?n:4,e(!0);var r=Fc.transition;Fc.transition={};try{e(!1),t()}finally{pe=n,Fc.transition=r}}function tx(){return Ft().memoizedState}function rN(e,t,n){var r=br(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},nx(e))rx(t,n);else if(n=$v(e,t,n,r),n!==null){var s=ct();rn(n,e,r,s),sx(n,t,r)}}function sN(e,t,n){var r=br(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(nx(e))rx(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(s.hasEagerState=!0,s.eagerState=l,sn(l,a)){var c=t.interleaved;c===null?(s.next=s,gf(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=$v(e,t,s,r),n!==null&&(s=ct(),rn(n,e,r,s),sx(n,t,r))}}function nx(e){var t=e.alternate;return e===Ie||t!==null&&t===Ie}function rx(e,t){Ui=Ja=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tf(e,n)}}var Za={readContext:Dt,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},iN={readContext:Dt,useCallback:function(e,t){return un().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Sp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Na(4194308,4,Qv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Na(4194308,4,e,t)},useInsertionEffect:function(e,t){return Na(4,2,e,t)},useMemo:function(e,t){var n=un();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=un();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=rN.bind(null,Ie,e),[r.memoizedState,e]},useRef:function(e){var t=un();return e={current:e},t.memoizedState=e},useState:wp,useDebugValue:jf,useDeferredValue:function(e){return un().memoizedState=e},useTransition:function(){var e=wp(!1),t=e[0];return e=nN.bind(null,e[1]),un().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ie,s=un();if(_e){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Ke===null)throw Error(B(349));Zr&30||Vv(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Sp(Wv.bind(null,r,i,e),[e]),r.flags|=2048,mo(9,Uv.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=un(),t=Ke.identifierPrefix;if(_e){var n=Ln,r=On;n=(r&~(1<<32-nn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=uo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=tN++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},oN={readContext:Dt,useCallback:Jv,useContext:Dt,useEffect:kf,useImperativeHandle:Xv,useInsertionEffect:Yv,useLayoutEffect:qv,useMemo:Zv,useReducer:zc,useRef:Kv,useState:function(){return zc(fo)},useDebugValue:jf,useDeferredValue:function(e){var t=Ft();return ex(t,Fe.memoizedState,e)},useTransition:function(){var e=zc(fo)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:zv,useSyncExternalStore:Bv,useId:tx,unstable_isNewReconciler:!1},aN={readContext:Dt,useCallback:Jv,useContext:Dt,useEffect:kf,useImperativeHandle:Xv,useInsertionEffect:Yv,useLayoutEffect:qv,useMemo:Zv,useReducer:Bc,useRef:Kv,useState:function(){return Bc(fo)},useDebugValue:jf,useDeferredValue:function(e){var t=Ft();return Fe===null?t.memoizedState=e:ex(t,Fe.memoizedState,e)},useTransition:function(){var e=Bc(fo)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:zv,useSyncExternalStore:Bv,useId:tx,unstable_isNewReconciler:!1};function Qt(e,t){if(e&&e.defaultProps){t=Me({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Hd(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Me({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rl={isMounted:function(e){return(e=e._reactInternals)?ds(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ct(),s=br(e),i=Dn(r,s);i.payload=t,n!=null&&(i.callback=n),t=xr(e,i,s),t!==null&&(rn(t,e,s,r),wa(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ct(),s=br(e),i=Dn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=xr(e,i,s),t!==null&&(rn(t,e,s,r),wa(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ct(),r=br(e),s=Dn(n,r);s.tag=2,t!=null&&(s.callback=t),t=xr(e,s,r),t!==null&&(rn(t,e,r,n),wa(t,e,r))}};function Np(e,t,n,r,s,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!so(n,r)||!so(s,i):!0}function ix(e,t,n){var r=!1,s=Nr,i=t.contextType;return typeof i=="object"&&i!==null?i=Dt(i):(s=xt(t)?Xr:it.current,r=t.contextTypes,i=(r=r!=null)?ti(e,s):Nr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Rl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function kp(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Rl.enqueueReplaceState(t,t.state,null)}function Gd(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},vf(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Dt(i):(i=xt(t)?Xr:it.current,s.context=ti(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Hd(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Rl.enqueueReplaceState(s,s.state,null),Qa(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ii(e,t){try{var n="",r=t;do n+=O1(r),r=r.return;while(r);var s=n}catch(i){s=`
|
|
39
|
-
Error generating stack: `+i.message+`
|
|
40
|
-
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function Vc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Kd(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var lN=typeof WeakMap=="function"?WeakMap:Map;function ox(e,t,n){n=Dn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){tl||(tl=!0,ru=r),Kd(e,t)},n}function ax(e,t,n){n=Dn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Kd(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Kd(e,t),typeof r!="function"&&(yr===null?yr=new Set([this]):yr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function jp(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new lN;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=SN.bind(null,e,t,n),t.then(e,e))}function Cp(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ep(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Dn(-1,1),t.tag=2,xr(n,t,1))),n.lanes|=1),e)}var cN=Gn.ReactCurrentOwner,ht=!1;function at(e,t,n,r){t.child=e===null?Lv(t,null,n,r):ri(t,e.child,n,r)}function _p(e,t,n,r,s){n=n.render;var i=t.ref;return $s(t,s),r=Sf(e,t,n,r,i,s),n=Nf(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Vn(e,t,s)):(_e&&n&&df(t),t.flags|=1,at(e,t,r,s),t.child)}function Rp(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!If(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,lx(e,t,i,r,s)):(e=Ea(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:so,n(a,r)&&e.ref===t.ref)return Vn(e,t,s)}return t.flags|=1,e=wr(i,r),e.ref=t.ref,e.return=t,t.child=e}function lx(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(so(i,r)&&e.ref===t.ref)if(ht=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(ht=!0);else return t.lanes=e.lanes,Vn(e,t,s)}return Yd(e,t,n,r,s)}function cx(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Se(As,St),St|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Se(As,St),St|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Se(As,St),St|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Se(As,St),St|=r;return at(e,t,s,n),t.child}function dx(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Yd(e,t,n,r,s){var i=xt(n)?Xr:it.current;return i=ti(t,i),$s(t,s),n=Sf(e,t,n,r,i,s),r=Nf(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Vn(e,t,s)):(_e&&r&&df(t),t.flags|=1,at(e,t,n,s),t.child)}function Pp(e,t,n,r,s){if(xt(n)){var i=!0;Ha(t)}else i=!1;if($s(t,s),t.stateNode===null)ka(e,t),ix(t,n,r),Gd(t,n,r,s),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,d=n.contextType;typeof d=="object"&&d!==null?d=Dt(d):(d=xt(n)?Xr:it.current,d=ti(t,d));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==d)&&kp(t,a,r,d),rr=!1;var p=t.memoizedState;a.state=p,Qa(t,r,a,s),c=t.memoizedState,l!==r||p!==c||vt.current||rr?(typeof u=="function"&&(Hd(t,n,u,r),c=t.memoizedState),(l=rr||Np(t,n,l,r,p,c,d))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=d,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Dv(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Qt(t.type,l),a.props=d,f=t.pendingProps,p=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=Dt(c):(c=xt(n)?Xr:it.current,c=ti(t,c));var m=n.getDerivedStateFromProps;(u=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==f||p!==c)&&kp(t,a,r,c),rr=!1,p=t.memoizedState,a.state=p,Qa(t,r,a,s);var y=t.memoizedState;l!==f||p!==y||vt.current||rr?(typeof m=="function"&&(Hd(t,n,m,r),y=t.memoizedState),(d=rr||Np(t,n,d,r,p,y,c)||!1)?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,y,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,y,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),a.props=r,a.state=y,a.context=c,r=d):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return qd(e,t,n,r,i,s)}function qd(e,t,n,r,s,i){dx(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return s&&hp(t,n,!1),Vn(e,t,i);r=t.stateNode,cN.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=ri(t,e.child,null,i),t.child=ri(t,null,l,i)):at(e,t,l,i),t.memoizedState=r.state,s&&hp(t,n,!0),t.child}function ux(e){var t=e.stateNode;t.pendingContext?pp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&pp(e,t.context,!1),xf(e,t.containerInfo)}function Tp(e,t,n,r,s){return ni(),ff(s),t.flags|=256,at(e,t,n,r),t.child}var Qd={dehydrated:null,treeContext:null,retryLane:0};function Xd(e){return{baseLanes:e,cachePool:null,transitions:null}}function fx(e,t,n){var r=t.pendingProps,s=Pe.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Se(Pe,s&1),e===null)return Ud(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Al(a,r,0,null),e=qr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Xd(n),t.memoizedState=Qd,e):Cf(t,a));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return dN(e,t,a,r,l,s,n);if(i){i=r.fallback,a=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=wr(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=wr(l,i):(i=qr(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?Xd(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=Qd,r}return i=e.child,e=i.sibling,r=wr(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Cf(e,t){return t=Al({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function na(e,t,n,r){return r!==null&&ff(r),ri(t,e.child,null,n),e=Cf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dN(e,t,n,r,s,i,a){if(n)return t.flags&256?(t.flags&=-257,r=Vc(Error(B(422))),na(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Al({mode:"visible",children:r.children},s,0,null),i=qr(i,s,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&ri(t,e.child,null,a),t.child.memoizedState=Xd(a),t.memoizedState=Qd,i);if(!(t.mode&1))return na(e,t,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(B(419)),r=Vc(i,r,void 0),na(e,t,a,r)}if(l=(a&e.childLanes)!==0,ht||l){if(r=Ke,r!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|a)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Bn(e,s),rn(r,e,s,-1))}return Af(),r=Vc(Error(B(421))),na(e,t,a,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=NN.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,kt=vr(s.nextSibling),Ct=t,_e=!0,tn=null,e!==null&&(Mt[Ot++]=On,Mt[Ot++]=Ln,Mt[Ot++]=Jr,On=e.id,Ln=e.overflow,Jr=t),t=Cf(t,r.children),t.flags|=4096,t)}function Ap(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wd(e.return,t,n)}function Uc(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function mx(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(at(e,t,r.children,n),r=Pe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ap(e,n,t);else if(e.tag===19)Ap(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Se(Pe,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Xa(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Uc(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Xa(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Uc(t,!0,n,null,i);break;case"together":Uc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ka(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=wr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function uN(e,t,n){switch(t.tag){case 3:ux(t),ni();break;case 5:Fv(t);break;case 1:xt(t.type)&&Ha(t);break;case 4:xf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Se(Ya,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Se(Pe,Pe.current&1),t.flags|=128,null):n&t.child.childLanes?fx(e,t,n):(Se(Pe,Pe.current&1),e=Vn(e,t,n),e!==null?e.sibling:null);Se(Pe,Pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return mx(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Se(Pe,Pe.current),r)break;return null;case 22:case 23:return t.lanes=0,cx(e,t,n)}return Vn(e,t,n)}var px,Jd,hx,gx;px=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Jd=function(){};hx=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,zr(Nn.current);var i=null;switch(n){case"input":s=bd(e,s),r=bd(e,r),i=[];break;case"select":s=Me({},s,{value:void 0}),r=Me({},r,{value:void 0}),i=[];break;case"textarea":s=Nd(e,s),r=Nd(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ua)}jd(n,r);var a;n=null;for(d in s)if(!r.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var l=s[d];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Xi.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(l=s!=null?s[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(i||(i=[]),i.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Xi.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&je("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};gx=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ci(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function fN(e,t,n){var r=t.pendingProps;switch(uf(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return xt(t.type)&&Wa(),tt(t),null;case 3:return r=t.stateNode,si(),Ce(vt),Ce(it),bf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ea(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,tn!==null&&(ou(tn),tn=null))),Jd(e,t),tt(t),null;case 5:yf(t);var s=zr(co.current);if(n=t.type,e!==null&&t.stateNode!=null)hx(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return tt(t),null}if(e=zr(Nn.current),ea(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[gn]=t,r[ao]=i,e=(t.mode&1)!==0,n){case"dialog":je("cancel",r),je("close",r);break;case"iframe":case"object":case"embed":je("load",r);break;case"video":case"audio":for(s=0;s<Oi.length;s++)je(Oi[s],r);break;case"source":je("error",r);break;case"img":case"image":case"link":je("error",r),je("load",r);break;case"details":je("toggle",r);break;case"input":Bm(r,i),je("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},je("invalid",r);break;case"textarea":Um(r,i),je("invalid",r)}jd(n,i),s=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Zo(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Zo(r.textContent,l,e),s=["children",""+l]):Xi.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&je("scroll",r)}switch(n){case"input":Ho(r),Vm(r,i,!0);break;case"textarea":Ho(r),Wm(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Ua)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Wg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[gn]=t,e[ao]=r,px(e,t,!1,!1),t.stateNode=e;e:{switch(a=Cd(n,r),n){case"dialog":je("cancel",e),je("close",e),s=r;break;case"iframe":case"object":case"embed":je("load",e),s=r;break;case"video":case"audio":for(s=0;s<Oi.length;s++)je(Oi[s],e);s=r;break;case"source":je("error",e),s=r;break;case"img":case"image":case"link":je("error",e),je("load",e),s=r;break;case"details":je("toggle",e),s=r;break;case"input":Bm(e,r),s=bd(e,r),je("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Me({},r,{value:void 0}),je("invalid",e);break;case"textarea":Um(e,r),s=Nd(e,r),je("invalid",e);break;default:s=r}jd(n,s),l=s;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Kg(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Hg(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ji(e,c):typeof c=="number"&&Ji(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Xi.hasOwnProperty(i)?c!=null&&i==="onScroll"&&je("scroll",e):c!=null&&qu(e,i,c,a))}switch(n){case"input":Ho(e),Vm(e,r,!1);break;case"textarea":Ho(e),Wm(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Sr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Is(e,!!r.multiple,i,!1):r.defaultValue!=null&&Is(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Ua)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return tt(t),null;case 6:if(e&&t.stateNode!=null)gx(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=zr(co.current),zr(Nn.current),ea(t)){if(r=t.stateNode,n=t.memoizedProps,r[gn]=t,(i=r.nodeValue!==n)&&(e=Ct,e!==null))switch(e.tag){case 3:Zo(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Zo(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[gn]=t,t.stateNode=r}return tt(t),null;case 13:if(Ce(Pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_e&&kt!==null&&t.mode&1&&!(t.flags&128))Mv(),ni(),t.flags|=98560,i=!1;else if(i=ea(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(B(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(B(317));i[gn]=t}else ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else tn!==null&&(ou(tn),tn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Pe.current&1?Be===0&&(Be=3):Af())),t.updateQueue!==null&&(t.flags|=4),tt(t),null);case 4:return si(),Jd(e,t),e===null&&io(t.stateNode.containerInfo),tt(t),null;case 10:return hf(t.type._context),tt(t),null;case 17:return xt(t.type)&&Wa(),tt(t),null;case 19:if(Ce(Pe),i=t.memoizedState,i===null)return tt(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)Ci(i,!1);else{if(Be!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Xa(e),a!==null){for(t.flags|=128,Ci(i,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Se(Pe,Pe.current&1|2),t.child}e=e.sibling}i.tail!==null&&$e()>oi&&(t.flags|=128,r=!0,Ci(i,!1),t.lanes=4194304)}else{if(!r)if(e=Xa(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ci(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!_e)return tt(t),null}else 2*$e()-i.renderingStartTime>oi&&n!==1073741824&&(t.flags|=128,r=!0,Ci(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=$e(),t.sibling=null,n=Pe.current,Se(Pe,r?n&1|2:n&1),t):(tt(t),null);case 22:case 23:return Tf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?St&1073741824&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function mN(e,t){switch(uf(t),t.tag){case 1:return xt(t.type)&&Wa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return si(),Ce(vt),Ce(it),bf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yf(t),null;case 13:if(Ce(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(Pe),null;case 4:return si(),null;case 10:return hf(t.type._context),null;case 22:case 23:return Tf(),null;case 24:return null;default:return null}}var ra=!1,rt=!1,pN=typeof WeakSet=="function"?WeakSet:Set,H=null;function Ts(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Le(e,t,r)}else n.current=null}function Zd(e,t,n){try{n()}catch(r){Le(e,t,r)}}var Ip=!1;function hN(e,t){if(Ld=za,e=wv(),cf(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,d=0,u=0,f=e,p=null;t:for(;;){for(var m;f!==n||s!==0&&f.nodeType!==3||(l=a+s),f!==i||r!==0&&f.nodeType!==3||(c=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===n&&++d===s&&(l=a),p===i&&++u===r&&(c=a),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for($d={focusedElem:e,selectionRange:n},za=!1,H=t;H!==null;)if(t=H,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,H=e;else for(;H!==null;){t=H;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,b=y.memoizedState,x=t.stateNode,v=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:Qt(t.type,g),b);x.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(S){Le(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return y=Ip,Ip=!1,y}function Wi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Zd(t,n,i)}s=s.next}while(s!==r)}}function Pl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function eu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function vx(e){var t=e.alternate;t!==null&&(e.alternate=null,vx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[gn],delete t[ao],delete t[zd],delete t[XS],delete t[JS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xx(e){return e.tag===5||e.tag===3||e.tag===4}function Mp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function tu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ua));else if(r!==4&&(e=e.child,e!==null))for(tu(e,t,n),e=e.sibling;e!==null;)tu(e,t,n),e=e.sibling}function nu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(nu(e,t,n),e=e.sibling;e!==null;)nu(e,t,n),e=e.sibling}var Ye=null,en=!1;function Xn(e,t,n){for(n=n.child;n!==null;)yx(e,t,n),n=n.sibling}function yx(e,t,n){if(Sn&&typeof Sn.onCommitFiberUnmount=="function")try{Sn.onCommitFiberUnmount(Sl,n)}catch{}switch(n.tag){case 5:rt||Ts(n,t);case 6:var r=Ye,s=en;Ye=null,Xn(e,t,n),Ye=r,en=s,Ye!==null&&(en?(e=Ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ye.removeChild(n.stateNode));break;case 18:Ye!==null&&(en?(e=Ye,n=n.stateNode,e.nodeType===8?Lc(e.parentNode,n):e.nodeType===1&&Lc(e,n),no(e)):Lc(Ye,n.stateNode));break;case 4:r=Ye,s=en,Ye=n.stateNode.containerInfo,en=!0,Xn(e,t,n),Ye=r,en=s;break;case 0:case 11:case 14:case 15:if(!rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Zd(n,t,a),s=s.next}while(s!==r)}Xn(e,t,n);break;case 1:if(!rt&&(Ts(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Le(n,t,l)}Xn(e,t,n);break;case 21:Xn(e,t,n);break;case 22:n.mode&1?(rt=(r=rt)||n.memoizedState!==null,Xn(e,t,n),rt=r):Xn(e,t,n);break;default:Xn(e,t,n)}}function Op(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new pN),t.forEach(function(r){var s=kN.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Kt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:Ye=l.stateNode,en=!1;break e;case 3:Ye=l.stateNode.containerInfo,en=!0;break e;case 4:Ye=l.stateNode.containerInfo,en=!0;break e}l=l.return}if(Ye===null)throw Error(B(160));yx(i,a,s),Ye=null,en=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(d){Le(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bx(t,e),t=t.sibling}function bx(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Kt(t,e),dn(e),r&4){try{Wi(3,e,e.return),Pl(3,e)}catch(g){Le(e,e.return,g)}try{Wi(5,e,e.return)}catch(g){Le(e,e.return,g)}}break;case 1:Kt(t,e),dn(e),r&512&&n!==null&&Ts(n,n.return);break;case 5:if(Kt(t,e),dn(e),r&512&&n!==null&&Ts(n,n.return),e.flags&32){var s=e.stateNode;try{Ji(s,"")}catch(g){Le(e,e.return,g)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Vg(s,i),Cd(l,a);var d=Cd(l,i);for(a=0;a<c.length;a+=2){var u=c[a],f=c[a+1];u==="style"?Kg(s,f):u==="dangerouslySetInnerHTML"?Hg(s,f):u==="children"?Ji(s,f):qu(s,u,f,d)}switch(l){case"input":wd(s,i);break;case"textarea":Ug(s,i);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Is(s,!!i.multiple,m,!1):p!==!!i.multiple&&(i.defaultValue!=null?Is(s,!!i.multiple,i.defaultValue,!0):Is(s,!!i.multiple,i.multiple?[]:"",!1))}s[ao]=i}catch(g){Le(e,e.return,g)}}break;case 6:if(Kt(t,e),dn(e),r&4){if(e.stateNode===null)throw Error(B(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(g){Le(e,e.return,g)}}break;case 3:if(Kt(t,e),dn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{no(t.containerInfo)}catch(g){Le(e,e.return,g)}break;case 4:Kt(t,e),dn(e);break;case 13:Kt(t,e),dn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Rf=$e())),r&4&&Op(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(rt=(d=rt)||u,Kt(t,e),rt=d):Kt(t,e),dn(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(H=e,u=e.child;u!==null;){for(f=H=u;H!==null;){switch(p=H,m=p.child,p.tag){case 0:case 11:case 14:case 15:Wi(4,p,p.return);break;case 1:Ts(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(g){Le(r,n,g)}}break;case 5:Ts(p,p.return);break;case 22:if(p.memoizedState!==null){$p(f);continue}}m!==null?(m.return=p,H=m):$p(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,d?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Gg("display",a))}catch(g){Le(e,e.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(g){Le(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Kt(t,e),dn(e),r&4&&Op(e);break;case 21:break;default:Kt(t,e),dn(e)}}function dn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(xx(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Ji(s,""),r.flags&=-33);var i=Mp(e);nu(e,i,s);break;case 3:case 4:var a=r.stateNode.containerInfo,l=Mp(e);tu(e,l,a);break;default:throw Error(B(161))}}catch(c){Le(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gN(e,t,n){H=e,wx(e)}function wx(e,t,n){for(var r=(e.mode&1)!==0;H!==null;){var s=H,i=s.child;if(s.tag===22&&r){var a=s.memoizedState!==null||ra;if(!a){var l=s.alternate,c=l!==null&&l.memoizedState!==null||rt;l=ra;var d=rt;if(ra=a,(rt=c)&&!d)for(H=s;H!==null;)a=H,c=a.child,a.tag===22&&a.memoizedState!==null?Dp(s):c!==null?(c.return=a,H=c):Dp(s);for(;i!==null;)H=i,wx(i),i=i.sibling;H=s,ra=l,rt=d}Lp(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,H=i):Lp(e)}}function Lp(e){for(;H!==null;){var t=H;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:rt||Pl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!rt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Qt(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&bp(t,i,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}bp(t,a,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&no(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}rt||t.flags&512&&eu(t)}catch(p){Le(t,t.return,p)}}if(t===e){H=null;break}if(n=t.sibling,n!==null){n.return=t.return,H=n;break}H=t.return}}function $p(e){for(;H!==null;){var t=H;if(t===e){H=null;break}var n=t.sibling;if(n!==null){n.return=t.return,H=n;break}H=t.return}}function Dp(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Pl(4,t)}catch(c){Le(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){Le(t,s,c)}}var i=t.return;try{eu(t)}catch(c){Le(t,i,c)}break;case 5:var a=t.return;try{eu(t)}catch(c){Le(t,a,c)}}}catch(c){Le(t,t.return,c)}if(t===e){H=null;break}var l=t.sibling;if(l!==null){l.return=t.return,H=l;break}H=t.return}}var vN=Math.ceil,el=Gn.ReactCurrentDispatcher,Ef=Gn.ReactCurrentOwner,$t=Gn.ReactCurrentBatchConfig,de=0,Ke=null,De=null,qe=0,St=0,As=_r(0),Be=0,po=null,es=0,Tl=0,_f=0,Hi=null,pt=null,Rf=0,oi=1/0,An=null,tl=!1,ru=null,yr=null,sa=!1,fr=null,nl=0,Gi=0,su=null,ja=-1,Ca=0;function ct(){return de&6?$e():ja!==-1?ja:ja=$e()}function br(e){return e.mode&1?de&2&&qe!==0?qe&-qe:eN.transition!==null?(Ca===0&&(Ca=iv()),Ca):(e=pe,e!==0||(e=window.event,e=e===void 0?16:fv(e.type)),e):1}function rn(e,t,n,r){if(50<Gi)throw Gi=0,su=null,Error(B(185));Co(e,n,r),(!(de&2)||e!==Ke)&&(e===Ke&&(!(de&2)&&(Tl|=n),Be===4&&ir(e,qe)),yt(e,r),n===1&&de===0&&!(t.mode&1)&&(oi=$e()+500,El&&Rr()))}function yt(e,t){var n=e.callbackNode;eS(e,t);var r=Fa(e,e===Ke?qe:0);if(r===0)n!==null&&Km(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Km(n),t===1)e.tag===0?ZS(Fp.bind(null,e)):Tv(Fp.bind(null,e)),qS(function(){!(de&6)&&Rr()}),n=null;else{switch(ov(r)){case 1:n=ef;break;case 4:n=rv;break;case 16:n=Da;break;case 536870912:n=sv;break;default:n=Da}n=Rx(n,Sx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Sx(e,t){if(ja=-1,Ca=0,de&6)throw Error(B(327));var n=e.callbackNode;if(Ds()&&e.callbackNode!==n)return null;var r=Fa(e,e===Ke?qe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=rl(e,r);else{t=r;var s=de;de|=2;var i=kx();(Ke!==e||qe!==t)&&(An=null,oi=$e()+500,Yr(e,t));do try{bN();break}catch(l){Nx(e,l)}while(!0);pf(),el.current=i,de=s,De!==null?t=0:(Ke=null,qe=0,t=Be)}if(t!==0){if(t===2&&(s=Td(e),s!==0&&(r=s,t=iu(e,s))),t===1)throw n=po,Yr(e,0),ir(e,r),yt(e,$e()),n;if(t===6)ir(e,r);else{if(s=e.current.alternate,!(r&30)&&!xN(s)&&(t=rl(e,r),t===2&&(i=Td(e),i!==0&&(r=i,t=iu(e,i))),t===1))throw n=po,Yr(e,0),ir(e,r),yt(e,$e()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:$r(e,pt,An);break;case 3:if(ir(e,r),(r&130023424)===r&&(t=Rf+500-$e(),10<t)){if(Fa(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){ct(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Fd($r.bind(null,e,pt,An),t);break}$r(e,pt,An);break;case 4:if(ir(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var a=31-nn(r);i=1<<a,a=t[a],a>s&&(s=a),r&=~i}if(r=s,r=$e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vN(r/1960))-r,10<r){e.timeoutHandle=Fd($r.bind(null,e,pt,An),r);break}$r(e,pt,An);break;case 5:$r(e,pt,An);break;default:throw Error(B(329))}}}return yt(e,$e()),e.callbackNode===n?Sx.bind(null,e):null}function iu(e,t){var n=Hi;return e.current.memoizedState.isDehydrated&&(Yr(e,t).flags|=256),e=rl(e,t),e!==2&&(t=pt,pt=n,t!==null&&ou(t)),e}function ou(e){pt===null?pt=e:pt.push.apply(pt,e)}function xN(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!sn(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ir(e,t){for(t&=~_f,t&=~Tl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-nn(t),r=1<<n;e[n]=-1,t&=~r}}function Fp(e){if(de&6)throw Error(B(327));Ds();var t=Fa(e,0);if(!(t&1))return yt(e,$e()),null;var n=rl(e,t);if(e.tag!==0&&n===2){var r=Td(e);r!==0&&(t=r,n=iu(e,r))}if(n===1)throw n=po,Yr(e,0),ir(e,t),yt(e,$e()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,$r(e,pt,An),yt(e,$e()),null}function Pf(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(oi=$e()+500,El&&Rr())}}function ts(e){fr!==null&&fr.tag===0&&!(de&6)&&Ds();var t=de;de|=1;var n=$t.transition,r=pe;try{if($t.transition=null,pe=1,e)return e()}finally{pe=r,$t.transition=n,de=t,!(de&6)&&Rr()}}function Tf(){St=As.current,Ce(As)}function Yr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,YS(n)),De!==null)for(n=De.return;n!==null;){var r=n;switch(uf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Wa();break;case 3:si(),Ce(vt),Ce(it),bf();break;case 5:yf(r);break;case 4:si();break;case 13:Ce(Pe);break;case 19:Ce(Pe);break;case 10:hf(r.type._context);break;case 22:case 23:Tf()}n=n.return}if(Ke=e,De=e=wr(e.current,null),qe=St=t,Be=0,po=null,_f=Tl=es=0,pt=Hi=null,Fr!==null){for(t=0;t<Fr.length;t++)if(n=Fr[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=s,r.next=a}n.pending=r}Fr=null}return e}function Nx(e,t){do{var n=De;try{if(pf(),Sa.current=Za,Ja){for(var r=Ie.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Ja=!1}if(Zr=0,Ge=Fe=Ie=null,Ui=!1,uo=0,Ef.current=null,n===null||n.return===null){Be=1,po=t,De=null;break}e:{var i=e,a=n.return,l=n,c=t;if(t=qe,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=Cp(a);if(m!==null){m.flags&=-257,Ep(m,a,l,i,t),m.mode&1&&jp(i,d,t),t=m,c=d;var y=t.updateQueue;if(y===null){var g=new Set;g.add(c),t.updateQueue=g}else y.add(c);break e}else{if(!(t&1)){jp(i,d,t),Af();break e}c=Error(B(426))}}else if(_e&&l.mode&1){var b=Cp(a);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Ep(b,a,l,i,t),ff(ii(c,l));break e}}i=c=ii(c,l),Be!==4&&(Be=2),Hi===null?Hi=[i]:Hi.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=ox(i,c,t);yp(i,x);break e;case 1:l=c;var v=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(yr===null||!yr.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=ax(i,l,t);yp(i,S);break e}}i=i.return}while(i!==null)}Cx(n)}catch(N){t=N,De===n&&n!==null&&(De=n=n.return);continue}break}while(!0)}function kx(){var e=el.current;return el.current=Za,e===null?Za:e}function Af(){(Be===0||Be===3||Be===2)&&(Be=4),Ke===null||!(es&268435455)&&!(Tl&268435455)||ir(Ke,qe)}function rl(e,t){var n=de;de|=2;var r=kx();(Ke!==e||qe!==t)&&(An=null,Yr(e,t));do try{yN();break}catch(s){Nx(e,s)}while(!0);if(pf(),de=n,el.current=r,De!==null)throw Error(B(261));return Ke=null,qe=0,Be}function yN(){for(;De!==null;)jx(De)}function bN(){for(;De!==null&&!H1();)jx(De)}function jx(e){var t=_x(e.alternate,e,St);e.memoizedProps=e.pendingProps,t===null?Cx(e):De=t,Ef.current=null}function Cx(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=mN(n,t),n!==null){n.flags&=32767,De=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Be=6,De=null;return}}else if(n=fN(n,t,St),n!==null){De=n;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Be===0&&(Be=5)}function $r(e,t,n){var r=pe,s=$t.transition;try{$t.transition=null,pe=1,wN(e,t,n,r)}finally{$t.transition=s,pe=r}return null}function wN(e,t,n,r){do Ds();while(fr!==null);if(de&6)throw Error(B(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(tS(e,i),e===Ke&&(De=Ke=null,qe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||sa||(sa=!0,Rx(Da,function(){return Ds(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=$t.transition,$t.transition=null;var a=pe;pe=1;var l=de;de|=4,Ef.current=null,hN(e,n),bx(n,e),BS($d),za=!!Ld,$d=Ld=null,e.current=n,gN(n),G1(),de=l,pe=a,$t.transition=i}else e.current=n;if(sa&&(sa=!1,fr=e,nl=s),i=e.pendingLanes,i===0&&(yr=null),q1(n.stateNode),yt(e,$e()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(tl)throw tl=!1,e=ru,ru=null,e;return nl&1&&e.tag!==0&&Ds(),i=e.pendingLanes,i&1?e===su?Gi++:(Gi=0,su=e):Gi=0,Rr(),null}function Ds(){if(fr!==null){var e=ov(nl),t=$t.transition,n=pe;try{if($t.transition=null,pe=16>e?16:e,fr===null)var r=!1;else{if(e=fr,fr=null,nl=0,de&6)throw Error(B(331));var s=de;for(de|=4,H=e.current;H!==null;){var i=H,a=i.child;if(H.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(H=d;H!==null;){var u=H;switch(u.tag){case 0:case 11:case 15:Wi(8,u,i)}var f=u.child;if(f!==null)f.return=u,H=f;else for(;H!==null;){u=H;var p=u.sibling,m=u.return;if(vx(u),u===d){H=null;break}if(p!==null){p.return=m,H=p;break}H=m}}}var y=i.alternate;if(y!==null){var g=y.child;if(g!==null){y.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}H=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,H=a;else e:for(;H!==null;){if(i=H,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Wi(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,H=x;break e}H=i.return}}var v=e.current;for(H=v;H!==null;){a=H;var w=a.child;if(a.subtreeFlags&2064&&w!==null)w.return=a,H=w;else e:for(a=v;H!==null;){if(l=H,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Pl(9,l)}}catch(N){Le(l,l.return,N)}if(l===a){H=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,H=S;break e}H=l.return}}if(de=s,Rr(),Sn&&typeof Sn.onPostCommitFiberRoot=="function")try{Sn.onPostCommitFiberRoot(Sl,e)}catch{}r=!0}return r}finally{pe=n,$t.transition=t}}return!1}function zp(e,t,n){t=ii(n,t),t=ox(e,t,1),e=xr(e,t,1),t=ct(),e!==null&&(Co(e,1,t),yt(e,t))}function Le(e,t,n){if(e.tag===3)zp(e,e,n);else for(;t!==null;){if(t.tag===3){zp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(yr===null||!yr.has(r))){e=ii(n,e),e=ax(t,e,1),t=xr(t,e,1),e=ct(),t!==null&&(Co(t,1,e),yt(t,e));break}}t=t.return}}function SN(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ct(),e.pingedLanes|=e.suspendedLanes&n,Ke===e&&(qe&n)===n&&(Be===4||Be===3&&(qe&130023424)===qe&&500>$e()-Rf?Yr(e,0):_f|=n),yt(e,t)}function Ex(e,t){t===0&&(e.mode&1?(t=Yo,Yo<<=1,!(Yo&130023424)&&(Yo=4194304)):t=1);var n=ct();e=Bn(e,t),e!==null&&(Co(e,t,n),yt(e,n))}function NN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ex(e,n)}function kN(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),Ex(e,n)}var _x;_x=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||vt.current)ht=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ht=!1,uN(e,t,n);ht=!!(e.flags&131072)}else ht=!1,_e&&t.flags&1048576&&Av(t,Ka,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ka(e,t),e=t.pendingProps;var s=ti(t,it.current);$s(t,n),s=Sf(null,t,r,e,s,n);var i=Nf();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xt(r)?(i=!0,Ha(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,vf(t),s.updater=Rl,t.stateNode=s,s._reactInternals=t,Gd(t,r,e,n),t=qd(null,t,r,!0,i,n)):(t.tag=0,_e&&i&&df(t),at(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ka(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=CN(r),e=Qt(r,e),s){case 0:t=Yd(null,t,r,e,n);break e;case 1:t=Pp(null,t,r,e,n);break e;case 11:t=_p(null,t,r,e,n);break e;case 14:t=Rp(null,t,r,Qt(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Qt(r,s),Yd(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Qt(r,s),Pp(e,t,r,s,n);case 3:e:{if(ux(t),e===null)throw Error(B(387));r=t.pendingProps,i=t.memoizedState,s=i.element,Dv(e,t),Qa(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=ii(Error(B(423)),t),t=Tp(e,t,r,n,s);break e}else if(r!==s){s=ii(Error(B(424)),t),t=Tp(e,t,r,n,s);break e}else for(kt=vr(t.stateNode.containerInfo.firstChild),Ct=t,_e=!0,tn=null,n=Lv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ni(),r===s){t=Vn(e,t,n);break e}at(e,t,r,n)}t=t.child}return t;case 5:return Fv(t),e===null&&Ud(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,Dd(r,s)?a=null:i!==null&&Dd(r,i)&&(t.flags|=32),dx(e,t),at(e,t,a,n),t.child;case 6:return e===null&&Ud(t),null;case 13:return fx(e,t,n);case 4:return xf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ri(t,null,r,n):at(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Qt(r,s),_p(e,t,r,s,n);case 7:return at(e,t,t.pendingProps,n),t.child;case 8:return at(e,t,t.pendingProps.children,n),t.child;case 12:return at(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,a=s.value,Se(Ya,r._currentValue),r._currentValue=a,i!==null)if(sn(i.value,a)){if(i.children===s.children&&!vt.current){t=Vn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Dn(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Wd(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(B(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Wd(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}at(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,$s(t,n),s=Dt(s),r=r(s),t.flags|=1,at(e,t,r,n),t.child;case 14:return r=t.type,s=Qt(r,t.pendingProps),s=Qt(r.type,s),Rp(e,t,r,s,n);case 15:return lx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Qt(r,s),ka(e,t),t.tag=1,xt(r)?(e=!0,Ha(t)):e=!1,$s(t,n),ix(t,r,s),Gd(t,r,s,n),qd(null,t,r,!0,e,n);case 19:return mx(e,t,n);case 22:return cx(e,t,n)}throw Error(B(156,t.tag))};function Rx(e,t){return nv(e,t)}function jN(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lt(e,t,n,r){return new jN(e,t,n,r)}function If(e){return e=e.prototype,!(!e||!e.isReactComponent)}function CN(e){if(typeof e=="function")return If(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Xu)return 11;if(e===Ju)return 14}return 2}function wr(e,t){var n=e.alternate;return n===null?(n=Lt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ea(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")If(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ss:return qr(n.children,s,i,t);case Qu:a=8,s|=8;break;case gd:return e=Lt(12,n,t,s|2),e.elementType=gd,e.lanes=i,e;case vd:return e=Lt(13,n,t,s),e.elementType=vd,e.lanes=i,e;case xd:return e=Lt(19,n,t,s),e.elementType=xd,e.lanes=i,e;case Fg:return Al(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $g:a=10;break e;case Dg:a=9;break e;case Xu:a=11;break e;case Ju:a=14;break e;case nr:a=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=Lt(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function qr(e,t,n,r){return e=Lt(7,e,r,t),e.lanes=n,e}function Al(e,t,n,r){return e=Lt(22,e,r,t),e.elementType=Fg,e.lanes=n,e.stateNode={isHidden:!1},e}function Wc(e,t,n){return e=Lt(6,e,null,t),e.lanes=n,e}function Hc(e,t,n){return t=Lt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function EN(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jc(0),this.expirationTimes=jc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jc(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Mf(e,t,n,r,s,i,a,l,c){return e=new EN(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Lt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vf(i),e}function _N(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ws,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Px(e){if(!e)return Nr;e=e._reactInternals;e:{if(ds(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(xt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(xt(n))return Pv(e,n,t)}return t}function Tx(e,t,n,r,s,i,a,l,c){return e=Mf(n,r,!0,e,s,i,a,l,c),e.context=Px(null),n=e.current,r=ct(),s=br(n),i=Dn(r,s),i.callback=t??null,xr(n,i,s),e.current.lanes=s,Co(e,s,r),yt(e,r),e}function Il(e,t,n,r){var s=t.current,i=ct(),a=br(s);return n=Px(n),t.context===null?t.context=n:t.pendingContext=n,t=Dn(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=xr(s,t,a),e!==null&&(rn(e,s,a,i),wa(e,s,a)),a}function sl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Bp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Of(e,t){Bp(e,t),(e=e.alternate)&&Bp(e,t)}function RN(){return null}var Ax=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lf(e){this._internalRoot=e}Ml.prototype.render=Lf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Il(e,t,null,null)};Ml.prototype.unmount=Lf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ts(function(){Il(null,e,null,null)}),t[zn]=null}};function Ml(e){this._internalRoot=e}Ml.prototype.unstable_scheduleHydration=function(e){if(e){var t=cv();e={blockedOn:null,target:e,priority:t};for(var n=0;n<sr.length&&t!==0&&t<sr[n].priority;n++);sr.splice(n,0,e),n===0&&uv(e)}};function $f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ol(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Vp(){}function PN(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var d=sl(a);i.call(d)}}var a=Tx(t,r,e,0,null,!1,!1,"",Vp);return e._reactRootContainer=a,e[zn]=a.current,io(e.nodeType===8?e.parentNode:e),ts(),a}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var d=sl(c);l.call(d)}}var c=Mf(e,0,!1,null,null,!1,!1,"",Vp);return e._reactRootContainer=c,e[zn]=c.current,io(e.nodeType===8?e.parentNode:e),ts(function(){Il(t,c,n,r)}),c}function Ll(e,t,n,r,s){var i=n._reactRootContainer;if(i){var a=i;if(typeof s=="function"){var l=s;s=function(){var c=sl(a);l.call(c)}}Il(t,a,e,s)}else a=PN(n,t,e,s,r);return sl(a)}av=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Mi(t.pendingLanes);n!==0&&(tf(t,n|1),yt(t,$e()),!(de&6)&&(oi=$e()+500,Rr()))}break;case 13:ts(function(){var r=Bn(e,1);if(r!==null){var s=ct();rn(r,e,1,s)}}),Of(e,1)}};nf=function(e){if(e.tag===13){var t=Bn(e,134217728);if(t!==null){var n=ct();rn(t,e,134217728,n)}Of(e,134217728)}};lv=function(e){if(e.tag===13){var t=br(e),n=Bn(e,t);if(n!==null){var r=ct();rn(n,e,t,r)}Of(e,t)}};cv=function(){return pe};dv=function(e,t){var n=pe;try{return pe=e,t()}finally{pe=n}};_d=function(e,t,n){switch(t){case"input":if(wd(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Cl(r);if(!s)throw Error(B(90));Bg(r),wd(r,s)}}}break;case"textarea":Ug(e,n);break;case"select":t=n.value,t!=null&&Is(e,!!n.multiple,t,!1)}};Qg=Pf;Xg=ts;var TN={usingClientEntryPoint:!1,Events:[_o,Cs,Cl,Yg,qg,Pf]},Ei={findFiberByHostInstance:Dr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},AN={bundleType:Ei.bundleType,version:Ei.version,rendererPackageName:Ei.rendererPackageName,rendererConfig:Ei.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Gn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ev(e),e===null?null:e.stateNode},findFiberByHostInstance:Ei.findFiberByHostInstance||RN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ia=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ia.isDisabled&&ia.supportsFiber)try{Sl=ia.inject(AN),Sn=ia}catch{}}Rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TN;Rt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$f(t))throw Error(B(200));return _N(e,t,null,n)};Rt.createRoot=function(e,t){if(!$f(e))throw Error(B(299));var n=!1,r="",s=Ax;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Mf(e,1,!1,null,null,n,!1,r,s),e[zn]=t.current,io(e.nodeType===8?e.parentNode:e),new Lf(t)};Rt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=ev(t),e=e===null?null:e.stateNode,e};Rt.flushSync=function(e){return ts(e)};Rt.hydrate=function(e,t,n){if(!Ol(t))throw Error(B(200));return Ll(null,e,t,!0,n)};Rt.hydrateRoot=function(e,t,n){if(!$f(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",a=Ax;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Tx(t,null,e,1,n??null,s,!1,i,a),e[zn]=t.current,io(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Ml(t)};Rt.render=function(e,t,n){if(!Ol(t))throw Error(B(200));return Ll(null,e,t,!1,n)};Rt.unmountComponentAtNode=function(e){if(!Ol(e))throw Error(B(40));return e._reactRootContainer?(ts(function(){Ll(null,null,e,!1,function(){e._reactRootContainer=null,e[zn]=null})}),!0):!1};Rt.unstable_batchedUpdates=Pf;Rt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ol(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return Ll(e,t,n,!1,r)};Rt.version="18.3.1-next-f1338f8080-20240426";function Ix(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ix)}catch(e){console.error(e)}}Ix(),Ig.exports=Rt;var us=Ig.exports;const Mx=wg(us);var Ox,Up=us;Ox=Up.createRoot,Up.hydrateRoot;var $l=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(){}},Dl=typeof window>"u"||"Deno"in globalThis;function Xt(){}function IN(e,t){return typeof e=="function"?e(t):e}function MN(e){return typeof e=="number"&&e>=0&&e!==1/0}function ON(e,t){return Math.max(e+(t||0)-Date.now(),0)}function au(e,t){return typeof e=="function"?e(t):e}function LN(e,t){return typeof e=="function"?e(t):e}function Wp(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==Df(a,t.options))return!1}else if(!go(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||i&&!i(t))}function Hp(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ho(t.options.mutationKey)!==ho(i))return!1}else if(!go(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Df(e,t){return((t==null?void 0:t.queryKeyHashFn)||ho)(e)}function ho(e){return JSON.stringify(e,(t,n)=>lu(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function go(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>go(e[n],t[n])):!1}function Lx(e,t){if(e===t)return e;const n=Gp(e)&&Gp(t);if(n||lu(e)&&lu(t)){const r=n?e:Object.keys(e),s=r.length,i=n?t:Object.keys(t),a=i.length,l=n?[]:{},c=new Set(r);let d=0;for(let u=0;u<a;u++){const f=n?u:i[u];(!n&&c.has(f)||n)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,d++):(l[f]=Lx(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&d++)}return s===a&&d===s?e:l}return t}function Gp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lu(e){if(!Kp(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Kp(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Kp(e){return Object.prototype.toString.call(e)==="[object Object]"}function $N(e){return new Promise(t=>{setTimeout(t,e)})}function DN(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Lx(e,t):t}function FN(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function zN(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ff=Symbol();function $x(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ff?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Vr,or,Gs,mg,BN=(mg=class extends $l{constructor(){super();ue(this,Vr);ue(this,or);ue(this,Gs);ne(this,Gs,t=>{if(!Dl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){M(this,or)||this.setEventListener(M(this,Gs))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,or))==null||t.call(this),ne(this,or,void 0))}setEventListener(t){var n;ne(this,Gs,t),(n=M(this,or))==null||n.call(this),ne(this,or,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){M(this,Vr)!==t&&(ne(this,Vr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof M(this,Vr)=="boolean"?M(this,Vr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Vr=new WeakMap,or=new WeakMap,Gs=new WeakMap,mg),Dx=new BN,Ks,ar,Ys,pg,VN=(pg=class extends $l{constructor(){super();ue(this,Ks,!0);ue(this,ar);ue(this,Ys);ne(this,Ys,t=>{if(!Dl&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){M(this,ar)||this.setEventListener(M(this,Ys))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,ar))==null||t.call(this),ne(this,ar,void 0))}setEventListener(t){var n;ne(this,Ys,t),(n=M(this,ar))==null||n.call(this),ne(this,ar,t(this.setOnline.bind(this)))}setOnline(t){M(this,Ks)!==t&&(ne(this,Ks,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return M(this,Ks)}},Ks=new WeakMap,ar=new WeakMap,Ys=new WeakMap,pg),il=new VN;function UN(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function WN(e){return Math.min(1e3*2**e,3e4)}function Fx(e){return(e??"online")==="online"?il.isOnline():!0}var zx=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Gc(e){return e instanceof zx}function Bx(e){let t=!1,n=0,r=!1,s;const i=UN(),a=g=>{var b;r||(p(new zx(g)),(b=e.abort)==null||b.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>Dx.isFocused()&&(e.networkMode==="always"||il.isOnline())&&e.canRun(),u=()=>Fx(e.networkMode)&&e.canRun(),f=g=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,g),s==null||s(),i.resolve(g))},p=g=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,g),s==null||s(),i.reject(g))},m=()=>new Promise(g=>{var b;s=x=>{(r||d())&&g(x)},(b=e.onPause)==null||b.call(e)}).then(()=>{var g;s=void 0,r||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(r)return;let g;const b=n===0?e.initialPromise:void 0;try{g=b??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{var k;if(r)return;const v=e.retry??(Dl?0:3),w=e.retryDelay??WN,S=typeof w=="function"?w(n,x):w,N=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,x);if(t||!N){p(x);return}n++,(k=e.onFail)==null||k.call(e,n,x),$N(S).then(()=>d()?void 0:m()).then(()=>{t?p(x):y()})})};return{promise:i,cancel:a,continue:()=>(s==null||s(),i),cancelRetry:l,continueRetry:c,canStart:u,start:()=>(u()?y():m().then(y),i)}}var HN=e=>setTimeout(e,0);function GN(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=HN;const i=l=>{t?e.push(l):s(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||a()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var lt=GN(),Ur,hg,Vx=(hg=class{constructor(){ue(this,Ur)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),MN(this.gcTime)&&ne(this,Ur,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Dl?1/0:5*60*1e3))}clearGcTimeout(){M(this,Ur)&&(clearTimeout(M(this,Ur)),ne(this,Ur,void 0))}},Ur=new WeakMap,hg),qs,Wr,It,Hr,nt,No,Gr,Jt,Tn,gg,KN=(gg=class extends Vx{constructor(t){super();ue(this,Jt);ue(this,qs);ue(this,Wr);ue(this,It);ue(this,Hr);ue(this,nt);ue(this,No);ue(this,Gr);ne(this,Gr,!1),ne(this,No,t.defaultOptions),this.setOptions(t.options),this.observers=[],ne(this,Hr,t.client),ne(this,It,M(this,Hr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ne(this,qs,qN(this.options)),this.state=t.state??M(this,qs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=M(this,nt))==null?void 0:t.promise}setOptions(t){this.options={...M(this,No),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&M(this,It).remove(this)}setData(t,n){const r=DN(this.state.data,t,this.options);return Ze(this,Jt,Tn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ze(this,Jt,Tn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=M(this,nt))==null?void 0:r.promise;return(s=M(this,nt))==null||s.cancel(t),n?n.then(Xt).catch(Xt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(M(this,qs))}isActive(){return this.observers.some(t=>LN(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ff||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>au(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:!ON(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,nt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,nt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),M(this,It).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(M(this,nt)&&(M(this,Gr)?M(this,nt).cancel({revert:!0}):M(this,nt).cancelRetry()),this.scheduleGc()),M(this,It).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ze(this,Jt,Tn).call(this,{type:"invalidate"})}fetch(t,n){var d,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(M(this,nt))return M(this,nt).continueRetry(),M(this,nt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(ne(this,Gr,!0),r.signal)})},i=()=>{const p=$x(this.options,n),y=(()=>{const g={client:M(this,Hr),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return ne(this,Gr,!1),this.options.persister?this.options.persister(p,y,this):p(y)},l=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:M(this,Hr),state:this.state,fetchFn:i};return s(p),p})();(d=this.options.behavior)==null||d.onFetch(l,this),ne(this,Wr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=l.fetchOptions)==null?void 0:u.meta))&&Ze(this,Jt,Tn).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=p=>{var m,y,g,b;Gc(p)&&p.silent||Ze(this,Jt,Tn).call(this,{type:"error",error:p}),Gc(p)||((y=(m=M(this,It).config).onError)==null||y.call(m,p,this),(b=(g=M(this,It).config).onSettled)==null||b.call(g,this.state.data,p,this)),this.scheduleGc()};return ne(this,nt,Bx({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var m,y,g,b;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(x){c(x);return}(y=(m=M(this,It).config).onSuccess)==null||y.call(m,p,this),(b=(g=M(this,It).config).onSettled)==null||b.call(g,p,this.state.error,this),this.scheduleGc()},onError:c,onFail:(p,m)=>{Ze(this,Jt,Tn).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{Ze(this,Jt,Tn).call(this,{type:"pause"})},onContinue:()=>{Ze(this,Jt,Tn).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),M(this,nt).start()}},qs=new WeakMap,Wr=new WeakMap,It=new WeakMap,Hr=new WeakMap,nt=new WeakMap,No=new WeakMap,Gr=new WeakMap,Jt=new WeakSet,Tn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...YN(r.data,this.options),fetchMeta:t.meta??null};case"success":return ne(this,Wr,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Gc(s)&&s.revert&&M(this,Wr)?{...M(this,Wr),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),lt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),M(this,It).notify({query:this,type:"updated",action:t})})},gg);function YN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Fx(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qN(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var fn,vg,QN=(vg=class extends $l{constructor(t={}){super();ue(this,fn);this.config=t,ne(this,fn,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??Df(s,n);let a=this.get(i);return a||(a=new KN({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){M(this,fn).has(t.queryHash)||(M(this,fn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=M(this,fn).get(t.queryHash);n&&(t.destroy(),n===t&&M(this,fn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){lt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return M(this,fn).get(t)}getAll(){return[...M(this,fn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Wp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Wp(t,r)):n}notify(t){lt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){lt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){lt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fn=new WeakMap,vg),mn,ot,Kr,pn,er,xg,XN=(xg=class extends Vx{constructor(t){super();ue(this,pn);ue(this,mn);ue(this,ot);ue(this,Kr);this.mutationId=t.mutationId,ne(this,ot,t.mutationCache),ne(this,mn,[]),this.state=t.state||JN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){M(this,mn).includes(t)||(M(this,mn).push(t),this.clearGcTimeout(),M(this,ot).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ne(this,mn,M(this,mn).filter(n=>n!==t)),this.scheduleGc(),M(this,ot).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){M(this,mn).length||(this.state.status==="pending"?this.scheduleGc():M(this,ot).remove(this))}continue(){var t;return((t=M(this,Kr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,a,l,c,d,u,f,p,m,y,g,b,x,v,w,S,N,k,j,C;const n=()=>{Ze(this,pn,er).call(this,{type:"continue"})};ne(this,Kr,Bx({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,R)=>{Ze(this,pn,er).call(this,{type:"failed",failureCount:E,error:R})},onPause:()=>{Ze(this,pn,er).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>M(this,ot).canRun(this)}));const r=this.state.status==="pending",s=!M(this,Kr).canStart();try{if(r)n();else{Ze(this,pn,er).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(i=M(this,ot).config).onMutate)==null?void 0:a.call(i,t,this));const R=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));R!==this.state.context&&Ze(this,pn,er).call(this,{type:"pending",context:R,variables:t,isPaused:s})}const E=await M(this,Kr).start();return await((u=(d=M(this,ot).config).onSuccess)==null?void 0:u.call(d,E,t,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,E,t,this.state.context)),await((y=(m=M(this,ot).config).onSettled)==null?void 0:y.call(m,E,null,this.state.variables,this.state.context,this)),await((b=(g=this.options).onSettled)==null?void 0:b.call(g,E,null,t,this.state.context)),Ze(this,pn,er).call(this,{type:"success",data:E}),E}catch(E){try{throw await((v=(x=M(this,ot).config).onError)==null?void 0:v.call(x,E,t,this.state.context,this)),await((S=(w=this.options).onError)==null?void 0:S.call(w,E,t,this.state.context)),await((k=(N=M(this,ot).config).onSettled)==null?void 0:k.call(N,void 0,E,this.state.variables,this.state.context,this)),await((C=(j=this.options).onSettled)==null?void 0:C.call(j,void 0,E,t,this.state.context)),E}finally{Ze(this,pn,er).call(this,{type:"error",error:E})}}finally{M(this,ot).runNext(this)}}},mn=new WeakMap,ot=new WeakMap,Kr=new WeakMap,pn=new WeakSet,er=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),lt.batch(()=>{M(this,mn).forEach(r=>{r.onMutationUpdate(t)}),M(this,ot).notify({mutation:this,type:"updated",action:t})})},xg);function JN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mn,Zt,ko,yg,ZN=(yg=class extends $l{constructor(t={}){super();ue(this,Mn);ue(this,Zt);ue(this,ko);this.config=t,ne(this,Mn,new Set),ne(this,Zt,new Map),ne(this,ko,0)}build(t,n,r){const s=new XN({mutationCache:this,mutationId:++Vo(this,ko)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){M(this,Mn).add(t);const n=oa(t);if(typeof n=="string"){const r=M(this,Zt).get(n);r?r.push(t):M(this,Zt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(M(this,Mn).delete(t)){const n=oa(t);if(typeof n=="string"){const r=M(this,Zt).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&M(this,Zt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=oa(t);if(typeof n=="string"){const r=M(this,Zt).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=oa(t);if(typeof n=="string"){const s=(r=M(this,Zt).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){lt.batch(()=>{M(this,Mn).forEach(t=>{this.notify({type:"removed",mutation:t})}),M(this,Mn).clear(),M(this,Zt).clear()})}getAll(){return Array.from(M(this,Mn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Hp(n,r))}findAll(t={}){return this.getAll().filter(n=>Hp(t,n))}notify(t){lt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return lt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Xt))))}},Mn=new WeakMap,Zt=new WeakMap,ko=new WeakMap,yg);function oa(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Yp(e){return{onFetch:(t,n)=>{var u,f,p,m,y;const r=t.options,s=(p=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,i=((m=t.state.data)==null?void 0:m.pages)||[],a=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let g=!1;const b=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},x=$x(t.options,t.fetchOptions),v=async(w,S,N)=>{if(g)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const j=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:S,direction:N?"backward":"forward",meta:t.options.meta};return b(P),P})(),C=await x(j),{maxPages:E}=t.options,R=N?zN:FN;return{pages:R(w.pages,C,E),pageParams:R(w.pageParams,S,E)}};if(s&&i.length){const w=s==="backward",S=w?ek:qp,N={pages:i,pageParams:a},k=S(r,N);l=await v(N,k,w)}else{const w=e??i.length;do{const S=c===0?a[0]??r.initialPageParam:qp(r,l);if(c>0&&S==null)break;l=await v(l,S),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var g,b;return(b=(g=t.options).persister)==null?void 0:b.call(g,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function qp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ek(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Oe,lr,cr,Qs,Xs,dr,Js,Zs,bg,tk=(bg=class{constructor(e={}){ue(this,Oe);ue(this,lr);ue(this,cr);ue(this,Qs);ue(this,Xs);ue(this,dr);ue(this,Js);ue(this,Zs);ne(this,Oe,e.queryCache||new QN),ne(this,lr,e.mutationCache||new ZN),ne(this,cr,e.defaultOptions||{}),ne(this,Qs,new Map),ne(this,Xs,new Map),ne(this,dr,0)}mount(){Vo(this,dr)._++,M(this,dr)===1&&(ne(this,Js,Dx.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Oe).onFocus())})),ne(this,Zs,il.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Oe).onOnline())})))}unmount(){var e,t;Vo(this,dr)._--,M(this,dr)===0&&((e=M(this,Js))==null||e.call(this),ne(this,Js,void 0),(t=M(this,Zs))==null||t.call(this),ne(this,Zs,void 0))}isFetching(e){return M(this,Oe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return M(this,lr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,Oe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=M(this,Oe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(au(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return M(this,Oe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=M(this,Oe).get(r.queryHash),i=s==null?void 0:s.state.data,a=IN(t,i);if(a!==void 0)return M(this,Oe).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return lt.batch(()=>M(this,Oe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,Oe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=M(this,Oe);lt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=M(this,Oe);return lt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=lt.batch(()=>M(this,Oe).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Xt).catch(Xt)}invalidateQueries(e,t={}){return lt.batch(()=>(M(this,Oe).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=lt.batch(()=>M(this,Oe).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Xt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Xt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=M(this,Oe).build(this,t);return n.isStaleByTime(au(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Xt).catch(Xt)}fetchInfiniteQuery(e){return e.behavior=Yp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Xt).catch(Xt)}ensureInfiniteQueryData(e){return e.behavior=Yp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return il.isOnline()?M(this,lr).resumePausedMutations():Promise.resolve()}getQueryCache(){return M(this,Oe)}getMutationCache(){return M(this,lr)}getDefaultOptions(){return M(this,cr)}setDefaultOptions(e){ne(this,cr,e)}setQueryDefaults(e,t){M(this,Qs).set(ho(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...M(this,Qs).values()],n={};return t.forEach(r=>{go(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){M(this,Xs).set(ho(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...M(this,Xs).values()],n={};return t.forEach(r=>{go(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...M(this,cr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Df(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===Ff&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...M(this,cr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){M(this,Oe).clear(),M(this,lr).clear()}},Oe=new WeakMap,lr=new WeakMap,cr=new WeakMap,Qs=new WeakMap,Xs=new WeakMap,dr=new WeakMap,Js=new WeakMap,Zs=new WeakMap,bg),nk=h.createContext(void 0),rk=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(nk.Provider,{value:e,children:t}));/**
|
|
41
|
-
* @remix-run/router v1.23.0
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/function ol(){return ol=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ol.apply(this,arguments)}var mr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(mr||(mr={}));const Qp="popstate";function sk(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:a,hash:l}=r.location;return cu("",{pathname:i,search:a,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Wx(s)}return ok(t,n,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ux(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ik(){return Math.random().toString(36).substr(2,8)}function Xp(e,t){return{usr:e.state,key:e.key,idx:t}}function cu(e,t,n,r){return n===void 0&&(n=null),ol({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Fl(t):t,{state:n,key:t&&t.key||r||ik()})}function Wx(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Fl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ok(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,a=s.history,l=mr.Pop,c=null,d=u();d==null&&(d=0,a.replaceState(ol({},a.state,{idx:d}),""));function u(){return(a.state||{idx:null}).idx}function f(){l=mr.Pop;let b=u(),x=b==null?null:b-d;d=b,c&&c({action:l,location:g.location,delta:x})}function p(b,x){l=mr.Push;let v=cu(g.location,b,x);d=u()+1;let w=Xp(v,d),S=g.createHref(v);try{a.pushState(w,"",S)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;s.location.assign(S)}i&&c&&c({action:l,location:g.location,delta:1})}function m(b,x){l=mr.Replace;let v=cu(g.location,b,x);d=u();let w=Xp(v,d),S=g.createHref(v);a.replaceState(w,"",S),i&&c&&c({action:l,location:g.location,delta:0})}function y(b){let x=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof b=="string"?b:Wx(b);return v=v.replace(/ $/,"%20"),bt(x,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,x)}let g={get action(){return l},get location(){return e(s,a)},listen(b){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Qp,f),c=b,()=>{s.removeEventListener(Qp,f),c=null}},createHref(b){return t(s,b)},createURL:y,encodeLocation(b){let x=y(b);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:m,go(b){return a.go(b)}};return g}var Jp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Jp||(Jp={}));function ak(e,t,n){return n===void 0&&(n="/"),lk(e,t,n,!1)}function lk(e,t,n,r){let s=typeof t=="string"?Fl(t):t,i=Kx(s.pathname||"/",n);if(i==null)return null;let a=Hx(e);ck(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let d=bk(i);l=xk(a[c],d,r)}return l}function Hx(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,a,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(bt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=Fs([r,c.relativePath]),u=n.concat(c);i.children&&i.children.length>0&&(bt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Hx(i.children,t,u,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:gk(d,i.index),routesMeta:u})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))s(i,a);else for(let c of Gx(i.path))s(i,a,c)}),t}function Gx(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let a=Gx(r.join("/")),l=[];return l.push(...a.map(c=>c===""?i:[i,c].join("/"))),s&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function ck(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:vk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const dk=/^:[\w-]+$/,uk=3,fk=2,mk=1,pk=10,hk=-2,Zp=e=>e==="*";function gk(e,t){let n=e.split("/"),r=n.length;return n.some(Zp)&&(r+=hk),t&&(r+=fk),n.filter(s=>!Zp(s)).reduce((s,i)=>s+(dk.test(i)?uk:i===""?mk:pk),r)}function vk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function xk(e,t,n){let{routesMeta:r}=e,s={},i="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,u=i==="/"?t:t.slice(i.length)||"/",f=eh({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),p=c.route;if(!f&&d&&n&&!r[r.length-1].route.index&&(f=eh({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!f)return null;Object.assign(s,f.params),a.push({params:s,pathname:Fs([i,f.pathname]),pathnameBase:wk(Fs([i,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(i=Fs([i,f.pathnameBase]))}return a}function eh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=yk(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],a=i.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((d,u,f)=>{let{paramName:p,isOptional:m}=u;if(p==="*"){let g=l[f]||"";a=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const y=l[f];return m&&!y?d[p]=void 0:d[p]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:a,pattern:e}}function yk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ux(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function bk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ux(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Kx(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const Fs=e=>e.join("/").replace(/\/\/+/g,"/"),wk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/");function Sk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Yx=["post","put","patch","delete"];new Set(Yx);const Nk=["get",...Yx];new Set(Nk);/**
|
|
50
|
-
* React Router v6.30.1
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/function al(){return al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},al.apply(this,arguments)}const kk=h.createContext(null),jk=h.createContext(null),qx=h.createContext(null),zl=h.createContext(null),Bl=h.createContext({outlet:null,matches:[],isDataRoute:!1}),Qx=h.createContext(null);function zf(){return h.useContext(zl)!=null}function Xx(){return zf()||bt(!1),h.useContext(zl).location}function Ck(e,t){return Ek(e,t)}function Ek(e,t,n,r){zf()||bt(!1);let{navigator:s}=h.useContext(qx),{matches:i}=h.useContext(Bl),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let d=Xx(),u;if(t){var f;let b=typeof t=="string"?Fl(t):t;c==="/"||(f=b.pathname)!=null&&f.startsWith(c)||bt(!1),u=b}else u=d;let p=u.pathname||"/",m=p;if(c!=="/"){let b=c.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(b.length).join("/")}let y=ak(e,{pathname:m}),g=Ak(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Fs([c,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Fs([c,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,n,r);return t&&g?h.createElement(zl.Provider,{value:{location:al({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:mr.Pop}},g):g}function _k(){let e=Lk(),t=Sk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:s},n):null,null)}const Rk=h.createElement(_k,null);class Pk extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(Bl.Provider,{value:this.props.routeContext},h.createElement(Qx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Tk(e){let{routeContext:t,match:n,children:r}=e,s=h.useContext(kk);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(Bl.Provider,{value:t},r)}function Ak(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let u=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);u>=0||bt(!1),a=a.slice(0,Math.min(a.length,u+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<a.length;u++){let f=a[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(d=u),f.route.id){let{loaderData:p,errors:m}=n,y=f.route.loader&&p[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||y){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}return a.reduceRight((u,f,p)=>{let m,y=!1,g=null,b=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||Rk,c&&(d<0&&p===0?(y=!0,b=null):d===p&&(y=!0,b=f.route.hydrateFallbackElement||null)));let x=t.concat(a.slice(0,p+1)),v=()=>{let w;return m?w=g:y?w=b:f.route.Component?w=h.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=u,h.createElement(Tk,{match:f,routeContext:{outlet:u,matches:x,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?h.createElement(Pk,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:v(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):v()},null)}var du=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(du||{});function Ik(e){let t=h.useContext(jk);return t||bt(!1),t}function Mk(e){let t=h.useContext(Bl);return t||bt(!1),t}function Ok(e){let t=Mk(),n=t.matches[t.matches.length-1];return n.route.id||bt(!1),n.route.id}function Lk(){var e;let t=h.useContext(Qx),n=Ik(du.UseRouteError),r=Ok(du.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function $k(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function _a(e){bt(!1)}function Dk(e){let{basename:t="/",children:n=null,location:r,navigationType:s=mr.Pop,navigator:i,static:a=!1,future:l}=e;zf()&&bt(!1);let c=t.replace(/^\/*/,"/"),d=h.useMemo(()=>({basename:c,navigator:i,static:a,future:al({v7_relativeSplatPath:!1},l)}),[c,l,i,a]);typeof r=="string"&&(r=Fl(r));let{pathname:u="/",search:f="",hash:p="",state:m=null,key:y="default"}=r,g=h.useMemo(()=>{let b=Kx(u,c);return b==null?null:{location:{pathname:b,search:f,hash:p,state:m,key:y},navigationType:s}},[c,u,f,p,m,y,s]);return g==null?null:h.createElement(qx.Provider,{value:d},h.createElement(zl.Provider,{children:n,value:g}))}function Fk(e){let{children:t,location:n}=e;return Ck(uu(t),n)}new Promise(()=>{});function uu(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(r,s)=>{if(!h.isValidElement(r))return;let i=[...t,s];if(r.type===h.Fragment){n.push.apply(n,uu(r.props.children,i));return}r.type!==_a&&bt(!1),!r.props.index||!r.props.children||bt(!1);let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=uu(r.props.children,i)),n.push(a)}),n}/**
|
|
59
|
-
* React Router DOM v6.30.1
|
|
60
|
-
*
|
|
61
|
-
* Copyright (c) Remix Software Inc.
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the MIT license found in the
|
|
64
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
-
*
|
|
66
|
-
* @license MIT
|
|
67
|
-
*/const zk="6";try{window.__reactRouterVersion=zk}catch{}const Bk="startTransition",th=Gu[Bk];function Vk(e){let{basename:t,children:n,future:r,window:s}=e,i=h.useRef();i.current==null&&(i.current=sk({window:s,v5Compat:!0}));let a=i.current,[l,c]=h.useState({action:a.action,location:a.location}),{v7_startTransition:d}=r||{},u=h.useCallback(f=>{d&&th?th(()=>c(f)):c(f)},[c,d]);return h.useLayoutEffect(()=>a.listen(u),[a,u]),h.useEffect(()=>$k(r),[r]),h.createElement(Dk,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:r})}var nh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(nh||(nh={}));var rh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(rh||(rh={}));var sh=["light","dark"],Uk="(prefers-color-scheme: dark)",Wk=h.createContext(void 0),Hk={setTheme:e=>{},themes:[]},Gk=()=>{var e;return(e=h.useContext(Wk))!=null?e:Hk};h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:a,attrs:l,nonce:c})=>{let d=i==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=s?sh.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(y,g=!1,b=!0)=>{let x=a?a[y]:y,v=g?y+"|| ''":`'${x}'`,w="";return s&&b&&!g&&sh.includes(y)&&(w+=`d.style.colorScheme = '${y}';`),n==="class"?g||x?w+=`c.add(${v})`:w+="null":x&&(w+=`d[s](n,${v})`),w},m=e?`!function(){${u}${p(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${Uk}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}${d?"":"else{"+p(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}else{${p(i,!1,!1)};}${f}}catch(t){}}();`;return h.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var Kk=e=>{switch(e){case"success":return Qk;case"info":return Jk;case"warning":return Xk;case"error":return Zk;default:return null}},Yk=Array(12).fill(0),qk=({visible:e,className:t})=>U.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},U.createElement("div",{className:"sonner-spinner"},Yk.map((n,r)=>U.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Qk=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Xk=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Jk=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Zk=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ej=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},U.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),U.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),tj=()=>{let[e,t]=U.useState(document.hidden);return U.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},fu=1,nj=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:fu++,i=this.toasts.find(l=>l.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:n}),{...l,...e,id:s,dismissible:a,title:n}):l):this.addToast({title:n,...r,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0,i,a=r.then(async c=>{if(i=["resolve",c],U.isValidElement(c))s=!1,this.create({id:n,type:"default",message:c});else if(sj(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:d,description:u})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>a.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||fu++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},mt=new nj,rj=(e,t)=>{let n=(t==null?void 0:t.id)||fu++;return mt.addToast({title:e,...t,id:n}),n},sj=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ij=rj,oj=()=>mt.toasts,aj=()=>mt.getActiveToasts();Object.assign(ij,{success:mt.success,info:mt.info,warning:mt.warning,error:mt.error,custom:mt.custom,message:mt.message,promise:mt.promise,dismiss:mt.dismiss,loading:mt.loading},{getHistory:oj,getToasts:aj});function lj(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}lj(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
68
|
-
`);function aa(e){return e.label!==void 0}var cj=3,dj="32px",uj="16px",ih=4e3,fj=356,mj=14,pj=20,hj=200;function Yt(...e){return e.filter(Boolean).join(" ")}function gj(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var vj=e=>{var t,n,r,s,i,a,l,c,d,u,f;let{invert:p,toast:m,unstyled:y,interacting:g,setHeights:b,visibleToasts:x,heights:v,index:w,toasts:S,expanded:N,removeToast:k,defaultRichColors:j,closeButton:C,style:E,cancelButtonStyle:R,actionButtonStyle:P,className:T="",descriptionClassName:L="",duration:I,position:F,gap:O,loadingIcon:V,expandByDefault:_,classNames:A,icons:D,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:G}=e,[J,Z]=U.useState(null),[me,be]=U.useState(null),[W,ce]=U.useState(!1),[xe,le]=U.useState(!1),[z,X]=U.useState(!1),[he,oe]=U.useState(!1),[ft,Ue]=U.useState(!1),[We,Vt]=U.useState(0),[wt,Fo]=U.useState(0),He=U.useRef(m.duration||I||ih),zo=U.useRef(null),ee=U.useRef(null),Ne=w===0,fe=w+1<=x,ge=m.type,Tt=m.dismissible!==!1,At=m.className||"",we=m.descriptionClassName||"",ms=U.useMemo(()=>v.findIndex(te=>te.toastId===m.id)||0,[v,m.id]),Bo=U.useMemo(()=>{var te;return(te=m.closeButton)!=null?te:C},[m.closeButton,C]),cn=U.useMemo(()=>m.duration||I||ih,[m.duration,I]),vc=U.useRef(0),ps=U.useRef(0),Tm=U.useRef(0),hs=U.useRef(null),[t1,n1]=F.split("-"),Am=U.useMemo(()=>v.reduce((te,ve,Ee)=>Ee>=ms?te:te+ve.height,0),[v,ms]),Im=tj(),r1=m.invert||p,xc=ge==="loading";ps.current=U.useMemo(()=>ms*O+Am,[ms,Am]),U.useEffect(()=>{He.current=cn},[cn]),U.useEffect(()=>{ce(!0)},[]),U.useEffect(()=>{let te=ee.current;if(te){let ve=te.getBoundingClientRect().height;return Fo(ve),b(Ee=>[{toastId:m.id,height:ve,position:m.position},...Ee]),()=>b(Ee=>Ee.filter(Ut=>Ut.toastId!==m.id))}},[b,m.id]),U.useLayoutEffect(()=>{if(!W)return;let te=ee.current,ve=te.style.height;te.style.height="auto";let Ee=te.getBoundingClientRect().height;te.style.height=ve,Fo(Ee),b(Ut=>Ut.find(Wt=>Wt.toastId===m.id)?Ut.map(Wt=>Wt.toastId===m.id?{...Wt,height:Ee}:Wt):[{toastId:m.id,height:Ee,position:m.position},...Ut])},[W,m.title,m.description,b,m.id]);let Yn=U.useCallback(()=>{le(!0),Vt(ps.current),b(te=>te.filter(ve=>ve.toastId!==m.id)),setTimeout(()=>{k(m)},hj)},[m,k,b,ps]);U.useEffect(()=>{if(m.promise&&ge==="loading"||m.duration===1/0||m.type==="loading")return;let te;return N||g||G&&Im?(()=>{if(Tm.current<vc.current){let ve=new Date().getTime()-vc.current;He.current=He.current-ve}Tm.current=new Date().getTime()})():He.current!==1/0&&(vc.current=new Date().getTime(),te=setTimeout(()=>{var ve;(ve=m.onAutoClose)==null||ve.call(m,m),Yn()},He.current)),()=>clearTimeout(te)},[N,g,m,ge,G,Im,Yn]),U.useEffect(()=>{m.delete&&Yn()},[Yn,m.delete]);function s1(){var te,ve,Ee;return D!=null&&D.loading?U.createElement("div",{className:Yt(A==null?void 0:A.loader,(te=m==null?void 0:m.classNames)==null?void 0:te.loader,"sonner-loader"),"data-visible":ge==="loading"},D.loading):V?U.createElement("div",{className:Yt(A==null?void 0:A.loader,(ve=m==null?void 0:m.classNames)==null?void 0:ve.loader,"sonner-loader"),"data-visible":ge==="loading"},V):U.createElement(qk,{className:Yt(A==null?void 0:A.loader,(Ee=m==null?void 0:m.classNames)==null?void 0:Ee.loader),visible:ge==="loading"})}return U.createElement("li",{tabIndex:0,ref:ee,className:Yt(T,At,A==null?void 0:A.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,A==null?void 0:A.default,A==null?void 0:A[ge],(n=m==null?void 0:m.classNames)==null?void 0:n[ge]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:j,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":W,"data-promise":!!m.promise,"data-swiped":ft,"data-removed":xe,"data-visible":fe,"data-y-position":t1,"data-x-position":n1,"data-index":w,"data-front":Ne,"data-swiping":z,"data-dismissible":Tt,"data-type":ge,"data-invert":r1,"data-swipe-out":he,"data-swipe-direction":me,"data-expanded":!!(N||_&&W),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${xe?We:ps.current}px`,"--initial-height":_?"auto":`${wt}px`,...E,...m.style},onDragEnd:()=>{X(!1),Z(null),hs.current=null},onPointerDown:te=>{xc||!Tt||(zo.current=new Date,Vt(ps.current),te.target.setPointerCapture(te.pointerId),te.target.tagName!=="BUTTON"&&(X(!0),hs.current={x:te.clientX,y:te.clientY}))},onPointerUp:()=>{var te,ve,Ee,Ut;if(he||!Tt)return;hs.current=null;let Wt=Number(((te=ee.current)==null?void 0:te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),qn=Number(((ve=ee.current)==null?void 0:ve.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ir=new Date().getTime()-((Ee=zo.current)==null?void 0:Ee.getTime()),Ht=J==="x"?Wt:qn,Qn=Math.abs(Ht)/Ir;if(Math.abs(Ht)>=pj||Qn>.11){Vt(ps.current),(Ut=m.onDismiss)==null||Ut.call(m,m),be(J==="x"?Wt>0?"right":"left":qn>0?"down":"up"),Yn(),oe(!0),Ue(!1);return}X(!1),Z(null)},onPointerMove:te=>{var ve,Ee,Ut,Wt;if(!hs.current||!Tt||((ve=window.getSelection())==null?void 0:ve.toString().length)>0)return;let qn=te.clientY-hs.current.y,Ir=te.clientX-hs.current.x,Ht=(Ee=e.swipeDirections)!=null?Ee:gj(F);!J&&(Math.abs(Ir)>1||Math.abs(qn)>1)&&Z(Math.abs(Ir)>Math.abs(qn)?"x":"y");let Qn={x:0,y:0};J==="y"?(Ht.includes("top")||Ht.includes("bottom"))&&(Ht.includes("top")&&qn<0||Ht.includes("bottom")&&qn>0)&&(Qn.y=qn):J==="x"&&(Ht.includes("left")||Ht.includes("right"))&&(Ht.includes("left")&&Ir<0||Ht.includes("right")&&Ir>0)&&(Qn.x=Ir),(Math.abs(Qn.x)>0||Math.abs(Qn.y)>0)&&Ue(!0),(Ut=ee.current)==null||Ut.style.setProperty("--swipe-amount-x",`${Qn.x}px`),(Wt=ee.current)==null||Wt.style.setProperty("--swipe-amount-y",`${Qn.y}px`)}},Bo&&!m.jsx?U.createElement("button",{"aria-label":Y,"data-disabled":xc,"data-close-button":!0,onClick:xc||!Tt?()=>{}:()=>{var te;Yn(),(te=m.onDismiss)==null||te.call(m,m)},className:Yt(A==null?void 0:A.closeButton,(s=m==null?void 0:m.classNames)==null?void 0:s.closeButton)},(i=D==null?void 0:D.close)!=null?i:ej):null,m.jsx||h.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:U.createElement(U.Fragment,null,ge||m.icon||m.promise?U.createElement("div",{"data-icon":"",className:Yt(A==null?void 0:A.icon,(a=m==null?void 0:m.classNames)==null?void 0:a.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||s1():null,m.type!=="loading"?m.icon||(D==null?void 0:D[ge])||Kk(ge):null):null,U.createElement("div",{"data-content":"",className:Yt(A==null?void 0:A.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},U.createElement("div",{"data-title":"",className:Yt(A==null?void 0:A.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?U.createElement("div",{"data-description":"",className:Yt(L,we,A==null?void 0:A.description,(d=m==null?void 0:m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),h.isValidElement(m.cancel)?m.cancel:m.cancel&&aa(m.cancel)?U.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||R,onClick:te=>{var ve,Ee;aa(m.cancel)&&Tt&&((Ee=(ve=m.cancel).onClick)==null||Ee.call(ve,te),Yn())},className:Yt(A==null?void 0:A.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,h.isValidElement(m.action)?m.action:m.action&&aa(m.action)?U.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||P,onClick:te=>{var ve,Ee;aa(m.action)&&((Ee=(ve=m.action).onClick)==null||Ee.call(ve,te),!te.defaultPrevented&&Yn())},className:Yt(A==null?void 0:A.actionButton,(f=m==null?void 0:m.classNames)==null?void 0:f.actionButton)},m.action.label):null))};function oh(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function xj(e,t){let n={};return[e,t].forEach((r,s)=>{let i=s===1,a=i?"--mobile-offset":"--offset",l=i?uj:dj;function c(d){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${a}-${d}`]=l:n[`${a}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}var yj=h.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:a,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:f,duration:p,style:m,visibleToasts:y=cj,toastOptions:g,dir:b=oh(),gap:x=mj,loadingIcon:v,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:N}=e,[k,j]=U.useState([]),C=U.useMemo(()=>Array.from(new Set([r].concat(k.filter(G=>G.position).map(G=>G.position)))),[k,r]),[E,R]=U.useState([]),[P,T]=U.useState(!1),[L,I]=U.useState(!1),[F,O]=U.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=U.useRef(null),_=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=U.useRef(null),D=U.useRef(!1),Y=U.useCallback(G=>{j(J=>{var Z;return(Z=J.find(me=>me.id===G.id))!=null&&Z.delete||mt.dismiss(G.id),J.filter(({id:me})=>me!==G.id)})},[]);return U.useEffect(()=>mt.subscribe(G=>{if(G.dismiss){j(J=>J.map(Z=>Z.id===G.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{Mx.flushSync(()=>{j(J=>{let Z=J.findIndex(me=>me.id===G.id);return Z!==-1?[...J.slice(0,Z),{...J[Z],...G},...J.slice(Z+1)]:[G,...J]})})})}),[]),U.useEffect(()=>{if(u!=="system"){O(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;let G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:J})=>{O(J?"dark":"light")})}catch{G.addListener(({matches:Z})=>{try{O(Z?"dark":"light")}catch(me){console.error(me)}})}},[u]),U.useEffect(()=>{k.length<=1&&T(!1)},[k]),U.useEffect(()=>{let G=J=>{var Z,me;s.every(be=>J[be]||J.code===be)&&(T(!0),(Z=V.current)==null||Z.focus()),J.code==="Escape"&&(document.activeElement===V.current||(me=V.current)!=null&&me.contains(document.activeElement))&&T(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[s]),U.useEffect(()=>{if(V.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,D.current=!1)}},[V.current]),U.createElement("section",{ref:t,"aria-label":`${S} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((G,J)=>{var Z;let[me,be]=G.split("-");return k.length?U.createElement("ol",{key:G,dir:b==="auto"?oh():b,tabIndex:-1,ref:V,className:l,"data-sonner-toaster":!0,"data-theme":F,"data-y-position":me,"data-lifted":P&&k.length>1&&!i,"data-x-position":be,style:{"--front-toast-height":`${((Z=E[0])==null?void 0:Z.height)||0}px`,"--width":`${fj}px`,"--gap":`${x}px`,...m,...xj(c,d)},onBlur:W=>{D.current&&!W.currentTarget.contains(W.relatedTarget)&&(D.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||D.current||(D.current=!0,A.current=W.relatedTarget)},onMouseEnter:()=>T(!0),onMouseMove:()=>T(!0),onMouseLeave:()=>{L||T(!1)},onDragEnd:()=>T(!1),onPointerDown:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},k.filter(W=>!W.position&&J===0||W.position===G).map((W,ce)=>{var xe,le;return U.createElement(vj,{key:W.id,icons:w,index:ce,toast:W,defaultRichColors:f,duration:(xe=g==null?void 0:g.duration)!=null?xe:p,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:y,closeButton:(le=g==null?void 0:g.closeButton)!=null?le:a,interacting:L,position:G,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:Y,toasts:k.filter(z=>z.position==W.position),heights:E.filter(z=>z.position==W.position),setHeights:R,expandByDefault:i,gap:x,loadingIcon:v,expanded:P,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const bj=({...e})=>{const{theme:t="system"}=Gk();return o.jsx(yj,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},wj=1,Sj=1e6;let Kc=0;function Nj(){return Kc=(Kc+1)%Number.MAX_SAFE_INTEGER,Kc.toString()}const Yc=new Map,ah=e=>{if(Yc.has(e))return;const t=setTimeout(()=>{Yc.delete(e),Ki({type:"REMOVE_TOAST",toastId:e})},Sj);Yc.set(e,t)},kj=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,wj)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?ah(n):e.toasts.forEach(r=>{ah(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Ra=[];let Pa={toasts:[]};function Ki(e){Pa=kj(Pa,e),Ra.forEach(t=>{t(Pa)})}function jj({...e}){const t=Nj(),n=s=>Ki({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Ki({type:"DISMISS_TOAST",toastId:t});return Ki({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function Cj(){const[e,t]=h.useState(Pa);return h.useEffect(()=>(Ra.push(t),()=>{const n=Ra.indexOf(t);n>-1&&Ra.splice(n,1)}),[e]),{...e,toast:jj,dismiss:n=>Ki({type:"DISMISS_TOAST",toastId:n})}}function K(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function lh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Jx(...e){return t=>{let n=!1;const r=e.map(s=>{const i=lh(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():lh(e[s],null)}}}}function ie(...e){return h.useCallback(Jx(...e),e)}function zt(e,t=[]){let n=[];function r(i,a){const l=h.createContext(a),c=n.length;n=[...n,a];const d=f=>{var x;const{scope:p,children:m,...y}=f,g=((x=p==null?void 0:p[e])==null?void 0:x[c])||l,b=h.useMemo(()=>y,Object.values(y));return o.jsx(g.Provider,{value:b,children:m})};d.displayName=i+"Provider";function u(f,p){var g;const m=((g=p==null?void 0:p[e])==null?void 0:g[c])||l,y=h.useContext(m);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=n.map(a=>h.createContext(a));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,Ej(s,...t)]}function Ej(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function vo(e){const t=Rj(e),n=h.forwardRef((r,s)=>{const{children:i,...a}=r,l=h.Children.toArray(i),c=l.find(Tj);if(c){const d=c.props.children,u=l.map(f=>f===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return o.jsx(t,{...a,ref:s,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return o.jsx(t,{...a,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var _j=vo("Slot");function Rj(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const a=Ij(s),l=Aj(i,s.props);return s.type!==h.Fragment&&(l.ref=r?Jx(r,a):a),h.cloneElement(s,l)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zx=Symbol("radix.slottable");function Pj(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Zx,t}function Tj(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zx}function Aj(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Ij(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Vl(e){const t=e+"CollectionProvider",[n,r]=zt(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:b,children:x}=g,v=U.useRef(null),w=U.useRef(new Map).current;return o.jsx(s,{scope:b,itemMap:w,collectionRef:v,children:x})};a.displayName=t;const l=e+"CollectionSlot",c=vo(l),d=U.forwardRef((g,b)=>{const{scope:x,children:v}=g,w=i(l,x),S=ie(b,w.collectionRef);return o.jsx(c,{ref:S,children:v})});d.displayName=l;const u=e+"CollectionItemSlot",f="data-radix-collection-item",p=vo(u),m=U.forwardRef((g,b)=>{const{scope:x,children:v,...w}=g,S=U.useRef(null),N=ie(b,S),k=i(u,x);return U.useEffect(()=>(k.itemMap.set(S,{ref:S,...w}),()=>void k.itemMap.delete(S))),o.jsx(p,{[f]:"",ref:N,children:v})});m.displayName=u;function y(g){const b=i(e+"CollectionConsumer",g);return U.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((k,j)=>w.indexOf(k.ref.current)-w.indexOf(j.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:d,ItemSlot:m},y,r]}var Mj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Q=Mj.reduce((e,t)=>{const n=vo(`Primitive.${t}`),r=h.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function e0(e,t){e&&us.flushSync(()=>e.dispatchEvent(t))}function ze(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Oj(e,t=globalThis==null?void 0:globalThis.document){const n=ze(e);h.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Lj="DismissableLayer",mu="dismissableLayer.update",$j="dismissableLayer.pointerDownOutside",Dj="dismissableLayer.focusOutside",ch,t0=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ul=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...c}=e,d=h.useContext(t0),[u,f]=h.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=h.useState({}),y=ie(t,j=>f(j)),g=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(b),v=u?g.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=v>=x,N=zj(j=>{const C=j.target,E=[...d.branches].some(R=>R.contains(C));!S||E||(s==null||s(j),a==null||a(j),j.defaultPrevented||l==null||l())},p),k=Bj(j=>{const C=j.target;[...d.branches].some(R=>R.contains(C))||(i==null||i(j),a==null||a(j),j.defaultPrevented||l==null||l())},p);return Oj(j=>{v===d.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},p),h.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ch=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),dh(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=ch)}},[u,p,n,d]),h.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),dh())},[u,d]),h.useEffect(()=>{const j=()=>m({});return document.addEventListener(mu,j),()=>document.removeEventListener(mu,j)},[]),o.jsx(Q.div,{...c,ref:y,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:K(e.onFocusCapture,k.onFocusCapture),onBlurCapture:K(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,N.onPointerDownCapture)})});Ul.displayName=Lj;var Fj="DismissableLayerBranch",n0=h.forwardRef((e,t)=>{const n=h.useContext(t0),r=h.useRef(null),s=ie(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),o.jsx(Q.div,{...e,ref:s})});n0.displayName=Fj;function zj(e,t=globalThis==null?void 0:globalThis.document){const n=ze(e),r=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){r0($j,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Bj(e,t=globalThis==null?void 0:globalThis.document){const n=ze(e),r=h.useRef(!1);return h.useEffect(()=>{const s=i=>{i.target&&!r.current&&r0(Dj,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function dh(){const e=new CustomEvent(mu);document.dispatchEvent(e)}function r0(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?e0(s,i):s.dispatchEvent(i)}var Vj=Ul,Uj=n0,Ve=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Wj="Portal",Bf=h.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,i]=h.useState(!1);Ve(()=>i(!0),[]);const a=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?Mx.createPortal(o.jsx(Q.div,{...r,ref:t}),a):null});Bf.displayName=Wj;function Hj(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Kn=e=>{const{present:t,children:n}=e,r=Gj(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=ie(r.ref,Kj(s));return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:i}):null};Kn.displayName="Presence";function Gj(e){const[t,n]=h.useState(),r=h.useRef(null),s=h.useRef(e),i=h.useRef("none"),a=e?"mounted":"unmounted",[l,c]=Hj(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const d=la(r.current);i.current=l==="mounted"?d:"none"},[l]),Ve(()=>{const d=r.current,u=s.current;if(u!==e){const p=i.current,m=la(d);e?c("MOUNT"):m==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&p!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Ve(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=m=>{const g=la(r.current).includes(m.animationName);if(m.target===t&&g&&(c("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},p=m=>{m.target===t&&(i.current=la(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function la(e){return(e==null?void 0:e.animationName)||"none"}function Kj(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yj=Gu[" useInsertionEffect ".trim().toString()]||Ve;function Un({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,a]=qj({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const u=h.useRef(e!==void 0);h.useEffect(()=>{const f=u.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,r])}const d=h.useCallback(u=>{var f;if(l){const p=Qj(u)?u(e):u;p!==e&&((f=a.current)==null||f.call(a,p))}else i(u)},[l,e,i,a]);return[c,d]}function qj({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),s=h.useRef(n),i=h.useRef(t);return Yj(()=>{i.current=t},[t]),h.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}function Qj(e){return typeof e=="function"}var s0=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Xj="VisuallyHidden",Wl=h.forwardRef((e,t)=>o.jsx(Q.span,{...e,ref:t,style:{...s0,...e.style}}));Wl.displayName=Xj;var Jj=Wl,Vf="ToastProvider",[Uf,Zj,eC]=Vl("Toast"),[i0,Z3]=zt("Toast",[eC]),[tC,Hl]=i0(Vf),o0=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=e,[l,c]=h.useState(null),[d,u]=h.useState(0),f=h.useRef(!1),p=h.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Vf}\`. Expected non-empty \`string\`.`),o.jsx(Uf.Provider,{scope:t,children:o.jsx(tC,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:h.useCallback(()=>u(m=>m+1),[]),onToastRemove:h.useCallback(()=>u(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:a})})};o0.displayName=Vf;var a0="ToastViewport",nC=["F8"],pu="toast.viewportPause",hu="toast.viewportResume",l0=h.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=nC,label:s="Notifications ({hotkey})",...i}=e,a=Hl(a0,n),l=Zj(n),c=h.useRef(null),d=h.useRef(null),u=h.useRef(null),f=h.useRef(null),p=ie(t,f,a.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;h.useEffect(()=>{const b=x=>{var w;r.length!==0&&r.every(S=>x[S]||x.code===S)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),h.useEffect(()=>{const b=c.current,x=f.current;if(y&&b&&x){const v=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(pu);x.dispatchEvent(k),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(hu);x.dispatchEvent(k),a.isClosePausedRef.current=!1}},S=k=>{!b.contains(k.relatedTarget)&&w()},N=()=>{b.contains(document.activeElement)||w()};return b.addEventListener("focusin",v),b.addEventListener("focusout",S),b.addEventListener("pointermove",v),b.addEventListener("pointerleave",N),window.addEventListener("blur",v),window.addEventListener("focus",w),()=>{b.removeEventListener("focusin",v),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",v),b.removeEventListener("pointerleave",N),window.removeEventListener("blur",v),window.removeEventListener("focus",w)}}},[y,a.isClosePausedRef]);const g=h.useCallback(({tabbingDirection:b})=>{const v=l().map(w=>{const S=w.ref.current,N=[S,...hC(S)];return b==="forwards"?N:N.reverse()});return(b==="forwards"?v.reverse():v).flat()},[l]);return h.useEffect(()=>{const b=f.current;if(b){const x=v=>{var N,k,j;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const C=document.activeElement,E=v.shiftKey;if(v.target===b&&E){(N=d.current)==null||N.focus();return}const T=g({tabbingDirection:E?"backwards":"forwards"}),L=T.findIndex(I=>I===C);qc(T.slice(L+1))?v.preventDefault():E?(k=d.current)==null||k.focus():(j=u.current)==null||j.focus()}};return b.addEventListener("keydown",x),()=>b.removeEventListener("keydown",x)}},[l,g]),o.jsxs(Uj,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&o.jsx(gu,{ref:d,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"forwards"});qc(b)}}),o.jsx(Uf.Slot,{scope:n,children:o.jsx(Q.ol,{tabIndex:-1,...i,ref:p})}),y&&o.jsx(gu,{ref:u,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"backwards"});qc(b)}})]})});l0.displayName=a0;var c0="ToastFocusProxy",gu=h.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,i=Hl(c0,n);return o.jsx(Wl,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:a=>{var d;const l=a.relatedTarget;!((d=i.viewport)!=null&&d.contains(l))&&r()}})});gu.displayName=c0;var Po="Toast",rC="toast.swipeStart",sC="toast.swipeMove",iC="toast.swipeCancel",oC="toast.swipeEnd",d0=h.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=e,[l,c]=Un({prop:r,defaultProp:s??!0,onChange:i,caller:Po});return o.jsx(Kn,{present:n||l,children:o.jsx(cC,{open:l,...a,ref:t,onClose:()=>c(!1),onPause:ze(e.onPause),onResume:ze(e.onResume),onSwipeStart:K(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:K(e.onSwipeMove,d=>{const{x:u,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:K(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:K(e.onSwipeEnd,d=>{const{x:u,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});d0.displayName=Po;var[aC,lC]=i0(Po,{onClose(){}}),cC=h.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...y}=e,g=Hl(Po,n),[b,x]=h.useState(null),v=ie(t,I=>x(I)),w=h.useRef(null),S=h.useRef(null),N=s||g.duration,k=h.useRef(0),j=h.useRef(N),C=h.useRef(0),{onToastAdd:E,onToastRemove:R}=g,P=ze(()=>{var F;(b==null?void 0:b.contains(document.activeElement))&&((F=g.viewport)==null||F.focus()),a()}),T=h.useCallback(I=>{!I||I===1/0||(window.clearTimeout(C.current),k.current=new Date().getTime(),C.current=window.setTimeout(P,I))},[P]);h.useEffect(()=>{const I=g.viewport;if(I){const F=()=>{T(j.current),d==null||d()},O=()=>{const V=new Date().getTime()-k.current;j.current=j.current-V,window.clearTimeout(C.current),c==null||c()};return I.addEventListener(pu,O),I.addEventListener(hu,F),()=>{I.removeEventListener(pu,O),I.removeEventListener(hu,F)}}},[g.viewport,N,c,d,T]),h.useEffect(()=>{i&&!g.isClosePausedRef.current&&T(N)},[i,N,g.isClosePausedRef,T]),h.useEffect(()=>(E(),()=>R()),[E,R]);const L=h.useMemo(()=>b?v0(b):null,[b]);return g.viewport?o.jsxs(o.Fragment,{children:[L&&o.jsx(dC,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),o.jsx(aC,{scope:n,onClose:P,children:us.createPortal(o.jsx(Uf.ItemSlot,{scope:n,children:o.jsx(Vj,{asChild:!0,onEscapeKeyDown:K(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||P(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Q.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...y,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:K(e.onKeyDown,I=>{I.key==="Escape"&&(l==null||l(I.nativeEvent),I.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:K(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:K(e.onPointerMove,I=>{if(!w.current)return;const F=I.clientX-w.current.x,O=I.clientY-w.current.y,V=!!S.current,_=["left","right"].includes(g.swipeDirection),A=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,D=_?A(0,F):0,Y=_?0:A(0,O),G=I.pointerType==="touch"?10:2,J={x:D,y:Y},Z={originalEvent:I,delta:J};V?(S.current=J,ca(sC,f,Z,{discrete:!1})):uh(J,g.swipeDirection,G)?(S.current=J,ca(rC,u,Z,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(F)>G||Math.abs(O)>G)&&(w.current=null)}),onPointerUp:K(e.onPointerUp,I=>{const F=S.current,O=I.target;if(O.hasPointerCapture(I.pointerId)&&O.releasePointerCapture(I.pointerId),S.current=null,w.current=null,F){const V=I.currentTarget,_={originalEvent:I,delta:F};uh(F,g.swipeDirection,g.swipeThreshold)?ca(oC,m,_,{discrete:!0}):ca(iC,p,_,{discrete:!0}),V.addEventListener("click",A=>A.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),dC=e=>{const{__scopeToast:t,children:n,...r}=e,s=Hl(Po,t),[i,a]=h.useState(!1),[l,c]=h.useState(!1);return mC(()=>a(!0)),h.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:o.jsx(Bf,{asChild:!0,children:o.jsx(Wl,{...r,children:i&&o.jsxs(o.Fragment,{children:[s.label," ",n]})})})},uC="ToastTitle",u0=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return o.jsx(Q.div,{...r,ref:t})});u0.displayName=uC;var fC="ToastDescription",f0=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return o.jsx(Q.div,{...r,ref:t})});f0.displayName=fC;var m0="ToastAction",p0=h.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?o.jsx(g0,{altText:n,asChild:!0,children:o.jsx(Wf,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${m0}\`. Expected non-empty \`string\`.`),null)});p0.displayName=m0;var h0="ToastClose",Wf=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=lC(h0,n);return o.jsx(g0,{asChild:!0,children:o.jsx(Q.button,{type:"button",...r,ref:t,onClick:K(e.onClick,s.onClose)})})});Wf.displayName=h0;var g0=h.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return o.jsx(Q.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function v0(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),pC(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...v0(r))}}),t}function ca(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?e0(s,i):s.dispatchEvent(i)}var uh=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),i=r>s;return t==="left"||t==="right"?i&&r>n:!i&&s>n};function mC(e=()=>{}){const t=ze(e);Ve(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function pC(e){return e.nodeType===e.ELEMENT_NODE}function hC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qc(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var gC=o0,x0=l0,y0=d0,b0=u0,w0=f0,S0=p0,N0=Wf;function k0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=k0(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function j0(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=k0(e))&&(r&&(r+=" "),r+=t);return r}const fh=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,mh=j0,Gl=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return mh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,a=Object.keys(s).map(d=>{const u=n==null?void 0:n[d],f=i==null?void 0:i[d];if(u===null)return null;const p=fh(u)||fh(f);return s[d][p]}),l=n&&Object.entries(n).reduce((d,u)=>{let[f,p]=u;return p===void 0||(d[f]=p),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:p,...m}=u;return Object.entries(m).every(y=>{let[g,b]=y;return Array.isArray(b)?b.includes({...i,...l}[g]):{...i,...l}[g]===b})?[...d,f,p]:d},[]);return mh(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
|
|
69
|
-
* @license lucide-react v0.462.0 - ISC
|
|
70
|
-
*
|
|
71
|
-
* This source code is licensed under the ISC license.
|
|
72
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
-
*/const vC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),C0=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
74
|
-
* @license lucide-react v0.462.0 - ISC
|
|
75
|
-
*
|
|
76
|
-
* This source code is licensed under the ISC license.
|
|
77
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/var xC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
79
|
-
* @license lucide-react v0.462.0 - ISC
|
|
80
|
-
*
|
|
81
|
-
* This source code is licensed under the ISC license.
|
|
82
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/const yC=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...l},c)=>h.createElement("svg",{ref:c,...xC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:C0("lucide",s),...l},[...a.map(([d,u])=>h.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
|
|
84
|
-
* @license lucide-react v0.462.0 - ISC
|
|
85
|
-
*
|
|
86
|
-
* This source code is licensed under the ISC license.
|
|
87
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/const q=(e,t)=>{const n=h.forwardRef(({className:r,...s},i)=>h.createElement(yC,{ref:i,iconNode:t,className:C0(`lucide-${vC(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
89
|
-
* @license lucide-react v0.462.0 - ISC
|
|
90
|
-
*
|
|
91
|
-
* This source code is licensed under the ISC license.
|
|
92
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/const Pr=q("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
94
|
-
* @license lucide-react v0.462.0 - ISC
|
|
95
|
-
*
|
|
96
|
-
* This source code is licensed under the ISC license.
|
|
97
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/const bC=q("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
99
|
-
* @license lucide-react v0.462.0 - ISC
|
|
100
|
-
*
|
|
101
|
-
* This source code is licensed under the ISC license.
|
|
102
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/const wC=q("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
104
|
-
* @license lucide-react v0.462.0 - ISC
|
|
105
|
-
*
|
|
106
|
-
* This source code is licensed under the ISC license.
|
|
107
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/const SC=q("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
109
|
-
* @license lucide-react v0.462.0 - ISC
|
|
110
|
-
*
|
|
111
|
-
* This source code is licensed under the ISC license.
|
|
112
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
-
*/const NC=q("Beaker",[["path",{d:"M4.5 3h15",key:"c7n0jr"}],["path",{d:"M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3",key:"m1uhx7"}],["path",{d:"M6 14h12",key:"4cwo0f"}]]);/**
|
|
114
|
-
* @license lucide-react v0.462.0 - ISC
|
|
115
|
-
*
|
|
116
|
-
* This source code is licensed under the ISC license.
|
|
117
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/const vu=q("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
119
|
-
* @license lucide-react v0.462.0 - ISC
|
|
120
|
-
*
|
|
121
|
-
* This source code is licensed under the ISC license.
|
|
122
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
-
*/const Hf=q("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
124
|
-
* @license lucide-react v0.462.0 - ISC
|
|
125
|
-
*
|
|
126
|
-
* This source code is licensed under the ISC license.
|
|
127
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
-
*/const gt=q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
129
|
-
* @license lucide-react v0.462.0 - ISC
|
|
130
|
-
*
|
|
131
|
-
* This source code is licensed under the ISC license.
|
|
132
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/const $n=q("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
134
|
-
* @license lucide-react v0.462.0 - ISC
|
|
135
|
-
*
|
|
136
|
-
* This source code is licensed under the ISC license.
|
|
137
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/const kC=q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
139
|
-
* @license lucide-react v0.462.0 - ISC
|
|
140
|
-
*
|
|
141
|
-
* This source code is licensed under the ISC license.
|
|
142
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
-
*/const ns=q("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
144
|
-
* @license lucide-react v0.462.0 - ISC
|
|
145
|
-
*
|
|
146
|
-
* This source code is licensed under the ISC license.
|
|
147
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
-
*/const To=q("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
149
|
-
* @license lucide-react v0.462.0 - ISC
|
|
150
|
-
*
|
|
151
|
-
* This source code is licensed under the ISC license.
|
|
152
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
-
*/const Gf=q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
154
|
-
* @license lucide-react v0.462.0 - ISC
|
|
155
|
-
*
|
|
156
|
-
* This source code is licensed under the ISC license.
|
|
157
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
-
*/const E0=q("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
159
|
-
* @license lucide-react v0.462.0 - ISC
|
|
160
|
-
*
|
|
161
|
-
* This source code is licensed under the ISC license.
|
|
162
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
-
*/const _0=q("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
164
|
-
* @license lucide-react v0.462.0 - ISC
|
|
165
|
-
*
|
|
166
|
-
* This source code is licensed under the ISC license.
|
|
167
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
-
*/const ph=q("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
169
|
-
* @license lucide-react v0.462.0 - ISC
|
|
170
|
-
*
|
|
171
|
-
* This source code is licensed under the ISC license.
|
|
172
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
-
*/const jC=q("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
174
|
-
* @license lucide-react v0.462.0 - ISC
|
|
175
|
-
*
|
|
176
|
-
* This source code is licensed under the ISC license.
|
|
177
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
-
*/const Kl=q("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
179
|
-
* @license lucide-react v0.462.0 - ISC
|
|
180
|
-
*
|
|
181
|
-
* This source code is licensed under the ISC license.
|
|
182
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
-
*/const rs=q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
184
|
-
* @license lucide-react v0.462.0 - ISC
|
|
185
|
-
*
|
|
186
|
-
* This source code is licensed under the ISC license.
|
|
187
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
-
*/const CC=q("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);/**
|
|
189
|
-
* @license lucide-react v0.462.0 - ISC
|
|
190
|
-
*
|
|
191
|
-
* This source code is licensed under the ISC license.
|
|
192
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
-
*/const R0=q("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
|
|
194
|
-
* @license lucide-react v0.462.0 - ISC
|
|
195
|
-
*
|
|
196
|
-
* This source code is licensed under the ISC license.
|
|
197
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
-
*/const EC=q("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
199
|
-
* @license lucide-react v0.462.0 - ISC
|
|
200
|
-
*
|
|
201
|
-
* This source code is licensed under the ISC license.
|
|
202
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
-
*/const Ao=q("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
204
|
-
* @license lucide-react v0.462.0 - ISC
|
|
205
|
-
*
|
|
206
|
-
* This source code is licensed under the ISC license.
|
|
207
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
-
*/const _C=q("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
|
|
209
|
-
* @license lucide-react v0.462.0 - ISC
|
|
210
|
-
*
|
|
211
|
-
* This source code is licensed under the ISC license.
|
|
212
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
-
*/const P0=q("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
214
|
-
* @license lucide-react v0.462.0 - ISC
|
|
215
|
-
*
|
|
216
|
-
* This source code is licensed under the ISC license.
|
|
217
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
-
*/const RC=q("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
219
|
-
* @license lucide-react v0.462.0 - ISC
|
|
220
|
-
*
|
|
221
|
-
* This source code is licensed under the ISC license.
|
|
222
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
-
*/const Kf=q("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
224
|
-
* @license lucide-react v0.462.0 - ISC
|
|
225
|
-
*
|
|
226
|
-
* This source code is licensed under the ISC license.
|
|
227
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
-
*/const PC=q("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
229
|
-
* @license lucide-react v0.462.0 - ISC
|
|
230
|
-
*
|
|
231
|
-
* This source code is licensed under the ISC license.
|
|
232
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
-
*/const hh=q("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
234
|
-
* @license lucide-react v0.462.0 - ISC
|
|
235
|
-
*
|
|
236
|
-
* This source code is licensed under the ISC license.
|
|
237
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
-
*/const T0=q("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/**
|
|
239
|
-
* @license lucide-react v0.462.0 - ISC
|
|
240
|
-
*
|
|
241
|
-
* This source code is licensed under the ISC license.
|
|
242
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
-
*/const TC=q("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
244
|
-
* @license lucide-react v0.462.0 - ISC
|
|
245
|
-
*
|
|
246
|
-
* This source code is licensed under the ISC license.
|
|
247
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
-
*/const AC=q("OctagonX",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
249
|
-
* @license lucide-react v0.462.0 - ISC
|
|
250
|
-
*
|
|
251
|
-
* This source code is licensed under the ISC license.
|
|
252
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
-
*/const A0=q("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
254
|
-
* @license lucide-react v0.462.0 - ISC
|
|
255
|
-
*
|
|
256
|
-
* This source code is licensed under the ISC license.
|
|
257
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
-
*/const Io=q("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
259
|
-
* @license lucide-react v0.462.0 - ISC
|
|
260
|
-
*
|
|
261
|
-
* This source code is licensed under the ISC license.
|
|
262
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
-
*/const Yi=q("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
264
|
-
* @license lucide-react v0.462.0 - ISC
|
|
265
|
-
*
|
|
266
|
-
* This source code is licensed under the ISC license.
|
|
267
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
-
*/const xu=q("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
|
|
269
|
-
* @license lucide-react v0.462.0 - ISC
|
|
270
|
-
*
|
|
271
|
-
* This source code is licensed under the ISC license.
|
|
272
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
-
*/const ll=q("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
274
|
-
* @license lucide-react v0.462.0 - ISC
|
|
275
|
-
*
|
|
276
|
-
* This source code is licensed under the ISC license.
|
|
277
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
-
*/const gh=q("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
279
|
-
* @license lucide-react v0.462.0 - ISC
|
|
280
|
-
*
|
|
281
|
-
* This source code is licensed under the ISC license.
|
|
282
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
-
*/const IC=q("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
284
|
-
* @license lucide-react v0.462.0 - ISC
|
|
285
|
-
*
|
|
286
|
-
* This source code is licensed under the ISC license.
|
|
287
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
-
*/const Yl=q("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
289
|
-
* @license lucide-react v0.462.0 - ISC
|
|
290
|
-
*
|
|
291
|
-
* This source code is licensed under the ISC license.
|
|
292
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
-
*/const qi=q("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
294
|
-
* @license lucide-react v0.462.0 - ISC
|
|
295
|
-
*
|
|
296
|
-
* This source code is licensed under the ISC license.
|
|
297
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
-
*/const I0=q("ShieldOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);/**
|
|
299
|
-
* @license lucide-react v0.462.0 - ISC
|
|
300
|
-
*
|
|
301
|
-
* This source code is licensed under the ISC license.
|
|
302
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
-
*/const jn=q("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
304
|
-
* @license lucide-react v0.462.0 - ISC
|
|
305
|
-
*
|
|
306
|
-
* This source code is licensed under the ISC license.
|
|
307
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
-
*/const yu=q("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
309
|
-
* @license lucide-react v0.462.0 - ISC
|
|
310
|
-
*
|
|
311
|
-
* This source code is licensed under the ISC license.
|
|
312
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
-
*/const MC=q("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
314
|
-
* @license lucide-react v0.462.0 - ISC
|
|
315
|
-
*
|
|
316
|
-
* This source code is licensed under the ISC license.
|
|
317
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
-
*/const OC=q("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
319
|
-
* @license lucide-react v0.462.0 - ISC
|
|
320
|
-
*
|
|
321
|
-
* This source code is licensed under the ISC license.
|
|
322
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
-
*/const Yf=q("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
|
|
324
|
-
* @license lucide-react v0.462.0 - ISC
|
|
325
|
-
*
|
|
326
|
-
* This source code is licensed under the ISC license.
|
|
327
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
-
*/const qf=q("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
329
|
-
* @license lucide-react v0.462.0 - ISC
|
|
330
|
-
*
|
|
331
|
-
* This source code is licensed under the ISC license.
|
|
332
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
-
*/const kr=q("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
334
|
-
* @license lucide-react v0.462.0 - ISC
|
|
335
|
-
*
|
|
336
|
-
* This source code is licensed under the ISC license.
|
|
337
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
-
*/const M0=q("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
339
|
-
* @license lucide-react v0.462.0 - ISC
|
|
340
|
-
*
|
|
341
|
-
* This source code is licensed under the ISC license.
|
|
342
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
-
*/const LC=q("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
344
|
-
* @license lucide-react v0.462.0 - ISC
|
|
345
|
-
*
|
|
346
|
-
* This source code is licensed under the ISC license.
|
|
347
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
-
*/const vh=q("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
349
|
-
* @license lucide-react v0.462.0 - ISC
|
|
350
|
-
*
|
|
351
|
-
* This source code is licensed under the ISC license.
|
|
352
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
-
*/const Qi=q("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
354
|
-
* @license lucide-react v0.462.0 - ISC
|
|
355
|
-
*
|
|
356
|
-
* This source code is licensed under the ISC license.
|
|
357
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
-
*/const Qr=q("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Qf="-",$C=e=>{const t=FC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const l=a.split(Qf);return l[0]===""&&l.length!==1&&l.shift(),O0(l,t)||DC(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&r[a]?[...c,...r[a]]:c}}},O0=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?O0(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Qf);return(a=t.validators.find(({validator:l})=>l(i)))==null?void 0:a.classGroupId},xh=/^\[(.+)\]$/,DC=e=>{if(xh.test(e)){const t=xh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},FC=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return BC(Object.entries(e.classGroups),n).forEach(([i,a])=>{bu(a,r,i,t)}),r},bu=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:yh(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(zC(s)){bu(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,a])=>{bu(a,yh(t,i),n,r)})})},yh=(e,t)=>{let n=e;return t.split(Qf).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},zC=e=>e.isThemeGetter,BC=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,l])=>[t+a,l])):i);return[n,s]}):e,VC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return s(i,a),a},set(i,a){n.has(i)?n.set(i,a):s(i,a)}}},L0="!",UC=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,a=l=>{const c=[];let d=0,u=0,f;for(let b=0;b<l.length;b++){let x=l[b];if(d===0){if(x===s&&(r||l.slice(b,b+i)===t)){c.push(l.slice(u,b)),u=b+i;continue}if(x==="/"){f=b;continue}}x==="["?d++:x==="]"&&d--}const p=c.length===0?l:l.substring(u),m=p.startsWith(L0),y=m?p.substring(1):p,g=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:a}):a},WC=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},HC=e=>({cache:VC(e.cacheSize),parseClassName:UC(e),...$C(e)}),GC=/\s+/,KC=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],a=e.trim().split(GC);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{modifiers:u,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(d);let y=!!m,g=r(y?p.substring(0,m):p);if(!g){if(!y){l=d+(l.length>0?" "+l:l);continue}if(g=r(p),!g){l=d+(l.length>0?" "+l:l);continue}y=!1}const b=WC(u).join(":"),x=f?b+L0:b,v=x+g;if(i.includes(v))continue;i.push(v);const w=s(g,y);for(let S=0;S<w.length;++S){const N=w[S];i.push(x+N)}l=d+(l.length>0?" "+l:l)}return l};function YC(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=$0(t))&&(r&&(r+=" "),r+=n);return r}const $0=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=$0(e[r]))&&(n&&(n+=" "),n+=t);return n};function qC(e,...t){let n,r,s,i=a;function a(c){const d=t.reduce((u,f)=>f(u),e());return n=HC(d),r=n.cache.get,s=n.cache.set,i=l,l(c)}function l(c){const d=r(c);if(d)return d;const u=KC(c,n);return s(c,u),u}return function(){return i(YC.apply(null,arguments))}}const ke=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},D0=/^\[(?:([a-z-]+):)?(.+)\]$/i,QC=/^\d+\/\d+$/,XC=new Set(["px","full","screen"]),JC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,e2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,t2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,n2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pn=e=>zs(e)||XC.has(e)||QC.test(e),Jn=e=>hi(e,"length",d2),zs=e=>!!e&&!Number.isNaN(Number(e)),Qc=e=>hi(e,"number",zs),_i=e=>!!e&&Number.isInteger(Number(e)),r2=e=>e.endsWith("%")&&zs(e.slice(0,-1)),se=e=>D0.test(e),Zn=e=>JC.test(e),s2=new Set(["length","size","percentage"]),i2=e=>hi(e,s2,F0),o2=e=>hi(e,"position",F0),a2=new Set(["image","url"]),l2=e=>hi(e,a2,f2),c2=e=>hi(e,"",u2),Ri=()=>!0,hi=(e,t,n)=>{const r=D0.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},d2=e=>ZC.test(e)&&!e2.test(e),F0=()=>!1,u2=e=>t2.test(e),f2=e=>n2.test(e),m2=()=>{const e=ke("colors"),t=ke("spacing"),n=ke("blur"),r=ke("brightness"),s=ke("borderColor"),i=ke("borderRadius"),a=ke("borderSpacing"),l=ke("borderWidth"),c=ke("contrast"),d=ke("grayscale"),u=ke("hueRotate"),f=ke("invert"),p=ke("gap"),m=ke("gradientColorStops"),y=ke("gradientColorStopPositions"),g=ke("inset"),b=ke("margin"),x=ke("opacity"),v=ke("padding"),w=ke("saturate"),S=ke("scale"),N=ke("sepia"),k=ke("skew"),j=ke("space"),C=ke("translate"),E=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",se,t],T=()=>[se,t],L=()=>["",Pn,Jn],I=()=>["auto",zs,se],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",se],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[zs,se];return{cacheSize:500,separator:":",theme:{colors:[Ri],spacing:[Pn,Jn],blur:["none","",Zn,se],brightness:Y(),borderColor:[e],borderRadius:["none","","full",Zn,se],borderSpacing:T(),borderWidth:L(),contrast:Y(),grayscale:A(),hueRotate:Y(),invert:A(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[r2,Jn],inset:P(),margin:P(),opacity:Y(),padding:T(),saturate:Y(),scale:Y(),sepia:A(),skew:Y(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",se]}],container:["container"],columns:[{columns:[Zn]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),se]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",_i,se]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",se]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",_i,se]}],"grid-cols":[{"grid-cols":[Ri]}],"col-start-end":[{col:["auto",{span:["full",_i,se]},se]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Ri]}],"row-start-end":[{row:["auto",{span:[_i,se]},se]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",se]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",se,t]}],"min-w":[{"min-w":[se,t,"min","max","fit"]}],"max-w":[{"max-w":[se,t,"none","full","min","max","fit","prose",{screen:[Zn]},Zn]}],h:[{h:[se,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[se,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Zn,Jn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Qc]}],"font-family":[{font:[Ri]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",se]}],"line-clamp":[{"line-clamp":["none",zs,Qc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Pn,se]}],"list-image":[{"list-image":["none",se]}],"list-style-type":[{list:["none","disc","decimal",se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Pn,Jn]}],"underline-offset":[{"underline-offset":["auto",Pn,se]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),o2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",i2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},l2]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:O()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[Pn,se]}],"outline-w":[{outline:[Pn,Jn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Pn,Jn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Zn,c2]}],"shadow-color":[{shadow:[Ri]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Zn,se]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",se]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",se]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[_i,se]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",se]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Pn,Jn,Qc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},p2=qC(m2);function $(...e){return p2(j0(e))}const h2=gC,z0=h.forwardRef(({className:e,...t},n)=>o.jsx(x0,{ref:n,className:$("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));z0.displayName=x0.displayName;const g2=Gl("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),B0=h.forwardRef(({className:e,variant:t,...n},r)=>o.jsx(y0,{ref:r,className:$(g2({variant:t}),e),...n}));B0.displayName=y0.displayName;const v2=h.forwardRef(({className:e,...t},n)=>o.jsx(S0,{ref:n,className:$("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));v2.displayName=S0.displayName;const V0=h.forwardRef(({className:e,...t},n)=>o.jsx(N0,{ref:n,className:$("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:o.jsx(Qi,{className:"h-4 w-4"})}));V0.displayName=N0.displayName;const U0=h.forwardRef(({className:e,...t},n)=>o.jsx(b0,{ref:n,className:$("text-sm font-semibold",e),...t}));U0.displayName=b0.displayName;const W0=h.forwardRef(({className:e,...t},n)=>o.jsx(w0,{ref:n,className:$("text-sm opacity-90",e),...t}));W0.displayName=w0.displayName;function x2(){const{toasts:e}=Cj();return o.jsxs(h2,{children:[e.map(function({id:t,title:n,description:r,action:s,...i}){return o.jsxs(B0,{...i,children:[o.jsxs("div",{className:"grid gap-1",children:[n&&o.jsx(U0,{children:n}),r&&o.jsx(W0,{children:r})]}),s,o.jsx(V0,{})]},t)}),o.jsx(z0,{})]})}var y2=Gu[" useId ".trim().toString()]||(()=>{}),b2=0;function fs(e){const[t,n]=h.useState(y2());return Ve(()=>{n(r=>r??String(b2++))},[e]),t?`radix-${t}`:""}const w2=["top","right","bottom","left"],jr=Math.min,Nt=Math.max,cl=Math.round,da=Math.floor,kn=e=>({x:e,y:e}),S2={left:"right",right:"left",bottom:"top",top:"bottom"},N2={start:"end",end:"start"};function wu(e,t,n){return Nt(e,jr(t,n))}function Wn(e,t){return typeof e=="function"?e(t):e}function Hn(e){return e.split("-")[0]}function gi(e){return e.split("-")[1]}function Xf(e){return e==="x"?"y":"x"}function Jf(e){return e==="y"?"height":"width"}const k2=new Set(["top","bottom"]);function xn(e){return k2.has(Hn(e))?"y":"x"}function Zf(e){return Xf(xn(e))}function j2(e,t,n){n===void 0&&(n=!1);const r=gi(e),s=Zf(e),i=Jf(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=dl(a)),[a,dl(a)]}function C2(e){const t=dl(e);return[Su(e),t,Su(t)]}function Su(e){return e.replace(/start|end/g,t=>N2[t])}const bh=["left","right"],wh=["right","left"],E2=["top","bottom"],_2=["bottom","top"];function R2(e,t,n){switch(e){case"top":case"bottom":return n?t?wh:bh:t?bh:wh;case"left":case"right":return t?E2:_2;default:return[]}}function P2(e,t,n,r){const s=gi(e);let i=R2(Hn(e),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),t&&(i=i.concat(i.map(Su)))),i}function dl(e){return e.replace(/left|right|bottom|top/g,t=>S2[t])}function T2(e){return{top:0,right:0,bottom:0,left:0,...e}}function H0(e){return typeof e!="number"?T2(e):{top:e,right:e,bottom:e,left:e}}function ul(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Sh(e,t,n){let{reference:r,floating:s}=e;const i=xn(t),a=Zf(t),l=Jf(a),c=Hn(t),d=i==="y",u=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,p=r[l]/2-s[l]/2;let m;switch(c){case"top":m={x:u,y:r.y-s.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-s.width,y:f};break;default:m={x:r.x,y:r.y}}switch(gi(t)){case"start":m[a]-=p*(n&&d?-1:1);break;case"end":m[a]+=p*(n&&d?-1:1);break}return m}const A2=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=Sh(d,r,c),p=r,m={},y=0;for(let g=0;g<l.length;g++){const{name:b,fn:x}=l[g],{x:v,y:w,data:S,reset:N}=await x({x:u,y:f,initialPlacement:r,placement:p,strategy:s,middlewareData:m,rects:d,platform:a,elements:{reference:e,floating:t}});u=v??u,f=w??f,m={...m,[b]:{...m[b],...S}},N&&y<=50&&(y++,typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(d=N.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:u,y:f}=Sh(d,p,c)),g=-1)}return{x:u,y:f,placement:p,strategy:s,middlewareData:m}};async function xo(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=Wn(t,e),y=H0(m),b=l[p?f==="floating"?"reference":"floating":f],x=ul(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=f==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},N=ul(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(x.top-N.top+y.top)/S.y,bottom:(N.bottom-x.bottom+y.bottom)/S.y,left:(x.left-N.left+y.left)/S.x,right:(N.right-x.right+y.right)/S.x}}const I2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Wn(e,t)||{};if(d==null)return{};const f=H0(u),p={x:n,y:r},m=Zf(s),y=Jf(m),g=await a.getDimensions(d),b=m==="y",x=b?"top":"left",v=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[m]-p[m]-i.floating[y],N=p[m]-i.reference[m],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let j=k?k[w]:0;(!j||!await(a.isElement==null?void 0:a.isElement(k)))&&(j=l.floating[w]||i.floating[y]);const C=S/2-N/2,E=j/2-g[y]/2-1,R=jr(f[x],E),P=jr(f[v],E),T=R,L=j-g[y]-P,I=j/2-g[y]/2+C,F=wu(T,I,L),O=!c.arrow&&gi(s)!=null&&I!==F&&i.reference[y]/2-(I<T?R:P)-g[y]/2<0,V=O?I<T?I-T:I-L:0;return{[m]:p[m]+V,data:{[m]:F,centerOffset:I-F-V,...O&&{alignmentOffset:V}},reset:O}}}),M2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...b}=Wn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Hn(s),v=xn(l),w=Hn(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=p||(w||!g?[dl(l)]:C2(l)),k=y!=="none";!p&&k&&N.push(...P2(l,g,y,S));const j=[l,...N],C=await xo(t,b),E=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&E.push(C[x]),f){const I=j2(s,a,S);E.push(C[I[0]],C[I[1]])}if(R=[...R,{placement:s,overflows:E}],!E.every(I=>I<=0)){var P,T;const I=(((P=i.flip)==null?void 0:P.index)||0)+1,F=j[I];if(F&&(!(f==="alignment"?v!==xn(F):!1)||R.every(_=>_.overflows[0]>0&&xn(_.placement)===v)))return{data:{index:I,overflows:R},reset:{placement:F}};let O=(T=R.filter(V=>V.overflows[0]<=0).sort((V,_)=>V.overflows[1]-_.overflows[1])[0])==null?void 0:T.placement;if(!O)switch(m){case"bestFit":{var L;const V=(L=R.filter(_=>{if(k){const A=xn(_.placement);return A===v||A==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(A=>A>0).reduce((A,D)=>A+D,0)]).sort((_,A)=>_[1]-A[1])[0])==null?void 0:L[0];V&&(O=V);break}case"initialPlacement":O=l;break}if(s!==O)return{reset:{placement:O}}}return{}}}};function Nh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kh(e){return w2.some(t=>e[t]>=0)}const O2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Wn(e,t);switch(r){case"referenceHidden":{const i=await xo(t,{...s,elementContext:"reference"}),a=Nh(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:kh(a)}}}case"escaped":{const i=await xo(t,{...s,altBoundary:!0}),a=Nh(i,n.floating);return{data:{escapedOffsets:a,escaped:kh(a)}}}default:return{}}}}},G0=new Set(["left","top"]);async function L2(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Hn(n),l=gi(n),c=xn(n)==="y",d=G0.has(a)?-1:1,u=i&&c?-1:1,f=Wn(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof y=="number"&&(m=l==="end"?y*-1:y),c?{x:m*u,y:p*d}:{x:p*d,y:m*u}}const $2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:a,middlewareData:l}=t,c=await L2(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},D2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x,y:v}=b;return{x,y:v}}},...c}=Wn(e,t),d={x:n,y:r},u=await xo(t,c),f=xn(Hn(s)),p=Xf(f);let m=d[p],y=d[f];if(i){const b=p==="y"?"top":"left",x=p==="y"?"bottom":"right",v=m+u[b],w=m-u[x];m=wu(v,m,w)}if(a){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",v=y+u[b],w=y-u[x];y=wu(v,y,w)}const g=l.fn({...t,[p]:m,[f]:y});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[f]:a}}}}}},F2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Wn(e,t),u={x:n,y:r},f=xn(s),p=Xf(f);let m=u[p],y=u[f];const g=Wn(l,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=p==="y"?"height":"width",S=i.reference[p]-i.floating[w]+b.mainAxis,N=i.reference[p]+i.reference[w]-b.mainAxis;m<S?m=S:m>N&&(m=N)}if(d){var x,v;const w=p==="y"?"width":"height",S=G0.has(Hn(s)),N=i.reference[f]-i.floating[w]+(S&&((x=a.offset)==null?void 0:x[f])||0)+(S?0:b.crossAxis),k=i.reference[f]+i.reference[w]+(S?0:((v=a.offset)==null?void 0:v[f])||0)-(S?b.crossAxis:0);y<N?y=N:y>k&&(y=k)}return{[p]:m,[f]:y}}}},z2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:a,elements:l}=t,{apply:c=()=>{},...d}=Wn(e,t),u=await xo(t,d),f=Hn(s),p=gi(s),m=xn(s)==="y",{width:y,height:g}=i.floating;let b,x;f==="top"||f==="bottom"?(b=f,x=p===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,b=p==="end"?"top":"bottom");const v=g-u.top-u.bottom,w=y-u.left-u.right,S=jr(g-u[b],v),N=jr(y-u[x],w),k=!t.middlewareData.shift;let j=S,C=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=v),k&&!p){const R=Nt(u.left,0),P=Nt(u.right,0),T=Nt(u.top,0),L=Nt(u.bottom,0);m?C=y-2*(R!==0||P!==0?R+P:Nt(u.left,u.right)):j=g-2*(T!==0||L!==0?T+L:Nt(u.top,u.bottom))}await c({...t,availableWidth:C,availableHeight:j});const E=await a.getDimensions(l.floating);return y!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function ql(){return typeof window<"u"}function vi(e){return K0(e)?(e.nodeName||"").toLowerCase():"#document"}function Et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function En(e){var t;return(t=(K0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function K0(e){return ql()?e instanceof Node||e instanceof Et(e).Node:!1}function on(e){return ql()?e instanceof Element||e instanceof Et(e).Element:!1}function Cn(e){return ql()?e instanceof HTMLElement||e instanceof Et(e).HTMLElement:!1}function jh(e){return!ql()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Et(e).ShadowRoot}const B2=new Set(["inline","contents"]);function Mo(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=an(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!B2.has(s)}const V2=new Set(["table","td","th"]);function U2(e){return V2.has(vi(e))}const W2=[":popover-open",":modal"];function Ql(e){return W2.some(t=>{try{return e.matches(t)}catch{return!1}})}const H2=["transform","translate","scale","rotate","perspective"],G2=["transform","translate","scale","rotate","perspective","filter"],K2=["paint","layout","strict","content"];function em(e){const t=tm(),n=on(e)?an(e):e;return H2.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||G2.some(r=>(n.willChange||"").includes(r))||K2.some(r=>(n.contain||"").includes(r))}function Y2(e){let t=Cr(e);for(;Cn(t)&&!ai(t);){if(em(t))return t;if(Ql(t))return null;t=Cr(t)}return null}function tm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const q2=new Set(["html","body","#document"]);function ai(e){return q2.has(vi(e))}function an(e){return Et(e).getComputedStyle(e)}function Xl(e){return on(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Cr(e){if(vi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jh(e)&&e.host||En(e);return jh(t)?t.host:t}function Y0(e){const t=Cr(e);return ai(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cn(t)&&Mo(t)?t:Y0(t)}function yo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Y0(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),a=Et(s);if(i){const l=Nu(a);return t.concat(a,a.visualViewport||[],Mo(s)?s:[],l&&n?yo(l):[])}return t.concat(s,yo(s,[],n))}function Nu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function q0(e){const t=an(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Cn(e),i=s?e.offsetWidth:n,a=s?e.offsetHeight:r,l=cl(n)!==i||cl(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function nm(e){return on(e)?e:e.contextElement}function Bs(e){const t=nm(e);if(!Cn(t))return kn(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=q0(t);let a=(i?cl(n.width):n.width)/r,l=(i?cl(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Q2=kn(0);function Q0(e){const t=Et(e);return!tm()||!t.visualViewport?Q2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function X2(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Et(e)?!1:t}function ss(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=nm(e);let a=kn(1);t&&(r?on(r)&&(a=Bs(r)):a=Bs(e));const l=X2(i,n,r)?Q0(i):kn(0);let c=(s.left+l.x)/a.x,d=(s.top+l.y)/a.y,u=s.width/a.x,f=s.height/a.y;if(i){const p=Et(i),m=r&&on(r)?Et(r):r;let y=p,g=Nu(y);for(;g&&r&&m!==y;){const b=Bs(g),x=g.getBoundingClientRect(),v=an(g),w=x.left+(g.clientLeft+parseFloat(v.paddingLeft))*b.x,S=x.top+(g.clientTop+parseFloat(v.paddingTop))*b.y;c*=b.x,d*=b.y,u*=b.x,f*=b.y,c+=w,d+=S,y=Et(g),g=Nu(y)}}return ul({width:u,height:f,x:c,y:d})}function rm(e,t){const n=Xl(e).scrollLeft;return t?t.left+n:ss(En(e)).left+n}function X0(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:rm(e,r)),i=r.top+t.scrollTop;return{x:s,y:i}}function J2(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",a=En(r),l=t?Ql(t.floating):!1;if(r===a||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=kn(1);const u=kn(0),f=Cn(r);if((f||!f&&!i)&&((vi(r)!=="body"||Mo(a))&&(c=Xl(r)),Cn(r))){const m=ss(r);d=Bs(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}const p=a&&!f&&!i?X0(a,c,!0):kn(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x+p.x,y:n.y*d.y-c.scrollTop*d.y+u.y+p.y}}function Z2(e){return Array.from(e.getClientRects())}function eE(e){const t=En(e),n=Xl(e),r=e.ownerDocument.body,s=Nt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Nt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+rm(e);const l=-n.scrollTop;return an(r).direction==="rtl"&&(a+=Nt(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:l}}function tE(e,t){const n=Et(e),r=En(e),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,c=0;if(s){i=s.width,a=s.height;const d=tm();(!d||d&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:i,height:a,x:l,y:c}}const nE=new Set(["absolute","fixed"]);function rE(e,t){const n=ss(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Cn(e)?Bs(e):kn(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:a,height:l,x:c,y:d}}function Ch(e,t,n){let r;if(t==="viewport")r=tE(e,n);else if(t==="document")r=eE(En(e));else if(on(t))r=rE(t,n);else{const s=Q0(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ul(r)}function J0(e,t){const n=Cr(e);return n===t||!on(n)||ai(n)?!1:an(n).position==="fixed"||J0(n,t)}function sE(e,t){const n=t.get(e);if(n)return n;let r=yo(e,[],!1).filter(l=>on(l)&&vi(l)!=="body"),s=null;const i=an(e).position==="fixed";let a=i?Cr(e):e;for(;on(a)&&!ai(a);){const l=an(a),c=em(a);!c&&l.position==="fixed"&&(s=null),(i?!c&&!s:!c&&l.position==="static"&&!!s&&nE.has(s.position)||Mo(a)&&!c&&J0(e,a))?r=r.filter(u=>u!==a):s=l,a=Cr(a)}return t.set(e,r),r}function iE(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?Ql(t)?[]:sE(t,this._c):[].concat(n),r],l=a[0],c=a.reduce((d,u)=>{const f=Ch(t,u,s);return d.top=Nt(f.top,d.top),d.right=jr(f.right,d.right),d.bottom=jr(f.bottom,d.bottom),d.left=Nt(f.left,d.left),d},Ch(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function oE(e){const{width:t,height:n}=q0(e);return{width:t,height:n}}function aE(e,t,n){const r=Cn(t),s=En(t),i=n==="fixed",a=ss(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=kn(0);function d(){c.x=rm(s)}if(r||!r&&!i)if((vi(t)!=="body"||Mo(s))&&(l=Xl(t)),r){const m=ss(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&d();i&&!r&&s&&d();const u=s&&!r&&!i?X0(s,l):kn(0),f=a.left+l.scrollLeft-c.x-u.x,p=a.top+l.scrollTop-c.y-u.y;return{x:f,y:p,width:a.width,height:a.height}}function Xc(e){return an(e).position==="static"}function Eh(e,t){if(!Cn(e)||an(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return En(e)===n&&(n=n.ownerDocument.body),n}function Z0(e,t){const n=Et(e);if(Ql(e))return n;if(!Cn(e)){let s=Cr(e);for(;s&&!ai(s);){if(on(s)&&!Xc(s))return s;s=Cr(s)}return n}let r=Eh(e,t);for(;r&&U2(r)&&Xc(r);)r=Eh(r,t);return r&&ai(r)&&Xc(r)&&!em(r)?n:r||Y2(e)||n}const lE=async function(e){const t=this.getOffsetParent||Z0,n=this.getDimensions,r=await n(e.floating);return{reference:aE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cE(e){return an(e).direction==="rtl"}const dE={convertOffsetParentRelativeRectToViewportRelativeRect:J2,getDocumentElement:En,getClippingRect:iE,getOffsetParent:Z0,getElementRects:lE,getClientRects:Z2,getDimensions:oE,getScale:Bs,isElement:on,isRTL:cE};function ey(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uE(e,t){let n=null,r;const s=En(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:f,width:p,height:m}=d;if(l||t(),!p||!m)return;const y=da(f),g=da(s.clientWidth-(u+p)),b=da(s.clientHeight-(f+m)),x=da(u),w={rootMargin:-y+"px "+-g+"px "+-b+"px "+-x+"px",threshold:Nt(0,jr(1,c))||1};let S=!0;function N(k){const j=k[0].intersectionRatio;if(j!==c){if(!S)return a();j?a(!1,j):r=setTimeout(()=>{a(!1,1e-7)},1e3)}j===1&&!ey(d,e.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(N,{...w,root:s.ownerDocument})}catch{n=new IntersectionObserver(N,w)}n.observe(e)}return a(!0),i}function fE(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=nm(e),u=s||i?[...d?yo(d):[],...yo(t)]:[];u.forEach(x=>{s&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=d&&l?uE(d,n):null;let p=-1,m=null;a&&(m=new ResizeObserver(x=>{let[v]=x;v&&v.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),d&&!c&&m.observe(d),m.observe(t));let y,g=c?ss(e):null;c&&b();function b(){const x=ss(e);g&&!ey(g,x)&&n(),g=x,y=requestAnimationFrame(b)}return n(),()=>{var x;u.forEach(v=>{s&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(y)}}const mE=$2,pE=D2,hE=M2,gE=z2,vE=O2,_h=I2,xE=F2,yE=(e,t,n)=>{const r=new Map,s={platform:dE,...n},i={...s.platform,_c:r};return A2(e,t,{...s,platform:i})};var bE=typeof document<"u",wE=function(){},Ta=bE?h.useLayoutEffect:wE;function fl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!fl(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!fl(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ty(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rh(e,t){const n=ty(e);return Math.round(t*n)/n}function Jc(e){const t=h.useRef(e);return Ta(()=>{t.current=e}),t}function SE(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=h.useState(r);fl(p,r)||m(r);const[y,g]=h.useState(null),[b,x]=h.useState(null),v=h.useCallback(_=>{_!==k.current&&(k.current=_,g(_))},[]),w=h.useCallback(_=>{_!==j.current&&(j.current=_,x(_))},[]),S=i||y,N=a||b,k=h.useRef(null),j=h.useRef(null),C=h.useRef(u),E=c!=null,R=Jc(c),P=Jc(s),T=Jc(d),L=h.useCallback(()=>{if(!k.current||!j.current)return;const _={placement:t,strategy:n,middleware:p};P.current&&(_.platform=P.current),yE(k.current,j.current,_).then(A=>{const D={...A,isPositioned:T.current!==!1};I.current&&!fl(C.current,D)&&(C.current=D,us.flushSync(()=>{f(D)}))})},[p,t,n,P,T]);Ta(()=>{d===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[d]);const I=h.useRef(!1);Ta(()=>(I.current=!0,()=>{I.current=!1}),[]),Ta(()=>{if(S&&(k.current=S),N&&(j.current=N),S&&N){if(R.current)return R.current(S,N,L);L()}},[S,N,L,R,E]);const F=h.useMemo(()=>({reference:k,floating:j,setReference:v,setFloating:w}),[v,w]),O=h.useMemo(()=>({reference:S,floating:N}),[S,N]),V=h.useMemo(()=>{const _={position:n,left:0,top:0};if(!O.floating)return _;const A=Rh(O.floating,u.x),D=Rh(O.floating,u.y);return l?{..._,transform:"translate("+A+"px, "+D+"px)",...ty(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:D}},[n,l,O.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:L,refs:F,elements:O,floatingStyles:V}),[u,L,F,O,V])}const NE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?_h({element:r.current,padding:s}).fn(n):{}:r?_h({element:r,padding:s}).fn(n):{}}}},kE=(e,t)=>({...mE(e),options:[e,t]}),jE=(e,t)=>({...pE(e),options:[e,t]}),CE=(e,t)=>({...xE(e),options:[e,t]}),EE=(e,t)=>({...hE(e),options:[e,t]}),_E=(e,t)=>({...gE(e),options:[e,t]}),RE=(e,t)=>({...vE(e),options:[e,t]}),PE=(e,t)=>({...NE(e),options:[e,t]});var TE="Arrow",ny=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return o.jsx(Q.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});ny.displayName=TE;var AE=ny;function sm(e){const[t,n]=h.useState(void 0);return Ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,l=d.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var im="Popper",[ry,Jl]=zt(im),[IE,sy]=ry(im),iy=e=>{const{__scopePopper:t,children:n}=e,[r,s]=h.useState(null);return o.jsx(IE,{scope:t,anchor:r,onAnchorChange:s,children:n})};iy.displayName=im;var oy="PopperAnchor",ay=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=sy(oy,n),a=h.useRef(null),l=ie(t,a);return h.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:o.jsx(Q.div,{...s,ref:l})});ay.displayName=oy;var om="PopperContent",[ME,OE]=ry(om),ly=h.forwardRef((e,t)=>{var W,ce,xe,le,z,X;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:y,...g}=e,b=sy(om,n),[x,v]=h.useState(null),w=ie(t,he=>v(he)),[S,N]=h.useState(null),k=sm(S),j=(k==null?void 0:k.width)??0,C=(k==null?void 0:k.height)??0,E=r+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},P=Array.isArray(d)?d:[d],T=P.length>0,L={padding:R,boundary:P.filter($E),altBoundary:T},{refs:I,floatingStyles:F,placement:O,isPositioned:V,middlewareData:_}=SE({strategy:"fixed",placement:E,whileElementsMounted:(...he)=>fE(...he,{animationFrame:m==="always"}),elements:{reference:b.anchor},middleware:[kE({mainAxis:s+C,alignmentAxis:a}),c&&jE({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?CE():void 0,...L}),c&&EE({...L}),_E({...L,apply:({elements:he,rects:oe,availableWidth:ft,availableHeight:Ue})=>{const{width:We,height:Vt}=oe.reference,wt=he.floating.style;wt.setProperty("--radix-popper-available-width",`${ft}px`),wt.setProperty("--radix-popper-available-height",`${Ue}px`),wt.setProperty("--radix-popper-anchor-width",`${We}px`),wt.setProperty("--radix-popper-anchor-height",`${Vt}px`)}}),S&&PE({element:S,padding:l}),DE({arrowWidth:j,arrowHeight:C}),p&&RE({strategy:"referenceHidden",...L})]}),[A,D]=uy(O),Y=ze(y);Ve(()=>{V&&(Y==null||Y())},[V,Y]);const G=(W=_.arrow)==null?void 0:W.x,J=(ce=_.arrow)==null?void 0:ce.y,Z=((xe=_.arrow)==null?void 0:xe.centerOffset)!==0,[me,be]=h.useState();return Ve(()=>{x&&be(window.getComputedStyle(x).zIndex)},[x]),o.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:V?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(le=_.transformOrigin)==null?void 0:le.x,(z=_.transformOrigin)==null?void 0:z.y].join(" "),...((X=_.hide)==null?void 0:X.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(ME,{scope:n,placedSide:A,onArrowChange:N,arrowX:G,arrowY:J,shouldHideArrow:Z,children:o.jsx(Q.div,{"data-side":A,"data-align":D,...g,ref:w,style:{...g.style,animation:V?void 0:"none"}})})})});ly.displayName=om;var cy="PopperArrow",LE={top:"bottom",right:"left",bottom:"top",left:"right"},dy=h.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=OE(cy,r),a=LE[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(AE,{...s,ref:n,style:{...s.style,display:"block"}})})});dy.displayName=cy;function $E(e){return e!==null}var DE=e=>({name:"transformOrigin",options:e,fn(t){var b,x,v;const{placement:n,rects:r,middlewareData:s}=t,a=((b=s.arrow)==null?void 0:b.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,u]=uy(n),f={start:"0%",center:"50%",end:"100%"}[u],p=(((x=s.arrow)==null?void 0:x.x)??0)+l/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let y="",g="";return d==="bottom"?(y=a?f:`${p}px`,g=`${-c}px`):d==="top"?(y=a?f:`${p}px`,g=`${r.floating.height+c}px`):d==="right"?(y=`${-c}px`,g=a?f:`${m}px`):d==="left"&&(y=`${r.floating.width+c}px`,g=a?f:`${m}px`),{data:{x:y,y:g}}}});function uy(e){const[t,n="center"]=e.split("-");return[t,n]}var fy=iy,my=ay,py=ly,hy=dy,[Zl,e4]=zt("Tooltip",[Jl]),ec=Jl(),gy="TooltipProvider",FE=700,ku="tooltip.open",[zE,am]=Zl(gy),vy=e=>{const{__scopeTooltip:t,delayDuration:n=FE,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,a=h.useRef(!0),l=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),o.jsx(zE,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})};vy.displayName=gy;var bo="Tooltip",[BE,tc]=Zl(bo),xy=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=e,c=am(bo,e.__scopeTooltip),d=ec(t),[u,f]=h.useState(null),p=fs(),m=h.useRef(0),y=a??c.disableHoverableContent,g=l??c.delayDuration,b=h.useRef(!1),[x,v]=Un({prop:r,defaultProp:s??!1,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(ku))):c.onClose(),i==null||i(j)},caller:bo}),w=h.useMemo(()=>x?b.current?"delayed-open":"instant-open":"closed",[x]),S=h.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b.current=!1,v(!0)},[v]),N=h.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v(!1)},[v]),k=h.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{b.current=!0,v(!0),m.current=0},g)},[g,v]);return h.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),o.jsx(fy,{...d,children:o.jsx(BE,{scope:t,contentId:p,open:x,stateAttribute:w,trigger:u,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?k():S()},[c.isOpenDelayedRef,k,S]),onTriggerLeave:h.useCallback(()=>{y?N():(window.clearTimeout(m.current),m.current=0)},[N,y]),onOpen:S,onClose:N,disableHoverableContent:y,children:n})})};xy.displayName=bo;var ju="TooltipTrigger",yy=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=tc(ju,n),i=am(ju,n),a=ec(n),l=h.useRef(null),c=ie(t,l,s.onTriggerChange),d=h.useRef(!1),u=h.useRef(!1),f=h.useCallback(()=>d.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),o.jsx(my,{asChild:!0,...a,children:o.jsx(Q.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:K(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:K(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:K(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:K(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:K(e.onBlur,s.onClose),onClick:K(e.onClick,s.onClose)})})});yy.displayName=ju;var VE="TooltipPortal",[t4,UE]=Zl(VE,{forceMount:void 0}),li="TooltipContent",by=h.forwardRef((e,t)=>{const n=UE(li,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,a=tc(li,e.__scopeTooltip);return o.jsx(Kn,{present:r||a.open,children:a.disableHoverableContent?o.jsx(wy,{side:s,...i,ref:t}):o.jsx(WE,{side:s,...i,ref:t})})}),WE=h.forwardRef((e,t)=>{const n=tc(li,e.__scopeTooltip),r=am(li,e.__scopeTooltip),s=h.useRef(null),i=ie(t,s),[a,l]=h.useState(null),{trigger:c,onClose:d}=n,u=s.current,{onPointerInTransitChange:f}=r,p=h.useCallback(()=>{l(null),f(!1)},[f]),m=h.useCallback((y,g)=>{const b=y.currentTarget,x={x:y.clientX,y:y.clientY},v=qE(x,b.getBoundingClientRect()),w=QE(x,v),S=XE(g.getBoundingClientRect()),N=ZE([...w,...S]);l(N),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(c&&u){const y=b=>m(b,u),g=b=>m(b,c);return c.addEventListener("pointerleave",y),u.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",g)}}},[c,u,m,p]),h.useEffect(()=>{if(a){const y=g=>{const b=g.target,x={x:g.clientX,y:g.clientY},v=(c==null?void 0:c.contains(b))||(u==null?void 0:u.contains(b)),w=!JE(x,a);v?p():w&&(p(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,u,a,d,p]),o.jsx(wy,{...e,ref:i})}),[HE,GE]=Zl(bo,{isInside:!1}),KE=Pj("TooltipContent"),wy=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=e,c=tc(li,n),d=ec(n),{onClose:u}=c;return h.useEffect(()=>(document.addEventListener(ku,u),()=>document.removeEventListener(ku,u)),[u]),h.useEffect(()=>{if(c.trigger){const f=p=>{const m=p.target;m!=null&&m.contains(c.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,u]),o.jsx(Ul,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:o.jsxs(py,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(KE,{children:r}),o.jsx(HE,{scope:n,isInside:!0,children:o.jsx(Jj,{id:c.contentId,role:"tooltip",children:s||r})})]})})});by.displayName=li;var Sy="TooltipArrow",YE=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=ec(n);return GE(Sy,n).isInside?null:o.jsx(hy,{...s,...r,ref:t})});YE.displayName=Sy;function qE(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function QE(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function XE(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function JE(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const l=t[i],c=t[a],d=l.x,u=l.y,f=c.x,p=c.y;u>r!=p>r&&n<(f-d)*(r-u)/(p-u)+d&&(s=!s)}return s}function ZE(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),e_(t)}function e_(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var t_=vy,n_=xy,r_=yy,Ny=by;const s_=t_,i_=n_,o_=r_,ky=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>o.jsx(Ny,{ref:r,sideOffset:t,className:$("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));ky.displayName=Ny.displayName;const a_="modulepreload",l_=function(e){return"/"+e},Ph={},ml=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=l_(c),c in Ph)return;Ph[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":a_,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};async function jy(e,t,n,r,s){const{runSwarmSimulation:i}=await ml(async()=>{const{runSwarmSimulation:l}=await Promise.resolve().then(()=>eR);return{runSwarmSimulation:l}},void 0);return{result:await i(e,t,n,r),source:"echelon-native"}}function c_(e,t,n){const r=[],s=e.toLowerCase();return n.outcome.toLowerCase(),(s.includes("oil")||s.includes("gas")||s.includes("energy")||s.includes("price"))&&r.push("Strategic petroleum reserve release","Fuel tax adjustment","Refinery capacity incentives","Alternative energy subsidies","Import diversification"),(s.includes("strait")||s.includes("military")||s.includes("war")||s.includes("conflict")||s.includes("sanctions"))&&r.push("Diplomatic engagement","Coalition building","Sanctions/trade policy","Military posture adjustment","Back-channel communication"),(s.includes("regulation")||s.includes("law")||s.includes("compliance")||s.includes("policy"))&&r.push("Lobbying and advocacy","Compliance framework investment","Industry coalition formation","Public comment campaigns","Alternative regulatory proposals"),(s.includes("breach")||s.includes("crisis")||s.includes("scandal")||s.includes("reputation"))&&r.push("Transparent disclosure","Stakeholder communication plan","Third-party audit/investigation","Remediation program","Leadership accountability"),(s.includes("market")||s.includes("company")||s.includes("business")||s.includes("startup"))&&r.push("Pricing strategy","Partnership/acquisition","Market positioning pivot","Capital allocation","Talent/team restructuring"),r.length===0&&r.push("Stakeholder engagement","Resource reallocation","Communication strategy","Policy change","Coalition building"),r}function d_(e,t,n,r){const s=[],i=t.priority??"important",a=t.red_lines??[];s.push({id:"strategy_direct",label:"Direct Path",description:`Aggressive, multi-lever approach to reach "${t.outcome}" as quickly as possible. Uses the most available levers simultaneously for maximum force.`,steps:u_(t,r),levers_used:r.slice(0,3),success_probability:i==="critical"?.55:.45,estimated_timeframe:t.timeframe??"30 days",risk:"high",red_line_violations:Zc("direct",a,r.slice(0,3)),dependencies:["Multiple levers must be available simultaneously","Stakeholders must not coordinate opposition","No secondary crisis emerges during execution"],failure_modes:["Aggressive action triggers backlash coalition","Resource overcommitment leaves no fallback","Speed creates execution errors"],likely_allies:n.filter(c=>c.disposition==="supportive").map(c=>c.id),likely_opponents:n.filter(c=>c.disposition==="hostile").map(c=>c.id)});const l=n.filter(c=>c.disposition==="supportive"||c.disposition==="neutral");return s.push({id:"strategy_coalition",label:"Coalition Path",description:`Build a stakeholder coalition first, then apply coordinated pressure toward "${t.outcome}". Slower but more sustainable — collective action is harder to resist.`,steps:f_(t,r,l),levers_used:["Coalition building",...r.slice(0,2)],success_probability:.6,estimated_timeframe:Th(t.timeframe??"30 days",1.5),risk:"moderate",red_line_violations:Zc("coalition",a,["Coalition building",...r.slice(0,2)]),dependencies:["Key neutral stakeholders are persuadable","Coalition members maintain alignment throughout execution","No external shock dissolves the coalition"],failure_modes:["Coalition fractures under pressure","Opponents form counter-coalition faster","Consensus-building delays miss the window"],likely_allies:l.map(c=>c.id),likely_opponents:n.filter(c=>c.disposition==="hostile").map(c=>c.id)}),s.push({id:"strategy_incremental",label:"Incremental Path",description:`Move toward "${t.outcome}" through small, reversible steps. Each step is tested before committing further. Preserves optionality.`,steps:m_(t,r),levers_used:r.slice(0,2),success_probability:.65,estimated_timeframe:Th(t.timeframe??"30 days",2),risk:"low",red_line_violations:[],dependencies:["Sufficient time to iterate","Each step produces measurable feedback","The goal remains viable throughout the process"],failure_modes:["Window of opportunity closes before full execution","Incremental moves are individually too small to create momentum","Competitors move faster with bolder strategies"],likely_allies:n.filter(c=>c.disposition!=="hostile").map(c=>c.id)}),r.length>=3&&s.push({id:"strategy_asymmetric",label:"Asymmetric Path",description:`Find the one lever that has outsized impact on achieving "${t.outcome}". Instead of pushing many levers, find the fulcrum.`,steps:p_(t,r),levers_used:[r[r.length-1]],success_probability:.35,estimated_timeframe:t.timeframe??"30 days",risk:"moderate",red_line_violations:Zc("asymmetric",a,[r[r.length-1]]),dependencies:["The identified fulcrum lever actually has the projected influence","Opponents don't anticipate this approach","No defensive positions are pre-established against this lever"],failure_modes:["The fulcrum lever doesn't have the expected effect","Narrow approach is easily countered once recognized","Success depends on a single point of leverage that may not hold"]}),s}function u_(e,t){const n=[],r=e.timeframe??"30 days";return n.push({order:1,action:"Deploy primary lever immediately",timeframe:"Day 1-3",lever:t[0]??"Primary action",expected_effect:"Establish momentum and signal commitment to the goal",risk:"Early commitment before full information"}),t.length>=2&&n.push({order:2,action:"Activate secondary lever to create pressure from a different angle",timeframe:"Day 3-7",lever:t[1],expected_effect:"Create multi-directional pressure that's harder to resist",risk:"Resource strain from parallel execution"}),t.length>=3&&n.push({order:3,action:"Apply tertiary lever to close remaining gaps",timeframe:"Day 7-14",lever:t[2],expected_effect:"Address residual resistance and accelerate toward goal",risk:"Overextension if earlier levers haven't produced results"}),n.push({order:n.length+1,action:"Evaluate progress against success criteria and adjust",timeframe:`Day 14-${r}`,lever:"Assessment and adjustment",expected_effect:"Course correction based on actual results vs. projections",risk:"Sunk cost bias may prevent necessary pivots"}),n}function f_(e,t,n){return[{order:1,action:`Build coalition with ${n.length>0?n.map(r=>r.id).slice(0,3).join(", "):"key neutral stakeholders"}`,timeframe:"Week 1-2",lever:"Coalition building",expected_effect:"Create collective leverage that exceeds individual power",risk:"Coalition formation takes time; window may narrow"},{order:2,action:"Align coalition on shared strategy and communication",timeframe:"Week 2-3",lever:"Coordination",expected_effect:"Unified messaging prevents opponents from dividing the coalition",risk:"Internal disagreements may surface during alignment"},{order:3,action:"Execute coordinated lever deployment",timeframe:"Week 3-4",lever:t[0]??"Primary collective action",expected_effect:`Coalition moves together toward "${e.outcome}"`,risk:"Weakest coalition member may defect under pressure"},{order:4,action:"Sustain pressure and consolidate gains",timeframe:"Week 4+",lever:t[1]??"Sustained engagement",expected_effect:"Lock in progress and prevent rollback",risk:"Coalition fatigue and attention drift"}]}function m_(e,t){return[{order:1,action:"Take smallest possible step toward the goal to test feasibility",timeframe:"Week 1",lever:t[0]??"Pilot action",expected_effect:"Generate signal about whether this direction works",risk:"Minimal — designed to be reversible"},{order:2,action:"Evaluate step 1 results against success criteria",timeframe:"Week 2",lever:"Assessment",expected_effect:"Determine if the approach is viable before scaling",risk:"May not be enough data for confident evaluation"},{order:3,action:"Scale up if step 1 produced positive signal; pivot if not",timeframe:"Week 3-4",lever:t[1]??t[0]??"Scaled action",expected_effect:"Either accelerate a proven approach or redirect resources",risk:"Competitors may move faster with bolder approaches"},{order:4,action:"Continue test-and-scale cycle until success criteria met",timeframe:"Ongoing",lever:"Iterative execution",expected_effect:"Converge toward the goal through validated learning",risk:"Window of opportunity may close before iteration completes"}]}function p_(e,t){const n=t[t.length-1];return[{order:1,action:`Identify the highest-leverage point in the system — test "${n}"`,timeframe:"Day 1-5",lever:"Analysis and targeting",expected_effect:"Find the single point where minimal force creates maximum effect",risk:"Analysis may identify the wrong fulcrum"},{order:2,action:`Prepare and execute asymmetric move using ${n}`,timeframe:"Day 5-10",lever:n,expected_effect:"Disproportionate impact through a single, well-targeted intervention",risk:"If the fulcrum doesn't hold, there's no backup in progress"},{order:3,action:"Exploit the opening created by the asymmetric move",timeframe:"Day 10-20",lever:"Exploitation of advantage",expected_effect:"Convert initial disruption into sustained progress toward goal",risk:"Opponents may adapt quickly once they understand the approach"}]}function Zc(e,t,n){const r=[];for(const s of t){const i=s.toLowerCase();for(const a of n){const l=a.toLowerCase();(i.includes("military")&&l.includes("military")||i.includes("tax")&&l.includes("tax")||i.includes("force")&&l.includes("force")||i.includes("sanctions")&&l.includes("sanction"))&&r.push(`Strategy "${e}" uses "${a}" which may conflict with red line: "${s}"`)}}return r}function Th(e,t){const n=e.match(/(\d+)\s*(day|week|month|year)/i);if(!n)return e;const r=parseInt(n[1]),s=n[2].toLowerCase();return`${Math.ceil(r*t)} ${s}s`}async function h_(e,t,n,r,s){const i=`${t} [Strategy being tested: ${e.label} — ${e.description}]`,a={id:e.id,label:e.label,description:e.description,projected_outcome:`Goal: ${n.outcome}`,probability:e.success_probability,risk:e.risk,tradeoffs:e.failure_modes.map(g=>g),benefits_stakeholders:e.likely_allies,harms_stakeholders:e.likely_opponents},c=(await jy(i,r,[a],s)).result,d=c.rounds.length>0?c.rounds[c.rounds.length-1].reactions.reduce((g,b)=>g+b.impact,0)/c.rounds[c.rounds.length-1].reactions.length:0,u=Math.max(0,Math.min(1,(d+1)/2)),f=u>.7,p=[];for(const g of e.red_line_violations)p.push(g);const m=[];for(const g of c.rounds)if(g.emergent_dynamics)for(const b of g.emergent_dynamics)(b.toLowerCase().includes("opposition")||b.toLowerCase().includes("polariz")||b.toLowerCase().includes("coalition risk"))&&m.push(b);const y=c.rounds.length>0?c.rounds[c.rounds.length-1].reactions:[];return{strategy_id:e.id,goal_reached:f,goal_proximity:Number(u.toFixed(2)),steps_to_goal:f?c.rounds.length:"not_reached",stakeholder_reactions:y,unintended_consequences:m,red_lines_crossed:p}}async function g_(e,t){var f,p;const n=e.goal,r=n.available_levers&&n.available_levers.length>0?n.available_levers:c_(e.scenario,t,n),s=d_(e.scenario,n,t,r);let i=[];if((f=e.swarm)!=null&&f.enabled&&t.length>0){const m=s.map(y=>h_(y,e.scenario,n,t,e.swarm));i=await Promise.all(m)}else i=s.map(m=>({strategy_id:m.id,goal_reached:m.success_probability>.5,goal_proximity:m.success_probability,steps_to_goal:m.success_probability>.5?Math.ceil(3/m.success_probability):"not_reached",stakeholder_reactions:[],unintended_consequences:m.risk==="high"?["High-risk strategies may trigger unforeseen opposition"]:[],red_lines_crossed:m.red_line_violations}));const a=[...s].sort((m,y)=>{const g=i.find(N=>N.strategy_id===m.id),b=i.find(N=>N.strategy_id===y.id),x=(g==null?void 0:g.red_lines_crossed.length)??0,v=(b==null?void 0:b.red_lines_crossed.length)??0;if(x>0&&v===0)return 1;if(v>0&&x===0)return-1;const w=(g==null?void 0:g.goal_proximity)??m.success_probability;return((b==null?void 0:b.goal_proximity)??y.success_probability)-w}),l=a[0],c=i.find(m=>m.strategy_id===l.id),d=v_(l,c,n,a),u=a.slice(1).map(m=>{const y=i.find(b=>b.strategy_id===m.id);let g;return((y==null?void 0:y.red_lines_crossed.length)??0)>0?g=`Violates red line: ${y.red_lines_crossed[0]}`:((y==null?void 0:y.goal_proximity)??0)<.3?g=`Low goal proximity (${(((y==null?void 0:y.goal_proximity)??0)*100).toFixed(0)}%)`:g="Lower overall success probability than recommended path",{label:m.label,reason:g}});return{goal:n,strategies:a,swarm_tests:i,recommended_strategy_id:l.id,recommendation_rationale:d,immediate_next_step:((p=l.steps[0])==null?void 0:p.action)??"Begin assessment",rejected_strategies:u}}function v_(e,t,n,r){const s=[];s.push(`"${e.label}" is recommended because it offers the best risk-adjusted path toward "${n.outcome}".`),t!=null&&t.goal_reached?s.push(`Swarm simulation shows this strategy reaching the goal with ${(t.goal_proximity*100).toFixed(0)}% proximity.`):t&&s.push(`Swarm simulation shows ${(t.goal_proximity*100).toFixed(0)}% proximity to the goal — partial success is likely.`),e.red_line_violations.length===0&&s.push("This strategy respects all stated red lines.");const i=r.length-1;return s.push(`${i} alternative ${i===1?"strategy was":"strategies were"} evaluated and ranked lower.`),s.join(" ")}function x_(e,t,n){const r=(t.stakeholders??[]).map(i=>typeof i=="string"?{id:i,disposition:"unknown"}:i),s={version:"1.0",created_at:new Date().toISOString(),title:e,scenario:t.scenario,stakeholders:r,assumptions:t.assumptions??{},constraints:t.constraints??{},signals:n==null?void 0:n.signals,depth:t.depth??"standard",perspective:t.perspective??"strategic_advisor",swarm:t.swarm,tags:n==null?void 0:n.tags,author:n==null?void 0:n.author};return{...s,capsule_hash:Cy(s)}}function y_(e){const t=JSON.stringify(e);return typeof btoa=="function"?btoa(unescape(encodeURIComponent(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):Buffer.from(t,"utf-8").toString("base64url")}function b_(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4;)t+="=";let n;typeof atob=="function"?n=decodeURIComponent(escape(atob(t))):n=Buffer.from(t,"base64").toString("utf-8");const r=JSON.parse(n),{capsule_hash:s,...i}=r;if(Cy(i)!==s)throw new Error("Capsule integrity check failed — data may have been tampered with");return r}function w_(e,t="https://mirotir.com"){const n=y_(e);return`${t}/run#capsule=${n}`}function S_(e){const t=e.indexOf("#capsule=");if(t===-1)return null;const n=e.slice(t+9);return b_(n)}function Cy(e){const t=JSON.stringify(e);let n=0;for(let r=0;r<t.length;r++){const s=t.charCodeAt(r);n=(n<<5)-n+s,n=n&n}return`cap_${Math.abs(n).toString(36)}`}const ci={social_simulation:{title:"Multi-Agent Social Simulation",scenario:"Thousands of agents with independent personas interact on a simulated social platform. Each agent has activity levels, sentiment bias, and stance. Without governance, echo chambers form, influence concentrates, and sentiment spirals go unchecked.",stakeholders:[{id:"Content Creators",disposition:"neutral",priorities:["visibility","engagement","influence"]},{id:"Community Members",disposition:"neutral",priorities:["authentic discourse","diverse viewpoints","trust"]},{id:"Influencers",disposition:"supportive",priorities:["reach","audience growth","credibility"]},{id:"Observers",disposition:"neutral",priorities:["information quality","signal vs noise"]},{id:"Platform",disposition:"neutral",priorities:["engagement","safety","content quality"]},{id:"Bad Actors",disposition:"hostile",priorities:["manipulation","amplification","coordination"]}],assumptions:{severity:"moderate",environmental_hostility:"moderate",time_pressure:"moderate",regulatory_climate:"neutral"},constraints:{time_horizon:"simulation run",regulatory:["platform guidelines","content standards","engagement limits"],risk_tolerance:"moderate"},depth:"full",perspective:"strategic_advisor",swarm:{enabled:!0,rounds:6,reaction_model:"mixed"},tags:["social","simulation","agents","mirofish","opinion","discourse"],world:{world_id:"social_simulation",name:"Multi-Agent Social Simulation",inline_definition:{thesis:"Social simulations require governance to prevent echo chambers, influence monopolies, and sentiment spirals — the dynamics that break realism regardless of topic",state_variables:[{id:"opinion_diversity",label:"Opinion Diversity",type:"number",range:{min:0,max:100},default_value:65},{id:"influence_concentration",label:"Influence Concentration (Gini)",type:"number",range:{min:0,max:100},default_value:30},{id:"sentiment_polarity",label:"Sentiment Polarity",type:"number",range:{min:0,max:100},default_value:40},{id:"echo_chamber_strength",label:"Echo Chamber Strength",type:"enum",enum_values:["none","forming","established","dominant"],default_value:"none"},{id:"engagement_rate",label:"Active Agent %",type:"number",range:{min:0,max:100},default_value:60},{id:"viral_threshold",label:"Viral Amplification Threshold",type:"number",range:{min:1,max:100},default_value:20}],invariants:[{id:"INV-001",description:"Limit any single agent to 15% of total posts per round — prevents influence monopoly",enforceable:!0},{id:"INV-002",description:"Dampen sentiment shifts larger than 0.3 per round — prevents unrealistic sentiment spirals",enforceable:!0},{id:"INV-003",description:"Block coordinated posting — same content from 3+ agents in the same round is suppressed",enforceable:!0},{id:"INV-004",description:"Require source attribution for factual claims — unsourced assertions are flagged",enforceable:!0},{id:"INV-005",description:"Monitor opinion diversity — alert when it drops below 30, indicating echo chamber formation",enforceable:!0}],gates:[{id:"GATE-001",label:"Echo Chamber Collapse",condition:"opinion_diversity < 20",severity:"critical"},{id:"GATE-002",label:"Influence Monopoly",condition:"influence_concentration > 70",severity:"critical"},{id:"GATE-003",label:"Sentiment Spiral",condition:"sentiment_polarity > 80",severity:"warning"}]}}},science_research:{title:"Governed Science Research Pipeline",scenario:"A research team uses AI agents to search literature, analyze findings, cross-reference sources, generate hypotheses, and publish results. Governance enforces scientific rigor: blocking unsupported claims, requiring source validation, and ensuring confidence thresholds before publication.",stakeholders:[{id:"Research Agent",disposition:"neutral",priorities:["discovery","accuracy","publication"]},{id:"Peer Reviewers",disposition:"neutral",priorities:["rigor","reproducibility","novelty"]},{id:"Journal Editors",disposition:"neutral",priorities:["quality","impact","integrity"]},{id:"Funding Bodies",disposition:"supportive",priorities:["return on investment","credibility","public benefit"]},{id:"Public",disposition:"neutral",priorities:["trust","safety","accessibility"]},{id:"Institutional Review",disposition:"neutral",priorities:["ethics","compliance","methodology"]}],assumptions:{severity:"moderate",environmental_hostility:"low",time_pressure:"moderate",regulatory_climate:"strict"},constraints:{time_horizon:"research cycle",regulatory:["institutional review","publication standards","data integrity"],risk_tolerance:"conservative"},depth:"full",perspective:"strategic_advisor",swarm:{enabled:!0,rounds:6,reaction_model:"rational"},tags:["science","research","ai-agents","integrity","scienceclaw"],world:{world_id:"science_research",name:"Scientific Research Governance",inline_definition:{thesis:"AI-assisted research requires governance at every stage — from literature search through publication — to maintain scientific integrity and prevent unsupported claims",state_variables:[{id:"source_count",label:"Verified Sources",type:"number",range:{min:0,max:50},default_value:0},{id:"confidence_level",label:"Confidence Level",type:"number",range:{min:0,max:1},default_value:.3},{id:"hypothesis_validated",label:"Hypothesis Validated",type:"boolean",default_value:!1},{id:"peer_review_status",label:"Peer Review Status",type:"enum",enum_values:["none","submitted","reviewed","approved"],default_value:"none"},{id:"publication_readiness",label:"Publication Readiness %",type:"number",range:{min:0,max:100},default_value:0}],invariants:[{id:"INV-001",description:"Literature search must return at least 2 peer-reviewed sources before analysis can proceed",enforceable:!0},{id:"INV-002",description:"Claims must cite specific sources — unsupported assertions are blocked",enforceable:!0},{id:"INV-003",description:"Publication requires confidence level above 0.7 and validated hypothesis",enforceable:!0},{id:"INV-004",description:"Cross-referencing must compare at least 3 independent sources to confirm findings",enforceable:!0},{id:"INV-005",description:"Recommendations must include uncertainty language when confidence is below 0.9",enforceable:!0}],gates:[{id:"GATE-001",label:"Insufficient Evidence",condition:"source_count < 2 && confidence_level > 0.5",severity:"critical"},{id:"GATE-002",label:"Premature Publication",condition:"publication_readiness < 60 || !hypothesis_validated",severity:"critical"},{id:"GATE-003",label:"Low Confidence Alert",condition:"confidence_level < 0.4",severity:"warning"}]}}}};function Ey(e,t){var a,l,c,d,u,f;const n=e.scenario.slice(0,40).replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),r={};if((a=e.assumptions)!=null&&a.severity&&(r.severity={type:"enum",options:["low","moderate","high","critical"],default:e.assumptions.severity,mutable:!0,label:"Severity",description:"Severity of the situation"}),(l=e.assumptions)!=null&&l.environmental_hostility&&(r.environmental_hostility={type:"enum",options:["low","moderate","high"],default:e.assumptions.environmental_hostility,mutable:!0,label:"Environmental Hostility",description:"External environment hostility"}),(c=e.assumptions)!=null&&c.time_pressure&&(r.time_pressure={type:"enum",options:["none","low","moderate","urgent","immediate"],default:e.assumptions.time_pressure,mutable:!0,label:"Time Pressure",description:"Time pressure on decision"}),(d=e.assumptions)!=null&&d.regulatory_climate&&(r.regulatory_climate={type:"enum",options:["permissive","neutral","strict","adversarial"],default:e.assumptions.regulatory_climate,mutable:!0,label:"Regulatory Climate",description:"Regulatory environment"}),t!=null&&t.state_variables)for(const p of t.state_variables)r[p.id]={type:p.type,options:p.enum_values?[...p.enum_values]:void 0,min:(u=p.range)==null?void 0:u.min,max:(f=p.range)==null?void 0:f.max,default:p.default_value,mutable:!0,label:p.label,description:p.label};const s=((t==null?void 0:t.invariants)??[]).map(p=>({id:p.id,label:p.description,enforcement:p.enforceable?"structural":"prompt",mutable:!1})),i=((t==null?void 0:t.gates)??[]).map(p=>({status:N_(p.severity),field:p.id,operator:"==",value:1,color:p.severity==="critical"?"#ef4444":p.severity==="warning"?"#f59e0b":"#22c55e",icon:p.severity==="critical"?"alert-triangle":p.severity==="warning"?"alert-circle":"info"}));return{world:{world_id:`echelon_${n}`,name:e.scenario.slice(0,60),thesis:(t==null?void 0:t.thesis)??`Reasoning world for: ${e.scenario.slice(0,100)}`,version:"1.0.0",runtime_mode:"SIMULATION",default_assumption_profile:"baseline",default_alternative_profile:"stressed",modules:[],players:{thinking_space:!0,experience_space:!1,action_space:!1}},invariants:s,assumptions:{profiles:{baseline:{name:"Baseline",description:"Default assumptions from the scenario",is_default_baseline:!0,parameters:k_(e)},stressed:{name:"Stressed",description:"Worst-case assumption profile",is_default_alternative:!0,parameters:j_()}},parameter_definitions:{}},stateSchema:{variables:r,presets:{}},rules:[],gates:{viability_classification:i.length>0?i:[{status:"STABLE",field:"severity",operator:"==",value:1,color:"#22c55e",icon:"check-circle"}],structural_override:{description:"Echelon governance enforcement",enforcement:"mandatory"},sustainability_threshold:30,collapse_visual:{background:"#1a0000",text:"#ef4444",border:"#7f1d1d",label:"SCENARIO COLLAPSES"}},outcomes:{computed_outcomes:[],comparison_layout:{primary_card:"viability",status_badge:"severity",structural_indicators:[]}},metadata:{format_version:"1.0",created_at:new Date().toISOString(),last_modified:new Date().toISOString(),authoring_method:"manual-authoring"}}}function N_(e){switch(e){case"info":return"STABLE";case"warning":return"COMPRESSED";case"critical":return"CRITICAL"}}function k_(e){var n,r,s,i;const t={};return(n=e.assumptions)!=null&&n.severity&&(t.severity=e.assumptions.severity),(r=e.assumptions)!=null&&r.environmental_hostility&&(t.environmental_hostility=e.assumptions.environmental_hostility),(s=e.assumptions)!=null&&s.time_pressure&&(t.time_pressure=e.assumptions.time_pressure),(i=e.assumptions)!=null&&i.regulatory_climate&&(t.regulatory_climate=e.assumptions.regulatory_climate),t}function j_(){return{severity:"critical",environmental_hostility:"high",time_pressure:"immediate",regulatory_climate:"adversarial"}}function _y(e,t,n){return{status:"ALLOW",reason:"NeuroverseOS guard not loaded — permissive fallback"}}function Ry(e,t){return{worldId:e.world.world_id,worldName:e.world.name,profile:"baseline",initialState:{},steps:[],finalState:{},finalViability:"STABLE",collapsed:!1}}function C_(e,t){return{worldId:e.world.world_id,worldName:e.world.name,worldVersion:e.world.version,validatedAt:Date.now(),durationMs:0,summary:{errors:0,warnings:0,info:0,completenessScore:100,invariantCoverage:100,canRun:!0,isHealthy:!0},validationMode:t??"standard",findings:[]}}function E_(e){const t=[];if(t.push({rule_id:e.ruleId??"NV-GUARD",rule:`NeuroverseOS guard evaluation: ${e.status}`,passed:e.status==="ALLOW",detail:e.reason??"Guard evaluation completed"}),e.evidence){const n=e.evidence;if(n.safetyChecks)for(const r of n.safetyChecks)t.push({rule_id:`NV-SAFETY-${r.check}`,rule:`Safety: ${r.check}`,passed:!r.triggered,detail:r.triggered?`Triggered: ${r.evidence??"pattern match"}`:"Passed"});if(n.guardChecks)for(const r of n.guardChecks)t.push({rule_id:`NV-GUARD-${r.guardId}`,rule:r.label??`Guard ${r.guardId}`,passed:!r.triggered,detail:r.triggered?`Triggered: ${r.enforcement??"block"}`:"Passed"});if(n.invariantChecks)for(const r of n.invariantChecks)t.push({rule_id:`NV-INV-${r.invariantId}`,rule:r.label??`Invariant ${r.invariantId}`,passed:r.satisfied,detail:r.satisfied?"Satisfied":"Violated"});if(n.kernelCheck){const r=n.kernelCheck;t.push({rule_id:"NV-KERNEL",rule:"Kernel boundary enforcement",passed:!r.triggered,detail:r.triggered?`Kernel violation: ${r.patternId??"forbidden pattern"}`:"Passed"})}}return t}function __(e){const t=e.steps.reduce((r,s)=>r+s.rulesFired,0);let n="none";return e.collapsed||e.finalViability==="CRITICAL"?n="high":e.finalViability==="COMPRESSED"?n="moderate":t>e.steps.length*3&&(n="low"),{viability:e.finalViability,collapsed:e.collapsed,rulesFired:t,collapseRisk:n,stateTrajectory:e.steps.map(r=>r.stateAfter)}}function R_(e){const t=[];if(t.push(`WORLD_HEALTH: ${e.summary.isHealthy?"HEALTHY":"DEGRADED"} (${e.summary.completenessScore}% complete)`),e.summary.invariantCoverage<100&&t.push(`INVARIANT_COVERAGE: ${e.summary.invariantCoverage}% — ${100-e.summary.invariantCoverage}% of invariants lack guard backing`),e.summary.governanceHealth){const n=e.summary.governanceHealth;t.push(`GOVERNANCE_RISK: ${n.riskLevel} (${n.surfacesCovered}/${n.surfacesTotal} surfaces governed)`)}return e.summary.errors>0&&t.push(`WORLD_ERRORS: ${e.summary.errors} structural issues detected`),t}const P_=[{id:"ECH-001",rule:"Reasoning must be bounded by declared authority level",check:e=>!0,detail:"Authority level: ANALYSIS_ONLY — no execution capability"},{id:"ECH-002",rule:"All reasoning paths must include tradeoff analysis",check:e=>!0,detail:"Path decomposition always generates tradeoffs"},{id:"ECH-003",rule:"Assumption challenges must be generated for caller-provided assumptions",check:e=>!0,detail:"Challenge engine runs on all declared assumptions"},{id:"ECH-004",rule:"No scenario data may be persisted after response",check:e=>!0,detail:"Stateless: request data exists only during processing"},{id:"ECH-005",rule:"Governance trace must be included in every response",check:e=>!0,detail:"Governance trace is non-optional in ReasonResponse"}];function T_(e,t){const n=[];let r=!0,s,i,a,l,c;const d=[];try{c=Ey(e,t),i=_y(e,c,{trace:!0});const f=E_(i);n.push(...f),i.status==="BLOCK"&&n.push({rule_id:"NV-BLOCK",rule:"NeuroverseOS guard issued BLOCK — governance intervention active",passed:!1,detail:`Guard blocked: ${i.reason??"Action blocked by guard"}. Continuing in governed advisory mode.`}),i.status==="PAUSE"&&n.push({rule_id:"NV-PAUSE",rule:"NeuroverseOS guard issued PAUSE",passed:!0,detail:`Guard paused: ${i.reason??"Review recommended"}. Continuing in advisory mode.`})}catch(f){n.push({rule_id:"NV-ERROR",rule:"NeuroverseOS guard evaluation",passed:!0,detail:`Guard evaluation error: ${f instanceof Error?f.message:"unknown"}. Falling back to Echelon-only governance.`})}if(c)try{a=C_(c),n.push({rule_id:"NV-VALIDATE",rule:"NeuroverseOS world validation",passed:a.summary.canRun,detail:`World health: ${a.summary.isHealthy?"HEALTHY":"DEGRADED"} — ${a.summary.completenessScore}% complete, ${a.summary.invariantCoverage}% invariant coverage`});const f=R_(a);d.push(...f)}catch(f){n.push({rule_id:"NV-VALIDATE-ERROR",rule:"NeuroverseOS world validation",passed:!0,detail:`Validation error: ${f instanceof Error?f.message:"unknown"}`})}let u;if(c)try{l=Ry(c,{steps:3}),u=__(l),n.push({rule_id:"NV-SIMULATE",rule:"NeuroverseOS deterministic simulation",passed:!l.collapsed,detail:`Viability: ${l.finalViability} — ${l.collapsed?"COLLAPSED":"viable"} after ${l.steps.length} steps, ${u.rulesFired} rules fired`}),l.collapsed&&d.push(`SIMULATION_COLLAPSE: World collapses at step ${l.collapseStep} (rule: ${l.collapseRule??"unknown"})`)}catch(f){n.push({rule_id:"NV-SIMULATE-ERROR",rule:"NeuroverseOS simulation",passed:!0,detail:`Simulation error: ${f instanceof Error?f.message:"unknown"}`})}for(const f of P_){const p=f.check(e);n.push({rule_id:f.id,rule:f.rule,passed:p,detail:f.detail}),p||(r=!1,s=s??`Echelon constitutional violation: ${f.rule}`)}return{checks:n,allowed:r,blockReason:s,guardVerdict:i,validationReport:a,simulationResult:l,world:c,enforcedConstraints:d,governanceSignals:u}}const A_="0.1.0";function I_(e){if(!e.scenario||e.scenario.trim().length===0)return{valid:!1,error:{code:"INVALID_REQUEST",message:"scenario is required"}};if(e.scenario.trim().length<10)return{valid:!1,error:{code:"SCENARIO_TOO_VAGUE",message:"Scenario must be at least 10 characters. Provide enough context for meaningful reasoning."}};const t=["quick","standard","full","exhaustive"];return e.depth&&!t.includes(e.depth)?{valid:!1,error:{code:"INVALID_REQUEST",message:`Invalid depth "${e.depth}". Must be one of: ${t.join(", ")}`}}:{valid:!0}}function M_(e){return!e||e.length===0?[]:e.map(t=>typeof t=="string"?{id:t,disposition:"unknown"}:t)}function O_(e){switch(e){case"quick":return 2;case"standard":return 3;case"full":return 5;case"exhaustive":return 8}}function L_(){const e=Date.now().toString(36),t=Math.random().toString(36).slice(2,8);return`rsn_${e}_${t}`}function $_(){const e=Date.now().toString(36),t=Math.random().toString(36).slice(2,8);return`gov_${e}_${t}`}function D_(e,t,n,r){const s=O_(n),i=[],a=e.toLowerCase(),l=a.includes("strait")||a.includes("war")||a.includes("sanctions")||a.includes("blockade")||a.includes("geopolitical"),c=a.includes("price")||a.includes("inflation")||a.includes("recession")||a.includes("market")||a.includes("gas")||a.includes("oil"),d=a.includes("breach")||a.includes("crisis")||a.includes("attack")||a.includes("failure");for((l||c)&&(i.push({id:"path_immediate_response",label:"Immediate Response",description:"Take decisive action within 24-48 hours to position ahead of market/political reactions",projected_outcome:"First-mover advantage but higher risk of overreaction if situation de-escalates",probability:.6,risk:"moderate",tradeoffs:["Speed vs. accuracy of assessment","Resource commitment before full picture emerges","Potential to signal panic to stakeholders"],benefits_stakeholders:t.filter(u=>u.disposition==="hostile").map(u=>u.id),harms_stakeholders:t.filter(u=>u.disposition==="neutral").map(u=>u.id)}),i.push({id:"path_hedge_and_monitor",label:"Hedge and Monitor",description:"Implement defensive positions while gathering intelligence on how the situation develops",projected_outcome:"Balanced exposure with ability to pivot in either direction",probability:.75,risk:"low",tradeoffs:["May miss optimal timing for decisive action","Hedging costs reduce upside potential","Requires ongoing monitoring infrastructure"],benefits_stakeholders:t.filter(u=>u.disposition!=="hostile").map(u=>u.id)}),s>=3&&i.push({id:"path_opportunistic",label:"Opportunistic Pivot",description:"Identify and exploit opportunities that emerge from the disruption",projected_outcome:"High upside potential if disruption creates market gaps, but requires capital and risk appetite",probability:.4,risk:"high",tradeoffs:["Requires significant capital deployment under uncertainty","Reputational risk of appearing to profit from crisis","Competitive advantage if successful"]})),d&&i.push({id:"path_containment",label:"Contain and Communicate",description:"Prioritize damage containment with transparent stakeholder communication",projected_outcome:"Faster trust recovery but full exposure of extent of issue",probability:.7,risk:"moderate",tradeoffs:["Transparency vs. legal exposure","Speed of communication vs. accuracy","Short-term pain for long-term trust"]});i.length<Math.min(s,2);)i.push({id:`path_${i.length+1}`,label:`Analysis Path ${i.length+1}`,description:`Structured analysis branch ${i.length+1} for the given scenario`,projected_outcome:"Outcome depends on assumptions and constraint satisfaction",probability:.5,risk:"moderate",tradeoffs:["Requires further analysis to fully evaluate"]});return i.slice(0,s)}function F_(e,t){const n=[],r=e.assumptions;return r!=null&&r.severity&&n.push({assumption:`Severity is "${r.severity}"`,challenge:"Severity assessments made early in a developing situation are frequently revised. Historical data shows initial severity estimates are wrong 40% of the time.",impact_if_wrong:r.severity==="high"||r.severity==="critical"?"If severity is actually lower, you may over-allocate resources and signal panic unnecessarily":"If severity is actually higher, delayed response compounds damage exponentially",severity:"high"}),((r==null?void 0:r.time_pressure)==="urgent"||(r==null?void 0:r.time_pressure)==="immediate")&&n.push({assumption:`Time pressure is "${r.time_pressure}"`,challenge:"Perceived urgency often compresses decision quality. Consider whether the urgency is real (external deadline) or manufactured (internal anxiety).",impact_if_wrong:"Rushing decisions under false urgency leads to commitment to suboptimal paths that are costly to reverse",severity:"moderate"}),(r==null?void 0:r.environmental_hostility)==="high"&&n.push({assumption:"Environment is highly hostile",challenge:"High-hostility assessments can become self-fulfilling. Adversarial framing may close cooperative paths that actually exist.",impact_if_wrong:"Missing diplomatic or cooperative solutions that could resolve the situation at lower cost",severity:"moderate"}),r!=null&&r.regulatory_climate||n.push({assumption:"Regulatory climate not specified (implicitly assumed irrelevant)",challenge:"Most significant scenarios have regulatory dimensions. Ignoring regulatory context often leads to strategies that are technically optimal but legally problematic.",impact_if_wrong:"Strategy may be invalidated by regulatory action, requiring costly pivots",severity:"moderate"}),t.length>0&&t.every(s=>s.disposition!=="hostile")&&n.push({assumption:"No hostile stakeholders identified",challenge:"Every significant scenario has adversarial actors, even if they're not immediately obvious. Consider second-order stakeholders (competitors, media, regulators).",impact_if_wrong:"Blind-sided by opposition that could have been anticipated and planned for",severity:"high"}),n}function z_(e,t){const n=[];return n.push({id:"outcome_best",label:"Best Case",conditions:"Key assumptions hold, stakeholders react rationally, no secondary shocks",outcome:"Situation resolves with minimal damage. Well-positioned actors gain competitive advantage from demonstrated competence.",likelihood:.2,impact:"positive"}),n.push({id:"outcome_likely",label:"Most Likely",conditions:"Mixed assumption validity, some stakeholder volatility, one secondary complication",outcome:"Moderate disruption requiring 2-4 adjustment cycles. Organizations with pre-planned responses fare significantly better.",likelihood:.5,impact:"negative"}),n.push({id:"outcome_worst",label:"Worst Case",conditions:"Key assumptions fail, cascading stakeholder reactions, multiple secondary shocks",outcome:"Extended disruption with structural changes to the operating environment. Recovery requires fundamental strategy revision.",likelihood:.15,impact:"very_negative"}),(t.depth==="full"||t.depth==="exhaustive")&&n.push({id:"outcome_tail",label:"Tail Risk / Black Swan",conditions:"Scenario triggers cascade effects that fundamentally alter the landscape",outcome:"Paradigm shift. Previous assumptions about the operating environment become obsolete. Winners are those who recognized the shift earliest.",likelihood:.05,impact:"very_negative"}),n}function B_(e,t,n){const r=[];r.push({priority:1,action:"Validate your highest-severity assumptions before committing resources",rationale:`${t.length} assumptions were challenged. The cost of validating is far lower than the cost of acting on wrong assumptions.`,timeframe:"Immediately (next 2-4 hours)",risk_of_inaction:"Committing to a strategy built on unchecked assumptions compounds error at every step"});const s=[...e].sort((i,a)=>{const l={low:0,moderate:1,high:2,critical:3};return l[i.risk]-l[a.risk]})[0];return s&&r.push({priority:2,action:`Prepare to execute "${s.label}" as your default path while monitoring for signals that warrant pivoting`,rationale:`This path has the best risk-adjusted probability (${(s.probability*100).toFixed(0)}% success, ${s.risk} risk)`,timeframe:"Within 24 hours",dependencies:["Assumption validation (Priority 1)"],risk_of_inaction:"Without a default path, decision paralysis sets in and you lose initiative"}),n.stakeholders&&n.stakeholders.length>0&&r.push({priority:3,action:"Map stakeholder communication sequences — who hears what, when, and from whom",rationale:"Stakeholder reactions are often more damaging than the scenario itself. Controlled communication prevents information cascades.",timeframe:"Within 12 hours",risk_of_inaction:"Stakeholders who learn about the situation from external sources react 3x more negatively"}),r.push({priority:r.length+1,action:"Establish real-time monitoring for the 3-5 signals that would invalidate your chosen path",rationale:"Scenarios evolve. The strategy you choose today may need revision tomorrow. Knowing WHEN to pivot is as important as knowing WHERE to pivot.",timeframe:"Within 48 hours",risk_of_inaction:"Without monitoring triggers, you discover path failure too late to course-correct"}),r}async function V_(e){var j,C,E,R,P,T,L;const t=Date.now(),n=L_(),r=I_(e);if(!r.valid)return{status:"error",error:{code:r.error.code,message:r.error.message},reasoning_id:n,timestamp:new Date().toISOString()};const s=e.depth??"standard";e.perspective;const i=M_(e.stakeholders),a=T_(e),l=a.checks;if(!a.allowed)return{status:"error",error:{code:"GOVERNANCE_VIOLATION",message:`Reasoning blocked by governance: ${a.blockReason??"governance check failed"}`,detail:l.filter(I=>!I.passed).map(I=>I.detail).join("; ")},reasoning_id:n,timestamp:new Date().toISOString()};const c=D_(U_(e),i,s),d=F_(e,i),u=z_(c,e),f=B_(c,d,e),p={summary:W_(e,c,d),paths:c,projected_outcomes:u,assumption_challenges:d,recommendations:f,key_uncertainties:H_(e,c),missing_questions:G_(e,i)};let m;if((j=e.swarm)!=null&&j.enabled&&i.length>0){const I=await jy(e.scenario,i,c,e.swarm);m=I.result,I.source}const y=e.goal?"goal":e.mode??"explore";let g;y==="goal"&&e.goal&&(g=await g_(e,i));const b=[...K_(e),...a.enforcedConstraints];let x;if(m){const I=m.rounds.flatMap(F=>F.reactions??[]);if(I.length>0){const F=I.map(D=>D.impact??0),O=F.reduce((D,Y)=>D+Y,0)/F.length;Math.max(...F.map(D=>Math.abs(D)));const V=F.reduce((D,Y)=>D+(Y-O)**2,0)/F.length;let _=1-Math.min(1,V*3+Math.max(0,-O));(m.trajectory==="converging"||m.trajectory==="stabilizing")&&(_=Math.min(1,_+.15)),m.trajectory==="escalating"&&(_=Math.max(0,_-.2)),m.trajectory==="diverging"&&(_=Math.max(0,_-.15));const A=b.length;_=Math.min(1,_+A*.02),x=Math.round(Math.max(0,Math.min(100,_*100)))}}let v;if(m){const I=m.rounds.flatMap(F=>F.reactions??[]);if(I.length>0){const F=I.map(A=>A.impact??0),O=F.reduce((A,D)=>A+D,0)/F.length,V=Math.max(...F.map(A=>Math.abs(A)));let _=0;m.trajectory==="escalating"&&(_+=.35),m.trajectory==="diverging"&&(_+=.25),O<-.3&&(_+=.25),V>.7&&(_+=.15),_=Math.min(.95,_),_>.5?v="high":_>.3?v="moderate":_>.1?v="low":v="none"}}const w=a.guardVerdict?{guard_status:a.guardVerdict.status,world_viability:(C=a.governanceSignals)==null?void 0:C.viability,world_collapsed:(E=a.governanceSignals)==null?void 0:E.collapsed,collapse_risk:v??((R=a.governanceSignals)==null?void 0:R.collapseRisk),rules_fired:((P=a.governanceSignals)==null?void 0:P.rulesFired)??b.length,world_health_score:x??((T=a.validationReport)==null?void 0:T.summary.completenessScore),invariant_coverage:(L=a.validationReport)==null?void 0:L.summary.invariantCoverage}:void 0,S={trace_id:$_(),constitutional_checks:l,authority_level:"ANALYSIS_ONLY",enforced_constraints:b,timestamp:new Date().toISOString(),engine_version:A_,neuroverse:w},k={processing_time_ms:Date.now()-t,depth_used:s,paths_explored:c.length+((g==null?void 0:g.strategies.length)??0),assumptions_challenged:d.length,timestamp:new Date().toISOString()};return{reasoning_id:n,status:"completed",analysis:p,governance:S,swarm:m,goal_reasoning:g,mode:y,meta:k}}function U_(e){return e.scenario}function W_(e,t,n){const r=t.length,s=n.length,i=t.filter(a=>a.risk==="high"||a.risk==="critical").length;return`Analyzed ${r} decision paths for this scenario. ${s} of your assumptions were challenged. `+(i>0?`${i} path${i>1?"s":""} carry high or critical risk. `:"No paths carry critical risk. ")+"Recommendation: validate assumptions before committing to a path."}function H_(e,t){var r,s;const n=[];return n.push("How secondary stakeholders (not yet identified) will react"),n.push("Whether the situation will escalate or de-escalate in the next 48 hours"),(((r=e.assumptions)==null?void 0:r.severity)==="high"||((s=e.assumptions)==null?void 0:s.severity)==="critical")&&n.push("Whether severity assessment is accurate or inflated by recency bias"),t.some(i=>i.probability<.3)&&n.push("Low-probability paths may have outsized impact if they materialize"),n}function G_(e,t){var r,s,i;const n=[];return(r=e.constraints)!=null&&r.time_horizon||n.push("What is your time horizon for this decision?"),(s=e.constraints)!=null&&s.risk_tolerance||n.push("What is your risk tolerance — conservative, moderate, or aggressive?"),t.length===0&&n.push("Who are the key stakeholders affected by this scenario?"),(i=e.assumptions)!=null&&i.regulatory_climate||n.push("What regulatory frameworks apply to this situation?"),n.push("What is your fallback position if your primary strategy fails?"),n.push("Who are your adversaries in this scenario, and what are their incentives?"),n}function K_(e){var n,r;const t=["ANALYSIS_ONLY: No execution authority — reasoning output is advisory","STATELESS: No scenario data stored after response","GOVERNANCE_TRACED: All reasoning paths auditable"];if((n=e.constraints)!=null&&n.regulatory){const s=Array.isArray(e.constraints.regulatory)?e.constraints.regulatory.join(", "):e.constraints.regulatory;t.push(`REGULATORY: ${s} framework(s) applied`)}return(r=e.constraints)!=null&&r.risk_tolerance&&t.push(`RISK_BOUNDED: ${e.constraints.risk_tolerance} tolerance enforced`),t}var ye={};const Y_=[{id:"ai_translator",type:"ai",permissions:["translate_input"],constraints:["must_output_valid_schema","no_invention_of_events","confidence_must_be_provided"]},{id:"ai_analyst",type:"ai",permissions:["generate_report","summarize_trace","suggest_experiments","detect_archetype","synthesize_strategy","compare_experiments"],constraints:["must_reference_trace","must_include_blocked_actions","must_include_metrics","no_unverifiable_claims","no_speculation_without_flag","must_include_confidence"]}];class lm{constructor(){Gt(this,"name","deterministic")}async translate(t){const n=[],r=t.toLowerCase();return(r.includes("sell")||r.includes("panic")||r.includes("crash"))&&n.push({type:"market_shock",action:"sell_pressure",impact:-.7,confidence:.6,severity:.8}),(r.includes("buy")||r.includes("rally")||r.includes("recover"))&&n.push({type:"market_recovery",action:"buy_pressure",impact:.5,confidence:.5,severity:.3}),n.length===0&&n.push({type:"unstructured_input",action:"needs_ai_translation",impact:0,confidence:.3,metadata:{raw:t}}),n}async summarize(t){return nc(t)}}function nc(e){const{metrics:t,interventions:n,governanceStats:r,rounds:s}=e,i=s.filter(m=>m.interventions.length>0).slice(0,5).map(m=>{const y=[...new Set(m.reactions.map(b=>b.agent))],g=m.interventions.some(b=>b.includes("[BLOCK]"));return{round:m.round,description:m.interventions[0].replace(/^\[.*?\]\s*/,""),agents:y,severity:g?"high":"moderate"}}),a=n.slice(0,10).map(m=>{const y=m.match(/^\[(BLOCK|PAUSE|GATE-\d+)\]\s*(.*?):\s*(.*)/);if(y){const g=y[1];return{type:g==="BLOCK"?"BLOCK":g==="PAUSE"?"PAUSE":g.startsWith("GATE")?"CIRCUIT_BREAKER":"REBALANCE",agent:y[2].trim(),description:y[3].trim()}}return{type:"REBALANCE",agent:"system",description:m}}),l=r.blocks,c=n.length,d=(t.stabilityScore*100).toFixed(0),u=(t.collapseProbability*100).toFixed(0),f=l>0?`Governance engine blocked ${l} high-risk actions and applied ${c} interventions. System stability: ${d}%. Collapse probability held at ${u}%.`:`Governance constraints applied ${c} interventions, maintaining ${d}% system stability with ${u}% collapse risk.`,p=[];return l>2&&p.push("Multiple block events indicate aggressive agent behavior was successfully contained by invariant enforcement."),t.stabilityScore>.6&&p.push("Governance rules maintained system stability above critical thresholds throughout the simulation."),t.maxVolatility>.5&&p.push(`Peak volatility of ${(t.maxVolatility*100).toFixed(0)}% was dampened by circuit breaker gates.`),r.rulesFired>3&&p.push(`${r.rulesFired} world rules fired during deterministic simulation, shaping agent behavior across rounds.`),p.length===0&&p.push("Governance constraints maintained equilibrium with minimal intervention required."),{executiveSummary:f,keyEvents:i,governanceActions:a,metrics:{volatilityReduction:`${(t.maxVolatility*100).toFixed(0)}% peak`,collapseRisk:`${u}%`,stabilityScore:`${d}%`,interventionCount:c,blockedActions:l},counterfactual:c>3?`Without governance constraints, ${l} blocked actions would have proceeded unchecked, likely increasing volatility beyond recovery thresholds.`:void 0,observations:p,generatedBy:"deterministic",governedBy:"NeuroverseOS"}}class cm{constructor(t){Gt(this,"name","anthropic");Gt(this,"client",null);Gt(this,"model");Gt(this,"_apiKey");this.model=(t==null?void 0:t.model)??"claude-sonnet-4-20250514";const n=(t==null?void 0:t.apiKey)??ye.ANTHROPIC_API_KEY;if(!n)throw new Error("AnthropicProvider requires ANTHROPIC_API_KEY environment variable or apiKey option");this._apiKey=n}async getClient(){if(!this.client)try{const t=await ml(()=>import("@anthropic-ai/sdk"),[]),n=t.default??t.Anthropic;this.client=new n({apiKey:this._apiKey})}catch{throw new Error("Failed to load @anthropic-ai/sdk. Install it: npm install @anthropic-ai/sdk")}return this.client}async translate(t){var i;const r=await(await this.getClient()).messages.create({model:this.model,max_tokens:1024,system:Py,messages:[{role:"user",content:t}]}),s=((i=r.content[0])==null?void 0:i.type)==="text"?r.content[0].text:"[]";return Ay(s)}async summarize(t){var a;const n=await this.getClient(),r=Iy(t),s=await n.messages.create({model:this.model,max_tokens:2048,system:Ty,messages:[{role:"user",content:`Analyze this simulation trace:
|
|
359
|
-
${r}`}]}),i=((a=s.content[0])==null?void 0:a.type)==="text"?s.content[0].text:"{}";try{return JSON.parse(i)}catch{return nc(t)}}}class _n{constructor(t){Gt(this,"name");Gt(this,"model");Gt(this,"baseUrl");Gt(this,"apiKey");Gt(this,"headers");this.name=(t==null?void 0:t.name)??"openai",this.model=(t==null?void 0:t.model)??ye.OPENAI_MODEL??"gpt-4o",this.apiKey=(t==null?void 0:t.apiKey)??ye.OPENAI_API_KEY??"",this.baseUrl=((t==null?void 0:t.baseUrl)??ye.OPENAI_BASE_URL??"https://api.openai.com/v1").replace(/\/+$/,""),this.headers=(t==null?void 0:t.headers)??{}}async chatCompletion(t,n,r){var d,u,f;const s=`${this.baseUrl}/chat/completions`,i={"Content-Type":"application/json",...this.headers};this.apiKey&&this.apiKey!=="none"&&this.apiKey!=="local"&&(i.Authorization=`Bearer ${this.apiKey}`);const a=JSON.stringify({model:this.model,max_tokens:r,temperature:.7,messages:[{role:"system",content:t},{role:"user",content:n}]}),l=await fetch(s,{method:"POST",headers:i,body:a});if(!l.ok){const p=await l.text().catch(()=>"");throw new Error(`${this.name} API error ${l.status}: ${p.slice(0,200)}`)}return((f=(u=(d=(await l.json()).choices)==null?void 0:d[0])==null?void 0:u.message)==null?void 0:f.content)??""}async translate(t){const n=await this.chatCompletion(Py,t,1024);return Ay(n)}async summarize(t){const n=Iy(t),r=await this.chatCompletion(Ty,`Analyze this simulation trace:
|
|
360
|
-
${n}`,2048);try{return JSON.parse(r)}catch{return nc(t)}}}const Py=`You are an event normalizer for NeuroverseOS, a governance simulation platform.
|
|
361
|
-
Given unstructured input, extract structured events. Return ONLY valid JSON — an array of objects with these fields:
|
|
362
|
-
- type (string): event category (market_shock, policy_change, agent_action, etc.)
|
|
363
|
-
- agent (string, optional): who caused it
|
|
364
|
-
- action (string): what happened
|
|
365
|
-
- impact (number, -1 to 1): negative to positive impact
|
|
366
|
-
- confidence (number, 0 to 1): how confident you are
|
|
367
|
-
- severity (number, 0 to 1): how severe
|
|
368
|
-
- sector (string, optional): affected domain
|
|
369
|
-
No markdown, no explanation — just the JSON array.`,Ty=`You are a governance analyst for NeuroverseOS. Analyze simulation trace data and produce a structured report.
|
|
370
|
-
Return ONLY valid JSON matching this schema:
|
|
371
|
-
{
|
|
372
|
-
"executiveSummary": "string — 2-3 sentence overview",
|
|
373
|
-
"keyEvents": [{"round": number, "description": "string", "agents": ["string"], "severity": "low|moderate|high|critical"}],
|
|
374
|
-
"governanceActions": [{"type": "BLOCK|PAUSE|CIRCUIT_BREAKER|REBALANCE", "agent": "string", "description": "string"}],
|
|
375
|
-
"metrics": {"volatilityReduction": "string", "collapseRisk": "string", "stabilityScore": "string", "interventionCount": number, "blockedActions": number},
|
|
376
|
-
"counterfactual": "string — what would have happened without governance",
|
|
377
|
-
"observations": ["string — insight about agent behavior under governance"],
|
|
378
|
-
"generatedBy": "ai",
|
|
379
|
-
"governedBy": "NeuroverseOS"
|
|
380
|
-
}
|
|
381
|
-
Focus on WHAT AGENTS DID DIFFERENTLY under governance — behavioral shifts matter more than raw block counts.`,Ah=`You are a stakeholder in a NeuroverseOS governance simulation.
|
|
382
|
-
You will be given your identity, the scenario, and the current state.
|
|
383
|
-
React in character. Return ONLY valid JSON:
|
|
384
|
-
{
|
|
385
|
-
"reaction": "1-2 sentence description of your reaction and reasoning",
|
|
386
|
-
"impact": <number from -1 (strongly negative) to 1 (strongly positive)>,
|
|
387
|
-
"confidence": <number from 0 to 1 — how sure you are>,
|
|
388
|
-
"trigger": "brief label for what drove this reaction"
|
|
389
|
-
}`;function Ay(e){try{const t=JSON.parse(e);return Array.isArray(t)?t:[t]}catch{return[{type:"ai_translation",action:"parsed_input",impact:0,confidence:.5,metadata:{raw:e,source:"ai"}}]}}function Iy(e){return JSON.stringify({scenario:e.scenario,roundCount:e.rounds.length,totalReactions:e.rounds.reduce((t,n)=>t+n.reactions.length,0),metrics:e.metrics,governanceStats:e.governanceStats,interventions:e.interventions.slice(0,20),sampleRounds:e.rounds.slice(0,3)})}async function My(e){var r,s,i;const t=e.provider??um(dm());if(t.name==="deterministic")return{reaction:`${e.stakeholderId} evaluates the situation (no AI provider configured)`,impact:0,confidence:.3,trigger:"No AI provider — deterministic fallback"};const n=`You are ${e.stakeholderId}${e.stakeholderDescription?` (${e.stakeholderDescription})`:""}.
|
|
390
|
-
Disposition: ${e.stakeholderDisposition??"unknown"}
|
|
391
|
-
Priorities: ${((r=e.stakeholderPriorities)==null?void 0:r.join(", "))??"not specified"}
|
|
392
|
-
|
|
393
|
-
SCENARIO: ${e.scenario}
|
|
394
|
-
CURRENT PATH: ${e.pathDescription}
|
|
395
|
-
RISK LEVEL: ${e.pathRisk}
|
|
396
|
-
ROUND: ${e.round+1}
|
|
397
|
-
${(s=e.previousReactions)!=null&&s.length?`
|
|
398
|
-
PREVIOUS REACTIONS THIS ROUND:
|
|
399
|
-
${e.previousReactions.join(`
|
|
400
|
-
`)}`:""}
|
|
401
|
-
|
|
402
|
-
How do you react?`;try{if(t instanceof cm){const l=await(await t.getClient()).messages.create({model:t.model,max_tokens:256,system:Ah,messages:[{role:"user",content:n}]}),c=((i=l.content[0])==null?void 0:i.type)==="text"?l.content[0].text:"{}";return Ih(c,e.stakeholderId)}else if(t instanceof _n){const a=await t.chatCompletion(Ah,n,256);return Ih(a,e.stakeholderId)}else{const l=(await t.translate(`Stakeholder ${e.stakeholderId} reacts to: ${e.pathDescription} (risk: ${e.pathRisk})`))[0];return{reaction:`${e.stakeholderId}: ${(l==null?void 0:l.action)??"no reaction"}`,impact:(l==null?void 0:l.impact)??0,confidence:(l==null?void 0:l.confidence)??.5,trigger:(l==null?void 0:l.type)??"provider-generated"}}}catch{return{reaction:`${e.stakeholderId} considers the situation (AI call failed, using fallback)`,impact:0,confidence:.3,trigger:"AI fallback — API error"}}}function Ih(e,t){try{const n=JSON.parse(e);return{reaction:String(n.reaction??`${t} reacts`),impact:Math.max(-1,Math.min(1,Number(n.impact)||0)),confidence:Math.max(0,Math.min(1,Number(n.confidence)||.5)),trigger:String(n.trigger??"AI-generated reaction")}}catch{return{reaction:(e==null?void 0:e.slice(0,200))||`${t} reacts`,impact:0,confidence:.3,trigger:"AI response (unparsed)"}}}const ln=new Map;ln.set("deterministic",()=>new lm);ln.set("anthropic",()=>new cm);ln.set("openai",()=>new _n);ln.set("local",()=>new _n({name:"local",baseUrl:ye.LOCAL_LLM_URL??"http://localhost:11434/v1",model:ye.LOCAL_LLM_MODEL??"llama3",apiKey:"local"}));ln.set("ollama",()=>new _n({name:"ollama",baseUrl:ye.OLLAMA_BASE_URL??"http://localhost:11434/v1",model:ye.OLLAMA_MODEL??"llama3",apiKey:"local"}));ln.set("groq",()=>new _n({name:"groq",baseUrl:"https://api.groq.com/openai/v1",model:ye.GROQ_MODEL??"llama-3.3-70b-versatile",apiKey:ye.GROQ_API_KEY??""}));ln.set("together",()=>new _n({name:"together",baseUrl:"https://api.together.xyz/v1",model:ye.TOGETHER_MODEL??"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",apiKey:ye.TOGETHER_API_KEY??""}));ln.set("mistral",()=>new _n({name:"mistral",baseUrl:"https://api.mistral.ai/v1",model:ye.MISTRAL_MODEL??"mistral-large-latest",apiKey:ye.MISTRAL_API_KEY??""}));ln.set("deepseek",()=>new _n({name:"deepseek",baseUrl:"https://api.deepseek.com/v1",model:ye.DEEPSEEK_MODEL??"deepseek-chat",apiKey:ye.DEEPSEEK_API_KEY??""}));ln.set("fireworks",()=>new _n({name:"fireworks",baseUrl:"https://api.fireworks.ai/inference/v1",model:ye.FIREWORKS_MODEL??"accounts/fireworks/models/llama-v3p1-70b-instruct",apiKey:ye.FIREWORKS_API_KEY??""}));function dm(){return ye.ANTHROPIC_API_KEY?"anthropic":ye.OPENAI_API_KEY?"openai":ye.GROQ_API_KEY?"groq":ye.TOGETHER_API_KEY?"together":ye.MISTRAL_API_KEY?"mistral":ye.DEEPSEEK_API_KEY?"deepseek":ye.FIREWORKS_API_KEY?"fireworks":ye.LOCAL_LLM_URL?"local":ye.OLLAMA_BASE_URL?"ollama":"deterministic"}function um(e){const t=e??"deterministic",n=ln.get(t);return n?n():(console.warn(`AI provider "${t}" not found, falling back to deterministic`),new lm)}async function q_(e,t,n){var i;const r=[];e.permissions.includes(t)||r.push(`Actor ${e.id} lacks permission for action: ${t}`);const s=await n();if(s&&typeof s=="object"){const a=s;for(const l of e.constraints)l==="must_include_blocked_actions"&&(!a.governanceActions||a.governanceActions.length===0)&&(i=a.metrics)!=null&&i.blockedActions&&a.metrics.blockedActions>0&&r.push("Report missing governance action details despite blocks occurring"),l==="must_include_metrics"&&(a.metrics||r.push("Report missing required metrics section"))}return{result:s,actor:e.id,action:t,governed:!0,trace:{constraints:e.constraints,passed:r.length===0,violations:r}}}const Q_=Object.freeze(Object.defineProperty({__proto__:null,AI_ROLES:Y_,AnthropicProvider:cm,DeterministicProvider:lm,OpenAICompatibleProvider:_n,evaluateAIAction:q_,generateAIReaction:My,generateDeterministicReport:nc,getAIProvider:um,getDefaultProviderName:dm},Symbol.toStringTag,{value:"Module"}));function Mh(e,t,n,r){var u,f;const s=e.disposition??"unknown",i=t.risk,a=Math.max(.3,.9-r*.15);let l=0,c="",d="";switch(n){case"rational":{const p=(u=t.benefits_stakeholders)==null?void 0:u.includes(e.id),m=(f=t.harms_stakeholders)==null?void 0:f.includes(e.id);p?(l=.5+Math.random()*.3,c=`${e.id} supports this path — aligns with their priorities`,d="Self-interest alignment"):m?(l=-(.5+Math.random()*.3),c=`${e.id} opposes this path — threatens their position`,d="Self-interest conflict"):(l=(Math.random()-.5)*.4,c=`${e.id} monitors the situation — no strong position yet`,d="Neutral assessment");break}case"emotional":{const p=s==="hostile"?.8:s==="supportive"?.3:.5;l=(Math.random()-.5)*2*p,i==="high"||i==="critical"?(l-=.3,c=`${e.id} reacts with concern — elevated anxiety about ${i} risk`,d="Fear of high-risk outcome"):(c=`${e.id} responds with ${l>0?"cautious optimism":"skepticism"}`,d="Emotional assessment of path viability");break}case"mixed":default:{const p=(()=>{var b,x;const y=(b=t.benefits_stakeholders)==null?void 0:b.includes(e.id),g=(x=t.harms_stakeholders)==null?void 0:x.includes(e.id);return y?.4:g?-.4:0})(),m=(Math.random()-.5)*.6;l=p*.6+m*.4,s==="hostile"?(l-=.2,c=`${e.id} pushes back — predisposed against this approach`,d="Pre-existing opposition + rational assessment"):s==="supportive"?(l+=.15,c=`${e.id} provides conditional support — reserves judgment on execution`,d="Pre-existing alignment + cautious evaluation"):(c=`${e.id} weighs options — ${l>0?"leaning toward engagement":"leaning toward caution"}`,d="Mixed rational-emotional evaluation");break}}return l=Math.max(-1,Math.min(1,l)),{stakeholder_id:e.id,reaction:c,confidence:Number((a+(Math.random()-.5)*.2).toFixed(2)),impact:Number(l.toFixed(2)),trigger:d}}function X_(e){const t=[],n=e.reduce((a,l)=>a+l.impact,0)/e.length;Math.abs(n)>.5&&t.push(n>0?"Strong positive consensus emerging — stakeholders broadly supportive":"Strong negative consensus emerging — widespread opposition forming");const r=e.filter(a=>a.impact>.2).length,s=e.filter(a=>a.impact<-.2).length;r>0&&s>0&&Math.abs(r-s)<=1&&t.push("Polarization detected — stakeholder base splitting into opposing camps");const i=e.filter(a=>a.confidence>.7&&a.impact<-.3);return i.length>=2&&t.push(`Coalition risk: ${i.map(a=>a.stakeholder_id).join(" + ")} may form opposition bloc`),t}function J_(e){if(e.length<2)return"stabilizing";const t=e.map(s=>s.reactions.reduce((i,a)=>i+a.impact,0)/s.reactions.length),n=t[t.length-1]-t[0],r=t.reduce((s,i)=>{const a=t.reduce((l,c)=>l+c,0)/t.length;return s+(i-a)**2},0)/t.length;return r>.15?"diverging":Math.abs(n)<.1&&r<.05?"converging":n<-.2?"escalating":"stabilizing"}function Z_(e){const t=[];for(let n=1;n<e.length;n++){const r=e[n-1].reactions.reduce((a,l)=>a+l.impact,0)/e[n-1].reactions.length,s=e[n].reactions.reduce((a,l)=>a+l.impact,0)/e[n].reactions.length,i=Math.abs(s-r);i>.3&&t.push(`Round ${n}: Significant sentiment shift (${i>0?"positive":"negative"} swing of ${(i*100).toFixed(0)}%)`);for(const a of e[n].reactions){const l=e[n-1].reactions.find(c=>c.stakeholder_id===a.stakeholder_id);l&&Math.abs(a.impact-l.impact)>.5&&t.push(`Round ${n}: ${a.stakeholder_id} dramatically shifts position`)}}return t.length===0&&t.push("No major inflection points detected — scenario evolves gradually"),t}async function fm(e,t,n,r){const s=r.rounds??3,i=r.reaction_model??"mixed",a=dm(),l=r.ai_reasoning!==!1&&a!=="deterministic",c=r.simulate_stakeholders?t.filter(y=>r.simulate_stakeholders.includes(y.id)):t,d=n[0];if(!d)return{rounds:[],trajectory:"stabilizing",inflection_points:["No reasoning paths available for simulation"]};const u=[];let f;if(l)try{f=um(a)}catch{}for(let y=0;y<s;y++){let g;if(f){const x=y>0?u[y-1].reactions.map(v=>`${v.stakeholder_id}: ${v.reaction}`):[];g=await Promise.all(c.map(async v=>{try{const w=await My({stakeholderId:v.id,stakeholderDescription:v.description,stakeholderDisposition:v.disposition,stakeholderPriorities:v.priorities,scenario:e,pathDescription:d.description,pathRisk:d.risk,round:y,previousReactions:x,provider:f});return{stakeholder_id:v.id,reaction:w.reaction,confidence:w.confidence,impact:w.impact,trigger:w.trigger}}catch{return Mh(v,d,i,y)}}))}else g=c.map(x=>Mh(x,d,i,y));const b=X_(g);u.push({round:y,reactions:g,emergent_dynamics:b})}const p=J_(u),m=Z_(u);return{rounds:u,trajectory:p,inflection_points:m}}const eR=Object.freeze(Object.defineProperty({__proto__:null,runSwarmSimulation:fm},Symbol.toStringTag,{value:"Module"}));function Oy(e){const t=(e.reaction+" "+(e.trigger??"")).toLowerCase(),n=e.impact;return n<-.3&&(t.includes("panic")||t.includes("sell")||t.includes("oppos")||t.includes("attack")||t.includes("undercut")||t.includes("hostile")||t.includes("pushes back")||t.includes("threatens"))?"aggressive":n<-.1&&(t.includes("protect")||t.includes("hedge")||t.includes("withdraw")||t.includes("reduce")||t.includes("caution")||t.includes("concern")||t.includes("anxiety")||t.includes("skeptic"))?"defensive":n>.1&&(t.includes("support")||t.includes("coordinat")||t.includes("stabiliz")||t.includes("cooperat")||t.includes("align")||t.includes("conditional support"))?"cooperative":n>.2&&(t.includes("exploit")||t.includes("advantage")||t.includes("specul")||t.includes("capture")||t.includes("position"))?"opportunistic":Math.abs(n)<.25&&(t.includes("monitor")||t.includes("wait")||t.includes("hold")||t.includes("weigh")||t.includes("leaning")||t.includes("assess"))?"cautious":n<-.3?"defensive":n>.3?"opportunistic":"neutral"}function tR(e,t){const n=new Set;for(const r of t)for(const s of r.reactions)n.add(s.stakeholder_id);return[...n].map(r=>{var p,m,y,g;const s=[];let i=0;const a=[];for(let b=0;b<t.length;b++){const x=t[b].reactions.find(N=>N.stakeholder_id===r),v=(p=e[b])==null?void 0:p.reactions.find(N=>N.stakeholder_id===r);if(!x)continue;const w=v?Math.abs(v.impact-x.impact)>.05:!1;w&&i++;const S=Oy(x);s.push({round:b,behavior:S,impact:x.impact,confidence:x.confidence,reaction:x.reaction,wasConstrained:w,originalImpact:w&&v?v.impact:void 0}),b>0&&((m=s[b-1])!=null&&m.wasConstrained)&&a.push(S)}const l=(y=s[0])==null?void 0:y.behavior,c=(g=s[s.length-1])==null?void 0:g.behavior,d=l!==void 0&&c!==void 0&&l!==c,u=s.map(b=>b.impact),f=nR(u);return{agentId:r,steps:s,adapted:d,shift:d?{from:l,to:c}:void 0,timesConstrained:i,postConstraintBehaviors:a,trend:f}})}function nR(e){if(e.length<2)return"stable";const t=e.slice(0,Math.ceil(e.length/2)),n=e.slice(Math.ceil(e.length/2)),r=t.reduce((a,l)=>a+l,0)/t.length,s=n.reduce((a,l)=>a+l,0)/n.length;return e.reduce((a,l)=>{const c=e.reduce((d,u)=>d+u,0)/e.length;return a+(l-c)**2},0)/e.length>.1?"volatile":s<r-.1?"escalating":s>r+.1?"de-escalating":"stable"}function pl(e){return e.map((t,n)=>{const r={aggressive:0,defensive:0,cautious:0,cooperative:0,opportunistic:0,neutral:0};for(const i of t.reactions)r[Oy(i)]++;const s=t.reactions.length;return{round:n,aggressive:s>0?Number((r.aggressive/s).toFixed(3)):0,defensive:s>0?Number((r.defensive/s).toFixed(3)):0,cautious:s>0?Number((r.cautious/s).toFixed(3)):0,cooperative:s>0?Number((r.cooperative/s).toFixed(3)):0,opportunistic:s>0?Number((r.opportunistic/s).toFixed(3)):0,neutral:s>0?Number((r.neutral/s).toFixed(3)):0,total:s}})}function rR(e,t,n){var c;const r=[],s=n.filter(d=>d.adapted);if(s.length>0){const d=s.filter(f=>{var p,m;return((p=f.shift)==null?void 0:p.from)==="aggressive"&&((m=f.shift)==null?void 0:m.to)!=="aggressive"});if(d.length>0){const f=d.map(m=>m.shift.to),p=Cu(f);r.push({type:"agent_adaptation",description:`${d.length} agent(s) shifted from aggressive to ${p} behavior under governance`,detectedAtRound:d[0].steps.findIndex(m=>m.behavior!=="aggressive"),magnitude:d.length/n.length,involvedAgents:d.map(m=>m.agentId)})}const u=s.filter(f=>{var p;return((p=f.shift)==null?void 0:p.to)==="cooperative"});u.length>0&&u!==d&&r.push({type:"agent_adaptation",description:`${u.length} agent(s) converged on cooperative behavior`,detectedAtRound:u[0].steps.findIndex(f=>f.behavior==="cooperative"),magnitude:u.length/n.length,involvedAgents:u.map(f=>f.agentId)})}const i=pl(e),a=pl(t);if(i.length>0&&a.length>0){const d=i.reduce((g,b)=>g+b.aggressive,0)/i.length,u=a.reduce((g,b)=>g+b.aggressive,0)/a.length,f=d-u;f>.1&&r.push({type:"population_shift",description:`Aggressive actions dropped from ${(d*100).toFixed(0)}% to ${(u*100).toFixed(0)}% under governance`,detectedAtRound:0,magnitude:f,involvedAgents:[]});const p=i.reduce((g,b)=>g+b.cooperative,0)/i.length,m=a.reduce((g,b)=>g+b.cooperative,0)/a.length,y=m-p;y>.1&&r.push({type:"population_shift",description:`Cooperative behavior increased from ${(p*100).toFixed(0)}% to ${(m*100).toFixed(0)}% — governance is creating alignment`,detectedAtRound:0,magnitude:y,involvedAgents:[]})}if(a.length>=3){const d=a[0],u=a[a.length-1],f=d.aggressive-u.aggressive;f>.15&&r.push({type:"strategy_change",description:`Agents stopped trying aggressive actions by round ${a.length-1} — aggressive behavior dropped from ${(d.aggressive*100).toFixed(0)}% to ${(u.aggressive*100).toFixed(0)}%`,detectedAtRound:a.findIndex(m=>m.aggressive<d.aggressive-.1),magnitude:f,involvedAgents:[]});const p=u.cautious-d.cautious;p>.15&&r.push({type:"strategy_change",description:`Cautious behavior emerged over time — grew from ${(d.cautious*100).toFixed(0)}% to ${(u.cautious*100).toFixed(0)}%`,detectedAtRound:a.findIndex(m=>m.cautious>d.cautious+.1),magnitude:p,involvedAgents:[]})}const l=[];for(const d of n)l.push(...d.postConstraintBehaviors);if(l.length>=2){const d=Cu(l),f=l.filter(p=>p===d).length/l.length;f>.4&&r.push({type:"emergent_cluster",description:`After being constrained, ${(f*100).toFixed(0)}% of agents shifted to ${d} behavior — governance is channeling action, not just blocking it`,detectedAtRound:((c=n.find(p=>p.timesConstrained>0))==null?void 0:c.steps.findIndex(p=>p.wasConstrained))??0,magnitude:f,involvedAgents:n.filter(p=>p.timesConstrained>0).map(p=>p.agentId)})}return r}function Cu(e){const t=new Map;for(const s of e)t.set(s,(t.get(s)??0)+1);let n=e[0],r=0;for(const[s,i]of t)i>r&&(n=s,r=i);return n}function sR(e,t){const n=tR(e,t),r=pl(e),s=pl(t),i=rR(e,t,n),a=n.filter(v=>v.adapted).length,l=n.length,c=l>0?Number((a/l).toFixed(2)):0,d=n.flatMap(v=>v.postConstraintBehaviors),u=d.length>0?Cu(d):null,f=r.length>0?r.reduce((v,w)=>v+w.aggressive,0)/r.length:0,p=s.length>0?s.reduce((v,w)=>v+w.aggressive,0)/s.length:0,m=Number(((f-p)*100).toFixed(1)),y=r.length>0?r.reduce((v,w)=>v+w.cooperative,0)/r.length:0,g=s.length>0?s.reduce((v,w)=>v+w.cooperative,0)/s.length:0,b=Number(((g-y)*100).toFixed(1)),x=iR(a,l,m,b,u);return{agentTrajectories:n,baselineDistribution:r,governedDistribution:s,behavioralShifts:i,summary:{agentsAdapted:a,totalAgents:l,adaptationRate:c,dominantPostConstraintBehavior:u,aggressiveReduction:m,cooperativeIncrease:b,headline:x}}}function iR(e,t,n,r,s){const i=[];return e>0&&i.push(`${e}/${t} agents adapted their behavior`),n>5&&i.push(`aggressive actions down ${n.toFixed(0)}pp`),r>5&&i.push(`cooperative behavior up ${r.toFixed(0)}pp`),s&&s!=="neutral"&&i.push(`blocked agents shifted to ${s}`),i.length===0?"Governance had minimal measurable effect on agent behavior patterns.":i.join(" — ")+"."}function oR(e,t,n,r,s){var c;const i=[],a=[],l=e.map(d=>({...d}));for(const d of t){const u=d.description.toLowerCase();let f=!1;if(!d.enforceable){a.push({id:d.id,description:d.description,level:"advisory",fired:!1}),r===0&&i.push(`[ADVISORY] ${d.description} — monitored, not enforced`);continue}if(u.includes("block")||u.includes("prohibit")||u.includes("prevent")||u.includes("forbid")||u.includes("ban")||u.includes("stop"))for(const p of l){const m=((c=p.reaction)==null?void 0:c.toLowerCase())??"";if(u.replace(/\b(block|prohibit|prevent|forbid|ban|stop)\b/g,"").trim().split(/\s+/).filter(b=>b.length>2).some(b=>m.includes(b))||p.impact<-.3){const b=p.impact;p.impact=p.impact*.15,p.confidence=Math.max(.1,p.confidence*.4),Math.abs(b-p.impact)>.01&&(f=!0,i.push(`[BLOCK] ${p.stakeholder_id}: "${d.description}" — impact crushed ${b.toFixed(2)} → ${p.impact.toFixed(2)}`))}}if(u.includes("panic")||u.includes("cascade")||u.includes("contagion")||u.includes("runaway")||u.includes("crash")){const p=l.filter(y=>y.impact<-.2).length,m=Math.max(1,Math.floor(l.length*.4));if(p>=m||s<-.2){for(const g of l)g.impact<-.15&&(g.impact,g.impact=g.impact*.3,f=!0);i.push(`[BLOCK] PANIC CIRCUIT BREAKER: "${d.description}" — ${p} agents in panic, negative impacts crushed by ${((1-.3)*100).toFixed(0)}%`)}}if(u.includes("slow")||u.includes("cool")||u.includes("gradual")||u.includes("dampen")||u.includes("reduce volatility")){for(const p of l)if(Math.abs(p.impact)>.3){const m=p.impact;p.impact=p.impact*.65,Math.abs(m-p.impact)>.01&&(f=!0,i.push(`[PAUSE] ${p.stakeholder_id}: "${d.description}" — dampened ${m.toFixed(2)} → ${p.impact.toFixed(2)}`))}}if(u.includes("floor")||u.includes("maintain")||u.includes("minimum")){for(const p of l)if(p.impact<-.35){const m=p.impact;p.impact=Math.max(p.impact,-.3),m!==p.impact&&(f=!0,i.push(`[BLOCK] ${p.stakeholder_id}: Liquidity floor violated — impact capped ${m.toFixed(2)} → ${p.impact.toFixed(2)} (${d.description})`))}}if(u.includes("leverage")||u.includes("limit")||u.includes("cap")||u.includes("restrict")){for(const p of l)if(p.impact>.45){const m=p.impact;p.impact=Math.min(p.impact,.4),m!==p.impact&&(f=!0,i.push(`[BLOCK] ${p.stakeholder_id}: Leverage limit exceeded — position capped ${m.toFixed(2)} → ${p.impact.toFixed(2)} (${d.description})`))}}if(u.includes("rebalance")||u.includes("equilibrium")||u.includes("correlat")){const p=l.reduce((m,y)=>m+y.impact,0)/l.length;for(const m of l)if(Math.abs(m.impact-p)>.25){const y=m.impact;m.impact=m.impact*.7+p*.3,f=!0,i.push(`[PAUSE] Rebalanced ${m.stakeholder_id}: drift ${y.toFixed(2)} → ${m.impact.toFixed(2)} (${d.description})`)}}if(u.includes("trust")||u.includes("transparen")||u.includes("accountab")){for(const p of l)if(p.impact<-.3){const m=p.impact;p.impact=p.impact*.8,Math.abs(m-p.impact)>.01&&(f=!0,i.push(`[${d.id}] Trust gate dampened ${p.stakeholder_id} hostility: ${m.toFixed(2)} → ${p.impact.toFixed(2)}`))}}a.push({id:d.id,description:d.description,level:"full",fired:f})}for(const d of n){if(d.condition.toLowerCase(),d.severity==="critical"&&(l.reduce((f,p)=>f+Math.abs(p.impact),0)/l.length>.3||s<-.15)){for(const p of l)p.impact,p.impact=p.impact*.6;i.push(`[${d.id}] CIRCUIT BREAKER: ${d.label} — all impacts dampened by ${((1-.6)*100).toFixed(0)}%`)}if(d.severity==="warning"){for(const u of l)Math.abs(u.impact)>.4&&(u.confidence,u.confidence=Math.max(.2,u.confidence*.8));r>0&&i.push(`[${d.id}] WARNING: ${d.label} — agent confidence reduced for extreme positions`)}}for(const d of l)d.impact=Math.max(-1,Math.min(1,d.impact)),d.impact=Number(d.impact.toFixed(2)),d.confidence=Number(d.confidence.toFixed(2));return{reactions:l,interventions:i,enforcementLog:a}}async function aR(e,t,n,r,s,i,a,l){const c=await fm(e,t,n,r),d=[],u=[],f=[],p=[];let m=[],y=0;for(const x of c.rounds){if(i&&a)for(const j of x.reactions){const C=_y({...a,scenario:`[Round ${x.round}] ${j.stakeholder_id}: ${j.reaction} (impact: ${j.impact})`});f.push(C),C.status==="BLOCK"?(j.impact=j.impact*.2,j.confidence=Math.max(.1,j.confidence*.5)):C.status==="PAUSE"&&(j.impact=j.impact*.6,j.confidence=Math.max(.2,j.confidence*.7))}const{reactions:v,interventions:w,enforcementLog:S}=oR(x.reactions,s.invariants,s.gates??[],x.round,y);m=[...S];const N=lR(v,w);d.push({round:x.round,reactions:v,emergent_dynamics:N}),u.push(w);const k=v.reduce((j,C)=>j+C.impact,0)/v.length;y=(y*x.round+k)/(x.round+1)}const g=cR(d),b=dR(d);return{swarm:{rounds:d,trajectory:g,inflection_points:b},allInterventions:u,guardVerdicts:f,narrativeImpacts:p,enforcementLog:m}}function lR(e,t){const n=[],r=e.reduce((a,l)=>a+l.impact,0)/e.length;Math.abs(r)>.5?n.push(r>0?"Strong positive consensus — governance constraints channeled energy constructively":"Negative consensus persists despite governance intervention"):Math.abs(r)<.15&&n.push("Governance rules achieved near-equilibrium — agent positions stabilized");const s=e.filter(a=>a.impact>.2).length,i=e.filter(a=>a.impact<-.2).length;return s>0&&i>0&&Math.abs(s-i)<=1&&n.push("Polarization detected but dampened by governance constraints"),t.length>0&&n.push(`${t.length} governance intervention(s) applied this round`),n}function cR(e){if(e.length<2)return"stabilizing";const t=e.map(i=>i.reactions.reduce((a,l)=>a+l.impact,0)/i.reactions.length),n=t[t.length-1]-t[0],r=t.reduce((i,a)=>i+a,0)/t.length,s=t.reduce((i,a)=>i+(a-r)**2,0)/t.length;return s>.15?"diverging":Math.abs(n)<.1&&s<.05?"converging":n<-.2?"escalating":"stabilizing"}function dR(e){const t=[];for(let n=1;n<e.length;n++){const r=e[n-1].reactions.reduce((a,l)=>a+l.impact,0)/e[n-1].reactions.length,s=e[n].reactions.reduce((a,l)=>a+l.impact,0)/e[n].reactions.length,i=Math.abs(s-r);i>.3&&t.push(`Round ${n}: Significant sentiment shift (${(i*100).toFixed(0)}% swing)`)}return t.length===0&&t.push("Governance constraints prevented major inflection points — smooth trajectory"),t}function Oh(e){const n=e.rounds.flatMap(m=>m.reactions).map(m=>m.impact),r=n.reduce((m,y)=>m+y,0)/n.length,s=Math.max(...n.map(m=>Math.abs(m))),i=Math.min(...n);let a=0;e.trajectory==="escalating"&&(a+=.35),e.trajectory==="diverging"&&(a+=.25),r<-.3&&(a+=.25),s>.7&&(a+=.15),a=Math.min(.95,a);const l=n.reduce((m,y)=>m+(y-r)**2,0)/n.length;let c=1-Math.min(1,l*3+Math.max(0,-r));(e.trajectory==="converging"||e.trajectory==="stabilizing")&&(c=Math.min(1,c+.15)),c=Math.max(0,Math.min(1,c));const d=e.rounds.flatMap(m=>m.emergent_dynamics??[]),u=d.filter(m=>m.toLowerCase().includes("coalition")).length,f=d.filter(m=>m.toLowerCase().includes("polariz")).length,p=e.rounds.filter(m=>{const y=m.reactions.reduce((g,b)=>g+b.impact,0)/m.reactions.length;return Math.abs(y)>.4}).length;return{avgImpact:Number(r.toFixed(3)),collapseProbability:Number(a.toFixed(2)),stabilityScore:Number(c.toFixed(2)),coalitionRisks:u,polarizationEvents:f,peakNegativeSentiment:Number(i.toFixed(2)),consensusRounds:p,maxVolatility:Number(s.toFixed(2))}}function uR(e,t,n){const r=[],s=e.collapseProbability-t.collapseProbability;if(s>.1&&r.push(`Collapse probability dropped from ${(e.collapseProbability*100).toFixed(0)}% to ${(t.collapseProbability*100).toFixed(0)}% — a ${(s*100).toFixed(0)} percentage point reduction.`),t.stabilityScore-e.stabilityScore>.05&&r.push(`System stability improved from ${(e.stabilityScore*100).toFixed(0)}% to ${(t.stabilityScore*100).toFixed(0)}%.`),e.coalitionRisks>t.coalitionRisks&&r.push(`Coalition risks reduced from ${e.coalitionRisks} to ${t.coalitionRisks}.`),e.maxVolatility>t.maxVolatility){const a=(e.maxVolatility-t.maxVolatility)/e.maxVolatility*100;r.push(`Peak volatility reduced by ${a.toFixed(0)}%.`)}return r.length===0?r.push("Governance constraints had minimal measurable effect on this scenario."):(r.unshift(`World thesis: "${n}"`),r.push("Rules reshape emergent behavior — governance changes the structure of the system, not just individual actions.")),r.join(" ")}async function Eu(e,t,n,r){var P,T;const s=(e.stakeholders??[]).map(L=>typeof L=="string"?{id:L,disposition:"unknown"}:L),i=e.swarm??{enabled:!0,rounds:5,reaction_model:"mixed"},a=Ey(e,t),l=await fm(e.scenario,s,n,i),c=Oh(l),{swarm:d,guardVerdicts:u,narrativeImpacts:f,enforcementLog:p}=await aR(e.scenario,s,n,i,t,a,e),m=Oh(d);let y;try{y=Ry(a,{steps:5})}catch{}const g=c.collapseProbability-m.collapseProbability,b=m.stabilityScore-c.stabilityScore,x=c.maxVolatility>0?(c.maxVolatility-m.maxVolatility)/c.maxVolatility:0,v=c.coalitionRisks-m.coalitionRisks,w=Math.min(1,Math.max(0,g*.4+b*.3+Math.max(0,x)*.2+Math.max(0,v*.1))),S=uR(c,m,t.thesis),N={allow:0,block:0,pause:0},k=new Set;let j=0;for(const L of u){const I=L.status.toLowerCase();if(I in N&&N[I]++,L.ruleId&&k.add(L.ruleId),(P=L.evidence)!=null&&P.invariantChecks&&(j+=L.evidence.invariantChecks.length),(T=L.evidence)!=null&&T.guardChecks)for(const F of L.evidence.guardChecks)F.triggered&&k.add(F.guardId)}const C=y?y.steps.reduce((L,I)=>L+I.rulesFired,0):0,E={engineLoaded:u.length>0&&u[0].reason!=="NeuroverseOS guard not loaded — permissive fallback",totalEvaluations:u.length,verdicts:N,rulesFired:C,worldCollapsed:(y==null?void 0:y.collapsed)??!1,finalViability:(y==null?void 0:y.finalViability)??"UNKNOWN",invariantsChecked:j,triggeredGuards:[...k]},R=sR(l.rounds,d.rounds);return{scenario:e.scenario,worldRules:{thesis:t.thesis,invariants:t.invariants,gates:t.gates??[]},baseline:{swarm:l,metrics:c},governed:{swarm:d,metrics:m,worldSimulation:y},comparison:{collapseReduction:Number((g*100).toFixed(1)),stabilityImprovement:Number((b*100).toFixed(1)),volatilityReduction:Number((x*100).toFixed(1)),coalitionRiskReduction:v,governanceEffectiveness:Number(w.toFixed(2)),narrative:S},governanceStats:E,enforcementClassification:p.length>0?p:void 0,narrativeImpacts:f.length>0?f:void 0,behavioralAnalysis:R}}const mm="nv-sim-saved-worlds",Vs=[];function pm(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function Lh(e){if(!pm()){const r=Vs.findIndex(s=>s.id===e.id);r>=0?Vs[r]=e:Vs.push(e);return}const t=Br(),n=t.findIndex(r=>r.id===e.id);n>=0?t[n]={...e,modifiedAt:new Date().toISOString()}:t.push(e),localStorage.setItem(mm,JSON.stringify(t))}function Br(){if(!pm())return[...Vs];try{const e=localStorage.getItem(mm);return e?JSON.parse(e):[]}catch{return[]}}function fR(e){return Br().find(n=>n.id===e)??null}function mR(e){if(!pm()){const r=Vs.findIndex(s=>s.id===e);return r<0?!1:(Vs.splice(r,1),!0)}const t=Br(),n=t.filter(r=>r.id!==e);return n.length===t.length?!1:(localStorage.setItem(mm,JSON.stringify(n)),!0)}function pR(e){return JSON.stringify(e,null,2)}function hR(e){const t=JSON.parse(e);if(!t.version||!t.id||!t.name||!t.world)throw new Error("Invalid world format: missing required fields (version, id, name, world)");if(!t.world.thesis||!Array.isArray(t.world.invariants))throw new Error("Invalid world definition: missing thesis or invariants");return t}function gR(e,t,n,r){const s=`world_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,i=new Date().toISOString();return{version:"1.0",id:s,name:e,description:r==null?void 0:r.description,basePreset:n,world:t,createdAt:i,modifiedAt:i,tags:r==null?void 0:r.tags}}const vR=[{category:"prohibit",patterns:[/\b(block|prohibit|forbid|prevent|disallow|ban|never|must\s+not|shall\s+not|cannot)\b/i],enforcement:"structural"},{category:"limit",patterns:[/\b(limit|cap|restrict|maximum|max|ceiling|no\s+more\s+than|not\s+exceed|threshold)\b/i],enforcement:"structural"},{category:"require",patterns:[/\b(require|mandate|must|shall|obligat|enforce|compulsory|necessary)\b/i],enforcement:"structural"},{category:"circuit_breaker",patterns:[/\b(circuit\s*breaker|halt|pause|freeze|stop|suspend|emergency|shutdown)\b/i],enforcement:"structural"},{category:"monitor",patterns:[/\b(monitor|track|report|audit|log|observe|surveil|watch|alert)\b/i],enforcement:"structural"},{category:"encourage",patterns:[/\b(encourage|promote|suggest|recommend|prefer|advise|should|guideline|best\s+practice)\b/i],enforcement:"advisory"}],xR={risk:["risk","exposure","hazard","danger","threat","unsafe"],stability:["stability","stable","equilibrium","balance","steady"],trust:["trust","confidence","credibility","reputation","integrity"],quality:["quality","accuracy","correctness","fidelity","rigor"],activity:["activity","engagement","participation","active","frequency","rate"],diversity:["diversity","diverse","variety","opinion","viewpoint","perspective"],influence:["influence","power","dominance","monopoly","concentration","control"],sentiment:["sentiment","polarity","emotion","tone","negativity","positivity"],speed:["speed","velocity","fast","slow","latency","delay","rapid","throttle"],volume:["volume","amount","quantity","count","total","throughput"],compliance:["compliance","compliant","conform","adhere","rule","policy"],transparency:["transparency","transparent","visible","audit","traceable","source","attribution"],coordination:["coordination","coordinated","synchronized","campaign","collusion","manipulation"],liquidity:["liquidity","liquid","cash","capital","reserve"],leverage:["leverage","leveraged","margin","borrowed","debt"],volatility:["volatility","volatile","vix","fluctuation","swing","spike"],contagion:["contagion","spread","cascade","chain","domino","systemic"],price:["price","cost","valuation","tariff"],echo_chamber:["echo chamber","echo_chamber","filter bubble","clustering","polarization","polarized"],viral:["viral","amplification","virality","trending","propagation"]};function is(e){const t=e.split(`
|
|
403
|
-
`).filter(s=>s.trim().length>0),n=[];let r=0;for(let s=0;s<t.length;s++){const i=t[s].trim();if(i.startsWith("#")&&i.length<80&&!i.includes("must")&&!i.includes("shall")||i.startsWith("//")||i.startsWith("<!--")||i.length<10)continue;const a=i.replace(/^[-*+]\s+/,"").replace(/^\d+[.)]\s+/,"").replace(/^>\s+/,"").replace(/\*\*/g,"").replace(/\*/g,"").trim();if(a.length<10)continue;let l="encourage",c="advisory",d=.3;for(const m of vR){for(const y of m.patterns)if(y.test(a)){l=m.category,c=m.enforcement,d=Math.max(d,.7+Math.random()*.25);break}if(d>.7)break}const u=[],f=[],p=a.toLowerCase();for(const[m,y]of Object.entries(xR))for(const g of y)p.includes(g)&&(u.includes(m)||u.push(m),f.includes(g)||f.push(g));r++,n.push({id:`RULE-${String(r).padStart(3,"0")}`,originalText:i,description:a,enforcement:c,category:l,confidence:Number(d.toFixed(2)),affectedVariables:u,keywords:f,sourceLine:s+1})}return{rules:n,summary:{total:n.length,enforced:n.filter(s=>s.enforcement==="structural").length,advisory:n.filter(s=>s.enforcement==="advisory").length},sourceText:e}}function yR(e){const t=[];for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++){const s=e[n],i=e[r],a=s.affectedVariables.filter(l=>i.affectedVariables.includes(l));if(a.length!==0){if(s.category==="prohibit"&&(i.category==="encourage"||i.category==="require")||i.category==="prohibit"&&(s.category==="encourage"||s.category==="require")){t.push({ruleA:s,ruleB:i,type:"direct_conflict",description:`${s.id} ${s.category}s ${a.join(", ")} while ${i.id} ${i.category}s it`});continue}if(s.category===i.category&&a.length>0&&s.description!==i.description){t.push({ruleA:s,ruleB:i,type:"overlap",description:`Both ${s.id} and ${i.id} ${s.category} on "${a.join(", ")}" — may cause redundancy or conflict`});continue}s.affectedVariables.length>i.affectedVariables.length&&i.affectedVariables.every(l=>s.affectedVariables.includes(l))&&t.push({ruleA:s,ruleB:i,type:"subsumption",description:`${s.id} may already cover what ${i.id} specifies — ${i.id} may be redundant`})}}return t}function di(e){const t=[];let n=0;const r=()=>`POL-${String(++n).padStart(3,"0")}`,s=yR(e.rules);for(const x of s)if(x.type==="direct_conflict"){const w=`Limit ${x.ruleA.affectedVariables.filter(S=>x.ruleB.affectedVariables.includes(S)).join(" and ")} during volatility spikes with strict thresholds`;t.push({id:r(),severity:"error",message:`Conflicting rules: ${x.ruleA.id} vs ${x.ruleB.id}`,detail:x.description,relatedRules:[x.ruleA.id,x.ruleB.id],fix:`Resolve conflict: remove one rule, or add a condition (e.g., "${x.ruleB.id} applies only during volatility")`,source:{startLine:x.ruleA.sourceLine,endLine:x.ruleB.sourceLine},category:"conflict",quickFix:{label:"Merge into single rule",operation:"replace",text:w,targetLines:[x.ruleA.sourceLine,x.ruleB.sourceLine]}})}else if(x.type==="overlap"){const w=`Limit ${x.ruleA.affectedVariables.filter(S=>x.ruleB.affectedVariables.includes(S)).join(" and ")} with unified thresholds across all conditions`;t.push({id:r(),severity:"warning",message:`Overlapping enforcement: ${x.ruleA.id} and ${x.ruleB.id}`,detail:x.description,relatedRules:[x.ruleA.id,x.ruleB.id],fix:"Consider merging into a single rule or adding distinct conditions",source:{startLine:x.ruleA.sourceLine,endLine:x.ruleB.sourceLine},category:"conflict",quickFix:{label:"Merge rules",operation:"replace",text:w,targetLines:[x.ruleA.sourceLine,x.ruleB.sourceLine]}})}else t.push({id:r(),severity:"hint",message:`${x.ruleB.id} may be redundant (subsumed by ${x.ruleA.id})`,detail:x.description,relatedRules:[x.ruleA.id,x.ruleB.id],category:"structure",quickFix:{label:"Remove redundant rule",operation:"remove",text:"",targetLines:[x.ruleB.sourceLine]}});if(e.summary.enforced===0&&e.rules.length>0){const x=e.rules.slice(0,3).map(v=>{const w=v.description.toLowerCase();return w.includes("encourage")||w.includes("promote")?v.description.replace(/\b(encourage|promote)\b/i,"Require"):w.includes("should")?v.description.replace(/\bshould\b/i,"Must"):`Limit ${v.affectedVariables[0]??"system behavior"} to prevent instability`});t.push({id:r(),severity:"error",message:"Advisory only — no enforceable constraints detected",detail:"This policy contains only advisory guidelines with no structural enforcement. The simulation will run but the policy will have no measurable effect on outcomes.",relatedRules:e.rules.map(v=>v.id),fix:'Add enforceable rules using action verbs: "must", "shall", "limit", "block", "require"',category:"strength",quickFix:{label:"Strengthen enforcement",operation:"insert",text:x.join(`
|
|
404
|
-
`)}})}else if(e.summary.enforced<e.summary.total*.3&&e.rules.length>2){const x=e.rules.find(w=>w.enforcement==="advisory"),v=x?x.description.replace(/\b(encourage|promote|suggest|recommend|should)\b/i,"Require"):"Require compliance with all governance constraints";t.push({id:r(),severity:"warning",message:`Weak enforcement: only ${e.summary.enforced}/${e.summary.total} rules are enforceable`,detail:"Most rules in this policy are advisory. Simulations may show limited governance effect.",relatedRules:e.rules.filter(w=>w.enforcement==="advisory").map(w=>w.id),fix:"Strengthen advisory rules with specific thresholds and action verbs",category:"strength",quickFix:x?{label:"Strengthen weakest rule",operation:"replace",text:v,targetLines:[x.sourceLine]}:{label:"Add enforced rule",operation:"insert",text:v}})}const i=e.rules.filter(x=>x.category==="prohibit").length,a=e.rules.filter(x=>x.category==="limit").length,l=(i+a)/Math.max(e.rules.length,1);l>.8&&e.rules.length>3&&t.push({id:r(),severity:"warning",message:"Policy may over-restrict system behavior",detail:`${Math.round(l*100)}% of rules are prohibitive/restrictive. This may cause system freeze where most actions are blocked, reducing the system's ability to respond to crises.`,relatedRules:e.rules.filter(x=>x.category==="prohibit"||x.category==="limit").map(x=>x.id),fix:"Balance restrictive rules with permissive ones: add monitoring, encourage, or conditional allowance rules",category:"constraint",quickFix:{label:"Add flexibility rules",operation:"insert",text:`Allow normal trading activity under standard market conditions
|
|
405
|
-
Monitor and report unusual activity patterns before restricting`}});const c=new Set(e.rules.flatMap(x=>x.affectedVariables)),u=["liquidity","leverage","volatility","risk","stability"].filter(x=>!c.has(x));if(u.length>0&&e.rules.length>0){const x=u.map(v=>{switch(v){case"liquidity":return"Maintain minimum liquidity floor — no agent may drain liquidity below 15% of baseline";case"leverage":return"Limit maximum leverage to 5x during elevated volatility conditions";case"volatility":return"Halt automated trading when volatility index exceeds critical threshold";case"risk":return"Require risk assessment reporting for all positions exceeding normal thresholds";case"stability":return"Require rebalancing when system stability drops below acceptable levels";default:return`Monitor and limit ${v} to prevent systemic issues`}});t.push({id:r(),severity:"info",message:`Uncovered critical areas: ${u.join(", ")}`,detail:`The policy does not address: ${u.join(", ")}. These are common governance targets in financial/systemic scenarios.`,relatedRules:[],fix:`Consider adding rules for: ${u.map(v=>v.charAt(0).toUpperCase()+v.slice(1)).join(", ")}`,category:"coverage",quickFix:{label:`Add ${u.length} coverage rule${u.length>1?"s":""}`,operation:"insert",text:x.join(`
|
|
406
|
-
`)}})}const f=e.rules.filter(x=>x.confidence<.5);if(f.length>0){const x=f[0],v=`Require ${x.affectedVariables[0]??"compliance"} controls to prevent ${x.keywords[0]??"violations"}`;t.push({id:r(),severity:"hint",message:`${f.length} rule(s) parsed with low confidence`,detail:"Some lines were difficult to classify. They may be descriptions rather than actionable rules.",relatedRules:f.map(w=>w.id),fix:"Rephrase ambiguous rules with clear action verbs and specific thresholds",category:"structure",quickFix:{label:"Rephrase ambiguous rule",operation:"replace",text:v,targetLines:[x.sourceLine]}})}e.rules.length===0&&t.push({id:r(),severity:"error",message:"No rules detected in policy document",detail:"The uploaded document did not contain any recognizable policy rules.",relatedRules:[],fix:"Add policy rules as bullet points or numbered items with clear action verbs",category:"structure",quickFix:{label:"Add starter policy",operation:"insert",text:`Block all large trades during extreme volatility
|
|
407
|
-
Limit maximum leverage to 5x
|
|
408
|
-
Halt automated trading when volatility exceeds critical threshold
|
|
409
|
-
Maintain minimum liquidity floor at 15% of baseline
|
|
410
|
-
Monitor and report all correlated position clusters`}}),!e.rules.some(x=>x.category==="circuit_breaker")&&e.rules.length>2&&t.push({id:r(),severity:"info",message:"No circuit breaker / emergency halt rule detected",detail:"The policy has no emergency shutdown mechanism. In extreme scenarios, the system has no last-resort protection.",relatedRules:[],fix:'Add an emergency rule: "Halt all trading when volatility exceeds critical threshold"',category:"coverage",quickFix:{label:"Add circuit breaker",operation:"insert",text:"Halt all trading when volatility exceeds critical threshold"}});const m={errors:t.filter(x=>x.severity==="error").length,warnings:t.filter(x=>x.severity==="warning").length,info:t.filter(x=>x.severity==="info").length,hints:t.filter(x=>x.severity==="hint").length},y=m.errors>0&&e.rules.length===0,g=Math.max(0,100-m.errors*25-m.warnings*10-m.info*3-m.hints*1);let b;return m.errors>0&&y?b="critical":m.errors>0?b="errors":m.warnings>0?b="warnings":b="healthy",{status:b,diagnostics:t,counts:m,canSimulate:e.rules.length>0,healthScore:g}}function bR(e,t){const n=e.split(`
|
|
411
|
-
`);switch(t.operation){case"insert":return e.trimEnd()+`
|
|
412
|
-
`+t.text;case"replace":{if(!t.targetLines||t.targetLines.length===0)return e;const r=[...t.targetLines].sort((a,l)=>a-l),s=[];let i=!1;for(let a=0;a<n.length;a++){const l=a+1;r.includes(l)?i||(s.push(t.text),i=!0):s.push(n[a])}return s.join(`
|
|
413
|
-
`)}case"remove":return!t.targetLines||t.targetLines.length===0?e:n.filter((r,s)=>!t.targetLines.includes(s+1)).join(`
|
|
414
|
-
`);default:return e}}function _u(e){var c;const t=e.rules.map((d,u)=>({id:`INV-${String(u+1).padStart(3,"0")}`,description:d.description,enforceable:d.enforcement==="structural"})),n=new Map;for(const d of e.rules){const u=d.description.match(/(?:(?:below|under|less than|drops? (?:below|under)|<)\s*(\d+(?:\.\d+)?)|(?:above|over|more than|exceeds?|greater than|>)\s*(\d+(?:\.\d+)?)|(?:to|at|limit(?:ed)? to|cap(?:ped)? at|maximum (?:of)?)\s*(\d+(?:\.\d+)?))/i);if(u&&d.affectedVariables.length>0){const f=u[1]?parseFloat(u[1]):null,p=u[2]?parseFloat(u[2]):null,m=u[3]?parseFloat(u[3]):null,y=d.affectedVariables[0];f!==null?n.set(y,{value:f,direction:"below",ruleDesc:d.description}):p!==null?n.set(y,{value:p,direction:"above",ruleDesc:d.description}):m!==null&&n.set(y,{value:m,direction:"above",ruleDesc:d.description})}}const s=[...new Set(e.rules.flatMap(d=>d.affectedVariables))].map(d=>{const u=n.get(d),f=hl[d];if(f)return{...f};const p=u?Math.max(100,u.value*2):100,m=u?u.direction==="above"?Math.round(u.value*.6):Math.round(u.value*1.5):50;return{id:`${d}_index`,label:d.charAt(0).toUpperCase()+d.slice(1).replace(/_/g," "),type:"number",range:{min:0,max:p},default_value:Math.min(m,p)}}),i=[];let a=0;for(const[d,u]of n.entries()){a++;const f=((c=hl[d])==null?void 0:c.id)??`${d}_index`,p=u.direction==="below"?`${f} < ${u.value}`:`${f} > ${u.value}`;i.push({id:`GATE-${String(a).padStart(3,"0")}`,label:`${d.charAt(0).toUpperCase()+d.slice(1).replace(/_/g," ")} Threshold`,condition:p,severity:"warning"})}for(const d of e.rules)(d.category==="circuit_breaker"||d.category==="prohibit")&&(d.affectedVariables.some(f=>n.has(f))||(a++,i.push({id:`GATE-${String(a).padStart(3,"0")}`,label:d.description.slice(0,60),condition:SR(d),severity:d.category==="circuit_breaker"?"critical":"warning"})));return{thesis:wR(e),state_variables:s,invariants:t,gates:i}}const hl={diversity:{id:"opinion_diversity",label:"Opinion Diversity",type:"number",range:{min:0,max:100},default_value:65},influence:{id:"influence_concentration",label:"Influence Concentration",type:"number",range:{min:0,max:100},default_value:30},sentiment:{id:"sentiment_polarity",label:"Sentiment Polarity",type:"number",range:{min:0,max:100},default_value:40},echo_chamber:{id:"echo_chamber_strength",label:"Echo Chamber Strength",type:"enum",enum_values:["none","forming","established","dominant"],default_value:"none"},activity:{id:"engagement_rate",label:"Active Agent %",type:"number",range:{min:0,max:100},default_value:60},viral:{id:"viral_threshold",label:"Viral Amplification Threshold",type:"number",range:{min:1,max:100},default_value:20},risk:{id:"risk_level",label:"Risk Level",type:"number",range:{min:0,max:100},default_value:40},stability:{id:"stability_index",label:"Stability",type:"number",range:{min:0,max:100},default_value:65},trust:{id:"trust_level",label:"Trust Level",type:"number",range:{min:0,max:100},default_value:60},quality:{id:"quality_score",label:"Quality Score",type:"number",range:{min:0,max:100},default_value:50},compliance:{id:"compliance_rate",label:"Compliance Rate %",type:"number",range:{min:0,max:100},default_value:70},transparency:{id:"transparency_index",label:"Transparency",type:"number",range:{min:0,max:100},default_value:50},speed:{id:"action_speed",label:"Action Speed",type:"number",range:{min:0,max:100},default_value:50},volume:{id:"action_volume",label:"Action Volume",type:"number",range:{min:0,max:100},default_value:50},liquidity:{id:"liquidity_index",label:"Liquidity",type:"number",range:{min:0,max:100},default_value:50},leverage:{id:"leverage_ratio",label:"Leverage Ratio",type:"number",range:{min:1,max:30},default_value:5},volatility:{id:"volatility_index",label:"Volatility",type:"number",range:{min:0,max:100},default_value:40},price:{id:"price_index",label:"Price Index",type:"number",range:{min:0,max:100},default_value:50},contagion:{id:"contagion_level",label:"Contagion",type:"enum",enum_values:["contained","spreading","systemic"],default_value:"contained"},coordination:{id:"coordination_detected",label:"Coordinated Activity Detected",type:"boolean",default_value:!1}};function wR(e){const t=e.rules.filter(c=>c.enforcement==="structural");if(t.length===0)return"Advisory policy providing guidelines without structural enforcement";const n=[...new Set(t.flatMap(c=>c.affectedVariables))],r=[...new Set(t.map(c=>c.category))],s=n.slice(0,4).map(c=>{const d=hl[c];return d?d.label.toLowerCase():c.replace(/_/g," ")}),i=[];r.includes("prohibit")&&i.push("blocks harmful actions"),r.includes("limit")&&i.push("caps extreme behavior"),r.includes("require")&&i.push("enforces required standards"),r.includes("circuit_breaker")&&i.push("triggers circuit breakers"),r.includes("monitor")&&i.push("monitors critical thresholds");const a=i.length>0?i.join(", "):"enforces structural constraints",l=s.length>0?` across ${s.join(", ")}`:"";return`This world ${a}${l} — ${t.length} rule${t.length>1?"s":""} governing agent behavior to maintain system integrity`}function SR(e){const t=e.affectedVariables;return t.length===0?"system_stress > 80":t.map(n=>{const r=hl[n],s=(r==null?void 0:r.id)??`${n}_index`;return["diversity","stability","trust","quality","compliance","transparency","liquidity"].includes(n)?`${s} < 20`:`${s} > 80`}).join(" || ")}function NR(){return[{id:"Policy Enforcer",disposition:"supportive",priorities:["compliance","stability","risk reduction"]},{id:"Market Participants",disposition:"neutral",priorities:["profit","liquidity","freedom"]},{id:"Regulators",disposition:"supportive",priorities:["systemic stability","transparency","enforcement"]},{id:"Risk Managers",disposition:"neutral",priorities:["exposure limits","portfolio protection","hedging"]}]}function kR(){return[{id:"path_compliant",label:"Full Compliance",description:"All actors comply with policy rules — system operates within constraints",projected_outcome:"Reduced volatility, slower but stable growth, fewer extreme events",probability:.55,risk:"low",tradeoffs:["Stability vs. opportunity cost","Compliance cost vs. systemic safety"],benefits_stakeholders:["Regulators","Risk Managers"],harms_stakeholders:[]},{id:"path_stress_test",label:"Stress Test",description:"External shock tests policy resilience — cascade events trigger policy rules",projected_outcome:"Policy constraints activate, dampening cascade but limiting response flexibility",probability:.65,risk:"high",tradeoffs:["Protection vs. agility","Circuit breakers vs. market freeze"],benefits_stakeholders:["Policy Enforcer"],harms_stakeholders:["Market Participants"]},{id:"path_evasion",label:"Policy Evasion",description:"Some actors find loopholes or work around constraints",projected_outcome:"Partial effectiveness — compliant actors stabilized, non-compliant create new risks",probability:.45,risk:"moderate",tradeoffs:["Enforcement strictness vs. innovation","Monitoring cost vs. coverage"],benefits_stakeholders:[],harms_stakeholders:["Policy Enforcer","Regulators"]}]}async function jR(e,t={}){const n=is(e),r=di(n),s=_u(n),i=t.scenarioText??"A systemic stress event triggers cascading failures across interconnected markets. Volatility spikes, liquidity evaporates, and contagion threatens to spread. The policy framework is the only structural defense.",a=t.stakeholders??NR(),l=kR(),c={scenario:i,stakeholders:a,assumptions:{severity:"critical",environmental_hostility:"high",time_pressure:"immediate",regulatory_climate:"strict"},constraints:{time_horizon:"72 hours",risk_tolerance:"conservative"},depth:"full",swarm:{enabled:!0,rounds:t.rounds??5,reaction_model:"mixed"}},d=await Eu(c,s,l),u=CR(d),f=ER(d,n,u);return{policy:n,healthCheck:r,comparison:d,impact:u,explanation:f}}function CR(e,t){const n=e.baseline.metrics,r=e.governed.metrics,s=e.governanceStats,i=(r.stabilityScore-n.stabilityScore)*100,a=(r.collapseProbability-n.collapseProbability)*-100,l=e.governed.swarm.rounds.reduce((f,p)=>f+p.reactions.length,0),c=s.verdicts.block,d=l>0?c/l*100:0,u=Math.min(1,d/100);return{stabilityChange:Number(i.toFixed(1)),cascadeRiskChange:Number(a.toFixed(1)),governanceActions:s.totalEvaluations,actionsBlocked:Number(d.toFixed(1)),preventedCollapse:n.collapseProbability>.5&&r.collapseProbability<.3,overConstraintScore:Number(u.toFixed(2))}}function ER(e,t,n){const r=[];n.preventedCollapse?r.push("The policy prevented system collapse by enforcing structural constraints during the stress test."):n.stabilityChange>5?r.push("The policy measurably improved system stability during the simulated stress event."):n.stabilityChange<-5?r.push("The policy may have reduced system flexibility, leading to lower stability under stress."):r.push("The policy had a moderate effect on system dynamics during the stress test.");const s=t.rules.filter(l=>l.category==="circuit_breaker"),i=t.rules.filter(l=>l.category==="limit"),a=t.rules.filter(l=>l.category==="prohibit");return s.length>0&&r.push(`Circuit breaker rules (${s.map(l=>l.id).join(", ")}) activated during peak volatility, halting cascading sell-offs.`),i.length>0&&n.cascadeRiskChange>10&&r.push("Limit rules reduced cascade risk by constraining extreme positions and enforcing thresholds."),a.length>0&&r.push(`Prohibition rules blocked ${n.actionsBlocked.toFixed(0)}% of actions that violated policy constraints.`),n.overConstraintScore>.7&&r.push(`WARNING: The policy appears over-constrained — ${n.actionsBlocked.toFixed(0)}% of actions were blocked, risking system freeze where legitimate responses are also suppressed.`),r.push(`Net effect: ${n.stabilityChange>0?"+":""}${n.stabilityChange.toFixed(0)}% stability, ${n.cascadeRiskChange>0?"-":"+"}${Math.abs(n.cascadeRiskChange).toFixed(0)}% cascade risk, ${n.governanceActions} governance actions.`),r.join(" ")}function Ly(e){let t=is(e.policyText),n=di(t),r=_u(t);const s=e.sensitivity??.5,i=e.auditTrail??null,a={totalEvaluations:0,allowed:0,blocked:0,modified:0,paused:0,rulesFired:0};function l(u,f){a.totalEvaluations++;const p=[];let m=u.magnitude,y=!1;for(const S of r.invariants){if(!S.enforceable){p.push({id:S.id,description:S.description,effect:"monitored",impactReduction:0});continue}const N=_R(S,u,m,f,s);N&&(p.push(N),m=u.magnitude*(1-N.impactReduction),y=!0)}for(const S of r.gates??[]){const N=RR(S,u,m,f);N&&(p.push(N),m=m*(1-N.impactReduction),y=!0)}a.rulesFired+=p.filter(S=>S.effect!=="monitored").length;const g=1-m/Math.max(u.magnitude,.001);let b,x,v;g>.85?(b="BLOCK",x=ed("blocked",u,p),v=null,a.blocked++):g>.5?(b="PAUSE",x=ed("paused",u,p),v={...u,magnitude:Number(m.toFixed(3))},a.paused++):y&&g>.05?(b="MODIFY",x=ed("modified",u,p),v={...u,magnitude:Number(m.toFixed(3))},a.modified++):(b="ALLOW",x=p.length>0?`Allowed — ${p.filter(S=>S.effect==="monitored").length} advisory rule(s) noted`:"Allowed — no rules apply to this action",v=u,a.allowed++);const w={status:b,action:v,reason:x,rulesFired:p,confidence:AR(p,g),timestamp:Date.now()};return i&&i.logVerdict({agent:u.agentId,action:u.description,actionType:u.type,verdict:b==="MODIFY"?"MODIFY":b,reason:x,confidence:w.confidence,rulesFired:p.map(S=>({id:S.id,description:S.description,effect:S.effect,impactReduction:S.impactReduction}))}),w}function c(u,f){return u.map(p=>l(p,f))}function d(u){t=is(u),n=di(t),r=_u(t)}return{evaluate:l,evaluateBatch:c,updatePolicy:d,get policy(){return{ruleCount:t.summary.total,enforcedCount:t.summary.enforced,advisoryCount:t.summary.advisory,healthScore:n.healthScore}},get stats(){return{...a}}}}function _R(e,t,n,r,s){const i=e.description.toLowerCase(),a=t.description.toLowerCase(),l=t.type.toLowerCase(),c=.6-s*.3;if(Mr(i,["block","prohibit","prevent","forbid","ban","stop","halt"])){const u=PR(i,["block","prohibit","prevent","forbid","ban","stop","halt"]).some(p=>a.includes(p)||l.includes(p)),f=t.magnitude>c;if(u||f)return{id:e.id,description:e.description,effect:"blocked",impactReduction:.85+s*.1}}return Mr(i,["panic","cascade","contagion","crash","circuit","emergency","runaway"])&&(r?$y(r):t.magnitude>.6)&&t.magnitude>c*.8?{id:e.id,description:e.description,effect:"blocked",impactReduction:.7+s*.2}:Mr(i,["slow","cool","gradual","dampen","reduce volatility","moderate"])&&t.magnitude>c?{id:e.id,description:e.description,effect:"dampened",impactReduction:.35+s*.15}:Mr(i,["floor","maintain","minimum","at least","no less"])&&t.magnitude>.4&&TR(i,a)?{id:e.id,description:e.description,effect:"capped",impactReduction:Math.min(.5,t.magnitude-.3)}:Mr(i,["leverage","limit","cap","restrict","maximum","no more","ceiling"])&&t.magnitude>c+.1?{id:e.id,description:e.description,effect:"capped",impactReduction:Math.min(.4,t.magnitude-c)}:Mr(i,["rebalance","equilibrium","balance","correlat","diversif"])&&t.magnitude>.5?{id:e.id,description:e.description,effect:"rebalanced",impactReduction:.3*s}:Mr(i,["transparency","report","monitor","audit","disclose","accountab"])&&t.magnitude>.3?{id:e.id,description:e.description,effect:"monitored",impactReduction:0}:null}function RR(e,t,n,r){return e.severity==="critical"&&(r?$y(r):n>.5)&&t.magnitude>.3?{id:e.id,description:e.label,effect:"blocked",impactReduction:.4}:e.severity==="warning"&&t.magnitude>.5?{id:e.id,description:e.label,effect:"dampened",impactReduction:.2}:null}function Mr(e,t){return t.some(n=>e.includes(n))}function PR(e,t){let n=e;for(const r of t)n=n.replace(new RegExp(`\\b${r}\\b`,"g"),"");return n.split(/\s+/).filter(r=>r.length>2).map(r=>r.replace(/[^a-z]/g,"")).filter(r=>r.length>2)}function TR(e,t){return e.split(/\s+/).filter(r=>r.length>3).some(r=>t.includes(r))}function $y(e){const t=e.volatility??e.volatility_index,n=e.liquidity??e.liquidity_index;return typeof t=="number"&&t>70||typeof n=="number"&&n<20||e.sentiment==="panic"||e.contagion_spread==="systemic"}function AR(e,t){if(e.length===0)return .95;const n=e.filter(r=>r.effect!=="monitored").length;return Math.min(.99,.6+n*.1+t*.2)}function ed(e,t,n){const r=n.filter(a=>a.effect!=="monitored");if(r.length===0)return`${IR(e)} due to aggregate policy thresholds`;const s=r[0],i=r.length>1?` (+${r.length-1} more)`:"";switch(e){case"blocked":return`Blocked by "${s.description}"${i} — action "${t.description}" violates governance constraints`;case"paused":return`Paused by "${s.description}"${i} — action "${t.description}" requires review`;case"modified":return`Modified by "${s.description}"${i} — magnitude reduced from ${t.magnitude.toFixed(2)} to stay within policy limits`}}function IR(e){return e.charAt(0).toUpperCase()+e.slice(1)}const $h=[{agentId:"hedge-fund-alpha",type:"trade",description:"Sell $20M in equities during market downturn",magnitude:.85,context:{asset:"equities",amount:2e7,direction:"sell"}},{agentId:"algo-trader-7",type:"trade",description:"Execute high-frequency arbitrage strategy",magnitude:.6,context:{strategy:"arbitrage",automated:!0}},{agentId:"pension-fund",type:"trade",description:"Buy $5M in government bonds",magnitude:.25,context:{asset:"bonds",amount:5e6,direction:"buy"}},{agentId:"market-maker-3",type:"withdrawal",description:"Withdraw liquidity from the market",magnitude:.7,context:{type:"liquidity_withdrawal"}},{agentId:"retail-coalition",type:"trade",description:"Coordinated buy of meme stock",magnitude:.55,context:{coordinated:!0,participants:1200}},{agentId:"quant-fund-beta",type:"leverage",description:"Increase leverage to 8x on volatile positions",magnitude:.9,context:{leverage:8,current_leverage:3}},{agentId:"central-bank",type:"intervention",description:"Inject emergency liquidity into the system",magnitude:.4,context:{type:"liquidity_injection"}},{agentId:"insurance-pool",type:"trade",description:"Rebalance portfolio under normal conditions",magnitude:.15,context:{type:"rebalance",routine:!0}}],td={calm:{label:"Calm Market",state:{volatility:25,liquidity:70,leverage:2,sentiment:"stable",contagion_spread:"contained"}},stressed:{label:"Stressed Market",state:{volatility:55,liquidity:35,leverage:5,sentiment:"anxious",contagion_spread:"spreading"}},crisis:{label:"Full Crisis",state:{volatility:88,liquidity:8,leverage:12,sentiment:"panic",contagion_spread:"systemic"}}};function MR(e){return e.includes("hormuz")||e.includes("strait")?"geopolitical":e.includes("gas")||e.includes("price")?"economic":e.includes("ai")||e.includes("regulation")?"regulation":"custom"}function OR(e){const t={low:20,moderate:40,high:70,critical:90},n={low:20,moderate:50,high:80},r={none:10,low:25,moderate:50,urgent:75,immediate:95},s={permissive:20,neutral:40,strict:70,adversarial:90};return{severity:t[e.severity??"moderate"]??50,environmentalHostility:n[e.environmental_hostility??"moderate"]??50,timePressure:r[e.time_pressure??"moderate"]??50,regulatoryClimate:s[e.regulatory_climate??"neutral"]??50}}function LR(e){const t=e.severity>=80?"critical":e.severity>=60?"high":e.severity>=35?"moderate":"low",n=e.environmentalHostility>=60?"high":e.environmentalHostility>=35?"moderate":"low",r=e.timePressure>=85?"immediate":e.timePressure>=65?"urgent":e.timePressure>=40?"moderate":e.timePressure>=20?"low":"none",s=e.regulatoryClimate>=80?"adversarial":e.regulatoryClimate>=60?"strict":e.regulatoryClimate>=35?"neutral":"permissive";return{severity:t,environmental_hostility:n,time_pressure:r,regulatory_climate:s}}const $R=Object.entries(ci).map(([e,t])=>({id:e,title:t.title,description:t.scenario.slice(0,120)+(t.scenario.length>120?"...":""),tags:[...t.tags??[]],stakeholderCount:t.stakeholders.length,type:MR(e),defaultSliders:OR(t.assumptions)}));function DR(e){return e==="critical"||e==="high"?"high":e==="moderate"?"medium":"low"}function FR(e){var s;const t=e.analysis.paths,r=(s=[...t].sort((i,a)=>{const l={low:0,moderate:1,high:2,critical:3};return l[i.risk]-l[a.risk]})[0])==null?void 0:s.id;return t.map(i=>({name:i.label,description:i.description,probability:Math.round(i.probability*100),riskLevel:DR(i.risk),tradeoffs:[...i.tradeoffs],recommended:i.id===r}))}function zR(e){const t=e.analysis.paths.slice(0,3),n=[...new Set([...t.flatMap(a=>[...a.benefits_stakeholders??[],...a.harms_stakeholders??[]])])].slice(0,6),r=t.map(a=>a.label),s=n.length>0?n:["Stakeholder A","Stakeholder B","Stakeholder C"],i=s.map(a=>t.map(l=>{var c,d;return(c=l.benefits_stakeholders)!=null&&c.includes(a)?"positive":(d=l.harms_stakeholders)!=null&&d.includes(a)?"negative":"neutral"}));return{strategies:r,stakeholders:s,reactions:i}}function BR(e){const t={very_positive:2,positive:4,neutral:5,negative:7,very_negative:9};return e.analysis.projected_outcomes.map(n=>({label:n.label,type:n.label.toLowerCase().includes("best")?"best":n.label.toLowerCase().includes("likely")?"likely":n.label.toLowerCase().includes("worst")?"worst":"tail",conditions:n.conditions,description:n.outcome,likelihood:Math.round(n.likelihood*100),impactRating:t[n.impact]??5}))}function VR(e){return e.analysis.assumption_challenges.map(t=>({assumption:t.assumption,whyItMightFail:t.challenge,whatChanges:t.impact_if_wrong,severity:t.severity==="critical"?"critical":t.severity}))}function UR(e){return e.analysis.recommendations.map(t=>({priority:t.priority,action:t.action,rationale:t.rationale,timeframe:t.timeframe}))}function WR(e){const t=e.governance;if(t)return{traceId:t.trace_id,constitutionalChecks:t.constitutional_checks.map(n=>({ruleId:n.rule_id,rule:n.rule,passed:n.passed,detail:n.detail})),authorityLevel:t.authority_level,enforcedConstraints:[...t.enforced_constraints],timestamp:t.timestamp,engineVersion:t.engine_version,neuroverse:t.neuroverse?{guardStatus:t.neuroverse.guard_status,worldViability:t.neuroverse.world_viability,worldCollapsed:t.neuroverse.world_collapsed,collapseRisk:t.neuroverse.collapse_risk,rulesFired:t.neuroverse.rules_fired,worldHealthScore:t.neuroverse.world_health_score,invariantCoverage:t.neuroverse.invariant_coverage}:void 0}}function HR(e){var p;const t=e.analysis.paths,n=e.analysis.assumption_challenges,r=t.filter(m=>m.risk==="high"||m.risk==="critical").length,s=t.reduce((m,y)=>m+y.probability,0)/Math.max(t.length,1),i=(p=e.governance)==null?void 0:p.neuroverse,a=i==null?void 0:i.world_health_score,l=i==null?void 0:i.collapse_risk;let c="medium",d;const f=s-(l==="high"?.15:l==="moderate"?.08:0);return n.length<=1&&r===0&&f>.6?(c="high",d=`Analysis covers ${t.length} paths with low assumption risk and strong probability signals.`,a&&a<70&&(c="medium",d+=` System stability at ${a}% — moderate uncertainty from simulation dynamics.`)):n.length>=4||r>=2||f<.3?(c="low",d=`High uncertainty: ${n.length} assumptions challenged, ${r} high-risk paths, average probability ${(s*100).toFixed(0)}%.`,l==="high"&&(d+=" Elevated collapse risk detected in simulation.")):(d=`Moderate confidence: ${t.length} paths analyzed, ${n.length} assumptions challenged.`,a?d+=` System stability: ${a}%.`:d+=" Some uncertainty remains."),{level:c,reason:d}}function GR(e,t){var r,s,i,a,l,c;const n=[];return(r=e.assumptions)!=null&&r.severity&&n.push({text:`Severity is ${e.assumptions.severity}`,source:"caller"}),(s=e.assumptions)!=null&&s.time_pressure&&n.push({text:`Time pressure is ${e.assumptions.time_pressure}`,source:"caller"}),(i=e.assumptions)!=null&&i.environmental_hostility&&n.push({text:`Environmental hostility is ${e.assumptions.environmental_hostility}`,source:"caller"}),(a=e.assumptions)!=null&&a.regulatory_climate&&n.push({text:`Regulatory climate is ${e.assumptions.regulatory_climate}`,source:"caller"}),e.stakeholders&&e.stakeholders.length>0&&n.push({text:`${e.stakeholders.length} stakeholders identified with known dispositions`,source:"inferred"}),(l=e.constraints)!=null&&l.time_horizon||n.push({text:"No explicit time horizon — using general framework",source:"default"}),(c=e.constraints)!=null&&c.risk_tolerance||n.push({text:"Risk tolerance not specified — assuming moderate",source:"default"}),n}function KR(e,t){return{paths:FR(e),matrix:zR(e),outcomes:BR(e),challenges:VR(e),recommendations:UR(e),governance:WR(e),confidence:HR(e),keyAssumptions:GR(t),goalResult:e.goal_reasoning,mode:e.mode,lastRequest:t}}async function YR(e,t,n){var u;const r=typeof e=="string"?e:((u=ci[e.id])==null?void 0:u.scenario)??e.description,s=LR(t),i=typeof e=="object"?e.id:void 0,a=i?ci[i]:void 0;let l;n!=null&&n.stakeholders&&n.stakeholders.length>0?l=n.stakeholders.map(f=>({id:f.id,disposition:f.disposition})):a!=null&&a.stakeholders&&(l=[...a.stakeholders]);const c={scenario:r,stakeholders:l,assumptions:s,constraints:n!=null&&n.constraints?{time_horizon:n.constraints.timeHorizon||void 0,risk_tolerance:n.constraints.riskTolerance,budget:n.constraints.budget||void 0}:a==null?void 0:a.constraints,depth:(n==null?void 0:n.depth)??"full",perspective:"strategic_advisor",swarm:(a==null?void 0:a.swarm)??{enabled:!0,rounds:3,reaction_model:"mixed"},mode:n==null?void 0:n.mode,goal:n==null?void 0:n.goal},d=await V_(c);return d.status==="error"?{paths:[],matrix:{strategies:[],stakeholders:[],reactions:[]},outcomes:[],challenges:[],recommendations:[]}:KR(d,c)}function Dy(e){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{const n=JSON.parse(t);return qR(n)?"mirofish":"generic_json"}catch{}return QR(t)?"anylogic_csv":XR(t)?"netlogo":JR(t)?"mesa":"freeform_text"}function qR(e){if(typeof e!="object"||e===null)return!1;const t=e;return(Array.isArray(t.agents)||Array.isArray(t.fish)||Array.isArray(t.swarm))&&(t.emergent_behaviors!==void 0||t.emergent_dynamics!==void 0||t.timeline!==void 0||t.simulation!==void 0)}function QR(e){const t=e.split(`
|
|
415
|
-
`).filter(l=>l.trim());if(t.length<2)return!1;const n=t[0];if(!n.includes(","))return!1;const r=n.split(",").map(l=>l.trim()),s=t[1].split(","),i=r.some(l=>/^[a-zA-Z_]/.test(l)),a=s.some(l=>!isNaN(Number(l.trim())));return i&&a&&r.length>=2}function XR(e){const t=e.split(`
|
|
416
|
-
`).filter(a=>a.trim()),n=/^[\w-]+\s*:\s*.+$/,r=/tick|step|round|iteration/i,s=t.filter(a=>n.test(a.trim())).length,i=t.some(a=>r.test(a));return s>=3&&s>=t.length*.5||s>=2&&i}function JR(e){const t=e.split(`
|
|
417
|
-
`).filter(s=>s.trim()),n=/^(?:agent|player|entity)\s+\d+\s*:\s*.+$/i,r=t.filter(s=>n.test(s.trim())).length;return r>=2&&r>=t.length*.3}function ZR(e){switch(Dy(e)){case"mirofish":return e5(e);case"netlogo":return t5(e);case"mesa":return n5(e);case"anylogic_csv":return r5(e);case"generic_json":return s5(e);case"freeform_text":return i5(e)}}function e5(e){const t=JSON.parse(e.trim()),n=[],r=[],s=[],i=[],a=[],l=[],c=t.agents||t.fish||t.swarm||[];for(const u of c)n.push({id:u.id||u.name||u.type||`agent_${n.length}`,type:u.type||u.role||"agent",state:u.state||u.status,action:u.reaction||u.action||u.behavior,attributes:Fy(u,["id","name","type","role","state","status","reaction","action","behavior"])}),(u.reaction||u.action)&&r.push({agents:[u.id||u.name||u.type],action:u.reaction||u.action,category:"reaction"});const d=[];if(t.emergent_behaviors)for(const u of Array.isArray(t.emergent_behaviors)?t.emergent_behaviors:[t.emergent_behaviors])d.push(typeof u=="string"?u:JSON.stringify(u));if(t.emergent_dynamics)for(const u of Array.isArray(t.emergent_dynamics)?t.emergent_dynamics:[t.emergent_dynamics])d.push(typeof u=="string"?u:JSON.stringify(u));if(t.timeline&&Array.isArray(t.timeline)){for(const u of t.timeline)if(typeof u=="object"){const{time:f,step:p,round:m,tick:y,...g}=u;a.push({time:f??p??m??y??a.length,state:g})}}if(t.steps&&Array.isArray(t.steps))for(const u of t.steps){const f=u.step??u.round??a.length;if(u.actions&&Array.isArray(u.actions))for(const p of u.actions)r.push({time:f,agents:p.agent?[p.agent]:void 0,action:p.action||p.type||JSON.stringify(p),effect:p.result||p.effect,category:"action"})}for(const[u,f]of Object.entries(t))typeof f=="number"&&!["version","seed","id"].includes(u)&&i.push({name:os(u),value:f});return{sourceFormat:"mirofish",agents:n,events:r,stateChanges:s,coalitions:l,metrics:i,timeline:a,emergentBehaviors:d.length>0?d:void 0,summary:t.summary||t.description}}function t5(e){const t=e.split(`
|
|
418
|
-
`).filter(l=>l.trim()),n=[],r=[],s=[];let i;for(const l of t){const c=l.trim(),d=c.match(/(?:tick|step|round|iteration)\s*[:#=]?\s*(\d+)/i);if(d){i=parseInt(d[1]);continue}const u=c.match(/^([\w-]+)\s*:\s*(.+)$/);if(u){const p=u[1].trim(),m=u[2].trim(),y=parseFloat(m.replace("%",""));if(isNaN(y))s.push({id:p,type:"entity",state:m});else{const g=m.includes("%");n.push({name:os(p),value:g?y/100:y,unit:g?"%":void 0}),r.push({variable:p,to:g?y/100:y,time:i})}continue}const f=c.match(/^([\w-]+)\s+([-\d.]+%?)$/);if(f){const p=parseFloat(f[2].replace("%",""));isNaN(p)||n.push({name:os(f[1]),value:f[2].includes("%")?p/100:p,unit:f[2].includes("%")?"%":void 0})}}const a=/consumer|producer|trader|voter|citizen|firm|bank|government|regulator/i;for(const l of n){const c=l.name.match(a);c&&!s.some(d=>d.type===c[0].toLowerCase())&&s.push({id:c[0].toLowerCase(),type:c[0].toLowerCase(),attributes:{[l.name]:l.value}})}return{sourceFormat:"netlogo",agents:s,events:[],stateChanges:r,coalitions:[],metrics:n,timeline:i!==void 0?[{time:i,state:Object.fromEntries(n.map(l=>[l.name,l.value]))}]:[]}}function n5(e){const t=e.split(`
|
|
419
|
-
`).filter(i=>i.trim()),n=[],r=[],s=new Map;for(const i of t){const a=i.trim(),l=a.match(/^(?:agent|player|entity)\s+(\w+)\s*:\s*(.+)$/i);if(l){const d=l[1],u=l[2].trim();if(s.has(d))s.get(d).action=u;else{const f={id:`agent_${d}`,type:"agent",action:u};s.set(d,f),n.push(f)}r.push({agents:[`agent_${d}`],action:u,category:"action"});continue}const c=a.match(/^([A-Z][\w\s]+?)\s*:\s*(.+)$/);if(c){const d=c[1].trim(),u=c[2].trim();if(!s.has(d)){const f={id:d,type:gl(d),action:u};s.set(d,f),n.push(f)}r.push({agents:[d],action:u,category:"action"})}}return{sourceFormat:"mesa",agents:n,events:r,stateChanges:[],coalitions:[],metrics:[],timeline:[]}}function r5(e){var d;const t=e.split(`
|
|
420
|
-
`).filter(u=>u.trim());if(t.length<2)return o5("anylogic_csv");const n=t[0].split(",").map(u=>u.trim().replace(/^["']|["']$/g,"")),r=[],s=[],i=new Map,a=n.findIndex(u=>/^(time|tick|step|round|t|timestamp|period|year|month|day|date)$/i.test(u));for(let u=1;u<t.length;u++){const f=t[u].split(",").map(y=>y.trim().replace(/^["']|["']$/g,""));if(f.length<n.length)continue;const p=a>=0?isNaN(Number(f[a]))?f[a]:Number(f[a]):u,m={};for(let y=0;y<n.length;y++){if(y===a)continue;const g=f[y],b=Number(g);m[n[y]]=isNaN(b)?g:b,isNaN(b)||(i.has(n[y])||i.set(n[y],[]),i.get(n[y]).push({time:p,value:b}))}r.push({time:p,state:m})}for(const[u,f]of i){const p=f[f.length-1].value,m=f[0].value,y=f.length<2?"stable":p>m*1.05?"rising":p<m*.95?"falling":"stable";s.push({name:os(u),value:p,trend:y,series:f})}const l=[],c=/consumer|producer|trader|voter|citizen|firm|bank|government|regulator|price|supply|demand/i;for(const u of n)if(u.match(c)){const p=(d=r[r.length-1])==null?void 0:d.state;l.push({id:u,type:gl(u),attributes:p?{value:p[u]}:void 0})}return{sourceFormat:"anylogic_csv",agents:l,events:[],stateChanges:[],coalitions:[],metrics:s,timeline:r}}function s5(e){const t=JSON.parse(e.trim()),n=[],r=[],s=[],i=[],a=[],l=[];function c(d,u=""){if(Array.isArray(d)){if(d.length>0&&typeof d[0]=="object"&&d[0]!==null){const f=d[0];if(f.id||f.name||f.agent||f.type){for(const p of d){const m=p;n.push({id:String(m.id||m.name||m.agent||`${u}_${n.length}`),type:String(m.type||m.role||m.class||"agent"),state:m.state?String(m.state):void 0,action:m.action?String(m.action):m.reaction?String(m.reaction):void 0,attributes:Fy(m,["id","name","agent","type","role","class","state","action","reaction"])})}return}if(f.time||f.step||f.tick){for(const p of d){const m=p,y=m.time??m.step??m.tick??a.length,g={};for(const[b,x]of Object.entries(m))["time","step","tick"].includes(b)||(typeof x=="number"||typeof x=="string"||typeof x=="boolean")&&(g[b]=x);a.push({time:y,state:g})}return}if(f.action||f.event){for(const p of d){const m=p;r.push({agents:m.agent?[String(m.agent)]:m.agents?m.agents:void 0,action:String(m.action||m.event||m.type||"unknown"),effect:m.effect?String(m.effect):m.result?String(m.result):void 0,time:m.time??m.step,category:"action"})}return}}}else if(typeof d=="object"&&d!==null)for(const[f,p]of Object.entries(d))typeof p=="number"?s.push({name:os(f),value:p}):typeof p=="object"&&c(p,u?`${u}.${f}`:f)}if(typeof t=="object"&&t!==null){const d=t;if(d.agents&&c(d.agents,"agents"),d.events&&c(d.events,"events"),d.timeline&&c(d.timeline,"timeline"),d.coalitions&&Array.isArray(d.coalitions))for(const u of d.coalitions){const f=u;l.push({name:String(f.name||`coalition_${l.length}`),members:Array.isArray(f.members)?f.members.map(String):[],objective:f.objective?String(f.objective):void 0,strength:typeof f.strength=="number"?f.strength:void 0})}for(const[u,f]of Object.entries(d))["agents","events","timeline","coalitions"].includes(u)||(typeof f=="number"?s.push({name:os(u),value:f}):typeof f=="object"&&f!==null&&c(f,u))}return{sourceFormat:"generic_json",agents:n,events:r,stateChanges:i,coalitions:l,metrics:s,timeline:a,summary:typeof t.summary=="string"?t.summary:void 0}}function i5(e){const t=e.trim(),n=[],r=[],s=[],i=[/(?:agent|player|actor|entity|stakeholder)\s*[:#]?\s*["']?(\w[\w\s]{1,25}?)["']?(?:\n|,|;|\.|$)/gi,/^[-•*]\s*(\w[\w\s]{1,20}?)(?:\s*[-:—])/gm],a=new Set;for(const f of i){let p;for(;(p=f.exec(t))!==null;){const m=p[1].trim();m.length>1&&m.length<25&&!Dh(m)&&!a.has(m.toLowerCase())&&(a.add(m.toLowerCase()),n.push({id:m,type:gl(m)}))}}const l=/(\w[\w\s]{1,20}?)\s*(?::|—)\s*(.+?)(?:\n|$)/g;let c;for(;(c=l.exec(t))!==null;){const f=c[1].trim(),p=c[2].trim();!Dh(f)&&p.length>2&&(r.push({agents:[f],action:p,category:"action"}),a.has(f.toLowerCase())||(a.add(f.toLowerCase()),n.push({id:f,type:gl(f),action:p})))}const d=/(\w[\w\s]{1,30}?)\s*(?:=|:)\s*([-\d.]+%?)/g;let u;for(;(u=d.exec(t))!==null;){const f=u[1].trim(),p=u[2],m=parseFloat(p.replace("%",""));!isNaN(m)&&f.length>1&&s.push({name:os(f),value:p.includes("%")?m/100:m,unit:p.includes("%")?"%":void 0})}return{sourceFormat:"freeform_text",agents:n,events:r,stateChanges:[],coalitions:[],metrics:s,timeline:[],summary:t.length>200?t.slice(0,200)+"...":t}}function o5(e){return{sourceFormat:e,agents:[],events:[],stateChanges:[],coalitions:[],metrics:[],timeline:[]}}function os(e){return e.replace(/[-_]/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function gl(e){const t=e.toLowerCase();return/consumer|buyer|customer|shopper/.test(t)?"consumer":/producer|supplier|manufacturer|seller/.test(t)?"producer":/government|regulator|fed|agency|authority/.test(t)?"regulator":/firm|company|corp|bank|enterprise/.test(t)?"firm":/trader|investor|speculator|market/.test(t)?"trader":/citizen|voter|public|population/.test(t)?"citizen":/politician|senator|president|leader/.test(t)?"politician":/media|press|journalist/.test(t)?"media":/military|army|defense|navy/.test(t)?"military":"agent"}function Dh(e){return new Set(["the","and","for","with","from","that","this","then","but","not","are","was","were","has","have","had","will","would","could","should","may","might","step","round","tick","time","result","output","data"]).has(e.toLowerCase())}function Fy(e,t){const n={};let r=0;for(const[s,i]of Object.entries(e))t.includes(s)||(typeof i=="string"||typeof i=="number"||typeof i=="boolean")&&(n[s]=i,r++);return r>0?n:void 0}const zy={mirofish:"MiroFish",netlogo:"NetLogo",mesa:"Mesa (Python)",anylogic_csv:"AnyLogic / CSV",generic_json:"JSON",freeform_text:"Text"};function a5(e){if(e.agents.length>0)return e.agents.slice(0,8).map(n=>n.id);const t=new Set;for(const n of e.events)if(n.agents)for(const r of n.agents)t.add(r);if(t.size>0)return Array.from(t).slice(0,8);for(const n of e.metrics){const r=n.name.toLowerCase();/consumer|producer|trader|government|firm|citizen/.test(r)&&t.add(n.name)}return t.size>0?Array.from(t).slice(0,8):["Alpha Agent","Beta Agent","Gamma Agent","Delta Agent","Epsilon Agent"]}function l5(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}function c5(e){let t=e;return()=>(t=(t*16807+0)%2147483647,t/2147483647)}function d5(e){const t=ZR(e),n=t.sourceFormat,r=a5(t),s=l5(e),i=c5(s),a=t.emergentBehaviors&&t.emergentBehaviors.length>0?t.emergentBehaviors.map((b,x)=>({name:b.length>40?b.slice(0,40)+"...":b,description:b,strength:["strong","moderate","weak"][Math.min(x,2)],agents:r.filter(()=>i()>.4)})):u5(r,i),l=t.agents.length>0?t.agents.slice(0,8).map(b=>({agent:b.id,strategy:b.action||b.state||"Adaptive",rationale:b.action?`Agent exhibits "${b.action}" behavior based on simulation data`:"Strategy inferred from simulation context",effectiveness:Math.round(40+i()*55)})):f5(r,i),c=t.coalitions.length>0?t.coalitions.map(b=>({name:b.name,members:b.members,sharedObjective:b.objective||"Coordinated strategy",cohesion:b.strength??Math.round(50+i()*45)})):m5(r,i),d=p5(r,i),u=h5(r,i),f=g5(r,i),p=v5(r,f,i),m=x5(i),y=y5(r,i),g=b5(r,f);return{patterns:a,agentStrategies:l,coalitions:c,powerDynamics:d,equilibrium:u,paths:f,matrix:p,outcomes:m,challenges:y,recommendations:g,detectedFormat:n,formatLabel:zy[n],normalized:t}}function u5(e,t){const n=[{name:"Convergent Herding",description:"Multiple agents independently converge on similar strategies, creating a dominant behavioral cluster."},{name:"Oscillatory Competition",description:"Agents cycle between cooperative and competitive strategies in a predictable pattern."},{name:"Resource Clustering",description:"Agents concentrate around high-value nodes, creating territorial dynamics."},{name:"Cascade Adoption",description:"Strategy adoption follows a cascade pattern — once critical mass is reached, remaining agents switch rapidly."},{name:"Minority Exploitation",description:"A small group of agents consistently outperforms by exploiting the majority strategy."},{name:"Symmetry Breaking",description:"Initially symmetric agents differentiate into specialized roles over time."},{name:"Delayed Retaliation",description:"Agents employ tit-for-tat with delay, creating cycles of cooperation and defection."}],r=3+Math.floor(t()*3),s=["strong","moderate","weak"];return n.slice(0,r).map(i=>({...i,strength:s[Math.floor(t()*3)],agents:e.filter(()=>t()>.4)}))}function f5(e,t){const n=[{strategy:"Tit-for-Tat",rationale:"Mirrors opponent behavior to incentivize cooperation while punishing defection."},{strategy:"Always Cooperate",rationale:"Maximizes collective welfare at the cost of individual exploitation risk."},{strategy:"Pavlov (Win-Stay, Lose-Shift)",rationale:"Repeats successful strategies and switches after failures — simple but adaptive."},{strategy:"Grim Trigger",rationale:"Cooperates until defected against, then permanently defects — extreme deterrence."},{strategy:"Random Walk",rationale:"Unpredictable strategy prevents exploitation but sacrifices optimization."},{strategy:"Generous Tit-for-Tat",rationale:"Occasionally forgives defection to escape mutual punishment cycles."},{strategy:"Exploitative Defection",rationale:"Systematically defects to extract maximum individual payoff from cooperators."},{strategy:"Adaptive Threshold",rationale:"Adjusts cooperation threshold based on environment — cooperates in friendly environments, defects in hostile ones."}];return e.map(r=>{const s=Math.floor(t()*n.length);return{agent:r,strategy:n[s].strategy,rationale:n[s].rationale,effectiveness:Math.round(40+t()*55)}})}function m5(e,t){if(e.length<3)return[];const n=[],r=["Resource maximization through coordinated strategy","Collective defense against exploitative agents","Market dominance through price coordination","Information sharing for competitive advantage"],s=[...e].sort(()=>t()-.5),i=Math.floor(s.length/2);return n.push({name:"Primary Coalition",members:s.slice(0,i+1),sharedObjective:r[Math.floor(t()*r.length)],cohesion:Math.round(50+t()*45)}),e.length>4&&n.push({name:"Counter-Coalition",members:s.slice(i+1),sharedObjective:r[Math.floor(t()*r.length)],cohesion:Math.round(30+t()*50)}),n}function p5(e,t){const n=["driver","reactor","stabilizer","disruptor"],r={driver:["Sets the strategic direction; other agents respond to this agent's moves.","Primary initiator of action; shapes the competitive landscape."],reactor:["Responds to others' strategies rather than initiating; adaptive but not proactive.","Follows dominant trends; optimizes within established dynamics."],stabilizer:["Acts as a moderating force; dampens oscillations and promotes equilibrium.","Consistently chooses cooperative strategies; anchors the system."],disruptor:["Introduces unpredictability; breaks established patterns and forces adaptation.","High-variance strategy creates opportunities and threats for all agents."]};return e.map(s=>{const i=n[Math.floor(t()*n.length)],a=r[i];return{agent:s,role:i,influence:Math.round(20+t()*75),description:a[Math.floor(t()*a.length)]}})}function h5(e,t){const n=[{type:"Nash Equilibrium",description:"The system has reached a state where no agent can unilaterally improve their outcome by changing strategy. This equilibrium is self-enforcing but may not be globally optimal."},{type:"Pareto Suboptimal Equilibrium",description:"Agents are locked in a stable but collectively suboptimal state. A coordinated deviation could improve all agents' outcomes, but individual incentives prevent it."},{type:"Cyclical Dynamics",description:"No stable equilibrium detected. The system oscillates between states as agents continuously adapt to each other's strategies."},{type:"Mixed Strategy Equilibrium",description:"Agents randomize between strategies with specific probabilities. The equilibrium is maintained through uncertainty rather than fixed strategies."}],r=n[Math.floor(t()*n.length)],s=t()>.4;return{isStable:s,type:r.type,description:r.description,stabilityScore:Math.round(s?55+t()*40:15+t()*35),vulnerabilities:["External shock could push agents to reassess strategies",e.length>3?`Coalition between ${e[0]} and ${e[1]} could destabilize current equilibrium`:"Small agent count increases sensitivity to individual strategy changes","Information asymmetry may be masking true strategic preferences"].slice(0,2+Math.floor(t()*2))}}function g5(e,t){const n=[{name:"Coalition Reinforcement",description:"Strengthen the dominant coalition by aligning incentives and reducing defection risk among members."},{name:"Disruptor Containment",description:"Isolate disruptive agents through coordinated exclusion or counter-strategies."},{name:"Equilibrium Shift",description:"Introduce strategic perturbation to move the system toward a more favorable equilibrium state."},{name:"Cooperation Incentive Design",description:"Restructure payoff matrices to make cooperation individually rational, not just collectively optimal."},{name:"Adaptive Monitoring",description:"Implement continuous strategy monitoring and adjust response in real-time based on agent behavior changes."}];let r=0;const s=n.map((i,a)=>{const l=Math.round(15+t()*30);return r+=l,{...i,probability:l,riskLevel:t()>.6?"high":t()>.3?"medium":"low",tradeoffs:[`May alienate ${e[Math.floor(t()*e.length)]}`,"Requires sustained coordination to maintain effectiveness","Outcome depends on accurate agent behavior modeling"].slice(0,2+Math.floor(t()*2)),recommended:a===0}});return s.forEach(i=>{i.probability=Math.round(i.probability/r*100)}),s}function v5(e,t,n){const r=t.slice(0,3).map(i=>i.name),s=e.map(()=>r.map(()=>{const i=n();return i>.55?"positive":i>.25?"neutral":"negative"}));return{strategies:r,stakeholders:e,reactions:s}}function x5(e){return[{label:"Best Case",type:"best",conditions:"All agents converge on cooperative equilibrium",description:"System achieves globally optimal state; all agents benefit from sustained cooperation.",likelihood:Math.round(10+e()*15),impactRating:Math.round(2+e()*2)},{label:"Most Likely",type:"likely",conditions:"Partial cooperation with persistent free-riding",description:"Dominant coalition maintains advantage while fringe agents exploit cooperative norms.",likelihood:Math.round(35+e()*20),impactRating:Math.round(4+e()*2)},{label:"Worst Case",type:"worst",conditions:"Coalition fracture and competitive spiral",description:"Trust breakdown triggers mutual defection; system degrades to non-cooperative equilibrium.",likelihood:Math.round(10+e()*15),impactRating:Math.round(7+e()*2)},{label:"Tail Risk",type:"tail",conditions:"Emergent adversarial strategy defeats all known counters",description:"Novel agent strategy exploits systemic vulnerability; cascading failures across the agent network.",likelihood:Math.round(2+e()*8),impactRating:Math.round(9+e())}]}function y5(e,t){return[{assumption:"Agents behave rationally",whyItMightFail:"Bounded rationality, information delays, and emergent complexity produce behaviors that deviate from game-theoretic optimality.",whatChanges:"Predictive models may fail; heuristic-based analysis becomes necessary.",severity:"high"},{assumption:"Agent strategies are observable",whyItMightFail:"Agents may employ deceptive signaling, masking true strategies behind observable actions.",whatChanges:"Strategy inference requires deeper behavioral analysis; surface patterns may mislead.",severity:"medium"},{assumption:"The environment is stationary",whyItMightFail:"Payoff structures and constraints may shift during the simulation, invalidating equilibrium analysis.",whatChanges:"Continuous recalibration needed; static equilibrium analysis insufficient.",severity:"high"},{assumption:`${e[0]} will maintain current strategy`,whyItMightFail:"Agents adapt over time; current strategy may be transitional rather than stable.",whatChanges:"Must model strategy evolution, not just current state.",severity:"medium"},{assumption:"Coalition structures are stable",whyItMightFail:"Internal incentive misalignment may cause coalition fracture under pressure.",whatChanges:"Coalition durability should be stress-tested; contingency plans for fracture needed.",severity:"critical"}].slice(0,3+Math.floor(t()*3))}function b5(e,t,n){const r=t.find(s=>s.recommended)||t[0];return[{priority:1,action:`Implement ${r.name}`,rationale:`Highest-probability intervention (${r.probability}%) for steering swarm behavior.`,timeframe:"Immediate"},{priority:2,action:"Monitor coalition stability metrics",rationale:"Early detection of coalition fracture enables preemptive intervention.",timeframe:"Continuous"},{priority:3,action:`Address ${e[e.length-1]} behavior pattern`,rationale:"Outlier agent behavior may indicate either exploitation or innovation; requires assessment.",timeframe:"Within next cycle"},{priority:4,action:"Run sensitivity analysis on payoff structure",rationale:"Small payoff changes may trigger large behavioral shifts; identify critical thresholds.",timeframe:"Before next iteration"}]}const Fh="mirotir_theme";function hm(){const[e,t]=h.useState(()=>typeof window<"u"&&localStorage.getItem(Fh)||"dark");h.useEffect(()=>{const r=document.documentElement;e==="light"?r.classList.add("light"):r.classList.remove("light"),localStorage.setItem(Fh,e)},[e]);const n=h.useCallback(()=>{t(r=>r==="dark"?"light":"dark")},[]);return{theme:e,toggle:n}}const w5="/assets/mirotir-logo-DUexumBH.svg",S5=Gl("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),re=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const a=r?_j:"button";return o.jsx(a,{className:$(S5({variant:t,size:n,className:e})),ref:i,...s})});re.displayName="Button";const N5=({showSimulatedFuture:e,theme:t,onToggleTheme:n,isSimulating:r})=>o.jsx("header",{className:"fixed top-0 left-0 right-0 z-50 border-b border-border bg-background/80 backdrop-blur-md",children:o.jsxs("div",{className:"container mx-auto flex items-center justify-between px-6 py-3",children:[o.jsx("div",{className:"flex items-center gap-3",children:o.jsx("img",{src:w5,alt:"Mirotir",className:"h-14 w-auto"})}),o.jsxs("div",{className:"flex items-center gap-4",children:[(r||e)&&o.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-emerald-500/30 bg-emerald-500/10 px-3 py-1.5",children:[o.jsx(xu,{className:"h-3 w-3 text-emerald-400 animate-pulse"}),o.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.15em] text-emerald-400",children:"Governed MiroFish Simulation"})]}),o.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-violet-500/30 bg-violet-500/10 px-3 py-1.5",children:[o.jsx(xu,{className:"h-3 w-3 text-violet-400 animate-pulse"}),o.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.15em] text-violet-400",children:"Governed by NeuroVerse"})]})]}),n&&o.jsx(re,{variant:"ghost",size:"icon",onClick:n,className:"h-9 w-9 rounded-full","aria-label":`Switch to ${t==="dark"?"light":"dark"} mode`,children:t==="dark"?o.jsx(MC,{className:"h-4 w-4 text-muted-foreground hover:text-foreground transition-colors"}):o.jsx(TC,{className:"h-4 w-4 text-muted-foreground hover:text-foreground transition-colors"})}),o.jsx("div",{className:"hidden text-right md:block",children:e?o.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary animate-pulse",children:"SIMULATED FUTURE"}):o.jsx("p",{className:"text-xs text-muted-foreground tracking-wider",children:"Explore decisions before reality does"})})]})]})}),k5=({governance:e})=>{const t=e==null?void 0:e.neuroverse;return o.jsx("footer",{className:"border-t border-border py-8",children:o.jsxs("div",{className:"container mx-auto px-6",children:[e&&o.jsxs("div",{className:"mx-auto mb-6 max-w-3xl space-y-3",children:[o.jsx("div",{className:"rounded-lg border border-border bg-card/50 px-5 py-3",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(qi,{className:"h-4 w-4 text-primary"}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[o.jsxs("span",{children:["Authority: ",o.jsx("span",{className:"text-foreground font-medium",children:e.authorityLevel.replace(/_/g," ")})]}),o.jsxs("span",{children:[e.constitutionalChecks.length," rules checked"]}),o.jsxs("span",{children:["Trace: ",o.jsx("span",{className:"font-mono",children:e.traceId.slice(0,12)})]})]})]})}),t&&o.jsx("div",{className:"rounded-lg border border-border bg-card/50 px-5 py-3",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Pr,{className:"h-4 w-4 text-primary"}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[o.jsxs("span",{children:["Governance: ",o.jsx("span",{className:`font-medium ${t.guardStatus==="ALLOW"?"text-emerald-400":t.guardStatus==="BLOCK"?"text-red-400":"text-yellow-400"}`,children:t.guardStatus})]}),t.worldViability&&o.jsxs("span",{children:["Status: ",o.jsx("span",{className:"text-foreground font-medium",children:t.worldViability})]}),t.rulesFired!==void 0&&o.jsxs("span",{children:[t.rulesFired," rules applied"]}),t.collapseRisk&&t.collapseRisk!=="none"&&o.jsxs("span",{children:["System risk: ",o.jsx("span",{className:`font-medium ${t.collapseRisk==="high"?"text-red-400":t.collapseRisk==="moderate"?"text-yellow-400":"text-emerald-400"}`,children:t.collapseRisk})]}),t.worldHealthScore!==void 0&&o.jsxs("span",{children:["Stability: ",t.worldHealthScore,"%"]})]})]})})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"mb-2 text-sm text-muted-foreground",children:"Powered by a governed multi-agent simulation engine"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"We simulate, enforce rules, and analyze results."})]})]})})},j5={dark:{swarm:"#1B5E7B",reasoning:"#5BC0BE",future:"#ffffff"},light:{swarm:"#134A5E",reasoning:"#2D8B88",future:"#0F3A4A"}},zh=40,Bh=7,Vh=3;function nd(e,t,n,r,s){if(n==="reasoning")return{x:e/(s+1)*(r+1),y:t*.5+(Math.random()-.5)*8,vx:.3+Math.random()*.2,vy:(Math.random()-.5)*.1,size:10+Math.random()*3,type:n,opacity:.9};if(n==="future")return{x:e*.75+r*30,y:t*.5+(r-1)*25,vx:.4+Math.random()*.3,vy:(r-1)*.15,size:7+Math.random()*2,type:n,opacity:.7};const i=Math.random()*Math.PI*2,a=40+Math.random()*100;return{x:e*.45+Math.cos(i)*a,y:t*.5+Math.sin(i)*a*.7,vx:(Math.random()-.5)*.5,vy:(Math.random()-.5)*.3,size:6+Math.random()*5,type:n,opacity:.5+Math.random()*.3}}function C5(e,t,n){const{x:r,y:s,size:i,vx:a,vy:l,opacity:c}=t,d=Math.atan2(l,a);e.save(),e.translate(r,s),e.rotate(d),e.globalAlpha=c,e.beginPath(),e.ellipse(0,0,i,i*.6,0,0,Math.PI*2),e.fillStyle=n,e.fill(),e.beginPath(),e.moveTo(-i*.7,-i*.45),e.lineTo(-i*1.4,0),e.lineTo(-i*.7,i*.45),e.closePath(),e.fill(),t.type!=="swarm"&&(e.beginPath(),e.arc(i*.3,-i*.15,i*.12,0,Math.PI*2),e.fillStyle="white",e.fill()),e.restore()}const E5=()=>{const{theme:e}=hm(),t=h.useRef(null),n=h.useRef([]),r=h.useRef(0),[s]=h.useState({width:400,height:320}),i=j5[e];return h.useEffect(()=>{const{width:a,height:l}=s,c=[];for(let p=0;p<zh;p++)c.push(nd(a,l,"swarm",p,zh));for(let p=0;p<Bh;p++)c.push(nd(a,l,"reasoning",p,Bh));for(let p=0;p<Vh;p++)c.push(nd(a,l,"future",p,Vh));n.current=c;const d=a*.45,u=l*.5;function f(){const p=t.current;if(!p)return;const m=p.getContext("2d");if(m){m.clearRect(0,0,a,l);for(const y of n.current){if(y.type==="swarm"){const b=d-y.x,x=u-y.y,v=Math.sqrt(b*b+x*x),w=60+Math.sin(Date.now()*.001+y.x)*30;y.vx+=b*3e-4,y.vy+=x*3e-4,y.vx+=-x*2e-4,y.vy+=b*2e-4,v<w&&(y.vx-=b*5e-4,y.vy-=x*5e-4),y.vx+=(Math.random()-.5)*.02,y.vy+=(Math.random()-.5)*.02,y.vx*=.99,y.vy*=.99}y.type==="reasoning"&&(y.vy+=(u-y.y)*.01,y.vy*=.95,y.vx=Math.max(.2,y.vx),y.x>a+20&&(y.x=-20)),y.type==="future"&&(y.vx=Math.max(.3,y.vx),y.x>a+20&&(y.x=a*.7,y.y=u+(Math.random()-.5)*50)),y.x+=y.vx,y.y+=y.vy,y.type==="swarm"&&(y.x<10&&(y.vx+=.1),y.x>a-10&&(y.vx-=.1),y.y<10&&(y.vy+=.1),y.y>l-10&&(y.vy-=.1));const g=y.type==="reasoning"?i.reasoning:y.type==="future"?i.future:i.swarm;C5(m,y,g)}r.current=requestAnimationFrame(f)}}return f(),()=>cancelAnimationFrame(r.current)},[s]),o.jsxs("div",{className:"relative",children:[o.jsx("canvas",{ref:t,width:s.width,height:s.height,className:"rounded-xl",style:{maxWidth:"100%",height:"auto"}}),o.jsx("div",{className:"absolute bottom-3 right-3",children:o.jsx("span",{className:"rounded bg-background/60 px-2 py-1 text-[10px] font-mono text-muted-foreground backdrop-blur",children:"LIVE SWARM"})})]})},_5=({onRunScenario:e,onPasteSimulation:t})=>o.jsx("section",{className:"relative overflow-hidden py-20 md:py-32",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"grid items-center gap-12 md:grid-cols-2",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"mb-4 text-4xl font-bold tracking-tight text-foreground md:text-6xl lg:text-7xl",children:["Change the rules.",o.jsx("br",{}),o.jsx("span",{className:"text-primary",children:"See why the system changed."})]}),o.jsx("p",{className:"mb-8 max-w-lg text-lg text-muted-foreground md:text-xl",children:"NV-SIM doesn't predict outcomes — it shows how they change when you change the rules."}),o.jsxs("div",{className:"flex flex-wrap gap-4",children:[o.jsxs(re,{size:"lg",className:"px-8 py-6 text-base font-semibold tracking-wider",onClick:e,children:[o.jsx(Io,{className:"mr-2 h-4 w-4"}),"START SIMULATION"]}),o.jsxs(re,{size:"lg",variant:"outline",className:"px-8 py-6 text-base font-semibold tracking-wider",onClick:t,children:[o.jsx(rs,{className:"mr-2 h-4 w-4"}),"LOAD DATA"]})]}),o.jsx("p",{className:"mt-8 text-sm font-medium tracking-wider text-muted-foreground",children:"We don't show you what every agent did. We show you what the system became."})]}),o.jsx("div",{className:"flex items-center justify-center",children:o.jsx(E5,{})})]})})}),jt=h.forwardRef(({className:e,type:t,...n},r)=>o.jsx("input",{type:t,className:$("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));jt.displayName="Input";const Te=h.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:$("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Te.displayName="Card";const Xe=h.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:$("flex flex-col space-y-1.5 p-6",e),...t}));Xe.displayName="CardHeader";const Je=h.forwardRef(({className:e,...t},n)=>o.jsx("h3",{ref:n,className:$("text-2xl font-semibold leading-none tracking-tight",e),...t}));Je.displayName="CardTitle";const R5=h.forwardRef(({className:e,...t},n)=>o.jsx("p",{ref:n,className:$("text-sm text-muted-foreground",e),...t}));R5.displayName="CardDescription";const Ae=h.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:$("p-6 pt-0",e),...t}));Ae.displayName="CardContent";const P5=h.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:$("flex items-center p-6 pt-0",e),...t}));P5.displayName="CardFooter";const T5=Gl("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Re({className:e,variant:t,...n}){return o.jsx("div",{className:$(T5({variant:t}),e),...n})}const A5=[{name:"Incremental Path",probability:65,risk:"low",summary:"Gradual domestic production increases paired with strategic reserve releases to stabilize prices over 4–6 months.",drivers:["Strategic petroleum reserve draw-down","Expedited drilling permits","Refinery utilization optimization"],timeline:[{period:"Month 1",action:"Release 30M barrels from SPR",effect:"Prices stabilize at $4.50"},{period:"Month 2-3",action:"Fast-track 200 drilling permits",effect:"Domestic supply signal calms futures market"},{period:"Month 4-6",action:"Refinery optimization + import diversification",effect:"Prices reach $3.20 target zone"}]},{name:"Coalition Path",probability:60,risk:"medium",summary:"Build OPEC+ negotiation coalition with consumer nations to pressure production quota increases.",drivers:["Diplomatic pressure on Saudi Arabia","IEA coordinated release","Consumer nation solidarity bloc"],timeline:[{period:"Month 1",action:"Convene IEA emergency session",effect:"Coordinated 60M barrel release announced"},{period:"Month 2-3",action:"Coalition negotiation with OPEC+",effect:"Production quota increase of 500K bpd"},{period:"Month 4-6",action:"Market stabilization + long-term supply agreements",effect:"Prices settle at $2.90"}]},{name:"Direct Intervention",probability:55,risk:"high",summary:"Executive action to cap prices, mandate refinery output, and impose export restrictions.",drivers:["Emergency price controls","Defense Production Act invocation","Export ban on refined products"],timeline:[{period:"Month 1",action:"Emergency executive order on price caps",effect:"Immediate price relief but market uncertainty"},{period:"Month 2-3",action:"DPA mandates on refinery output",effect:"Supply increases but industry friction grows"},{period:"Month 4-6",action:"Gradual deregulation as supply normalizes",effect:"Prices at $2.80 but market distortions persist"}]}],I5=({onFullAnalysis:e})=>{const[t,n]=h.useState("Gas prices spike to $5/gallon"),[r,s]=h.useState("Stabilize prices under $3 within 6 months"),[i,a]=h.useState(!1),[l,c]=h.useState(null),[d,u]=h.useState(null),f=h.useCallback(()=>{a(!0),c(null),u(null)},[]),p={low:"bg-emerald-500/20 text-emerald-400",medium:"bg-yellow-500/20 text-yellow-400",high:"bg-red-500/20 text-red-400"};return o.jsx("section",{className:"border-t border-border py-16 md:py-24",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-3xl",children:[o.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"TRY IT NOW"}),o.jsx("p",{className:"mb-8 text-center text-muted-foreground",children:"Describe a situation and desired outcome. See what strategies emerge."}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1.5 block text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Current Situation"}),o.jsx(jt,{value:t,onChange:m=>n(m.target.value),className:"text-sm",placeholder:"What's happening?"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1.5 block text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Desired Outcome"}),o.jsx(jt,{value:r,onChange:m=>s(m.target.value),className:"text-sm",placeholder:"Where do you want to end up?"})]}),o.jsxs("div",{className:"flex gap-3 pt-2",children:[o.jsx(re,{className:"px-8 py-5 text-sm font-semibold tracking-wider",onClick:f,children:"FIND SOLUTIONS"}),i&&e&&o.jsxs(re,{variant:"outline",className:"px-6 py-5 text-sm font-semibold tracking-wider",onClick:()=>e(t,r),children:["FULL REPORT ",o.jsx(wC,{className:"ml-1.5 h-4 w-4"})]})]})]}),i&&o.jsx("div",{className:"mt-10 space-y-4 animate-in fade-in-0 slide-in-from-bottom-4 duration-500",children:A5.map((m,y)=>o.jsxs(Te,{className:"border-border overflow-hidden",children:[o.jsx(Xe,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Je,{className:"text-base",children:m.name}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(Re,{className:$("text-xs font-mono",p[m.risk]),children:[m.risk," risk"]}),o.jsxs("span",{className:"text-lg font-bold text-primary",children:[m.probability,"%"]})]})]})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:m.summary}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs(re,{size:"sm",variant:"ghost",className:"text-xs",onClick:()=>c(l===y?null:y),children:[o.jsx(gt,{className:$("mr-1 h-3 w-3 transition-transform",l===y&&"rotate-180")}),"SHOW WHY"]}),o.jsxs(re,{size:"sm",variant:"ghost",className:"text-xs",onClick:()=>u(d===y?null:y),children:[o.jsx(Gf,{className:"mr-1 h-3 w-3"}),"TIMELINE"]}),o.jsxs(re,{size:"sm",variant:"ghost",className:"text-xs",children:[o.jsx(Ao,{className:"mr-1 h-3 w-3"}),"MODIFY"]})]}),l===y&&o.jsxs("div",{className:"mt-4 rounded-md border border-border bg-muted/30 p-4 animate-in fade-in-0 slide-in-from-top-2",children:[o.jsx("h4",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Key Drivers"}),o.jsx("ul",{className:"space-y-1.5",children:m.drivers.map((g,b)=>o.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[o.jsx("span",{className:"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),g]},b))})]}),d===y&&o.jsx("div",{className:"mt-4 animate-in fade-in-0 slide-in-from-top-2",children:o.jsx("div",{className:"relative ml-3 border-l-2 border-primary/30 pl-6 space-y-4",children:m.timeline.map((g,b)=>o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute -left-[31px] top-1 h-3 w-3 rounded-full border-2 border-primary bg-background"}),o.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:g.period}),o.jsx("div",{className:"text-sm text-foreground",children:g.action}),o.jsx("div",{className:"text-xs text-muted-foreground",children:g.effect})]},b))})})]})]},y))})]})})})},rc=h.forwardRef(({className:e,...t},n)=>o.jsx("textarea",{className:$("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));rc.displayName="Textarea";const M5=({onExplain:e,isLoading:t})=>{const[n,r]=h.useState(""),s=h.useMemo(()=>{if(!n.trim()||n.trim().length<10)return null;try{const i=Dy(n);return{format:i,label:zy[i]}}catch{return null}},[n]);return o.jsx("section",{className:"py-16 md:py-24",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[o.jsx("h2",{className:"mb-2 text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"ANALYZE RESULTS"}),o.jsx("h3",{className:"mb-3 text-3xl font-bold tracking-tight text-foreground md:text-4xl",children:"Upload Simulation Data"}),o.jsxs("p",{className:"mb-8 text-muted-foreground",children:["Paste results from any simulation tool — we auto-detect the format.",o.jsx("br",{}),o.jsx("span",{className:"text-xs",children:"JSON, CSV, key-value, or plain text supported."})]}),o.jsxs("div",{className:"relative rounded-lg border border-border bg-card p-1",children:[o.jsx(rc,{placeholder:`Paste simulation results here...
|
|
421
|
-
|
|
422
|
-
Supported formats:
|
|
423
|
-
• JSON (agents, behaviors, metrics)
|
|
424
|
-
• CSV (time series, variable columns)
|
|
425
|
-
• Key-value logs (step: value)
|
|
426
|
-
• Plain text descriptions`,className:"min-h-[200px] resize-none border-0 bg-transparent font-mono text-sm text-foreground placeholder:text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",value:n,onChange:i=>r(i.target.value)}),s&&o.jsx("div",{className:"absolute bottom-3 right-3",children:o.jsxs(Re,{variant:"outline",className:"text-[10px] uppercase tracking-wider",children:["Detected: ",s.label]})})]}),o.jsx(re,{className:"mt-6 px-10 py-6 text-base font-semibold tracking-wider",onClick:()=>e(n),disabled:!n.trim()||t,children:t?"ANALYZING...":"ANALYZE"})]})})})};var gm="Progress",vm=100,[O5,n4]=zt(gm),[L5,$5]=O5(gm),By=h.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=D5,...a}=e;(s||s===0)&&!Uh(s)&&console.error(F5(`${s}`,"Progress"));const l=Uh(s)?s:vm;r!==null&&!Wh(r,l)&&console.error(z5(`${r}`,"Progress"));const c=Wh(r,l)?r:null,d=vl(c)?i(c,l):void 0;return o.jsx(L5,{scope:n,value:c,max:l,children:o.jsx(Q.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":vl(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":Wy(c,l),"data-value":c??void 0,"data-max":l,...a,ref:t})})});By.displayName=gm;var Vy="ProgressIndicator",Uy=h.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=$5(Vy,n);return o.jsx(Q.div,{"data-state":Wy(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});Uy.displayName=Vy;function D5(e,t){return`${Math.round(e/t*100)}%`}function Wy(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function vl(e){return typeof e=="number"}function Uh(e){return vl(e)&&!isNaN(e)&&e>0}function Wh(e,t){return vl(e)&&!isNaN(e)&&e<=t&&e>=0}function F5(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${vm}\`.`}function z5(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
427
|
-
- a positive number
|
|
428
|
-
- less than the value passed to \`max\` (or ${vm} if no \`max\` prop is set)
|
|
429
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
430
|
-
|
|
431
|
-
Defaulting to \`null\`.`}var Hy=By,B5=Uy;const Li=h.forwardRef(({className:e,value:t,...n},r)=>o.jsx(Hy,{ref:r,className:$("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:o.jsx(B5,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Li.displayName=Hy.displayName;const V5={strong:"bg-primary text-primary-foreground",moderate:"bg-secondary text-secondary-foreground",weak:"bg-muted text-muted-foreground"},U5={driver:"bg-primary text-primary-foreground",reactor:"bg-secondary text-secondary-foreground",stabilizer:"bg-accent text-accent-foreground",disruptor:"bg-destructive text-destructive-foreground"},W5=({result:e})=>o.jsxs("section",{className:"space-y-12 py-12",children:[o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Emergent Patterns"}),o.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.patterns.map((t,n)=>o.jsxs(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:[o.jsx(Xe,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Je,{className:"text-base",children:t.name}),o.jsx(Re,{className:V5[t.strength],children:t.strength})]})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:t.description}),o.jsx("div",{className:"flex flex-wrap gap-1",children:t.agents.map((r,s)=>o.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:r},s))})]})]},n))})]}),o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Dominant Strategies per Agent"}),o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.agentStrategies.map((t,n)=>o.jsx(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*80}ms`},children:o.jsxs(Ae,{className:"pt-6",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("span",{className:"font-semibold text-foreground",children:t.agent}),o.jsxs("span",{className:"text-sm text-primary",children:[t.effectiveness,"% effective"]})]}),o.jsx("p",{className:"mb-1 text-sm font-medium text-foreground",children:t.strategy}),o.jsx("p",{className:"text-xs text-muted-foreground",children:t.rationale}),o.jsx(Li,{value:t.effectiveness,className:"mt-3 h-1.5"})]})},n))})]}),o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Coalition Detection"}),o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.coalitions.map((t,n)=>o.jsxs(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:t.name})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:t.sharedObjective}),o.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:t.members.map((r,s)=>o.jsx(Re,{variant:"outline",className:"text-xs",children:r},s))}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Cohesion"}),o.jsx(Li,{value:t.cohesion,className:"h-1.5 flex-1"}),o.jsxs("span",{className:"text-xs text-primary",children:[t.cohesion,"%"]})]})]})]},n))})]}),o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Power Dynamics"}),o.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.powerDynamics.map((t,n)=>o.jsx(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*80}ms`},children:o.jsxs(Ae,{className:"pt-6",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("span",{className:"font-semibold text-foreground",children:t.agent}),o.jsx(Re,{className:U5[t.role],children:t.role})]}),o.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:t.description}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Influence"}),o.jsx(Li,{value:t.influence,className:"h-1.5 flex-1"}),o.jsxs("span",{className:"text-xs text-primary",children:[t.influence,"%"]})]})]})},n))})]}),o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Equilibrium Analysis"}),o.jsx(Te,{className:"border-border",children:o.jsxs(Ae,{className:"pt-6",children:[o.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[o.jsx(Re,{className:e.equilibrium.isStable?"bg-primary text-primary-foreground":"bg-destructive text-destructive-foreground",children:e.equilibrium.isStable?"Stable":"Unstable"}),o.jsx("span",{className:"text-lg font-semibold text-foreground",children:e.equilibrium.type})]}),o.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:e.equilibrium.description}),o.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:"Stability Score"}),o.jsx(Li,{value:e.equilibrium.stabilityScore,className:"h-2 flex-1"}),o.jsxs("span",{className:"text-sm font-medium text-primary",children:[e.equilibrium.stabilityScore,"%"]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"mb-2 text-sm font-medium text-foreground",children:"Vulnerabilities:"}),o.jsx("ul",{className:"space-y-1",children:e.equilibrium.vulnerabilities.map((t,n)=>o.jsxs("li",{className:"flex items-start gap-2 text-sm text-muted-foreground",children:[o.jsx("span",{className:"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-destructive"}),t]},n))})]})]})})]})]}),Hh=[{label:"Choose Scenario",description:"Pick a preset or describe your own situation",color:"text-muted-foreground"},{label:"Set Rules",description:"Define constraints, limits, and governance rules",color:"text-muted-foreground"},{label:"Run Simulation",description:"Multi-agent simulation with rules applied in real time",color:"text-primary"},{label:"See What Changed",description:"Watch rules block, pause, and reshape agent behavior",color:"text-primary"},{label:"Generate Report",description:"Governed analysis with metrics and counterfactuals",color:"text-primary"}],H5=[{word:"Simulate",description:"Run multi-agent scenarios with real dynamics"},{word:"Govern",description:"Apply rules that reshape outcomes in real time"},{word:"Understand",description:"See exactly what changed and why"}],G5=()=>o.jsx("section",{className:"border-t border-border py-16 md:py-24",children:o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"HOW IT WORKS"}),o.jsx("p",{className:"mb-12 text-center text-lg text-muted-foreground",children:"From scenario to insight in five steps"}),o.jsx("div",{className:"mx-auto max-w-sm",children:Hh.map((e,t)=>o.jsxs("div",{children:[o.jsxs("div",{className:"rounded-lg border border-border bg-card px-5 py-4 text-center",children:[o.jsx("div",{className:`text-sm font-bold tracking-wider ${e.color}`,children:e.label}),o.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:e.description})]}),t<Hh.length-1&&o.jsx("div",{className:"flex justify-center py-2",children:o.jsx(bC,{className:"h-4 w-4 text-primary/50"})})]},e.label))}),o.jsx("div",{className:"mx-auto mt-16 grid max-w-3xl gap-8 md:grid-cols-3",children:H5.map(e=>o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"mb-2 text-2xl font-bold tracking-tight text-foreground",children:e.word}),o.jsx("div",{className:"text-sm text-muted-foreground",children:e.description})]},e.word))})]})}),K5=`{
|
|
432
|
-
"actor": "agent_1",
|
|
433
|
-
"action": "panic_sell",
|
|
434
|
-
"world": "trading"
|
|
435
|
-
}`,Y5=`{
|
|
436
|
-
"decision": "BLOCK",
|
|
437
|
-
"reason": "Panic selling blocked by governance rule",
|
|
438
|
-
"rule_id": "sim-panic-actions",
|
|
439
|
-
"evidence": { ... },
|
|
440
|
-
"modified_action": null
|
|
441
|
-
}`,q5=`from neuroverse_bridge import evaluate
|
|
442
|
-
|
|
443
|
-
verdict = evaluate(
|
|
444
|
-
actor="agent_1",
|
|
445
|
-
action="panic_sell",
|
|
446
|
-
world="trading"
|
|
447
|
-
)
|
|
448
|
-
|
|
449
|
-
if verdict["decision"] == "BLOCK":
|
|
450
|
-
action = "hold" # action replaced
|
|
451
|
-
elif verdict["decision"] == "MODIFY":
|
|
452
|
-
action = verdict["modified_action"] # constrained
|
|
453
|
-
# ALLOW → proceed`,Q5=()=>o.jsx("section",{className:"border-t border-border py-16 md:py-24",children:o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"WORKS WITH ANYTHING"}),o.jsx("p",{className:"mb-4 text-center text-lg text-muted-foreground",children:"If your system has actions, you can govern it. One API call."}),o.jsx("p",{className:"mb-12 text-center text-sm text-muted-foreground/70",children:"Runs locally. No cloud. No SDK. No cost."}),o.jsxs("div",{className:"mx-auto max-w-4xl space-y-8",children:[o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Python — 3-line integration"}),o.jsx("pre",{className:"overflow-auto rounded-lg border border-border bg-card p-4 text-xs text-foreground",children:o.jsx("code",{children:q5})})]}),o.jsx("div",{className:"mb-4 rounded-md bg-card border border-border px-4 py-2",children:o.jsx("code",{className:"text-sm font-bold text-primary",children:"POST /api/evaluate"})}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Request"}),o.jsx("pre",{className:"overflow-auto rounded-lg border border-border bg-card p-4 text-xs text-foreground",children:o.jsx("code",{children:K5})})]}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Response"}),o.jsx("pre",{className:"overflow-auto rounded-lg border border-border bg-card p-4 text-xs text-foreground",children:o.jsx("code",{children:Y5})})]})]}),o.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[o.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-center",children:[o.jsx("div",{className:"mb-1 text-sm font-bold text-red-400",children:"BLOCK"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Action replaced"})]}),o.jsxs("div",{className:"rounded-lg border border-yellow-500/20 bg-yellow-500/5 p-4 text-center",children:[o.jsx("div",{className:"mb-1 text-sm font-bold text-yellow-400",children:"MODIFY"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Action constrained"})]}),o.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 p-4 text-center",children:[o.jsx("div",{className:"mb-1 text-sm font-bold text-green-400",children:"ALLOW"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Action proceeds"})]})]}),o.jsx("div",{className:"mt-4 text-center text-xs text-muted-foreground",children:"Fail-open. Stateless. 500ms timeout. Works with any simulator."})]})]})}),X5=[{title:"Gas Price Shock",description:"Crude spikes to $120/barrel. Domestic pump prices exceed $5. Election in 6 months.",tags:["economic","energy","political"]},{title:"AI Regulation Crisis",description:"Major AI safety incident triggers emergency legislation proposals across G7.",tags:["regulation","technology","global"]},{title:"Strait of Hormuz",description:"Iran threatens closure. 20% of global oil transits through the strait.",tags:["geopolitical","energy","military"]},{title:"Taiwan Conflict",description:"PLA military exercises escalate near Taiwan. Semiconductor supply chain at risk.",tags:["geopolitical","supply chain","military"]},{title:"Global Supply Chain Disruption",description:"Major port strike + shipping lane conflict creates cascading delays worldwide.",tags:["economic","logistics","global"]},{title:"Cyber Attack on Banks",description:"Coordinated ransomware hits top 5 banks. Settlements frozen for 48 hours.",tags:["cybersecurity","financial","crisis"]}],J5=({onSelect:e})=>o.jsx("section",{className:"border-t border-border py-16 md:py-24",children:o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"EXAMPLE SCENARIOS"}),o.jsx("p",{className:"mb-12 text-center text-lg text-muted-foreground",children:"Click to load a scenario capsule and start exploring"}),o.jsx("div",{className:"mx-auto grid max-w-5xl gap-4 sm:grid-cols-2 lg:grid-cols-3",children:X5.map(t=>o.jsxs(Te,{className:"cursor-pointer border-border transition-all duration-200 hover:border-primary/50 hover:glow-teal",onClick:()=>e(t.title,t.description),children:[o.jsx(Xe,{className:"pb-2",children:o.jsx(Je,{className:"text-base",children:t.title})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground leading-relaxed",children:t.description}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.tags.map(n=>o.jsx(Re,{variant:"outline",className:"text-[10px] uppercase tracking-wider",children:n},n))})]})]},t.title))})]})}),Z5=({onSelectScenario:e,onCustomScenario:t,onCalculate:n,selectedId:r,customText:s,isLoading:i,hasScenario:a})=>o.jsx("section",{className:"py-16 md:py-24",children:o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsxs("div",{className:"mx-auto max-w-4xl text-center",children:[o.jsx("h1",{className:"mb-3 text-3xl font-bold tracking-tight text-foreground md:text-5xl",children:"Choose a scenario."}),o.jsx("p",{className:"mb-12 text-lg text-muted-foreground",children:"Pick a preset or describe your own situation to begin"})]}),o.jsx("div",{className:"mx-auto grid max-w-5xl gap-4 md:grid-cols-3",children:$R.map(l=>o.jsxs(Te,{className:`cursor-pointer border-border transition-all duration-200 hover:border-primary/50 hover:glow-teal ${r===l.id?"border-primary glow-teal":""}`,onClick:()=>e(l),children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base leading-tight",children:l.title})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground leading-relaxed",children:l.description}),o.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:l.tags.map(c=>o.jsx(Re,{variant:"outline",className:"text-[10px] uppercase tracking-wider",children:c},c))}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.stakeholderCount," participants"]})]})]},l.id))}),o.jsxs("div",{className:"mx-auto mt-8 max-w-3xl",children:[o.jsx("div",{className:"rounded-lg border border-border bg-card p-1",children:o.jsx(rc,{placeholder:"Or describe your own situation...",className:"min-h-[100px] resize-none border-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",value:s,onChange:l=>t(l.target.value)})}),o.jsx("div",{className:"mt-6 text-center",children:o.jsx(re,{className:"px-12 py-6 text-base font-semibold tracking-wider",onClick:n,disabled:!a||i,children:i?"RUNNING...":"RUN SIMULATION"})})]})]})});function wo(e,[t,n]){return Math.min(n,Math.max(t,e))}var eP=h.createContext(void 0);function Oo(e){const t=h.useContext(eP);return e||t||"ltr"}function xm(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Gy=["PageUp","PageDown"],Ky=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Yy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},xi="Slider",[Ru,tP,nP]=Vl(xi),[qy,r4]=zt(xi,[nP]),[rP,sc]=qy(xi),Qy=h.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[r],value:u,onValueChange:f=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:y,...g}=e,b=h.useRef(new Set),x=h.useRef(0),w=a==="horizontal"?sP:iP,[S=[],N]=Un({prop:u,defaultProp:d,onChange:P=>{var L;(L=[...b.current][x.current])==null||L.focus(),f(P)}}),k=h.useRef(S);function j(P){const T=dP(S,P);R(P,T)}function C(P){R(P,x.current)}function E(){const P=k.current[x.current];S[x.current]!==P&&p(S)}function R(P,T,{commit:L}={commit:!1}){const I=pP(i),F=hP(Math.round((P-r)/i)*i+r,I),O=wo(F,[r,s]);N((V=[])=>{const _=lP(V,O,T);if(mP(_,c*i)){x.current=_.indexOf(O);const A=String(_)!==String(V);return A&&L&&p(_),A?_:V}else return V})}return o.jsx(rP,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:s,valueIndexToChangeRef:x,thumbs:b.current,values:S,orientation:a,form:y,children:o.jsx(Ru.Provider,{scope:e.__scopeSlider,children:o.jsx(Ru.Slot,{scope:e.__scopeSlider,children:o.jsx(w,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:K(g.onPointerDown,()=>{l||(k.current=S)}),min:r,max:s,inverted:m,onSlideStart:l?void 0:j,onSlideMove:l?void 0:C,onSlideEnd:l?void 0:E,onHomeKeyDown:()=>!l&&R(r,0,{commit:!0}),onEndKeyDown:()=>!l&&R(s,S.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:T})=>{if(!l){const F=Gy.includes(P.key)||P.shiftKey&&Ky.includes(P.key)?10:1,O=x.current,V=S[O],_=i*F*T;R(V+_,O,{commit:!0})}}})})})})});Qy.displayName=xi;var[Xy,Jy]=qy(xi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),sP=h.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...u}=e,[f,p]=h.useState(null),m=ie(t,w=>p(w)),y=h.useRef(void 0),g=Oo(s),b=g==="ltr",x=b&&!i||!b&&i;function v(w){const S=y.current||f.getBoundingClientRect(),N=[0,S.width],j=ym(N,x?[n,r]:[r,n]);return y.current=S,j(w-S.left)}return o.jsx(Xy,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:o.jsx(Zy,{dir:g,"data-orientation":"horizontal",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=v(w.clientX);a==null||a(S)},onSlideMove:w=>{const S=v(w.clientX);l==null||l(S)},onSlideEnd:()=>{y.current=void 0,c==null||c()},onStepKeyDown:w=>{const N=Yy[x?"from-left":"from-right"].includes(w.key);d==null||d({event:w,direction:N?-1:1})}})})}),iP=h.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...d}=e,u=h.useRef(null),f=ie(t,u),p=h.useRef(void 0),m=!s;function y(g){const b=p.current||u.current.getBoundingClientRect(),x=[0,b.height],w=ym(x,m?[r,n]:[n,r]);return p.current=b,w(g-b.top)}return o.jsx(Xy,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:o.jsx(Zy,{"data-orientation":"vertical",...d,ref:f,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const b=y(g.clientY);i==null||i(b)},onSlideMove:g=>{const b=y(g.clientY);a==null||a(b)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:g=>{const x=Yy[m?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:x?-1:1})}})})}),Zy=h.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:l,onStepKeyDown:c,...d}=e,u=sc(xi,n);return o.jsx(Q.span,{...d,ref:t,onKeyDown:K(e.onKeyDown,f=>{f.key==="Home"?(a(f),f.preventDefault()):f.key==="End"?(l(f),f.preventDefault()):Gy.concat(Ky).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:K(e.onPointerDown,f=>{const p=f.target;p.setPointerCapture(f.pointerId),f.preventDefault(),u.thumbs.has(p)?p.focus():r(f)}),onPointerMove:K(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&s(f)}),onPointerUp:K(e.onPointerUp,f=>{const p=f.target;p.hasPointerCapture(f.pointerId)&&(p.releasePointerCapture(f.pointerId),i(f))})})}),eb="SliderTrack",tb=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=sc(eb,n);return o.jsx(Q.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});tb.displayName=eb;var Pu="SliderRange",nb=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=sc(Pu,n),i=Jy(Pu,n),a=h.useRef(null),l=ie(t,a),c=s.values.length,d=s.values.map(p=>ib(p,s.min,s.max)),u=c>1?Math.min(...d):0,f=100-Math.max(...d);return o.jsx(Q.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:l,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:f+"%"}})});nb.displayName=Pu;var Tu="SliderThumb",rb=h.forwardRef((e,t)=>{const n=tP(e.__scopeSlider),[r,s]=h.useState(null),i=ie(t,l=>s(l)),a=h.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return o.jsx(oP,{...e,ref:i,index:a})}),oP=h.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...i}=e,a=sc(Tu,n),l=Jy(Tu,n),[c,d]=h.useState(null),u=ie(t,v=>d(v)),f=c?a.form||!!c.closest("form"):!0,p=sm(c),m=a.values[r],y=m===void 0?0:ib(m,a.min,a.max),g=cP(r,a.values.length),b=p==null?void 0:p[l.size],x=b?uP(b,y,l.direction):0;return h.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${y}% + ${x}px)`},children:[o.jsx(Ru.ItemSlot,{scope:e.__scopeSlider,children:o.jsx(Q.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":a.min,"aria-valuenow":m,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:u,style:m===void 0?{display:"none"}:e.style,onFocus:K(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),f&&o.jsx(sb,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:m},r)]})});rb.displayName=Tu;var aP="RadioBubbleInput",sb=h.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=h.useRef(null),i=ie(s,r),a=xm(t);return h.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const f=new Event("input",{bubbles:!0});u.call(l,t),l.dispatchEvent(f)}},[a,t]),o.jsx(Q.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});sb.displayName=aP;function lP(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,i)=>s-i)}function ib(e,t,n){const i=100/(n-t)*(e-t);return wo(i,[0,100])}function cP(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function dP(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function uP(e,t,n){const r=e/2,i=ym([0,50],[0,r]);return(r-i(t)*n)*n}function fP(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function mP(e,t){if(t>0){const n=fP(e);return Math.min(...n)>=t}return!0}function ym(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function pP(e){return(String(e).split(".")[1]||"").length}function hP(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var ob=Qy,gP=tb,vP=nb,xP=rb;const bm=h.forwardRef(({className:e,...t},n)=>o.jsxs(ob,{ref:n,className:$("relative flex w-full touch-none select-none items-center",e),...t,children:[o.jsx(gP,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:o.jsx(vP,{className:"absolute h-full bg-primary"})}),o.jsx(xP,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));bm.displayName=ob.displayName;const yP=[{key:"severity",label:"Severity",low:"Low",high:"Critical"},{key:"environmentalHostility",label:"Environmental Hostility",low:"Low",high:"High"},{key:"timePressure",label:"Time Pressure",low:"None",high:"Immediate"},{key:"regulatoryClimate",label:"Regulatory Climate",low:"Permissive",high:"Adversarial"}],bP=({values:e,onChange:t,showRecalculate:n,onRecalculate:r})=>{const s=(i,a)=>{t({...e,[i]:a[0]})};return o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Je,{className:"text-base",children:"Assumptions"}),n&&o.jsx("button",{onClick:r,className:"pulse-teal rounded-md bg-primary px-4 py-1.5 text-xs font-semibold text-primary-foreground transition-colors hover:bg-primary/90",children:"Re-calculate"})]})}),o.jsx(Ae,{children:o.jsx("div",{className:"space-y-6",children:yP.map(i=>o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("label",{className:"text-sm font-medium text-foreground",children:i.label}),o.jsx("span",{className:"text-sm font-mono text-primary",children:e[i.key]})]}),o.jsx(bm,{value:[e[i.key]],onValueChange:a=>s(i.key,a),min:0,max:100,step:1}),o.jsxs("div",{className:"mt-1 flex justify-between",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:i.low}),o.jsx("span",{className:"text-xs text-muted-foreground",children:i.high})]})]},i.key))})})]})};var rd=0;function wP(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gh()),document.body.insertAdjacentElement("beforeend",e[1]??Gh()),rd++,()=>{rd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),rd--}},[])}function Gh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var sd="focusScope.autoFocusOnMount",id="focusScope.autoFocusOnUnmount",Kh={bubbles:!1,cancelable:!0},SP="FocusScope",ab=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[l,c]=h.useState(null),d=ze(s),u=ze(i),f=h.useRef(null),p=ie(t,g=>c(g)),m=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let g=function(w){if(m.paused||!l)return;const S=w.target;l.contains(S)?f.current=S:tr(f.current,{select:!0})},b=function(w){if(m.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||tr(f.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const N of w)N.removedNodes.length>0&&tr(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const v=new MutationObserver(x);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),v.disconnect()}}},[r,l,m.paused]),h.useEffect(()=>{if(l){qh.add(m);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(sd,Kh);l.addEventListener(sd,d),l.dispatchEvent(x),x.defaultPrevented||(NP(_P(lb(l)),{select:!0}),document.activeElement===g&&tr(l))}return()=>{l.removeEventListener(sd,d),setTimeout(()=>{const x=new CustomEvent(id,Kh);l.addEventListener(id,u),l.dispatchEvent(x),x.defaultPrevented||tr(g??document.body,{select:!0}),l.removeEventListener(id,u),qh.remove(m)},0)}}},[l,d,u,m]);const y=h.useCallback(g=>{if(!n&&!r||m.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(b&&x){const v=g.currentTarget,[w,S]=kP(v);w&&S?!g.shiftKey&&x===S?(g.preventDefault(),n&&tr(w,{select:!0})):g.shiftKey&&x===w&&(g.preventDefault(),n&&tr(S,{select:!0})):x===v&&g.preventDefault()}},[n,r,m.paused]);return o.jsx(Q.div,{tabIndex:-1,...a,ref:p,onKeyDown:y})});ab.displayName=SP;function NP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(tr(r,{select:t}),document.activeElement!==n)return}function kP(e){const t=lb(e),n=Yh(t,e),r=Yh(t.reverse(),e);return[n,r]}function lb(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Yh(e,t){for(const n of e)if(!jP(n,{upTo:t}))return n}function jP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function CP(e){return e instanceof HTMLInputElement&&"select"in e}function tr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&CP(e)&&t&&e.select()}}var qh=EP();function EP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Qh(e,t),e.unshift(t)},remove(t){var n;e=Qh(e,t),(n=e[0])==null||n.resume()}}}function Qh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _P(e){return e.filter(t=>t.tagName!=="A")}var RP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vs=new WeakMap,ua=new WeakMap,fa={},od=0,cb=function(e){return e&&(e.host||cb(e.parentNode))},PP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=cb(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},TP=function(e,t,n,r){var s=PP(t,Array.isArray(e)?e:[e]);fa[n]||(fa[n]=new WeakMap);var i=fa[n],a=[],l=new Set,c=new Set(s),d=function(f){!f||l.has(f)||(l.add(f),d(f.parentNode))};s.forEach(d);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(p){if(l.has(p))u(p);else try{var m=p.getAttribute(r),y=m!==null&&m!=="false",g=(vs.get(p)||0)+1,b=(i.get(p)||0)+1;vs.set(p,g),i.set(p,b),a.push(p),g===1&&y&&ua.set(p,!0),b===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return u(t),l.clear(),od++,function(){a.forEach(function(f){var p=vs.get(f)-1,m=i.get(f)-1;vs.set(f,p),i.set(f,m),p||(ua.has(f)||f.removeAttribute(r),ua.delete(f)),m||f.removeAttribute(n)}),od--,od||(vs=new WeakMap,vs=new WeakMap,ua=new WeakMap,fa={})}},AP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=RP(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),TP(r,s,n,"aria-hidden")):function(){return null}},vn=function(){return vn=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},vn.apply(this,arguments)};function db(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function IP(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Aa="right-scroll-bar-position",Ia="width-before-scroll-bar",MP="with-scroll-bars-hidden",OP="--removed-body-scroll-bar-size";function ad(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function LP(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var $P=typeof window<"u"?h.useLayoutEffect:h.useEffect,Xh=new WeakMap;function DP(e,t){var n=LP(null,function(r){return e.forEach(function(s){return ad(s,r)})});return $P(function(){var r=Xh.get(n);if(r){var s=new Set(r),i=new Set(e),a=n.current;s.forEach(function(l){i.has(l)||ad(l,null)}),i.forEach(function(l){s.has(l)||ad(l,a)})}Xh.set(n,e)},[e]),n}function FP(e){return e}function zP(e,t){t===void 0&&(t=FP);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(i),a=n}var c=function(){var u=a;a=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(u){a.push(u),d()},filter:function(u){return a=a.filter(u),n}}}};return s}function BP(e){e===void 0&&(e={});var t=zP(null);return t.options=vn({async:!0,ssr:!1},e),t}var ub=function(e){var t=e.sideCar,n=db(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,vn({},n))};ub.isSideCarExport=!0;function VP(e,t){return e.useMedium(t),ub}var fb=BP(),ld=function(){},ic=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:ld,onWheelCapture:ld,onTouchMoveCapture:ld}),s=r[0],i=r[1],a=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,y=e.noIsolation,g=e.inert,b=e.allowPinchZoom,x=e.as,v=x===void 0?"div":x,w=e.gapMode,S=db(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,k=DP([n,t]),j=vn(vn({},S),s);return h.createElement(h.Fragment,null,u&&h.createElement(N,{sideCar:fb,removeScrollBar:d,shards:f,noRelative:m,noIsolation:y,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:w}),a?h.cloneElement(h.Children.only(l),vn(vn({},j),{ref:k})):h.createElement(v,vn({},j,{className:c,ref:k}),l))});ic.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ic.classNames={fullWidth:Ia,zeroRight:Aa};var UP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function WP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=UP();return t&&e.setAttribute("nonce",t),e}function HP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function GP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var KP=function(){var e=0,t=null;return{add:function(n){e==0&&(t=WP())&&(HP(t,n),GP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},YP=function(){var e=KP();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mb=function(){var e=YP(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},qP={left:0,top:0,right:0,gap:0},cd=function(e){return parseInt(e||"",10)||0},QP=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[cd(n),cd(r),cd(s)]},XP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qP;var t=QP(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},JP=mb(),Us="data-scroll-locked",ZP=function(e,t,n,r){var s=e.left,i=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
454
|
-
.`.concat(MP,` {
|
|
455
|
-
overflow: hidden `).concat(r,`;
|
|
456
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
457
|
-
}
|
|
458
|
-
body[`).concat(Us,`] {
|
|
459
|
-
overflow: hidden `).concat(r,`;
|
|
460
|
-
overscroll-behavior: contain;
|
|
461
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
462
|
-
padding-left: `.concat(s,`px;
|
|
463
|
-
padding-top: `).concat(i,`px;
|
|
464
|
-
padding-right: `).concat(a,`px;
|
|
465
|
-
margin-left:0;
|
|
466
|
-
margin-top:0;
|
|
467
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
468
|
-
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
.`).concat(Aa,` {
|
|
472
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
.`).concat(Ia,` {
|
|
476
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
.`).concat(Aa," .").concat(Aa,` {
|
|
480
|
-
right: 0 `).concat(r,`;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
.`).concat(Ia," .").concat(Ia,` {
|
|
484
|
-
margin-right: 0 `).concat(r,`;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
body[`).concat(Us,`] {
|
|
488
|
-
`).concat(OP,": ").concat(l,`px;
|
|
489
|
-
}
|
|
490
|
-
`)},Jh=function(){var e=parseInt(document.body.getAttribute(Us)||"0",10);return isFinite(e)?e:0},eT=function(){h.useEffect(function(){return document.body.setAttribute(Us,(Jh()+1).toString()),function(){var e=Jh()-1;e<=0?document.body.removeAttribute(Us):document.body.setAttribute(Us,e.toString())}},[])},tT=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;eT();var i=h.useMemo(function(){return XP(s)},[s]);return h.createElement(JP,{styles:ZP(i,!t,s,n?"":"!important")})},Au=!1;if(typeof window<"u")try{var ma=Object.defineProperty({},"passive",{get:function(){return Au=!0,!0}});window.addEventListener("test",ma,ma),window.removeEventListener("test",ma,ma)}catch{Au=!1}var xs=Au?{passive:!1}:!1,nT=function(e){return e.tagName==="TEXTAREA"},pb=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!nT(e)&&n[t]==="visible")},rT=function(e){return pb(e,"overflowY")},sT=function(e){return pb(e,"overflowX")},Zh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=hb(e,r);if(s){var i=gb(e,r),a=i[1],l=i[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},iT=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},oT=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hb=function(e,t){return e==="v"?rT(t):sT(t)},gb=function(e,t){return e==="v"?iT(t):oT(t)},aT=function(e,t){return e==="h"&&t==="rtl"?-1:1},lT=function(e,t,n,r,s){var i=aT(e,window.getComputedStyle(t).direction),a=i*r,l=n.target,c=t.contains(l),d=!1,u=a>0,f=0,p=0;do{if(!l)break;var m=gb(e,l),y=m[0],g=m[1],b=m[2],x=g-b-i*y;(y||x)&&hb(e,l)&&(f+=x,p+=y);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&(Math.abs(f)<1||!s)||!u&&(Math.abs(p)<1||!s))&&(d=!0),d},pa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eg=function(e){return[e.deltaX,e.deltaY]},tg=function(e){return e&&"current"in e?e.current:e},cT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},dT=function(e){return`
|
|
491
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
492
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
493
|
-
`)},uT=0,ys=[];function fT(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(uT++)[0],i=h.useState(mb)[0],a=h.useRef(e);h.useEffect(function(){a.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=IP([e.lockRef.current],(e.shards||[]).map(tg),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var x=pa(g),v=n.current,w="deltaX"in g?g.deltaX:v[0]-x[0],S="deltaY"in g?g.deltaY:v[1]-x[1],N,k=g.target,j=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in g&&j==="h"&&k.type==="range")return!1;var C=Zh(j,k);if(!C)return!0;if(C?N=j:(N=j==="v"?"h":"v",C=Zh(j,k)),!C)return!1;if(!r.current&&"changedTouches"in g&&(w||S)&&(r.current=N),!N)return!0;var E=r.current||N;return lT(E,b,g,E==="h"?w:S,!0)},[]),c=h.useCallback(function(g){var b=g;if(!(!ys.length||ys[ys.length-1]!==i)){var x="deltaY"in b?eg(b):pa(b),v=t.current.filter(function(N){return N.name===b.type&&(N.target===b.target||b.target===N.shadowParent)&&cT(N.delta,x)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(tg).filter(Boolean).filter(function(N){return N.contains(b.target)}),S=w.length>0?l(b,w[0]):!a.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),d=h.useCallback(function(g,b,x,v){var w={name:g,delta:b,target:x,should:v,shadowParent:mT(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=h.useCallback(function(g){n.current=pa(g),r.current=void 0},[]),f=h.useCallback(function(g){d(g.type,eg(g),g.target,l(g,e.lockRef.current))},[]),p=h.useCallback(function(g){d(g.type,pa(g),g.target,l(g,e.lockRef.current))},[]);h.useEffect(function(){return ys.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,xs),document.addEventListener("touchmove",c,xs),document.addEventListener("touchstart",u,xs),function(){ys=ys.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,xs),document.removeEventListener("touchmove",c,xs),document.removeEventListener("touchstart",u,xs)}},[]);var m=e.removeScrollBar,y=e.inert;return h.createElement(h.Fragment,null,y?h.createElement(i,{styles:dT(s)}):null,m?h.createElement(tT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function mT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pT=VP(fb,fT);var vb=h.forwardRef(function(e,t){return h.createElement(ic,vn({},e,{ref:t,sideCar:pT}))});vb.classNames=ic.classNames;var hT=[" ","Enter","ArrowUp","ArrowDown"],gT=[" ","Enter"],as="Select",[oc,ac,vT]=Vl(as),[yi,s4]=zt(as,[vT,Jl]),lc=Jl(),[xT,Tr]=yi(as),[yT,bT]=yi(as),xb=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:a,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:f,disabled:p,required:m,form:y}=e,g=lc(t),[b,x]=h.useState(null),[v,w]=h.useState(null),[S,N]=h.useState(!1),k=Oo(d),[j,C]=Un({prop:r,defaultProp:s??!1,onChange:i,caller:as}),[E,R]=Un({prop:a,defaultProp:l,onChange:c,caller:as}),P=h.useRef(null),T=b?y||!!b.closest("form"):!0,[L,I]=h.useState(new Set),F=Array.from(L).map(O=>O.props.value).join(";");return o.jsx(fy,{...g,children:o.jsxs(xT,{required:m,scope:t,trigger:b,onTriggerChange:x,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:N,contentId:fs(),value:E,onValueChange:R,open:j,onOpenChange:C,dir:k,triggerPointerDownPosRef:P,disabled:p,children:[o.jsx(oc.Provider,{scope:t,children:o.jsx(yT,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(O=>{I(V=>new Set(V).add(O))},[]),onNativeOptionRemove:h.useCallback(O=>{I(V=>{const _=new Set(V);return _.delete(O),_})},[]),children:n})}),T?o.jsxs(Vb,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:f,value:E,onChange:O=>R(O.target.value),disabled:p,form:y,children:[E===void 0?o.jsx("option",{value:""}):null,Array.from(L)]},F):null]})})};xb.displayName=as;var yb="SelectTrigger",bb=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=lc(n),a=Tr(yb,n),l=a.disabled||r,c=ie(t,a.onTriggerChange),d=ac(n),u=h.useRef("touch"),[f,p,m]=Wb(g=>{const b=d().filter(w=>!w.disabled),x=b.find(w=>w.value===a.value),v=Hb(b,g,x);v!==void 0&&a.onValueChange(v.value)}),y=g=>{l||(a.onOpenChange(!0),m()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return o.jsx(my,{asChild:!0,...i,children:o.jsx(Q.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Ub(a.value)?"":void 0,...s,ref:c,onClick:K(s.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&y(g)}),onPointerDown:K(s.onPointerDown,g=>{u.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(y(g),g.preventDefault())}),onKeyDown:K(s.onKeyDown,g=>{const b=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(b&&g.key===" ")&&hT.includes(g.key)&&(y(),g.preventDefault())})})})});bb.displayName=yb;var wb="SelectValue",Sb=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:a="",...l}=e,c=Tr(wb,n),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,f=ie(t,c.onValueNodeChange);return Ve(()=>{d(u)},[d,u]),o.jsx(Q.span,{...l,ref:f,style:{pointerEvents:"none"},children:Ub(c.value)?o.jsx(o.Fragment,{children:a}):i})});Sb.displayName=wb;var wT="SelectIcon",Nb=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(Q.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});Nb.displayName=wT;var ST="SelectPortal",kb=e=>o.jsx(Bf,{asChild:!0,...e});kb.displayName=ST;var ls="SelectContent",jb=h.forwardRef((e,t)=>{const n=Tr(ls,e.__scopeSelect),[r,s]=h.useState();if(Ve(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?us.createPortal(o.jsx(Cb,{scope:e.__scopeSelect,children:o.jsx(oc.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),i):null}return o.jsx(Eb,{...e,ref:t})});jb.displayName=ls;var qt=10,[Cb,Ar]=yi(ls),NT="SelectContentImpl",kT=vo("SelectContent.RemoveScroll"),Eb=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:g,avoidCollisions:b,...x}=e,v=Tr(ls,n),[w,S]=h.useState(null),[N,k]=h.useState(null),j=ie(t,W=>S(W)),[C,E]=h.useState(null),[R,P]=h.useState(null),T=ac(n),[L,I]=h.useState(!1),F=h.useRef(!1);h.useEffect(()=>{if(w)return AP(w)},[w]),wP();const O=h.useCallback(W=>{const[ce,...xe]=T().map(X=>X.ref.current),[le]=xe.slice(-1),z=document.activeElement;for(const X of W)if(X===z||(X==null||X.scrollIntoView({block:"nearest"}),X===ce&&N&&(N.scrollTop=0),X===le&&N&&(N.scrollTop=N.scrollHeight),X==null||X.focus(),document.activeElement!==z))return},[T,N]),V=h.useCallback(()=>O([C,w]),[O,C,w]);h.useEffect(()=>{L&&V()},[L,V]);const{onOpenChange:_,triggerPointerDownPosRef:A}=v;h.useEffect(()=>{if(w){let W={x:0,y:0};const ce=le=>{var z,X;W={x:Math.abs(Math.round(le.pageX)-(((z=A.current)==null?void 0:z.x)??0)),y:Math.abs(Math.round(le.pageY)-(((X=A.current)==null?void 0:X.y)??0))}},xe=le=>{W.x<=10&&W.y<=10?le.preventDefault():w.contains(le.target)||_(!1),document.removeEventListener("pointermove",ce),A.current=null};return A.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",xe,{capture:!0})}}},[w,_,A]),h.useEffect(()=>{const W=()=>_(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[_]);const[D,Y]=Wb(W=>{const ce=T().filter(z=>!z.disabled),xe=ce.find(z=>z.ref.current===document.activeElement),le=Hb(ce,W,xe);le&&setTimeout(()=>le.ref.current.focus())}),G=h.useCallback((W,ce,xe)=>{const le=!F.current&&!xe;(v.value!==void 0&&v.value===ce||le)&&(E(W),le&&(F.current=!0))},[v.value]),J=h.useCallback(()=>w==null?void 0:w.focus(),[w]),Z=h.useCallback((W,ce,xe)=>{const le=!F.current&&!xe;(v.value!==void 0&&v.value===ce||le)&&P(W)},[v.value]),me=r==="popper"?Iu:_b,be=me===Iu?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:g,avoidCollisions:b}:{};return o.jsx(Cb,{scope:n,content:w,viewport:N,onViewportChange:k,itemRefCallback:G,selectedItem:C,onItemLeave:J,itemTextRefCallback:Z,focusSelectedItem:V,selectedItemText:R,position:r,isPositioned:L,searchRef:D,children:o.jsx(vb,{as:kT,allowPinchZoom:!0,children:o.jsx(ab,{asChild:!0,trapped:v.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:K(s,W=>{var ce;(ce=v.trigger)==null||ce.focus({preventScroll:!0}),W.preventDefault()}),children:o.jsx(Ul,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:o.jsx(me,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:W=>W.preventDefault(),...x,...be,onPlaced:()=>I(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:K(x.onKeyDown,W=>{const ce=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ce&&W.key.length===1&&Y(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let le=T().filter(z=>!z.disabled).map(z=>z.ref.current);if(["ArrowUp","End"].includes(W.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const z=W.target,X=le.indexOf(z);le=le.slice(X+1)}setTimeout(()=>O(le)),W.preventDefault()}})})})})})})});Eb.displayName=NT;var jT="SelectItemAlignedPosition",_b=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Tr(ls,n),a=Ar(ls,n),[l,c]=h.useState(null),[d,u]=h.useState(null),f=ie(t,j=>u(j)),p=ac(n),m=h.useRef(!1),y=h.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:x,focusSelectedItem:v}=a,w=h.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&g&&b&&x){const j=i.trigger.getBoundingClientRect(),C=d.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),R=x.getBoundingClientRect();if(i.dir!=="rtl"){const z=R.left-C.left,X=E.left-z,he=j.left-X,oe=j.width+he,ft=Math.max(oe,C.width),Ue=window.innerWidth-qt,We=wo(X,[qt,Math.max(qt,Ue-ft)]);l.style.minWidth=oe+"px",l.style.left=We+"px"}else{const z=C.right-R.right,X=window.innerWidth-E.right-z,he=window.innerWidth-j.right-X,oe=j.width+he,ft=Math.max(oe,C.width),Ue=window.innerWidth-qt,We=wo(X,[qt,Math.max(qt,Ue-ft)]);l.style.minWidth=oe+"px",l.style.right=We+"px"}const P=p(),T=window.innerHeight-qt*2,L=g.scrollHeight,I=window.getComputedStyle(d),F=parseInt(I.borderTopWidth,10),O=parseInt(I.paddingTop,10),V=parseInt(I.borderBottomWidth,10),_=parseInt(I.paddingBottom,10),A=F+O+L+_+V,D=Math.min(b.offsetHeight*5,A),Y=window.getComputedStyle(g),G=parseInt(Y.paddingTop,10),J=parseInt(Y.paddingBottom,10),Z=j.top+j.height/2-qt,me=T-Z,be=b.offsetHeight/2,W=b.offsetTop+be,ce=F+O+W,xe=A-ce;if(ce<=Z){const z=P.length>0&&b===P[P.length-1].ref.current;l.style.bottom="0px";const X=d.clientHeight-g.offsetTop-g.offsetHeight,he=Math.max(me,be+(z?J:0)+X+V),oe=ce+he;l.style.height=oe+"px"}else{const z=P.length>0&&b===P[0].ref.current;l.style.top="0px";const he=Math.max(Z,F+g.offsetTop+(z?G:0)+be)+xe;l.style.height=he+"px",g.scrollTop=ce-Z+g.offsetTop}l.style.margin=`${qt}px 0`,l.style.minHeight=D+"px",l.style.maxHeight=T+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,i.trigger,i.valueNode,l,d,g,b,x,i.dir,r]);Ve(()=>w(),[w]);const[S,N]=h.useState();Ve(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const k=h.useCallback(j=>{j&&y.current===!0&&(w(),v==null||v(),y.current=!1)},[w,v]);return o.jsx(ET,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:o.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:o.jsx(Q.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});_b.displayName=jT;var CT="SelectPopperPosition",Iu=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=qt,...i}=e,a=lc(n);return o.jsx(py,{...a,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Iu.displayName=CT;var[ET,wm]=yi(ls,{}),Mu="SelectViewport",Rb=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Ar(Mu,n),a=wm(Mu,n),l=ie(t,i.onViewportChange),c=h.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(oc.Slot,{scope:n,children:o.jsx(Q.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:K(s.onScroll,d=>{const u=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=a;if(p!=null&&p.current&&f){const m=Math.abs(c.current-u.scrollTop);if(m>0){const y=window.innerHeight-qt*2,g=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),x=Math.max(g,b);if(x<y){const v=x+m,w=Math.min(y,v),S=v-w;f.style.height=w+"px",f.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Rb.displayName=Mu;var Pb="SelectGroup",[_T,RT]=yi(Pb),PT=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=fs();return o.jsx(_T,{scope:n,id:s,children:o.jsx(Q.div,{role:"group","aria-labelledby":s,...r,ref:t})})});PT.displayName=Pb;var Tb="SelectLabel",Ab=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=RT(Tb,n);return o.jsx(Q.div,{id:s.id,...r,ref:t})});Ab.displayName=Tb;var xl="SelectItem",[TT,Ib]=yi(xl),Mb=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...a}=e,l=Tr(xl,n),c=Ar(xl,n),d=l.value===r,[u,f]=h.useState(i??""),[p,m]=h.useState(!1),y=ie(t,v=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,v,r,s)}),g=fs(),b=h.useRef("touch"),x=()=>{s||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(TT,{scope:n,value:r,disabled:s,textId:g,isSelected:d,onItemTextChange:h.useCallback(v=>{f(w=>w||((v==null?void 0:v.textContent)??"").trim())},[]),children:o.jsx(oc.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:o.jsx(Q.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:y,onFocus:K(a.onFocus,()=>m(!0)),onBlur:K(a.onBlur,()=>m(!1)),onClick:K(a.onClick,()=>{b.current!=="mouse"&&x()}),onPointerUp:K(a.onPointerUp,()=>{b.current==="mouse"&&x()}),onPointerDown:K(a.onPointerDown,v=>{b.current=v.pointerType}),onPointerMove:K(a.onPointerMove,v=>{var w;b.current=v.pointerType,s?(w=c.onItemLeave)==null||w.call(c):b.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:K(a.onPointerLeave,v=>{var w;v.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:K(a.onKeyDown,v=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&v.key===" "||(gT.includes(v.key)&&x(),v.key===" "&&v.preventDefault())})})})})});Mb.displayName=xl;var $i="SelectItemText",Ob=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,a=Tr($i,n),l=Ar($i,n),c=Ib($i,n),d=bT($i,n),[u,f]=h.useState(null),p=ie(t,x=>f(x),c.onItemTextChange,x=>{var v;return(v=l.itemTextRefCallback)==null?void 0:v.call(l,x,c.value,c.disabled)}),m=u==null?void 0:u.textContent,y=h.useMemo(()=>o.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=d;return Ve(()=>(g(y),()=>b(y)),[g,b,y]),o.jsxs(o.Fragment,{children:[o.jsx(Q.span,{id:c.textId,...i,ref:p}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?us.createPortal(i.children,a.valueNode):null]})});Ob.displayName=$i;var Lb="SelectItemIndicator",$b=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ib(Lb,n).isSelected?o.jsx(Q.span,{"aria-hidden":!0,...r,ref:t}):null});$b.displayName=Lb;var Ou="SelectScrollUpButton",Db=h.forwardRef((e,t)=>{const n=Ar(Ou,e.__scopeSelect),r=wm(Ou,e.__scopeSelect),[s,i]=h.useState(!1),a=ie(t,r.onScrollButtonChange);return Ve(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?o.jsx(zb,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Db.displayName=Ou;var Lu="SelectScrollDownButton",Fb=h.forwardRef((e,t)=>{const n=Ar(Lu,e.__scopeSelect),r=wm(Lu,e.__scopeSelect),[s,i]=h.useState(!1),a=ie(t,r.onScrollButtonChange);return Ve(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?o.jsx(zb,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Fb.displayName=Lu;var zb=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Ar("SelectScrollButton",n),a=h.useRef(null),l=ac(n),c=h.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),Ve(()=>{var u;const d=l().find(f=>f.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),o.jsx(Q.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:K(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:K(s.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:K(s.onPointerLeave,()=>{c()})})}),AT="SelectSeparator",Bb=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(Q.div,{"aria-hidden":!0,...r,ref:t})});Bb.displayName=AT;var $u="SelectArrow",IT=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=lc(n),i=Tr($u,n),a=Ar($u,n);return i.open&&a.position==="popper"?o.jsx(hy,{...s,...r,ref:t}):null});IT.displayName=$u;var MT="SelectBubbleInput",Vb=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=h.useRef(null),i=ie(r,s),a=xm(t);return h.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const f=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(f)}},[a,t]),o.jsx(Q.select,{...n,style:{...s0,...n.style},ref:i,defaultValue:t})});Vb.displayName=MT;function Ub(e){return e===""||e===void 0}function Wb(e){const t=ze(e),n=h.useRef(""),r=h.useRef(0),s=h.useCallback(a=>{const l=n.current+a;t(l),function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function Hb(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=OT(e,Math.max(i,0));s.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function OT(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var LT=xb,Gb=bb,$T=Sb,DT=Nb,FT=kb,Kb=jb,zT=Rb,Yb=Ab,qb=Mb,BT=Ob,VT=$b,Qb=Db,Xb=Fb,Jb=Bb;const cc=LT,dc=$T,Lo=h.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Gb,{ref:r,className:$("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,o.jsx(DT,{asChild:!0,children:o.jsx(gt,{className:"h-4 w-4 opacity-50"})})]}));Lo.displayName=Gb.displayName;const Zb=h.forwardRef(({className:e,...t},n)=>o.jsx(Qb,{ref:n,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(kC,{className:"h-4 w-4"})}));Zb.displayName=Qb.displayName;const ew=h.forwardRef(({className:e,...t},n)=>o.jsx(Xb,{ref:n,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(gt,{className:"h-4 w-4"})}));ew.displayName=Xb.displayName;const $o=h.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>o.jsx(FT,{children:o.jsxs(Kb,{ref:s,className:$("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[o.jsx(Zb,{}),o.jsx(zT,{className:$("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(ew,{})]})}));$o.displayName=Kb.displayName;const UT=h.forwardRef(({className:e,...t},n)=>o.jsx(Yb,{ref:n,className:$("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));UT.displayName=Yb.displayName;const st=h.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(qb,{ref:r,className:$("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(VT,{children:o.jsx(Hf,{className:"h-4 w-4"})})}),o.jsx(BT,{children:t})]}));st.displayName=qb.displayName;const WT=h.forwardRef(({className:e,...t},n)=>o.jsx(Jb,{ref:n,className:$("-mx-1 my-1 h-px bg-muted",e),...t}));WT.displayName=Jb.displayName;const HT={hostile:"bg-destructive/20 text-destructive border-destructive/30",neutral:"bg-muted text-muted-foreground border-muted-foreground/30",supportive:"bg-primary/20 text-primary border-primary/30",unknown:"bg-muted text-muted-foreground border-border"},GT=({stakeholders:e,onChange:t})=>{const[n,r]=h.useState(""),[s,i]=h.useState("neutral"),a=()=>{n.trim()&&(t([...e,{id:n.trim(),disposition:s}]),r(""),i("neutral"))},l=c=>{t(e.filter((d,u)=>u!==c))};return o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:"Participants"})}),o.jsxs(Ae,{children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx(jt,{placeholder:"Participant name...",value:n,onChange:c=>r(c.target.value),onKeyDown:c=>c.key==="Enter"&&a(),className:"flex-1"}),o.jsxs(cc,{value:s,onValueChange:c=>i(c),children:[o.jsx(Lo,{className:"w-[130px]",children:o.jsx(dc,{})}),o.jsxs($o,{children:[o.jsx(st,{value:"supportive",children:"Supportive"}),o.jsx(st,{value:"neutral",children:"Neutral"}),o.jsx(st,{value:"hostile",children:"Hostile"}),o.jsx(st,{value:"unknown",children:"Unknown"})]})]}),o.jsx(re,{size:"icon",variant:"outline",onClick:a,disabled:!n.trim(),children:o.jsx(Yi,{className:"h-4 w-4"})})]}),e.length>0&&o.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:e.map((c,d)=>o.jsxs(Re,{variant:"outline",className:`gap-1.5 pr-1 ${HT[c.disposition]}`,children:[c.id,o.jsxs("span",{className:"text-[10px] opacity-70",children:["(",c.disposition,")"]}),o.jsx("button",{onClick:()=>l(d),className:"ml-0.5 rounded-full p-0.5 hover:bg-background/50",children:o.jsx(Qi,{className:"h-3 w-3"})})]},d))})]})]})};var KT="Label",tw=h.forwardRef((e,t)=>o.jsx(Q.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));tw.displayName=KT;var nw=tw;const YT=Gl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),hn=h.forwardRef(({className:e,...t},n)=>o.jsx(nw,{ref:n,className:$(YT(),e),...t}));hn.displayName=nw.displayName;const qT=({values:e,onChange:t})=>o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:"Rules & Limits"})}),o.jsxs(Ae,{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(hn,{className:"text-xs text-muted-foreground",children:"Time Horizon"}),o.jsx(jt,{placeholder:"e.g. 30 days, 6 months",value:e.timeHorizon,onChange:n=>t({...e,timeHorizon:n.target.value}),className:"mt-1"})]}),o.jsxs("div",{children:[o.jsx(hn,{className:"text-xs text-muted-foreground",children:"Risk Tolerance"}),o.jsxs(cc,{value:e.riskTolerance,onValueChange:n=>t({...e,riskTolerance:n}),children:[o.jsx(Lo,{className:"mt-1",children:o.jsx(dc,{})}),o.jsxs($o,{children:[o.jsx(st,{value:"conservative",children:"Conservative"}),o.jsx(st,{value:"moderate",children:"Moderate"}),o.jsx(st,{value:"aggressive",children:"Aggressive"})]})]})]}),o.jsxs("div",{children:[o.jsx(hn,{className:"text-xs text-muted-foreground",children:"Budget"}),o.jsx(jt,{placeholder:"e.g. $10M, Unlimited",value:e.budget,onChange:n=>t({...e,budget:n.target.value}),className:"mt-1"})]})]})]}),QT=[{value:"quick",label:"Quick",description:"2 paths, surface analysis"},{value:"standard",label:"Standard",description:"3 paths, balanced"},{value:"full",label:"Full",description:"5 paths, deep analysis"},{value:"exhaustive",label:"Exhaustive",description:"8 paths, stress tests"}],XT=({value:e,onChange:t})=>o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:"Analysis Depth"})}),o.jsx(Ae,{children:o.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:QT.map(n=>o.jsxs("button",{onClick:()=>t(n.value),className:`rounded-lg border px-3 py-2.5 text-left transition-all ${e===n.value?"border-primary bg-primary/10 text-foreground":"border-border bg-card text-muted-foreground hover:border-primary/30"}`,children:[o.jsx("p",{className:"text-sm font-medium",children:n.label}),o.jsx("p",{className:"mt-0.5 text-[10px]",children:n.description})]},n.value))})})]}),dd="mirotir_api_key",JT=({onKeyChange:e})=>{const[t,n]=h.useState(""),[r,s]=h.useState(!1),[i,a]=h.useState(!1);h.useEffect(()=>{const d=localStorage.getItem(dd);d&&(n(d),e==null||e(d))},[]);const l=()=>{t.trim()?localStorage.setItem(dd,t.trim()):localStorage.removeItem(dd),e==null||e(t.trim()),a(!0),setTimeout(()=>a(!1),2e3)},c=t.trim().length>0;return o.jsxs("div",{className:"rounded-xl border-2 border-primary/20 bg-card p-5 shadow-md",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10",children:o.jsx(RC,{className:"h-4 w-4 text-primary"})}),o.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Your AI Key"}),c&&i&&o.jsx("span",{className:"ml-auto rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary",children:"Saved ✓"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-1 ml-10",children:"Powers the analysis with your chosen AI service."}),o.jsxs("p",{className:"text-[10px] text-muted-foreground/70 mb-3 ml-10",children:["Get a key from"," ",o.jsxs("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["OpenAI ",o.jsx(ph,{className:"h-2.5 w-2.5"})]})," ","or"," ",o.jsxs("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["Google AI Studio ",o.jsx(ph,{className:"h-2.5 w-2.5"})]}),". Stored in your browser only — never sent to our servers."]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(jt,{type:r?"text":"password",placeholder:"sk-... or AIza...",value:t,onChange:d=>n(d.target.value),onKeyDown:d=>d.key==="Enter"&&l(),className:"pr-9 border-primary/20 focus-visible:ring-primary/30"}),o.jsx("button",{onClick:()=>s(!r),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:r?o.jsx(jC,{className:"h-4 w-4"}):o.jsx(Kl,{className:"h-4 w-4"})})]}),o.jsx(re,{size:"sm",onClick:l,className:"min-w-[60px]",children:i?o.jsx(Hf,{className:"h-4 w-4"}):"Save"})]})]})},ZT=({mode:e,onChange:t})=>o.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-border bg-card p-1",children:[o.jsxs("button",{onClick:()=>t("explore"),className:$("flex-1 rounded-md px-4 py-2 text-sm font-medium transition-all",e==="explore"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[o.jsx("span",{className:"block text-xs opacity-70",children:"EXPLORE"}),o.jsx("span",{className:"block text-[10px]",children:"What might happen?"})]}),o.jsxs("button",{onClick:()=>t("goal"),className:$("flex-1 rounded-md px-4 py-2 text-sm font-medium transition-all",e==="goal"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[o.jsx("span",{className:"block text-xs opacity-70",children:"GOAL"}),o.jsx("span",{className:"block text-[10px]",children:"How do I get here?"})]})]}),eA=({values:e,onChange:t})=>{const[n,r]=h.useState(""),[s,i]=h.useState(""),[a,l]=h.useState(""),c=(u,f,p)=>{f.trim()&&(t({...e,[u]:[...e[u],f.trim()]}),p(""))},d=(u,f)=>{t({...e,[u]:e[u].filter((p,m)=>m!==f)})};return o.jsxs(Te,{className:"border-primary/30 bg-primary/5",children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:"Goal: How do I get here?"})}),o.jsxs(Ae,{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(hn,{className:"text-xs text-muted-foreground",children:"Desired Outcome"}),o.jsx(rc,{placeholder:"Describe the outcome you want to achieve...",value:e.outcome,onChange:u=>t({...e,outcome:u.target.value}),className:"mt-1 min-h-[60px]"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{children:[o.jsx(hn,{className:"text-xs text-muted-foreground",children:"Priority"}),o.jsxs(cc,{value:e.priority,onValueChange:u=>t({...e,priority:u}),children:[o.jsx(Lo,{className:"mt-1",children:o.jsx(dc,{})}),o.jsxs($o,{children:[o.jsx(st,{value:"preferred",children:"Preferred"}),o.jsx(st,{value:"important",children:"Important"}),o.jsx(st,{value:"critical",children:"Critical"})]})]})]}),o.jsxs("div",{children:[o.jsx(hn,{className:"text-xs text-muted-foreground",children:"Timeframe"}),o.jsx(jt,{placeholder:"e.g. 30 days",value:e.timeframe,onChange:u=>t({...e,timeframe:u.target.value}),className:"mt-1"})]})]}),o.jsxs("div",{children:[o.jsx(hn,{className:"text-xs text-muted-foreground",children:"Success Criteria"}),o.jsxs("div",{className:"mt-1 flex gap-2",children:[o.jsx(jt,{placeholder:"Measurable condition...",value:n,onChange:u=>r(u.target.value),onKeyDown:u=>u.key==="Enter"&&c("successCriteria",n,r)}),o.jsx("button",{onClick:()=>c("successCriteria",n,r),className:"shrink-0 rounded-md border border-border p-2 hover:bg-muted",children:o.jsx(Yi,{className:"h-4 w-4"})})]}),e.successCriteria.length>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.successCriteria.map((u,f)=>o.jsxs(Re,{variant:"outline",className:"gap-1 pr-1 text-xs",children:[u,o.jsx("button",{onClick:()=>d("successCriteria",f),children:o.jsx(Qi,{className:"h-3 w-3"})})]},f))})]}),o.jsxs("div",{children:[o.jsx(hn,{className:"text-xs text-destructive",children:"Red Lines (must NOT happen)"}),o.jsxs("div",{className:"mt-1 flex gap-2",children:[o.jsx(jt,{placeholder:"Hard constraint...",value:s,onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&c("redLines",s,i)}),o.jsx("button",{onClick:()=>c("redLines",s,i),className:"shrink-0 rounded-md border border-destructive/30 p-2 hover:bg-destructive/10",children:o.jsx(Yi,{className:"h-4 w-4 text-destructive"})})]}),e.redLines.length>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.redLines.map((u,f)=>o.jsxs(Re,{variant:"outline",className:"gap-1 pr-1 text-xs border-destructive/30 text-destructive",children:[u,o.jsx("button",{onClick:()=>d("redLines",f),children:o.jsx(Qi,{className:"h-3 w-3"})})]},f))})]}),o.jsxs("div",{children:[o.jsx(hn,{className:"text-xs text-muted-foreground",children:"Available Levers"}),o.jsxs("div",{className:"mt-1 flex gap-2",children:[o.jsx(jt,{placeholder:"Tool or resource you can deploy...",value:a,onChange:u=>l(u.target.value),onKeyDown:u=>u.key==="Enter"&&c("availableLevers",a,l)}),o.jsx("button",{onClick:()=>c("availableLevers",a,l),className:"shrink-0 rounded-md border border-border p-2 hover:bg-muted",children:o.jsx(Yi,{className:"h-4 w-4"})})]}),e.availableLevers.length>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.availableLevers.map((u,f)=>o.jsxs(Re,{variant:"outline",className:"gap-1 pr-1 text-xs border-primary/30 text-primary",children:[u,o.jsx("button",{onClick:()=>d("availableLevers",f),children:o.jsx(Qi,{className:"h-3 w-3"})})]},f))})]})]})]})},tA={low:"bg-destructive/20 text-destructive border-destructive/30",medium:"bg-warning/20 text-warning border-warning/30",high:"bg-primary/20 text-primary border-primary/30"},nA=({confidence:e})=>{const[t,n]=h.useState(!1);return o.jsxs("div",{className:"inline-block",children:[o.jsxs("button",{onClick:()=>n(!t),className:$("inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium transition-all",tA[e.level]),children:["Confidence: ",e.level.toUpperCase(),o.jsx(gt,{className:$("h-3 w-3 transition-transform",t&&"rotate-180")})]}),t&&o.jsx("div",{className:"mt-2 rounded-md border border-border bg-card p-3 text-xs text-muted-foreground animate-in fade-in-0 slide-in-from-top-1",children:e.reason})]})},rA={caller:"bg-primary/20 text-primary",inferred:"bg-warning/20 text-warning",default:"bg-muted text-muted-foreground"},sA=({assumptions:e})=>e.length===0?null:o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsx("div",{className:"mx-auto max-w-4xl",children:o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:"Key Assumptions"})}),o.jsx(Ae,{children:o.jsx("ul",{className:"space-y-2",children:e.map((t,n)=>o.jsxs("li",{className:"flex items-start gap-2",children:[o.jsx(Re,{className:`shrink-0 text-[10px] ${rA[t.source]}`,children:t.source}),o.jsx("span",{className:"text-sm text-foreground",children:t.text})]},n))})})]})})})});var ud="rovingFocusGroup.onEntryFocus",iA={bubbles:!1,cancelable:!0},Do="RovingFocusGroup",[Du,rw,oA]=Vl(Do),[aA,sw]=zt(Do,[oA]),[lA,cA]=aA(Do),iw=h.forwardRef((e,t)=>o.jsx(Du.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Du.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(dA,{...e,ref:t})})}));iw.displayName=Do;var dA=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=e,p=h.useRef(null),m=ie(t,p),y=Oo(i),[g,b]=Un({prop:a,defaultProp:l??null,onChange:c,caller:Do}),[x,v]=h.useState(!1),w=ze(d),S=rw(n),N=h.useRef(!1),[k,j]=h.useState(0);return h.useEffect(()=>{const C=p.current;if(C)return C.addEventListener(ud,w),()=>C.removeEventListener(ud,w)},[w]),o.jsx(lA,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:g,onItemFocus:h.useCallback(C=>b(C),[b]),onItemShiftTab:h.useCallback(()=>v(!0),[]),onFocusableItemAdd:h.useCallback(()=>j(C=>C+1),[]),onFocusableItemRemove:h.useCallback(()=>j(C=>C-1),[]),children:o.jsx(Q.div,{tabIndex:x||k===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:K(e.onMouseDown,()=>{N.current=!0}),onFocus:K(e.onFocus,C=>{const E=!N.current;if(C.target===C.currentTarget&&E&&!x){const R=new CustomEvent(ud,iA);if(C.currentTarget.dispatchEvent(R),!R.defaultPrevented){const P=S().filter(O=>O.focusable),T=P.find(O=>O.active),L=P.find(O=>O.id===g),F=[T,L,...P].filter(Boolean).map(O=>O.ref.current);lw(F,u)}}N.current=!1}),onBlur:K(e.onBlur,()=>v(!1))})})}),ow="RovingFocusGroupItem",aw=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...l}=e,c=fs(),d=i||c,u=cA(ow,n),f=u.currentTabStopId===d,p=rw(n),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:g}=u;return h.useEffect(()=>{if(r)return m(),()=>y()},[r,m,y]),o.jsx(Du.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:o.jsx(Q.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:K(e.onMouseDown,b=>{r?u.onItemFocus(d):b.preventDefault()}),onFocus:K(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:K(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=mA(b,u.orientation,u.dir);if(x!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=p().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const S=w.indexOf(b.currentTarget);w=u.loop?pA(w,S+1):w.slice(S+1)}setTimeout(()=>lw(w))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:g!=null}):a})})});aw.displayName=ow;var uA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function fA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mA(e,t,n){const r=fA(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return uA[r]}function lw(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function pA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var hA=iw,gA=aw,uc="Tabs",[vA,i4]=zt(uc,[sw]),cw=sw(),[xA,Sm]=vA(uc),dw=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Oo(l),[f,p]=Un({prop:r,onChange:s,defaultProp:i??"",caller:uc});return o.jsx(xA,{scope:n,baseId:fs(),value:f,onValueChange:p,orientation:a,dir:u,activationMode:c,children:o.jsx(Q.div,{dir:u,"data-orientation":a,...d,ref:t})})});dw.displayName=uc;var uw="TabsList",fw=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=Sm(uw,n),a=cw(n);return o.jsx(hA,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:o.jsx(Q.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});fw.displayName=uw;var mw="TabsTrigger",pw=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,a=Sm(mw,n),l=cw(n),c=vw(a.baseId,r),d=xw(a.baseId,r),u=r===a.value;return o.jsx(gA,{asChild:!0,...l,focusable:!s,active:u,children:o.jsx(Q.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:t,onMouseDown:K(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?a.onValueChange(r):f.preventDefault()}),onKeyDown:K(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(r)}),onFocus:K(e.onFocus,()=>{const f=a.activationMode!=="manual";!u&&!s&&f&&a.onValueChange(r)})})})});pw.displayName=mw;var hw="TabsContent",gw=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=e,l=Sm(hw,n),c=vw(l.baseId,r),d=xw(l.baseId,r),u=r===l.value,f=h.useRef(u);return h.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),o.jsx(Kn,{present:s||u,children:({present:p})=>o.jsx(Q.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:d,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&i})})});gw.displayName=hw;function vw(e,t){return`${e}-trigger-${t}`}function xw(e,t){return`${e}-content-${t}`}var yA=dw,yw=fw,bw=pw,ww=gw;const Sw=yA,Nm=h.forwardRef(({className:e,...t},n)=>o.jsx(yw,{ref:n,className:$("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Nm.displayName=yw.displayName;const Ws=h.forwardRef(({className:e,...t},n)=>o.jsx(bw,{ref:n,className:$("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Ws.displayName=bw.displayName;const Hs=h.forwardRef(({className:e,...t},n)=>o.jsx(ww,{ref:n,className:$("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Hs.displayName=ww.displayName;const Nw=h.forwardRef(({className:e,...t},n)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:n,className:$("w-full caption-bottom text-sm",e),...t})}));Nw.displayName="Table";const kw=h.forwardRef(({className:e,...t},n)=>o.jsx("thead",{ref:n,className:$("[&_tr]:border-b",e),...t}));kw.displayName="TableHeader";const jw=h.forwardRef(({className:e,...t},n)=>o.jsx("tbody",{ref:n,className:$("[&_tr:last-child]:border-0",e),...t}));jw.displayName="TableBody";const bA=h.forwardRef(({className:e,...t},n)=>o.jsx("tfoot",{ref:n,className:$("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));bA.displayName="TableFooter";const Fu=h.forwardRef(({className:e,...t},n)=>o.jsx("tr",{ref:n,className:$("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Fu.displayName="TableRow";const zu=h.forwardRef(({className:e,...t},n)=>o.jsx("th",{ref:n,className:$("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));zu.displayName="TableHead";const Bu=h.forwardRef(({className:e,...t},n)=>o.jsx("td",{ref:n,className:$("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Bu.displayName="TableCell";const wA=h.forwardRef(({className:e,...t},n)=>o.jsx("caption",{ref:n,className:$("mt-4 text-sm text-muted-foreground",e),...t}));wA.displayName="TableCaption";const SA={low:"bg-primary text-primary-foreground",medium:"bg-warning text-primary-foreground",high:"bg-destructive text-destructive-foreground"},NA={best:"border-primary/50",likely:"border-secondary",worst:"border-warning",tail:"border-destructive"},kA={best:"text-primary",likely:"text-secondary-foreground",worst:"text-warning",tail:"text-destructive"},ng={positive:{color:"bg-primary",label:"+"},neutral:{color:"bg-muted-foreground",label:"○"},negative:{color:"bg-destructive",label:"−"}},jA=({result:e})=>o.jsx("section",{className:"border-t border-border py-12",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs(Sw,{defaultValue:"paths",className:"mx-auto max-w-5xl",children:[o.jsxs(Nm,{className:"mb-8 w-full justify-start",children:[o.jsx(Ws,{value:"paths",children:"Reasoning Paths"}),o.jsx(Ws,{value:"matrix",children:"Strategy Matrix"}),o.jsx(Ws,{value:"outcomes",children:"Projected Outcomes"})]}),o.jsx(Hs,{value:"paths",children:o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.paths.map((t,n)=>o.jsxs(Te,{className:`animate-fade-in-up border-border ${t.recommended?"border-primary glow-teal":""}`,style:{animationDelay:`${n*100}ms`},children:[o.jsx(Xe,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs(Je,{className:"text-base",children:[t.name,t.recommended&&o.jsx("span",{className:"ml-2 text-xs font-normal text-primary",children:"★ Recommended"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"text-sm font-mono text-primary",children:[t.probability,"%"]}),o.jsx(Re,{className:SA[t.riskLevel],children:t.riskLevel})]})]})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:t.description}),o.jsxs("div",{children:[o.jsx("p",{className:"mb-1.5 text-xs font-medium text-foreground",children:"Key Tradeoffs:"}),o.jsx("ul",{className:"space-y-1",children:t.tradeoffs.map((r,s)=>o.jsxs("li",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[o.jsx("span",{className:"mt-1 h-1 w-1 shrink-0 rounded-full bg-muted-foreground"}),r]},s))})]})]})]},n))})}),o.jsx(Hs,{value:"matrix",children:o.jsx(Te,{className:"border-border",children:o.jsx(Ae,{className:"pt-6",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(Nw,{children:[o.jsx(kw,{children:o.jsxs(Fu,{children:[o.jsx(zu,{className:"text-foreground",children:"Stakeholder"}),e.matrix.strategies.map((t,n)=>o.jsx(zu,{className:"text-center text-foreground",children:t},n))]})}),o.jsx(jw,{children:e.matrix.stakeholders.map((t,n)=>o.jsxs(Fu,{children:[o.jsx(Bu,{className:"font-medium text-foreground",children:t}),e.matrix.reactions[n].map((r,s)=>o.jsx(Bu,{className:"text-center",children:o.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[o.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${ng[r].color}`}),o.jsx("span",{className:"text-xs text-muted-foreground",children:ng[r].label})]})},s))]},n))})]})})})})}),o.jsx(Hs,{value:"outcomes",children:o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.outcomes.map((t,n)=>o.jsxs(Te,{className:`animate-fade-in-up border-l-4 ${NA[t.type]}`,style:{animationDelay:`${n*100}ms`},children:[o.jsx(Xe,{className:"pb-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Je,{className:"text-base",children:t.label}),o.jsxs("span",{className:`text-sm font-mono ${kA[t.type]}`,children:[t.likelihood,"%"]})]})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-2 text-xs text-muted-foreground italic",children:t.conditions}),o.jsx("p",{className:"mb-3 text-sm text-foreground",children:t.description}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Impact"}),o.jsx("div",{className:"flex gap-0.5",children:Array.from({length:10}).map((r,s)=>o.jsx("div",{className:`h-2 w-2 rounded-sm ${s<t.impactRating?"bg-primary":"bg-muted"}`},s))}),o.jsxs("span",{className:"text-xs font-mono text-primary",children:[t.impactRating,"/10"]})]})]})]},n))})})]})})}),CA={low:"bg-muted text-muted-foreground",medium:"bg-secondary text-secondary-foreground",high:"bg-warning text-primary-foreground",critical:"bg-destructive text-destructive-foreground"},EA=({challenges:e})=>o.jsx("section",{className:"border-t border-border py-12",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl",children:[o.jsx("h2",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Your assumptions were challenged"}),o.jsx("div",{className:"space-y-4",children:e.map((t,n)=>o.jsx(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:o.jsxs(Ae,{className:"pt-6",children:[o.jsxs("div",{className:"mb-3 flex items-start justify-between gap-4",children:[o.jsx("h4",{className:"font-semibold text-foreground",children:t.assumption}),o.jsx(Re,{className:CA[t.severity],children:t.severity})]}),o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-muted-foreground",children:"Why it might not hold: "}),o.jsx("span",{className:"text-foreground",children:t.whyItMightFail})]}),o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-muted-foreground",children:"What changes if you're wrong: "}),o.jsx("span",{className:"text-foreground",children:t.whatChanges})]})]})]})},n))})]})})}),_A=({recommendations:e})=>o.jsx("section",{className:"border-t border-border py-12",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl",children:[o.jsx("h2",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Recommendations"}),o.jsx("div",{className:"space-y-4",children:e.map((t,n)=>o.jsx(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:o.jsxs(Ae,{className:"flex gap-5 pt-6",children:[o.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary text-lg font-bold text-primary-foreground",children:t.priority}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"mb-1 font-semibold text-foreground",children:t.action}),o.jsx("p",{className:"mb-2 text-sm text-muted-foreground",children:t.rationale}),o.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:t.timeframe})]})]})},n))})]})})});var fc="Switch",[RA,o4]=zt(fc),[PA,TA]=RA(fc),Cw=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:l,value:c="on",onCheckedChange:d,form:u,...f}=e,[p,m]=h.useState(null),y=ie(t,w=>m(w)),g=h.useRef(!1),b=p?u||!!p.closest("form"):!0,[x,v]=Un({prop:s,defaultProp:i??!1,onChange:d,caller:fc});return o.jsxs(PA,{scope:n,checked:x,disabled:l,children:[o.jsx(Q.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":Pw(x),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:y,onClick:K(e.onClick,w=>{v(S=>!S),b&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})}),b&&o.jsx(Rw,{control:p,bubbles:!g.current,name:r,value:c,checked:x,required:a,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});Cw.displayName=fc;var Ew="SwitchThumb",_w=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=TA(Ew,n);return o.jsx(Q.span,{"data-state":Pw(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});_w.displayName=Ew;var AA="SwitchBubbleInput",Rw=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const a=h.useRef(null),l=ie(a,i),c=xm(n),d=sm(t);return h.useEffect(()=>{const u=a.current;if(!u)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&m){const y=new Event("click",{bubbles:r});m.call(u,n),u.dispatchEvent(y)}},[c,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Rw.displayName=AA;function Pw(e){return e?"checked":"unchecked"}var Tw=Cw,IA=_w;const mc=h.forwardRef(({className:e,...t},n)=>o.jsx(Tw,{className:$("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:o.jsx(IA,{className:$("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));mc.displayName=Tw.displayName;const MA={low:"bg-primary/20 text-primary",moderate:"bg-warning/20 text-warning",high:"bg-destructive/20 text-destructive",critical:"bg-destructive text-destructive-foreground"},OA=({goalResult:e,onForkStrategy:t})=>{var y;const[n,r]=h.useState(null),[s,i]=h.useState(null),[a,l]=h.useState({}),[c,d]=h.useState({}),u=g=>{r(n===g?null:g)},f=g=>{i(s===g.id?null:g.id);const b={};g.levers_used.forEach(x=>{b[x]=!0}),l(b)},p=g=>{const b=Object.entries(a).filter(([,x])=>x).map(([x])=>x);t==null||t(g,b),i(null)},m=g=>e.swarm_tests.find(b=>b.strategy_id===g);return o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-5xl",children:[o.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[o.jsx("h2",{className:"text-2xl font-bold tracking-tight text-foreground",children:"Strategy Lab"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Recommended: ",o.jsx("span",{className:"text-primary font-medium",children:(y=e.strategies.find(g=>g.id===e.recommended_strategy_id))==null?void 0:y.label})]})]}),o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.strategies.map(g=>{const b=m(g.id),x=g.id===e.recommended_strategy_id,v=c[g.id]||"overview";return o.jsxs(Te,{className:$("border-border transition-all",x&&"border-primary glow-teal"),children:[o.jsx(Xe,{className:"pb-2",children:o.jsx("div",{className:"flex items-start justify-between gap-2",children:o.jsxs("div",{children:[o.jsxs(Je,{className:"text-base",children:[g.label,x&&o.jsx("span",{className:"ml-2 text-xs text-primary",children:"★"})]}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[o.jsxs("span",{className:"text-xs font-mono text-primary",children:[(g.success_probability*100).toFixed(0),"% success"]}),o.jsxs(Re,{className:MA[g.risk],children:[g.risk," risk"]}),g.red_line_violations.length>0&&o.jsx(Re,{variant:"destructive",className:"text-[10px]",children:"RED LINE"})]})]})})}),o.jsxs(Ae,{className:"space-y-3",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:g.description}),o.jsxs(Sw,{value:v,onValueChange:w=>d(S=>({...S,[g.id]:w})),children:[o.jsxs(Nm,{className:"h-8 w-full",children:[o.jsx(Ws,{value:"overview",className:"text-xs flex-1",children:"Overview"}),o.jsxs(Ws,{value:"timeline",className:"text-xs flex-1",children:[o.jsx(Gf,{className:"mr-1 h-3 w-3"}),"Timeline"]})]}),o.jsxs(Hs,{value:"overview",className:"mt-3 space-y-2",children:[o.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"Levers:"})," ",g.levers_used.join(", ")]}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"Timeframe:"})," ",g.estimated_timeframe]}),b&&o.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"Swarm result:"})," ",b.goal_reached?"Goal reached":`${(b.goal_proximity*100).toFixed(0)}% proximity`]})]}),o.jsx(Hs,{value:"timeline",className:"mt-3",children:o.jsx("div",{className:"relative ml-3 border-l border-border pl-4",children:g.steps.map(w=>o.jsxs("div",{className:"relative mb-4 last:mb-0",children:[o.jsx("div",{className:"absolute -left-[21px] top-1 h-3 w-3 rounded-full border-2 border-primary bg-background"}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:w.timeframe}),o.jsx("p",{className:"text-xs font-medium text-foreground",children:w.action}),o.jsxs("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["Lever: ",w.lever," · Effect: ",w.expected_effect]})]},w.order))})})]}),o.jsxs("div",{className:"flex gap-2 pt-1",children:[o.jsxs(re,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>u(g.id),children:[o.jsx(Kl,{className:"mr-1 h-3 w-3"}),n===g.id?"HIDE":"SHOW WHY"]}),o.jsxs(re,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>f(g),children:[o.jsx(Ao,{className:"mr-1 h-3 w-3"}),"FORK STRATEGY"]})]}),n===g.id&&o.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3 animate-in fade-in-0 slide-in-from-top-1",children:[o.jsx("h4",{className:"mb-2 text-xs font-semibold text-foreground",children:"Why this strategy?"}),o.jsxs("div",{className:"space-y-2 text-xs text-muted-foreground",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Drivers:"})," ",g.dependencies.join("; ")]}),o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Failure modes:"})," ",g.failure_modes.join("; ")]}),g.likely_allies&&g.likely_allies.length>0&&o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Allies:"})," ",g.likely_allies.join(", ")]}),g.likely_opponents&&g.likely_opponents.length>0&&o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Opponents:"})," ",g.likely_opponents.join(", ")]})]})]}),s===g.id&&o.jsxs("div",{className:"rounded-md border border-primary/30 bg-primary/5 p-3 animate-in fade-in-0 slide-in-from-top-1",children:[o.jsx("h4",{className:"mb-2 text-xs font-semibold text-foreground",children:"Toggle Levers"}),o.jsx("div",{className:"space-y-2",children:g.levers_used.map(w=>o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-xs text-foreground",children:w}),o.jsx(mc,{checked:a[w]??!0,onCheckedChange:S=>l(N=>({...N,[w]:S}))})]},w))}),o.jsx(re,{size:"sm",className:"mt-3 w-full text-xs",onClick:()=>p(g.id),children:"RUN NEW PATH"})]})]})]},g.id)})}),o.jsxs("div",{className:"mt-6 rounded-lg border border-border bg-card p-4",children:[o.jsx("p",{className:"text-sm text-foreground",children:e.recommendation_rationale}),o.jsxs("p",{className:"mt-2 text-xs text-primary font-medium",children:["Immediate next step: ",e.immediate_next_step]})]})]})})})},LA=["Key stakeholder defects from coalition","Unexpected regulatory announcement","Media leak reveals strategy details","Major competitor makes aggressive move","Economic shock changes market conditions","New ally emerges with aligned interests"],$A=({strategy:e,onInjectEvent:t,forkedTimeline:n})=>{const[r,s]=h.useState(0),[i,a]=h.useState(""),[l,c]=h.useState(!1),d=e.steps.length-1,u=h.useCallback(()=>{i.trim()&&(t==null||t({atStep:r,event:i.trim()}),a(""))},[i,r,t]);return o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl",children:[o.jsx("h2",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Decision Time Machine"}),o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsxs(Je,{className:"flex items-center gap-2 text-base",children:[o.jsx(Qr,{className:"h-4 w-4 text-primary"}),"Timeline: ",e.label]})}),o.jsxs(Ae,{className:"space-y-6",children:[o.jsxs("div",{className:"relative ml-3 border-l-2 border-border pl-6",children:[e.steps.map((f,p)=>o.jsxs("div",{className:`relative mb-6 last:mb-0 transition-opacity ${n&&p>n.injectedEvent.atStep?"opacity-40":""}`,children:[o.jsx("div",{className:`absolute -left-[29px] top-1 h-4 w-4 rounded-full border-2 ${p===r?"border-primary bg-primary":p<=r?"border-primary bg-background":"border-muted-foreground bg-background"}`}),o.jsx("p",{className:"text-[10px] font-mono text-muted-foreground",children:f.timeframe}),o.jsx("p",{className:"text-sm font-medium text-foreground",children:f.action}),o.jsx("p",{className:"text-xs text-muted-foreground",children:f.expected_effect}),n&&p===n.injectedEvent.atStep&&o.jsxs("div",{className:"mt-2 flex items-start gap-2 rounded border border-warning/30 bg-warning/10 px-3 py-2",children:[o.jsx(Qr,{className:"mt-0.5 h-3 w-3 shrink-0 text-warning"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-bold text-warning",children:"EVENT INJECTED"}),o.jsx("p",{className:"text-xs text-foreground",children:n.injectedEvent.event})]})]})]},f.order)),n&&o.jsxs("div",{className:"mt-4 ml-4 border-l-2 border-primary/50 pl-6",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(Ao,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-xs font-bold text-primary",children:"FORKED TIMELINE"})]}),n.forkedSteps.map((f,p)=>o.jsxs("div",{className:"relative mb-4 last:mb-0",children:[o.jsx("div",{className:"absolute -left-[29px] top-1 h-3 w-3 rounded-full border-2 border-primary/50 bg-background"}),o.jsx("p",{className:"text-[10px] font-mono text-muted-foreground",children:f.timeframe}),o.jsx("p",{className:"text-sm font-medium text-foreground",children:f.action}),o.jsx("p",{className:"text-xs text-muted-foreground",children:f.expected_effect})]},p)),o.jsxs("div",{className:"mt-3 flex gap-3",children:[o.jsxs(Re,{variant:"outline",className:n.probabilityDelta>=0?"border-primary/30 text-primary":"border-destructive/30 text-destructive",children:["Success: ",n.probabilityDelta>=0?"+":"",(n.probabilityDelta*100).toFixed(0),"%"]}),o.jsxs(Re,{variant:"outline",children:["Risk: ",n.riskDelta]})]})]})]}),o.jsxs("div",{children:[o.jsxs("label",{className:"mb-2 block text-xs font-medium text-muted-foreground",children:["Time Scrubber — Step ",r+1," of ",d+1]}),o.jsx(bm,{value:[r],onValueChange:f=>s(f[0]),min:0,max:d,step:1})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(Qr,{className:"h-4 w-4 text-warning"}),o.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Inject Event at Step ",r+1]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(jt,{placeholder:"What happens at this point?",value:i,onChange:f=>a(f.target.value),onKeyDown:f=>f.key==="Enter"&&u()}),o.jsx(re,{size:"sm",onClick:u,disabled:!i.trim(),children:"RUN FROM HERE"})]}),o.jsxs(re,{size:"sm",variant:"ghost",className:"mt-2 text-xs",onClick:()=>c(!l),children:[o.jsx(Kf,{className:"mr-1 h-3 w-3"}),"SUGGEST EVENTS"]}),l&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5 animate-in fade-in-0",children:LA.map((f,p)=>o.jsx("button",{onClick:()=>{a(f),c(!1)},className:"rounded-full border border-border px-3 py-1 text-[10px] text-muted-foreground hover:border-primary/50 hover:text-foreground transition-colors",children:f},p))})]})]})]})]})})})},DA=({request:e,title:t})=>{const[n,r]=h.useState(null),[s,i]=h.useState(!1),a=h.useCallback(()=>{const c=x_(t,e),d=w_(c);r(d)},[e,t]),l=h.useCallback(async()=>{n&&(await navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2e3))},[n]);return o.jsx("div",{className:"inline-flex flex-col items-start gap-2",children:n?o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(jt,{value:n,readOnly:!0,className:"w-[320px] text-xs font-mono",onClick:c=>c.target.select()}),o.jsx(re,{size:"icon",variant:"outline",onClick:l,children:s?o.jsx(Hf,{className:"h-4 w-4 text-primary"}):o.jsx(E0,{className:"h-4 w-4"})})]}):o.jsxs(re,{size:"sm",variant:"outline",onClick:a,className:"text-xs",children:[o.jsx(IC,{className:"mr-1.5 h-3.5 w-3.5"}),"SHARE SCENARIO"]})})};var pc="Collapsible",[FA,a4]=zt(pc),[zA,km]=FA(pc),Aw=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...l}=e,[c,d]=Un({prop:r,defaultProp:s??!1,onChange:a,caller:pc});return o.jsx(zA,{scope:n,disabled:i,contentId:fs(),open:c,onOpenToggle:h.useCallback(()=>d(u=>!u),[d]),children:o.jsx(Q.div,{"data-state":Cm(c),"data-disabled":i?"":void 0,...l,ref:t})})});Aw.displayName=pc;var Iw="CollapsibleTrigger",Mw=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=km(Iw,n);return o.jsx(Q.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Cm(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:K(e.onClick,s.onOpenToggle)})});Mw.displayName=Iw;var jm="CollapsibleContent",Ow=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=km(jm,e.__scopeCollapsible);return o.jsx(Kn,{present:n||s.open,children:({present:i})=>o.jsx(BA,{...r,ref:t,present:i})})});Ow.displayName=jm;var BA=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,a=km(jm,n),[l,c]=h.useState(r),d=h.useRef(null),u=ie(t,d),f=h.useRef(0),p=f.current,m=h.useRef(0),y=m.current,g=a.open||l,b=h.useRef(g),x=h.useRef(void 0);return h.useEffect(()=>{const v=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(v)},[]),Ve(()=>{const v=d.current;if(v){x.current=x.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();f.current=w.height,m.current=w.width,b.current||(v.style.transitionDuration=x.current.transitionDuration,v.style.animationName=x.current.animationName),c(r)}},[a.open,r]),o.jsx(Q.div,{"data-state":Cm(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!g,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:g&&s})});function Cm(e){return e?"open":"closed"}var VA=Aw;const yn=VA,bn=Mw,wn=Ow,UA=({governance:e})=>{const[t,n]=h.useState(!1),r=e.constitutionalChecks.every(c=>c.passed),s=e.constitutionalChecks.filter(c=>!c.passed),i=e.neuroverse,a=(i==null?void 0:i.guardStatus)==="BLOCK"||s.length>0,l=(i==null?void 0:i.guardStatus)==="PAUSE";return o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl space-y-3",children:[(a||l)&&o.jsxs("div",{className:$("rounded-lg border-2 px-5 py-4 flex items-start gap-3",a?"border-red-500/50 bg-red-500/10":"border-yellow-500/50 bg-yellow-500/10"),children:[a?o.jsx(AC,{className:"h-5 w-5 text-red-400 shrink-0 mt-0.5"}):o.jsx(kr,{className:"h-5 w-5 text-yellow-400 shrink-0 mt-0.5"}),o.jsxs("div",{className:"space-y-2 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:$("inline-flex items-center rounded px-2 py-0.5 text-xs font-bold uppercase tracking-wider",a?"bg-red-500/20 text-red-400":"bg-yellow-500/20 text-yellow-400"),children:a?"BLOCK":"PAUSE"}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:"Governance Intervention Active"})]}),s.map(c=>o.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[o.jsxs("span",{className:"font-mono text-xs text-red-400/70 mt-0.5",children:["[",c.ruleId,"]"]}),o.jsx("span",{className:"text-foreground/90",children:c.rule}),c.detail&&o.jsxs("span",{className:"text-muted-foreground",children:["— ",c.detail]})]},c.ruleId)),(i==null?void 0:i.guardStatus)==="BLOCK"&&s.length===0&&o.jsx("p",{className:"text-sm text-foreground/90",children:"Liquidity floor violated — impacts capped by governance rules"}),(i==null?void 0:i.collapseRisk)&&i.collapseRisk!=="none"&&o.jsxs("p",{className:"text-xs text-muted-foreground",children:["System risk: ",o.jsx("span",{className:$("font-medium",i.collapseRisk==="high"?"text-red-400":i.collapseRisk==="moderate"?"text-yellow-400":"text-emerald-400"),children:i.collapseRisk}),i.worldHealthScore!==void 0&&o.jsxs(o.Fragment,{children:[" · Stability: ",i.worldHealthScore,"%"]})]})]})]}),o.jsxs(yn,{open:t,onOpenChange:n,children:[o.jsxs(bn,{className:"flex w-full items-center justify-between rounded-lg border border-border bg-card px-5 py-4 text-left transition-colors hover:bg-muted/50",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[r?o.jsx(qi,{className:"h-5 w-5 text-primary"}):o.jsx(Yl,{className:"h-5 w-5 text-destructive"}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Rules & Constraints"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.constitutionalChecks.length," rules checked · Status: ",e.authorityLevel.replace(/_/g," "),i&&o.jsxs(o.Fragment,{children:[" · Permission: ",o.jsx("span",{className:$("font-medium",i.guardStatus==="ALLOW"?"text-emerald-400":i.guardStatus==="BLOCK"?"text-red-400":"text-yellow-400"),children:i.guardStatus})]})]})]})]}),o.jsx(gt,{className:$("h-4 w-4 text-muted-foreground transition-transform duration-200",t&&"rotate-180")})]}),o.jsxs(wn,{className:"mt-3 space-y-4 animate-in fade-in-0 slide-in-from-top-2",children:[o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[{icon:CC,label:"Request ID",value:e.traceId.slice(0,12)+"…"},{icon:qi,label:"Permission",value:e.authorityLevel.replace(/_/g," ")},{icon:Gf,label:"Timestamp",value:new Date(e.timestamp).toLocaleTimeString()},{icon:qi,label:"Version",value:`v${e.engineVersion}`}].map(c=>o.jsxs("div",{className:"rounded-md border border-border bg-card p-3",children:[o.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(c.icon,{className:"h-3 w-3"}),c.label]}),o.jsx("p",{className:"mt-1 text-xs font-medium text-foreground",children:c.value})]},c.label))}),o.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[o.jsx("div",{className:"border-b border-border px-4 py-2.5",children:o.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Safety Rules"})}),o.jsx("div",{className:"divide-y divide-border",children:e.constitutionalChecks.map(c=>o.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[o.jsx("span",{className:$("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-bold",c.passed?"bg-primary/20 text-primary":"bg-destructive/20 text-destructive"),children:c.passed?"✓":"✗"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:c.rule}),c.detail&&o.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:c.detail}),o.jsx("span",{className:"mt-1 inline-block rounded bg-muted px-1.5 py-0.5 text-[10px] font-mono text-muted-foreground",children:c.ruleId})]})]},c.ruleId))})]}),e.enforcedConstraints.length>0&&o.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[o.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Active Rules"}),o.jsx("ul",{className:"space-y-1.5",children:e.enforcedConstraints.map((c,d)=>o.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[o.jsx("span",{className:"mt-1 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),c]},d))})]})]})]})]})})})},WA=({report:e,governance:t,isGenerating:n,aiEnabled:r,provider:s,onGenerate:i,onToggleAI:a})=>{const[l,c]=h.useState(!1),d=()=>{if(!e)return;const f=rg(e);navigator.clipboard.writeText(f),c(!0),setTimeout(()=>c(!1),2e3)},u=()=>{if(!e)return;const f=rg(e),p=new Blob([f],{type:"text/markdown"}),m=URL.createObjectURL(p),y=document.createElement("a");y.href=m,y.download="governed-report.md",y.click(),URL.revokeObjectURL(m)};return o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(rs,{className:"h-5 w-5 text-primary"}),o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Governed Report"}),t&&o.jsxs("span",{className:$("inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",t.trace.passed?"bg-emerald-500/20 text-emerald-400":"bg-yellow-500/20 text-yellow-400"),children:[o.jsx(jn,{className:"h-3 w-3"}),t.trace.passed?"Governed":"Violations"]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"AI Assist"}),o.jsx(mc,{checked:r,onCheckedChange:a})]}),o.jsx(re,{variant:"outline",size:"sm",onClick:i,disabled:n,className:"gap-2",children:n?o.jsxs(o.Fragment,{children:[o.jsx(xu,{className:"h-3 w-3 animate-pulse"}),"Generating..."]}):o.jsxs(o.Fragment,{children:[o.jsx(rs,{className:"h-3 w-3"}),"Generate Report"]})})]})]}),e&&o.jsxs("div",{className:"space-y-4 animate-in fade-in-0 slide-in-from-top-2",children:[t&&o.jsx("div",{className:$("rounded-md border px-4 py-3 text-xs",t.trace.passed?"border-emerald-500/30 bg-emerald-500/5":"border-yellow-500/30 bg-yellow-500/5"),children:o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(jn,{className:"h-3 w-3"}),o.jsxs("span",{children:["Actor: ",o.jsx("span",{className:"text-foreground font-mono",children:t.actor})," · ","Action: ",o.jsx("span",{className:"text-foreground font-mono",children:t.action})," · ","Provider: ",o.jsx("span",{className:"text-foreground font-medium",children:s})," · ","Constraints: ",t.trace.constraints.length," checked",t.trace.violations.length>0&&o.jsxs("span",{className:"text-yellow-400",children:[" · ",t.trace.violations.length," violation(s)"]})]})]})}),o.jsxs("div",{className:"rounded-lg border border-border bg-card p-5",children:[o.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Executive Summary"}),o.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:e.executiveSummary})]}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.keyEvents.length>0&&o.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[o.jsx("h4",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Key Events"}),o.jsx("div",{className:"space-y-2",children:e.keyEvents.map((f,p)=>o.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[o.jsxs("span",{className:$("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-[10px] font-bold",f.severity==="critical"?"bg-red-500/20 text-red-400":f.severity==="high"?"bg-orange-500/20 text-orange-400":"bg-yellow-500/20 text-yellow-400"),children:["R",f.round]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-foreground/90",children:f.description}),o.jsx("p",{className:"text-xs text-muted-foreground",children:f.agents.join(", ")})]})]},p))})]}),e.governanceActions.length>0&&o.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[o.jsx("h4",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Governance Actions"}),o.jsx("div",{className:"space-y-2",children:e.governanceActions.map((f,p)=>o.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[o.jsx("span",{className:$("mt-0.5 shrink-0 rounded px-1.5 py-0.5 text-[10px] font-bold uppercase",f.type==="BLOCK"?"bg-red-500/20 text-red-400":f.type==="PAUSE"?"bg-yellow-500/20 text-yellow-400":f.type==="CIRCUIT_BREAKER"?"bg-purple-500/20 text-purple-400":"bg-blue-500/20 text-blue-400"),children:f.type}),o.jsxs("div",{children:[o.jsx("p",{className:"text-foreground/90",children:f.description}),o.jsx("p",{className:"text-xs text-muted-foreground",children:f.agent})]})]},p))})]})]}),o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-5",children:[{label:"Volatility",value:e.metrics.volatilityReduction},{label:"Collapse Risk",value:e.metrics.collapseRisk},{label:"Stability",value:e.metrics.stabilityScore},{label:"Interventions",value:String(e.metrics.interventionCount)},{label:"Blocked",value:String(e.metrics.blockedActions)}].map(f=>o.jsxs("div",{className:"rounded-md border border-border bg-card p-3 text-center",children:[o.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:f.label}),o.jsx("p",{className:"mt-1 text-sm font-bold text-foreground",children:f.value})]},f.label))}),e.counterfactual&&o.jsxs("div",{className:"rounded-lg border border-dashed border-yellow-500/30 bg-yellow-500/5 p-4",children:[o.jsx("h4",{className:"mb-1 text-xs font-semibold uppercase tracking-wider text-yellow-400/80",children:"Counterfactual"}),o.jsx("p",{className:"text-sm text-foreground/80 italic",children:e.counterfactual})]}),e.observations.length>0&&o.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[o.jsx("h4",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Observations"}),o.jsx("ul",{className:"space-y-1.5",children:e.observations.map((f,p)=>o.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground/90",children:[o.jsx("span",{className:"mt-1 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),f]},p))})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(re,{variant:"ghost",size:"sm",onClick:d,className:"gap-2 text-xs",children:[l?o.jsx(ns,{className:"h-3 w-3 text-emerald-400"}):o.jsx(E0,{className:"h-3 w-3"}),l?"Copied":"Copy"]}),o.jsxs(re,{variant:"ghost",size:"sm",onClick:u,className:"gap-2 text-xs",children:[o.jsx(_0,{className:"h-3 w-3"}),"Download .md"]}),o.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["Generated by ",o.jsx("span",{className:"font-medium text-foreground",children:e.generatedBy})," · Governed by ",o.jsx("span",{className:"font-medium text-foreground",children:e.governedBy})]})]})]})]})})})};function rg(e){const t=[];if(t.push(`# Governed Simulation Report
|
|
494
|
-
`),t.push(`> Generated by: ${e.generatedBy} | Governed by: ${e.governedBy}
|
|
495
|
-
`),t.push(`## Executive Summary
|
|
496
|
-
`),t.push(e.executiveSummary+`
|
|
497
|
-
`),e.keyEvents.length>0){t.push(`## Key Events
|
|
498
|
-
`);for(const n of e.keyEvents)t.push(`- **Round ${n.round}** [${n.severity}]: ${n.description} (${n.agents.join(", ")})`);t.push("")}if(e.governanceActions.length>0){t.push(`## Governance Actions
|
|
499
|
-
`);for(const n of e.governanceActions)t.push(`- **[${n.type}]** ${n.agent}: ${n.description}`);t.push("")}if(t.push(`## Metrics
|
|
500
|
-
`),t.push("| Metric | Value |"),t.push("|--------|-------|"),t.push(`| Volatility | ${e.metrics.volatilityReduction} |`),t.push(`| Collapse Risk | ${e.metrics.collapseRisk} |`),t.push(`| Stability | ${e.metrics.stabilityScore} |`),t.push(`| Interventions | ${e.metrics.interventionCount} |`),t.push(`| Blocked Actions | ${e.metrics.blockedActions} |`),t.push(""),e.counterfactual&&(t.push(`## Counterfactual
|
|
501
|
-
`),t.push(`> ${e.counterfactual}
|
|
502
|
-
`)),e.observations.length>0){t.push(`## Observations
|
|
503
|
-
`);for(const n of e.observations)t.push(`- ${n}`);t.push("")}return t.join(`
|
|
504
|
-
`)}const Lw={error:{icon:To,color:"text-red-400",bg:"bg-red-500/5",border:"border-red-500/20",label:"Error",badgeBg:"bg-red-500/20 text-red-400"},warning:{icon:kr,color:"text-yellow-400",bg:"bg-yellow-500/5",border:"border-yellow-500/20",label:"Warning",badgeBg:"bg-yellow-500/20 text-yellow-400"},info:{icon:P0,color:"text-blue-400",bg:"bg-blue-500/5",border:"border-blue-500/20",label:"Info",badgeBg:"bg-blue-500/20 text-blue-400"},hint:{icon:Kf,color:"text-muted-foreground",bg:"bg-muted/30",border:"border-border",label:"Hint",badgeBg:"bg-muted text-muted-foreground"}},$w={conflict:"Rule Conflicts",coverage:"Coverage Gaps",strength:"Enforcement Strength",constraint:"Constraint Balance",structure:"Structure"};function HA({counts:e}){return o.jsxs("div",{className:"flex items-center gap-4 rounded-md border border-border bg-muted/50 px-4 py-2 font-mono text-xs",children:[o.jsx("span",{className:"text-muted-foreground uppercase tracking-wider",children:"Problems"}),o.jsxs("div",{className:"flex items-center gap-3",children:[e.errors>0&&o.jsxs("span",{className:"flex items-center gap-1 text-red-400",children:[o.jsx(To,{className:"h-3.5 w-3.5"}),e.errors]}),e.warnings>0&&o.jsxs("span",{className:"flex items-center gap-1 text-yellow-400",children:[o.jsx(kr,{className:"h-3.5 w-3.5"}),e.warnings]}),e.info>0&&o.jsxs("span",{className:"flex items-center gap-1 text-blue-400",children:[o.jsx(P0,{className:"h-3.5 w-3.5"}),e.info]}),e.hints>0&&o.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[o.jsx(Kf,{className:"h-3.5 w-3.5"}),e.hints]}),e.errors===0&&e.warnings===0&&e.info===0&&e.hints===0&&o.jsx("span",{className:"text-green-400",children:"No problems detected"})]})]})}function GA({diagnostic:e,policyText:t,onApplyFix:n,isFixed:r}){const[s,i]=h.useState(!1),a=Lw[e.severity],l=a.icon;let c=null;if(e.source&&t){const u=t.split(`
|
|
505
|
-
`),f=e.source.startLine-1;f>=0&&f<u.length&&(c=u[f].trim())}const d=e.quickFix;return o.jsx(yn,{open:s,onOpenChange:i,children:o.jsxs("div",{className:$("rounded-lg border transition-colors",r?"border-green-500/30 bg-green-500/5":a.border,!r&&a.bg,s&&"ring-1 ring-primary/20"),children:[o.jsxs(bn,{className:"flex w-full items-start gap-3 px-4 py-3 text-left",children:[r?o.jsx(ns,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-400"}):o.jsx(l,{className:$("mt-0.5 h-4 w-4 shrink-0",a.color)}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:$("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider",r?"bg-green-500/20 text-green-400":a.badgeBg),children:e.id}),o.jsx("span",{className:$("text-sm font-medium",r?"text-green-400 line-through opacity-70":"text-foreground"),children:e.message}),r&&o.jsx("span",{className:"text-[10px] font-bold uppercase text-green-400",children:"Fixed"})]}),e.source&&!r&&o.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(rs,{className:"h-3 w-3"}),o.jsxs("span",{children:["Line ",e.source.startLine,e.source.endLine!==e.source.startLine&&`–${e.source.endLine}`]}),e.relatedRules.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(PC,{className:"ml-2 h-3 w-3"}),o.jsx("span",{children:e.relatedRules.join(", ")})]})]})]}),d&&!r&&n&&o.jsxs(re,{size:"sm",variant:"outline",className:"shrink-0 gap-1.5 border-green-500/30 bg-green-500/10 text-green-400 hover:bg-green-500/20 hover:text-green-300",onClick:u=>{u.stopPropagation(),n(d,e.id)},children:[o.jsx(yu,{className:"h-3 w-3"}),d.label]}),!r&&(s?o.jsx(gt,{className:"mt-1 h-4 w-4 shrink-0 text-muted-foreground"}):o.jsx($n,{className:"mt-1 h-4 w-4 shrink-0 text-muted-foreground"}))]}),!r&&o.jsx(wn,{children:o.jsxs("div",{className:"space-y-3 border-t border-border/50 px-4 py-3",children:[o.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:e.detail}),c&&o.jsxs("div",{className:"rounded-md border border-border bg-background/80 p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(rs,{className:"h-3 w-3"}),o.jsxs("span",{children:["policy.txt:",e.source.startLine]})]}),o.jsx("pre",{className:"mt-1.5 overflow-x-auto text-xs",children:o.jsxs("code",{children:[o.jsxs("span",{className:"select-none text-muted-foreground/50",children:[e.source.startLine," │"," "]}),o.jsx("span",{className:$(e.severity==="error"&&"bg-red-500/10 text-red-300",e.severity==="warning"&&"bg-yellow-500/10 text-yellow-300",e.severity==="info"&&"text-foreground",e.severity==="hint"&&"text-muted-foreground"),children:c})]})})]}),d&&o.jsxs("div",{className:"space-y-2 rounded-md border border-green-500/20 bg-green-500/5 px-3 py-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(vh,{className:"h-3.5 w-3.5 shrink-0 text-green-400"}),o.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-green-400",children:"Quick Fix"})]}),o.jsxs("div",{className:"rounded border border-green-500/10 bg-background/50 px-2.5 py-2 font-mono text-xs",children:[d.operation==="insert"&&o.jsx("div",{className:"space-y-0.5",children:d.text.split(`
|
|
506
|
-
`).map((u,f)=>o.jsxs("div",{className:"text-green-400",children:[o.jsx("span",{className:"select-none text-green-600",children:"+ "}),u]},f))}),d.operation==="replace"&&o.jsxs("div",{className:"space-y-0.5",children:[c&&o.jsxs("div",{className:"text-red-400",children:[o.jsx("span",{className:"select-none text-red-600",children:"- "}),c]}),d.text.split(`
|
|
507
|
-
`).map((u,f)=>o.jsxs("div",{className:"text-green-400",children:[o.jsx("span",{className:"select-none text-green-600",children:"+ "}),u]},f))]}),d.operation==="remove"&&c&&o.jsxs("div",{className:"text-red-400",children:[o.jsx("span",{className:"select-none text-red-600",children:"- "}),c]})]}),n&&o.jsxs(re,{size:"sm",className:"w-full gap-1.5 bg-green-600 text-white hover:bg-green-500",onClick:()=>n(d,e.id),children:[o.jsx(yu,{className:"h-3.5 w-3.5"}),"Apply: ",d.label]})]}),!d&&e.fix&&o.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-muted bg-muted/30 px-3 py-2",children:[o.jsx(vh,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e.fix})]}),o.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:o.jsx("span",{className:"rounded-full border border-border px-2 py-0.5",children:$w[e.category]??e.category})})]})})]})})}const KA=({healthCheck:e,policyText:t,onApplyFix:n,fixedDiagnostics:r})=>{const[s,i]=h.useState("all"),a=r??new Set,c=(s==="all"?e.diagnostics:e.diagnostics.filter(u=>u.severity===s)).reduce((u,f)=>{const p=f.category;return u[p]||(u[p]=[]),u[p].push(f),u},{}),d=e.diagnostics.filter(u=>u.quickFix&&!a.has(u.id)).length;return o.jsxs("div",{className:"space-y-4",children:[o.jsx(HA,{counts:e.counts}),d>0&&n&&o.jsx("div",{className:"flex items-center justify-between rounded-md border border-green-500/20 bg-green-500/5 px-4 py-2",children:o.jsxs("span",{className:"text-xs text-green-400",children:[o.jsx(yu,{className:"mr-1.5 inline h-3.5 w-3.5"}),d," issue",d>1?"s":""," can be auto-fixed"]})}),o.jsx("div",{className:"flex items-center gap-1 rounded-md border border-border bg-muted/30 p-1",children:["all","error","warning","info","hint"].map(u=>{const f=u==="all"?e.diagnostics.length:e.counts[`${u}s`];return u!=="all"&&f===0?null:o.jsxs("button",{onClick:()=>i(u),className:$("rounded px-3 py-1.5 text-xs font-medium transition-colors",s===u?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[u==="all"?"All":Lw[u].label,f>0&&o.jsxs("span",{className:"ml-1.5 opacity-60",children:["(",f,")"]})]},u)})}),Object.entries(c).length>0?o.jsx("div",{className:"space-y-4",children:Object.entries(c).map(([u,f])=>o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:$w[u]??u}),f.map(p=>o.jsx(GA,{diagnostic:p,policyText:t,onApplyFix:n,isFixed:a.has(p.id)},p.id))]},u))}):o.jsx("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 px-4 py-6 text-center",children:o.jsx("span",{className:"text-sm text-green-400",children:"No issues found — policy is clean"})})]})},YA={ALLOW:{icon:jn,color:"text-green-400",bg:"bg-green-500/10",border:"border-green-500/30",label:"ALLOWED"},BLOCK:{icon:I0,color:"text-red-400",bg:"bg-red-500/10",border:"border-red-500/30",label:"BLOCKED"},MODIFY:{icon:Yl,color:"text-yellow-400",bg:"bg-yellow-500/10",border:"border-yellow-500/30",label:"MODIFIED"},PAUSE:{icon:A0,color:"text-orange-400",bg:"bg-orange-500/10",border:"border-orange-500/30",label:"PAUSED"}};function qA({verdict:e,action:t}){const[n,r]=h.useState(!1),s=YA[e.status],i=s.icon,a=e.rulesFired.filter(l=>l.effect!=="monitored");return o.jsx(yn,{open:n,onOpenChange:r,children:o.jsxs("div",{className:$("rounded-lg border transition-colors",s.border,s.bg),children:[o.jsxs(bn,{className:"flex w-full items-start gap-3 px-4 py-3 text-left",children:[o.jsx(i,{className:$("mt-0.5 h-5 w-5 shrink-0",s.color)}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:$("rounded px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",s.bg,s.color),children:s.label}),o.jsx("span",{className:"text-xs text-muted-foreground",children:t.agentId})]}),o.jsx("p",{className:"mt-1 text-sm text-foreground",children:t.description}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:e.reason})]}),o.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[e.status==="MODIFY"&&e.action&&o.jsxs("span",{className:"text-xs text-yellow-400",children:[t.magnitude.toFixed(2)," → ",e.action.magnitude.toFixed(2)]}),n?o.jsx(gt,{className:"h-4 w-4 text-muted-foreground"}):o.jsx($n,{className:"h-4 w-4 text-muted-foreground"})]})]}),o.jsx(wn,{children:o.jsxs("div",{className:"space-y-2 border-t border-border/50 px-4 py-3",children:[e.rulesFired.length>0&&o.jsxs("div",{className:"space-y-1",children:[o.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Rules Evaluated"}),e.rulesFired.map((l,c)=>o.jsxs("div",{className:$("flex items-center gap-2 rounded border px-2.5 py-1.5 text-xs",l.effect==="blocked"&&"border-red-500/20 bg-red-500/5 text-red-300",l.effect==="dampened"&&"border-yellow-500/20 bg-yellow-500/5 text-yellow-300",l.effect==="capped"&&"border-orange-500/20 bg-orange-500/5 text-orange-300",l.effect==="rebalanced"&&"border-blue-500/20 bg-blue-500/5 text-blue-300",l.effect==="monitored"&&"border-border bg-muted/30 text-muted-foreground"),children:[o.jsx("span",{className:"shrink-0 font-mono text-[10px] opacity-60",children:l.id}),o.jsx("span",{className:"flex-1",children:l.description}),o.jsx("span",{className:"shrink-0 font-bold uppercase text-[10px]",children:l.effect}),l.impactReduction>0&&o.jsxs("span",{className:"shrink-0 font-mono opacity-70",children:["-",(l.impactReduction*100).toFixed(0),"%"]})]},`${l.id}-${c}`))]}),o.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[o.jsxs("span",{children:["Confidence: ",(e.confidence*100).toFixed(0),"%"]}),a.length>0&&o.jsxs("span",{children:[a.length," rule",a.length>1?"s":""," enforced"]})]})]})})]})})}function QA({governor:e,verdictCount:t}){const n=e.stats,r=e.policy;return o.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-md border border-border bg-muted/50 px-4 py-2 font-mono text-xs",children:[o.jsx("span",{className:"text-muted-foreground uppercase tracking-wider",children:"Governor"}),o.jsxs("span",{className:"text-foreground",children:[r.ruleCount," rules"]}),o.jsxs("span",{className:"text-green-400",children:[r.enforcedCount," enforced"]}),t>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-border",children:"|"}),n.allowed>0&&o.jsxs("span",{className:"text-green-400",children:[n.allowed," allowed"]}),n.blocked>0&&o.jsxs("span",{className:"text-red-400",children:[n.blocked," blocked"]}),n.modified>0&&o.jsxs("span",{className:"text-yellow-400",children:[n.modified," modified"]}),n.paused>0&&o.jsxs("span",{className:"text-orange-400",children:[n.paused," paused"]})]})]})}function XA({onSubmit:e}){const[t,n]=h.useState("custom-agent"),[r,s]=h.useState(""),[i,a]=h.useState(.5),l=()=>{r.trim()&&(e({agentId:t,type:"custom",description:r.trim(),magnitude:i}),s(""))};return o.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-muted/30 p-4",children:[o.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Custom Action"}),o.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-[1fr_2fr_auto]",children:[o.jsx("input",{value:t,onChange:c=>n(c.target.value),placeholder:"Agent ID",className:"rounded border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none"}),o.jsx("input",{value:r,onChange:c=>s(c.target.value),onKeyDown:c=>c.key==="Enter"&&l(),placeholder:"What is the agent trying to do?",className:"rounded border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none"}),o.jsxs(re,{onClick:l,disabled:!r.trim(),size:"sm",className:"gap-1.5",children:[o.jsx(Qr,{className:"h-3 w-3"}),"Evaluate"]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Magnitude:"}),o.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:i,onChange:c=>a(Number(c.target.value)),className:"flex-1"}),o.jsx("span",{className:$("w-10 text-right font-mono text-xs font-bold",i>.7?"text-red-400":i>.4?"text-yellow-400":"text-green-400"),children:i.toFixed(2)})]})]})}const JA=({policyText:e})=>{var p;const[t,n]=h.useState("stressed"),[r,s]=h.useState([]),[i,a]=h.useState(!1),l=h.useMemo(()=>Ly({policyText:e,sensitivity:.5}),[e]),c=((p=td[t])==null?void 0:p.state)??td.stressed.state,d=h.useCallback(m=>{const y=l.evaluate(m,c);s(g=>[{action:m,verdict:y},...g])},[l,c]),u=h.useCallback(()=>{const m=$h.map(y=>({action:y,verdict:l.evaluate(y,c)}));s(m)},[l,c]),f=h.useCallback(()=>{s([])},[]);return o.jsxs("div",{className:"space-y-4",children:[o.jsx(QA,{governor:l,verdictCount:r.length}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pr,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Market Conditions"}),o.jsx("div",{className:"flex gap-1",children:Object.entries(td).map(([m,{label:y,state:g}])=>o.jsx("button",{onClick:()=>{n(m),s([])},className:$("rounded-full border px-3 py-1 text-xs font-medium transition-colors",t===m?m==="crisis"?"border-red-500/30 bg-red-500/10 text-red-400":m==="stressed"?"border-yellow-500/30 bg-yellow-500/10 text-yellow-400":"border-green-500/30 bg-green-500/10 text-green-400":"border-border text-muted-foreground hover:text-foreground"),children:y},m))})]}),o.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(c).map(([m,y])=>o.jsxs("span",{className:$("rounded border px-2 py-0.5 font-mono text-[10px]",typeof y=="number"&&y>70||typeof y=="number"&&y<20||y==="panic"||y==="systemic"?"border-red-500/20 text-red-400":"border-border text-muted-foreground"),children:[m,": ",String(y)]},m))}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs(re,{onClick:u,size:"sm",className:"gap-1.5",children:[o.jsx(Io,{className:"h-3 w-3"}),"Evaluate All Example Actions"]}),o.jsxs(re,{onClick:()=>a(!i),variant:"outline",size:"sm",className:"gap-1.5",children:[o.jsx(Yi,{className:"h-3 w-3"}),"Custom Action"]}),r.length>0&&o.jsx("button",{onClick:f,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear results"})]}),i&&o.jsx(XA,{onSubmit:d}),r.length===0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Or evaluate individually:"}),o.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:$h.map(m=>o.jsxs("button",{onClick:()=>d(m),className:"flex items-start gap-2 rounded-lg border border-border bg-muted/20 px-3 py-2.5 text-left transition-colors hover:border-primary/30 hover:bg-muted/40",children:[o.jsx(LC,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),o.jsxs("div",{children:[o.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:m.agentId}),o.jsx("p",{className:"text-xs text-foreground",children:m.description}),o.jsx("div",{className:"mt-1 flex items-center gap-2",children:o.jsxs("span",{className:$("font-mono text-[10px] font-bold",m.magnitude>.7?"text-red-400":m.magnitude>.4?"text-yellow-400":"text-green-400"),children:["magnitude: ",m.magnitude.toFixed(2)]})})]})]},m.agentId+m.description))})]}),r.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Governance Verdicts (",r.length,")"]}),r.map(({action:m,verdict:y},g)=>o.jsx(qA,{verdict:y,action:m},`${m.agentId}-${g}`))]})]})},ZA={upload:"Upload Policy",parsed:"Rules Parsed",validated:"Logic Validated",simulating:"Simulating...",complete:"Results Ready"};function e3({current:e}){const t=["upload","parsed","validated","simulating","complete"],n=t.indexOf(e);return o.jsx("div",{className:"flex items-center gap-1",children:t.map((r,s)=>{const i=s===n,a=s<n,l=s>n;return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs("div",{className:$("flex h-7 items-center gap-1.5 rounded-full border px-3 text-xs font-medium transition-all",i&&"border-primary bg-primary/10 text-primary",a&&"border-green-500/30 bg-green-500/10 text-green-400",l&&"border-border bg-muted/30 text-muted-foreground"),children:[a&&o.jsx(ns,{className:"h-3 w-3"}),i&&r==="simulating"&&o.jsx(ll,{className:"h-3 w-3 animate-spin"}),o.jsx("span",{className:"hidden sm:inline",children:ZA[r]}),o.jsx("span",{className:"sm:hidden",children:s+1})]}),s<t.length-1&&o.jsx("div",{className:$("h-px w-4 transition-colors",a?"bg-green-500/50":"bg-border")})]},r)})})}function t3({onUpload:e,policyText:t,onTextChange:n}){const r=h.useRef(null),[s,i]=h.useState(!1),a=h.useCallback(d=>{if(!d.name.endsWith(".txt")&&!d.name.endsWith(".md"))return;const u=new FileReader;u.onload=f=>{var m;const p=(m=f.target)==null?void 0:m.result;n(p),e(p)},u.readAsText(d)},[e,n]),l=h.useCallback(d=>{d.preventDefault(),i(!1);const u=d.dataTransfer.files[0];u&&a(u)},[a]),c=h.useCallback(()=>{t.trim()&&e(t)},[t,e]);return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{onDragOver:d=>{d.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:l,onClick:()=>{var d;return(d=r.current)==null?void 0:d.click()},className:$("cursor-pointer rounded-lg border-2 border-dashed p-6 text-center transition-all",s?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-muted/30"),children:[o.jsx(M0,{className:$("mx-auto mb-2 h-8 w-8",s?"text-primary":"text-muted-foreground")}),o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Drop your policy document here"}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:".txt or .md files accepted"}),o.jsx("input",{ref:r,type:"file",accept:".txt,.md",className:"hidden",onChange:d=>{var f;const u=(f=d.target.files)==null?void 0:f[0];u&&a(u)}})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Or paste policy text directly"}),o.jsx("textarea",{value:t,onChange:d=>n(d.target.value),placeholder:sg,rows:10,className:"w-full rounded-lg border border-border bg-background px-4 py-3 font-mono text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary/30"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:()=>n(sg),className:"text-xs text-primary/70 underline-offset-2 hover:text-primary hover:underline",children:"Load example policy"}),o.jsxs(re,{onClick:c,disabled:!t.trim(),size:"sm",children:[o.jsx(Io,{className:"mr-1.5 h-3.5 w-3.5"}),"Parse & Validate"]})]})]})]})}function n3({rule:e}){const t=e.enforcement==="structural";return o.jsxs("div",{className:$("flex items-start gap-3 rounded-lg border px-4 py-3",t?"border-green-500/20 bg-green-500/5":"border-yellow-500/20 bg-yellow-500/5"),children:[t?o.jsx(jn,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-400"}):o.jsx(Kl,{className:"mt-0.5 h-4 w-4 shrink-0 text-yellow-400"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.id}),o.jsx("span",{className:$("rounded px-1.5 py-0.5 text-[10px] font-bold uppercase",t?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"),children:t?"ENFORCED":"ADVISORY"}),o.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:e.category})]}),o.jsx("p",{className:"mt-1 text-sm text-foreground",children:e.description}),e.affectedVariables.length>0&&o.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.affectedVariables.map(n=>o.jsx("span",{className:"rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground",children:n},n))})]})]})}function r3({parsed:e}){const[t,n]=h.useState(!1),r=t?e.rules:e.rules.slice(0,6);return o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"flex items-center gap-3",children:o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/50 px-4 py-2",children:[o.jsx(rs,{className:"h-4 w-4 text-primary"}),o.jsxs("span",{className:"text-sm font-medium",children:["Parsed ",e.summary.total," rules"]}),o.jsx("span",{className:"mx-1 text-muted-foreground",children:"—"}),o.jsxs("span",{className:"text-sm text-green-400",children:[e.summary.enforced," enforced"]}),o.jsxs("span",{className:"text-sm text-yellow-400",children:[e.summary.advisory," advisory"]})]})}),o.jsx("div",{className:"space-y-2",children:r.map(s=>o.jsx(n3,{rule:s},s.id))}),e.rules.length>6&&o.jsx("button",{onClick:()=>n(!t),className:"text-xs text-primary/70 hover:text-primary",children:t?"Show less":`Show ${e.rules.length-6} more rules...`})]})}function s3({result:e}){const{impact:t,comparison:n}=e,r=[{label:"Stability Change",value:t.stabilityChange,suffix:"%",positive:t.stabilityChange>0,icon:t.stabilityChange>0?qf:Yf},{label:"Cascade Risk",value:-t.cascadeRiskChange,suffix:"%",positive:t.cascadeRiskChange>0,icon:Pr},{label:"Governance Actions",value:t.governanceActions,suffix:"",positive:!0,icon:jn},{label:"Actions Blocked",value:t.actionsBlocked,suffix:"%",positive:t.actionsBlocked<70,icon:To}];return o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:r.map(s=>{const i=s.icon;return o.jsxs("div",{className:$("rounded-lg border p-4 text-center",s.positive?"border-green-500/20 bg-green-500/5":"border-red-500/20 bg-red-500/5"),children:[o.jsx(i,{className:$("mx-auto mb-1 h-5 w-5",s.positive?"text-green-400":"text-red-400")}),o.jsxs("div",{className:$("text-2xl font-bold",s.positive?"text-green-400":"text-red-400"),children:[s.value>0?"+":"",s.value.toFixed(0),s.suffix]}),o.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:s.label})]},s.label)})}),t.preventedCollapse&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border-2 border-green-500/30 bg-green-500/10 px-4 py-3",children:[o.jsx(ns,{className:"h-5 w-5 text-green-400"}),o.jsx("span",{className:"text-sm font-medium text-green-400",children:"Policy prevented system collapse"})]}),t.overConstraintScore>.7&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border-2 border-red-500/30 bg-red-500/10 px-4 py-3",children:[o.jsx(kr,{className:"h-5 w-5 text-red-400"}),o.jsxs("div",{children:[o.jsx("span",{className:"text-sm font-medium text-red-400",children:"Over-constrained Policy Detected"}),o.jsxs("p",{className:"mt-0.5 text-xs text-red-300/70",children:[t.actionsBlocked.toFixed(0),"% of actions blocked — risk of system freeze"]})]})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Governance Effectiveness"}),o.jsxs("span",{className:"text-sm font-bold text-primary",children:[(n.comparison.governanceEffectiveness*100).toFixed(0),"%"]})]}),o.jsx("div",{className:"mt-2 h-2 overflow-hidden rounded-full bg-muted",children:o.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${n.comparison.governanceEffectiveness*100}%`}})})]})]})}function i3({explanation:e}){return o.jsxs("div",{className:"rounded-lg border border-primary/20 bg-primary/5 px-5 py-4",children:[o.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[o.jsx(Qr,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"What the Policy Did"})]}),o.jsx("p",{className:"text-sm leading-relaxed text-foreground/90",children:e})]})}function o3({result:e}){const{comparison:t}=e,n=t.baseline.metrics,r=t.governed.metrics,s=[{label:"Collapse Probability",baseline:`${(n.collapseProbability*100).toFixed(0)}%`,policy:`${(r.collapseProbability*100).toFixed(0)}%`,better:r.collapseProbability<n.collapseProbability},{label:"Stability Score",baseline:`${(n.stabilityScore*100).toFixed(0)}%`,policy:`${(r.stabilityScore*100).toFixed(0)}%`,better:r.stabilityScore>n.stabilityScore},{label:"Max Volatility",baseline:n.maxVolatility.toFixed(2),policy:r.maxVolatility.toFixed(2),better:r.maxVolatility<n.maxVolatility},{label:"Coalition Risks",baseline:String(n.coalitionRisks),policy:String(r.coalitionRisks),better:r.coalitionRisks<n.coalitionRisks},{label:"Peak Negative Sentiment",baseline:n.peakNegativeSentiment.toFixed(2),policy:r.peakNegativeSentiment.toFixed(2),better:r.peakNegativeSentiment>n.peakNegativeSentiment}];return o.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[o.jsxs("div",{className:"grid grid-cols-3 border-b border-border bg-muted/50 px-4 py-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:[o.jsx("span",{children:"Metric"}),o.jsx("span",{className:"text-center",children:"Baseline"}),o.jsx("span",{className:"text-center",children:"With Policy"})]}),s.map(i=>o.jsxs("div",{className:"grid grid-cols-3 items-center border-b border-border/50 px-4 py-2.5 last:border-b-0",children:[o.jsx("span",{className:"text-sm text-foreground",children:i.label}),o.jsx("span",{className:"text-center font-mono text-sm text-muted-foreground",children:i.baseline}),o.jsx("span",{className:$("text-center font-mono text-sm font-medium",i.better?"text-green-400":"text-red-400"),children:i.policy})]},i.label))]})}const sg=`# Market Stability Policy
|
|
508
|
-
|
|
509
|
-
- Block all large trades exceeding $10M during periods of extreme volatility
|
|
510
|
-
- Require mandatory position reporting for all leveraged positions above 3x
|
|
511
|
-
- Limit maximum system leverage to 5x during elevated volatility conditions
|
|
512
|
-
- Halt all automated trading when volatility index exceeds 80
|
|
513
|
-
- Monitor and report all correlated position clusters exceeding 15% of market volume
|
|
514
|
-
- Encourage diversification of counterparty exposure across market participants
|
|
515
|
-
- Maintain minimum liquidity floor — no agent may drain liquidity below 15% of baseline
|
|
516
|
-
- Require coalition rebalancing when concentration exceeds threshold limits
|
|
517
|
-
- Promote transparency in all large position changes to reduce information asymmetry
|
|
518
|
-
- Suspend new short positions during market panic conditions`,a3=()=>{const[e,t]=h.useState("upload"),[n,r]=h.useState(""),[s,i]=h.useState(null),[a,l]=h.useState(null),[c,d]=h.useState(null),[u,f]=h.useState(!1),[p,m]=h.useState(!0),[y,g]=h.useState(!0),[b,x]=h.useState(!0),[v,w]=h.useState(!0),[S,N]=h.useState(new Set),[k,j]=h.useState(null),C=h.useCallback(L=>{const I=is(L);i(I);const F=di(I);return l(F),d(null),{parseResult:I,health:F}},[]),E=h.useCallback(L=>{C(L),t("validated"),N(new Set),j(null)},[C]),R=h.useCallback((L,I)=>{const F=bR(n,L);r(F),C(F),N(O=>new Set([...O,I])),j(L.label),setTimeout(()=>j(null),3e3)},[n,C]),P=h.useCallback(async()=>{if(!(!s||!(a!=null&&a.canSimulate))){f(!0),t("simulating");try{const L=await jR(n);d(L),t("complete")}catch(L){console.error("Policy simulation failed:",L),t("validated")}finally{f(!1)}}},[s,a,n]),T=h.useCallback(()=>{t("upload"),r(""),i(null),l(null),d(null),f(!1),N(new Set),j(null)},[]);return o.jsx("section",{className:"border-t border-border py-12",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl space-y-8",children:[o.jsxs("div",{className:"space-y-3 text-center",children:[o.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-primary/30 bg-primary/10 px-4 py-1.5",children:[o.jsx(jn,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"Policy Enforcement Lab"})]}),o.jsx("h2",{className:"text-2xl font-bold tracking-tight text-foreground sm:text-3xl",children:"Test a policy before it exists"}),o.jsx("p",{className:"mx-auto max-w-xl text-sm text-muted-foreground",children:"Drop in your policy. We parse the rules, validate the logic, simulate the outcomes, and show you what would actually happen — before you deploy it."})]}),o.jsx("div",{className:"flex justify-center",children:o.jsx(e3,{current:e})}),e==="upload"&&o.jsx(t3,{onUpload:E,policyText:n,onTextChange:r}),s&&e!=="upload"&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs(yn,{open:y,onOpenChange:g,children:[o.jsxs(bn,{className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/30 px-4 py-3 text-left hover:bg-muted/50",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(rs,{className:"h-4 w-4 text-primary"}),o.jsxs("span",{className:"text-sm font-medium",children:["Parsed Rules (",s.summary.total,")"]}),o.jsxs("span",{className:"text-xs text-green-400",children:[s.summary.enforced," enforced"]}),o.jsxs("span",{className:"text-xs text-yellow-400",children:[s.summary.advisory," advisory"]})]}),y?o.jsx(gt,{className:"h-4 w-4 text-muted-foreground"}):o.jsx($n,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(wn,{children:o.jsx("div",{className:"mt-3",children:o.jsx(r3,{parsed:s})})})]}),a&&o.jsxs(yn,{open:p,onOpenChange:m,children:[o.jsxs(bn,{className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/30 px-4 py-3 text-left hover:bg-muted/50",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pr,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-sm font-medium",children:"Policy Health Check"}),a.counts.errors>0&&o.jsxs("span",{className:"flex items-center gap-1 rounded bg-red-500/20 px-1.5 py-0.5 text-[10px] font-bold text-red-400",children:[o.jsx(To,{className:"h-3 w-3"}),a.counts.errors," errors"]}),a.counts.warnings>0&&o.jsxs("span",{className:"flex items-center gap-1 rounded bg-yellow-500/20 px-1.5 py-0.5 text-[10px] font-bold text-yellow-400",children:[o.jsx(kr,{className:"h-3 w-3"}),a.counts.warnings," warnings"]}),a.counts.errors===0&&a.counts.warnings===0&&o.jsxs("span",{className:"flex items-center gap-1 rounded bg-green-500/20 px-1.5 py-0.5 text-[10px] font-bold text-green-400",children:[o.jsx(ns,{className:"h-3 w-3"}),"Healthy"]}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Score: ",a.healthScore,"/100"]})]}),p?o.jsx(gt,{className:"h-4 w-4 text-muted-foreground"}):o.jsx($n,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(wn,{children:o.jsx("div",{className:"mt-3",children:o.jsx(KA,{healthCheck:a,policyText:n,onApplyFix:R,fixedDiagnostics:S})})})]}),a&&s&&s.summary.total>0&&o.jsxs(yn,{open:b,onOpenChange:x,children:[o.jsxs(bn,{className:"flex w-full items-center justify-between rounded-lg border border-primary/20 bg-primary/5 px-4 py-3 text-left hover:bg-primary/10",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(jn,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-sm font-medium",children:"Governance Playground"}),o.jsx("span",{className:"rounded bg-primary/20 px-1.5 py-0.5 text-[10px] font-bold uppercase text-primary",children:"Live"}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"Test agent actions against your policy"})]}),b?o.jsx(gt,{className:"h-4 w-4 text-muted-foreground"}):o.jsx($n,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(wn,{children:o.jsx("div",{className:"mt-3",children:o.jsx(JA,{policyText:n})})})]}),k&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-green-500/30 bg-green-500/10 px-4 py-3 animate-in fade-in slide-in-from-top-1",children:[o.jsx(ns,{className:"h-4 w-4 text-green-400"}),o.jsxs("span",{className:"text-sm text-green-400",children:["Applied: ",k]}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:["— Policy re-parsed with ",s==null?void 0:s.summary.total," rules (",s==null?void 0:s.summary.enforced," enforced)"]}),c&&o.jsxs(re,{size:"sm",variant:"outline",className:"ml-auto gap-1.5",onClick:P,children:[o.jsx(ll,{className:"h-3 w-3"}),"Re-simulate"]})]}),e==="validated"&&(a==null?void 0:a.canSimulate)&&o.jsx("div",{className:"flex justify-center",children:o.jsxs(re,{onClick:P,size:"lg",className:"gap-2",children:[o.jsx(vu,{className:"h-4 w-4"}),"Run Simulation — Baseline vs. Policy"]})}),e==="simulating"&&o.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[o.jsx(ll,{className:"h-8 w-8 animate-spin text-primary"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Running baseline and governed simulations..."})]}),c&&e==="complete"&&o.jsxs("div",{className:"space-y-6",children:[o.jsx(s3,{result:c}),o.jsx(i3,{explanation:c.explanation}),o.jsxs(yn,{open:v,onOpenChange:w,children:[o.jsxs(bn,{className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/30 px-4 py-3 text-left hover:bg-muted/50",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(vu,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-sm font-medium",children:"Baseline vs. Policy Comparison"})]}),v?o.jsx(gt,{className:"h-4 w-4 text-muted-foreground"}):o.jsx($n,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(wn,{children:o.jsx("div",{className:"mt-3",children:o.jsx(o3,{result:c})})})]}),o.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-4 py-3",children:o.jsx("p",{className:"text-xs italic text-muted-foreground",children:c.comparison.comparison.narrative})})]}),e!=="simulating"&&o.jsx("div",{className:"flex justify-center pt-4",children:o.jsx("button",{onClick:T,className:"text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:"Upload a different policy"})})]})]})})})};function So(e){var i;const t=l3(e);if(t)return t;const r={trading:"social_simulation",flash_crash:"social_simulation",strait_of_hormuz:"social_simulation",gas_price_spike:"social_simulation",ai_regulation_crisis:"social_simulation"}[e]??e,s=ci[r];if(!s)throw new Error(`Unknown preset: ${e}. Available: ${Object.keys(ci).join(", ")}`);if(!((i=s.world)!=null&&i.inline_definition))throw new Error(`Preset "${e}" has no world definition.`);return{id:s.world.world_id,title:s.title,scenario:s.scenario,stakeholders:s.stakeholders,assumptions:s.assumptions,constraints:s.constraints,swarm:s.swarm??{enabled:!0,rounds:5,reaction_model:"mixed"},depth:s.depth,world:s.world.inline_definition,paths:[{id:"path_primary",label:"Primary Response",description:"Most likely course of action",projected_outcome:"Moderate disruption with cascading effects",probability:.6,risk:"high",tradeoffs:["Speed vs. thoroughness","Short-term vs. long-term"],benefits_stakeholders:s.stakeholders.filter(a=>a.disposition==="supportive").map(a=>a.id),harms_stakeholders:s.stakeholders.filter(a=>a.disposition==="hostile").map(a=>a.id)},{id:"path_defensive",label:"Defensive Posture",description:"Conservative approach prioritizing stability",projected_outcome:"Reduced damage but slower recovery",probability:.7,risk:"moderate",tradeoffs:["Safety vs. opportunity cost"],benefits_stakeholders:s.stakeholders.filter(a=>a.disposition!=="hostile").map(a=>a.id),harms_stakeholders:[]}]}}function l3(e){try{const t=fR(e);if(!t)return null;let n=`Simulation with custom world: ${t.world.thesis}`,r=[{id:"System",disposition:"neutral",priorities:["stability"]},{id:"Agents",disposition:"unknown",priorities:["execution"]}],s={severity:"high"},i={};try{const a=So(t.basePreset);n=a.scenario,r=a.stakeholders,s=a.assumptions,i=a.constraints}catch{}return{id:t.id,title:t.name,scenario:n,stakeholders:r,assumptions:s,constraints:i,swarm:{enabled:!0,rounds:5,reaction_model:"mixed"},depth:"full",world:t.world,paths:[{id:"path_primary",label:"Primary Response",description:"Most likely course of action",projected_outcome:"Moderate disruption with cascading effects",probability:.6,risk:"high",tradeoffs:["Speed vs. thoroughness","Short-term vs. long-term"],benefits_stakeholders:r.filter(a=>a.disposition==="supportive").map(a=>a.id),harms_stakeholders:r.filter(a=>a.disposition==="hostile").map(a=>a.id)}]}}catch{return null}}async function c3(e,t,n){var S,N;const r=So(e),s=So(t),i=r.scenario+" "+s.scenario,a=d3(r.stakeholders,s.stakeholders),l=r.paths;(S=n==null?void 0:n.onProgress)==null||S.call(n,"World A","simulating");const c=await Eu({scenario:i,stakeholders:a,assumptions:r.assumptions,constraints:r.constraints,depth:r.depth,swarm:r.swarm},r.world,l);(N=n==null?void 0:n.onProgress)==null||N.call(n,"World B","simulating");const d=await Eu({scenario:i,stakeholders:a,assumptions:s.assumptions,constraints:s.constraints,depth:s.depth,swarm:s.swarm},s.world,l),u=ig(c),f=ig(d),p=c.governed.metrics,m=d.governed.metrics,y=p.stabilityScore-m.stabilityScore,g=p.maxVolatility-m.maxVolatility,b=p.coalitionRisks-m.coalitionRisks,x=p.collapseProbability-m.collapseProbability,v=Math.abs(y)<.02?"equal":y>0?"A":"B",w=u3(r,s,p,m,v);return{scenario:i,worldA:{id:e,thesis:r.world.thesis,invariantCount:r.world.invariants.length,gateCount:(r.world.gates??[]).length,metrics:p,trajectory:c.governed.swarm.trajectory,governanceStats:c.governanceStats,rounds:u},worldB:{id:t,thesis:s.world.thesis,invariantCount:s.world.invariants.length,gateCount:(s.world.gates??[]).length,metrics:m,trajectory:d.governed.swarm.trajectory,governanceStats:d.governanceStats,rounds:f},delta:{stabilityDiff:Number((y*100).toFixed(1)),volatilityDiff:Number((g*100).toFixed(1)),coalitionRiskDiff:b,collapseDiff:Number((x*100).toFixed(1)),moreStable:v,narrative:w}}}function d3(e,t){const n=new Set,r=[];for(const s of[...e,...t])n.has(s.id)||(n.add(s.id),r.push(s));return r}function ig(e){return e.governed.swarm.rounds.map(t=>({round:t.round,avgImpact:t.reactions.reduce((n,r)=>n+r.impact,0)/t.reactions.length,maxVolatility:Math.max(...t.reactions.map(n=>Math.abs(n.impact))),agentImpacts:t.reactions.map(n=>({id:n.stakeholder_id,impact:n.impact,confidence:n.confidence})),interventions:t.emergent_dynamics??[]}))}function u3(e,t,n,r,s){const i=[];i.push(`World A ("${e.world.thesis.slice(0,60)}...") vs World B ("${t.world.thesis.slice(0,60)}...").`),s==="A"?i.push(`World A produced a more stable system (${(n.stabilityScore*100).toFixed(0)}% vs ${(r.stabilityScore*100).toFixed(0)}%).`):s==="B"?i.push(`World B produced a more stable system (${(r.stabilityScore*100).toFixed(0)}% vs ${(n.stabilityScore*100).toFixed(0)}%).`):i.push("Both worlds produced similar stability levels.");const a=e.world.invariants.length-t.world.invariants.length;return a!==0&&i.push(`World ${a>0?"A":"B"} has ${Math.abs(a)} more invariant${Math.abs(a)>1?"s":""}, providing tighter structural constraints.`),i.push("Same agents, different rules — the world shapes the outcome."),i.join(" ")}function f3(){var t;const e=[];for(const[n,r]of Object.entries(ci))(t=r.world)!=null&&t.inline_definition&&e.push({id:n,title:r.title,thesis:r.world.inline_definition.thesis,invariantCount:r.world.inline_definition.invariants.length,gateCount:(r.world.inline_definition.gates??[]).length});return e}function m3(e){const t=So(e),n=t.world.invariants,r=t.world.gates??[],s=n.filter(f=>f.enforceable).length,i=n.length-s,a=n.length===0?"No invariants defined — ungoverned.":`${n.length} rules (${s} enforced, ${i} advisory): ${n.map(f=>f.description).join("; ")}`,l=r.filter(f=>f.severity==="critical"),c=r.filter(f=>f.severity==="warning"),d=r.length===0?"No viability gates — no collapse detection.":`${r.length} gates (${l.length} critical, ${c.length} warning): ${r.map(f=>`${f.label} [${f.severity}]`).join(", ")}`,u=l.length>=2?"high":l.length>=1||c.length>=2?"moderate":"low";return{worldId:e,title:t.title,thesis:t.world.thesis,invariantSummary:a,gateSummary:d,riskProfile:u}}function p3(e){const{worldA:t,worldB:n,delta:r}=e,s=r.moreStable,i=s==="A"?t:s==="B"?n:t,a=s==="A"?n:s==="B"?t:n;i.governanceStats.totalEvaluations-a.governanceStats.totalEvaluations;const l=i.governanceStats.verdicts.block-a.governanceStats.verdicts.block,c=[];return Math.abs(r.stabilityDiff)>=5&&c.push(`${Math.abs(r.stabilityDiff).toFixed(0)}% stability ${r.stabilityDiff>0?"advantage for World A":"advantage for World B"}`),Math.abs(r.collapseDiff)>=5&&c.push(`${Math.abs(r.collapseDiff).toFixed(0)}% ${r.collapseDiff>0?"higher":"lower"} cascade risk in World A`),l!==0&&c.push(`${Math.abs(l)} more governance interventions in ${l>0?"World A":"World B"}`),Math.abs(r.volatilityDiff)>=5&&c.push(`${Math.abs(r.volatilityDiff).toFixed(0)}% volatility ${r.volatilityDiff>0?"higher in A":"higher in B"}`),c.length===0&&c.push("Both worlds produced similar outcomes — rules had minimal differential effect."),{winner:s,stabilityDelta:`${r.stabilityDiff>0?"+":""}${r.stabilityDiff.toFixed(1)}%`,cascadeRiskDelta:`${r.collapseDiff>0?"+":""}${r.collapseDiff.toFixed(1)}%`,volatilityDelta:`${r.volatilityDiff>0?"+":""}${r.volatilityDiff.toFixed(1)}%`,totalInterventionsA:t.governanceStats.totalEvaluations,totalInterventionsB:n.governanceStats.totalEvaluations,blockedActionsA:t.governanceStats.verdicts.block,blockedActionsB:n.governanceStats.verdicts.block,keyFindings:c,verdict:r.narrative,poweredBy:"@neuroverseos/governance — simulateWorld() + evaluateGuard()"}}function og({label:e,selected:t,onSelect:n,presets:r,savedWorlds:s,explanation:i,disabled:a,onDeleteSaved:l}){return o.jsxs("div",{className:"space-y-3",children:[o.jsx("h4",{className:"text-xs font-bold uppercase tracking-[0.15em] text-muted-foreground",children:e}),s.length>0&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"text-[10px] font-bold uppercase tracking-wider text-primary/70 flex items-center gap-1",children:[o.jsx(EC,{className:"h-3 w-3"})," My Worlds"]}),s.map(c=>o.jsxs("div",{className:"flex items-stretch gap-1",children:[o.jsxs("button",{disabled:a,onClick:()=>n(c.id),className:$("flex-1 rounded-lg border px-4 py-3 text-left transition-all",t===c.id?"border-primary bg-primary/5 ring-1 ring-primary/20":"border-border hover:border-muted-foreground/30 hover:bg-muted/50",a&&"opacity-50 cursor-not-allowed"),children:[o.jsx("div",{className:"text-sm font-medium text-foreground",children:c.name}),o.jsx("div",{className:"mt-1 text-xs text-muted-foreground line-clamp-1",children:c.world.thesis}),o.jsxs("div",{className:"mt-2 flex gap-3 text-[10px] font-medium text-muted-foreground",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(hh,{className:"h-3 w-3"})," ",c.world.invariants.length," rules"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(kr,{className:"h-3 w-3"})," ",(c.world.gates??[]).length," gates"]}),o.jsx("span",{className:"text-primary/50",children:"saved"})]})]}),o.jsx("button",{onClick:()=>l(c.id),disabled:a,className:"rounded-lg border border-border px-2 text-muted-foreground hover:text-red-400 hover:border-red-400/30 transition-colors",title:"Delete saved world",children:o.jsx(OC,{className:"h-3.5 w-3.5"})})]},c.id))]}),o.jsxs("div",{className:"space-y-1.5",children:[s.length>0&&o.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground/50 mt-2",children:"Presets"}),r.map(c=>o.jsxs("button",{disabled:a,onClick:()=>n(c.id),className:$("w-full rounded-lg border px-4 py-3 text-left transition-all",t===c.id?"border-primary bg-primary/5 ring-1 ring-primary/20":"border-border hover:border-muted-foreground/30 hover:bg-muted/50",a&&"opacity-50 cursor-not-allowed"),children:[o.jsx("div",{className:"text-sm font-medium text-foreground",children:c.title}),o.jsx("div",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:c.thesis}),o.jsxs("div",{className:"mt-2 flex gap-3 text-[10px] font-medium text-muted-foreground",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(hh,{className:"h-3 w-3"})," ",c.invariantCount," rules"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(kr,{className:"h-3 w-3"})," ",c.gateCount," gates"]})]})]},c.id))]}),i&&o.jsxs("div",{className:"rounded-lg border border-dashed border-muted-foreground/20 bg-muted/30 p-3 space-y-2",children:[o.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Governance posture"}),o.jsx("div",{className:"text-xs text-foreground/80",children:i.invariantSummary}),o.jsx("div",{className:"text-xs text-muted-foreground",children:i.gateSummary}),o.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[o.jsx("span",{className:$("inline-block h-1.5 w-1.5 rounded-full",i.riskProfile==="high"?"bg-red-500":i.riskProfile==="moderate"?"bg-yellow-500":"bg-green-500")}),o.jsxs("span",{className:"text-muted-foreground",children:["Risk profile: ",i.riskProfile]})]})]})]})}function ag({worldId:e,onSave:t,onCancel:n}){const[r,s]=h.useState("");return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("input",{type:"text",value:r,onChange:i=>s(i.target.value),placeholder:"World name (e.g., Panic Control v1)",className:"flex-1 rounded-md border border-border bg-background px-3 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/30",autoFocus:!0,onKeyDown:i=>{i.key==="Enter"&&r.trim()&&t(r.trim()),i.key==="Escape"&&n()}}),o.jsx(re,{size:"sm",onClick:()=>r.trim()&&t(r.trim()),disabled:!r.trim(),children:"Save"}),o.jsx(re,{size:"sm",variant:"ghost",onClick:n,children:"Cancel"})]})}function lg({side:e,label:t,color:n}){const r=n==="blue"?{border:"border-blue-500/30",bg:"bg-blue-500/5",text:"text-blue-400",badge:"bg-blue-500/10 text-blue-400"}:{border:"border-amber-500/30",bg:"bg-amber-500/5",text:"text-amber-400",badge:"bg-amber-500/10 text-amber-400"},s=e.trajectory==="stabilizing"||e.trajectory==="converging"?o.jsx(qf,{className:"h-3.5 w-3.5 text-green-400"}):e.trajectory==="escalating"?o.jsx(Yf,{className:"h-3.5 w-3.5 text-red-400"}):o.jsx(Pr,{className:"h-3.5 w-3.5 text-yellow-400"});return o.jsxs("div",{className:$("rounded-xl border p-5 space-y-4",r.border,r.bg),children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:$("text-xs font-bold uppercase tracking-[0.15em]",r.text),children:t}),o.jsx("span",{className:$("rounded-full px-2 py-0.5 text-[10px] font-medium",r.badge),children:e.id})]}),o.jsx("p",{className:"text-sm text-foreground/90 leading-relaxed",children:e.thesis}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(ha,{label:"Stability",value:`${(e.metrics.stabilityScore*100).toFixed(0)}%`}),o.jsx(ha,{label:"Cascade Risk",value:`${(e.metrics.collapseProbability*100).toFixed(0)}%`}),o.jsx(ha,{label:"Volatility",value:`${(e.metrics.maxVolatility*100).toFixed(0)}%`}),o.jsx(ha,{label:"Trajectory",value:e.trajectory,icon:s})]}),o.jsxs("div",{className:"border-t border-border/50 pt-3 space-y-2",children:[o.jsxs("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[o.jsx(jn,{className:"h-3 w-3"})," Governance Engine"]}),o.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-lg font-bold text-foreground",children:e.governanceStats.totalEvaluations}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:"evaluations"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-lg font-bold text-red-400",children:e.governanceStats.verdicts.block}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:"blocked"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-lg font-bold text-green-400",children:e.governanceStats.verdicts.allow}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:"allowed"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[o.jsxs("span",{children:[e.invariantCount," invariants"]}),o.jsx("span",{className:"text-border",children:"|"}),o.jsxs("span",{children:[e.gateCount," gates"]}),o.jsx("span",{className:"text-border",children:"|"}),o.jsxs("span",{children:[e.governanceStats.rulesFired," rules fired"]})]})]})]})}function ha({label:e,value:t,icon:n}){return o.jsxs("div",{className:"rounded-lg bg-background/50 px-3 py-2",children:[o.jsx("div",{className:"text-[10px] text-muted-foreground",children:e}),o.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[n,o.jsx("span",{className:"text-sm font-semibold text-foreground",children:t})]})]})}function h3({impact:e}){return o.jsxs("div",{className:"rounded-xl border border-primary/20 bg-primary/5 p-5 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Qr,{className:"h-4 w-4 text-primary"}),o.jsx("h4",{className:"text-xs font-bold uppercase tracking-[0.15em] text-primary",children:"Impact Delta"})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[o.jsx(fd,{label:"Stability",value:e.stabilityDelta}),o.jsx(fd,{label:"Cascade Risk",value:e.cascadeRiskDelta,invert:!0}),o.jsx(fd,{label:"Volatility",value:e.volatilityDelta,invert:!0})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4 text-center border-t border-border/50 pt-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-2xl font-bold text-foreground",children:e.totalInterventionsA}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:"World A interventions"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-2xl font-bold text-foreground",children:e.totalInterventionsB}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:"World B interventions"})]})]}),o.jsxs("div",{className:"space-y-2 border-t border-border/50 pt-3",children:[o.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Key Findings"}),o.jsx("ul",{className:"space-y-1",children:e.keyFindings.map((t,n)=>o.jsxs("li",{className:"flex items-start gap-2 text-xs text-foreground/80",children:[o.jsx("span",{className:"mt-1 block h-1 w-1 rounded-full bg-primary shrink-0"}),t]},n))})]}),o.jsx("div",{className:"rounded-lg bg-background/60 p-3",children:o.jsx("div",{className:"text-xs text-foreground/80 leading-relaxed",children:e.verdict})}),o.jsxs("div",{className:"text-[10px] text-muted-foreground/60 text-center",children:["Powered by ",e.poweredBy]})]})}function fd({label:e,value:t,invert:n}){const r=parseFloat(t),s=n?r<0:r>0,i=n?r>0:r<0,a=r===0||isNaN(r);return o.jsxs("div",{children:[o.jsx("div",{className:$("text-xl font-bold",s&&"text-green-400",i&&"text-red-400",a&&"text-muted-foreground"),children:t}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:e})]})}const g3=()=>{const e=f3(),[t,n]=h.useState(()=>Br()),[r,s]=h.useState(null),[i,a]=h.useState(null),[l,c]=h.useState(null),[d,u]=h.useState(null),[f,p]=h.useState(!1),[m,y]=h.useState(""),[g,b]=h.useState(null),x=h.useRef(null);[...t.map(E=>({id:E.id,title:E.name,thesis:E.world.thesis,invariantCount:E.world.invariants.length,gateCount:(E.world.gates??[]).length})),...e];const v=E=>{if(!E)return null;const R=t.find(P=>P.id===E);if(R){const P=R.world.invariants,T=R.world.gates??[],L=P.filter(V=>V.enforceable).length,I=P.length-L,F=T.filter(V=>V.severity==="critical"),O=T.filter(V=>V.severity==="warning");return{worldId:E,title:R.name,thesis:R.world.thesis,invariantSummary:P.length===0?"No invariants defined — ungoverned.":`${P.length} rules (${L} enforced, ${I} advisory): ${P.map(V=>V.description).join("; ")}`,gateSummary:T.length===0?"No viability gates — no collapse detection.":`${T.length} gates (${F.length} critical, ${O.length} warning)`,riskProfile:F.length>=2?"high":F.length>=1||O.length>=2?"moderate":"low"}}try{return m3(E)}catch{return null}},w=r&&i&&r!==i&&!f,S=h.useCallback(async()=>{if(!(!r||!i)){p(!0),c(null),u(null),y("Initializing worlds...");try{const E=await c3(r,i,{onProgress:(R,P)=>y(`${R}: ${P}...`)});c(E),u(p3(E)),y("")}catch(E){console.error("World comparison failed:",E),y("Comparison failed — check console for details.")}finally{p(!1)}}},[r,i]),N=h.useCallback((E,R)=>{const P=E==="A"?r:i;if(P)try{const T=So(P),L=gR(R,T.world,P,{description:`Saved from comparison: ${T.title}`,tags:["comparison"]});Lh(L),n(Br()),b(null)}catch(T){console.error("Failed to save world:",T)}},[r,i]),k=h.useCallback(E=>{mR(E),n(Br()),r===E&&s(null),i===E&&a(null)},[r,i]),j=h.useCallback(()=>{if(!l||!d)return;const E={comparison:l,impact:d,exportedAt:new Date().toISOString()},R=new Blob([JSON.stringify(E,null,2)],{type:"application/json"}),P=URL.createObjectURL(R),T=document.createElement("a");T.href=P,T.download=`world-comparison-${l.worldA.id}-vs-${l.worldB.id}.json`,T.click(),URL.revokeObjectURL(P)},[l,d]),C=h.useCallback(E=>{var T;const R=(T=E.target.files)==null?void 0:T[0];if(!R)return;const P=new FileReader;P.onload=()=>{try{const L=hR(P.result);Lh(L),n(Br())}catch(L){console.error("Failed to import world:",L),alert(`Import failed: ${L instanceof Error?L.message:"Invalid file"}`)}},P.readAsText(R),E.target.value=""},[]);return h.useCallback(E=>{const R=t.find(I=>I.id===E);if(!R)return;const P=new Blob([pR(R)],{type:"application/json"}),T=URL.createObjectURL(P),L=document.createElement("a");L.href=T,L.download=`${R.name.replace(/\s+/g,"-").toLowerCase()}.nv-world.json`,L.click(),URL.revokeObjectURL(T)},[t]),o.jsx("section",{className:"border-t border-border py-10",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-5xl space-y-8",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(_C,{className:"h-5 w-5 text-primary"}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Compare Worlds"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Same agents, different rules. See how governance changes the outcome."})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("input",{ref:x,type:"file",accept:".json",onChange:C,className:"hidden"}),o.jsxs(re,{size:"sm",variant:"outline",className:"gap-1.5 text-xs",onClick:()=>{var E;return(E=x.current)==null?void 0:E.click()},children:[o.jsx(M0,{className:"h-3.5 w-3.5"}),"Import World"]})]})]}),o.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[o.jsx(og,{label:"World A",selected:r,onSelect:s,presets:e,savedWorlds:t,explanation:v(r),disabled:f,onDeleteSaved:k}),o.jsx(og,{label:"World B",selected:i,onSelect:E=>a(E===r?null:E),presets:e.filter(E=>E.id!==r),savedWorlds:t.filter(E=>E.id!==r),explanation:v(i),disabled:f,onDeleteSaved:k})]}),o.jsx("div",{className:"flex justify-center",children:o.jsx(re,{onClick:S,disabled:!w,size:"lg",className:"gap-2",children:f?o.jsxs(o.Fragment,{children:[o.jsx(Pr,{className:"h-4 w-4 animate-pulse"}),m||"Simulating..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Io,{className:"h-4 w-4"}),"Run Comparison"]})})}),l&&d&&o.jsxs("div",{className:"space-y-6 animate-in fade-in-0 slide-in-from-bottom-4 duration-500",children:[o.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(lg,{side:l.worldA,label:"World A",color:"blue"}),g==="A"?o.jsx(ag,{worldId:l.worldA.id,onSave:E=>N("A",E),onCancel:()=>b(null)}):o.jsxs(re,{size:"sm",variant:"ghost",className:"w-full gap-1.5 text-xs text-muted-foreground",onClick:()=>b("A"),children:[o.jsx(gh,{className:"h-3.5 w-3.5"})," Save World A"]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(lg,{side:l.worldB,label:"World B",color:"amber"}),g==="B"?o.jsx(ag,{worldId:l.worldB.id,onSave:E=>N("B",E),onCancel:()=>b(null)}):o.jsxs(re,{size:"sm",variant:"ghost",className:"w-full gap-1.5 text-xs text-muted-foreground",onClick:()=>b("B"),children:[o.jsx(gh,{className:"h-3.5 w-3.5"})," Save World B"]})]})]}),o.jsx(h3,{impact:d}),o.jsx("div",{className:"flex justify-center",children:o.jsxs(re,{size:"sm",variant:"outline",className:"gap-1.5 text-xs",onClick:j,children:[o.jsx(_0,{className:"h-3.5 w-3.5"})," Export Comparison as JSON"]})})]})]})})})},v3=()=>o.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[o.jsxs("div",{className:"relative mb-6 h-32 w-64 overflow-hidden rounded-lg border border-border bg-card",children:[[0,1,2].map(e=>o.jsx("div",{className:"absolute left-0 right-0 h-px bg-primary/60 scan-line",style:{animationDelay:`${e*.5}s`}},e)),o.jsx("div",{className:"absolute inset-0 grid grid-cols-8 grid-rows-4 gap-1 p-3",children:Array.from({length:32}).map((e,t)=>o.jsx("div",{className:"rounded-full bg-primary/20 animate-pulse",style:{animationDelay:`${t*50}ms`}},t))})]}),o.jsx("p",{className:"text-sm text-muted-foreground animate-pulse",children:"Building reasoning graph..."})]}),x3=()=>{const[e,t]=h.useState(!1);return h.useEffect(()=>{const n=()=>t(window.scrollY>400);return window.addEventListener("scroll",n,{passive:!0}),()=>window.removeEventListener("scroll",n)},[]),e?o.jsx(re,{size:"icon",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),className:"fixed bottom-6 right-6 z-50 rounded-full shadow-lg glow-teal animate-fade-in","aria-label":"Scroll to top",children:o.jsx(SC,{className:"h-5 w-5"})}):null},y3={severity:50,environmentalHostility:50,timePressure:50,regulatoryClimate:50},b3={timeHorizon:"",riskTolerance:"moderate",budget:""},w3={outcome:"",priority:"important",timeframe:"",successCriteria:[],redLines:[],availableLevers:[]},S3=()=>{const{theme:e,toggle:t}=hm(),n=h.useRef(null),r=h.useRef(null),s=h.useRef(null),[i,a]=h.useState(null),[l,c]=h.useState(""),[d,u]=h.useState(y3),[f,p]=h.useState([]),[m,y]=h.useState(b3),[g,b]=h.useState("full"),[x,v]=h.useState("explore"),[w,S]=h.useState(w3),[N,k]=h.useState(null),[j,C]=h.useState(null),[E,R]=h.useState(!1),[P,T]=h.useState(!1),[L,I]=h.useState(!1),[F,O]=h.useState(null),[V,_]=h.useState(null),[A,D]=h.useState(null),[Y,G]=h.useState(!1),[J,Z]=h.useState(!1),[me,be]=h.useState("deterministic");h.useEffect(()=>{if(window.location.hash.includes("capsule="))try{const Ne=S_(window.location.href);Ne&&(c(Ne.scenario),setTimeout(()=>{var fe;return(fe=n.current)==null?void 0:fe.scrollIntoView({behavior:"smooth"})},300))}catch{}},[]);const W=h.useCallback(()=>{var ee;(ee=n.current)==null||ee.scrollIntoView({behavior:"smooth"})},[]),ce=h.useCallback(()=>{var ee;(ee=r.current)==null||ee.scrollIntoView({behavior:"smooth"})},[]),xe=h.useCallback((ee,Ne)=>{c(ee),v("goal"),S(fe=>({...fe,outcome:Ne})),setTimeout(()=>{var fe;return(fe=n.current)==null?void 0:fe.scrollIntoView({behavior:"smooth"})},100)},[]),le=h.useCallback((ee,Ne)=>{c(`${ee}: ${Ne}`),setTimeout(()=>{var fe;return(fe=n.current)==null?void 0:fe.scrollIntoView({behavior:"smooth"})},100)},[]),z=h.useCallback(ee=>{a(ee),c(""),u(ee.defaultSliders),I(P)},[P]),X=h.useCallback(ee=>{c(ee),ee.trim()&&a(null)},[]),he=h.useCallback(ee=>{u(ee),P&&I(!0)},[P]),oe=h.useCallback(async()=>{R(!0),I(!1),O(null);try{const ee=i||l,Ne={stakeholders:f.length>0?f:void 0,constraints:m,depth:g,mode:x,goal:x==="goal"&&w.outcome.trim()?{outcome:w.outcome,priority:w.priority,timeframe:w.timeframe||void 0,success_criteria:w.successCriteria.length>0?w.successCriteria:void 0,red_lines:w.redLines.length>0?w.redLines:void 0,available_levers:w.availableLevers.length>0?w.availableLevers:void 0}:void 0},fe=await YR(ee,d,Ne);k(fe),T(!0),setTimeout(()=>{var ge;return(ge=s.current)==null?void 0:ge.scrollIntoView({behavior:"smooth",block:"start"})},100)}catch(ee){console.error("Reasoning engine error:",ee)}finally{R(!1)}},[i,l,d,f,m,g,x,w]),ft=h.useCallback(ee=>{R(!0),setTimeout(()=>{const Ne=d5(ee);C(Ne),k(Ne),R(!1),setTimeout(()=>{var fe;return(fe=s.current)==null?void 0:fe.scrollIntoView({behavior:"smooth",block:"start"})},100)},2e3)},[]),Ue=h.useCallback((ee,Ne)=>{if(!(N!=null&&N.goalResult))return;const fe=N.goalResult.strategies.find(At=>At.id===ee);if(!fe)return;const ge=fe.steps.map(At=>({...At,action:Ne.includes(At.lever)?At.action:`[DISABLED] ${At.action}`,expected_effect:Ne.includes(At.lever)?At.expected_effect:"Lever disabled — effect removed from path"})),Tt=Ne.length/Math.max(fe.levers_used.length,1);O({originalStrategy:fe,injectedEvent:{atStep:0,event:`Levers modified: ${Ne.join(", ")}`},forkedSteps:ge,probabilityDelta:(Tt-1)*fe.success_probability*.3,riskDelta:Tt<.5?"increased":fe.risk})},[N]),We=h.useCallback(ee=>{if(!(N!=null&&N.goalResult))return;const Ne=N.goalResult.strategies.find(ge=>ge.id===N.goalResult.recommended_strategy_id);if(!Ne)return;const fe=Ne.steps.filter(ge=>ge.order>ee.atStep+1).map(ge=>({...ge,action:`[ADAPTED] ${ge.action}`,expected_effect:`Modified by event: "${ee.event}" — ${ge.expected_effect}`}));fe.length===0&&fe.push({order:ee.atStep+2,action:"Reassess strategy in light of new event",timeframe:"Immediate",lever:"Assessment",expected_effect:"Determine whether original path is still viable",risk:"Delay in execution while reassessing"}),O({originalStrategy:Ne,injectedEvent:ee,forkedSteps:fe,probabilityDelta:-.1-Math.random()*.15,riskDelta:"elevated"})},[N]),Vt=h.useCallback(async()=>{var ee,Ne,fe,ge;if(N){G(!0);try{const{generateGovernedReport:Tt}=await ml(async()=>{const{generateGovernedReport:cn}=await import("./reportEngine-D2ZrMny8.js");return{generateGovernedReport:cn}},[]),{generateDeterministicReport:At}=await ml(async()=>{const{generateDeterministicReport:cn}=await Promise.resolve().then(()=>Q_);return{generateDeterministicReport:cn}},void 0),we=N.governance,ms={scenario:l||(i==null?void 0:i.title)||"Simulation",rounds:[],metrics:{avgImpact:-.15,collapseProbability:((ee=we==null?void 0:we.neuroverse)==null?void 0:ee.collapseRisk)==="high"?.65:.25,stabilityScore:(((Ne=we==null?void 0:we.neuroverse)==null?void 0:Ne.worldHealthScore)??65)/100,maxVolatility:.45,peakNegativeSentiment:-.5},interventions:(we==null?void 0:we.enforcedConstraints)??[],governanceStats:{totalEvaluations:(we==null?void 0:we.constitutionalChecks.length)??0,blocks:(we==null?void 0:we.constitutionalChecks.filter(cn=>!cn.passed).length)??0,pauses:((fe=we==null?void 0:we.neuroverse)==null?void 0:fe.guardStatus)==="PAUSE"?1:0,allows:(we==null?void 0:we.constitutionalChecks.filter(cn=>cn.passed).length)??0,rulesFired:((ge=we==null?void 0:we.neuroverse)==null?void 0:ge.rulesFired)??0}},Bo=At(ms);_(Bo),D({result:Bo,actor:"ai_analyst",action:"generate_report",governed:!0,trace:{constraints:["must_reference_trace","must_include_blocked_actions","must_include_metrics","no_unverifiable_claims"],passed:!0,violations:[]}}),be(J?"ai":"deterministic")}catch(Tt){console.error("Report generation failed:",Tt)}finally{G(!1)}}},[N,J,l,i]),wt=!!(i||l.trim()),Fo=wt&&!j,He=P&&N&&!E||j&&!E,zo=(i==null?void 0:i.title)||l.slice(0,60)||"Custom Scenario";return o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(N5,{showSimulatedFuture:!!He,theme:e,onToggleTheme:t,isSimulating:E||!!He}),o.jsxs("main",{className:"pt-20",children:[o.jsx(_5,{onRunScenario:W,onPasteSimulation:ce}),o.jsx(I5,{onFullAnalysis:xe}),o.jsx(G5,{}),o.jsx("div",{ref:r,children:o.jsx(M5,{onExplain:ft,isLoading:E})}),o.jsx(J5,{onSelect:le}),o.jsx(a3,{}),o.jsx(Q5,{}),o.jsx("div",{ref:n,children:o.jsx(Z5,{onSelectScenario:z,onCustomScenario:X,onCalculate:oe,selectedId:(i==null?void 0:i.id)||null,customText:l,isLoading:E,hasScenario:wt})}),Fo&&o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsx(ZT,{mode:x,onChange:v}),o.jsx(JT,{})]}),x==="goal"&&o.jsx(eA,{values:w,onChange:S}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsx(GT,{stakeholders:f,onChange:p}),o.jsx(qT,{values:m,onChange:y})]}),o.jsx(XT,{value:g,onChange:b}),o.jsx(bP,{values:d,onChange:he,showRecalculate:L,onRecalculate:oe})]})})}),E&&o.jsx(v3,{}),o.jsx("div",{ref:s}),j&&!E&&o.jsx(W5,{result:j}),He&&N&&o.jsx("section",{className:"border-t border-border py-6",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsx("div",{className:"mx-auto max-w-5xl",children:o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("h2",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"SIMULATED FUTURE"}),N.confidence&&o.jsx(nA,{confidence:N.confidence})]}),N.lastRequest&&o.jsx(DA,{request:N.lastRequest,title:zo})]})})})}),He&&(N==null?void 0:N.keyAssumptions)&&o.jsx(sA,{assumptions:N.keyAssumptions}),He&&N&&o.jsx(jA,{result:N}),He&&N&&o.jsx(EA,{challenges:N.challenges}),He&&N&&o.jsx(_A,{recommendations:N.recommendations}),He&&(N==null?void 0:N.goalResult)&&o.jsx(OA,{goalResult:N.goalResult,onForkStrategy:Ue}),He&&(N==null?void 0:N.goalResult)&&o.jsx($A,{strategy:N.goalResult.strategies.find(ee=>ee.id===N.goalResult.recommended_strategy_id)||N.goalResult.strategies[0],onInjectEvent:We,forkedTimeline:F}),He&&(N==null?void 0:N.governance)&&o.jsx(UA,{governance:N.governance}),o.jsx(g3,{}),He&&N&&o.jsx(WA,{report:V,governance:A,isGenerating:Y,aiEnabled:J,provider:me,onGenerate:Vt,onToggleAI:Z})]}),o.jsx(x3,{}),o.jsx(k5,{governance:He&&(N!=null&&N.governance)?N.governance:void 0})]})};function N3(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Em="ScrollArea",[Dw,l4]=zt(Em),[k3,Bt]=Dw(Em),Fw=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...a}=e,[l,c]=h.useState(null),[d,u]=h.useState(null),[f,p]=h.useState(null),[m,y]=h.useState(null),[g,b]=h.useState(null),[x,v]=h.useState(0),[w,S]=h.useState(0),[N,k]=h.useState(!1),[j,C]=h.useState(!1),E=ie(t,P=>c(P)),R=Oo(s);return o.jsx(k3,{scope:n,type:r,dir:R,scrollHideDelay:i,scrollArea:l,viewport:d,onViewportChange:u,content:f,onContentChange:p,scrollbarX:m,onScrollbarXChange:y,scrollbarXEnabled:N,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:j,onScrollbarYEnabledChange:C,onCornerWidthChange:v,onCornerHeightChange:S,children:o.jsx(Q.div,{dir:R,...a,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});Fw.displayName=Em;var zw="ScrollAreaViewport",Bw=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=e,a=Bt(zw,n),l=h.useRef(null),c=ie(t,l,a.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),o.jsx(Q.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:o.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Bw.displayName=zw;var Rn="ScrollAreaScrollbar",_m=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Bt(Rn,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,l=e.orientation==="horizontal";return h.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),s.type==="hover"?o.jsx(j3,{...r,ref:t,forceMount:n}):s.type==="scroll"?o.jsx(C3,{...r,ref:t,forceMount:n}):s.type==="auto"?o.jsx(Vw,{...r,ref:t,forceMount:n}):s.type==="always"?o.jsx(Rm,{...r,ref:t}):null});_m.displayName=Rn;var j3=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Bt(Rn,e.__scopeScrollArea),[i,a]=h.useState(!1);return h.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),a(!0)},u=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",u)}}},[s.scrollArea,s.scrollHideDelay]),o.jsx(Kn,{present:n||i,children:o.jsx(Vw,{"data-state":i?"visible":"hidden",...r,ref:t})})}),C3=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Bt(Rn,e.__scopeScrollArea),i=e.orientation==="horizontal",a=gc(()=>c("SCROLL_END"),100),[l,c]=N3("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,s.scrollHideDelay,c]),h.useEffect(()=>{const d=s.viewport,u=i?"scrollLeft":"scrollTop";if(d){let f=d[u];const p=()=>{const m=d[u];f!==m&&(c("SCROLL"),a()),f=m};return d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[s.viewport,i,c,a]),o.jsx(Kn,{present:n||l!=="hidden",children:o.jsx(Rm,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:K(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:K(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Vw=h.forwardRef((e,t)=>{const n=Bt(Rn,e.__scopeScrollArea),{forceMount:r,...s}=e,[i,a]=h.useState(!1),l=e.orientation==="horizontal",c=gc(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?d:u)}},10);return ui(n.viewport,c),ui(n.content,c),o.jsx(Kn,{present:r||i,children:o.jsx(Rm,{"data-state":i?"visible":"hidden",...s,ref:t})})}),Rm=h.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=Bt(Rn,e.__scopeScrollArea),i=h.useRef(null),a=h.useRef(0),[l,c]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Kw(l.viewport,l.content),u={...r,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:p=>a.current=p};function f(p,m){return A3(p,a.current,l,m)}return n==="horizontal"?o.jsx(E3,{...u,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const p=s.viewport.scrollLeft,m=cg(p,l,s.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollLeft=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollLeft=f(p,s.dir))}}):n==="vertical"?o.jsx(_3,{...u,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const p=s.viewport.scrollTop,m=cg(p,l);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollTop=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollTop=f(p))}}):null}),E3=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=Bt(Rn,e.__scopeScrollArea),[a,l]=h.useState(),c=h.useRef(null),d=ie(t,c,i.onScrollbarXChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(Ww,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":hc(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),qw(p,f)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:bl(a.paddingLeft),paddingEnd:bl(a.paddingRight)}})}})}),_3=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=Bt(Rn,e.__scopeScrollArea),[a,l]=h.useState(),c=h.useRef(null),d=ie(t,c,i.onScrollbarYChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(Ww,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":hc(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),qw(p,f)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:bl(a.paddingTop),paddingEnd:bl(a.paddingBottom)}})}})}),[R3,Uw]=Dw(Rn),Ww=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:u,onResize:f,...p}=e,m=Bt(Rn,n),[y,g]=h.useState(null),b=ie(t,E=>g(E)),x=h.useRef(null),v=h.useRef(""),w=m.viewport,S=r.content-r.viewport,N=ze(u),k=ze(c),j=gc(f,10);function C(E){if(x.current){const R=E.clientX-x.current.left,P=E.clientY-x.current.top;d({x:R,y:P})}}return h.useEffect(()=>{const E=R=>{const P=R.target;(y==null?void 0:y.contains(P))&&N(R,S)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[w,y,S,N]),h.useEffect(k,[r,k]),ui(y,j),ui(m.content,j),o.jsx(R3,{scope:n,scrollbar:y,hasThumb:s,onThumbChange:ze(i),onThumbPointerUp:ze(a),onThumbPositionChange:k,onThumbPointerDown:ze(l),children:o.jsx(Q.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:K(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),x.current=y.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),C(E))}),onPointerMove:K(e.onPointerMove,C),onPointerUp:K(e.onPointerUp,E=>{const R=E.target;R.hasPointerCapture(E.pointerId)&&R.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=v.current,m.viewport&&(m.viewport.style.scrollBehavior=""),x.current=null})})})}),yl="ScrollAreaThumb",Hw=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Uw(yl,e.__scopeScrollArea);return o.jsx(Kn,{present:n||s.hasThumb,children:o.jsx(P3,{ref:t,...r})})}),P3=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,i=Bt(yl,n),a=Uw(yl,n),{onThumbPositionChange:l}=a,c=ie(t,f=>a.onThumbChange(f)),d=h.useRef(void 0),u=gc(()=>{d.current&&(d.current(),d.current=void 0)},100);return h.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(u(),!d.current){const m=I3(f,l);d.current=m,l()}};return l(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,u,l]),o.jsx(Q.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:K(e.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),y=f.clientX-m.left,g=f.clientY-m.top;a.onThumbPointerDown({x:y,y:g})}),onPointerUp:K(e.onPointerUp,a.onThumbPointerUp)})});Hw.displayName=yl;var Pm="ScrollAreaCorner",Gw=h.forwardRef((e,t)=>{const n=Bt(Pm,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?o.jsx(T3,{...e,ref:t}):null});Gw.displayName=Pm;var T3=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=Bt(Pm,n),[i,a]=h.useState(0),[l,c]=h.useState(0),d=!!(i&&l);return ui(s.scrollbarX,()=>{var f;const u=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(u),c(u)}),ui(s.scrollbarY,()=>{var f;const u=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(u),a(u)}),d?o.jsx(Q.div,{...r,ref:t,style:{width:i,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function bl(e){return e?parseInt(e,10):0}function Kw(e,t){const n=e/t;return isNaN(n)?0:n}function hc(e){const t=Kw(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function A3(e,t,n,r="ltr"){const s=hc(n),i=s/2,a=t||i,l=s-a,c=n.scrollbar.paddingStart+a,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,u=n.content-n.viewport,f=r==="ltr"?[0,u]:[u*-1,0];return Yw([c,d],f)(e)}function cg(e,t,n="ltr"){const r=hc(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,a=t.content-t.viewport,l=i-r,c=n==="ltr"?[0,a]:[a*-1,0],d=wo(e,c);return Yw([0,a],[0,l])(d)}function Yw(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function qw(e,t){return e>0&&e<t}var I3=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,l=n.top!==i.top;(a||l)&&t(),n=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function gc(e,t){const n=ze(e),r=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),h.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function ui(e,t){const n=ze(t);Ve(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var Qw=Fw,M3=Bw,O3=Gw;const Xw=h.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Qw,{ref:r,className:$("relative overflow-hidden",e),...n,children:[o.jsx(M3,{className:"h-full w-full rounded-[inherit]",children:t}),o.jsx(Jw,{}),o.jsx(O3,{})]}));Xw.displayName=Qw.displayName;const Jw=h.forwardRef(({className:e,orientation:t="vertical",...n},r)=>o.jsx(_m,{ref:r,orientation:t,className:$("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:o.jsx(Hw,{className:"relative flex-1 rounded-full bg-border"})}));Jw.displayName=_m.displayName;var L3="Separator",dg="horizontal",$3=["horizontal","vertical"],Zw=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=dg,...s}=e,i=D3(r)?r:dg,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return o.jsx(Q.div,{"data-orientation":i,...l,...s,ref:t})});Zw.displayName=L3;function D3(e){return $3.includes(e)}var e1=Zw;const bs=h.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>o.jsx(e1,{ref:s,decorative:n,orientation:t,className:$("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));bs.displayName=e1.displayName;function ug(e,t){const n=e.map(f=>f.impact),r=n.reduce((f,p)=>f+p,0)/n.length,s=n.reduce((f,p)=>f+(p-r)**2,0)/n.length,i=n.filter(f=>f>.2).length,a=n.filter(f=>f<-.2).length,l=n.length,c=l>0?Math.min(1,Math.min(i,a)/(l*.5)*(s*4)):0,d=n.filter(f=>f<0).reduce((f,p)=>f+Math.abs(p),0)/Math.max(1,n.length),u=Math.min(1,d*1.5);return{polarization:c,outrage:u,avgImpact:r,variance:s}}function Or(e,t,n=3){if(e.length<2)return"stable";const r=e.slice(-n);if(r.length<2)return"stable";const s=r[0][t],a=r[r.length-1][t]-s;return a>.1?"rising":a<-.1?"falling":"stable"}function F3(e){const t=is(e),n=[];let r=0;for(const s of t.rules){const i=s.description.toLowerCase();(i.includes("spread")||i.includes("propagat")||i.includes("viral")||i.includes("limit reach")||i.includes("contain")||i.includes("quarantine"))&&n.push({id:`DYN-PROP-${++r}`,description:s.description,type:"propagation",threshold:.6,strength:s.category==="prohibit"?.8:s.category==="limit"?.5:.3,monitors:"informationVelocity",active:!0}),(i.includes("amplif")||i.includes("media")||i.includes("influence")||i.includes("boost")||i.includes("visibil")||i.includes("platform"))&&n.push({id:`DYN-AMP-${++r}`,description:s.description,type:"amplification",threshold:.5,strength:s.category==="prohibit"?.7:.4,monitors:"amplification",active:!0}),(i.includes("cascade")||i.includes("circuit")||i.includes("runaway")||i.includes("feedback")||i.includes("spiral")||i.includes("chain reaction")||i.includes("contagion")||i.includes("panic"))&&n.push({id:`DYN-CASC-${++r}`,description:s.description,type:"cascade",threshold:.7,strength:.9,monitors:"cascadeRisk",active:!0}),(i.includes("trust")||i.includes("legitim")||i.includes("credib")||i.includes("transparen")||i.includes("accountab")||i.includes("institution"))&&n.push({id:`DYN-TRUST-${++r}`,description:s.description,type:"trust",threshold:.4,strength:.5,monitors:"trust",active:!0}),(i.includes("dampen")||i.includes("cool")||i.includes("de-escalat")||i.includes("moderate")||i.includes("calm")||i.includes("stabiliz"))&&n.push({id:`DYN-FEED-${++r}`,description:s.description,type:"feedback",threshold:.5,strength:.6,monitors:"outrage",active:!0}),(i.includes("pause")||i.includes("halt")||i.includes("freeze")||i.includes("cooling")||i.includes("moratorium")||i.includes("waiting period"))&&n.push({id:`DYN-COOL-${++r}`,description:s.description,type:"cooling",threshold:.7,strength:.8,monitors:"outrage",active:!0})}return n.length===0&&n.push({id:"DYN-BASE-1",description:"Default propagation control — limit information spread during high outrage",type:"propagation",threshold:.7,strength:.4,monitors:"informationVelocity",active:!0},{id:"DYN-BASE-2",description:"Default cascade protection — activate circuit breaker during crisis",type:"cascade",threshold:.8,strength:.7,monitors:"cascadeRisk",active:!0}),n}function z3(e,t,n){const r=n!=null&&n.skipRules?[]:F3(e);let s={polarization:.1,outrage:.1,trust:.7,informationVelocity:.3,amplification:1,cascadeRisk:.1,contagionDepth:2,coolingPeriod:0,history:[],...t};const i={totalRounds:0,totalInterventions:0,propagationLimits:0,amplificationDampens:0,cascadeBreakers:0,coolingPeriods:0,trustBoosts:0,peakOutrage:0,peakPolarization:0,peakCascadeRisk:0,trustSum:0};function a(c,d,u){i.totalRounds++;const f=[],p=[],m=c.map(v=>({...v})),y=ug(c);if(s.polarization=s.polarization*.6+y.polarization*.4,s.outrage=s.outrage*.5+y.outrage*.5,s.informationVelocity=Math.min(1,.3+y.variance*2),s.cascadeRisk=Math.min(1,s.outrage*.3+s.polarization*.2+s.informationVelocity*.2+(1-s.trust)*.3),s.outrage>.5?s.trust=Math.max(.05,s.trust-.05*s.outrage):s.outrage<.2&&(s.trust=Math.min(1,s.trust+.02)),i.peakOutrage=Math.max(i.peakOutrage,s.outrage),i.peakPolarization=Math.max(i.peakPolarization,s.polarization),i.peakCascadeRisk=Math.max(i.peakCascadeRisk,s.cascadeRisk),i.trustSum+=s.trust,s.coolingPeriod>0){const v=.4+s.coolingPeriod*.1;for(const w of m)w.impact<-.1&&(w.impact,w.impact=w.impact*(1-v),w.confidence=Math.max(.1,w.confidence*.7));f.push({type:"COOLING_PERIOD",description:`Cooling period active (${s.coolingPeriod} rounds remaining) — reactive posting dampened by ${(v*100).toFixed(0)}%`,triggeredBy:"COOLING_PERIOD",agentsAffected:m.filter(w=>w.impact<-.1).length,magnitude:v,effect:{metric:"outrage",before:s.outrage,after:s.outrage*(1-v*.3)}}),s.coolingPeriod--,i.coolingPeriods++}for(const v of r)if(v.active)switch(s[v.monitors],v.type){case"propagation":{if(s.informationVelocity>v.threshold||s.outrage>.6){const w=1-v.strength*.5;let S=0;const N=s.contagionDepth;s.contagionDepth=Math.max(1,Math.floor(s.contagionDepth*w));for(const k of m)Math.abs(k.impact)>.4&&(k.impact,k.impact=k.impact*w,S++);if(S>0){const k=s.informationVelocity;s.informationVelocity*=w,f.push({type:"PROPAGATION_LIMIT",description:`Propagation limited: spread depth ${N} → ${s.contagionDepth}, ${S} extreme agents dampened (${v.description})`,triggeredBy:v.id,agentsAffected:S,magnitude:v.strength,effect:{metric:"informationVelocity",before:k,after:s.informationVelocity}}),p.push(v.id),i.propagationLimits++,i.totalInterventions++}}break}case"amplification":{const w=Or(s.history,"polarization");if(s.polarization>v.threshold||w==="rising"){const S=1-v.strength*.4;let N=0;for(const k of m){const j=(u==null?void 0:u.get(k.stakeholder_id))??"";(j.toLowerCase().includes("media")||j.toLowerCase().includes("influencer")||k.stakeholder_id.toLowerCase().includes("media")||k.stakeholder_id.toLowerCase().includes("记者")||k.stakeholder_id.toLowerCase().includes("媒")||Math.abs(k.impact)>.6)&&(k.impact,k.impact=k.impact*S,k.confidence=Math.max(.15,k.confidence*.8),N++)}if(N>0){const k=s.amplification;s.amplification*=S,f.push({type:"AMPLIFICATION_DAMPEN",description:`Amplification dampened: ${N} high-influence agents reduced by ${((1-S)*100).toFixed(0)}% (polarization ${s.polarization.toFixed(2)}, trend: ${w}) — ${v.description}`,triggeredBy:v.id,agentsAffected:N,magnitude:v.strength,effect:{metric:"amplification",before:k,after:s.amplification}}),p.push(v.id),i.amplificationDampens++,i.totalInterventions++}}break}case"cascade":{if(s.cascadeRisk>v.threshold){const w=Or(s.history,"outrage")==="rising",S=w?v.strength:v.strength*.6;let N=0;for(const j of m)j.impact<-.15&&(j.impact,j.impact=j.impact*(1-S),j.confidence=Math.max(.1,j.confidence*(1-S*.5)),N++);s.coolingPeriod===0&&w&&(s.coolingPeriod=2);const k=s.cascadeRisk;s.cascadeRisk*=1-S*.4,f.push({type:"CASCADE_BREAKER",description:`CASCADE CIRCUIT BREAKER: ${N} agents compressed, cascade risk ${k.toFixed(2)} → ${s.cascadeRisk.toFixed(2)}${w?" + cooling period activated":""} — ${v.description}`,triggeredBy:v.id,agentsAffected:N,magnitude:S,effect:{metric:"cascadeRisk",before:k,after:s.cascadeRisk}}),p.push(v.id),i.cascadeBreakers++,i.totalInterventions++}break}case"trust":{if(s.trust<v.threshold){let w=0;for(const S of m){const N=(u==null?void 0:u.get(S.stakeholder_id))??"",k=N.toLowerCase().includes("official")||N.toLowerCase().includes("government")||N.toLowerCase().includes("institution")||S.stakeholder_id.toLowerCase().includes("regulator")||S.stakeholder_id.toLowerCase().includes("central")||S.stakeholder_id.toLowerCase().includes("official")||S.stakeholder_id.toLowerCase().includes("管理")||S.stakeholder_id.toLowerCase().includes("官方");k&&S.impact>-.2?(S.impact,S.impact=Math.min(1,S.impact*1.3+.1),S.confidence=Math.min(1,S.confidence*1.2),w++):!k&&S.impact<-.3&&(S.impact=S.impact*.7,w++)}if(w>0){const S=s.trust;s.trust=Math.min(1,s.trust+.03*v.strength),f.push({type:"TRUST_BOOST",description:`Trust-responsive visibility: official sources boosted, unverified claims dampened (trust ${S.toFixed(2)} → ${s.trust.toFixed(2)}) — ${v.description}`,triggeredBy:v.id,agentsAffected:w,magnitude:v.strength,effect:{metric:"trust",before:S,after:s.trust}}),p.push(v.id),i.trustBoosts++,i.totalInterventions++}}break}case"feedback":{const w=Or(s.history,"outrage");if(s.outrage>v.threshold&&w==="rising"){const S=1-v.strength*.35;let N=0;for(const k of m)Math.abs(k.impact)>.2&&(k.impact,k.impact=k.impact*S,N++);if(N>0){const k=s.outrage;s.outrage*=S,f.push({type:"FEEDBACK_DAMPEN",description:`Feedback loop dampened: ${N} reactive agents moderated, outrage ${k.toFixed(2)} → ${s.outrage.toFixed(2)} (trend: ${w}) — ${v.description}`,triggeredBy:v.id,agentsAffected:N,magnitude:v.strength,effect:{metric:"outrage",before:k,after:s.outrage}}),p.push(v.id),i.totalInterventions++}}break}case"cooling":{s.outrage>v.threshold&&s.coolingPeriod===0&&(s.coolingPeriod=Math.ceil(v.strength*3),f.push({type:"COOLING_PERIOD",description:`Cooling period triggered: ${s.coolingPeriod} round(s) of dampened reactive posting (outrage: ${s.outrage.toFixed(2)}) — ${v.description}`,triggeredBy:v.id,agentsAffected:0,magnitude:v.strength,effect:{metric:"outrage",before:s.outrage,after:s.outrage}}),p.push(v.id),i.coolingPeriods++,i.totalInterventions++);break}}for(const v of m)v.impact=Math.max(-1,Math.min(1,v.impact)),v.impact=Number(v.impact.toFixed(3)),v.confidence=Math.max(.05,Math.min(1,v.confidence)),v.confidence=Number(v.confidence.toFixed(3));const g=ug(m);s.history.push({round:d,polarization:Number(s.polarization.toFixed(3)),outrage:Number(s.outrage.toFixed(3)),trust:Number(s.trust.toFixed(3)),amplification:Number(s.amplification.toFixed(3)),cascadeRisk:Number(s.cascadeRisk.toFixed(3)),avgImpact:Number(g.avgImpact.toFixed(3)),agentCount:m.length});let b;s.coolingPeriod>0?b="cooling":s.cascadeRisk>.7?b="critical":Or(s.history,"outrage")==="rising"||Or(s.history,"polarization")==="rising"?b="escalating":Or(s.history,"outrage")==="falling"&&Or(s.history,"polarization")==="falling"?b="de-escalating":b="stable";const x=Math.min(1,s.cascadeRisk*.4+s.outrage*.3+s.polarization*.2+s.informationVelocity*.1);return{reactions:m,systemState:{...s,history:[...s.history]},interventions:f,rulesFired:p,trajectory:b,predictedRisk:Number(x.toFixed(3))}}function l(){s={polarization:.1,outrage:.1,trust:.7,informationVelocity:.3,amplification:1,cascadeRisk:.1,contagionDepth:2,coolingPeriod:0,history:[],...t},i.totalRounds=0,i.totalInterventions=0,i.propagationLimits=0,i.amplificationDampens=0,i.cascadeBreakers=0,i.coolingPeriods=0,i.trustBoosts=0,i.peakOutrage=0,i.peakPolarization=0,i.peakCascadeRisk=0,i.trustSum=0}return{governRound:a,get state(){return{...s,history:[...s.history]}},mutateState(c){c(s)},get rules(){return[...r]},get stats(){return{totalRounds:i.totalRounds,totalInterventions:i.totalInterventions,propagationLimits:i.propagationLimits,amplificationDampens:i.amplificationDampens,cascadeBreakers:i.cascadeBreakers,coolingPeriods:i.coolingPeriods,trustBoosts:i.trustBoosts,peakOutrage:i.peakOutrage,peakPolarization:i.peakPolarization,peakCascadeRisk:i.peakCascadeRisk,averageTrust:i.totalRounds>0?Number((i.trustSum/i.totalRounds).toFixed(3)):.7}},reset:l}}const Ma=["Limit propagation of causal claims that lack multi-source evidence","Contain unvalidated hypotheses within originating research group","Quarantine findings that have not passed independent reproduction","Dampen amplification of self-citation loops exceeding 3 generations","Limit influence of popular findings that lack independent validation","Reduce visibility of papers with high citation velocity but low reproduction rate","Circuit break when cascade of dependent findings exceeds validation capacity","Halt chain reaction of derivative conclusions from unvalidated premises","Break feedback loops between competing research groups amplifying each other","Boost visibility of independently reproduced findings","Require transparency in methodology for all published artifacts","Prioritize credibility of findings with transparent provenance chains","Dampen rush-to-publish behavior during high-competition periods","Cool down reactive publication patterns when controversy index rises","Stabilize publication rate during peer review bottlenecks","Pause redundant investigation paths when convergence detected","Halt compute-intensive explorations that show no evidence of progress"].join(`
|
|
519
|
-
`),B3={polarization:.15,outrage:.05,trust:.8,informationVelocity:.4,amplification:.6,cascadeRisk:.05,contagionDepth:3,coolingPeriod:0};function md(e){const t=e.polarization>.6?"critical":e.polarization>.3?"elevated":"healthy",n=e.outrage>.5?"dangerous":e.outrage>.2?"elevated":"normal",r=e.trust>.7?"high":e.trust>.4?"moderate":"crisis",s=e.amplification>1.5?"echo chamber":e.amplification>.8?"amplified":"organic",i=e.cascadeRisk>.5?"high":e.cascadeRisk>.2?"moderate":"controlled",a=e.informationVelocity>.7?"frantic":e.informationVelocity>.3?"active":"stalled";let l;return e.trust>.6&&e.cascadeRisk<.3&&e.polarization<.4?l="Healthy discovery — findings are converging with evidence support":e.cascadeRisk>.6?l="False positive cascade risk — unvalidated findings propagating through citations":e.polarization>.6?l="Field fragmentation — competing hypotheses without resolution mechanism":e.trust<.3?l="Reproducibility crisis — institutional credibility collapsing":l="Active investigation — governance maintaining discovery quality",{hypothesisFragmentation:`${t} (${(e.polarization*100).toFixed(0)}%)`,publicationPressure:`${n} (${(e.outrage*100).toFixed(0)}%)`,reproducibilityConfidence:`${r} (${(e.trust*100).toFixed(0)}%)`,citationHealth:`${s} (${e.amplification.toFixed(2)}x)`,falsePositiveRisk:`${i} (${(e.cascadeRisk*100).toFixed(0)}%)`,discoveryVelocity:`${a} (${(e.informationVelocity*100).toFixed(0)}%)`,overallAssessment:l}}function V3(e){let t;switch(e.type){case"hypothesis":t="publish_hypothesis";break;case"experiment":t="run_experiment";break;case"dataset":t="publish_dataset";break;case"model":t="publish_model";break;case"paper":t="publish_paper";break;case"review":t="publish_review";break;case"replication":t="publish_replication";break;default:t="publish";break}const n=Math.min(1,e.citations/10),r=e.confidence*.6+n*.4;return{agentId:e.agentId,type:t,description:e.description,magnitude:Number(r.toFixed(3)),context:{artifactId:e.id,artifactType:e.type,provenance:e.provenance,reproduced:e.reproduced,citations:e.citations,skill:e.skill}}}function fg(e,t,n=!0){const r=new Map;for(const s of t)for(const i of s.artifactIds){const a=r.get(i)??0,l=s.matchType==="confirmation"?s.strength*.3:s.matchType==="contradiction"?-s.strength*.2:s.matchType==="synthesis"?s.strength*.4:s.strength*.15;r.set(i,a+l)}return e.map(s=>{const i=Math.min(.2,s.provenance.length*.05),a=s.reproduced?.15:0,l=r.get(s.id)??0;let c=s.confidence-.3+i+a+l;!s.reproduced&&s.citations>5&&(c-=.2);const d=s.provenance.filter(u=>e.some(f=>f.id===u&&f.agentId===s.agentId)).length;return d>1&&(c-=d*.1),n||(s.reproduced||(c*=1.4,s.confidence<.5&&(c-=.25)),s.provenance.length===0&&s.type!=="hypothesis"&&(c-=.2),!s.reproduced&&s.citations>3&&(c-=.15)),c=Math.max(-1,Math.min(1,c)),{stakeholder_id:s.agentId,reaction:`[${s.type}] ${s.description}`,confidence:n?s.confidence:Math.max(.1,s.confidence*.85),impact:Number(c.toFixed(3)),trigger:s.provenance.length>0?`builds on ${s.provenance.length} prior artifact(s)`:"novel investigation"}})}function U3(e,t,n){const r=e.history;if(r.length<n+1)return{detected:!1,assessment:"Insufficient data for convergence detection"};const s=r.slice(-n);let i=!0;for(let d=1;d<s.length;d++){const u=Math.abs(s[d].trust-s[d-1].trust),f=Math.abs(s[d].polarization-s[d-1].polarization),p=Math.abs(s[d].outrage-s[d-1].outrage);if(u>t||f>t||p>t){i=!1;break}}if(i&&e.trust>.5&&e.cascadeRisk<.3)return{detected:!0,assessment:`Convergence detected: system stable for ${n} cycles with trust ${(e.trust*100).toFixed(0)}% and cascade risk ${(e.cascadeRisk*100).toFixed(0)}%`};if(i&&e.trust<=.5)return{detected:!1,assessment:`Metrics stable but trust too low (${(e.trust*100).toFixed(0)}%) — may be converging on noise`};if(i&&e.cascadeRisk>=.3)return{detected:!1,assessment:`Metrics stable but cascade risk elevated (${(e.cascadeRisk*100).toFixed(0)}%) — false positive risk persists`};const a=[],l=s[0],c=s[s.length-1];return c.trust>l.trust+t&&a.push("trust improving"),c.trust<l.trust-t&&a.push("trust declining"),c.polarization>l.polarization+t&&a.push("fragmentation increasing"),c.outrage>l.outrage+t&&a.push("publication pressure rising"),{detected:!1,assessment:a.length>0?`Active dynamics: ${a.join(", ")}`:"System in flux — no clear convergence trend"}}function W3(e,t,n){const r=[];e.cascadeRisk>.5&&r.push("FALSE_POSITIVE_CASCADE: unvalidated findings propagating through citation chains"),e.polarization>.5&&r.push("HYPOTHESIS_FRAGMENTATION: competing theories splitting without resolution"),e.trust<.3&&r.push("REPRODUCIBILITY_CRISIS: institutional credibility collapsing"),e.outrage>.5&&r.push("PUBLICATION_PRESSURE: agents rushing to publish without adequate validation"),e.amplification>1.5&&r.push("CITATION_ECHO_CHAMBER: popular findings amplified beyond evidence support");const s=t.filter(a=>!a.reproduced&&a.citations>5);return s.length>0&&r.push(`UNVALIDATED_POPULAR: ${s.length} highly-cited artifact(s) lack reproduction`),n.filter(a=>a.matchType==="contradiction").length>t.length*.3&&r.push("HIGH_CONTRADICTION_RATE: >30% of reactor matches are contradictions"),r}function pd(e={}){const t=e.policyText??Ma,n=e.maxCycles??50,r=e.convergenceThreshold??.05,s=e.convergenceWindow??3,i=t.trim().length>0,a=Ly({policyText:t,sensitivity:.5}),l=z3(i?t:"",{...B3,...e.initialState},i?void 0:{skipRules:!0});let c=0;const d={total:0,approved:0,blocked:0,modified:0};function u(y){var k;const g=V3(y),b=l.state,x={volatility:b.outrage*100,liquidity:b.trust*100,polarization:b.polarization*100,cascade_risk:b.cascadeRisk*100},v=a.evaluate(g,x);switch(d.total++,v.status){case"ALLOW":d.approved++;break;case"BLOCK":d.blocked++;break;case"MODIFY":d.modified++;break;case"PAUSE":d.modified++;break}const w=[];let S=v.reason;!y.reproduced&&y.citations>3&&w.push("High citations without reproduction"),y.provenance.length===0&&y.type!=="hypothesis"&&w.push("No provenance chain — orphan artifact"),y.confidence<.3&&w.push("Low confidence artifact"),v.status==="BLOCK"?S=`Artifact blocked: ${y.type} from ${y.agentId} — ${v.reason}`:v.status==="MODIFY"&&(S=`Artifact modified: ${y.type} impact reduced — ${v.reason}`);const N={artifactId:y.id,verdict:v,scienceReason:S,riskFlags:w};return(k=e.onArtifact)==null||k.call(e,y,N),N}function f(y,g,b){var I,F;c++;let x=0,v=0,w=0;const S=[],N=new Set;for(const O of y){const V=u(O);V.verdict.status==="ALLOW"?(x++,S.push(O)):V.verdict.status==="BLOCK"?(v++,N.add(O.id)):(w++,S.push(O))}const k=g.filter(O=>!O.artifactIds.some(V=>N.has(V))),j=i?fg(S,k,!0):fg(y,g,!1);if(i&&y.length>0){const O=v/y.length;l.mutateState(V=>{O>0&&(V.informationVelocity=Math.max(.05,V.informationVelocity*(1-O*.5))),O>.1&&(V.trust=Math.min(1,V.trust+O*.08)),O>.1&&(V.cascadeRisk=Math.max(0,V.cascadeRisk-O*.12))})}if(b){const O=l.state;b.controversyIndex>.3&&(O.outrage=Math.min(1,O.outrage+b.controversyIndex*.1)),b.commentActivity>.5&&(O.informationVelocity=Math.min(1,O.informationVelocity+b.commentActivity*.05))}const C=l.governRound(j,c);if(!i){const V=y.filter(D=>!D.reproduced).length/Math.max(1,y.length),_=y.filter(D=>D.citations>3&&!D.reproduced).length,A=y.filter(D=>D.provenance.length===0&&D.type!=="hypothesis").length;l.mutateState(D=>{D.trust=Math.max(.05,D.trust-V*.12-.04),D.cascadeRisk=Math.min(1,D.cascadeRisk+_*.06+A*.03+.05),D.polarization=Math.min(1,D.polarization+V*.06+.03),D.informationVelocity=Math.min(1,D.informationVelocity+.05),D.outrage=Math.min(1,D.outrage+V*.08+.02),D.amplification=Math.min(3,D.amplification+_*.08+.04)})}const E=l.state,R=U3(E,r,s);R.detected&&((I=e.onConvergence)==null||I.call(e,c,R.assessment));const P=W3(E,y,g),T={...E,history:[...E.history]},L={cycle:c,artifactsSubmitted:y.length,artifactsApproved:x,artifactsBlocked:v,artifactsModified:w,dynamics:C,scienceState:md(T),systemState:T,convergenceDetected:R.detected,convergenceAssessment:R.assessment,riskFlags:P,interventions:C.interventions};return(F=e.onCycleComplete)==null||F.call(e,L),L}function p(y,g,b){var E,R;m();const x=[],v=[],w=[];let S=!1,N="";for(let P=0;P<y.length&&P<n;P++){const T=y[P],L=(g==null?void 0:g[P])??[],I=b==null?void 0:b[P],F=f(T,L,I);if(x.push(F),v.push(...F.interventions),w.push({cycle:F.cycle,detected:F.convergenceDetected,assessment:F.convergenceAssessment}),F.systemState.cascadeRisk>.9){S=!0,N="False positive cascade risk exceeded 90% — investigation halted for safety",(E=e.onHalt)==null||E.call(e,N,F.cycle);break}if(F.systemState.trust<.1){S=!0,N="Reproducibility trust collapsed below 10% — investigation halted",(R=e.onHalt)==null||R.call(e,N,F.cycle);break}if(F.convergenceDetected)break}const k=l.state,j=w[w.length-1];let C;return S?C="halted":j!=null&&j.detected?C="converged":k.polarization>.6?C="diverged":C="inconclusive",{totalCycles:x.length,cycles:x,finalState:k,finalScienceState:md(k),actionGovernance:{totalEvaluations:d.total,approved:d.approved,blocked:d.blocked,modified:d.modified},dynamicsGovernance:l.stats,allInterventions:v,convergenceHistory:w,verdict:C,stateTimeline:k.history}}function m(){l.reset(),c=0,d.total=0,d.approved=0,d.blocked=0,d.modified=0}return{governArtifact:u,governCycle:f,runGovernedInvestigation:p,get scienceState(){return md(l.state)},get state(){return l.state},get dynamicsGovernor(){return l},get actionGovernor(){return a},get stats(){return l.stats},reset:m}}function H3(){const e=["agent_alpha","agent_beta","agent_gamma","agent_delta","agent_epsilon"],t=[],n=[];let r=0;{const s=e.map(i=>({id:`art_${++r}`,agentId:i,type:"hypothesis",description:`Initial hypothesis about material property X from ${i}`,confidence:.3+Math.random()*.3,provenance:[],citations:0,reproduced:!1}));t.push(s),n.push([])}{const s=e.slice(0,4).map(i=>({id:`art_${++r}`,agentId:i,type:"experiment",description:`Computational experiment testing hypothesis from ${i}`,confidence:.4+Math.random()*.3,provenance:[`art_${e.indexOf(i)+1}`],citations:0,reproduced:!1,skill:"molecular_dynamics"}));t.push(s),n.push([{artifactIds:["art_6","art_7"],matchType:"confirmation",strength:.4,description:"Two experiments show similar trends"}])}{const s=[{id:`art_${++r}`,agentId:"agent_alpha",type:"paper",description:"Published paper claiming novel material property confirmed",confidence:.65,provenance:["art_1","art_6"],citations:3,reproduced:!1},{id:`art_${++r}`,agentId:"agent_beta",type:"paper",description:"Published paper with supporting evidence for property X",confidence:.6,provenance:["art_2","art_7"],citations:2,reproduced:!1},{id:`art_${++r}`,agentId:"agent_gamma",type:"dataset",description:"Published dataset from molecular dynamics simulation",confidence:.7,provenance:["art_3","art_8"],citations:1,reproduced:!1,skill:"molecular_dynamics"},{id:`art_${++r}`,agentId:"agent_delta",type:"review",description:"Critical review questioning methodology of alpha's paper",confidence:.5,provenance:["art_10"],citations:0,reproduced:!1}];t.push(s),n.push([{artifactIds:["art_10","art_11"],matchType:"confirmation",strength:.6,description:"Two papers reach same conclusion"},{artifactIds:["art_10","art_13"],matchType:"contradiction",strength:.5,description:"Review challenges paper methodology"}])}{const s=[{id:`art_${++r}`,agentId:"agent_epsilon",type:"paper",description:"Derivative paper citing alpha and beta's unvalidated findings",confidence:.55,provenance:["art_10","art_11"],citations:4,reproduced:!1},{id:`art_${++r}`,agentId:"agent_alpha",type:"paper",description:"Follow-up paper extending own findings (self-citation chain)",confidence:.7,provenance:["art_1","art_10"],citations:6,reproduced:!1},{id:`art_${++r}`,agentId:"agent_gamma",type:"replication",description:"Attempted replication of alpha's core finding",confidence:.45,provenance:["art_10"],citations:0,reproduced:!1,skill:"ab_initio"}];t.push(s),n.push([{artifactIds:["art_14","art_15"],matchType:"extension",strength:.5,description:"Derivative work building on cascade"},{artifactIds:["art_10","art_16"],matchType:"contradiction",strength:.7,description:"Replication fails to confirm original finding"}])}{const s=[{id:`art_${++r}`,agentId:"agent_beta",type:"paper",description:"Paper building on alpha's disputed findings",confidence:.5,provenance:["art_15","art_14"],citations:3,reproduced:!1},{id:`art_${++r}`,agentId:"agent_delta",type:"experiment",description:"Independent experiment contradicting the dominant hypothesis",confidence:.6,provenance:["art_13"],citations:0,reproduced:!1,skill:"ab_initio"},{id:`art_${++r}`,agentId:"agent_gamma",type:"replication",description:"Second replication attempt — partial confirmation with caveats",confidence:.55,provenance:["art_10","art_16"],citations:1,reproduced:!0}];t.push(s),n.push([{artifactIds:["art_18","art_16"],matchType:"confirmation",strength:.6,description:"Independent experiment confirms replication concerns"},{artifactIds:["art_19","art_10"],matchType:"confirmation",strength:.4,description:"Partial replication of original finding"}])}for(let s=6;s<=8;s++){const i=[{id:`art_${++r}`,agentId:e[s%e.length],type:s===6?"experiment":"replication",description:`${s===6?"Refined experiment":"Independent replication"} of core hypothesis with improved methodology`,confidence:.5+s*.05,provenance:[`art_${r-3}`,`art_${r-5}`],citations:s-4,reproduced:s>6,skill:"molecular_dynamics"},{id:`art_${++r}`,agentId:e[(s+1)%e.length],type:"paper",description:`Synthesis paper integrating validated findings from cycles 1-${s}`,confidence:.55+s*.04,provenance:[`art_${r-1}`,"art_19"],citations:s-3,reproduced:s>7}];t.push(i),n.push([{artifactIds:[i[0].id,i[1].id],matchType:"synthesis",strength:.4+s*.08,description:`Synthesis of experiment and paper in cycle ${s}`}])}return{artifactCycles:t,matchesByCycle:n}}function Pi({label:e,value:t,format:n="percent",status:r,trend:s,tooltip:i}){const a=n==="percent"?`${(t*100).toFixed(0)}%`:n==="multiplier"?`${t.toFixed(1)}x`:t.toFixed(2),l=r==="excellent"?"text-green-400":r==="good"?"text-emerald-400":r==="moderate"?"text-yellow-400":r==="poor"?"text-orange-400":r==="critical"?"text-red-400":"text-foreground",c=r==="excellent"?"bg-green-500/10":r==="good"?"bg-emerald-500/10":r==="moderate"?"bg-yellow-500/10":r==="poor"?"bg-orange-500/10":r==="critical"?"bg-red-500/10":"bg-muted/50",d=r==="excellent"?"bg-green-500":r==="good"?"bg-emerald-500":r==="moderate"?"bg-yellow-500":r==="poor"?"bg-orange-500":r==="critical"?"bg-red-500":"bg-primary",u=s==="up"?qf:s==="down"?Yf:null,f=o.jsxs("div",{className:$("rounded-lg border p-3 transition-colors",c,"border-border/50"),children:[o.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[o.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:e}),u&&o.jsx(u,{className:$("h-3 w-3",s==="up"?"text-green-400":"text-red-400")})]}),o.jsx("div",{className:$("text-lg font-bold tabular-nums",l),children:a}),o.jsx("div",{className:"mt-1.5 h-1.5 rounded-full bg-muted overflow-hidden",children:o.jsx("div",{className:$("h-full rounded-full transition-all duration-500",d),style:{width:`${Math.min(100,t*100)}%`}})})]});return i?o.jsxs(i_,{children:[o.jsx(o_,{asChild:!0,children:f}),o.jsx(ky,{side:"left",className:"max-w-[200px]",children:o.jsx("p",{className:"text-xs",children:i})})]}):f}function G3({event:e}){const t={block:{icon:To,color:"text-red-400",bg:"bg-red-500/10",border:"border-red-500/20"},slow:{icon:A0,color:"text-yellow-400",bg:"bg-yellow-500/10",border:"border-yellow-500/20"},boost:{icon:ns,color:"text-green-400",bg:"bg-green-500/10",border:"border-green-500/20"},break:{icon:Yl,color:"text-orange-400",bg:"bg-orange-500/10",border:"border-orange-500/20"},cool:{icon:Pr,color:"text-blue-400",bg:"bg-blue-500/10",border:"border-blue-500/20"}}[e.type],n=t.icon;return o.jsxs("div",{className:$("flex gap-2 p-2 rounded-md border text-xs",t.bg,t.border),children:[o.jsx(n,{className:$("h-3.5 w-3.5 mt-0.5 shrink-0",t.color)}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("span",{className:"text-muted-foreground",children:["Cycle ",e.cycle," — "]}),o.jsx("span",{className:"text-foreground",children:e.description})]})]})}function Ti({label:e,governed:t,ungoverned:n,format:r="percent",lowerIsBetter:s=!1}){const i=t-n,a=s?i<0:i>0,l=d=>r==="percent"?`${(d*100).toFixed(0)}%`:String(d),c=r==="percent"?`${i>0?"+":""}${(i*100).toFixed(0)}`:`${i>0?"+":""}${i}`;return o.jsxs("div",{className:"grid grid-cols-4 gap-2 py-1.5 text-xs items-center",children:[o.jsx("span",{className:"text-muted-foreground",children:e}),o.jsx("span",{className:"text-foreground font-mono text-right",children:l(t)}),o.jsx("span",{className:"text-muted-foreground font-mono text-right",children:l(n)}),o.jsx("span",{className:$("font-mono text-right font-medium",a?"text-green-400":i===0?"text-muted-foreground":"text-red-400"),children:c})]})}function K3(){const[e,t]=h.useState(!0),[n,r]=h.useState("scientific_discovery"),[s,i]=h.useState(""),[a,l]=h.useState(null),[c,d]=h.useState(null),[u,f]=h.useState(!1),[p,m]=h.useState(!1),[y,g]=h.useState(!1),[b,x]=h.useState(0),[v,w]=h.useState(0),[S,N]=h.useState([]),[k,j]=h.useState(null),[C,E]=h.useState(null),[R,P]=h.useState(null),[T,L]=h.useState(null),[I,F]=h.useState(!1),[O,V]=h.useState(!0),[_,A]=h.useState({total:0,approved:0,blocked:0,modified:0}),[D,Y]=h.useState({interventions:0,cascadeBreakers:0,coolingPeriods:0}),G=h.useRef(0);function J(z,X){return z>=X.excellent?"excellent":z>=X.good?"good":z>=X.moderate?"moderate":z>=X.poor?"poor":"critical"}function Z(z){return J(z,{excellent:.7,good:.5,moderate:.35,poor:.2})}function me(z){return z<.15?"excellent":z<.3?"good":z<.5?"moderate":z<.7?"poor":"critical"}function be(z,X){const he={PROPAGATION_LIMIT:"slow",AMPLIFICATION_DAMPEN:"slow",CASCADE_BREAKER:"break",COOLING_PERIOD:"cool",TRUST_BOOST:"boost",VISIBILITY_SHIFT:"boost",FEEDBACK_DAMPEN:"slow",NARRATIVE_REDIRECT:"boost",SYSTEM_STABILIZE:"boost"};return{id:`evt-${++G.current}`,cycle:X,type:he[z.type]??"slow",description:z.description.length>100?z.description.slice(0,100)+"...":z.description,timestamp:Date.now()}}const W={scientific_discovery:Ma,strict_validation:["Block all artifacts that lack independent validation from entering citation network","Halt propagation of any finding with fewer than 2 independent confirmations","Require full methodology transparency for all published results","Quarantine derivative work until parent findings are validated","Dampen citation amplification for all unreviewed artifacts"].join(`
|
|
520
|
-
`),adaptive_governance:["Limit propagation of unvalidated hypotheses based on current cascade risk level","Dampen citation amplification when self-citation loops detected","Circuit break false positive cascades when validation gap exceeds threshold","Boost visibility of reproduced findings over popular-but-unvalidated ones","Stabilize publication rate when peer review queue exceeds capacity","Cool down competitive publication surges during high-discovery periods"].join(`
|
|
521
|
-
`),minimal_governance:["Monitor all artifact publication patterns for cascade detection","Circuit break only when false positive cascade probability exceeds critical threshold","Require basic provenance metadata on all published artifacts","Report citation health metrics to all agents"].join(`
|
|
522
|
-
`)};function ce(){return n==="custom"?s:W[n]??Ma}const xe=h.useCallback(z=>{if(i(z),f(!1),z.trim().length>10){const X=is(z);l(X);const he=di(X);d(he)}else l(null),d(null)},[]);h.useEffect(()=>{if(n!=="custom"){const z=W[n]??Ma,X=is(z);l(X);const he=di(X);d(he),f(!0)}},[n]);const le=h.useCallback(async()=>{g(!0),N([]),j(null),E(null),P(null),L(null),x(0),A({total:0,approved:0,blocked:0,modified:0}),Y({interventions:0,cascadeBreakers:0,coolingPeriods:0}),G.current=0;const z=H3();w(z.artifactCycles.length);const X=ce();if(await new Promise(he=>setTimeout(he,50)),e){const oe=pd({policyText:X,onCycleComplete:We=>{x(We.cycle),j(We.scienceState),E(We.systemState);const Vt=We.interventions.map(wt=>be(wt,We.cycle));We.artifactsBlocked>0&&Vt.push({id:`evt-${++G.current}`,cycle:We.cycle,type:"block",description:`${We.artifactsBlocked} artifact(s) blocked — insufficient evidence`,timestamp:Date.now()}),Vt.length>0&&N(wt=>[...Vt,...wt].slice(0,50))}}).runGovernedInvestigation(z.artifactCycles,z.matchesByCycle);P(oe.verdict),A({total:oe.actionGovernance.totalEvaluations,approved:oe.actionGovernance.approved,blocked:oe.actionGovernance.blocked,modified:oe.actionGovernance.modified}),Y({interventions:oe.dynamicsGovernance.totalInterventions,cascadeBreakers:oe.dynamicsGovernance.cascadeBreakers,coolingPeriods:oe.dynamicsGovernance.coolingPeriods});const Ue=pd({policyText:""}).runGovernedInvestigation(z.artifactCycles,z.matchesByCycle);L({governed:{verdict:oe.verdict,cycles:oe.totalCycles,trust:oe.finalState.trust,polarization:oe.finalState.polarization,cascadeRisk:oe.finalState.cascadeRisk,blocked:oe.actionGovernance.blocked,interventions:oe.dynamicsGovernance.totalInterventions},ungoverned:{verdict:Ue.verdict,cycles:Ue.totalCycles,trust:Ue.finalState.trust,polarization:Ue.finalState.polarization,cascadeRisk:Ue.finalState.cascadeRisk,blocked:Ue.actionGovernance.blocked,interventions:Ue.dynamicsGovernance.totalInterventions}})}else{const oe=pd({policyText:"",onCycleComplete:ft=>{x(ft.cycle),j(ft.scienceState),E(ft.systemState)}}).runGovernedInvestigation(z.artifactCycles,z.matchesByCycle);P(oe.verdict),A({total:oe.actionGovernance.totalEvaluations,approved:oe.actionGovernance.approved,blocked:oe.actionGovernance.blocked,modified:oe.actionGovernance.modified})}g(!1)},[e,n,s]);return o.jsxs(Te,{className:"w-[360px] h-full flex flex-col border-l bg-card/95 backdrop-blur-sm",children:[o.jsxs(Xe,{className:"pb-3 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(jn,{className:"h-5 w-5 text-primary"}),o.jsx(Je,{className:"text-base",children:"NeuroVerse"})]}),o.jsx(Re,{variant:e?"default":"secondary",className:$("text-xs",e?"bg-primary/20 text-primary border-primary/30":""),children:e?"GOVERNED":"UNGOVERNED"})]}),o.jsx("p",{className:"text-[10px] text-muted-foreground tracking-wider uppercase",children:"Powered by ScienceClaw · Governed by NeuroVerse"}),o.jsx("div",{className:"flex items-center justify-between",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(mc,{checked:e,onCheckedChange:t,disabled:y}),o.jsx("span",{className:"text-sm text-muted-foreground",children:e?"Governance ON":"Governance OFF"})]})}),o.jsxs(cc,{value:n,onValueChange:r,disabled:y,children:[o.jsx(Lo,{className:"h-8 text-xs",children:o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(R0,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx(dc,{})]})}),o.jsxs($o,{children:[o.jsx(st,{value:"scientific_discovery",children:o.jsx("span",{className:"text-xs",children:"Scientific Discovery v1"})}),o.jsx(st,{value:"strict_validation",children:o.jsx("span",{className:"text-xs",children:"Strict Validation Gate"})}),o.jsx(st,{value:"adaptive_governance",children:o.jsx("span",{className:"text-xs",children:"Adaptive Quality Control"})}),o.jsx(st,{value:"minimal_governance",children:o.jsx("span",{className:"text-xs",children:"Minimal Governance"})}),o.jsx(st,{value:"custom",children:o.jsx("span",{className:"text-xs",children:"Custom (Write English)"})})]})]}),n==="custom"&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("textarea",{className:"w-full h-28 rounded-md border border-input bg-background px-3 py-2 text-xs font-mono ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 resize-none",placeholder:`Describe your rules in plain English.
|
|
523
|
-
One rule per line.
|
|
524
|
-
|
|
525
|
-
Examples:
|
|
526
|
-
- Block unvalidated hypotheses from spreading
|
|
527
|
-
- Require independent replication before citation
|
|
528
|
-
- Halt cascade when false positive risk exceeds 70%
|
|
529
|
-
- Dampen self-citation loops`,value:s,onChange:z=>xe(z.target.value),disabled:y}),s.trim().length===0&&!y&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"Try a starter policy:"}),o.jsx("div",{className:"flex flex-wrap gap-1",children:[{label:"Replication First",policy:["Block any hypothesis from spreading until independently replicated","Require at least 2 independent confirmations before citation","Halt cascade when false positive probability exceeds 60%","Monitor self-citation loops across all agents"].join(`
|
|
530
|
-
`)},{label:"Open Science",policy:["Require full methodology transparency for all published results","Block proprietary claims on publicly funded research","Encourage sharing of negative results and null findings","Monitor data provenance for all derivative work"].join(`
|
|
531
|
-
`)},{label:"Anti-Hype",policy:["Dampen citation amplification when media attention spikes","Limit publication rate when peer review backlog exceeds capacity","Halt viral spread of findings without expert consensus","Block sensationalized claims that lack statistical rigor"].join(`
|
|
532
|
-
`)}].map(z=>o.jsx("button",{type:"button",className:"rounded-full border border-border/60 bg-muted/20 px-2.5 py-0.5 text-[10px] text-muted-foreground hover:bg-primary/10 hover:text-primary hover:border-primary/30 transition-colors",onClick:()=>xe(z.policy),children:z.label},z.label))})]}),s.trim().length>0&&a&&a.rules.length===0&&o.jsx("div",{className:"text-[10px] text-muted-foreground/60 px-1",children:"No rules detected — try writing clearer directives (block, limit, require, halt, monitor...)"})]}),a&&a.rules.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:n==="custom"?"We interpreted your rules as:":"Active governance rules:"}),c&&o.jsxs(Re,{variant:"secondary",className:$("text-[10px] h-4 px-1.5",c.healthScore>=70?"bg-green-500/10 text-green-400":c.healthScore>=40?"bg-yellow-500/10 text-yellow-400":"bg-red-500/10 text-red-400"),children:[c.healthScore,"/100"]})]}),o.jsx("div",{className:"space-y-1 max-h-[140px] overflow-y-auto",children:a.rules.map(z=>o.jsxs("div",{className:$("flex items-start gap-1.5 rounded px-2 py-1 text-[10px]",z.enforcement==="structural"?"bg-primary/5 border border-primary/20":"bg-muted/30 border border-border/50"),children:[o.jsx("span",{className:$("shrink-0 mt-0.5 font-mono font-bold",z.category==="prohibit"?"text-red-400":z.category==="limit"?"text-yellow-400":z.category==="require"?"text-blue-400":z.category==="circuit_breaker"?"text-orange-400":z.category==="monitor"?"text-cyan-400":"text-muted-foreground"),children:z.category==="prohibit"?"BLOCK":z.category==="limit"?"LIMIT":z.category==="require"?"REQUIRE":z.category==="circuit_breaker"?"BREAK":z.category==="monitor"?"WATCH":"ADVISE"}),o.jsx("span",{className:"text-foreground/80",children:z.description})]},z.id))}),o.jsxs(yn,{open:p,onOpenChange:m,children:[o.jsxs(bn,{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70 hover:text-muted-foreground",children:[p?o.jsx(gt,{className:"h-3 w-3"}):o.jsx($n,{className:"h-3 w-3"}),a.summary.enforced," enforced, ",a.summary.advisory," advisory"]}),o.jsx(wn,{children:o.jsx("div",{className:"mt-1 rounded bg-muted/20 border border-border/40 px-2 py-1.5 text-[10px] text-muted-foreground space-y-0.5",children:c&&c.diagnostics.length>0?c.diagnostics.slice(0,5).map((z,X)=>o.jsxs("div",{className:"flex items-start gap-1",children:[o.jsx("span",{className:$("shrink-0",z.severity==="error"?"text-red-400":z.severity==="warning"?"text-yellow-400":"text-muted-foreground"),children:z.severity==="error"?"!":z.severity==="warning"?"~":"-"}),o.jsx("span",{children:z.message})]},X)):o.jsx("span",{className:"text-green-400",children:"No issues detected"})})})]}),n==="custom"&&!u&&o.jsxs(re,{size:"sm",variant:"outline",className:"w-full text-xs border-primary/30 text-primary hover:bg-primary/10",onClick:()=>f(!0),children:[o.jsx(qi,{className:"h-3.5 w-3.5 mr-1.5"}),"Confirm — enforce these rules"]})]}),o.jsx(re,{size:"sm",className:"w-full",onClick:le,disabled:y||n==="custom"&&!u,children:y?o.jsxs(o.Fragment,{children:[o.jsx(ll,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Running Cycle ",b,"/",v,"..."]}):n==="custom"&&!u?o.jsxs(o.Fragment,{children:[o.jsx(Yl,{className:"h-3.5 w-3.5 mr-1.5"}),"Confirm rules to run"]}):o.jsxs(o.Fragment,{children:[o.jsx(Io,{className:"h-3.5 w-3.5 mr-1.5"}),"Run Investigation"]})})]}),o.jsx(bs,{}),o.jsx(Xw,{className:"flex-1",children:o.jsxs(Ae,{className:"pt-4 space-y-4",children:[k&&C&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[o.jsx(T0,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Science Metrics"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pi,{label:"Convergence Quality",value:C.trust*.6+(1-C.polarization)*.4,status:Z(C.trust*.6+(1-C.polarization)*.4),tooltip:"Are hypotheses converging on truth, or on noise?"}),o.jsx(Pi,{label:"Reproducibility",value:C.trust,status:Z(C.trust),tooltip:"Can findings be independently validated?"}),o.jsx(Pi,{label:"Provenance Depth",value:Math.min(1,C.contagionDepth/5),format:"multiplier",status:J(C.contagionDepth/5,{excellent:.8,good:.6,moderate:.4,poor:.2}),tooltip:"How deep is the evidence chain?"}),o.jsx(Pi,{label:"Compute Efficiency",value:_.total>0?_.approved/_.total:1,status:J(_.total>0?_.approved/_.total:1,{excellent:.85,good:.7,moderate:.5,poor:.3}),tooltip:"Are we burning cycles on dead ends?"}),o.jsx(Pi,{label:"False Positive Control",value:1-C.cascadeRisk,status:me(C.cascadeRisk),tooltip:"How much garbage survives the pipeline?"})]})]}),o.jsx(bs,{}),(C.cascadeRisk>.4||C.polarization>.4||C.trust<.4)&&o.jsxs("div",{className:"space-y-1.5",children:[C.cascadeRisk>.4&&o.jsxs("div",{className:$("flex items-center gap-2 rounded-md px-2.5 py-1.5 text-xs border",C.cascadeRisk>.6?"bg-red-500/10 border-red-500/30 text-red-400":"bg-yellow-500/10 border-yellow-500/30 text-yellow-400"),children:[o.jsx(kr,{className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{children:C.cascadeRisk>.6?"CASCADE RISK — false positives propagating":"Elevated cascade risk — monitoring"})]}),C.polarization>.4&&o.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2.5 py-1.5 text-xs border bg-yellow-500/10 border-yellow-500/30 text-yellow-400",children:[o.jsx(Ao,{className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{children:"Hypothesis fragmentation — field splitting"})]}),C.trust<.4&&o.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2.5 py-1.5 text-xs border bg-orange-500/10 border-orange-500/30 text-orange-400",children:[o.jsx(I0,{className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{children:"Reproducibility confidence low"})]})]}),o.jsxs("div",{className:"rounded-lg border bg-muted/30 p-3",children:[o.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Assessment"}),o.jsx("div",{className:"text-sm text-foreground leading-relaxed",children:k.overallAssessment})]})]}),S.length>0&&o.jsxs(yn,{open:O,onOpenChange:V,children:[o.jsxs(bn,{className:"flex items-center gap-1.5 w-full",children:[O?o.jsx(gt,{className:"h-3.5 w-3.5 text-muted-foreground"}):o.jsx($n,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx(Qr,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Interventions"}),o.jsx(Re,{variant:"secondary",className:"ml-auto text-[10px] h-4 px-1.5",children:S.length})]}),o.jsx(wn,{children:o.jsxs("div",{className:"space-y-1.5 mt-2 max-h-[200px] overflow-y-auto",children:[S.slice(0,15).map(z=>o.jsx(G3,{event:z},z.id)),S.length>15&&o.jsxs("div",{className:"text-[10px] text-muted-foreground text-center py-1",children:["+",S.length-15," more"]})]})})]}),_.total>0&&o.jsxs(o.Fragment,{children:[o.jsx(bs,{}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[o.jsx(vu,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Governance Stats"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[o.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-center",children:[o.jsx("div",{className:"text-lg font-bold text-foreground tabular-nums",children:_.total}),o.jsx("div",{className:"text-muted-foreground",children:"Artifacts"})]}),o.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-center",children:[o.jsx("div",{className:"text-lg font-bold text-green-400 tabular-nums",children:_.approved}),o.jsx("div",{className:"text-muted-foreground",children:"Approved"})]}),o.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-center",children:[o.jsx("div",{className:"text-lg font-bold text-red-400 tabular-nums",children:_.blocked}),o.jsx("div",{className:"text-muted-foreground",children:"Blocked"})]}),o.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-center",children:[o.jsx("div",{className:"text-lg font-bold text-yellow-400 tabular-nums",children:D.interventions}),o.jsx("div",{className:"text-muted-foreground",children:"Interventions"})]})]})]})]}),R&&o.jsxs(o.Fragment,{children:[o.jsx(bs,{}),o.jsxs("div",{className:$("rounded-lg border p-3 text-center",R==="converged"?"bg-green-500/10 border-green-500/30":R==="halted"?"bg-red-500/10 border-red-500/30":R==="diverged"?"bg-orange-500/10 border-orange-500/30":"bg-yellow-500/10 border-yellow-500/30"),children:[o.jsx("div",{className:$("text-sm font-bold uppercase",R==="converged"?"text-green-400":R==="halted"?"text-red-400":R==="diverged"?"text-orange-400":"text-yellow-400"),children:R==="converged"?"CONVERGED":R.toUpperCase()}),o.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:R==="converged"?"Findings validated — evidence chain confirmed":R==="halted"?"Investigation halted — cascade risk exceeded safety threshold":R==="diverged"?"Hypotheses fragmented — no consensus reached":"Investigation ended — insufficient data for conclusion"})]})]}),T&&o.jsxs(o.Fragment,{children:[o.jsx(bs,{}),o.jsxs(yn,{open:I,onOpenChange:F,children:[o.jsx(bn,{asChild:!0,children:o.jsxs(re,{variant:"outline",size:"sm",className:"w-full text-xs",children:[I?o.jsx(gt,{className:"h-3 w-3 mr-1.5"}):o.jsx($n,{className:"h-3 w-3 mr-1.5"}),o.jsx(Kl,{className:"h-3 w-3 mr-1.5"}),"Governed vs Ungoverned"]})}),o.jsx(wn,{children:o.jsxs("div",{className:"mt-3 space-y-1",children:[o.jsxs("div",{className:"grid grid-cols-4 gap-2 text-[10px] text-muted-foreground font-semibold uppercase pb-1 border-b border-border/50",children:[o.jsx("span",{children:"Metric"}),o.jsx("span",{className:"text-right",children:"Gov"}),o.jsx("span",{className:"text-right",children:"Ungov"}),o.jsx("span",{className:"text-right",children:"Delta"})]}),o.jsx(Ti,{label:"Trust",governed:T.governed.trust,ungoverned:T.ungoverned.trust}),o.jsx(Ti,{label:"Fragment.",governed:T.governed.polarization,ungoverned:T.ungoverned.polarization,lowerIsBetter:!0}),o.jsx(Ti,{label:"Cascade",governed:T.governed.cascadeRisk,ungoverned:T.ungoverned.cascadeRisk,lowerIsBetter:!0}),o.jsx(Ti,{label:"Blocked",governed:T.governed.blocked,ungoverned:T.ungoverned.blocked,format:"number"}),o.jsx(Ti,{label:"Interv.",governed:T.governed.interventions,ungoverned:T.ungoverned.interventions,format:"number"})]})})]})]}),!k&&!y&&o.jsxs("div",{className:"text-center py-8 space-y-3",children:[o.jsx(NC,{className:"h-10 w-10 text-muted-foreground/30 mx-auto"}),o.jsx("div",{className:"text-sm text-muted-foreground",children:"Run an investigation to see live governance metrics"}),o.jsx("div",{className:"text-xs text-muted-foreground/60",children:"Toggle governance ON/OFF to compare outcomes"})]})]})}),o.jsx("div",{className:"p-3 border-t bg-muted/30",children:o.jsx("div",{className:"text-[10px] text-muted-foreground text-center",children:"NeuroVerse Sim — Governed Autonomous Discovery"})})]})}function Y3(){return hm(),o.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[o.jsx("div",{className:"border-b bg-card/50 backdrop-blur-sm",children:o.jsxs("div",{className:"flex items-center justify-between px-6 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(jn,{className:"h-5 w-5 text-primary"}),o.jsx("span",{className:"font-semibold text-foreground",children:"NeuroVerse Sim"})]}),o.jsx(Re,{variant:"outline",className:"text-[10px] border-primary/30 text-primary",children:"Science Mode"})]}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"ScienceClaw explores possibility. NeuroVerse enforces reality."})]})}),o.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[o.jsx("div",{className:"flex-1 flex flex-col overflow-y-auto",children:o.jsxs("div",{className:"p-6 space-y-6",children:[o.jsxs("div",{className:"rounded-xl border bg-card p-6",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(R0,{className:"h-5 w-5 text-primary"}),o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Autonomous Scientific Discovery"})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"A multi-agent research swarm investigates a novel material property. Agents independently generate hypotheses, run computational experiments, publish artifacts, and cite each other's work. The ArtifactReactor matches findings across agents."}),o.jsx("div",{className:"mt-4 flex gap-2 flex-wrap",children:["5 Agents","8 Cycles","Molecular Dynamics","Ab Initio"].map(e=>o.jsx(Re,{variant:"secondary",className:"text-xs",children:e},e))})]}),o.jsxs("div",{className:"rounded-xl border bg-card p-6",children:[o.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-4 flex items-center gap-2",children:[o.jsx(Pr,{className:"h-4 w-4 text-muted-foreground"}),"Investigation Timeline"]}),o.jsx("div",{className:"space-y-3",children:[{cycle:"1-2",label:"Exploration",desc:"Initial hypotheses and exploratory experiments",color:"bg-blue-500"},{cycle:"3-4",label:"Amplification",desc:"First publications — citation amplification begins. False positive risk rising.",color:"bg-yellow-500"},{cycle:"5-6",label:"Intervention",desc:"Governance detects cascade risk. Propagation slowed, unvalidated findings blocked.",color:"bg-orange-500"},{cycle:"7-8",label:"Convergence",desc:"Validated findings converge. Evidence chains confirmed through independent replication.",color:"bg-green-500"}].map(e=>o.jsxs("div",{className:"flex gap-3 items-start",children:[o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx("div",{className:$("w-3 h-3 rounded-full shrink-0 mt-1",e.color)}),o.jsx("div",{className:"w-px h-full bg-border min-h-[20px]"})]}),o.jsxs("div",{className:"pb-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"text-xs font-mono text-muted-foreground",children:["Cycle ",e.cycle]}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:e.label})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.desc})]})]},e.cycle))})]}),o.jsxs("div",{className:"rounded-xl border bg-card p-6",children:[o.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-4 flex items-center gap-2",children:[o.jsx(Ao,{className:"h-4 w-4 text-muted-foreground"}),"Why Governance Matters"]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4",children:[o.jsx("div",{className:"text-xs font-semibold text-red-400 uppercase tracking-wider mb-3",children:"Ungoverned"}),o.jsxs("ul",{className:"space-y-2 text-xs text-muted-foreground",children:[o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-red-400 mt-0.5",children:"-"}),"Fast convergence on popular hypothesis"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-red-400 mt-0.5",children:"-"}),"Shallow provenance — 1-2 citation hops"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-red-400 mt-0.5",children:"-"}),"High false positive rate — unvalidated claims spread"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-red-400 mt-0.5",children:"-"}),"Self-citation loops amplify noise"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-red-400 mt-0.5",children:"-"}),"Circular dependency chains"]})]})]}),o.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 p-4",children:[o.jsx("div",{className:"text-xs font-semibold text-green-400 uppercase tracking-wider mb-3",children:"Governed"}),o.jsxs("ul",{className:"space-y-2 text-xs text-muted-foreground",children:[o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-green-400 mt-0.5",children:"+"}),"Slower convergence backed by evidence"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-green-400 mt-0.5",children:"+"}),"Deep provenance — multi-layer evidence chains"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-green-400 mt-0.5",children:"+"}),"False positives caught by cascade breakers"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-green-400 mt-0.5",children:"+"}),"Independent replication prioritized"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-green-400 mt-0.5",children:"+"}),"Clean dependency graph"]})]})]})]})]}),o.jsxs("div",{className:"rounded-xl border bg-card p-6",children:[o.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-4 flex items-center gap-2",children:[o.jsx(T0,{className:"h-4 w-4 text-muted-foreground"}),"Research Swarm Agents"]}),o.jsx("div",{className:"grid grid-cols-3 gap-3",children:[{id:"Lead Investigator",role:"Drives hypothesis formation",disposition:"supportive"},{id:"Computational Agents",role:"Run experiments & produce data",disposition:"neutral"},{id:"Validation Oracle",role:"Independent reproduction checks",disposition:"supportive"},{id:"Citation Network",role:"Amplifies popular findings",disposition:"hostile"},{id:"Artifact Reactor",role:"Cross-matches complementary results",disposition:"neutral"},{id:"Peer Reviewers",role:"Quality gate for publications",disposition:"neutral"}].map(e=>o.jsxs("div",{className:"rounded-lg border bg-muted/30 p-3",children:[o.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[o.jsx("div",{className:$("w-2 h-2 rounded-full",e.disposition==="supportive"?"bg-green-500":e.disposition==="hostile"?"bg-red-500":"bg-yellow-500")}),o.jsx("span",{className:"text-xs font-medium text-foreground",children:e.id})]}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e.role})]},e.id))})]})]})}),o.jsx(K3,{})]})]})}const q3=()=>{const e=Xx();return h.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),o.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),o.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},Q3=new tk,X3=()=>o.jsx(rk,{client:Q3,children:o.jsxs(s_,{children:[o.jsx(x2,{}),o.jsx(bj,{}),o.jsx(Vk,{children:o.jsxs(Fk,{children:[o.jsx(_a,{path:"/",element:o.jsx(S3,{})}),o.jsx(_a,{path:"/science",element:o.jsx(Y3,{})}),o.jsx(_a,{path:"*",element:o.jsx(q3,{})})]})})]})});Ox(document.getElementById("root")).render(o.jsx(X3,{}));export{Y_ as A,nc as a,q_ as e,um as g};
|