@neuroverseos/nv-sim 0.1.10 → 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 +184 -619
- package/dist/assets/index-CH_VswRM.css +1 -0
- package/dist/assets/index-sT4b_z7w.js +686 -0
- package/dist/assets/{reportEngine-CYSZfooa.js → reportEngine-Bu8bB5Yq.js} +1 -1
- package/dist/connectors/nv-scienceclaw-post.js +141 -154
- package/dist/engine/universalAdapter.js +371 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/index-B43_0HyO.css +0 -1
- package/dist/assets/index-CdghpsS8.js +0 -595
|
@@ -0,0 +1,686 @@
|
|
|
1
|
+
var f1=Object.defineProperty;var Ff=e=>{throw TypeError(e)};var p1=(e,t,n)=>t in e?f1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var qt=(e,t,n)=>p1(e,typeof t!="symbol"?t+"":t,n),jc=(e,t,n)=>t.has(e)||Ff("Cannot "+n);var $=(e,t,n)=>(jc(e,t,"read from private field"),n?n.call(e):t.get(e)),xe=(e,t,n)=>t.has(e)?Ff("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ne=(e,t,n,r)=>(jc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),nt=(e,t,n)=>(jc(e,t,"access private method"),n);var Wi=(e,t,n,r)=>({set _(o){ne(e,t,o,n)},get _(){return $(e,t,r)}});function h1(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)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(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function _g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ag={exports:{}},kl={},Tg={exports:{}},de={};/**
|
|
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 Ei=Symbol.for("react.element"),g1=Symbol.for("react.portal"),x1=Symbol.for("react.fragment"),v1=Symbol.for("react.strict_mode"),y1=Symbol.for("react.profiler"),b1=Symbol.for("react.provider"),w1=Symbol.for("react.context"),N1=Symbol.for("react.forward_ref"),j1=Symbol.for("react.suspense"),S1=Symbol.for("react.memo"),k1=Symbol.for("react.lazy"),zf=Symbol.iterator;function C1(e){return e===null||typeof e!="object"?null:(e=zf&&e[zf]||e["@@iterator"],typeof e=="function"?e:null)}var Ig={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Mg=Object.assign,Lg={};function ho(e,t,n){this.props=e,this.context=t,this.refs=Lg,this.updater=n||Ig}ho.prototype.isReactComponent={};ho.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")};ho.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Og(){}Og.prototype=ho.prototype;function Ku(e,t,n){this.props=e,this.context=t,this.refs=Lg,this.updater=n||Ig}var Gu=Ku.prototype=new Og;Gu.constructor=Ku;Mg(Gu,ho.prototype);Gu.isPureReactComponent=!0;var Bf=Array.isArray,$g=Object.prototype.hasOwnProperty,qu={current:null},Dg={key:!0,ref:!0,__self:!0,__source:!0};function Fg(e,t,n){var r,o={},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)&&!Dg.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];o.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Ei,type:e,key:i,ref:a,props:o,_owner:qu.current}}function E1(e,t){return{$$typeof:Ei,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Yu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ei}function R1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Vf=/\/+/g;function Sc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?R1(""+e.key):t.toString(36)}function ba(e,t,n,r,o){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 Ei:case g1:a=!0}}if(a)return a=e,o=o(a),e=r===""?"."+Sc(a,0):r,Bf(o)?(n="",e!=null&&(n=e.replace(Vf,"$&/")+"/"),ba(o,t,n,"",function(d){return d})):o!=null&&(Yu(o)&&(o=E1(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(Vf,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=r===""?".":r+":",Bf(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Sc(i,l);a+=ba(i,t,n,c,o)}else if(c=C1(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Sc(i,l++),a+=ba(i,t,n,c,o);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 Ui(e,t,n){if(e==null)return e;var r=[],o=0;return ba(e,r,"","",function(i){return t.call(n,i,o++)}),r}function P1(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 ht={current:null},wa={transition:null},_1={ReactCurrentDispatcher:ht,ReactCurrentBatchConfig:wa,ReactCurrentOwner:qu};function zg(){throw Error("act(...) is not supported in production builds of React.")}de.Children={map:Ui,forEach:function(e,t,n){Ui(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ui(e,function(){t++}),t},toArray:function(e){return Ui(e,function(t){return t})||[]},only:function(e){if(!Yu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};de.Component=ho;de.Fragment=x1;de.Profiler=y1;de.PureComponent=Ku;de.StrictMode=v1;de.Suspense=j1;de.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_1;de.act=zg;de.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=Mg({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=qu.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)$g.call(t,c)&&!Dg.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:Ei,type:e.type,key:o,ref:i,props:r,_owner:a}};de.createContext=function(e){return e={$$typeof:w1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:b1,_context:e},e.Consumer=e};de.createElement=Fg;de.createFactory=function(e){var t=Fg.bind(null,e);return t.type=e,t};de.createRef=function(){return{current:null}};de.forwardRef=function(e){return{$$typeof:N1,render:e}};de.isValidElement=Yu;de.lazy=function(e){return{$$typeof:k1,_payload:{_status:-1,_result:e},_init:P1}};de.memo=function(e,t){return{$$typeof:S1,type:e,compare:t===void 0?null:t}};de.startTransition=function(e){var t=wa.transition;wa.transition={};try{e()}finally{wa.transition=t}};de.unstable_act=zg;de.useCallback=function(e,t){return ht.current.useCallback(e,t)};de.useContext=function(e){return ht.current.useContext(e)};de.useDebugValue=function(){};de.useDeferredValue=function(e){return ht.current.useDeferredValue(e)};de.useEffect=function(e,t){return ht.current.useEffect(e,t)};de.useId=function(){return ht.current.useId()};de.useImperativeHandle=function(e,t,n){return ht.current.useImperativeHandle(e,t,n)};de.useInsertionEffect=function(e,t){return ht.current.useInsertionEffect(e,t)};de.useLayoutEffect=function(e,t){return ht.current.useLayoutEffect(e,t)};de.useMemo=function(e,t){return ht.current.useMemo(e,t)};de.useReducer=function(e,t,n){return ht.current.useReducer(e,t,n)};de.useRef=function(e){return ht.current.useRef(e)};de.useState=function(e){return ht.current.useState(e)};de.useSyncExternalStore=function(e,t,n){return ht.current.useSyncExternalStore(e,t,n)};de.useTransition=function(){return ht.current.useTransition()};de.version="18.3.1";Tg.exports=de;var h=Tg.exports;const W=_g(h),Qu=h1({__proto__:null,default:W},[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 A1=h,T1=Symbol.for("react.element"),I1=Symbol.for("react.fragment"),M1=Object.prototype.hasOwnProperty,L1=A1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,O1={key:!0,ref:!0,__self:!0,__source:!0};function Bg(e,t,n){var r,o={},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)M1.call(t,r)&&!O1.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:T1,type:e,key:i,ref:a,props:o,_owner:L1.current}}kl.Fragment=I1;kl.jsx=Bg;kl.jsxs=Bg;Ag.exports=kl;var s=Ag.exports,Vg={exports:{}},At={},Wg={exports:{}},Ug={};/**
|
|
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(T,L){var S=T.length;T.push(L);e:for(;0<S;){var D=S-1>>>1,F=T[D];if(0<o(F,L))T[D]=L,T[S]=F,S=D;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var L=T[0],S=T.pop();if(S!==L){T[0]=S;e:for(var D=0,F=T.length,G=F>>>1;D<G;){var Q=2*(D+1)-1,re=T[Q],K=Q+1,B=T[K];if(0>o(re,S))K<F&&0>o(B,re)?(T[D]=B,T[K]=S,D=K):(T[D]=re,T[Q]=S,D=Q);else if(K<F&&0>o(B,S))T[D]=B,T[K]=S,D=K;else break e}}return L}function o(T,L){var S=T.sortIndex-L.sortIndex;return S!==0?S:T.id-L.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,m=null,f=3,p=!1,v=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(T){for(var L=n(d);L!==null;){if(L.callback===null)r(d);else if(L.startTime<=T)r(d),L.sortIndex=L.expirationTime,t(c,L);else break;L=n(d)}}function N(T){if(g=!1,b(T),!v)if(n(c)!==null)v=!0,z(j);else{var L=n(d);L!==null&&U(N,L.startTime-T)}}function j(T,L){v=!1,g&&(g=!1,x(P),P=-1),p=!0;var S=f;try{for(b(L),m=n(c);m!==null&&(!(m.expirationTime>L)||T&&!_());){var D=m.callback;if(typeof D=="function"){m.callback=null,f=m.priorityLevel;var F=D(m.expirationTime<=L);L=e.unstable_now(),typeof F=="function"?m.callback=F:m===n(c)&&r(c),b(L)}else r(c);m=n(c)}if(m!==null)var G=!0;else{var Q=n(d);Q!==null&&U(N,Q.startTime-L),G=!1}return G}finally{m=null,f=S,p=!1}}var C=!1,k=null,P=-1,E=5,R=-1;function _(){return!(e.unstable_now()-R<E)}function M(){if(k!==null){var T=e.unstable_now();R=T;var L=!0;try{L=k(!0,T)}finally{L?O():(C=!1,k=null)}}else C=!1}var O;if(typeof y=="function")O=function(){y(M)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,H=A.port2;A.port1.onmessage=M,O=function(){H.postMessage(null)}}else O=function(){w(M,0)};function z(T){k=T,C||(C=!0,O())}function U(T,L){P=w(function(){T(e.unstable_now())},L)}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(T){T.callback=null},e.unstable_continueExecution=function(){v||p||(v=!0,z(j))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(T){switch(f){case 1:case 2:case 3:var L=3;break;default:L=f}var S=f;f=L;try{return T()}finally{f=S}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,L){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var S=f;f=T;try{return L()}finally{f=S}},e.unstable_scheduleCallback=function(T,L,S){var D=e.unstable_now();switch(typeof S=="object"&&S!==null?(S=S.delay,S=typeof S=="number"&&0<S?D+S:D):S=D,T){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=S+F,T={id:u++,callback:L,priorityLevel:T,startTime:S,expirationTime:F,sortIndex:-1},S>D?(T.sortIndex=S,t(d,T),n(c)===null&&T===n(d)&&(g?(x(P),P=-1):g=!0,U(N,S-D))):(T.sortIndex=F,t(c,T),v||p||(v=!0,z(j))),T},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(T){var L=f;return function(){var S=f;f=L;try{return T.apply(this,arguments)}finally{f=S}}}})(Ug);Wg.exports=Ug;var $1=Wg.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 D1=h,_t=$1;function V(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 Hg=new Set,ei={};function us(e,t){to(e,t),to(e+"Capture",t)}function to(e,t){for(ei[e]=t,e=0;e<t.length;e++)Hg.add(t[e])}var zn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yd=Object.prototype.hasOwnProperty,F1=/^[: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]*$/,Wf={},Uf={};function z1(e){return yd.call(Uf,e)?!0:yd.call(Wf,e)?!1:F1.test(e)?Uf[e]=!0:(Wf[e]=!0,!1)}function B1(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 V1(e,t,n,r){if(t===null||typeof t>"u"||B1(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 gt(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){tt[e]=new gt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];tt[t]=new gt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){tt[e]=new gt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){tt[e]=new gt(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){tt[e]=new gt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){tt[e]=new gt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){tt[e]=new gt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){tt[e]=new gt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){tt[e]=new gt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Xu=/[\-:]([a-z])/g;function Zu(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(Xu,Zu);tt[t]=new gt(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(Xu,Zu);tt[t]=new gt(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(Xu,Zu);tt[t]=new gt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){tt[e]=new gt(e,1,!1,e.toLowerCase(),null,!1,!1)});tt.xlinkHref=new gt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){tt[e]=new gt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ju(e,t,n,r){var o=tt.hasOwnProperty(t)?tt[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(V1(t,n,o,r)&&(n=null),r||o===null?z1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Gn=D1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Hi=Symbol.for("react.element"),ws=Symbol.for("react.portal"),Ns=Symbol.for("react.fragment"),em=Symbol.for("react.strict_mode"),bd=Symbol.for("react.profiler"),Kg=Symbol.for("react.provider"),Gg=Symbol.for("react.context"),tm=Symbol.for("react.forward_ref"),wd=Symbol.for("react.suspense"),Nd=Symbol.for("react.suspense_list"),nm=Symbol.for("react.memo"),or=Symbol.for("react.lazy"),qg=Symbol.for("react.offscreen"),Hf=Symbol.iterator;function So(e){return e===null||typeof e!="object"?null:(e=Hf&&e[Hf]||e["@@iterator"],typeof e=="function"?e:null)}var Ie=Object.assign,kc;function Oo(e){if(kc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);kc=t&&t[1]||""}return`
|
|
34
|
+
`+kc+e}var Cc=!1;function Ec(e,t){if(!e||Cc)return"";Cc=!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 o=d.stack.split(`
|
|
35
|
+
`),i=r.stack.split(`
|
|
36
|
+
`),a=o.length-1,l=i.length-1;1<=a&&0<=l&&o[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(o[a]!==i[l]){if(a!==1||l!==1)do if(a--,l--,0>l||o[a]!==i[l]){var c=`
|
|
37
|
+
`+o[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{Cc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Oo(e):""}function W1(e){switch(e.tag){case 5:return Oo(e.type);case 16:return Oo("Lazy");case 13:return Oo("Suspense");case 19:return Oo("SuspenseList");case 0:case 2:case 15:return e=Ec(e.type,!1),e;case 11:return e=Ec(e.type.render,!1),e;case 1:return e=Ec(e.type,!0),e;default:return""}}function jd(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 Ns:return"Fragment";case ws:return"Portal";case bd:return"Profiler";case em:return"StrictMode";case wd:return"Suspense";case Nd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Gg:return(e.displayName||"Context")+".Consumer";case Kg:return(e._context.displayName||"Context")+".Provider";case tm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case nm:return t=e.displayName||null,t!==null?t:jd(e.type)||"Memo";case or:t=e._payload,e=e._init;try{return jd(e(t))}catch{}}return null}function U1(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 jd(t);case 8:return t===em?"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 Cr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function H1(e){var t=Yg(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.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 Ki(e){e._valueTracker||(e._valueTracker=H1(e))}function Qg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Yg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Da(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 Sd(e,t){var n=t.checked;return Ie({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Kf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Cr(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 Xg(e,t){t=t.checked,t!=null&&Ju(e,"checked",t,!1)}function kd(e,t){Xg(e,t);var n=Cr(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")?Cd(e,t.type,n):t.hasOwnProperty("defaultValue")&&Cd(e,t.type,Cr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Gf(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 Cd(e,t,n){(t!=="number"||Da(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var $o=Array.isArray;function Ms(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Cr(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ed(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return Ie({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function qf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(V(92));if($o(n)){if(1<n.length)throw Error(V(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Cr(n)}}function Zg(e,t){var n=Cr(t.value),r=Cr(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 Yf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Jg(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 Rd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Jg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Gi,ex=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Gi=Gi||document.createElement("div"),Gi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Gi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ti(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wo={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},K1=["Webkit","ms","Moz","O"];Object.keys(Wo).forEach(function(e){K1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Wo[t]=Wo[e]})});function tx(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Wo.hasOwnProperty(e)&&Wo[e]?(""+t).trim():t+"px"}function nx(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=tx(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var G1=Ie({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 Pd(e,t){if(t){if(G1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function _d(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 Ad=null;function rm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Td=null,Ls=null,Os=null;function Qf(e){if(e=_i(e)){if(typeof Td!="function")throw Error(V(280));var t=e.stateNode;t&&(t=_l(t),Td(e.stateNode,e.type,t))}}function rx(e){Ls?Os?Os.push(e):Os=[e]:Ls=e}function sx(){if(Ls){var e=Ls,t=Os;if(Os=Ls=null,Qf(e),t)for(e=0;e<t.length;e++)Qf(t[e])}}function ox(e,t){return e(t)}function ix(){}var Rc=!1;function ax(e,t,n){if(Rc)return e(t,n);Rc=!0;try{return ox(e,t,n)}finally{Rc=!1,(Ls!==null||Os!==null)&&(ix(),sx())}}function ni(e,t){var n=e.stateNode;if(n===null)return null;var r=_l(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(V(231,t,typeof n));return n}var Id=!1;if(zn)try{var ko={};Object.defineProperty(ko,"passive",{get:function(){Id=!0}}),window.addEventListener("test",ko,ko),window.removeEventListener("test",ko,ko)}catch{Id=!1}function q1(e,t,n,r,o,i,a,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(u){this.onError(u)}}var Uo=!1,Fa=null,za=!1,Md=null,Y1={onError:function(e){Uo=!0,Fa=e}};function Q1(e,t,n,r,o,i,a,l,c){Uo=!1,Fa=null,q1.apply(Y1,arguments)}function X1(e,t,n,r,o,i,a,l,c){if(Q1.apply(this,arguments),Uo){if(Uo){var d=Fa;Uo=!1,Fa=null}else throw Error(V(198));za||(za=!0,Md=d)}}function ms(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 lx(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 Xf(e){if(ms(e)!==e)throw Error(V(188))}function Z1(e){var t=e.alternate;if(!t){if(t=ms(e),t===null)throw Error(V(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Xf(o),e;if(i===r)return Xf(o),t;i=i.sibling}throw Error(V(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,l=o.child;l;){if(l===n){a=!0,n=o,r=i;break}if(l===r){a=!0,r=o,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,r=o;break}if(l===r){a=!0,r=i,n=o;break}l=l.sibling}if(!a)throw Error(V(189))}}if(n.alternate!==r)throw Error(V(190))}if(n.tag!==3)throw Error(V(188));return n.stateNode.current===n?e:t}function cx(e){return e=Z1(e),e!==null?dx(e):null}function dx(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=dx(e);if(t!==null)return t;e=e.sibling}return null}var ux=_t.unstable_scheduleCallback,Zf=_t.unstable_cancelCallback,J1=_t.unstable_shouldYield,eN=_t.unstable_requestPaint,$e=_t.unstable_now,tN=_t.unstable_getCurrentPriorityLevel,sm=_t.unstable_ImmediatePriority,mx=_t.unstable_UserBlockingPriority,Ba=_t.unstable_NormalPriority,nN=_t.unstable_LowPriority,fx=_t.unstable_IdlePriority,Cl=null,wn=null;function rN(e){if(wn&&typeof wn.onCommitFiberRoot=="function")try{wn.onCommitFiberRoot(Cl,e,void 0,(e.current.flags&128)===128)}catch{}}var on=Math.clz32?Math.clz32:iN,sN=Math.log,oN=Math.LN2;function iN(e){return e>>>=0,e===0?32:31-(sN(e)/oN|0)|0}var qi=64,Yi=4194304;function Do(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 Va(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~o;l!==0?r=Do(l):(i&=a,i!==0&&(r=Do(i)))}else a=n&~o,a!==0?r=Do(a):i!==0&&(r=Do(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===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-on(t),o=1<<n,r|=e[n],t&=~o;return r}function aN(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 lN(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-on(i),l=1<<a,c=o[a];c===-1?(!(l&n)||l&r)&&(o[a]=aN(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Ld(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function px(){var e=qi;return qi<<=1,!(qi&4194240)&&(qi=64),e}function Pc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ri(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-on(t),e[t]=n}function cN(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 o=31-on(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function om(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-on(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ve=0;function hx(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var gx,im,xx,vx,yx,Od=!1,Qi=[],xr=null,vr=null,yr=null,ri=new Map,si=new Map,ar=[],dN="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 Jf(e,t){switch(e){case"focusin":case"focusout":xr=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":yr=null;break;case"pointerover":case"pointerout":ri.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":si.delete(t.pointerId)}}function Co(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=_i(t),t!==null&&im(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function uN(e,t,n,r,o){switch(t){case"focusin":return xr=Co(xr,e,t,n,r,o),!0;case"dragenter":return vr=Co(vr,e,t,n,r,o),!0;case"mouseover":return yr=Co(yr,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return ri.set(i,Co(ri.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,si.set(i,Co(si.get(i)||null,e,t,n,r,o)),!0}return!1}function bx(e){var t=Wr(e.target);if(t!==null){var n=ms(t);if(n!==null){if(t=n.tag,t===13){if(t=lx(n),t!==null){e.blockedOn=t,yx(e.priority,function(){xx(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 Na(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$d(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ad=r,n.target.dispatchEvent(r),Ad=null}else return t=_i(n),t!==null&&im(t),e.blockedOn=n,!1;t.shift()}return!0}function ep(e,t,n){Na(e)&&n.delete(t)}function mN(){Od=!1,xr!==null&&Na(xr)&&(xr=null),vr!==null&&Na(vr)&&(vr=null),yr!==null&&Na(yr)&&(yr=null),ri.forEach(ep),si.forEach(ep)}function Eo(e,t){e.blockedOn===t&&(e.blockedOn=null,Od||(Od=!0,_t.unstable_scheduleCallback(_t.unstable_NormalPriority,mN)))}function oi(e){function t(o){return Eo(o,e)}if(0<Qi.length){Eo(Qi[0],e);for(var n=1;n<Qi.length;n++){var r=Qi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(xr!==null&&Eo(xr,e),vr!==null&&Eo(vr,e),yr!==null&&Eo(yr,e),ri.forEach(t),si.forEach(t),n=0;n<ar.length;n++)r=ar[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ar.length&&(n=ar[0],n.blockedOn===null);)bx(n),n.blockedOn===null&&ar.shift()}var $s=Gn.ReactCurrentBatchConfig,Wa=!0;function fN(e,t,n,r){var o=ve,i=$s.transition;$s.transition=null;try{ve=1,am(e,t,n,r)}finally{ve=o,$s.transition=i}}function pN(e,t,n,r){var o=ve,i=$s.transition;$s.transition=null;try{ve=4,am(e,t,n,r)}finally{ve=o,$s.transition=i}}function am(e,t,n,r){if(Wa){var o=$d(e,t,n,r);if(o===null)Fc(e,t,r,Ua,n),Jf(e,r);else if(uN(o,e,t,n,r))r.stopPropagation();else if(Jf(e,r),t&4&&-1<dN.indexOf(e)){for(;o!==null;){var i=_i(o);if(i!==null&&gx(i),i=$d(e,t,n,r),i===null&&Fc(e,t,r,Ua,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Fc(e,t,r,null,n)}}var Ua=null;function $d(e,t,n,r){if(Ua=null,e=rm(r),e=Wr(e),e!==null)if(t=ms(e),t===null)e=null;else if(n=t.tag,n===13){if(e=lx(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 Ua=e,null}function wx(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(tN()){case sm:return 1;case mx:return 4;case Ba:case nN:return 16;case fx:return 536870912;default:return 16}default:return 16}}var pr=null,lm=null,ja=null;function Nx(){if(ja)return ja;var e,t=lm,n=t.length,r,o="value"in pr?pr.value:pr.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===o[i-r];r++);return ja=o.slice(e,1<r?1-r:void 0)}function Sa(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 Xi(){return!0}function tp(){return!1}function Tt(e){function t(n,r,o,i,a){this._reactName=n,this._targetInst=o,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)?Xi:tp,this.isPropagationStopped=tp,this}return Ie(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=Xi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xi)},persist:function(){},isPersistent:Xi}),t}var go={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cm=Tt(go),Pi=Ie({},go,{view:0,detail:0}),hN=Tt(Pi),_c,Ac,Ro,El=Ie({},Pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dm,button:0,buttons:0,relatedTarget:function(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!==Ro&&(Ro&&e.type==="mousemove"?(_c=e.screenX-Ro.screenX,Ac=e.screenY-Ro.screenY):Ac=_c=0,Ro=e),_c)},movementY:function(e){return"movementY"in e?e.movementY:Ac}}),np=Tt(El),gN=Ie({},El,{dataTransfer:0}),xN=Tt(gN),vN=Ie({},Pi,{relatedTarget:0}),Tc=Tt(vN),yN=Ie({},go,{animationName:0,elapsedTime:0,pseudoElement:0}),bN=Tt(yN),wN=Ie({},go,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),NN=Tt(wN),jN=Ie({},go,{data:0}),rp=Tt(jN),SN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kN={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"},CN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function EN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=CN[e])?!!t[e]:!1}function dm(){return EN}var RN=Ie({},Pi,{key:function(e){if(e.key){var t=SN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Sa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dm,charCode:function(e){return e.type==="keypress"?Sa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Sa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),PN=Tt(RN),_N=Ie({},El,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sp=Tt(_N),AN=Ie({},Pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dm}),TN=Tt(AN),IN=Ie({},go,{propertyName:0,elapsedTime:0,pseudoElement:0}),MN=Tt(IN),LN=Ie({},El,{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}),ON=Tt(LN),$N=[9,13,27,32],um=zn&&"CompositionEvent"in window,Ho=null;zn&&"documentMode"in document&&(Ho=document.documentMode);var DN=zn&&"TextEvent"in window&&!Ho,jx=zn&&(!um||Ho&&8<Ho&&11>=Ho),op=" ",ip=!1;function Sx(e,t){switch(e){case"keyup":return $N.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var js=!1;function FN(e,t){switch(e){case"compositionend":return kx(t);case"keypress":return t.which!==32?null:(ip=!0,op);case"textInput":return e=t.data,e===op&&ip?null:e;default:return null}}function zN(e,t){if(js)return e==="compositionend"||!um&&Sx(e,t)?(e=Nx(),ja=lm=pr=null,js=!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 jx&&t.locale!=="ko"?null:t.data;default:return null}}var BN={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 ap(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!BN[e.type]:t==="textarea"}function Cx(e,t,n,r){rx(r),t=Ha(t,"onChange"),0<t.length&&(n=new cm("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ko=null,ii=null;function VN(e){$x(e,0)}function Rl(e){var t=Cs(e);if(Qg(t))return e}function WN(e,t){if(e==="change")return t}var Ex=!1;if(zn){var Ic;if(zn){var Mc="oninput"in document;if(!Mc){var lp=document.createElement("div");lp.setAttribute("oninput","return;"),Mc=typeof lp.oninput=="function"}Ic=Mc}else Ic=!1;Ex=Ic&&(!document.documentMode||9<document.documentMode)}function cp(){Ko&&(Ko.detachEvent("onpropertychange",Rx),ii=Ko=null)}function Rx(e){if(e.propertyName==="value"&&Rl(ii)){var t=[];Cx(t,ii,e,rm(e)),ax(VN,t)}}function UN(e,t,n){e==="focusin"?(cp(),Ko=t,ii=n,Ko.attachEvent("onpropertychange",Rx)):e==="focusout"&&cp()}function HN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Rl(ii)}function KN(e,t){if(e==="click")return Rl(t)}function GN(e,t){if(e==="input"||e==="change")return Rl(t)}function qN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ln=typeof Object.is=="function"?Object.is:qN;function ai(e,t){if(ln(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 o=n[r];if(!yd.call(t,o)||!ln(e[o],t[o]))return!1}return!0}function dp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function up(e,t){var n=dp(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=dp(n)}}function Px(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Px(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _x(){for(var e=window,t=Da();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Da(e.document)}return t}function mm(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 YN(e){var t=_x(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Px(n.ownerDocument.documentElement,n)){if(r!==null&&mm(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=up(n,i);var a=up(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.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 QN=zn&&"documentMode"in document&&11>=document.documentMode,Ss=null,Dd=null,Go=null,Fd=!1;function mp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fd||Ss==null||Ss!==Da(r)||(r=Ss,"selectionStart"in r&&mm(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}),Go&&ai(Go,r)||(Go=r,r=Ha(Dd,"onSelect"),0<r.length&&(t=new cm("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ss)))}function Zi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ks={animationend:Zi("Animation","AnimationEnd"),animationiteration:Zi("Animation","AnimationIteration"),animationstart:Zi("Animation","AnimationStart"),transitionend:Zi("Transition","TransitionEnd")},Lc={},Ax={};zn&&(Ax=document.createElement("div").style,"AnimationEvent"in window||(delete ks.animationend.animation,delete ks.animationiteration.animation,delete ks.animationstart.animation),"TransitionEvent"in window||delete ks.transitionend.transition);function Pl(e){if(Lc[e])return Lc[e];if(!ks[e])return e;var t=ks[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ax)return Lc[e]=t[n];return e}var Tx=Pl("animationend"),Ix=Pl("animationiteration"),Mx=Pl("animationstart"),Lx=Pl("transitionend"),Ox=new Map,fp="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 Tr(e,t){Ox.set(e,t),us(t,[e])}for(var Oc=0;Oc<fp.length;Oc++){var $c=fp[Oc],XN=$c.toLowerCase(),ZN=$c[0].toUpperCase()+$c.slice(1);Tr(XN,"on"+ZN)}Tr(Tx,"onAnimationEnd");Tr(Ix,"onAnimationIteration");Tr(Mx,"onAnimationStart");Tr("dblclick","onDoubleClick");Tr("focusin","onFocus");Tr("focusout","onBlur");Tr(Lx,"onTransitionEnd");to("onMouseEnter",["mouseout","mouseover"]);to("onMouseLeave",["mouseout","mouseover"]);to("onPointerEnter",["pointerout","pointerover"]);to("onPointerLeave",["pointerout","pointerover"]);us("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));us("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));us("onBeforeInput",["compositionend","keypress","textInput","paste"]);us("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));us("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));us("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fo="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(" "),JN=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fo));function pp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,X1(r,t,void 0,e),e.currentTarget=null}function $x(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=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&&o.isPropagationStopped())break e;pp(o,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&&o.isPropagationStopped())break e;pp(o,l,d),i=c}}}if(za)throw e=Md,za=!1,Md=null,e}function ke(e,t){var n=t[Ud];n===void 0&&(n=t[Ud]=new Set);var r=e+"__bubble";n.has(r)||(Dx(t,e,2,!1),n.add(r))}function Dc(e,t,n){var r=0;t&&(r|=4),Dx(n,e,r,t)}var Ji="_reactListening"+Math.random().toString(36).slice(2);function li(e){if(!e[Ji]){e[Ji]=!0,Hg.forEach(function(n){n!=="selectionchange"&&(JN.has(n)||Dc(n,!1,e),Dc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ji]||(t[Ji]=!0,Dc("selectionchange",!1,t))}}function Dx(e,t,n,r){switch(wx(t)){case 1:var o=fN;break;case 4:o=pN;break;default:o=am}n=o.bind(null,t,n,e),o=void 0,!Id||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Fc(e,t,n,r,o){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===o||l.nodeType===8&&l.parentNode===o)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;a=a.return}for(;l!==null;){if(a=Wr(l),a===null)return;if(c=a.tag,c===5||c===6){r=i=a;continue e}l=l.parentNode}}r=r.return}ax(function(){var d=i,u=rm(n),m=[];e:{var f=Ox.get(e);if(f!==void 0){var p=cm,v=e;switch(e){case"keypress":if(Sa(n)===0)break e;case"keydown":case"keyup":p=PN;break;case"focusin":v="focus",p=Tc;break;case"focusout":v="blur",p=Tc;break;case"beforeblur":case"afterblur":p=Tc;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":p=np;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=xN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=TN;break;case Tx:case Ix:case Mx:p=bN;break;case Lx:p=MN;break;case"scroll":p=hN;break;case"wheel":p=ON;break;case"copy":case"cut":case"paste":p=NN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=sp}var g=(t&4)!==0,w=!g&&e==="scroll",x=g?f!==null?f+"Capture":null:f;g=[];for(var y=d,b;y!==null;){b=y;var N=b.stateNode;if(b.tag===5&&N!==null&&(b=N,x!==null&&(N=ni(y,x),N!=null&&g.push(ci(y,N,b)))),w)break;y=y.return}0<g.length&&(f=new p(f,v,null,n,u),m.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Ad&&(v=n.relatedTarget||n.fromElement)&&(Wr(v)||v[Bn]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(v=n.relatedTarget||n.toElement,p=d,v=v?Wr(v):null,v!==null&&(w=ms(v),v!==w||v.tag!==5&&v.tag!==6)&&(v=null)):(p=null,v=d),p!==v)){if(g=np,N="onMouseLeave",x="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=sp,N="onPointerLeave",x="onPointerEnter",y="pointer"),w=p==null?f:Cs(p),b=v==null?f:Cs(v),f=new g(N,y+"leave",p,n,u),f.target=w,f.relatedTarget=b,N=null,Wr(u)===d&&(g=new g(x,y+"enter",v,n,u),g.target=b,g.relatedTarget=w,N=g),w=N,p&&v)t:{for(g=p,x=v,y=0,b=g;b;b=gs(b))y++;for(b=0,N=x;N;N=gs(N))b++;for(;0<y-b;)g=gs(g),y--;for(;0<b-y;)x=gs(x),b--;for(;y--;){if(g===x||x!==null&&g===x.alternate)break t;g=gs(g),x=gs(x)}g=null}else g=null;p!==null&&hp(m,f,p,g,!1),v!==null&&w!==null&&hp(m,w,v,g,!0)}}e:{if(f=d?Cs(d):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var j=WN;else if(ap(f))if(Ex)j=GN;else{j=HN;var C=UN}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(j=KN);if(j&&(j=j(e,d))){Cx(m,j,n,u);break e}C&&C(e,f,d),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&Cd(f,"number",f.value)}switch(C=d?Cs(d):window,e){case"focusin":(ap(C)||C.contentEditable==="true")&&(Ss=C,Dd=d,Go=null);break;case"focusout":Go=Dd=Ss=null;break;case"mousedown":Fd=!0;break;case"contextmenu":case"mouseup":case"dragend":Fd=!1,mp(m,n,u);break;case"selectionchange":if(QN)break;case"keydown":case"keyup":mp(m,n,u)}var k;if(um)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else js?Sx(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(jx&&n.locale!=="ko"&&(js||P!=="onCompositionStart"?P==="onCompositionEnd"&&js&&(k=Nx()):(pr=u,lm="value"in pr?pr.value:pr.textContent,js=!0)),C=Ha(d,P),0<C.length&&(P=new rp(P,e,null,n,u),m.push({event:P,listeners:C}),k?P.data=k:(k=kx(n),k!==null&&(P.data=k)))),(k=DN?FN(e,n):zN(e,n))&&(d=Ha(d,"onBeforeInput"),0<d.length&&(u=new rp("onBeforeInput","beforeinput",null,n,u),m.push({event:u,listeners:d}),u.data=k))}$x(m,t)})}function ci(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ha(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=ni(e,n),i!=null&&r.unshift(ci(e,i,o)),i=ni(e,t),i!=null&&r.push(ci(e,i,o))),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 hp(e,t,n,r,o){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,o?(c=ni(n,i),c!=null&&a.unshift(ci(n,c,l))):o||(c=ni(n,i),c!=null&&a.push(ci(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var ej=/\r\n?/g,tj=/\u0000|\uFFFD/g;function gp(e){return(typeof e=="string"?e:""+e).replace(ej,`
|
|
38
|
+
`).replace(tj,"")}function ea(e,t,n){if(t=gp(t),gp(e)!==t&&n)throw Error(V(425))}function Ka(){}var zd=null,Bd=null;function Vd(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 Wd=typeof setTimeout=="function"?setTimeout:void 0,nj=typeof clearTimeout=="function"?clearTimeout:void 0,xp=typeof Promise=="function"?Promise:void 0,rj=typeof queueMicrotask=="function"?queueMicrotask:typeof xp<"u"?function(e){return xp.resolve(null).then(e).catch(sj)}:Wd;function sj(e){setTimeout(function(){throw e})}function zc(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),oi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);oi(t)}function br(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 vp(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 xo=Math.random().toString(36).slice(2),vn="__reactFiber$"+xo,di="__reactProps$"+xo,Bn="__reactContainer$"+xo,Ud="__reactEvents$"+xo,oj="__reactListeners$"+xo,ij="__reactHandles$"+xo;function Wr(e){var t=e[vn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bn]||n[vn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vp(e);e!==null;){if(n=e[vn])return n;e=vp(e)}return t}e=n,n=e.parentNode}return null}function _i(e){return e=e[vn]||e[Bn],!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(V(33))}function _l(e){return e[di]||null}var Hd=[],Es=-1;function Ir(e){return{current:e}}function Ce(e){0>Es||(e.current=Hd[Es],Hd[Es]=null,Es--)}function je(e,t){Es++,Hd[Es]=e.current,e.current=t}var Er={},lt=Ir(Er),wt=Ir(!1),ns=Er;function no(e,t){var n=e.type.contextTypes;if(!n)return Er;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Nt(e){return e=e.childContextTypes,e!=null}function Ga(){Ce(wt),Ce(lt)}function yp(e,t,n){if(lt.current!==Er)throw Error(V(168));je(lt,t),je(wt,n)}function Fx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(V(108,U1(e)||"Unknown",o));return Ie({},n,r)}function qa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Er,ns=lt.current,je(lt,e),je(wt,wt.current),!0}function bp(e,t,n){var r=e.stateNode;if(!r)throw Error(V(169));n?(e=Fx(e,t,ns),r.__reactInternalMemoizedMergedChildContext=e,Ce(wt),Ce(lt),je(lt,e)):Ce(wt),je(wt,n)}var In=null,Al=!1,Bc=!1;function zx(e){In===null?In=[e]:In.push(e)}function aj(e){Al=!0,zx(e)}function Mr(){if(!Bc&&In!==null){Bc=!0;var e=0,t=ve;try{var n=In;for(ve=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}In=null,Al=!1}catch(o){throw In!==null&&(In=In.slice(e+1)),ux(sm,Mr),o}finally{ve=t,Bc=!1}}return null}var Rs=[],Ps=0,Ya=null,Qa=0,Mt=[],Lt=0,rs=null,Ln=1,On="";function Br(e,t){Rs[Ps++]=Qa,Rs[Ps++]=Ya,Ya=e,Qa=t}function Bx(e,t,n){Mt[Lt++]=Ln,Mt[Lt++]=On,Mt[Lt++]=rs,rs=e;var r=Ln;e=On;var o=32-on(r)-1;r&=~(1<<o),n+=1;var i=32-on(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Ln=1<<32-on(t)+o|n<<o|r,On=i+e}else Ln=1<<i|n<<o|r,On=e}function fm(e){e.return!==null&&(Br(e,1),Bx(e,1,0))}function pm(e){for(;e===Ya;)Ya=Rs[--Ps],Rs[Ps]=null,Qa=Rs[--Ps],Rs[Ps]=null;for(;e===rs;)rs=Mt[--Lt],Mt[Lt]=null,On=Mt[--Lt],Mt[Lt]=null,Ln=Mt[--Lt],Mt[Lt]=null}var Rt=null,Et=null,Re=!1,rn=null;function Vx(e,t){var n=Ot(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 wp(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,Rt=e,Et=br(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Rt=e,Et=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=rs!==null?{id:Ln,overflow:On}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ot(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Rt=e,Et=null,!0):!1;default:return!1}}function Kd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gd(e){if(Re){var t=Et;if(t){var n=t;if(!wp(e,t)){if(Kd(e))throw Error(V(418));t=br(n.nextSibling);var r=Rt;t&&wp(e,t)?Vx(r,n):(e.flags=e.flags&-4097|2,Re=!1,Rt=e)}}else{if(Kd(e))throw Error(V(418));e.flags=e.flags&-4097|2,Re=!1,Rt=e}}}function Np(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Rt=e}function ta(e){if(e!==Rt)return!1;if(!Re)return Np(e),Re=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Vd(e.type,e.memoizedProps)),t&&(t=Et)){if(Kd(e))throw Wx(),Error(V(418));for(;t;)Vx(e,t),t=br(t.nextSibling)}if(Np(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Et=br(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Et=null}}else Et=Rt?br(e.stateNode.nextSibling):null;return!0}function Wx(){for(var e=Et;e;)e=br(e.nextSibling)}function ro(){Et=Rt=null,Re=!1}function hm(e){rn===null?rn=[e]:rn.push(e)}var lj=Gn.ReactCurrentBatchConfig;function Po(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(V(309));var r=n.stateNode}if(!r)throw Error(V(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=o.refs;a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(V(284));if(!n._owner)throw Error(V(290,e))}return e}function na(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function jp(e){var t=e._init;return t(e._payload)}function Ux(e){function t(x,y){if(e){var b=x.deletions;b===null?(x.deletions=[y],x.flags|=16):b.push(y)}}function n(x,y){if(!e)return null;for(;y!==null;)t(x,y),y=y.sibling;return null}function r(x,y){for(x=new Map;y!==null;)y.key!==null?x.set(y.key,y):x.set(y.index,y),y=y.sibling;return x}function o(x,y){return x=Sr(x,y),x.index=0,x.sibling=null,x}function i(x,y,b){return x.index=b,e?(b=x.alternate,b!==null?(b=b.index,b<y?(x.flags|=2,y):b):(x.flags|=2,y)):(x.flags|=1048576,y)}function a(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,y,b,N){return y===null||y.tag!==6?(y=qc(b,x.mode,N),y.return=x,y):(y=o(y,b),y.return=x,y)}function c(x,y,b,N){var j=b.type;return j===Ns?u(x,y,b.props.children,N,b.key):y!==null&&(y.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===or&&jp(j)===y.type)?(N=o(y,b.props),N.ref=Po(x,y,b),N.return=x,N):(N=Aa(b.type,b.key,b.props,null,x.mode,N),N.ref=Po(x,y,b),N.return=x,N)}function d(x,y,b,N){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=Yc(b,x.mode,N),y.return=x,y):(y=o(y,b.children||[]),y.return=x,y)}function u(x,y,b,N,j){return y===null||y.tag!==7?(y=es(b,x.mode,N,j),y.return=x,y):(y=o(y,b),y.return=x,y)}function m(x,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=qc(""+y,x.mode,b),y.return=x,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Hi:return b=Aa(y.type,y.key,y.props,null,x.mode,b),b.ref=Po(x,null,y),b.return=x,b;case ws:return y=Yc(y,x.mode,b),y.return=x,y;case or:var N=y._init;return m(x,N(y._payload),b)}if($o(y)||So(y))return y=es(y,x.mode,b,null),y.return=x,y;na(x,y)}return null}function f(x,y,b,N){var j=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return j!==null?null:l(x,y,""+b,N);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Hi:return b.key===j?c(x,y,b,N):null;case ws:return b.key===j?d(x,y,b,N):null;case or:return j=b._init,f(x,y,j(b._payload),N)}if($o(b)||So(b))return j!==null?null:u(x,y,b,N,null);na(x,b)}return null}function p(x,y,b,N,j){if(typeof N=="string"&&N!==""||typeof N=="number")return x=x.get(b)||null,l(y,x,""+N,j);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case Hi:return x=x.get(N.key===null?b:N.key)||null,c(y,x,N,j);case ws:return x=x.get(N.key===null?b:N.key)||null,d(y,x,N,j);case or:var C=N._init;return p(x,y,b,C(N._payload),j)}if($o(N)||So(N))return x=x.get(b)||null,u(y,x,N,j,null);na(y,N)}return null}function v(x,y,b,N){for(var j=null,C=null,k=y,P=y=0,E=null;k!==null&&P<b.length;P++){k.index>P?(E=k,k=null):E=k.sibling;var R=f(x,k,b[P],N);if(R===null){k===null&&(k=E);break}e&&k&&R.alternate===null&&t(x,k),y=i(R,y,P),C===null?j=R:C.sibling=R,C=R,k=E}if(P===b.length)return n(x,k),Re&&Br(x,P),j;if(k===null){for(;P<b.length;P++)k=m(x,b[P],N),k!==null&&(y=i(k,y,P),C===null?j=k:C.sibling=k,C=k);return Re&&Br(x,P),j}for(k=r(x,k);P<b.length;P++)E=p(k,x,P,b[P],N),E!==null&&(e&&E.alternate!==null&&k.delete(E.key===null?P:E.key),y=i(E,y,P),C===null?j=E:C.sibling=E,C=E);return e&&k.forEach(function(_){return t(x,_)}),Re&&Br(x,P),j}function g(x,y,b,N){var j=So(b);if(typeof j!="function")throw Error(V(150));if(b=j.call(b),b==null)throw Error(V(151));for(var C=j=null,k=y,P=y=0,E=null,R=b.next();k!==null&&!R.done;P++,R=b.next()){k.index>P?(E=k,k=null):E=k.sibling;var _=f(x,k,R.value,N);if(_===null){k===null&&(k=E);break}e&&k&&_.alternate===null&&t(x,k),y=i(_,y,P),C===null?j=_:C.sibling=_,C=_,k=E}if(R.done)return n(x,k),Re&&Br(x,P),j;if(k===null){for(;!R.done;P++,R=b.next())R=m(x,R.value,N),R!==null&&(y=i(R,y,P),C===null?j=R:C.sibling=R,C=R);return Re&&Br(x,P),j}for(k=r(x,k);!R.done;P++,R=b.next())R=p(k,x,P,R.value,N),R!==null&&(e&&R.alternate!==null&&k.delete(R.key===null?P:R.key),y=i(R,y,P),C===null?j=R:C.sibling=R,C=R);return e&&k.forEach(function(M){return t(x,M)}),Re&&Br(x,P),j}function w(x,y,b,N){if(typeof b=="object"&&b!==null&&b.type===Ns&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Hi:e:{for(var j=b.key,C=y;C!==null;){if(C.key===j){if(j=b.type,j===Ns){if(C.tag===7){n(x,C.sibling),y=o(C,b.props.children),y.return=x,x=y;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===or&&jp(j)===C.type){n(x,C.sibling),y=o(C,b.props),y.ref=Po(x,C,b),y.return=x,x=y;break e}n(x,C);break}else t(x,C);C=C.sibling}b.type===Ns?(y=es(b.props.children,x.mode,N,b.key),y.return=x,x=y):(N=Aa(b.type,b.key,b.props,null,x.mode,N),N.ref=Po(x,y,b),N.return=x,x=N)}return a(x);case ws:e:{for(C=b.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){n(x,y.sibling),y=o(y,b.children||[]),y.return=x,x=y;break e}else{n(x,y);break}else t(x,y);y=y.sibling}y=Yc(b,x.mode,N),y.return=x,x=y}return a(x);case or:return C=b._init,w(x,y,C(b._payload),N)}if($o(b))return v(x,y,b,N);if(So(b))return g(x,y,b,N);na(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(n(x,y.sibling),y=o(y,b),y.return=x,x=y):(n(x,y),y=qc(b,x.mode,N),y.return=x,x=y),a(x)):n(x,y)}return w}var so=Ux(!0),Hx=Ux(!1),Xa=Ir(null),Za=null,_s=null,gm=null;function xm(){gm=_s=Za=null}function vm(e){var t=Xa.current;Ce(Xa),e._currentValue=t}function qd(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 Ds(e,t){Za=e,gm=_s=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(bt=!0),e.firstContext=null)}function Dt(e){var t=e._currentValue;if(gm!==e)if(e={context:e,memoizedValue:t,next:null},_s===null){if(Za===null)throw Error(V(308));_s=e,Za.dependencies={lanes:0,firstContext:e}}else _s=_s.next=e;return t}var Ur=null;function ym(e){Ur===null?Ur=[e]:Ur.push(e)}function Kx(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,ym(t)):(n.next=o.next,o.next=n),t.interleaved=n,Vn(e,r)}function Vn(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 ir=!1;function bm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gx(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 $n(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function wr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ge&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Vn(e,n)}return o=r.interleaved,o===null?(t.next=t,ym(r)):(t.next=o.next,o.next=t),r.interleaved=t,Vn(e,n)}function ka(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,om(e,n)}}function Sp(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=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?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,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 Ja(e,t,n,r){var o=e.updateQueue;ir=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.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 m=o.baseState;a=0,u=d=c=null,l=i;do{var f=l.lane,p=l.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,g=l;switch(f=t,p=n,g.tag){case 1:if(v=g.payload,typeof v=="function"){m=v.call(p,m,f);break e}m=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,f=typeof v=="function"?v.call(p,m,f):v,f==null)break e;m=Ie({},m,f);break e;case 2:ir=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=p,c=m):u=u.next=p,a|=f;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;f=l,l=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(u===null&&(c=m),o.baseState=c,o.firstBaseUpdate=d,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);os|=a,e.lanes=a,e.memoizedState=m}}function kp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(V(191,o));o.call(r)}}}var Ai={},Nn=Ir(Ai),ui=Ir(Ai),mi=Ir(Ai);function Hr(e){if(e===Ai)throw Error(V(174));return e}function wm(e,t){switch(je(mi,t),je(ui,e),je(Nn,Ai),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rd(t,e)}Ce(Nn),je(Nn,t)}function oo(){Ce(Nn),Ce(ui),Ce(mi)}function qx(e){Hr(mi.current);var t=Hr(Nn.current),n=Rd(t,e.type);t!==n&&(je(ui,e),je(Nn,n))}function Nm(e){ui.current===e&&(Ce(Nn),Ce(ui))}var Ae=Ir(0);function el(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 Vc=[];function jm(){for(var e=0;e<Vc.length;e++)Vc[e]._workInProgressVersionPrimary=null;Vc.length=0}var Ca=Gn.ReactCurrentDispatcher,Wc=Gn.ReactCurrentBatchConfig,ss=0,Te=null,ze=null,Ue=null,tl=!1,qo=!1,fi=0,cj=0;function rt(){throw Error(V(321))}function Sm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ln(e[n],t[n]))return!1;return!0}function km(e,t,n,r,o,i){if(ss=i,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ca.current=e===null||e.memoizedState===null?fj:pj,e=n(r,o),qo){i=0;do{if(qo=!1,fi=0,25<=i)throw Error(V(301));i+=1,Ue=ze=null,t.updateQueue=null,Ca.current=hj,e=n(r,o)}while(qo)}if(Ca.current=nl,t=ze!==null&&ze.next!==null,ss=0,Ue=ze=Te=null,tl=!1,t)throw Error(V(300));return e}function Cm(){var e=fi!==0;return fi=0,e}function fn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ue===null?Te.memoizedState=Ue=e:Ue=Ue.next=e,Ue}function Ft(){if(ze===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=ze.next;var t=Ue===null?Te.memoizedState:Ue.next;if(t!==null)Ue=t,ze=e;else{if(e===null)throw Error(V(310));ze=e,e={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},Ue===null?Te.memoizedState=Ue=e:Ue=Ue.next=e}return Ue}function pi(e,t){return typeof t=="function"?t(e):t}function Uc(e){var t=Ft(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=ze,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=a=null,c=null,d=i;do{var u=d.lane;if((ss&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 m={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=m,a=r):c=c.next=m,Te.lanes|=u,os|=u}d=d.next}while(d!==null&&d!==i);c===null?a=r:c.next=l,ln(r,t.memoizedState)||(bt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Te.lanes|=i,os|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Hc(e){var t=Ft(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);ln(i,t.memoizedState)||(bt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Yx(){}function Qx(e,t){var n=Te,r=Ft(),o=t(),i=!ln(r.memoizedState,o);if(i&&(r.memoizedState=o,bt=!0),r=r.queue,Em(Jx.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ue!==null&&Ue.memoizedState.tag&1){if(n.flags|=2048,hi(9,Zx.bind(null,n,r,o,t),void 0,null),He===null)throw Error(V(349));ss&30||Xx(n,t,o)}return o}function Xx(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Te.updateQueue,t===null?(t={lastEffect:null,stores:null},Te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Zx(e,t,n,r){t.value=n,t.getSnapshot=r,e0(t)&&t0(e)}function Jx(e,t,n){return n(function(){e0(t)&&t0(e)})}function e0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ln(e,n)}catch{return!0}}function t0(e){var t=Vn(e,1);t!==null&&an(t,e,1,-1)}function Cp(e){var t=fn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:e},t.queue=e,e=e.dispatch=mj.bind(null,Te,e),[t.memoizedState,e]}function hi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Te.updateQueue,t===null?(t={lastEffect:null,stores:null},Te.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 n0(){return Ft().memoizedState}function Ea(e,t,n,r){var o=fn();Te.flags|=e,o.memoizedState=hi(1|t,n,void 0,r===void 0?null:r)}function Tl(e,t,n,r){var o=Ft();r=r===void 0?null:r;var i=void 0;if(ze!==null){var a=ze.memoizedState;if(i=a.destroy,r!==null&&Sm(r,a.deps)){o.memoizedState=hi(t,n,i,r);return}}Te.flags|=e,o.memoizedState=hi(1|t,n,i,r)}function Ep(e,t){return Ea(8390656,8,e,t)}function Em(e,t){return Tl(2048,8,e,t)}function r0(e,t){return Tl(4,2,e,t)}function s0(e,t){return Tl(4,4,e,t)}function o0(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 i0(e,t,n){return n=n!=null?n.concat([e]):null,Tl(4,4,o0.bind(null,t,e),n)}function Rm(){}function a0(e,t){var n=Ft();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Sm(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function l0(e,t){var n=Ft();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Sm(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function c0(e,t,n){return ss&21?(ln(n,t)||(n=px(),Te.lanes|=n,os|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,bt=!0),e.memoizedState=n)}function dj(e,t){var n=ve;ve=n!==0&&4>n?n:4,e(!0);var r=Wc.transition;Wc.transition={};try{e(!1),t()}finally{ve=n,Wc.transition=r}}function d0(){return Ft().memoizedState}function uj(e,t,n){var r=jr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},u0(e))m0(t,n);else if(n=Kx(e,t,n,r),n!==null){var o=pt();an(n,e,r,o),f0(n,t,r)}}function mj(e,t,n){var r=jr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(u0(e))m0(t,o);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(o.hasEagerState=!0,o.eagerState=l,ln(l,a)){var c=t.interleaved;c===null?(o.next=o,ym(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=Kx(e,t,o,r),n!==null&&(o=pt(),an(n,e,r,o),f0(n,t,r))}}function u0(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function m0(e,t){qo=tl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function f0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,om(e,n)}}var nl={readContext:Dt,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useInsertionEffect:rt,useLayoutEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useMutableSource:rt,useSyncExternalStore:rt,useId:rt,unstable_isNewReconciler:!1},fj={readContext:Dt,useCallback:function(e,t){return fn().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Ep,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ea(4194308,4,o0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ea(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ea(4,2,e,t)},useMemo:function(e,t){var n=fn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=fn();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=uj.bind(null,Te,e),[r.memoizedState,e]},useRef:function(e){var t=fn();return e={current:e},t.memoizedState=e},useState:Cp,useDebugValue:Rm,useDeferredValue:function(e){return fn().memoizedState=e},useTransition:function(){var e=Cp(!1),t=e[0];return e=dj.bind(null,e[1]),fn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Te,o=fn();if(Re){if(n===void 0)throw Error(V(407));n=n()}else{if(n=t(),He===null)throw Error(V(349));ss&30||Xx(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Ep(Jx.bind(null,r,i,e),[e]),r.flags|=2048,hi(9,Zx.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=fn(),t=He.identifierPrefix;if(Re){var n=On,r=Ln;n=(r&~(1<<32-on(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=fi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=cj++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},pj={readContext:Dt,useCallback:a0,useContext:Dt,useEffect:Em,useImperativeHandle:i0,useInsertionEffect:r0,useLayoutEffect:s0,useMemo:l0,useReducer:Uc,useRef:n0,useState:function(){return Uc(pi)},useDebugValue:Rm,useDeferredValue:function(e){var t=Ft();return c0(t,ze.memoizedState,e)},useTransition:function(){var e=Uc(pi)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:Yx,useSyncExternalStore:Qx,useId:d0,unstable_isNewReconciler:!1},hj={readContext:Dt,useCallback:a0,useContext:Dt,useEffect:Em,useImperativeHandle:i0,useInsertionEffect:r0,useLayoutEffect:s0,useMemo:l0,useReducer:Hc,useRef:n0,useState:function(){return Hc(pi)},useDebugValue:Rm,useDeferredValue:function(e){var t=Ft();return ze===null?t.memoizedState=e:c0(t,ze.memoizedState,e)},useTransition:function(){var e=Hc(pi)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:Yx,useSyncExternalStore:Qx,useId:d0,unstable_isNewReconciler:!1};function Zt(e,t){if(e&&e.defaultProps){t=Ie({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Yd(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ie({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Il={isMounted:function(e){return(e=e._reactInternals)?ms(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pt(),o=jr(e),i=$n(r,o);i.payload=t,n!=null&&(i.callback=n),t=wr(e,i,o),t!==null&&(an(t,e,o,r),ka(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pt(),o=jr(e),i=$n(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=wr(e,i,o),t!==null&&(an(t,e,o,r),ka(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pt(),r=jr(e),o=$n(n,r);o.tag=2,t!=null&&(o.callback=t),t=wr(e,o,r),t!==null&&(an(t,e,r,n),ka(t,e,r))}};function Rp(e,t,n,r,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!ai(n,r)||!ai(o,i):!0}function p0(e,t,n){var r=!1,o=Er,i=t.contextType;return typeof i=="object"&&i!==null?i=Dt(i):(o=Nt(t)?ns:lt.current,r=t.contextTypes,i=(r=r!=null)?no(e,o):Er),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Il,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Pp(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&&Il.enqueueReplaceState(t,t.state,null)}function Qd(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},bm(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Dt(i):(i=Nt(t)?ns:lt.current,o.context=no(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Yd(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Il.enqueueReplaceState(o,o.state,null),Ja(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function io(e,t){try{var n="",r=t;do n+=W1(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function Kc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Xd(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var gj=typeof WeakMap=="function"?WeakMap:Map;function h0(e,t,n){n=$n(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){sl||(sl=!0,au=r),Xd(e,t)},n}function g0(e,t,n){n=$n(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Xd(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Xd(e,t),typeof r!="function"&&(Nr===null?Nr=new Set([this]):Nr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function _p(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new gj;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=_j.bind(null,e,t,n),t.then(e,e))}function Ap(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 Tp(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,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=$n(-1,1),t.tag=2,wr(n,t,1))),n.lanes|=1),e)}var xj=Gn.ReactCurrentOwner,bt=!1;function ut(e,t,n,r){t.child=e===null?Hx(t,null,n,r):so(t,e.child,n,r)}function Ip(e,t,n,r,o){n=n.render;var i=t.ref;return Ds(t,o),r=km(e,t,n,r,i,o),n=Cm(),e!==null&&!bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Wn(e,t,o)):(Re&&n&&fm(t),t.flags|=1,ut(e,t,r,o),t.child)}function Mp(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Om(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,x0(e,t,i,r,o)):(e=Aa(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:ai,n(a,r)&&e.ref===t.ref)return Wn(e,t,o)}return t.flags|=1,e=Sr(i,r),e.ref=t.ref,e.return=t,t.child=e}function x0(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ai(i,r)&&e.ref===t.ref)if(bt=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(bt=!0);else return t.lanes=e.lanes,Wn(e,t,o)}return Zd(e,t,n,r,o)}function v0(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},je(Ts,kt),kt|=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,je(Ts,kt),kt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,je(Ts,kt),kt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,je(Ts,kt),kt|=r;return ut(e,t,o,n),t.child}function y0(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Zd(e,t,n,r,o){var i=Nt(n)?ns:lt.current;return i=no(t,i),Ds(t,o),n=km(e,t,n,r,i,o),r=Cm(),e!==null&&!bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Wn(e,t,o)):(Re&&r&&fm(t),t.flags|=1,ut(e,t,n,o),t.child)}function Lp(e,t,n,r,o){if(Nt(n)){var i=!0;qa(t)}else i=!1;if(Ds(t,o),t.stateNode===null)Ra(e,t),p0(t,n,r),Qd(t,n,r,o),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=Nt(n)?ns:lt.current,d=no(t,d));var u=n.getDerivedStateFromProps,m=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";m||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==d)&&Pp(t,a,r,d),ir=!1;var f=t.memoizedState;a.state=f,Ja(t,r,a,o),c=t.memoizedState,l!==r||f!==c||wt.current||ir?(typeof u=="function"&&(Yd(t,n,u,r),c=t.memoizedState),(l=ir||Rp(t,n,l,r,f,c,d))?(m||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,Gx(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Zt(t.type,l),a.props=d,m=t.pendingProps,f=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=Dt(c):(c=Nt(n)?ns:lt.current,c=no(t,c));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==m||f!==c)&&Pp(t,a,r,c),ir=!1,f=t.memoizedState,a.state=f,Ja(t,r,a,o);var v=t.memoizedState;l!==m||f!==v||wt.current||ir?(typeof p=="function"&&(Yd(t,n,p,r),v=t.memoizedState),(d=ir||Rp(t,n,d,r,f,v,c)||!1)?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,v,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,v,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),a.props=r,a.state=v,a.context=c,r=d):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Jd(e,t,n,r,i,o)}function Jd(e,t,n,r,o,i){y0(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&bp(t,n,!1),Wn(e,t,i);r=t.stateNode,xj.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=so(t,e.child,null,i),t.child=so(t,null,l,i)):ut(e,t,l,i),t.memoizedState=r.state,o&&bp(t,n,!0),t.child}function b0(e){var t=e.stateNode;t.pendingContext?yp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&yp(e,t.context,!1),wm(e,t.containerInfo)}function Op(e,t,n,r,o){return ro(),hm(o),t.flags|=256,ut(e,t,n,r),t.child}var eu={dehydrated:null,treeContext:null,retryLane:0};function tu(e){return{baseLanes:e,cachePool:null,transitions:null}}function w0(e,t,n){var r=t.pendingProps,o=Ae.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),je(Ae,o&1),e===null)return Gd(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=Ol(a,r,0,null),e=es(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=tu(n),t.memoizedState=eu,e):Pm(t,a));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return vj(e,t,a,r,l,o,n);if(i){i=r.fallback,a=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Sr(o,c),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Sr(l,i):(i=es(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?tu(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=eu,r}return i=e.child,e=i.sibling,r=Sr(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 Pm(e,t){return t=Ol({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ra(e,t,n,r){return r!==null&&hm(r),so(t,e.child,null,n),e=Pm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vj(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=Kc(Error(V(422))),ra(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Ol({mode:"visible",children:r.children},o,0,null),i=es(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&so(t,e.child,null,a),t.child.memoizedState=tu(a),t.memoizedState=eu,i);if(!(t.mode&1))return ra(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(V(419)),r=Kc(i,r,void 0),ra(e,t,a,r)}if(l=(a&e.childLanes)!==0,bt||l){if(r=He,r!==null){switch(a&-a){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Vn(e,o),an(r,e,o,-1))}return Lm(),r=Kc(Error(V(421))),ra(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Aj.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Et=br(o.nextSibling),Rt=t,Re=!0,rn=null,e!==null&&(Mt[Lt++]=Ln,Mt[Lt++]=On,Mt[Lt++]=rs,Ln=e.id,On=e.overflow,rs=t),t=Pm(t,r.children),t.flags|=4096,t)}function $p(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qd(e.return,t,n)}function Gc(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function N0(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(ut(e,t,r.children,n),r=Ae.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&&$p(e,n,t);else if(e.tag===19)$p(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(je(Ae,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&el(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Gc(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&el(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Gc(t,!0,n,null,i);break;case"together":Gc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ra(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),os|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,n=Sr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Sr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function yj(e,t,n){switch(t.tag){case 3:b0(t),ro();break;case 5:qx(t);break;case 1:Nt(t.type)&&qa(t);break;case 4:wm(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;je(Xa,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(je(Ae,Ae.current&1),t.flags|=128,null):n&t.child.childLanes?w0(e,t,n):(je(Ae,Ae.current&1),e=Wn(e,t,n),e!==null?e.sibling:null);je(Ae,Ae.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return N0(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),je(Ae,Ae.current),r)break;return null;case 22:case 23:return t.lanes=0,v0(e,t,n)}return Wn(e,t,n)}var j0,nu,S0,k0;j0=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}};nu=function(){};S0=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Hr(Nn.current);var i=null;switch(n){case"input":o=Sd(e,o),r=Sd(e,r),i=[];break;case"select":o=Ie({},o,{value:void 0}),r=Ie({},r,{value:void 0}),i=[];break;case"textarea":o=Ed(e,o),r=Ed(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ka)}Pd(n,r);var a;n=null;for(d in o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&o[d]!=null)if(d==="style"){var l=o[d];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ei.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(l=o!=null?o[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"&&(ei.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&ke("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)}};k0=function(e,t,n,r){n!==r&&(t.flags|=4)};function _o(e,t){if(!Re)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 st(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bj(e,t,n){var r=t.pendingProps;switch(pm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return Nt(t.type)&&Ga(),st(t),null;case 3:return r=t.stateNode,oo(),Ce(wt),Ce(lt),jm(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ta(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,rn!==null&&(du(rn),rn=null))),nu(e,t),st(t),null;case 5:Nm(t);var o=Hr(mi.current);if(n=t.type,e!==null&&t.stateNode!=null)S0(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(V(166));return st(t),null}if(e=Hr(Nn.current),ta(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[vn]=t,r[di]=i,e=(t.mode&1)!==0,n){case"dialog":ke("cancel",r),ke("close",r);break;case"iframe":case"object":case"embed":ke("load",r);break;case"video":case"audio":for(o=0;o<Fo.length;o++)ke(Fo[o],r);break;case"source":ke("error",r);break;case"img":case"image":case"link":ke("error",r),ke("load",r);break;case"details":ke("toggle",r);break;case"input":Kf(r,i),ke("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ke("invalid",r);break;case"textarea":qf(r,i),ke("invalid",r)}Pd(n,i),o=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&&ea(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&ea(r.textContent,l,e),o=["children",""+l]):ei.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&ke("scroll",r)}switch(n){case"input":Ki(r),Gf(r,i,!0);break;case"textarea":Ki(r),Yf(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Ka)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Jg(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[vn]=t,e[di]=r,j0(e,t,!1,!1),t.stateNode=e;e:{switch(a=_d(n,r),n){case"dialog":ke("cancel",e),ke("close",e),o=r;break;case"iframe":case"object":case"embed":ke("load",e),o=r;break;case"video":case"audio":for(o=0;o<Fo.length;o++)ke(Fo[o],e);o=r;break;case"source":ke("error",e),o=r;break;case"img":case"image":case"link":ke("error",e),ke("load",e),o=r;break;case"details":ke("toggle",e),o=r;break;case"input":Kf(e,r),o=Sd(e,r),ke("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ie({},r,{value:void 0}),ke("invalid",e);break;case"textarea":qf(e,r),o=Ed(e,r),ke("invalid",e);break;default:o=r}Pd(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?nx(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&ex(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&ti(e,c):typeof c=="number"&&ti(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ei.hasOwnProperty(i)?c!=null&&i==="onScroll"&&ke("scroll",e):c!=null&&Ju(e,i,c,a))}switch(n){case"input":Ki(e),Gf(e,r,!1);break;case"textarea":Ki(e),Yf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Cr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Ms(e,!!r.multiple,i,!1):r.defaultValue!=null&&Ms(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ka)}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 st(t),null;case 6:if(e&&t.stateNode!=null)k0(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(V(166));if(n=Hr(mi.current),Hr(Nn.current),ta(t)){if(r=t.stateNode,n=t.memoizedProps,r[vn]=t,(i=r.nodeValue!==n)&&(e=Rt,e!==null))switch(e.tag){case 3:ea(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ea(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[vn]=t,t.stateNode=r}return st(t),null;case 13:if(Ce(Ae),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Re&&Et!==null&&t.mode&1&&!(t.flags&128))Wx(),ro(),t.flags|=98560,i=!1;else if(i=ta(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(V(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(V(317));i[vn]=t}else ro(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;st(t),i=!1}else rn!==null&&(du(rn),rn=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||Ae.current&1?Ve===0&&(Ve=3):Lm())),t.updateQueue!==null&&(t.flags|=4),st(t),null);case 4:return oo(),nu(e,t),e===null&&li(t.stateNode.containerInfo),st(t),null;case 10:return vm(t.type._context),st(t),null;case 17:return Nt(t.type)&&Ga(),st(t),null;case 19:if(Ce(Ae),i=t.memoizedState,i===null)return st(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)_o(i,!1);else{if(Ve!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=el(e),a!==null){for(t.flags|=128,_o(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 je(Ae,Ae.current&1|2),t.child}e=e.sibling}i.tail!==null&&$e()>ao&&(t.flags|=128,r=!0,_o(i,!1),t.lanes=4194304)}else{if(!r)if(e=el(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),_o(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Re)return st(t),null}else 2*$e()-i.renderingStartTime>ao&&n!==1073741824&&(t.flags|=128,r=!0,_o(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=Ae.current,je(Ae,r?n&1|2:n&1),t):(st(t),null);case 22:case 23:return Mm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?kt&1073741824&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function wj(e,t){switch(pm(t),t.tag){case 1:return Nt(t.type)&&Ga(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return oo(),Ce(wt),Ce(lt),jm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Nm(t),null;case 13:if(Ce(Ae),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));ro()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(Ae),null;case 4:return oo(),null;case 10:return vm(t.type._context),null;case 22:case 23:return Mm(),null;case 24:return null;default:return null}}var sa=!1,it=!1,Nj=typeof WeakSet=="function"?WeakSet:Set,q=null;function As(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Oe(e,t,r)}else n.current=null}function ru(e,t,n){try{n()}catch(r){Oe(e,t,r)}}var Dp=!1;function jj(e,t){if(zd=Wa,e=_x(),mm(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 o=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,m=e,f=null;t:for(;;){for(var p;m!==n||o!==0&&m.nodeType!==3||(l=a+o),m!==i||r!==0&&m.nodeType!==3||(c=a+r),m.nodeType===3&&(a+=m.nodeValue.length),(p=m.firstChild)!==null;)f=m,m=p;for(;;){if(m===e)break t;if(f===n&&++d===o&&(l=a),f===i&&++u===r&&(c=a),(p=m.nextSibling)!==null)break;m=f,f=m.parentNode}m=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},Wa=!1,q=t;q!==null;)if(t=q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,q=e;else for(;q!==null;){t=q;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,w=v.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:Zt(t.type,g),w);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(N){Oe(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,q=e;break}q=t.return}return v=Dp,Dp=!1,v}function Yo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&ru(t,n,i)}o=o.next}while(o!==r)}}function Ml(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 su(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 C0(e){var t=e.alternate;t!==null&&(e.alternate=null,C0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vn],delete t[di],delete t[Ud],delete t[oj],delete t[ij])),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 E0(e){return e.tag===5||e.tag===3||e.tag===4}function Fp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||E0(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 ou(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=Ka));else if(r!==4&&(e=e.child,e!==null))for(ou(e,t,n),e=e.sibling;e!==null;)ou(e,t,n),e=e.sibling}function iu(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(iu(e,t,n),e=e.sibling;e!==null;)iu(e,t,n),e=e.sibling}var qe=null,nn=!1;function er(e,t,n){for(n=n.child;n!==null;)R0(e,t,n),n=n.sibling}function R0(e,t,n){if(wn&&typeof wn.onCommitFiberUnmount=="function")try{wn.onCommitFiberUnmount(Cl,n)}catch{}switch(n.tag){case 5:it||As(n,t);case 6:var r=qe,o=nn;qe=null,er(e,t,n),qe=r,nn=o,qe!==null&&(nn?(e=qe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):qe.removeChild(n.stateNode));break;case 18:qe!==null&&(nn?(e=qe,n=n.stateNode,e.nodeType===8?zc(e.parentNode,n):e.nodeType===1&&zc(e,n),oi(e)):zc(qe,n.stateNode));break;case 4:r=qe,o=nn,qe=n.stateNode.containerInfo,nn=!0,er(e,t,n),qe=r,nn=o;break;case 0:case 11:case 14:case 15:if(!it&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&ru(n,t,a),o=o.next}while(o!==r)}er(e,t,n);break;case 1:if(!it&&(As(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Oe(n,t,l)}er(e,t,n);break;case 21:er(e,t,n);break;case 22:n.mode&1?(it=(r=it)||n.memoizedState!==null,er(e,t,n),it=r):er(e,t,n);break;default:er(e,t,n)}}function zp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Nj),t.forEach(function(r){var o=Tj.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Yt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:qe=l.stateNode,nn=!1;break e;case 3:qe=l.stateNode.containerInfo,nn=!0;break e;case 4:qe=l.stateNode.containerInfo,nn=!0;break e}l=l.return}if(qe===null)throw Error(V(160));R0(i,a,o),qe=null,nn=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(d){Oe(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)P0(t,e),t=t.sibling}function P0(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Yt(t,e),mn(e),r&4){try{Yo(3,e,e.return),Ml(3,e)}catch(g){Oe(e,e.return,g)}try{Yo(5,e,e.return)}catch(g){Oe(e,e.return,g)}}break;case 1:Yt(t,e),mn(e),r&512&&n!==null&&As(n,n.return);break;case 5:if(Yt(t,e),mn(e),r&512&&n!==null&&As(n,n.return),e.flags&32){var o=e.stateNode;try{ti(o,"")}catch(g){Oe(e,e.return,g)}}if(r&4&&(o=e.stateNode,o!=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&&Xg(o,i),_d(l,a);var d=_d(l,i);for(a=0;a<c.length;a+=2){var u=c[a],m=c[a+1];u==="style"?nx(o,m):u==="dangerouslySetInnerHTML"?ex(o,m):u==="children"?ti(o,m):Ju(o,u,m,d)}switch(l){case"input":kd(o,i);break;case"textarea":Zg(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?Ms(o,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?Ms(o,!!i.multiple,i.defaultValue,!0):Ms(o,!!i.multiple,i.multiple?[]:"",!1))}o[di]=i}catch(g){Oe(e,e.return,g)}}break;case 6:if(Yt(t,e),mn(e),r&4){if(e.stateNode===null)throw Error(V(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(g){Oe(e,e.return,g)}}break;case 3:if(Yt(t,e),mn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{oi(t.containerInfo)}catch(g){Oe(e,e.return,g)}break;case 4:Yt(t,e),mn(e);break;case 13:Yt(t,e),mn(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Tm=$e())),r&4&&zp(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(it=(d=it)||u,Yt(t,e),it=d):Yt(t,e),mn(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(q=e,u=e.child;u!==null;){for(m=q=u;q!==null;){switch(f=q,p=f.child,f.tag){case 0:case 11:case 14:case 15:Yo(4,f,f.return);break;case 1:As(f,f.return);var v=f.stateNode;if(typeof v.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(g){Oe(r,n,g)}}break;case 5:As(f,f.return);break;case 22:if(f.memoizedState!==null){Vp(m);continue}}p!==null?(p.return=f,q=p):Vp(m)}u=u.sibling}e:for(u=null,m=e;;){if(m.tag===5){if(u===null){u=m;try{o=m.stateNode,d?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=m.stateNode,c=m.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=tx("display",a))}catch(g){Oe(e,e.return,g)}}}else if(m.tag===6){if(u===null)try{m.stateNode.nodeValue=d?"":m.memoizedProps}catch(g){Oe(e,e.return,g)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;u===m&&(u=null),m=m.return}u===m&&(u=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:Yt(t,e),mn(e),r&4&&zp(e);break;case 21:break;default:Yt(t,e),mn(e)}}function mn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(E0(n)){var r=n;break e}n=n.return}throw Error(V(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(ti(o,""),r.flags&=-33);var i=Fp(e);iu(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,l=Fp(e);ou(e,l,a);break;default:throw Error(V(161))}}catch(c){Oe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sj(e,t,n){q=e,_0(e)}function _0(e,t,n){for(var r=(e.mode&1)!==0;q!==null;){var o=q,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||sa;if(!a){var l=o.alternate,c=l!==null&&l.memoizedState!==null||it;l=sa;var d=it;if(sa=a,(it=c)&&!d)for(q=o;q!==null;)a=q,c=a.child,a.tag===22&&a.memoizedState!==null?Wp(o):c!==null?(c.return=a,q=c):Wp(o);for(;i!==null;)q=i,_0(i),i=i.sibling;q=o,sa=l,it=d}Bp(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,q=i):Bp(e)}}function Bp(e){for(;q!==null;){var t=q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:it||Ml(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!it)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Zt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&kp(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}kp(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 m=u.dehydrated;m!==null&&oi(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}it||t.flags&512&&su(t)}catch(f){Oe(t,t.return,f)}}if(t===e){q=null;break}if(n=t.sibling,n!==null){n.return=t.return,q=n;break}q=t.return}}function Vp(e){for(;q!==null;){var t=q;if(t===e){q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,q=n;break}q=t.return}}function Wp(e){for(;q!==null;){var t=q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ml(4,t)}catch(c){Oe(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){Oe(t,o,c)}}var i=t.return;try{su(t)}catch(c){Oe(t,i,c)}break;case 5:var a=t.return;try{su(t)}catch(c){Oe(t,a,c)}}}catch(c){Oe(t,t.return,c)}if(t===e){q=null;break}var l=t.sibling;if(l!==null){l.return=t.return,q=l;break}q=t.return}}var kj=Math.ceil,rl=Gn.ReactCurrentDispatcher,_m=Gn.ReactCurrentOwner,$t=Gn.ReactCurrentBatchConfig,ge=0,He=null,Fe=null,Je=0,kt=0,Ts=Ir(0),Ve=0,gi=null,os=0,Ll=0,Am=0,Qo=null,yt=null,Tm=0,ao=1/0,An=null,sl=!1,au=null,Nr=null,oa=!1,hr=null,ol=0,Xo=0,lu=null,Pa=-1,_a=0;function pt(){return ge&6?$e():Pa!==-1?Pa:Pa=$e()}function jr(e){return e.mode&1?ge&2&&Je!==0?Je&-Je:lj.transition!==null?(_a===0&&(_a=px()),_a):(e=ve,e!==0||(e=window.event,e=e===void 0?16:wx(e.type)),e):1}function an(e,t,n,r){if(50<Xo)throw Xo=0,lu=null,Error(V(185));Ri(e,n,r),(!(ge&2)||e!==He)&&(e===He&&(!(ge&2)&&(Ll|=n),Ve===4&&lr(e,Je)),jt(e,r),n===1&&ge===0&&!(t.mode&1)&&(ao=$e()+500,Al&&Mr()))}function jt(e,t){var n=e.callbackNode;lN(e,t);var r=Va(e,e===He?Je:0);if(r===0)n!==null&&Zf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Zf(n),t===1)e.tag===0?aj(Up.bind(null,e)):zx(Up.bind(null,e)),rj(function(){!(ge&6)&&Mr()}),n=null;else{switch(hx(r)){case 1:n=sm;break;case 4:n=mx;break;case 16:n=Ba;break;case 536870912:n=fx;break;default:n=Ba}n=D0(n,A0.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function A0(e,t){if(Pa=-1,_a=0,ge&6)throw Error(V(327));var n=e.callbackNode;if(Fs()&&e.callbackNode!==n)return null;var r=Va(e,e===He?Je:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=il(e,r);else{t=r;var o=ge;ge|=2;var i=I0();(He!==e||Je!==t)&&(An=null,ao=$e()+500,Jr(e,t));do try{Rj();break}catch(l){T0(e,l)}while(!0);xm(),rl.current=i,ge=o,Fe!==null?t=0:(He=null,Je=0,t=Ve)}if(t!==0){if(t===2&&(o=Ld(e),o!==0&&(r=o,t=cu(e,o))),t===1)throw n=gi,Jr(e,0),lr(e,r),jt(e,$e()),n;if(t===6)lr(e,r);else{if(o=e.current.alternate,!(r&30)&&!Cj(o)&&(t=il(e,r),t===2&&(i=Ld(e),i!==0&&(r=i,t=cu(e,i))),t===1))throw n=gi,Jr(e,0),lr(e,r),jt(e,$e()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(V(345));case 2:Vr(e,yt,An);break;case 3:if(lr(e,r),(r&130023424)===r&&(t=Tm+500-$e(),10<t)){if(Va(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){pt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Wd(Vr.bind(null,e,yt,An),t);break}Vr(e,yt,An);break;case 4:if(lr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-on(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=$e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kj(r/1960))-r,10<r){e.timeoutHandle=Wd(Vr.bind(null,e,yt,An),r);break}Vr(e,yt,An);break;case 5:Vr(e,yt,An);break;default:throw Error(V(329))}}}return jt(e,$e()),e.callbackNode===n?A0.bind(null,e):null}function cu(e,t){var n=Qo;return e.current.memoizedState.isDehydrated&&(Jr(e,t).flags|=256),e=il(e,t),e!==2&&(t=yt,yt=n,t!==null&&du(t)),e}function du(e){yt===null?yt=e:yt.push.apply(yt,e)}function Cj(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 o=n[r],i=o.getSnapshot;o=o.value;try{if(!ln(i(),o))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 lr(e,t){for(t&=~Am,t&=~Ll,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-on(t),r=1<<n;e[n]=-1,t&=~r}}function Up(e){if(ge&6)throw Error(V(327));Fs();var t=Va(e,0);if(!(t&1))return jt(e,$e()),null;var n=il(e,t);if(e.tag!==0&&n===2){var r=Ld(e);r!==0&&(t=r,n=cu(e,r))}if(n===1)throw n=gi,Jr(e,0),lr(e,t),jt(e,$e()),n;if(n===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Vr(e,yt,An),jt(e,$e()),null}function Im(e,t){var n=ge;ge|=1;try{return e(t)}finally{ge=n,ge===0&&(ao=$e()+500,Al&&Mr())}}function is(e){hr!==null&&hr.tag===0&&!(ge&6)&&Fs();var t=ge;ge|=1;var n=$t.transition,r=ve;try{if($t.transition=null,ve=1,e)return e()}finally{ve=r,$t.transition=n,ge=t,!(ge&6)&&Mr()}}function Mm(){kt=Ts.current,Ce(Ts)}function Jr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,nj(n)),Fe!==null)for(n=Fe.return;n!==null;){var r=n;switch(pm(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ga();break;case 3:oo(),Ce(wt),Ce(lt),jm();break;case 5:Nm(r);break;case 4:oo();break;case 13:Ce(Ae);break;case 19:Ce(Ae);break;case 10:vm(r.type._context);break;case 22:case 23:Mm()}n=n.return}if(He=e,Fe=e=Sr(e.current,null),Je=kt=t,Ve=0,gi=null,Am=Ll=os=0,yt=Qo=null,Ur!==null){for(t=0;t<Ur.length;t++)if(n=Ur[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=o,r.next=a}n.pending=r}Ur=null}return e}function T0(e,t){do{var n=Fe;try{if(xm(),Ca.current=nl,tl){for(var r=Te.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}tl=!1}if(ss=0,Ue=ze=Te=null,qo=!1,fi=0,_m.current=null,n===null||n.return===null){Ve=1,gi=t,Fe=null;break}e:{var i=e,a=n.return,l=n,c=t;if(t=Je,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,m=u.tag;if(!(u.mode&1)&&(m===0||m===11||m===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=Ap(a);if(p!==null){p.flags&=-257,Tp(p,a,l,i,t),p.mode&1&&_p(i,d,t),t=p,c=d;var v=t.updateQueue;if(v===null){var g=new Set;g.add(c),t.updateQueue=g}else v.add(c);break e}else{if(!(t&1)){_p(i,d,t),Lm();break e}c=Error(V(426))}}else if(Re&&l.mode&1){var w=Ap(a);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Tp(w,a,l,i,t),hm(io(c,l));break e}}i=c=io(c,l),Ve!==4&&(Ve=2),Qo===null?Qo=[i]:Qo.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=h0(i,c,t);Sp(i,x);break e;case 1:l=c;var y=i.type,b=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Nr===null||!Nr.has(b)))){i.flags|=65536,t&=-t,i.lanes|=t;var N=g0(i,l,t);Sp(i,N);break e}}i=i.return}while(i!==null)}L0(n)}catch(j){t=j,Fe===n&&n!==null&&(Fe=n=n.return);continue}break}while(!0)}function I0(){var e=rl.current;return rl.current=nl,e===null?nl:e}function Lm(){(Ve===0||Ve===3||Ve===2)&&(Ve=4),He===null||!(os&268435455)&&!(Ll&268435455)||lr(He,Je)}function il(e,t){var n=ge;ge|=2;var r=I0();(He!==e||Je!==t)&&(An=null,Jr(e,t));do try{Ej();break}catch(o){T0(e,o)}while(!0);if(xm(),ge=n,rl.current=r,Fe!==null)throw Error(V(261));return He=null,Je=0,Ve}function Ej(){for(;Fe!==null;)M0(Fe)}function Rj(){for(;Fe!==null&&!J1();)M0(Fe)}function M0(e){var t=$0(e.alternate,e,kt);e.memoizedProps=e.pendingProps,t===null?L0(e):Fe=t,_m.current=null}function L0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=wj(n,t),n!==null){n.flags&=32767,Fe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ve=6,Fe=null;return}}else if(n=bj(n,t,kt),n!==null){Fe=n;return}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);Ve===0&&(Ve=5)}function Vr(e,t,n){var r=ve,o=$t.transition;try{$t.transition=null,ve=1,Pj(e,t,n,r)}finally{$t.transition=o,ve=r}return null}function Pj(e,t,n,r){do Fs();while(hr!==null);if(ge&6)throw Error(V(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(V(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(cN(e,i),e===He&&(Fe=He=null,Je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||oa||(oa=!0,D0(Ba,function(){return Fs(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=$t.transition,$t.transition=null;var a=ve;ve=1;var l=ge;ge|=4,_m.current=null,jj(e,n),P0(n,e),YN(Bd),Wa=!!zd,Bd=zd=null,e.current=n,Sj(n),eN(),ge=l,ve=a,$t.transition=i}else e.current=n;if(oa&&(oa=!1,hr=e,ol=o),i=e.pendingLanes,i===0&&(Nr=null),rN(n.stateNode),jt(e,$e()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(sl)throw sl=!1,e=au,au=null,e;return ol&1&&e.tag!==0&&Fs(),i=e.pendingLanes,i&1?e===lu?Xo++:(Xo=0,lu=e):Xo=0,Mr(),null}function Fs(){if(hr!==null){var e=hx(ol),t=$t.transition,n=ve;try{if($t.transition=null,ve=16>e?16:e,hr===null)var r=!1;else{if(e=hr,hr=null,ol=0,ge&6)throw Error(V(331));var o=ge;for(ge|=4,q=e.current;q!==null;){var i=q,a=i.child;if(q.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(q=d;q!==null;){var u=q;switch(u.tag){case 0:case 11:case 15:Yo(8,u,i)}var m=u.child;if(m!==null)m.return=u,q=m;else for(;q!==null;){u=q;var f=u.sibling,p=u.return;if(C0(u),u===d){q=null;break}if(f!==null){f.return=p,q=f;break}q=p}}}var v=i.alternate;if(v!==null){var g=v.child;if(g!==null){v.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}q=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,q=a;else e:for(;q!==null;){if(i=q,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Yo(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,q=x;break e}q=i.return}}var y=e.current;for(q=y;q!==null;){a=q;var b=a.child;if(a.subtreeFlags&2064&&b!==null)b.return=a,q=b;else e:for(a=y;q!==null;){if(l=q,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ml(9,l)}}catch(j){Oe(l,l.return,j)}if(l===a){q=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,q=N;break e}q=l.return}}if(ge=o,Mr(),wn&&typeof wn.onPostCommitFiberRoot=="function")try{wn.onPostCommitFiberRoot(Cl,e)}catch{}r=!0}return r}finally{ve=n,$t.transition=t}}return!1}function Hp(e,t,n){t=io(n,t),t=h0(e,t,1),e=wr(e,t,1),t=pt(),e!==null&&(Ri(e,1,t),jt(e,t))}function Oe(e,t,n){if(e.tag===3)Hp(e,e,n);else for(;t!==null;){if(t.tag===3){Hp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Nr===null||!Nr.has(r))){e=io(n,e),e=g0(t,e,1),t=wr(t,e,1),e=pt(),t!==null&&(Ri(t,1,e),jt(t,e));break}}t=t.return}}function _j(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=pt(),e.pingedLanes|=e.suspendedLanes&n,He===e&&(Je&n)===n&&(Ve===4||Ve===3&&(Je&130023424)===Je&&500>$e()-Tm?Jr(e,0):Am|=n),jt(e,t)}function O0(e,t){t===0&&(e.mode&1?(t=Yi,Yi<<=1,!(Yi&130023424)&&(Yi=4194304)):t=1);var n=pt();e=Vn(e,t),e!==null&&(Ri(e,t,n),jt(e,n))}function Aj(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),O0(e,n)}function Tj(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(V(314))}r!==null&&r.delete(t),O0(e,n)}var $0;$0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||wt.current)bt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return bt=!1,yj(e,t,n);bt=!!(e.flags&131072)}else bt=!1,Re&&t.flags&1048576&&Bx(t,Qa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ra(e,t),e=t.pendingProps;var o=no(t,lt.current);Ds(t,n),o=km(null,t,r,e,o,n);var i=Cm();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Nt(r)?(i=!0,qa(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,bm(t),o.updater=Il,t.stateNode=o,o._reactInternals=t,Qd(t,r,e,n),t=Jd(null,t,r,!0,i,n)):(t.tag=0,Re&&i&&fm(t),ut(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ra(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Mj(r),e=Zt(r,e),o){case 0:t=Zd(null,t,r,e,n);break e;case 1:t=Lp(null,t,r,e,n);break e;case 11:t=Ip(null,t,r,e,n);break e;case 14:t=Mp(null,t,r,Zt(r.type,e),n);break e}throw Error(V(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),Zd(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),Lp(e,t,r,o,n);case 3:e:{if(b0(t),e===null)throw Error(V(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Gx(e,t),Ja(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){o=io(Error(V(423)),t),t=Op(e,t,r,n,o);break e}else if(r!==o){o=io(Error(V(424)),t),t=Op(e,t,r,n,o);break e}else for(Et=br(t.stateNode.containerInfo.firstChild),Rt=t,Re=!0,rn=null,n=Hx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ro(),r===o){t=Wn(e,t,n);break e}ut(e,t,r,n)}t=t.child}return t;case 5:return qx(t),e===null&&Gd(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Vd(r,o)?a=null:i!==null&&Vd(r,i)&&(t.flags|=32),y0(e,t),ut(e,t,a,n),t.child;case 6:return e===null&&Gd(t),null;case 13:return w0(e,t,n);case 4:return wm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):ut(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),Ip(e,t,r,o,n);case 7:return ut(e,t,t.pendingProps,n),t.child;case 8:return ut(e,t,t.pendingProps.children,n),t.child;case 12:return ut(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,je(Xa,r._currentValue),r._currentValue=a,i!==null)if(ln(i.value,a)){if(i.children===o.children&&!wt.current){t=Wn(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=$n(-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),qd(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(V(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),qd(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}ut(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ds(t,n),o=Dt(o),r=r(o),t.flags|=1,ut(e,t,r,n),t.child;case 14:return r=t.type,o=Zt(r,t.pendingProps),o=Zt(r.type,o),Mp(e,t,r,o,n);case 15:return x0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),Ra(e,t),t.tag=1,Nt(r)?(e=!0,qa(t)):e=!1,Ds(t,n),p0(t,r,o),Qd(t,r,o,n),Jd(null,t,r,!0,e,n);case 19:return N0(e,t,n);case 22:return v0(e,t,n)}throw Error(V(156,t.tag))};function D0(e,t){return ux(e,t)}function Ij(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 Ot(e,t,n,r){return new Ij(e,t,n,r)}function Om(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mj(e){if(typeof e=="function")return Om(e)?1:0;if(e!=null){if(e=e.$$typeof,e===tm)return 11;if(e===nm)return 14}return 2}function Sr(e,t){var n=e.alternate;return n===null?(n=Ot(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 Aa(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")Om(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ns:return es(n.children,o,i,t);case em:a=8,o|=8;break;case bd:return e=Ot(12,n,t,o|2),e.elementType=bd,e.lanes=i,e;case wd:return e=Ot(13,n,t,o),e.elementType=wd,e.lanes=i,e;case Nd:return e=Ot(19,n,t,o),e.elementType=Nd,e.lanes=i,e;case qg:return Ol(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kg:a=10;break e;case Gg:a=9;break e;case tm:a=11;break e;case nm:a=14;break e;case or:a=16,r=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=Ot(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function es(e,t,n,r){return e=Ot(7,e,r,t),e.lanes=n,e}function Ol(e,t,n,r){return e=Ot(22,e,r,t),e.elementType=qg,e.lanes=n,e.stateNode={isHidden:!1},e}function qc(e,t,n){return e=Ot(6,e,null,t),e.lanes=n,e}function Yc(e,t,n){return t=Ot(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Lj(e,t,n,r,o){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=Pc(0),this.expirationTimes=Pc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function $m(e,t,n,r,o,i,a,l,c){return e=new Lj(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ot(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},bm(i),e}function Oj(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 F0(e){if(!e)return Er;e=e._reactInternals;e:{if(ms(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Nt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var n=e.type;if(Nt(n))return Fx(e,n,t)}return t}function z0(e,t,n,r,o,i,a,l,c){return e=$m(n,r,!0,e,o,i,a,l,c),e.context=F0(null),n=e.current,r=pt(),o=jr(n),i=$n(r,o),i.callback=t??null,wr(n,i,o),e.current.lanes=o,Ri(e,o,r),jt(e,r),e}function $l(e,t,n,r){var o=t.current,i=pt(),a=jr(o);return n=F0(n),t.context===null?t.context=n:t.pendingContext=n,t=$n(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=wr(o,t,a),e!==null&&(an(e,o,a,i),ka(e,o,a)),a}function al(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 Kp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Dm(e,t){Kp(e,t),(e=e.alternate)&&Kp(e,t)}function $j(){return null}var B0=typeof reportError=="function"?reportError:function(e){console.error(e)};function Fm(e){this._internalRoot=e}Dl.prototype.render=Fm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));$l(e,t,null,null)};Dl.prototype.unmount=Fm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;is(function(){$l(null,e,null,null)}),t[Bn]=null}};function Dl(e){this._internalRoot=e}Dl.prototype.unstable_scheduleHydration=function(e){if(e){var t=vx();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ar.length&&t!==0&&t<ar[n].priority;n++);ar.splice(n,0,e),n===0&&bx(e)}};function zm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Fl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Gp(){}function Dj(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var d=al(a);i.call(d)}}var a=z0(t,r,e,0,null,!1,!1,"",Gp);return e._reactRootContainer=a,e[Bn]=a.current,li(e.nodeType===8?e.parentNode:e),is(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var d=al(c);l.call(d)}}var c=$m(e,0,!1,null,null,!1,!1,"",Gp);return e._reactRootContainer=c,e[Bn]=c.current,li(e.nodeType===8?e.parentNode:e),is(function(){$l(t,c,n,r)}),c}function zl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var l=o;o=function(){var c=al(a);l.call(c)}}$l(t,a,e,o)}else a=Dj(n,t,e,o,r);return al(a)}gx=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Do(t.pendingLanes);n!==0&&(om(t,n|1),jt(t,$e()),!(ge&6)&&(ao=$e()+500,Mr()))}break;case 13:is(function(){var r=Vn(e,1);if(r!==null){var o=pt();an(r,e,1,o)}}),Dm(e,1)}};im=function(e){if(e.tag===13){var t=Vn(e,134217728);if(t!==null){var n=pt();an(t,e,134217728,n)}Dm(e,134217728)}};xx=function(e){if(e.tag===13){var t=jr(e),n=Vn(e,t);if(n!==null){var r=pt();an(n,e,t,r)}Dm(e,t)}};vx=function(){return ve};yx=function(e,t){var n=ve;try{return ve=e,t()}finally{ve=n}};Td=function(e,t,n){switch(t){case"input":if(kd(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 o=_l(r);if(!o)throw Error(V(90));Qg(r),kd(r,o)}}}break;case"textarea":Zg(e,n);break;case"select":t=n.value,t!=null&&Ms(e,!!n.multiple,t,!1)}};ox=Im;ix=is;var Fj={usingClientEntryPoint:!1,Events:[_i,Cs,_l,rx,sx,Im]},Ao={findFiberByHostInstance:Wr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zj={bundleType:Ao.bundleType,version:Ao.version,rendererPackageName:Ao.rendererPackageName,rendererConfig:Ao.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=cx(e),e===null?null:e.stateNode},findFiberByHostInstance:Ao.findFiberByHostInstance||$j,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{Cl=ia.inject(zj),wn=ia}catch{}}At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Fj;At.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!zm(t))throw Error(V(200));return Oj(e,t,null,n)};At.createRoot=function(e,t){if(!zm(e))throw Error(V(299));var n=!1,r="",o=B0;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=$m(e,1,!1,null,null,n,!1,r,o),e[Bn]=t.current,li(e.nodeType===8?e.parentNode:e),new Fm(t)};At.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(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=cx(t),e=e===null?null:e.stateNode,e};At.flushSync=function(e){return is(e)};At.hydrate=function(e,t,n){if(!Fl(t))throw Error(V(200));return zl(null,e,t,!0,n)};At.hydrateRoot=function(e,t,n){if(!zm(e))throw Error(V(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=B0;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=z0(t,null,e,1,n??null,o,!1,i,a),e[Bn]=t.current,li(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Dl(t)};At.render=function(e,t,n){if(!Fl(t))throw Error(V(200));return zl(null,e,t,!1,n)};At.unmountComponentAtNode=function(e){if(!Fl(e))throw Error(V(40));return e._reactRootContainer?(is(function(){zl(null,null,e,!1,function(){e._reactRootContainer=null,e[Bn]=null})}),!0):!1};At.unstable_batchedUpdates=Im;At.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Fl(n))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return zl(e,t,n,!1,r)};At.version="18.3.1-next-f1338f8080-20240426";function V0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(V0)}catch(e){console.error(e)}}V0(),Vg.exports=At;var fs=Vg.exports;const W0=_g(fs);var U0,qp=fs;U0=qp.createRoot,qp.hydrateRoot;var Bl=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(){}},Vl=typeof window>"u"||"Deno"in globalThis;function Jt(){}function Bj(e,t){return typeof e=="function"?e(t):e}function Vj(e){return typeof e=="number"&&e>=0&&e!==1/0}function Wj(e,t){return Math.max(e+(t||0)-Date.now(),0)}function uu(e,t){return typeof e=="function"?e(t):e}function Uj(e,t){return typeof e=="function"?e(t):e}function Yp(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==Bm(a,t.options))return!1}else if(!vi(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||o&&o!==t.state.fetchStatus||i&&!i(t))}function Qp(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(xi(t.options.mutationKey)!==xi(i))return!1}else if(!vi(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Bm(e,t){return((t==null?void 0:t.queryKeyHashFn)||xi)(e)}function xi(e){return JSON.stringify(e,(t,n)=>mu(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function vi(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>vi(e[n],t[n])):!1}function H0(e,t){if(e===t)return e;const n=Xp(e)&&Xp(t);if(n||mu(e)&&mu(t)){const r=n?e:Object.keys(e),o=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 m=n?u:i[u];(!n&&c.has(m)||n)&&e[m]===void 0&&t[m]===void 0?(l[m]=void 0,d++):(l[m]=H0(e[m],t[m]),l[m]===e[m]&&e[m]!==void 0&&d++)}return o===a&&d===o?e:l}return t}function Xp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mu(e){if(!Zp(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Zp(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Zp(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hj(e){return new Promise(t=>{setTimeout(t,e)})}function Kj(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?H0(e,t):t}function Gj(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function qj(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Vm=Symbol();function K0(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Vm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Gr,cr,Gs,Ng,Yj=(Ng=class extends Bl{constructor(){super();xe(this,Gr);xe(this,cr);xe(this,Gs);ne(this,Gs,t=>{if(!Vl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){$(this,cr)||this.setEventListener($(this,Gs))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,cr))==null||t.call(this),ne(this,cr,void 0))}setEventListener(t){var n;ne(this,Gs,t),(n=$(this,cr))==null||n.call(this),ne(this,cr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){$(this,Gr)!==t&&(ne(this,Gr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof $(this,Gr)=="boolean"?$(this,Gr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Gr=new WeakMap,cr=new WeakMap,Gs=new WeakMap,Ng),G0=new Yj,qs,dr,Ys,jg,Qj=(jg=class extends Bl{constructor(){super();xe(this,qs,!0);xe(this,dr);xe(this,Ys);ne(this,Ys,t=>{if(!Vl&&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(){$(this,dr)||this.setEventListener($(this,Ys))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,dr))==null||t.call(this),ne(this,dr,void 0))}setEventListener(t){var n;ne(this,Ys,t),(n=$(this,dr))==null||n.call(this),ne(this,dr,t(this.setOnline.bind(this)))}setOnline(t){$(this,qs)!==t&&(ne(this,qs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return $(this,qs)}},qs=new WeakMap,dr=new WeakMap,Ys=new WeakMap,jg),ll=new Qj;function Xj(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function Zj(e){return Math.min(1e3*2**e,3e4)}function q0(e){return(e??"online")==="online"?ll.isOnline():!0}var Y0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Qc(e){return e instanceof Y0}function Q0(e){let t=!1,n=0,r=!1,o;const i=Xj(),a=g=>{var w;r||(f(new Y0(g)),(w=e.abort)==null||w.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>G0.isFocused()&&(e.networkMode==="always"||ll.isOnline())&&e.canRun(),u=()=>q0(e.networkMode)&&e.canRun(),m=g=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,g),o==null||o(),i.resolve(g))},f=g=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,g),o==null||o(),i.reject(g))},p=()=>new Promise(g=>{var w;o=x=>{(r||d())&&g(x)},(w=e.onPause)==null||w.call(e)}).then(()=>{var g;o=void 0,r||(g=e.onContinue)==null||g.call(e)}),v=()=>{if(r)return;let g;const w=n===0?e.initialPromise:void 0;try{g=w??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(m).catch(x=>{var C;if(r)return;const y=e.retry??(Vl?0:3),b=e.retryDelay??Zj,N=typeof b=="function"?b(n,x):b,j=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,x);if(t||!j){f(x);return}n++,(C=e.onFail)==null||C.call(e,n,x),Hj(N).then(()=>d()?void 0:p()).then(()=>{t?f(x):v()})})};return{promise:i,cancel:a,continue:()=>(o==null||o(),i),cancelRetry:l,continueRetry:c,canStart:u,start:()=>(u()?v():p().then(v),i)}}var Jj=e=>setTimeout(e,0);function eS(){let e=[],t=0,n=l=>{l()},r=l=>{l()},o=Jj;const i=l=>{t?e.push(l):o(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&o(()=>{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=>{o=l}}}var mt=eS(),qr,Sg,X0=(Sg=class{constructor(){xe(this,qr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vj(this.gcTime)&&ne(this,qr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vl?1/0:5*60*1e3))}clearGcTimeout(){$(this,qr)&&(clearTimeout($(this,qr)),ne(this,qr,void 0))}},qr=new WeakMap,Sg),Qs,Yr,It,Qr,ot,ki,Xr,en,_n,kg,tS=(kg=class extends X0{constructor(t){super();xe(this,en);xe(this,Qs);xe(this,Yr);xe(this,It);xe(this,Qr);xe(this,ot);xe(this,ki);xe(this,Xr);ne(this,Xr,!1),ne(this,ki,t.defaultOptions),this.setOptions(t.options),this.observers=[],ne(this,Qr,t.client),ne(this,It,$(this,Qr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ne(this,Qs,rS(this.options)),this.state=t.state??$(this,Qs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=$(this,ot))==null?void 0:t.promise}setOptions(t){this.options={...$(this,ki),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,It).remove(this)}setData(t,n){const r=Kj(this.state.data,t,this.options);return nt(this,en,_n).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){nt(this,en,_n).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=$(this,ot))==null?void 0:r.promise;return(o=$(this,ot))==null||o.cancel(t),n?n.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState($(this,Qs))}isActive(){return this.observers.some(t=>Uj(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>uu(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:!Wj(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,ot))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,ot))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$(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||($(this,ot)&&($(this,Xr)?$(this,ot).cancel({revert:!0}):$(this,ot).cancelRetry()),this.scheduleGc()),$(this,It).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||nt(this,en,_n).call(this,{type:"invalidate"})}fetch(t,n){var d,u,m;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if($(this,ot))return $(this,ot).continueRetry(),$(this,ot).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(ne(this,Xr,!0),r.signal)})},i=()=>{const f=K0(this.options,n),v=(()=>{const g={client:$(this,Qr),queryKey:this.queryKey,meta:this.meta};return o(g),g})();return ne(this,Xr,!1),this.options.persister?this.options.persister(f,v,this):f(v)},l=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:$(this,Qr),state:this.state,fetchFn:i};return o(f),f})();(d=this.options.behavior)==null||d.onFetch(l,this),ne(this,Yr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=l.fetchOptions)==null?void 0:u.meta))&&nt(this,en,_n).call(this,{type:"fetch",meta:(m=l.fetchOptions)==null?void 0:m.meta});const c=f=>{var p,v,g,w;Qc(f)&&f.silent||nt(this,en,_n).call(this,{type:"error",error:f}),Qc(f)||((v=(p=$(this,It).config).onError)==null||v.call(p,f,this),(w=(g=$(this,It).config).onSettled)==null||w.call(g,this.state.data,f,this)),this.scheduleGc()};return ne(this,ot,Q0({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var p,v,g,w;if(f===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(x){c(x);return}(v=(p=$(this,It).config).onSuccess)==null||v.call(p,f,this),(w=(g=$(this,It).config).onSettled)==null||w.call(g,f,this.state.error,this),this.scheduleGc()},onError:c,onFail:(f,p)=>{nt(this,en,_n).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{nt(this,en,_n).call(this,{type:"pause"})},onContinue:()=>{nt(this,en,_n).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),$(this,ot).start()}},Qs=new WeakMap,Yr=new WeakMap,It=new WeakMap,Qr=new WeakMap,ot=new WeakMap,ki=new WeakMap,Xr=new WeakMap,en=new WeakSet,_n=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,...nS(r.data,this.options),fetchMeta:t.meta??null};case"success":return ne(this,Yr,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 o=t.error;return Qc(o)&&o.revert&&$(this,Yr)?{...$(this,Yr),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),mt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),$(this,It).notify({query:this,type:"updated",action:t})})},kg);function nS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:q0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function rS(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 pn,Cg,sS=(Cg=class extends Bl{constructor(t={}){super();xe(this,pn);this.config=t,ne(this,pn,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Bm(o,n);let a=this.get(i);return a||(a=new tS({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){$(this,pn).has(t.queryHash)||($(this,pn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=$(this,pn).get(t.queryHash);n&&(t.destroy(),n===t&&$(this,pn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){mt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $(this,pn).get(t)}getAll(){return[...$(this,pn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Yp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Yp(t,r)):n}notify(t){mt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){mt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){mt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},pn=new WeakMap,Cg),hn,dt,Zr,gn,rr,Eg,oS=(Eg=class extends X0{constructor(t){super();xe(this,gn);xe(this,hn);xe(this,dt);xe(this,Zr);this.mutationId=t.mutationId,ne(this,dt,t.mutationCache),ne(this,hn,[]),this.state=t.state||iS(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$(this,hn).includes(t)||($(this,hn).push(t),this.clearGcTimeout(),$(this,dt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ne(this,hn,$(this,hn).filter(n=>n!==t)),this.scheduleGc(),$(this,dt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$(this,hn).length||(this.state.status==="pending"?this.scheduleGc():$(this,dt).remove(this))}continue(){var t;return((t=$(this,Zr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,a,l,c,d,u,m,f,p,v,g,w,x,y,b,N,j,C,k,P;const n=()=>{nt(this,gn,rr).call(this,{type:"continue"})};ne(this,Zr,Q0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,R)=>{nt(this,gn,rr).call(this,{type:"failed",failureCount:E,error:R})},onPause:()=>{nt(this,gn,rr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,dt).canRun(this)}));const r=this.state.status==="pending",o=!$(this,Zr).canStart();try{if(r)n();else{nt(this,gn,rr).call(this,{type:"pending",variables:t,isPaused:o}),await((a=(i=$(this,dt).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&&nt(this,gn,rr).call(this,{type:"pending",context:R,variables:t,isPaused:o})}const E=await $(this,Zr).start();return await((u=(d=$(this,dt).config).onSuccess)==null?void 0:u.call(d,E,t,this.state.context,this)),await((f=(m=this.options).onSuccess)==null?void 0:f.call(m,E,t,this.state.context)),await((v=(p=$(this,dt).config).onSettled)==null?void 0:v.call(p,E,null,this.state.variables,this.state.context,this)),await((w=(g=this.options).onSettled)==null?void 0:w.call(g,E,null,t,this.state.context)),nt(this,gn,rr).call(this,{type:"success",data:E}),E}catch(E){try{throw await((y=(x=$(this,dt).config).onError)==null?void 0:y.call(x,E,t,this.state.context,this)),await((N=(b=this.options).onError)==null?void 0:N.call(b,E,t,this.state.context)),await((C=(j=$(this,dt).config).onSettled)==null?void 0:C.call(j,void 0,E,this.state.variables,this.state.context,this)),await((P=(k=this.options).onSettled)==null?void 0:P.call(k,void 0,E,t,this.state.context)),E}finally{nt(this,gn,rr).call(this,{type:"error",error:E})}}finally{$(this,dt).runNext(this)}}},hn=new WeakMap,dt=new WeakMap,Zr=new WeakMap,gn=new WeakSet,rr=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),mt.batch(()=>{$(this,hn).forEach(r=>{r.onMutationUpdate(t)}),$(this,dt).notify({mutation:this,type:"updated",action:t})})},Eg);function iS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mn,tn,Ci,Rg,aS=(Rg=class extends Bl{constructor(t={}){super();xe(this,Mn);xe(this,tn);xe(this,Ci);this.config=t,ne(this,Mn,new Set),ne(this,tn,new Map),ne(this,Ci,0)}build(t,n,r){const o=new oS({mutationCache:this,mutationId:++Wi(this,Ci)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){$(this,Mn).add(t);const n=aa(t);if(typeof n=="string"){const r=$(this,tn).get(n);r?r.push(t):$(this,tn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if($(this,Mn).delete(t)){const n=aa(t);if(typeof n=="string"){const r=$(this,tn).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&$(this,tn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=aa(t);if(typeof n=="string"){const r=$(this,tn).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=aa(t);if(typeof n=="string"){const o=(r=$(this,tn).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){mt.batch(()=>{$(this,Mn).forEach(t=>{this.notify({type:"removed",mutation:t})}),$(this,Mn).clear(),$(this,tn).clear()})}getAll(){return Array.from($(this,Mn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Qp(n,r))}findAll(t={}){return this.getAll().filter(n=>Qp(t,n))}notify(t){mt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return mt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Jt))))}},Mn=new WeakMap,tn=new WeakMap,Ci=new WeakMap,Rg);function aa(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Jp(e){return{onFetch:(t,n)=>{var u,m,f,p,v;const r=t.options,o=(f=(m=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:m.fetchMore)==null?void 0:f.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],a=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let g=!1;const w=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},x=K0(t.options,t.fetchOptions),y=async(b,N,j)=>{if(g)return Promise.reject();if(N==null&&b.pages.length)return Promise.resolve(b);const k=(()=>{const _={client:t.client,queryKey:t.queryKey,pageParam:N,direction:j?"backward":"forward",meta:t.options.meta};return w(_),_})(),P=await x(k),{maxPages:E}=t.options,R=j?qj:Gj;return{pages:R(b.pages,P,E),pageParams:R(b.pageParams,N,E)}};if(o&&i.length){const b=o==="backward",N=b?lS:eh,j={pages:i,pageParams:a},C=N(r,j);l=await y(j,C,b)}else{const b=e??i.length;do{const N=c===0?a[0]??r.initialPageParam:eh(r,l);if(c>0&&N==null)break;l=await y(l,N),c++}while(c<b)}return l};t.options.persister?t.fetchFn=()=>{var g,w;return(w=(g=t.options).persister)==null?void 0:w.call(g,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function eh(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 lS(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 Le,ur,mr,Xs,Zs,fr,Js,eo,Pg,cS=(Pg=class{constructor(e={}){xe(this,Le);xe(this,ur);xe(this,mr);xe(this,Xs);xe(this,Zs);xe(this,fr);xe(this,Js);xe(this,eo);ne(this,Le,e.queryCache||new sS),ne(this,ur,e.mutationCache||new aS),ne(this,mr,e.defaultOptions||{}),ne(this,Xs,new Map),ne(this,Zs,new Map),ne(this,fr,0)}mount(){Wi(this,fr)._++,$(this,fr)===1&&(ne(this,Js,G0.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,Le).onFocus())})),ne(this,eo,ll.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,Le).onOnline())})))}unmount(){var e,t;Wi(this,fr)._--,$(this,fr)===0&&((e=$(this,Js))==null||e.call(this),ne(this,Js,void 0),(t=$(this,eo))==null||t.call(this),ne(this,eo,void 0))}isFetching(e){return $(this,Le).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $(this,ur).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,Le).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=$(this,Le).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(uu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return $(this,Le).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=$(this,Le).get(r.queryHash),i=o==null?void 0:o.state.data,a=Bj(t,i);if(a!==void 0)return $(this,Le).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return mt.batch(()=>$(this,Le).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,Le).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=$(this,Le);mt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=$(this,Le);return mt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=mt.batch(()=>$(this,Le).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Jt).catch(Jt)}invalidateQueries(e,t={}){return mt.batch(()=>($(this,Le).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=mt.batch(()=>$(this,Le).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Jt)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=$(this,Le).build(this,t);return n.isStaleByTime(uu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=Jp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=Jp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ll.isOnline()?$(this,ur).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,Le)}getMutationCache(){return $(this,ur)}getDefaultOptions(){return $(this,mr)}setDefaultOptions(e){ne(this,mr,e)}setQueryDefaults(e,t){$(this,Xs).set(xi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$(this,Xs).values()],n={};return t.forEach(r=>{vi(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){$(this,Zs).set(xi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$(this,Zs).values()],n={};return t.forEach(r=>{vi(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...$(this,mr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bm(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===Vm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$(this,mr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$(this,Le).clear(),$(this,ur).clear()}},Le=new WeakMap,ur=new WeakMap,mr=new WeakMap,Xs=new WeakMap,Zs=new WeakMap,fr=new WeakMap,Js=new WeakMap,eo=new WeakMap,Pg),dS=h.createContext(void 0),uS=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(dS.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 cl(){return cl=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},cl.apply(this,arguments)}var gr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(gr||(gr={}));const th="popstate";function mS(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:a,hash:l}=r.location;return fu("",{pathname:i,search:a,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:J0(o)}return pS(t,n,null,e)}function St(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Z0(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function fS(){return Math.random().toString(36).substr(2,8)}function nh(e,t){return{usr:e.state,key:e.key,idx:t}}function fu(e,t,n,r){return n===void 0&&(n=null),cl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Wl(t):t,{state:n,key:t&&t.key||r||fS()})}function J0(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 Wl(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 pS(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,l=gr.Pop,c=null,d=u();d==null&&(d=0,a.replaceState(cl({},a.state,{idx:d}),""));function u(){return(a.state||{idx:null}).idx}function m(){l=gr.Pop;let w=u(),x=w==null?null:w-d;d=w,c&&c({action:l,location:g.location,delta:x})}function f(w,x){l=gr.Push;let y=fu(g.location,w,x);d=u()+1;let b=nh(y,d),N=g.createHref(y);try{a.pushState(b,"",N)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;o.location.assign(N)}i&&c&&c({action:l,location:g.location,delta:1})}function p(w,x){l=gr.Replace;let y=fu(g.location,w,x);d=u();let b=nh(y,d),N=g.createHref(y);a.replaceState(b,"",N),i&&c&&c({action:l,location:g.location,delta:0})}function v(w){let x=o.location.origin!=="null"?o.location.origin:o.location.href,y=typeof w=="string"?w:J0(w);return y=y.replace(/ $/,"%20"),St(x,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,x)}let g={get action(){return l},get location(){return e(o,a)},listen(w){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(th,m),c=w,()=>{o.removeEventListener(th,m),c=null}},createHref(w){return t(o,w)},createURL:v,encodeLocation(w){let x=v(w);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:f,replace:p,go(w){return a.go(w)}};return g}var rh;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(rh||(rh={}));function hS(e,t,n){return n===void 0&&(n="/"),gS(e,t,n,!1)}function gS(e,t,n,r){let o=typeof t=="string"?Wl(t):t,i=nv(o.pathname||"/",n);if(i==null)return null;let a=ev(e);xS(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let d=RS(i);l=CS(a[c],d,r)}return l}function ev(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,a,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(St(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=zs([r,c.relativePath]),u=n.concat(c);i.children&&i.children.length>0&&(St(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),ev(i.children,t,u,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:SS(d,i.index),routesMeta:u})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let c of tv(i.path))o(i,a,c)}),t}function tv(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=tv(r.join("/")),l=[];return l.push(...a.map(c=>c===""?i:[i,c].join("/"))),o&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function xS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:kS(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const vS=/^:[\w-]+$/,yS=3,bS=2,wS=1,NS=10,jS=-2,sh=e=>e==="*";function SS(e,t){let n=e.split("/"),r=n.length;return n.some(sh)&&(r+=jS),t&&(r+=bS),n.filter(o=>!sh(o)).reduce((o,i)=>o+(vS.test(i)?yS:i===""?wS:NS),r)}function kS(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function CS(e,t,n){let{routesMeta:r}=e,o={},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)||"/",m=oh({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),f=c.route;if(!m&&d&&n&&!r[r.length-1].route.index&&(m=oh({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!m)return null;Object.assign(o,m.params),a.push({params:o,pathname:zs([i,m.pathname]),pathnameBase:PS(zs([i,m.pathnameBase])),route:f}),m.pathnameBase!=="/"&&(i=zs([i,m.pathnameBase]))}return a}function oh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ES(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((d,u,m)=>{let{paramName:f,isOptional:p}=u;if(f==="*"){let g=l[m]||"";a=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const v=l[m];return p&&!v?d[f]=void 0:d[f]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:a,pattern:e}}function ES(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Z0(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=[],o="^"+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:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function RS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Z0(!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 nv(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 zs=e=>e.join("/").replace(/\/\/+/g,"/"),PS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/");function _S(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const rv=["post","put","patch","delete"];new Set(rv);const AS=["get",...rv];new Set(AS);/**
|
|
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 dl(){return dl=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},dl.apply(this,arguments)}const TS=h.createContext(null),IS=h.createContext(null),sv=h.createContext(null),Ul=h.createContext(null),Hl=h.createContext({outlet:null,matches:[],isDataRoute:!1}),ov=h.createContext(null);function Wm(){return h.useContext(Ul)!=null}function iv(){return Wm()||St(!1),h.useContext(Ul).location}function MS(e,t){return LS(e,t)}function LS(e,t,n,r){Wm()||St(!1);let{navigator:o}=h.useContext(sv),{matches:i}=h.useContext(Hl),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let d=iv(),u;if(t){var m;let w=typeof t=="string"?Wl(t):t;c==="/"||(m=w.pathname)!=null&&m.startsWith(c)||St(!1),u=w}else u=d;let f=u.pathname||"/",p=f;if(c!=="/"){let w=c.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let v=hS(e,{pathname:p}),g=zS(v&&v.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:zs([c,o.encodeLocation?o.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:zs([c,o.encodeLocation?o.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r);return t&&g?h.createElement(Ul.Provider,{value:{location:dl({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:gr.Pop}},g):g}function OS(){let e=US(),t=_S(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={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:o},n):null,null)}const $S=h.createElement(OS,null);class DS 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(Hl.Provider,{value:this.props.routeContext},h.createElement(ov.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function FS(e){let{routeContext:t,match:n,children:r}=e,o=h.useContext(TS);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(Hl.Provider,{value:t},r)}function zS(e,t,n,r){var o;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=(o=n)==null?void 0:o.errors;if(l!=null){let u=a.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);u>=0||St(!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 m=a[u];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=u),m.route.id){let{loaderData:f,errors:p}=n,v=m.route.loader&&f[m.route.id]===void 0&&(!p||p[m.route.id]===void 0);if(m.route.lazy||v){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}return a.reduceRight((u,m,f)=>{let p,v=!1,g=null,w=null;n&&(p=l&&m.route.id?l[m.route.id]:void 0,g=m.route.errorElement||$S,c&&(d<0&&f===0?(v=!0,w=null):d===f&&(v=!0,w=m.route.hydrateFallbackElement||null)));let x=t.concat(a.slice(0,f+1)),y=()=>{let b;return p?b=g:v?b=w:m.route.Component?b=h.createElement(m.route.Component,null):m.route.element?b=m.route.element:b=u,h.createElement(FS,{match:m,routeContext:{outlet:u,matches:x,isDataRoute:n!=null},children:b})};return n&&(m.route.ErrorBoundary||m.route.errorElement||f===0)?h.createElement(DS,{location:n.location,revalidation:n.revalidation,component:g,error:p,children:y(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):y()},null)}var pu=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}(pu||{});function BS(e){let t=h.useContext(IS);return t||St(!1),t}function VS(e){let t=h.useContext(Hl);return t||St(!1),t}function WS(e){let t=VS(),n=t.matches[t.matches.length-1];return n.route.id||St(!1),n.route.id}function US(){var e;let t=h.useContext(ov),n=BS(pu.UseRouteError),r=WS(pu.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function HS(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function zo(e){St(!1)}function KS(e){let{basename:t="/",children:n=null,location:r,navigationType:o=gr.Pop,navigator:i,static:a=!1,future:l}=e;Wm()&&St(!1);let c=t.replace(/^\/*/,"/"),d=h.useMemo(()=>({basename:c,navigator:i,static:a,future:dl({v7_relativeSplatPath:!1},l)}),[c,l,i,a]);typeof r=="string"&&(r=Wl(r));let{pathname:u="/",search:m="",hash:f="",state:p=null,key:v="default"}=r,g=h.useMemo(()=>{let w=nv(u,c);return w==null?null:{location:{pathname:w,search:m,hash:f,state:p,key:v},navigationType:o}},[c,u,m,f,p,v,o]);return g==null?null:h.createElement(sv.Provider,{value:d},h.createElement(Ul.Provider,{children:n,value:g}))}function GS(e){let{children:t,location:n}=e;return MS(hu(t),n)}new Promise(()=>{});function hu(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(r,o)=>{if(!h.isValidElement(r))return;let i=[...t,o];if(r.type===h.Fragment){n.push.apply(n,hu(r.props.children,i));return}r.type!==zo&&St(!1),!r.props.index||!r.props.children||St(!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=hu(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 qS="6";try{window.__reactRouterVersion=qS}catch{}const YS="startTransition",ih=Qu[YS];function QS(e){let{basename:t,children:n,future:r,window:o}=e,i=h.useRef();i.current==null&&(i.current=mS({window:o,v5Compat:!0}));let a=i.current,[l,c]=h.useState({action:a.action,location:a.location}),{v7_startTransition:d}=r||{},u=h.useCallback(m=>{d&&ih?ih(()=>c(m)):c(m)},[c,d]);return h.useLayoutEffect(()=>a.listen(u),[a,u]),h.useEffect(()=>HS(r),[r]),h.createElement(KS,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:r})}var ah;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ah||(ah={}));var lh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(lh||(lh={}));var ch=["light","dark"],XS="(prefers-color-scheme: dark)",ZS=h.createContext(void 0),JS={setTheme:e=>{},themes:[]},ek=()=>{var e;return(e=h.useContext(ZS))!=null?e:JS};h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,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(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,m=o?ch.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(v,g=!1,w=!0)=>{let x=a?a[v]:v,y=g?v+"|| ''":`'${x}'`,b="";return o&&w&&!g&&ch.includes(v)&&(b+=`d.style.colorScheme = '${v}';`),n==="class"?g||x?b+=`c.add(${y})`:b+="null":x&&(b+=`d[s](n,${y})`),b},p=e?`!function(){${u}${f(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${XS}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}${d?"":"else{"+f(i,!1,!1)+"}"}${m}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${m}}catch(t){}}();`;return h.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var tk=e=>{switch(e){case"success":return sk;case"info":return ik;case"warning":return ok;case"error":return ak;default:return null}},nk=Array(12).fill(0),rk=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},nk.map((n,r)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),sk=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),ok=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.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"})),ik=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),ak=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),lk=W.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"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ck=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},gu=1,dk=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,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:gu++,i=this.toasts.find(l=>l.id===o),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(l=>l.id===o?(this.publish({...l,...e,id:o,title:n}),{...l,...e,id:o,dismissible:a,title:n}):l):this.addToast({title:n,...r,dismissible:a,id:o}),o},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(),o=n!==void 0,i,a=r.then(async c=>{if(i=["resolve",c],W.isValidElement(c))o=!1,this.create({id:n,type:"default",message:c});else if(mk(c)&&!c.ok){o=!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){o=!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){o=!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;o&&(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)||gu++;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}},vt=new dk,uk=(e,t)=>{let n=(t==null?void 0:t.id)||gu++;return vt.addToast({title:e,...t,id:n}),n},mk=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",fk=uk,pk=()=>vt.toasts,hk=()=>vt.getActiveToasts();Object.assign(fk,{success:vt.success,info:vt.info,warning:vt.warning,error:vt.error,custom:vt.custom,message:vt.message,promise:vt.promise,dismiss:vt.dismiss,loading:vt.loading},{getHistory:pk,getToasts:hk});function gk(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))}gk(`: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 la(e){return e.label!==void 0}var xk=3,vk="32px",yk="16px",dh=4e3,bk=356,wk=14,Nk=20,jk=200;function Qt(...e){return e.filter(Boolean).join(" ")}function Sk(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var kk=e=>{var t,n,r,o,i,a,l,c,d,u,m;let{invert:f,toast:p,unstyled:v,interacting:g,setHeights:w,visibleToasts:x,heights:y,index:b,toasts:N,expanded:j,removeToast:C,defaultRichColors:k,closeButton:P,style:E,cancelButtonStyle:R,actionButtonStyle:_,className:M="",descriptionClassName:O="",duration:A,position:H,gap:z,loadingIcon:U,expandByDefault:T,classNames:L,icons:S,closeButtonAriaLabel:D="Close toast",pauseWhenPageIsHidden:F}=e,[G,Q]=W.useState(null),[re,K]=W.useState(null),[B,ee]=W.useState(!1),[be,ue]=W.useState(!1),[oe,ie]=W.useState(!1),[Me,Ke]=W.useState(!1),[Wt,Ut]=W.useState(!1),[Rn,Dr]=W.useState(0),[Yn,zi]=W.useState(0),Qn=W.useRef(p.duration||A||dh),Bi=W.useRef(null),De=W.useRef(null),wc=b===0,ae=b+1<=x,me=p.type,fe=p.dismissible!==!1,Ge=p.className||"",Fr=p.descriptionClassName||"",ct=W.useMemo(()=>y.findIndex(te=>te.toastId===p.id)||0,[y,p.id]),Ne=W.useMemo(()=>{var te;return(te=p.closeButton)!=null?te:P},[p.closeButton,P]),Vi=W.useMemo(()=>p.duration||A||dh,[p.duration,A]),ps=W.useRef(0),xt=W.useRef(0),Of=W.useRef(0),hs=W.useRef(null),[c1,d1]=H.split("-"),$f=W.useMemo(()=>y.reduce((te,ye,Ee)=>Ee>=ct?te:te+ye.height,0),[y,ct]),Df=ck(),u1=p.invert||f,Nc=me==="loading";xt.current=W.useMemo(()=>ct*z+$f,[ct,$f]),W.useEffect(()=>{Qn.current=Vi},[Vi]),W.useEffect(()=>{ee(!0)},[]),W.useEffect(()=>{let te=De.current;if(te){let ye=te.getBoundingClientRect().height;return zi(ye),w(Ee=>[{toastId:p.id,height:ye,position:p.position},...Ee]),()=>w(Ee=>Ee.filter(Ht=>Ht.toastId!==p.id))}},[w,p.id]),W.useLayoutEffect(()=>{if(!B)return;let te=De.current,ye=te.style.height;te.style.height="auto";let Ee=te.getBoundingClientRect().height;te.style.height=ye,zi(Ee),w(Ht=>Ht.find(Kt=>Kt.toastId===p.id)?Ht.map(Kt=>Kt.toastId===p.id?{...Kt,height:Ee}:Kt):[{toastId:p.id,height:Ee,position:p.position},...Ht])},[B,p.title,p.description,w,p.id]);let Xn=W.useCallback(()=>{ue(!0),Dr(xt.current),w(te=>te.filter(ye=>ye.toastId!==p.id)),setTimeout(()=>{C(p)},jk)},[p,C,w,xt]);W.useEffect(()=>{if(p.promise&&me==="loading"||p.duration===1/0||p.type==="loading")return;let te;return j||g||F&&Df?(()=>{if(Of.current<ps.current){let ye=new Date().getTime()-ps.current;Qn.current=Qn.current-ye}Of.current=new Date().getTime()})():Qn.current!==1/0&&(ps.current=new Date().getTime(),te=setTimeout(()=>{var ye;(ye=p.onAutoClose)==null||ye.call(p,p),Xn()},Qn.current)),()=>clearTimeout(te)},[j,g,p,me,F,Df,Xn]),W.useEffect(()=>{p.delete&&Xn()},[Xn,p.delete]);function m1(){var te,ye,Ee;return S!=null&&S.loading?W.createElement("div",{className:Qt(L==null?void 0:L.loader,(te=p==null?void 0:p.classNames)==null?void 0:te.loader,"sonner-loader"),"data-visible":me==="loading"},S.loading):U?W.createElement("div",{className:Qt(L==null?void 0:L.loader,(ye=p==null?void 0:p.classNames)==null?void 0:ye.loader,"sonner-loader"),"data-visible":me==="loading"},U):W.createElement(rk,{className:Qt(L==null?void 0:L.loader,(Ee=p==null?void 0:p.classNames)==null?void 0:Ee.loader),visible:me==="loading"})}return W.createElement("li",{tabIndex:0,ref:De,className:Qt(M,Ge,L==null?void 0:L.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,L==null?void 0:L.default,L==null?void 0:L[me],(n=p==null?void 0:p.classNames)==null?void 0:n[me]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:k,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":B,"data-promise":!!p.promise,"data-swiped":Wt,"data-removed":be,"data-visible":ae,"data-y-position":c1,"data-x-position":d1,"data-index":b,"data-front":wc,"data-swiping":oe,"data-dismissible":fe,"data-type":me,"data-invert":u1,"data-swipe-out":Me,"data-swipe-direction":re,"data-expanded":!!(j||T&&B),style:{"--index":b,"--toasts-before":b,"--z-index":N.length-b,"--offset":`${be?Rn:xt.current}px`,"--initial-height":T?"auto":`${Yn}px`,...E,...p.style},onDragEnd:()=>{ie(!1),Q(null),hs.current=null},onPointerDown:te=>{Nc||!fe||(Bi.current=new Date,Dr(xt.current),te.target.setPointerCapture(te.pointerId),te.target.tagName!=="BUTTON"&&(ie(!0),hs.current={x:te.clientX,y:te.clientY}))},onPointerUp:()=>{var te,ye,Ee,Ht;if(Me||!fe)return;hs.current=null;let Kt=Number(((te=De.current)==null?void 0:te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Zn=Number(((ye=De.current)==null?void 0:ye.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),zr=new Date().getTime()-((Ee=Bi.current)==null?void 0:Ee.getTime()),Gt=G==="x"?Kt:Zn,Jn=Math.abs(Gt)/zr;if(Math.abs(Gt)>=Nk||Jn>.11){Dr(xt.current),(Ht=p.onDismiss)==null||Ht.call(p,p),K(G==="x"?Kt>0?"right":"left":Zn>0?"down":"up"),Xn(),Ke(!0),Ut(!1);return}ie(!1),Q(null)},onPointerMove:te=>{var ye,Ee,Ht,Kt;if(!hs.current||!fe||((ye=window.getSelection())==null?void 0:ye.toString().length)>0)return;let Zn=te.clientY-hs.current.y,zr=te.clientX-hs.current.x,Gt=(Ee=e.swipeDirections)!=null?Ee:Sk(H);!G&&(Math.abs(zr)>1||Math.abs(Zn)>1)&&Q(Math.abs(zr)>Math.abs(Zn)?"x":"y");let Jn={x:0,y:0};G==="y"?(Gt.includes("top")||Gt.includes("bottom"))&&(Gt.includes("top")&&Zn<0||Gt.includes("bottom")&&Zn>0)&&(Jn.y=Zn):G==="x"&&(Gt.includes("left")||Gt.includes("right"))&&(Gt.includes("left")&&zr<0||Gt.includes("right")&&zr>0)&&(Jn.x=zr),(Math.abs(Jn.x)>0||Math.abs(Jn.y)>0)&&Ut(!0),(Ht=De.current)==null||Ht.style.setProperty("--swipe-amount-x",`${Jn.x}px`),(Kt=De.current)==null||Kt.style.setProperty("--swipe-amount-y",`${Jn.y}px`)}},Ne&&!p.jsx?W.createElement("button",{"aria-label":D,"data-disabled":Nc,"data-close-button":!0,onClick:Nc||!fe?()=>{}:()=>{var te;Xn(),(te=p.onDismiss)==null||te.call(p,p)},className:Qt(L==null?void 0:L.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(i=S==null?void 0:S.close)!=null?i:lk):null,p.jsx||h.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:W.createElement(W.Fragment,null,me||p.icon||p.promise?W.createElement("div",{"data-icon":"",className:Qt(L==null?void 0:L.icon,(a=p==null?void 0:p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||m1():null,p.type!=="loading"?p.icon||(S==null?void 0:S[me])||tk(me):null):null,W.createElement("div",{"data-content":"",className:Qt(L==null?void 0:L.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},W.createElement("div",{"data-title":"",className:Qt(L==null?void 0:L.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?W.createElement("div",{"data-description":"",className:Qt(O,Fr,L==null?void 0:L.description,(d=p==null?void 0:p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),h.isValidElement(p.cancel)?p.cancel:p.cancel&&la(p.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:te=>{var ye,Ee;la(p.cancel)&&fe&&((Ee=(ye=p.cancel).onClick)==null||Ee.call(ye,te),Xn())},className:Qt(L==null?void 0:L.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,h.isValidElement(p.action)?p.action:p.action&&la(p.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||_,onClick:te=>{var ye,Ee;la(p.action)&&((Ee=(ye=p.action).onClick)==null||Ee.call(ye,te),!te.defaultPrevented&&Xn())},className:Qt(L==null?void 0:L.actionButton,(m=p==null?void 0:p.classNames)==null?void 0:m.actionButton)},p.action.label):null))};function uh(){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 Ck(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,a=i?"--mobile-offset":"--offset",l=i?yk:vk;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 Ek=h.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:a,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:m,duration:f,style:p,visibleToasts:v=xk,toastOptions:g,dir:w=uh(),gap:x=wk,loadingIcon:y,icons:b,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:j}=e,[C,k]=W.useState([]),P=W.useMemo(()=>Array.from(new Set([r].concat(C.filter(F=>F.position).map(F=>F.position)))),[C,r]),[E,R]=W.useState([]),[_,M]=W.useState(!1),[O,A]=W.useState(!1),[H,z]=W.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=W.useRef(null),T=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=W.useRef(null),S=W.useRef(!1),D=W.useCallback(F=>{k(G=>{var Q;return(Q=G.find(re=>re.id===F.id))!=null&&Q.delete||vt.dismiss(F.id),G.filter(({id:re})=>re!==F.id)})},[]);return W.useEffect(()=>vt.subscribe(F=>{if(F.dismiss){k(G=>G.map(Q=>Q.id===F.id?{...Q,delete:!0}:Q));return}setTimeout(()=>{W0.flushSync(()=>{k(G=>{let Q=G.findIndex(re=>re.id===F.id);return Q!==-1?[...G.slice(0,Q),{...G[Q],...F},...G.slice(Q+1)]:[F,...G]})})})}),[]),W.useEffect(()=>{if(u!=="system"){z(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:G})=>{z(G?"dark":"light")})}catch{F.addListener(({matches:Q})=>{try{z(Q?"dark":"light")}catch(re){console.error(re)}})}},[u]),W.useEffect(()=>{C.length<=1&&M(!1)},[C]),W.useEffect(()=>{let F=G=>{var Q,re;o.every(K=>G[K]||G.code===K)&&(M(!0),(Q=U.current)==null||Q.focus()),G.code==="Escape"&&(document.activeElement===U.current||(re=U.current)!=null&&re.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),W.useEffect(()=>{if(U.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,S.current=!1)}},[U.current]),W.createElement("section",{ref:t,"aria-label":`${N} ${T}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((F,G)=>{var Q;let[re,K]=F.split("-");return C.length?W.createElement("ol",{key:F,dir:w==="auto"?uh():w,tabIndex:-1,ref:U,className:l,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":re,"data-lifted":_&&C.length>1&&!i,"data-x-position":K,style:{"--front-toast-height":`${((Q=E[0])==null?void 0:Q.height)||0}px`,"--width":`${bk}px`,"--gap":`${x}px`,...p,...Ck(c,d)},onBlur:B=>{S.current&&!B.currentTarget.contains(B.relatedTarget)&&(S.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:B=>{B.target instanceof HTMLElement&&B.target.dataset.dismissible==="false"||S.current||(S.current=!0,L.current=B.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{O||M(!1)},onDragEnd:()=>M(!1),onPointerDown:B=>{B.target instanceof HTMLElement&&B.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},C.filter(B=>!B.position&&G===0||B.position===F).map((B,ee)=>{var be,ue;return W.createElement(kk,{key:B.id,icons:b,index:ee,toast:B,defaultRichColors:m,duration:(be=g==null?void 0:g.duration)!=null?be:f,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:v,closeButton:(ue=g==null?void 0:g.closeButton)!=null?ue:a,interacting:O,position:F,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:D,toasts:C.filter(oe=>oe.position==B.position),heights:E.filter(oe=>oe.position==B.position),setHeights:R,expandByDefault:i,gap:x,loadingIcon:y,expanded:_,pauseWhenPageIsHidden:j,swipeDirections:e.swipeDirections})})):null}))});const Rk=({...e})=>{const{theme:t="system"}=ek();return s.jsx(Ek,{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})},Pk=1,_k=1e6;let Xc=0;function Ak(){return Xc=(Xc+1)%Number.MAX_SAFE_INTEGER,Xc.toString()}const Zc=new Map,mh=e=>{if(Zc.has(e))return;const t=setTimeout(()=>{Zc.delete(e),Zo({type:"REMOVE_TOAST",toastId:e})},_k);Zc.set(e,t)},Tk=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Pk)};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?mh(n):e.toasts.forEach(r=>{mh(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)}}},Ta=[];let Ia={toasts:[]};function Zo(e){Ia=Tk(Ia,e),Ta.forEach(t=>{t(Ia)})}function Ik({...e}){const t=Ak(),n=o=>Zo({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Zo({type:"DISMISS_TOAST",toastId:t});return Zo({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Mk(){const[e,t]=h.useState(Ia);return h.useEffect(()=>(Ta.push(t),()=>{const n=Ta.indexOf(t);n>-1&&Ta.splice(n,1)}),[e]),{...e,toast:Ik,dismiss:n=>Zo({type:"DISMISS_TOAST",toastId:n})}}function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function fh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function av(...e){return t=>{let n=!1;const r=e.map(o=>{const i=fh(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():fh(e[o],null)}}}}function le(...e){return h.useCallback(av(...e),e)}function Bt(e,t=[]){let n=[];function r(i,a){const l=h.createContext(a),c=n.length;n=[...n,a];const d=m=>{var x;const{scope:f,children:p,...v}=m,g=((x=f==null?void 0:f[e])==null?void 0:x[c])||l,w=h.useMemo(()=>v,Object.values(v));return s.jsx(g.Provider,{value:w,children:p})};d.displayName=i+"Provider";function u(m,f){var g;const p=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,v=h.useContext(p);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{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 o.scopeName=e,[r,Lk(o,...t)]}function Lk(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const m=c(i)[`__scope${d}`];return{...l,...m}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function yi(e){const t=$k(e),n=h.forwardRef((r,o)=>{const{children:i,...a}=r,l=h.Children.toArray(i),c=l.find(Fk);if(c){const d=c.props.children,u=l.map(m=>m===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:m);return s.jsx(t,{...a,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return s.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var Ok=yi("Slot");function $k(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const a=Bk(o),l=zk(i,o.props);return o.type!==h.Fragment&&(l.ref=r?av(r,a):a),h.cloneElement(o,l)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lv=Symbol("radix.slottable");function Dk(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=lv,t}function Fk(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lv}function zk(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Bk(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Kl(e){const t=e+"CollectionProvider",[n,r]=Bt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:w,children:x}=g,y=W.useRef(null),b=W.useRef(new Map).current;return s.jsx(o,{scope:w,itemMap:b,collectionRef:y,children:x})};a.displayName=t;const l=e+"CollectionSlot",c=yi(l),d=W.forwardRef((g,w)=>{const{scope:x,children:y}=g,b=i(l,x),N=le(w,b.collectionRef);return s.jsx(c,{ref:N,children:y})});d.displayName=l;const u=e+"CollectionItemSlot",m="data-radix-collection-item",f=yi(u),p=W.forwardRef((g,w)=>{const{scope:x,children:y,...b}=g,N=W.useRef(null),j=le(w,N),C=i(u,x);return W.useEffect(()=>(C.itemMap.set(N,{ref:N,...b}),()=>void C.itemMap.delete(N))),s.jsx(f,{[m]:"",ref:j,children:y})});p.displayName=u;function v(g){const w=i(e+"CollectionConsumer",g);return W.useCallback(()=>{const y=w.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${m}]`));return Array.from(w.itemMap.values()).sort((C,k)=>b.indexOf(C.ref.current)-b.indexOf(k.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:d,ItemSlot:p},v,r]}var Vk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],J=Vk.reduce((e,t)=>{const n=yi(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:a,...l}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cv(e,t){e&&fs.flushSync(()=>e.dispatchEvent(t))}function Be(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 Wk(e,t=globalThis==null?void 0:globalThis.document){const n=Be(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Uk="DismissableLayer",xu="dismissableLayer.update",Hk="dismissableLayer.pointerDownOutside",Kk="dismissableLayer.focusOutside",ph,dv=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gl=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...c}=e,d=h.useContext(dv),[u,m]=h.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=h.useState({}),v=le(t,k=>m(k)),g=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(w),y=u?g.indexOf(u):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,N=y>=x,j=qk(k=>{const P=k.target,E=[...d.branches].some(R=>R.contains(P));!N||E||(o==null||o(k),a==null||a(k),k.defaultPrevented||l==null||l())},f),C=Yk(k=>{const P=k.target;[...d.branches].some(R=>R.contains(P))||(i==null||i(k),a==null||a(k),k.defaultPrevented||l==null||l())},f);return Wk(k=>{y===d.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},f),h.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ph=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),hh(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ph)}},[u,f,n,d]),h.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),hh())},[u,d]),h.useEffect(()=>{const k=()=>p({});return document.addEventListener(xu,k),()=>document.removeEventListener(xu,k)},[]),s.jsx(J.div,{...c,ref:v,style:{pointerEvents:b?N?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,C.onFocusCapture),onBlurCapture:X(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,j.onPointerDownCapture)})});Gl.displayName=Uk;var Gk="DismissableLayerBranch",uv=h.forwardRef((e,t)=>{const n=h.useContext(dv),r=h.useRef(null),o=le(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(J.div,{...e,ref:o})});uv.displayName=Gk;function qk(e,t=globalThis==null?void 0:globalThis.document){const n=Be(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){mv(Hk,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Yk(e,t=globalThis==null?void 0:globalThis.document){const n=Be(e),r=h.useRef(!1);return h.useEffect(()=>{const o=i=>{i.target&&!r.current&&mv(Kk,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hh(){const e=new CustomEvent(xu);document.dispatchEvent(e)}function mv(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?cv(o,i):o.dispatchEvent(i)}var Qk=Gl,Xk=uv,We=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Zk="Portal",Um=h.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[o,i]=h.useState(!1);We(()=>i(!0),[]);const a=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?W0.createPortal(s.jsx(J.div,{...r,ref:t}),a):null});Um.displayName=Zk;function Jk(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var qn=e=>{const{present:t,children:n}=e,r=e2(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=le(r.ref,t2(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:i}):null};qn.displayName="Presence";function e2(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),i=h.useRef("none"),a=e?"mounted":"unmounted",[l,c]=Jk(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const d=ca(r.current);i.current=l==="mounted"?d:"none"},[l]),We(()=>{const d=r.current,u=o.current;if(u!==e){const f=i.current,p=ca(d);e?c("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),We(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,m=p=>{const g=ca(r.current).includes(p.animationName);if(p.target===t&&g&&(c("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},f=p=>{p.target===t&&(i.current=ca(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function ca(e){return(e==null?void 0:e.animationName)||"none"}function t2(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var n2=Qu[" useInsertionEffect ".trim().toString()]||We;function Rr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=r2({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:o;{const u=h.useRef(e!==void 0);h.useEffect(()=>{const m=u.current;m!==l&&console.warn(`${r} is changing from ${m?"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 m;if(l){const f=s2(u)?u(e):u;f!==e&&((m=a.current)==null||m.call(a,f))}else i(u)},[l,e,i,a]);return[c,d]}function r2({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),i=h.useRef(t);return n2(()=>{i.current=t},[t]),h.useEffect(()=>{var a;o.current!==n&&((a=i.current)==null||a.call(i,n),o.current=n)},[n,o]),[n,r,i]}function s2(e){return typeof e=="function"}var fv=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"}),o2="VisuallyHidden",ql=h.forwardRef((e,t)=>s.jsx(J.span,{...e,ref:t,style:{...fv,...e.style}}));ql.displayName=o2;var i2=ql,Hm="ToastProvider",[Km,a2,l2]=Kl("Toast"),[pv,H3]=Bt("Toast",[l2]),[c2,Yl]=pv(Hm),hv=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:a}=e,[l,c]=h.useState(null),[d,u]=h.useState(0),m=h.useRef(!1),f=h.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Hm}\`. Expected non-empty \`string\`.`),s.jsx(Km.Provider,{scope:t,children:s.jsx(c2,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:h.useCallback(()=>u(p=>p+1),[]),onToastRemove:h.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:f,children:a})})};hv.displayName=Hm;var gv="ToastViewport",d2=["F8"],vu="toast.viewportPause",yu="toast.viewportResume",xv=h.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=d2,label:o="Notifications ({hotkey})",...i}=e,a=Yl(gv,n),l=a2(n),c=h.useRef(null),d=h.useRef(null),u=h.useRef(null),m=h.useRef(null),f=le(t,m,a.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=a.toastCount>0;h.useEffect(()=>{const w=x=>{var b;r.length!==0&&r.every(N=>x[N]||x.code===N)&&((b=m.current)==null||b.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),h.useEffect(()=>{const w=c.current,x=m.current;if(v&&w&&x){const y=()=>{if(!a.isClosePausedRef.current){const C=new CustomEvent(vu);x.dispatchEvent(C),a.isClosePausedRef.current=!0}},b=()=>{if(a.isClosePausedRef.current){const C=new CustomEvent(yu);x.dispatchEvent(C),a.isClosePausedRef.current=!1}},N=C=>{!w.contains(C.relatedTarget)&&b()},j=()=>{w.contains(document.activeElement)||b()};return w.addEventListener("focusin",y),w.addEventListener("focusout",N),w.addEventListener("pointermove",y),w.addEventListener("pointerleave",j),window.addEventListener("blur",y),window.addEventListener("focus",b),()=>{w.removeEventListener("focusin",y),w.removeEventListener("focusout",N),w.removeEventListener("pointermove",y),w.removeEventListener("pointerleave",j),window.removeEventListener("blur",y),window.removeEventListener("focus",b)}}},[v,a.isClosePausedRef]);const g=h.useCallback(({tabbingDirection:w})=>{const y=l().map(b=>{const N=b.ref.current,j=[N,...j2(N)];return w==="forwards"?j:j.reverse()});return(w==="forwards"?y.reverse():y).flat()},[l]);return h.useEffect(()=>{const w=m.current;if(w){const x=y=>{var j,C,k;const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const P=document.activeElement,E=y.shiftKey;if(y.target===w&&E){(j=d.current)==null||j.focus();return}const M=g({tabbingDirection:E?"backwards":"forwards"}),O=M.findIndex(A=>A===P);Jc(M.slice(O+1))?y.preventDefault():E?(C=d.current)==null||C.focus():(k=u.current)==null||k.focus()}};return w.addEventListener("keydown",x),()=>w.removeEventListener("keydown",x)}},[l,g]),s.jsxs(Xk,{ref:c,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&s.jsx(bu,{ref:d,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"forwards"});Jc(w)}}),s.jsx(Km.Slot,{scope:n,children:s.jsx(J.ol,{tabIndex:-1,...i,ref:f})}),v&&s.jsx(bu,{ref:u,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"backwards"});Jc(w)}})]})});xv.displayName=gv;var vv="ToastFocusProxy",bu=h.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=Yl(vv,n);return s.jsx(ql,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:a=>{var d;const l=a.relatedTarget;!((d=i.viewport)!=null&&d.contains(l))&&r()}})});bu.displayName=vv;var Ti="Toast",u2="toast.swipeStart",m2="toast.swipeMove",f2="toast.swipeCancel",p2="toast.swipeEnd",yv=h.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...a}=e,[l,c]=Rr({prop:r,defaultProp:o??!0,onChange:i,caller:Ti});return s.jsx(qn,{present:n||l,children:s.jsx(x2,{open:l,...a,ref:t,onClose:()=>c(!1),onPause:Be(e.onPause),onResume:Be(e.onResume),onSwipeStart:X(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:X(e.onSwipeMove,d=>{const{x:u,y:m}=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",`${m}px`)}),onSwipeCancel:X(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:X(e.onSwipeEnd,d=>{const{x:u,y:m}=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",`${m}px`),c(!1)})})})});yv.displayName=Ti;var[h2,g2]=pv(Ti,{onClose(){}}),x2=h.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:m,onSwipeCancel:f,onSwipeEnd:p,...v}=e,g=Yl(Ti,n),[w,x]=h.useState(null),y=le(t,A=>x(A)),b=h.useRef(null),N=h.useRef(null),j=o||g.duration,C=h.useRef(0),k=h.useRef(j),P=h.useRef(0),{onToastAdd:E,onToastRemove:R}=g,_=Be(()=>{var H;(w==null?void 0:w.contains(document.activeElement))&&((H=g.viewport)==null||H.focus()),a()}),M=h.useCallback(A=>{!A||A===1/0||(window.clearTimeout(P.current),C.current=new Date().getTime(),P.current=window.setTimeout(_,A))},[_]);h.useEffect(()=>{const A=g.viewport;if(A){const H=()=>{M(k.current),d==null||d()},z=()=>{const U=new Date().getTime()-C.current;k.current=k.current-U,window.clearTimeout(P.current),c==null||c()};return A.addEventListener(vu,z),A.addEventListener(yu,H),()=>{A.removeEventListener(vu,z),A.removeEventListener(yu,H)}}},[g.viewport,j,c,d,M]),h.useEffect(()=>{i&&!g.isClosePausedRef.current&&M(j)},[i,j,g.isClosePausedRef,M]),h.useEffect(()=>(E(),()=>R()),[E,R]);const O=h.useMemo(()=>w?Cv(w):null,[w]);return g.viewport?s.jsxs(s.Fragment,{children:[O&&s.jsx(v2,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:O}),s.jsx(h2,{scope:n,onClose:_,children:fs.createPortal(s.jsx(Km.ItemSlot,{scope:n,children:s.jsx(Qk,{asChild:!0,onEscapeKeyDown:X(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||_(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(J.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...v,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:X(e.onKeyDown,A=>{A.key==="Escape"&&(l==null||l(A.nativeEvent),A.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,_()))}),onPointerDown:X(e.onPointerDown,A=>{A.button===0&&(b.current={x:A.clientX,y:A.clientY})}),onPointerMove:X(e.onPointerMove,A=>{if(!b.current)return;const H=A.clientX-b.current.x,z=A.clientY-b.current.y,U=!!N.current,T=["left","right"].includes(g.swipeDirection),L=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,S=T?L(0,H):0,D=T?0:L(0,z),F=A.pointerType==="touch"?10:2,G={x:S,y:D},Q={originalEvent:A,delta:G};U?(N.current=G,da(m2,m,Q,{discrete:!1})):gh(G,g.swipeDirection,F)?(N.current=G,da(u2,u,Q,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(H)>F||Math.abs(z)>F)&&(b.current=null)}),onPointerUp:X(e.onPointerUp,A=>{const H=N.current,z=A.target;if(z.hasPointerCapture(A.pointerId)&&z.releasePointerCapture(A.pointerId),N.current=null,b.current=null,H){const U=A.currentTarget,T={originalEvent:A,delta:H};gh(H,g.swipeDirection,g.swipeThreshold)?da(p2,p,T,{discrete:!0}):da(f2,f,T,{discrete:!0}),U.addEventListener("click",L=>L.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),v2=e=>{const{__scopeToast:t,children:n,...r}=e,o=Yl(Ti,t),[i,a]=h.useState(!1),[l,c]=h.useState(!1);return w2(()=>a(!0)),h.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:s.jsx(Um,{asChild:!0,children:s.jsx(ql,{...r,children:i&&s.jsxs(s.Fragment,{children:[o.label," ",n]})})})},y2="ToastTitle",bv=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(J.div,{...r,ref:t})});bv.displayName=y2;var b2="ToastDescription",wv=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(J.div,{...r,ref:t})});wv.displayName=b2;var Nv="ToastAction",jv=h.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(kv,{altText:n,asChild:!0,children:s.jsx(Gm,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Nv}\`. Expected non-empty \`string\`.`),null)});jv.displayName=Nv;var Sv="ToastClose",Gm=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=g2(Sv,n);return s.jsx(kv,{asChild:!0,children:s.jsx(J.button,{type:"button",...r,ref:t,onClick:X(e.onClick,o.onClose)})})});Gm.displayName=Sv;var kv=h.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return s.jsx(J.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Cv(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),N2(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...Cv(r))}}),t}function da(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?cv(o,i):o.dispatchEvent(i)}var gh=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function w2(e=()=>{}){const t=Be(e);We(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function N2(e){return e.nodeType===e.ELEMENT_NODE}function j2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Jc(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var S2=hv,Ev=xv,Rv=yv,Pv=bv,_v=wv,Av=jv,Tv=Gm;function Iv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Iv(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Mv(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Iv(e))&&(r&&(r+=" "),r+=t);return r}const xh=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vh=Mv,Ql=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return vh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(d=>{const u=n==null?void 0:n[d],m=i==null?void 0:i[d];if(u===null)return null;const f=xh(u)||xh(m);return o[d][f]}),l=n&&Object.entries(n).reduce((d,u)=>{let[m,f]=u;return f===void 0||(d[m]=f),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:m,className:f,...p}=u;return Object.entries(p).every(v=>{let[g,w]=v;return Array.isArray(w)?w.includes({...i,...l}[g]):{...i,...l}[g]===w})?[...d,m,f]:d},[]);return vh(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 k2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Lv=(...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 C2={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 E2=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...l},c)=>h.createElement("svg",{ref:c,...C2,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Lv("lucide",o),...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 Y=(e,t)=>{const n=h.forwardRef(({className:r,...o},i)=>h.createElement(E2,{ref:i,iconNode:t,className:Lv(`lucide-${k2(e)}`,r),...o}));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 Lr=Y("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 R2=Y("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 yh=Y("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
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 Is=Y("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
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 P2=Y("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
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 bh=Y("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 qm=Y("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 at=Y("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 Ye=Y("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 _2=Y("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 Sn=Y("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 Ii=Y("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 Xl=Y("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 A2=Y("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
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 bi=Y("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"}]]);/**
|
|
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 Ov=Y("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"}]]);/**
|
|
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 Jo=Y("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"}]]);/**
|
|
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 T2=Y("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"}]]);/**
|
|
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 Zl=Y("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"}]]);/**
|
|
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 Mi=Y("FileJson",[["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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);/**
|
|
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 Pr=Y("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"}]]);/**
|
|
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 I2=Y("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"}]]);/**
|
|
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 M2=Y("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"}]]);/**
|
|
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 Ym=Y("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"}]]);/**
|
|
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 L2=Y("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"}]]);/**
|
|
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 O2=Y("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
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 $2=Y("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
|
|
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 $v=Y("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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 D2=Y("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"}]]);/**
|
|
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 Qm=Y("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"}]]);/**
|
|
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 F2=Y("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"}]]);/**
|
|
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 z2=Y("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
|
|
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 wu=Y("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 wh=Y("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"}]]);/**
|
|
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 B2=Y("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
|
|
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 V2=Y("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"}]]);/**
|
|
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 Dv=Y("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 W2=Y("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"}]]);/**
|
|
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 U2=Y("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"}]]);/**
|
|
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 Li=Y("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 H2=Y("PlugZap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]);/**
|
|
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 K2=Y("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
|
|
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 Dn=Y("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 ul=Y("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"}]]);/**
|
|
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 Nu=Y("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"}]]);/**
|
|
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 Nh=Y("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"}]]);/**
|
|
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 G2=Y("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
|
|
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 q2=Y("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
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 Y2=Y("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"}]]);/**
|
|
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 Fv=Y("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"}]]);/**
|
|
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 Ma=Y("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"}]]);/**
|
|
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 zv=Y("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"}]]);/**
|
|
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 et=Y("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"}]]);/**
|
|
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 Fn=Y("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"}]]);/**
|
|
359
|
+
* @license lucide-react v0.462.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const Q2=Y("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
|
364
|
+
* @license lucide-react v0.462.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const Bv=Y("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"}]]);/**
|
|
369
|
+
* @license lucide-react v0.462.0 - ISC
|
|
370
|
+
*
|
|
371
|
+
* This source code is licensed under the ISC license.
|
|
372
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
+
*/const X2=Y("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"}]]);/**
|
|
374
|
+
* @license lucide-react v0.462.0 - ISC
|
|
375
|
+
*
|
|
376
|
+
* This source code is licensed under the ISC license.
|
|
377
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
+
*/const Vv=Y("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"}]]);/**
|
|
379
|
+
* @license lucide-react v0.462.0 - ISC
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the ISC license.
|
|
382
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/const Wv=Y("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"}]]);/**
|
|
384
|
+
* @license lucide-react v0.462.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/const Un=Y("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"}]]);/**
|
|
389
|
+
* @license lucide-react v0.462.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*/const Xm=Y("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"}]]);/**
|
|
394
|
+
* @license lucide-react v0.462.0 - ISC
|
|
395
|
+
*
|
|
396
|
+
* This source code is licensed under the ISC license.
|
|
397
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
+
*/const Uv=Y("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"}]]);/**
|
|
399
|
+
* @license lucide-react v0.462.0 - ISC
|
|
400
|
+
*
|
|
401
|
+
* This source code is licensed under the ISC license.
|
|
402
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
403
|
+
*/const Z2=Y("Waypoints",[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]]);/**
|
|
404
|
+
* @license lucide-react v0.462.0 - ISC
|
|
405
|
+
*
|
|
406
|
+
* This source code is licensed under the ISC license.
|
|
407
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
+
*/const jh=Y("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"}]]);/**
|
|
409
|
+
* @license lucide-react v0.462.0 - ISC
|
|
410
|
+
*
|
|
411
|
+
* This source code is licensed under the ISC license.
|
|
412
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
413
|
+
*/const ts=Y("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
414
|
+
* @license lucide-react v0.462.0 - ISC
|
|
415
|
+
*
|
|
416
|
+
* This source code is licensed under the ISC license.
|
|
417
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
418
|
+
*/const kr=Y("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"}]]),Zm="-",J2=e=>{const t=tC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const l=a.split(Zm);return l[0]===""&&l.length!==1&&l.shift(),Hv(l,t)||eC(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&r[a]?[...c,...r[a]]:c}}},Hv=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Hv(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Zm);return(a=t.validators.find(({validator:l})=>l(i)))==null?void 0:a.classGroupId},Sh=/^\[(.+)\]$/,eC=e=>{if(Sh.test(e)){const t=Sh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},tC=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return rC(Object.entries(e.classGroups),n).forEach(([i,a])=>{ju(a,r,i,t)}),r},ju=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:kh(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(nC(o)){ju(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{ju(a,kh(t,i),n,r)})})},kh=(e,t)=>{let n=e;return t.split(Zm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},nC=e=>e.isThemeGetter,rC=(e,t)=>t?e.map(([n,r])=>{const o=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,o]}):e,sC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(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 o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},Kv="!",oC=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,a=l=>{const c=[];let d=0,u=0,m;for(let w=0;w<l.length;w++){let x=l[w];if(d===0){if(x===o&&(r||l.slice(w,w+i)===t)){c.push(l.slice(u,w)),u=w+i;continue}if(x==="/"){m=w;continue}}x==="["?d++:x==="]"&&d--}const f=c.length===0?l:l.substring(u),p=f.startsWith(Kv),v=p?f.substring(1):f,g=m&&m>u?m-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:a}):a},iC=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},aC=e=>({cache:sC(e.cacheSize),parseClassName:oC(e),...J2(e)}),lC=/\s+/,cC=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(lC);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{modifiers:u,hasImportantModifier:m,baseClassName:f,maybePostfixModifierPosition:p}=n(d);let v=!!p,g=r(v?f.substring(0,p):f);if(!g){if(!v){l=d+(l.length>0?" "+l:l);continue}if(g=r(f),!g){l=d+(l.length>0?" "+l:l);continue}v=!1}const w=iC(u).join(":"),x=m?w+Kv:w,y=x+g;if(i.includes(y))continue;i.push(y);const b=o(g,v);for(let N=0;N<b.length;++N){const j=b[N];i.push(x+j)}l=d+(l.length>0?" "+l:l)}return l};function dC(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Gv(t))&&(r&&(r+=" "),r+=n);return r}const Gv=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Gv(e[r]))&&(n&&(n+=" "),n+=t);return n};function uC(e,...t){let n,r,o,i=a;function a(c){const d=t.reduce((u,m)=>m(u),e());return n=aC(d),r=n.cache.get,o=n.cache.set,i=l,l(c)}function l(c){const d=r(c);if(d)return d;const u=cC(c,n);return o(c,u),u}return function(){return i(dC.apply(null,arguments))}}const Se=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},qv=/^\[(?:([a-z-]+):)?(.+)\]$/i,mC=/^\d+\/\d+$/,fC=new Set(["px","full","screen"]),pC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hC=/\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$/,gC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,xC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pn=e=>Bs(e)||fC.has(e)||mC.test(e),tr=e=>vo(e,"length",CC),Bs=e=>!!e&&!Number.isNaN(Number(e)),ed=e=>vo(e,"number",Bs),To=e=>!!e&&Number.isInteger(Number(e)),yC=e=>e.endsWith("%")&&Bs(e.slice(0,-1)),se=e=>qv.test(e),nr=e=>pC.test(e),bC=new Set(["length","size","percentage"]),wC=e=>vo(e,bC,Yv),NC=e=>vo(e,"position",Yv),jC=new Set(["image","url"]),SC=e=>vo(e,jC,RC),kC=e=>vo(e,"",EC),Io=()=>!0,vo=(e,t,n)=>{const r=qv.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},CC=e=>hC.test(e)&&!gC.test(e),Yv=()=>!1,EC=e=>xC.test(e),RC=e=>vC.test(e),PC=()=>{const e=Se("colors"),t=Se("spacing"),n=Se("blur"),r=Se("brightness"),o=Se("borderColor"),i=Se("borderRadius"),a=Se("borderSpacing"),l=Se("borderWidth"),c=Se("contrast"),d=Se("grayscale"),u=Se("hueRotate"),m=Se("invert"),f=Se("gap"),p=Se("gradientColorStops"),v=Se("gradientColorStopPositions"),g=Se("inset"),w=Se("margin"),x=Se("opacity"),y=Se("padding"),b=Se("saturate"),N=Se("scale"),j=Se("sepia"),C=Se("skew"),k=Se("space"),P=Se("translate"),E=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",se,t],M=()=>[se,t],O=()=>["",Pn,tr],A=()=>["auto",Bs,se],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",se],S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[Bs,se];return{cacheSize:500,separator:":",theme:{colors:[Io],spacing:[Pn,tr],blur:["none","",nr,se],brightness:D(),borderColor:[e],borderRadius:["none","","full",nr,se],borderSpacing:M(),borderWidth:O(),contrast:D(),grayscale:L(),hueRotate:D(),invert:L(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[yC,tr],inset:_(),margin:_(),opacity:D(),padding:M(),saturate:D(),scale:D(),sepia:L(),skew:D(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",se]}],container:["container"],columns:[{columns:[nr]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:[...H(),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",To,se]}],basis:[{basis:_()}],"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:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",To,se]}],"grid-cols":[{"grid-cols":[Io]}],"col-start-end":[{col:["auto",{span:["full",To,se]},se]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[Io]}],"row-start-end":[{row:["auto",{span:[To,se]},se]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"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:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"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:[nr]},nr]}],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",nr,tr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ed]}],"font-family":[{font:[Io]}],"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",Bs,ed]}],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:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Pn,tr]}],"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:M()}],"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:[...H(),NC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},SC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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:[...z(),"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:z()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Pn,se]}],"outline-w":[{outline:[Pn,tr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Pn,tr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",nr,kC]}],"shadow-color":[{shadow:[Io]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",nr,se]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[m]}],saturate:[{saturate:[b]}],sepia:[{sepia:[j]}],"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":[m]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"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:D()}],ease:[{ease:["linear","in","out","in-out",se]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[To,se]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"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":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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,tr,ed]}],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"]}}},_C=uC(PC);function I(...e){return _C(Mv(e))}const AC=S2,Qv=h.forwardRef(({className:e,...t},n)=>s.jsx(Ev,{ref:n,className:I("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}));Qv.displayName=Ev.displayName;const TC=Ql("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"}}),Xv=h.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(Rv,{ref:r,className:I(TC({variant:t}),e),...n}));Xv.displayName=Rv.displayName;const IC=h.forwardRef(({className:e,...t},n)=>s.jsx(Av,{ref:n,className:I("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}));IC.displayName=Av.displayName;const Zv=h.forwardRef(({className:e,...t},n)=>s.jsx(Tv,{ref:n,className:I("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:s.jsx(ts,{className:"h-4 w-4"})}));Zv.displayName=Tv.displayName;const Jv=h.forwardRef(({className:e,...t},n)=>s.jsx(Pv,{ref:n,className:I("text-sm font-semibold",e),...t}));Jv.displayName=Pv.displayName;const ey=h.forwardRef(({className:e,...t},n)=>s.jsx(_v,{ref:n,className:I("text-sm opacity-90",e),...t}));ey.displayName=_v.displayName;function MC(){const{toasts:e}=Mk();return s.jsxs(AC,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return s.jsxs(Xv,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(Jv,{children:n}),r&&s.jsx(ey,{children:r})]}),o,s.jsx(Zv,{})]},t)}),s.jsx(Qv,{})]})}var LC=Qu[" useId ".trim().toString()]||(()=>{}),OC=0;function yo(e){const[t,n]=h.useState(LC());return We(()=>{n(r=>r??String(OC++))},[e]),t?`radix-${t}`:""}const $C=["top","right","bottom","left"],_r=Math.min,Ct=Math.max,ml=Math.round,ua=Math.floor,jn=e=>({x:e,y:e}),DC={left:"right",right:"left",bottom:"top",top:"bottom"},FC={start:"end",end:"start"};function Su(e,t,n){return Ct(e,_r(t,n))}function Hn(e,t){return typeof e=="function"?e(t):e}function Kn(e){return e.split("-")[0]}function bo(e){return e.split("-")[1]}function Jm(e){return e==="x"?"y":"x"}function ef(e){return e==="y"?"height":"width"}const zC=new Set(["top","bottom"]);function bn(e){return zC.has(Kn(e))?"y":"x"}function tf(e){return Jm(bn(e))}function BC(e,t,n){n===void 0&&(n=!1);const r=bo(e),o=tf(e),i=ef(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=fl(a)),[a,fl(a)]}function VC(e){const t=fl(e);return[ku(e),t,ku(t)]}function ku(e){return e.replace(/start|end/g,t=>FC[t])}const Ch=["left","right"],Eh=["right","left"],WC=["top","bottom"],UC=["bottom","top"];function HC(e,t,n){switch(e){case"top":case"bottom":return n?t?Eh:Ch:t?Ch:Eh;case"left":case"right":return t?WC:UC;default:return[]}}function KC(e,t,n,r){const o=bo(e);let i=HC(Kn(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(ku)))),i}function fl(e){return e.replace(/left|right|bottom|top/g,t=>DC[t])}function GC(e){return{top:0,right:0,bottom:0,left:0,...e}}function ty(e){return typeof e!="number"?GC(e):{top:e,right:e,bottom:e,left:e}}function pl(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Rh(e,t,n){let{reference:r,floating:o}=e;const i=bn(t),a=tf(t),l=ef(a),c=Kn(t),d=i==="y",u=r.x+r.width/2-o.width/2,m=r.y+r.height/2-o.height/2,f=r[l]/2-o[l]/2;let p;switch(c){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:m};break;case"left":p={x:r.x-o.width,y:m};break;default:p={x:r.x,y:r.y}}switch(bo(t)){case"start":p[a]-=f*(n&&d?-1:1);break;case"end":p[a]+=f*(n&&d?-1:1);break}return p}const qC=async(e,t,n)=>{const{placement:r="bottom",strategy:o="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:o}),{x:u,y:m}=Rh(d,r,c),f=r,p={},v=0;for(let g=0;g<l.length;g++){const{name:w,fn:x}=l[g],{x:y,y:b,data:N,reset:j}=await x({x:u,y:m,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:d,platform:a,elements:{reference:e,floating:t}});u=y??u,m=b??m,p={...p,[w]:{...p[w],...N}},j&&v<=50&&(v++,typeof j=="object"&&(j.placement&&(f=j.placement),j.rects&&(d=j.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:u,y:m}=Rh(d,f,c)),g=-1)}return{x:u,y:m,placement:f,strategy:o,middlewareData:p}};async function wi(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:m="floating",altBoundary:f=!1,padding:p=0}=Hn(t,e),v=ty(p),w=l[f?m==="floating"?"reference":"floating":m],x=pl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),y=m==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),N=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},j=pl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:b,strategy:c}):y);return{top:(x.top-j.top+v.top)/N.y,bottom:(j.bottom-x.bottom+v.bottom)/N.y,left:(x.left-j.left+v.left)/N.x,right:(j.right-x.right+v.right)/N.x}}const YC=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Hn(e,t)||{};if(d==null)return{};const m=ty(u),f={x:n,y:r},p=tf(o),v=ef(p),g=await a.getDimensions(d),w=p==="y",x=w?"top":"left",y=w?"bottom":"right",b=w?"clientHeight":"clientWidth",N=i.reference[v]+i.reference[p]-f[p]-i.floating[v],j=f[p]-i.reference[p],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let k=C?C[b]:0;(!k||!await(a.isElement==null?void 0:a.isElement(C)))&&(k=l.floating[b]||i.floating[v]);const P=N/2-j/2,E=k/2-g[v]/2-1,R=_r(m[x],E),_=_r(m[y],E),M=R,O=k-g[v]-_,A=k/2-g[v]/2+P,H=Su(M,A,O),z=!c.arrow&&bo(o)!=null&&A!==H&&i.reference[v]/2-(A<M?R:_)-g[v]/2<0,U=z?A<M?A-M:A-O:0;return{[p]:f[p]+U,data:{[p]:H,centerOffset:A-H-U,...z&&{alignmentOffset:U}},reset:z}}}),QC=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:m=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...w}=Hn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Kn(o),y=bn(l),b=Kn(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(d.floating)),j=f||(b||!g?[fl(l)]:VC(l)),C=v!=="none";!f&&C&&j.push(...KC(l,g,v,N));const k=[l,...j],P=await wi(t,w),E=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&E.push(P[x]),m){const A=BC(o,a,N);E.push(P[A[0]],P[A[1]])}if(R=[...R,{placement:o,overflows:E}],!E.every(A=>A<=0)){var _,M;const A=(((_=i.flip)==null?void 0:_.index)||0)+1,H=k[A];if(H&&(!(m==="alignment"?y!==bn(H):!1)||R.every(T=>T.overflows[0]>0&&bn(T.placement)===y)))return{data:{index:A,overflows:R},reset:{placement:H}};let z=(M=R.filter(U=>U.overflows[0]<=0).sort((U,T)=>U.overflows[1]-T.overflows[1])[0])==null?void 0:M.placement;if(!z)switch(p){case"bestFit":{var O;const U=(O=R.filter(T=>{if(C){const L=bn(T.placement);return L===y||L==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(L=>L>0).reduce((L,S)=>L+S,0)]).sort((T,L)=>T[1]-L[1])[0])==null?void 0:O[0];U&&(z=U);break}case"initialPlacement":z=l;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function Ph(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _h(e){return $C.some(t=>e[t]>=0)}const XC=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Hn(e,t);switch(r){case"referenceHidden":{const i=await wi(t,{...o,elementContext:"reference"}),a=Ph(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:_h(a)}}}case"escaped":{const i=await wi(t,{...o,altBoundary:!0}),a=Ph(i,n.floating);return{data:{escapedOffsets:a,escaped:_h(a)}}}default:return{}}}}},ny=new Set(["left","top"]);async function ZC(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Kn(n),l=bo(n),c=bn(n)==="y",d=ny.has(a)?-1:1,u=i&&c?-1:1,m=Hn(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:v}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof v=="number"&&(p=l==="end"?v*-1:v),c?{x:p*u,y:f*d}:{x:f*d,y:p*u}}const JC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:l}=t,c=await ZC(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},eE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:w=>{let{x,y}=w;return{x,y}}},...c}=Hn(e,t),d={x:n,y:r},u=await wi(t,c),m=bn(Kn(o)),f=Jm(m);let p=d[f],v=d[m];if(i){const w=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=p+u[w],b=p-u[x];p=Su(y,p,b)}if(a){const w=m==="y"?"top":"left",x=m==="y"?"bottom":"right",y=v+u[w],b=v-u[x];v=Su(y,v,b)}const g=l.fn({...t,[f]:p,[m]:v});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:i,[m]:a}}}}}},tE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Hn(e,t),u={x:n,y:r},m=bn(o),f=Jm(m);let p=u[f],v=u[m];const g=Hn(l,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const b=f==="y"?"height":"width",N=i.reference[f]-i.floating[b]+w.mainAxis,j=i.reference[f]+i.reference[b]-w.mainAxis;p<N?p=N:p>j&&(p=j)}if(d){var x,y;const b=f==="y"?"width":"height",N=ny.has(Kn(o)),j=i.reference[m]-i.floating[b]+(N&&((x=a.offset)==null?void 0:x[m])||0)+(N?0:w.crossAxis),C=i.reference[m]+i.reference[b]+(N?0:((y=a.offset)==null?void 0:y[m])||0)-(N?w.crossAxis:0);v<j?v=j:v>C&&(v=C)}return{[f]:p,[m]:v}}}},nE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:l}=t,{apply:c=()=>{},...d}=Hn(e,t),u=await wi(t,d),m=Kn(o),f=bo(o),p=bn(o)==="y",{width:v,height:g}=i.floating;let w,x;m==="top"||m==="bottom"?(w=m,x=f===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(x=m,w=f==="end"?"top":"bottom");const y=g-u.top-u.bottom,b=v-u.left-u.right,N=_r(g-u[w],y),j=_r(v-u[x],b),C=!t.middlewareData.shift;let k=N,P=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=y),C&&!f){const R=Ct(u.left,0),_=Ct(u.right,0),M=Ct(u.top,0),O=Ct(u.bottom,0);p?P=v-2*(R!==0||_!==0?R+_:Ct(u.left,u.right)):k=g-2*(M!==0||O!==0?M+O:Ct(u.top,u.bottom))}await c({...t,availableWidth:P,availableHeight:k});const E=await a.getDimensions(l.floating);return v!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function Jl(){return typeof window<"u"}function wo(e){return ry(e)?(e.nodeName||"").toLowerCase():"#document"}function Pt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cn(e){var t;return(t=(ry(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ry(e){return Jl()?e instanceof Node||e instanceof Pt(e).Node:!1}function cn(e){return Jl()?e instanceof Element||e instanceof Pt(e).Element:!1}function kn(e){return Jl()?e instanceof HTMLElement||e instanceof Pt(e).HTMLElement:!1}function Ah(e){return!Jl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pt(e).ShadowRoot}const rE=new Set(["inline","contents"]);function Oi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!rE.has(o)}const sE=new Set(["table","td","th"]);function oE(e){return sE.has(wo(e))}const iE=[":popover-open",":modal"];function ec(e){return iE.some(t=>{try{return e.matches(t)}catch{return!1}})}const aE=["transform","translate","scale","rotate","perspective"],lE=["transform","translate","scale","rotate","perspective","filter"],cE=["paint","layout","strict","content"];function nf(e){const t=rf(),n=cn(e)?dn(e):e;return aE.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)||lE.some(r=>(n.willChange||"").includes(r))||cE.some(r=>(n.contain||"").includes(r))}function dE(e){let t=Ar(e);for(;kn(t)&&!lo(t);){if(nf(t))return t;if(ec(t))return null;t=Ar(t)}return null}function rf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const uE=new Set(["html","body","#document"]);function lo(e){return uE.has(wo(e))}function dn(e){return Pt(e).getComputedStyle(e)}function tc(e){return cn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ar(e){if(wo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ah(e)&&e.host||Cn(e);return Ah(t)?t.host:t}function sy(e){const t=Ar(e);return lo(t)?e.ownerDocument?e.ownerDocument.body:e.body:kn(t)&&Oi(t)?t:sy(t)}function Ni(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=sy(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Pt(o);if(i){const l=Cu(a);return t.concat(a,a.visualViewport||[],Oi(o)?o:[],l&&n?Ni(l):[])}return t.concat(o,Ni(o,[],n))}function Cu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oy(e){const t=dn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=kn(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=ml(n)!==i||ml(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function sf(e){return cn(e)?e:e.contextElement}function Vs(e){const t=sf(e);if(!kn(t))return jn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=oy(t);let a=(i?ml(n.width):n.width)/r,l=(i?ml(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const mE=jn(0);function iy(e){const t=Pt(e);return!rf()||!t.visualViewport?mE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pt(e)?!1:t}function as(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=sf(e);let a=jn(1);t&&(r?cn(r)&&(a=Vs(r)):a=Vs(e));const l=fE(i,n,r)?iy(i):jn(0);let c=(o.left+l.x)/a.x,d=(o.top+l.y)/a.y,u=o.width/a.x,m=o.height/a.y;if(i){const f=Pt(i),p=r&&cn(r)?Pt(r):r;let v=f,g=Cu(v);for(;g&&r&&p!==v;){const w=Vs(g),x=g.getBoundingClientRect(),y=dn(g),b=x.left+(g.clientLeft+parseFloat(y.paddingLeft))*w.x,N=x.top+(g.clientTop+parseFloat(y.paddingTop))*w.y;c*=w.x,d*=w.y,u*=w.x,m*=w.y,c+=b,d+=N,v=Pt(g),g=Cu(v)}}return pl({width:u,height:m,x:c,y:d})}function of(e,t){const n=tc(e).scrollLeft;return t?t.left+n:as(Cn(e)).left+n}function ay(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:of(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function pE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=Cn(r),l=t?ec(t.floating):!1;if(r===a||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=jn(1);const u=jn(0),m=kn(r);if((m||!m&&!i)&&((wo(r)!=="body"||Oi(a))&&(c=tc(r)),kn(r))){const p=as(r);d=Vs(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=a&&!m&&!i?ay(a,c,!0):jn(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x+f.x,y:n.y*d.y-c.scrollTop*d.y+u.y+f.y}}function hE(e){return Array.from(e.getClientRects())}function gE(e){const t=Cn(e),n=tc(e),r=e.ownerDocument.body,o=Ct(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ct(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+of(e);const l=-n.scrollTop;return dn(r).direction==="rtl"&&(a+=Ct(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}function xE(e,t){const n=Pt(e),r=Cn(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const d=rf();(!d||d&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}const vE=new Set(["absolute","fixed"]);function yE(e,t){const n=as(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=kn(e)?Vs(e):jn(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=r*i.y;return{width:a,height:l,x:c,y:d}}function Th(e,t,n){let r;if(t==="viewport")r=xE(e,n);else if(t==="document")r=gE(Cn(e));else if(cn(t))r=yE(t,n);else{const o=iy(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return pl(r)}function ly(e,t){const n=Ar(e);return n===t||!cn(n)||lo(n)?!1:dn(n).position==="fixed"||ly(n,t)}function bE(e,t){const n=t.get(e);if(n)return n;let r=Ni(e,[],!1).filter(l=>cn(l)&&wo(l)!=="body"),o=null;const i=dn(e).position==="fixed";let a=i?Ar(e):e;for(;cn(a)&&!lo(a);){const l=dn(a),c=nf(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&vE.has(o.position)||Oi(a)&&!c&&ly(e,a))?r=r.filter(u=>u!==a):o=l,a=Ar(a)}return t.set(e,r),r}function wE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?ec(t)?[]:bE(t,this._c):[].concat(n),r],l=a[0],c=a.reduce((d,u)=>{const m=Th(t,u,o);return d.top=Ct(m.top,d.top),d.right=_r(m.right,d.right),d.bottom=_r(m.bottom,d.bottom),d.left=Ct(m.left,d.left),d},Th(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function NE(e){const{width:t,height:n}=oy(e);return{width:t,height:n}}function jE(e,t,n){const r=kn(t),o=Cn(t),i=n==="fixed",a=as(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=jn(0);function d(){c.x=of(o)}if(r||!r&&!i)if((wo(t)!=="body"||Oi(o))&&(l=tc(t)),r){const p=as(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&d();i&&!r&&o&&d();const u=o&&!r&&!i?ay(o,l):jn(0),m=a.left+l.scrollLeft-c.x-u.x,f=a.top+l.scrollTop-c.y-u.y;return{x:m,y:f,width:a.width,height:a.height}}function td(e){return dn(e).position==="static"}function Ih(e,t){if(!kn(e)||dn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Cn(e)===n&&(n=n.ownerDocument.body),n}function cy(e,t){const n=Pt(e);if(ec(e))return n;if(!kn(e)){let o=Ar(e);for(;o&&!lo(o);){if(cn(o)&&!td(o))return o;o=Ar(o)}return n}let r=Ih(e,t);for(;r&&oE(r)&&td(r);)r=Ih(r,t);return r&&lo(r)&&td(r)&&!nf(r)?n:r||dE(e)||n}const SE=async function(e){const t=this.getOffsetParent||cy,n=this.getDimensions,r=await n(e.floating);return{reference:jE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kE(e){return dn(e).direction==="rtl"}const CE={convertOffsetParentRelativeRectToViewportRelativeRect:pE,getDocumentElement:Cn,getClippingRect:wE,getOffsetParent:cy,getElementRects:SE,getClientRects:hE,getDimensions:NE,getScale:Vs,isElement:cn,isRTL:kE};function dy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function EE(e,t){let n=null,r;const o=Cn(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:m,width:f,height:p}=d;if(l||t(),!f||!p)return;const v=ua(m),g=ua(o.clientWidth-(u+f)),w=ua(o.clientHeight-(m+p)),x=ua(u),b={rootMargin:-v+"px "+-g+"px "+-w+"px "+-x+"px",threshold:Ct(0,_r(1,c))||1};let N=!0;function j(C){const k=C[0].intersectionRatio;if(k!==c){if(!N)return a();k?a(!1,k):r=setTimeout(()=>{a(!1,1e-7)},1e3)}k===1&&!dy(d,e.getBoundingClientRect())&&a(),N=!1}try{n=new IntersectionObserver(j,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(j,b)}n.observe(e)}return a(!0),i}function RE(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=sf(e),u=o||i?[...d?Ni(d):[],...Ni(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const m=d&&l?EE(d,n):null;let f=-1,p=null;a&&(p=new ResizeObserver(x=>{let[y]=x;y&&y.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),d&&!c&&p.observe(d),p.observe(t));let v,g=c?as(e):null;c&&w();function w(){const x=as(e);g&&!dy(g,x)&&n(),g=x,v=requestAnimationFrame(w)}return n(),()=>{var x;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),m==null||m(),(x=p)==null||x.disconnect(),p=null,c&&cancelAnimationFrame(v)}}const PE=JC,_E=eE,AE=QC,TE=nE,IE=XC,Mh=YC,ME=tE,LE=(e,t,n)=>{const r=new Map,o={platform:CE,...n},i={...o.platform,_c:r};return qC(e,t,{...o,platform:i})};var OE=typeof document<"u",$E=function(){},La=OE?h.useLayoutEffect:$E;function hl(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,o;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(!hl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!hl(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function uy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lh(e,t){const n=uy(e);return Math.round(t*n)/n}function nd(e){const t=h.useRef(e);return La(()=>{t.current=e}),t}function DE(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,m]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=h.useState(r);hl(f,r)||p(r);const[v,g]=h.useState(null),[w,x]=h.useState(null),y=h.useCallback(T=>{T!==C.current&&(C.current=T,g(T))},[]),b=h.useCallback(T=>{T!==k.current&&(k.current=T,x(T))},[]),N=i||v,j=a||w,C=h.useRef(null),k=h.useRef(null),P=h.useRef(u),E=c!=null,R=nd(c),_=nd(o),M=nd(d),O=h.useCallback(()=>{if(!C.current||!k.current)return;const T={placement:t,strategy:n,middleware:f};_.current&&(T.platform=_.current),LE(C.current,k.current,T).then(L=>{const S={...L,isPositioned:M.current!==!1};A.current&&!hl(P.current,S)&&(P.current=S,fs.flushSync(()=>{m(S)}))})},[f,t,n,_,M]);La(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,m(T=>({...T,isPositioned:!1})))},[d]);const A=h.useRef(!1);La(()=>(A.current=!0,()=>{A.current=!1}),[]),La(()=>{if(N&&(C.current=N),j&&(k.current=j),N&&j){if(R.current)return R.current(N,j,O);O()}},[N,j,O,R,E]);const H=h.useMemo(()=>({reference:C,floating:k,setReference:y,setFloating:b}),[y,b]),z=h.useMemo(()=>({reference:N,floating:j}),[N,j]),U=h.useMemo(()=>{const T={position:n,left:0,top:0};if(!z.floating)return T;const L=Lh(z.floating,u.x),S=Lh(z.floating,u.y);return l?{...T,transform:"translate("+L+"px, "+S+"px)",...uy(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:S}},[n,l,z.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:O,refs:H,elements:z,floatingStyles:U}),[u,O,H,z,U])}const FE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Mh({element:r.current,padding:o}).fn(n):{}:r?Mh({element:r,padding:o}).fn(n):{}}}},zE=(e,t)=>({...PE(e),options:[e,t]}),BE=(e,t)=>({..._E(e),options:[e,t]}),VE=(e,t)=>({...ME(e),options:[e,t]}),WE=(e,t)=>({...AE(e),options:[e,t]}),UE=(e,t)=>({...TE(e),options:[e,t]}),HE=(e,t)=>({...IE(e),options:[e,t]}),KE=(e,t)=>({...FE(e),options:[e,t]});var GE="Arrow",my=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return s.jsx(J.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});my.displayName=GE;var qE=my;function af(e){const[t,n]=h.useState(void 0);return We(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[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 lf="Popper",[fy,nc]=Bt(lf),[YE,py]=fy(lf),hy=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return s.jsx(YE,{scope:t,anchor:r,onAnchorChange:o,children:n})};hy.displayName=lf;var gy="PopperAnchor",xy=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=py(gy,n),a=h.useRef(null),l=le(t,a);return h.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:s.jsx(J.div,{...o,ref:l})});xy.displayName=gy;var cf="PopperContent",[QE,XE]=fy(cf),vy=h.forwardRef((e,t)=>{var B,ee,be,ue,oe,ie;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:m="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:v,...g}=e,w=py(cf,n),[x,y]=h.useState(null),b=le(t,Me=>y(Me)),[N,j]=h.useState(null),C=af(N),k=(C==null?void 0:C.width)??0,P=(C==null?void 0:C.height)??0,E=r+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},_=Array.isArray(d)?d:[d],M=_.length>0,O={padding:R,boundary:_.filter(JE),altBoundary:M},{refs:A,floatingStyles:H,placement:z,isPositioned:U,middlewareData:T}=DE({strategy:"fixed",placement:E,whileElementsMounted:(...Me)=>RE(...Me,{animationFrame:p==="always"}),elements:{reference:w.anchor},middleware:[zE({mainAxis:o+P,alignmentAxis:a}),c&&BE({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?VE():void 0,...O}),c&&WE({...O}),UE({...O,apply:({elements:Me,rects:Ke,availableWidth:Wt,availableHeight:Ut})=>{const{width:Rn,height:Dr}=Ke.reference,Yn=Me.floating.style;Yn.setProperty("--radix-popper-available-width",`${Wt}px`),Yn.setProperty("--radix-popper-available-height",`${Ut}px`),Yn.setProperty("--radix-popper-anchor-width",`${Rn}px`),Yn.setProperty("--radix-popper-anchor-height",`${Dr}px`)}}),N&&KE({element:N,padding:l}),e5({arrowWidth:k,arrowHeight:P}),f&&HE({strategy:"referenceHidden",...O})]}),[L,S]=wy(z),D=Be(v);We(()=>{U&&(D==null||D())},[U,D]);const F=(B=T.arrow)==null?void 0:B.x,G=(ee=T.arrow)==null?void 0:ee.y,Q=((be=T.arrow)==null?void 0:be.centerOffset)!==0,[re,K]=h.useState();return We(()=>{x&&K(window.getComputedStyle(x).zIndex)},[x]),s.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:U?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(ue=T.transformOrigin)==null?void 0:ue.x,(oe=T.transformOrigin)==null?void 0:oe.y].join(" "),...((ie=T.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(QE,{scope:n,placedSide:L,onArrowChange:j,arrowX:F,arrowY:G,shouldHideArrow:Q,children:s.jsx(J.div,{"data-side":L,"data-align":S,...g,ref:b,style:{...g.style,animation:U?void 0:"none"}})})})});vy.displayName=cf;var yy="PopperArrow",ZE={top:"bottom",right:"left",bottom:"top",left:"right"},by=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=XE(yy,r),a=ZE[i.placedSide];return s.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:s.jsx(qE,{...o,ref:n,style:{...o.style,display:"block"}})})});by.displayName=yy;function JE(e){return e!==null}var e5=e=>({name:"transformOrigin",options:e,fn(t){var w,x,y;const{placement:n,rects:r,middlewareData:o}=t,a=((w=o.arrow)==null?void 0:w.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,u]=wy(n),m={start:"0%",center:"50%",end:"100%"}[u],f=(((x=o.arrow)==null?void 0:x.x)??0)+l/2,p=(((y=o.arrow)==null?void 0:y.y)??0)+c/2;let v="",g="";return d==="bottom"?(v=a?m:`${f}px`,g=`${-c}px`):d==="top"?(v=a?m:`${f}px`,g=`${r.floating.height+c}px`):d==="right"?(v=`${-c}px`,g=a?m:`${p}px`):d==="left"&&(v=`${r.floating.width+c}px`,g=a?m:`${p}px`),{data:{x:v,y:g}}}});function wy(e){const[t,n="center"]=e.split("-");return[t,n]}var t5=hy,Ny=xy,jy=vy,Sy=by,[rc,K3]=Bt("Tooltip",[nc]),df=nc(),ky="TooltipProvider",n5=700,Oh="tooltip.open",[r5,Cy]=rc(ky),Ey=e=>{const{__scopeTooltip:t,delayDuration:n=n5,skipDelayDuration:r=300,disableHoverableContent:o=!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)},[]),s.jsx(r5,{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:o,children:i})};Ey.displayName=ky;var Ry="Tooltip",[G3,sc]=rc(Ry),Eu="TooltipTrigger",s5=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=sc(Eu,n),i=Cy(Eu,n),a=df(n),l=h.useRef(null),c=le(t,l,o.onTriggerChange),d=h.useRef(!1),u=h.useRef(!1),m=h.useCallback(()=>d.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),s.jsx(Ny,{asChild:!0,...a,children:s.jsx(J.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:X(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:X(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:X(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:X(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:X(e.onBlur,o.onClose),onClick:X(e.onClick,o.onClose)})})});s5.displayName=Eu;var o5="TooltipPortal",[q3,i5]=rc(o5,{forceMount:void 0}),co="TooltipContent",Py=h.forwardRef((e,t)=>{const n=i5(co,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=sc(co,e.__scopeTooltip);return s.jsx(qn,{present:r||a.open,children:a.disableHoverableContent?s.jsx(_y,{side:o,...i,ref:t}):s.jsx(a5,{side:o,...i,ref:t})})}),a5=h.forwardRef((e,t)=>{const n=sc(co,e.__scopeTooltip),r=Cy(co,e.__scopeTooltip),o=h.useRef(null),i=le(t,o),[a,l]=h.useState(null),{trigger:c,onClose:d}=n,u=o.current,{onPointerInTransitChange:m}=r,f=h.useCallback(()=>{l(null),m(!1)},[m]),p=h.useCallback((v,g)=>{const w=v.currentTarget,x={x:v.clientX,y:v.clientY},y=m5(x,w.getBoundingClientRect()),b=f5(x,y),N=p5(g.getBoundingClientRect()),j=g5([...b,...N]);l(j),m(!0)},[m]);return h.useEffect(()=>()=>f(),[f]),h.useEffect(()=>{if(c&&u){const v=w=>p(w,u),g=w=>p(w,c);return c.addEventListener("pointerleave",v),u.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",g)}}},[c,u,p,f]),h.useEffect(()=>{if(a){const v=g=>{const w=g.target,x={x:g.clientX,y:g.clientY},y=(c==null?void 0:c.contains(w))||(u==null?void 0:u.contains(w)),b=!h5(x,a);y?f():b&&(f(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,u,a,d,f]),s.jsx(_y,{...e,ref:i})}),[l5,c5]=rc(Ry,{isInside:!1}),d5=Dk("TooltipContent"),_y=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=e,c=sc(co,n),d=df(n),{onClose:u}=c;return h.useEffect(()=>(document.addEventListener(Oh,u),()=>document.removeEventListener(Oh,u)),[u]),h.useEffect(()=>{if(c.trigger){const m=f=>{const p=f.target;p!=null&&p.contains(c.trigger)&&u()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,u]),s.jsx(Gl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:u,children:s.jsxs(jy,{"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:[s.jsx(d5,{children:r}),s.jsx(l5,{scope:n,isInside:!0,children:s.jsx(i2,{id:c.contentId,role:"tooltip",children:o||r})})]})})});Py.displayName=co;var Ay="TooltipArrow",u5=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=df(n);return c5(Ay,n).isInside?null:s.jsx(Sy,{...o,...r,ref:t})});u5.displayName=Ay;function m5(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function f5(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 p5(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function h5(e,t){const{x:n,y:r}=e;let o=!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,m=c.x,f=c.y;u>r!=f>r&&n<(m-d)*(r-u)/(f-u)+d&&(o=!o)}return o}function g5(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),x5(t)}function x5(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}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 v5=Ey,Ty=Py;const y5=v5,b5=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Ty,{ref:r,sideOffset:t,className:I("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}));b5.displayName=Ty.displayName;const w5="modulepreload",N5=function(e){return"/"+e},$h={},Ru=function(t,n,r){let o=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"));o=Promise.allSettled(n.map(c=>{if(c=N5(c),c in $h)return;$h[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":w5,d||(m.as="script"),m.crossOrigin="",m.href=c,l&&m.setAttribute("nonce",l),document.head.appendChild(m),d)return new Promise((f,p)=>{m.addEventListener("load",f),m.addEventListener("error",()=>p(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 o.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};var we={};const j5=[{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 uf{constructor(){qt(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 oc(t)}}function oc(e){const{metrics:t,interventions:n,governanceStats:r,rounds:o}=e,i=o.filter(p=>p.interventions.length>0).slice(0,5).map(p=>{const v=[...new Set(p.reactions.map(w=>w.agent))],g=p.interventions.some(w=>w.includes("[BLOCK]"));return{round:p.round,description:p.interventions[0].replace(/^\[.*?\]\s*/,""),agents:v,severity:g?"high":"moderate"}}),a=n.slice(0,10).map(p=>{const v=p.match(/^\[(BLOCK|PAUSE|GATE-\d+)\]\s*(.*?):\s*(.*)/);if(v){const g=v[1];return{type:g==="BLOCK"?"BLOCK":g==="PAUSE"?"PAUSE":g.startsWith("GATE")?"CIRCUIT_BREAKER":"REBALANCE",agent:v[2].trim(),description:v[3].trim()}}return{type:"REBALANCE",agent:"system",description:p}}),l=r.blocks,c=n.length,d=(t.stabilityScore*100).toFixed(0),u=(t.collapseProbability*100).toFixed(0),m=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.`,f=[];return l>2&&f.push("Multiple block events indicate aggressive agent behavior was successfully contained by invariant enforcement."),t.stabilityScore>.6&&f.push("Governance rules maintained system stability above critical thresholds throughout the simulation."),t.maxVolatility>.5&&f.push(`Peak volatility of ${(t.maxVolatility*100).toFixed(0)}% was dampened by circuit breaker gates.`),r.rulesFired>3&&f.push(`${r.rulesFired} world rules fired during deterministic simulation, shaping agent behavior across rounds.`),f.length===0&&f.push("Governance constraints maintained equilibrium with minimal intervention required."),{executiveSummary:m,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:f,generatedBy:"deterministic",governedBy:"NeuroverseOS"}}class ic{constructor(t){qt(this,"name","anthropic");qt(this,"client",null);qt(this,"model");qt(this,"_apiKey");this.model=(t==null?void 0:t.model)??"claude-sonnet-4-20250514";const n=(t==null?void 0:t.apiKey)??we.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 Ru(()=>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:Iy,messages:[{role:"user",content:t}]}),o=((i=r.content[0])==null?void 0:i.type)==="text"?r.content[0].text:"[]";return Ly(o)}async summarize(t){var a;const n=await this.getClient(),r=Oy(t),o=await n.messages.create({model:this.model,max_tokens:2048,system:My,messages:[{role:"user",content:`Analyze this simulation trace:
|
|
419
|
+
${r}`}]}),i=((a=o.content[0])==null?void 0:a.type)==="text"?o.content[0].text:"{}";try{return JSON.parse(i)}catch{return oc(t)}}}class zt{constructor(t){qt(this,"name");qt(this,"model");qt(this,"baseUrl");qt(this,"apiKey");qt(this,"headers");this.name=(t==null?void 0:t.name)??"openai",this.model=(t==null?void 0:t.model)??we.OPENAI_MODEL??"gpt-4o",this.apiKey=(t==null?void 0:t.apiKey)??we.OPENAI_API_KEY??"",this.baseUrl=((t==null?void 0:t.baseUrl)??we.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,m;const o=`${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(o,{method:"POST",headers:i,body:a});if(!l.ok){const f=await l.text().catch(()=>"");throw new Error(`${this.name} API error ${l.status}: ${f.slice(0,200)}`)}return((m=(u=(d=(await l.json()).choices)==null?void 0:d[0])==null?void 0:u.message)==null?void 0:m.content)??""}async translate(t){const n=await this.chatCompletion(Iy,t,1024);return Ly(n)}async summarize(t){const n=Oy(t),r=await this.chatCompletion(My,`Analyze this simulation trace:
|
|
420
|
+
${n}`,2048);try{return JSON.parse(r)}catch{return oc(t)}}}const Iy=`You are an event normalizer for NeuroverseOS, a governance simulation platform.
|
|
421
|
+
Given unstructured input, extract structured events. Return ONLY valid JSON — an array of objects with these fields:
|
|
422
|
+
- type (string): event category (market_shock, policy_change, agent_action, etc.)
|
|
423
|
+
- agent (string, optional): who caused it
|
|
424
|
+
- action (string): what happened
|
|
425
|
+
- impact (number, -1 to 1): negative to positive impact
|
|
426
|
+
- confidence (number, 0 to 1): how confident you are
|
|
427
|
+
- severity (number, 0 to 1): how severe
|
|
428
|
+
- sector (string, optional): affected domain
|
|
429
|
+
No markdown, no explanation — just the JSON array.`,My=`You are a governance analyst for NeuroverseOS. Analyze simulation trace data and produce a structured report.
|
|
430
|
+
Return ONLY valid JSON matching this schema:
|
|
431
|
+
{
|
|
432
|
+
"executiveSummary": "string — 2-3 sentence overview",
|
|
433
|
+
"keyEvents": [{"round": number, "description": "string", "agents": ["string"], "severity": "low|moderate|high|critical"}],
|
|
434
|
+
"governanceActions": [{"type": "BLOCK|PAUSE|CIRCUIT_BREAKER|REBALANCE", "agent": "string", "description": "string"}],
|
|
435
|
+
"metrics": {"volatilityReduction": "string", "collapseRisk": "string", "stabilityScore": "string", "interventionCount": number, "blockedActions": number},
|
|
436
|
+
"counterfactual": "string — what would have happened without governance",
|
|
437
|
+
"observations": ["string — insight about agent behavior under governance"],
|
|
438
|
+
"generatedBy": "ai",
|
|
439
|
+
"governedBy": "NeuroverseOS"
|
|
440
|
+
}
|
|
441
|
+
Focus on WHAT AGENTS DID DIFFERENTLY under governance — behavioral shifts matter more than raw block counts.`,Dh=`You are a stakeholder in a NeuroverseOS governance simulation.
|
|
442
|
+
You will be given your identity, the scenario, and the current state.
|
|
443
|
+
React in character. Return ONLY valid JSON:
|
|
444
|
+
{
|
|
445
|
+
"reaction": "1-2 sentence description of your reaction and reasoning",
|
|
446
|
+
"impact": <number from -1 (strongly negative) to 1 (strongly positive)>,
|
|
447
|
+
"confidence": <number from 0 to 1 — how sure you are>,
|
|
448
|
+
"trigger": "brief label for what drove this reaction"
|
|
449
|
+
}`;function Ly(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 Oy(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 $y(e){var r,o,i;const t=e.provider??lc(ac());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})`:""}.
|
|
450
|
+
Disposition: ${e.stakeholderDisposition??"unknown"}
|
|
451
|
+
Priorities: ${((r=e.stakeholderPriorities)==null?void 0:r.join(", "))??"not specified"}
|
|
452
|
+
|
|
453
|
+
SCENARIO: ${e.scenario}
|
|
454
|
+
CURRENT PATH: ${e.pathDescription}
|
|
455
|
+
RISK LEVEL: ${e.pathRisk}
|
|
456
|
+
ROUND: ${e.round+1}
|
|
457
|
+
${(o=e.previousReactions)!=null&&o.length?`
|
|
458
|
+
PREVIOUS REACTIONS THIS ROUND:
|
|
459
|
+
${e.previousReactions.join(`
|
|
460
|
+
`)}`:""}
|
|
461
|
+
|
|
462
|
+
How do you react?`;try{if(t instanceof ic){const l=await(await t.getClient()).messages.create({model:t.model,max_tokens:256,system:Dh,messages:[{role:"user",content:n}]}),c=((i=l.content[0])==null?void 0:i.type)==="text"?l.content[0].text:"{}";return Fh(c,e.stakeholderId)}else if(t instanceof zt){const a=await t.chatCompletion(Dh,n,256);return Fh(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 Fh(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 un=new Map;un.set("deterministic",()=>new uf);un.set("anthropic",()=>new ic);un.set("openai",()=>new zt);un.set("local",()=>new zt({name:"local",baseUrl:we.LOCAL_LLM_URL??"http://localhost:11434/v1",model:we.LOCAL_LLM_MODEL??"llama3",apiKey:"local"}));un.set("ollama",()=>new zt({name:"ollama",baseUrl:we.OLLAMA_BASE_URL??"http://localhost:11434/v1",model:we.OLLAMA_MODEL??"llama3",apiKey:"local"}));un.set("groq",()=>new zt({name:"groq",baseUrl:"https://api.groq.com/openai/v1",model:we.GROQ_MODEL??"llama-3.3-70b-versatile",apiKey:we.GROQ_API_KEY??""}));un.set("together",()=>new zt({name:"together",baseUrl:"https://api.together.xyz/v1",model:we.TOGETHER_MODEL??"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",apiKey:we.TOGETHER_API_KEY??""}));un.set("mistral",()=>new zt({name:"mistral",baseUrl:"https://api.mistral.ai/v1",model:we.MISTRAL_MODEL??"mistral-large-latest",apiKey:we.MISTRAL_API_KEY??""}));un.set("deepseek",()=>new zt({name:"deepseek",baseUrl:"https://api.deepseek.com/v1",model:we.DEEPSEEK_MODEL??"deepseek-chat",apiKey:we.DEEPSEEK_API_KEY??""}));un.set("fireworks",()=>new zt({name:"fireworks",baseUrl:"https://api.fireworks.ai/inference/v1",model:we.FIREWORKS_MODEL??"accounts/fireworks/models/llama-v3p1-70b-instruct",apiKey:we.FIREWORKS_API_KEY??""}));function Dy(){try{if(typeof window<"u"&&window.localStorage)return localStorage.getItem("neuroverse_api_key")??""}catch{}return""}function ac(){if(we.ANTHROPIC_API_KEY)return"anthropic";if(we.OPENAI_API_KEY)return"openai";if(we.GROQ_API_KEY)return"groq";if(we.TOGETHER_API_KEY)return"together";if(we.MISTRAL_API_KEY)return"mistral";if(we.DEEPSEEK_API_KEY)return"deepseek";if(we.FIREWORKS_API_KEY)return"fireworks";if(we.LOCAL_LLM_URL)return"local";if(we.OLLAMA_BASE_URL)return"ollama";const e=Dy();return e?S5(e):"deterministic"}function S5(e){return e.startsWith("sk-ant-")?"anthropic":e.startsWith("sk-")?"openai":e.startsWith("AIza")?"google":e.startsWith("gsk_")?"groq":(e.startsWith("xai-"),"openai")}function lc(e){const t=e??"deterministic",n=Dy();if(n&&t!=="deterministic")try{if(t==="anthropic")return new ic({apiKey:n});if(t==="openai"||t==="google")return new zt({name:t,apiKey:n,baseUrl:t==="google"?"https://generativelanguage.googleapis.com/v1beta/openai":void 0,model:t==="google"?"gemini-2.0-flash":void 0});if(t==="groq")return new zt({name:"groq",baseUrl:"https://api.groq.com/openai/v1",model:"llama-3.3-70b-versatile",apiKey:n})}catch{}const r=un.get(t);return r?r():(console.warn(`AI provider "${t}" not found, falling back to deterministic`),new uf)}async function k5(e,t,n){var i;const r=[];e.permissions.includes(t)||r.push(`Actor ${e.id} lacks permission for action: ${t}`);const o=await n();if(o&&typeof o=="object"){const a=o;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:o,actor:e.id,action:t,governed:!0,trace:{constraints:e.constraints,passed:r.length===0,violations:r}}}const C5=Object.freeze(Object.defineProperty({__proto__:null,AI_ROLES:j5,AnthropicProvider:ic,DeterministicProvider:uf,OpenAICompatibleProvider:zt,evaluateAIAction:k5,generateAIReaction:$y,generateDeterministicReport:oc,getAIProvider:lc,getDefaultProviderName:ac},Symbol.toStringTag,{value:"Module"}));function zh(e,t,n,r){var u,m;const o=e.disposition??"unknown",i=t.risk,a=Math.max(.3,.9-r*.15);let l=0,c="",d="";switch(n){case"rational":{const f=(u=t.benefits_stakeholders)==null?void 0:u.includes(e.id),p=(m=t.harms_stakeholders)==null?void 0:m.includes(e.id);f?(l=.5+Math.random()*.3,c=`${e.id} supports this path — aligns with their priorities`,d="Self-interest alignment"):p?(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 f=o==="hostile"?.8:o==="supportive"?.3:.5;l=(Math.random()-.5)*2*f,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 f=(()=>{var w,x;const v=(w=t.benefits_stakeholders)==null?void 0:w.includes(e.id),g=(x=t.harms_stakeholders)==null?void 0:x.includes(e.id);return v?.4:g?-.4:0})(),p=(Math.random()-.5)*.6;l=f*.6+p*.4,o==="hostile"?(l-=.2,c=`${e.id} pushes back — predisposed against this approach`,d="Pre-existing opposition + rational assessment"):o==="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 E5(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,o=e.filter(a=>a.impact<-.2).length;r>0&&o>0&&Math.abs(r-o)<=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 R5(e){if(e.length<2)return"stabilizing";const t=e.map(o=>o.reactions.reduce((i,a)=>i+a.impact,0)/o.reactions.length),n=t[t.length-1]-t[0],r=t.reduce((o,i)=>{const a=t.reduce((l,c)=>l+c,0)/t.length;return o+(i-a)**2},0)/t.length;return r>.15?"diverging":Math.abs(n)<.1&&r<.05?"converging":n<-.2?"escalating":"stabilizing"}function P5(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,o=e[n].reactions.reduce((a,l)=>a+l.impact,0)/e[n].reactions.length,i=Math.abs(o-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 Fy(e,t,n,r){const o=r.rounds??3,i=r.reaction_model??"mixed",a=ac(),l=r.ai_reasoning!==!1&&a!=="deterministic",c=r.simulate_stakeholders?t.filter(v=>r.simulate_stakeholders.includes(v.id)):t,d=n[0];if(!d)return{rounds:[],trajectory:"stabilizing",inflection_points:["No reasoning paths available for simulation"]};const u=[];let m;if(l)try{m=lc(a)}catch{}for(let v=0;v<o;v++){let g;if(m){const x=v>0?u[v-1].reactions.map(y=>`${y.stakeholder_id}: ${y.reaction}`):[];g=await Promise.all(c.map(async y=>{try{const b=await $y({stakeholderId:y.id,stakeholderDescription:y.description,stakeholderDisposition:y.disposition,stakeholderPriorities:y.priorities,scenario:e,pathDescription:d.description,pathRisk:d.risk,round:v,previousReactions:x,provider:m});return{stakeholder_id:y.id,reaction:b.reaction,confidence:b.confidence,impact:b.impact,trigger:b.trigger}}catch{return zh(y,d,i,v)}}))}else g=c.map(x=>zh(x,d,i,v));const w=E5(g);u.push({round:v,reactions:g,emergent_dynamics:w})}const f=R5(u),p=P5(u);return{rounds:u,trajectory:f,inflection_points:p}}function _5(e,t,n){const r=(t.stakeholders??[]).map(i=>typeof i=="string"?{id:i,disposition:"unknown"}:i),o={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{...o,capsule_hash:zy(o)}}function A5(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 T5(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:o,...i}=r;if(zy(i)!==o)throw new Error("Capsule integrity check failed — data may have been tampered with");return r}function I5(e,t="https://neuroverse.dev"){const n=A5(e);return`${t}/run#capsule=${n}`}function M5(e){const t=e.indexOf("#capsule=");if(t===-1)return null;const n=e.slice(t+9);return T5(n)}function zy(e){const t=JSON.stringify(e);let n=0;for(let r=0;r<t.length;r++){const o=t.charCodeAt(r);n=(n<<5)-n+o,n=n&n}return`cap_${Math.abs(n).toString(36)}`}const uo={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","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 L5(e,t){var a,l,c,d,u,m;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 f of t.state_variables)r[f.id]={type:f.type,options:f.enum_values?[...f.enum_values]:void 0,min:(u=f.range)==null?void 0:u.min,max:(m=f.range)==null?void 0:m.max,default:f.default_value,mutable:!0,label:f.label,description:f.label};const o=((t==null?void 0:t.invariants)??[]).map(f=>({id:f.id,label:f.description,enforcement:f.enforceable?"structural":"prompt",mutable:!1})),i=((t==null?void 0:t.gates)??[]).map(f=>({status:O5(f.severity),field:f.id,operator:"==",value:1,color:f.severity==="critical"?"#ef4444":f.severity==="warning"?"#f59e0b":"#22c55e",icon:f.severity==="critical"?"alert-triangle":f.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:o,assumptions:{profiles:{baseline:{name:"Baseline",description:"Default assumptions from the scenario",is_default_baseline:!0,parameters:$5(e)},stressed:{name:"Stressed",description:"Worst-case assumption profile",is_default_alternative:!0,parameters:D5()}},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 O5(e){switch(e){case"info":return"STABLE";case"warning":return"COMPRESSED";case"critical":return"CRITICAL"}}function $5(e){var n,r,o,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),(o=e.assumptions)!=null&&o.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 D5(){return{severity:"critical",environmental_hostility:"high",time_pressure:"immediate",regulatory_climate:"adversarial"}}function F5(e,t,n){return{status:"ALLOW",reason:"NeuroverseOS guard not loaded — permissive fallback"}}function z5(e,t){return{worldId:e.world.world_id,worldName:e.world.name,profile:"baseline",initialState:{},steps:[],finalState:{},finalViability:"STABLE",collapsed:!1}}function By(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 B5(e,t){const n=new Set;for(const r of t)for(const o of r.reactions)n.add(o.stakeholder_id);return[...n].map(r=>{var f,p,v,g;const o=[];let i=0;const a=[];for(let w=0;w<t.length;w++){const x=t[w].reactions.find(j=>j.stakeholder_id===r),y=(f=e[w])==null?void 0:f.reactions.find(j=>j.stakeholder_id===r);if(!x)continue;const b=y?Math.abs(y.impact-x.impact)>.05:!1;b&&i++;const N=By(x);o.push({round:w,behavior:N,impact:x.impact,confidence:x.confidence,reaction:x.reaction,wasConstrained:b,originalImpact:b&&y?y.impact:void 0}),w>0&&((p=o[w-1])!=null&&p.wasConstrained)&&a.push(N)}const l=(v=o[0])==null?void 0:v.behavior,c=(g=o[o.length-1])==null?void 0:g.behavior,d=l!==void 0&&c!==void 0&&l!==c,u=o.map(w=>w.impact),m=V5(u);return{agentId:r,steps:o,adapted:d,shift:d?{from:l,to:c}:void 0,timesConstrained:i,postConstraintBehaviors:a,trend:m}})}function V5(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,o=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":o<r-.1?"escalating":o>r+.1?"de-escalating":"stable"}function gl(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[By(i)]++;const o=t.reactions.length;return{round:n,aggressive:o>0?Number((r.aggressive/o).toFixed(3)):0,defensive:o>0?Number((r.defensive/o).toFixed(3)):0,cautious:o>0?Number((r.cautious/o).toFixed(3)):0,cooperative:o>0?Number((r.cooperative/o).toFixed(3)):0,opportunistic:o>0?Number((r.opportunistic/o).toFixed(3)):0,neutral:o>0?Number((r.neutral/o).toFixed(3)):0,total:o}})}function W5(e,t,n){var c;const r=[],o=n.filter(d=>d.adapted);if(o.length>0){const d=o.filter(m=>{var f,p;return((f=m.shift)==null?void 0:f.from)==="aggressive"&&((p=m.shift)==null?void 0:p.to)!=="aggressive"});if(d.length>0){const m=d.map(p=>p.shift.to),f=Pu(m);r.push({type:"agent_adaptation",description:`${d.length} agent(s) shifted from aggressive to ${f} behavior under governance`,detectedAtRound:d[0].steps.findIndex(p=>p.behavior!=="aggressive"),magnitude:d.length/n.length,involvedAgents:d.map(p=>p.agentId)})}const u=o.filter(m=>{var f;return((f=m.shift)==null?void 0:f.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(m=>m.behavior==="cooperative"),magnitude:u.length/n.length,involvedAgents:u.map(m=>m.agentId)})}const i=gl(e),a=gl(t);if(i.length>0&&a.length>0){const d=i.reduce((g,w)=>g+w.aggressive,0)/i.length,u=a.reduce((g,w)=>g+w.aggressive,0)/a.length,m=d-u;m>.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:m,involvedAgents:[]});const f=i.reduce((g,w)=>g+w.cooperative,0)/i.length,p=a.reduce((g,w)=>g+w.cooperative,0)/a.length,v=p-f;v>.1&&r.push({type:"population_shift",description:`Cooperative behavior increased from ${(f*100).toFixed(0)}% to ${(p*100).toFixed(0)}% — governance is creating alignment`,detectedAtRound:0,magnitude:v,involvedAgents:[]})}if(a.length>=3){const d=a[0],u=a[a.length-1],m=d.aggressive-u.aggressive;m>.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(p=>p.aggressive<d.aggressive-.1),magnitude:m,involvedAgents:[]});const f=u.cautious-d.cautious;f>.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(p=>p.cautious>d.cautious+.1),magnitude:f,involvedAgents:[]})}const l=[];for(const d of n)l.push(...d.postConstraintBehaviors);if(l.length>=2){const d=Pu(l),m=l.filter(f=>f===d).length/l.length;m>.4&&r.push({type:"emergent_cluster",description:`After being constrained, ${(m*100).toFixed(0)}% of agents shifted to ${d} behavior — governance is channeling action, not just blocking it`,detectedAtRound:((c=n.find(f=>f.timesConstrained>0))==null?void 0:c.steps.findIndex(f=>f.wasConstrained))??0,magnitude:m,involvedAgents:n.filter(f=>f.timesConstrained>0).map(f=>f.agentId)})}return r}function Pu(e){const t=new Map;for(const o of e)t.set(o,(t.get(o)??0)+1);let n=e[0],r=0;for(const[o,i]of t)i>r&&(n=o,r=i);return n}function U5(e,t){const n=B5(e,t),r=gl(e),o=gl(t),i=W5(e,t,n),a=n.filter(y=>y.adapted).length,l=n.length,c=l>0?Number((a/l).toFixed(2)):0,d=n.flatMap(y=>y.postConstraintBehaviors),u=d.length>0?Pu(d):null,m=r.length>0?r.reduce((y,b)=>y+b.aggressive,0)/r.length:0,f=o.length>0?o.reduce((y,b)=>y+b.aggressive,0)/o.length:0,p=Number(((m-f)*100).toFixed(1)),v=r.length>0?r.reduce((y,b)=>y+b.cooperative,0)/r.length:0,g=o.length>0?o.reduce((y,b)=>y+b.cooperative,0)/o.length:0,w=Number(((g-v)*100).toFixed(1)),x=H5(a,l,p,w,u);return{agentTrajectories:n,baselineDistribution:r,governedDistribution:o,behavioralShifts:i,summary:{agentsAdapted:a,totalAgents:l,adaptationRate:c,dominantPostConstraintBehavior:u,aggressiveReduction:p,cooperativeIncrease:w,headline:x}}}function H5(e,t,n,r,o){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`),o&&o!=="neutral"&&i.push(`blocked agents shifted to ${o}`),i.length===0?"Governance had minimal measurable effect on agent behavior patterns.":i.join(" — ")+"."}function K5(e,t,n,r,o){var c;const i=[],a=[],l=e.map(d=>({...d}));for(const d of t){const u=d.description.toLowerCase();let m=!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 f of l){const p=((c=f.reaction)==null?void 0:c.toLowerCase())??"";if(u.replace(/\b(block|prohibit|prevent|forbid|ban|stop)\b/g,"").trim().split(/\s+/).filter(w=>w.length>2).some(w=>p.includes(w))||f.impact<-.3){const w=f.impact;f.impact=f.impact*.15,f.confidence=Math.max(.1,f.confidence*.4),Math.abs(w-f.impact)>.01&&(m=!0,i.push(`[BLOCK] ${f.stakeholder_id}: "${d.description}" — impact crushed ${w.toFixed(2)} → ${f.impact.toFixed(2)}`))}}if(u.includes("panic")||u.includes("cascade")||u.includes("contagion")||u.includes("runaway")||u.includes("crash")){const f=l.filter(v=>v.impact<-.2).length,p=Math.max(1,Math.floor(l.length*.4));if(f>=p||o<-.2){for(const g of l)g.impact<-.15&&(g.impact,g.impact=g.impact*.3,m=!0);i.push(`[BLOCK] PANIC CIRCUIT BREAKER: "${d.description}" — ${f} 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 f of l)if(Math.abs(f.impact)>.3){const p=f.impact;f.impact=f.impact*.65,Math.abs(p-f.impact)>.01&&(m=!0,i.push(`[PAUSE] ${f.stakeholder_id}: "${d.description}" — dampened ${p.toFixed(2)} → ${f.impact.toFixed(2)}`))}}if(u.includes("floor")||u.includes("maintain")||u.includes("minimum")){for(const f of l)if(f.impact<-.35){const p=f.impact;f.impact=Math.max(f.impact,-.3),p!==f.impact&&(m=!0,i.push(`[BLOCK] ${f.stakeholder_id}: Liquidity floor violated — impact capped ${p.toFixed(2)} → ${f.impact.toFixed(2)} (${d.description})`))}}if(u.includes("leverage")||u.includes("limit")||u.includes("cap")||u.includes("restrict")){for(const f of l)if(f.impact>.45){const p=f.impact;f.impact=Math.min(f.impact,.4),p!==f.impact&&(m=!0,i.push(`[BLOCK] ${f.stakeholder_id}: Leverage limit exceeded — position capped ${p.toFixed(2)} → ${f.impact.toFixed(2)} (${d.description})`))}}if(u.includes("rebalance")||u.includes("equilibrium")||u.includes("correlat")){const f=l.reduce((p,v)=>p+v.impact,0)/l.length;for(const p of l)if(Math.abs(p.impact-f)>.25){const v=p.impact;p.impact=p.impact*.7+f*.3,m=!0,i.push(`[PAUSE] Rebalanced ${p.stakeholder_id}: drift ${v.toFixed(2)} → ${p.impact.toFixed(2)} (${d.description})`)}}if(u.includes("trust")||u.includes("transparen")||u.includes("accountab")){for(const f of l)if(f.impact<-.3){const p=f.impact;f.impact=f.impact*.8,Math.abs(p-f.impact)>.01&&(m=!0,i.push(`[${d.id}] Trust gate dampened ${f.stakeholder_id} hostility: ${p.toFixed(2)} → ${f.impact.toFixed(2)}`))}}a.push({id:d.id,description:d.description,level:"full",fired:m})}for(const d of n){if(d.condition.toLowerCase(),d.severity==="critical"&&(l.reduce((m,f)=>m+Math.abs(f.impact),0)/l.length>.3||o<-.15)){for(const f of l)f.impact,f.impact=f.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 G5(e,t,n,r,o,i,a,l){const c=await Fy(e,t,n,r),d=[],u=[],m=[],f=[];let p=[],v=0;for(const x of c.rounds){if(i&&a)for(const k of x.reactions){const P=F5({...a,scenario:`[Round ${x.round}] ${k.stakeholder_id}: ${k.reaction} (impact: ${k.impact})`});m.push(P),P.status==="BLOCK"?(k.impact=k.impact*.2,k.confidence=Math.max(.1,k.confidence*.5)):P.status==="PAUSE"&&(k.impact=k.impact*.6,k.confidence=Math.max(.2,k.confidence*.7))}const{reactions:y,interventions:b,enforcementLog:N}=K5(x.reactions,o.invariants,o.gates??[],x.round,v);p=[...N];const j=q5(y,b);d.push({round:x.round,reactions:y,emergent_dynamics:j}),u.push(b);const C=y.reduce((k,P)=>k+P.impact,0)/y.length;v=(v*x.round+C)/(x.round+1)}const g=Y5(d),w=Q5(d);return{swarm:{rounds:d,trajectory:g,inflection_points:w},allInterventions:u,guardVerdicts:m,narrativeImpacts:f,enforcementLog:p}}function q5(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 o=e.filter(a=>a.impact>.2).length,i=e.filter(a=>a.impact<-.2).length;return o>0&&i>0&&Math.abs(o-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 Y5(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,o=t.reduce((i,a)=>i+(a-r)**2,0)/t.length;return o>.15?"diverging":Math.abs(n)<.1&&o<.05?"converging":n<-.2?"escalating":"stabilizing"}function Q5(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,o=e[n].reactions.reduce((a,l)=>a+l.impact,0)/e[n].reactions.length,i=Math.abs(o-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 Bh(e){const n=e.rounds.flatMap(p=>p.reactions).map(p=>p.impact),r=n.reduce((p,v)=>p+v,0)/n.length,o=Math.max(...n.map(p=>Math.abs(p))),i=Math.min(...n);let a=0;e.trajectory==="escalating"&&(a+=.35),e.trajectory==="diverging"&&(a+=.25),r<-.3&&(a+=.25),o>.7&&(a+=.15),a=Math.min(.95,a);const l=n.reduce((p,v)=>p+(v-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(p=>p.emergent_dynamics??[]),u=d.filter(p=>p.toLowerCase().includes("coalition")).length,m=d.filter(p=>p.toLowerCase().includes("polariz")).length,f=e.rounds.filter(p=>{const v=p.reactions.reduce((g,w)=>g+w.impact,0)/p.reactions.length;return Math.abs(v)>.4}).length;return{avgImpact:Number(r.toFixed(3)),collapseProbability:Number(a.toFixed(2)),stabilityScore:Number(c.toFixed(2)),coalitionRisks:u,polarizationEvents:m,peakNegativeSentiment:Number(i.toFixed(2)),consensusRounds:f,maxVolatility:Number(o.toFixed(2))}}function X5(e,t,n){const r=[],o=e.collapseProbability-t.collapseProbability;if(o>.1&&r.push(`Collapse probability dropped from ${(e.collapseProbability*100).toFixed(0)}% to ${(t.collapseProbability*100).toFixed(0)}% — a ${(o*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 _u(e,t,n,r){var _,M;const o=(e.stakeholders??[]).map(O=>typeof O=="string"?{id:O,disposition:"unknown"}:O),i=e.swarm??{enabled:!0,rounds:5,reaction_model:"mixed"},a=L5(e,t),l=await Fy(e.scenario,o,n,i),c=Bh(l),{swarm:d,guardVerdicts:u,narrativeImpacts:m,enforcementLog:f}=await G5(e.scenario,o,n,i,t,a,e),p=Bh(d);let v;try{v=z5(a,{steps:5})}catch{}const g=c.collapseProbability-p.collapseProbability,w=p.stabilityScore-c.stabilityScore,x=c.maxVolatility>0?(c.maxVolatility-p.maxVolatility)/c.maxVolatility:0,y=c.coalitionRisks-p.coalitionRisks,b=Math.min(1,Math.max(0,g*.4+w*.3+Math.max(0,x)*.2+Math.max(0,y*.1))),N=X5(c,p,t.thesis),j={allow:0,block:0,pause:0},C=new Set;let k=0;for(const O of u){const A=O.status.toLowerCase();if(A in j&&j[A]++,O.ruleId&&C.add(O.ruleId),(_=O.evidence)!=null&&_.invariantChecks&&(k+=O.evidence.invariantChecks.length),(M=O.evidence)!=null&&M.guardChecks)for(const H of O.evidence.guardChecks)H.triggered&&C.add(H.guardId)}const P=v?v.steps.reduce((O,A)=>O+A.rulesFired,0):0,E={engineLoaded:u.length>0&&u[0].reason!=="NeuroverseOS guard not loaded — permissive fallback",totalEvaluations:u.length,verdicts:j,rulesFired:P,worldCollapsed:(v==null?void 0:v.collapsed)??!1,finalViability:(v==null?void 0:v.finalViability)??"UNKNOWN",invariantsChecked:k,triggeredGuards:[...C]},R=U5(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:p,worldSimulation:v},comparison:{collapseReduction:Number((g*100).toFixed(1)),stabilityImprovement:Number((w*100).toFixed(1)),volatilityReduction:Number((x*100).toFixed(1)),coalitionRiskReduction:y,governanceEffectiveness:Number(b.toFixed(2)),narrative:N},governanceStats:E,enforcementClassification:f.length>0?f:void 0,narrativeImpacts:m.length>0?m:void 0,behavioralAnalysis:R}}const mf="nv-sim-saved-worlds",Ws=[];function ff(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function Vh(e){if(!ff()){const r=Ws.findIndex(o=>o.id===e.id);r>=0?Ws[r]=e:Ws.push(e);return}const t=Kr(),n=t.findIndex(r=>r.id===e.id);n>=0?t[n]={...e,modifiedAt:new Date().toISOString()}:t.push(e),localStorage.setItem(mf,JSON.stringify(t))}function Kr(){if(!ff())return[...Ws];try{const e=localStorage.getItem(mf);return e?JSON.parse(e):[]}catch{return[]}}function Z5(e){return Kr().find(n=>n.id===e)??null}function J5(e){if(!ff()){const r=Ws.findIndex(o=>o.id===e);return r<0?!1:(Ws.splice(r,1),!0)}const t=Kr(),n=t.filter(r=>r.id!==e);return n.length===t.length?!1:(localStorage.setItem(mf,JSON.stringify(n)),!0)}function eR(e){return JSON.stringify(e,null,2)}function tR(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 nR(e,t,n,r){const o=`world_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,i=new Date().toISOString();return{version:"1.0",id:o,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 rR=[{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"}],sR={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 mo(e){const t=e.split(`
|
|
463
|
+
`).filter(o=>o.trim().length>0),n=[];let r=0;for(let o=0;o<t.length;o++){const i=t[o].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 p of rR){for(const v of p.patterns)if(v.test(a)){l=p.category,c=p.enforcement,d=Math.max(d,.7+Math.random()*.25);break}if(d>.7)break}const u=[],m=[],f=a.toLowerCase();for(const[p,v]of Object.entries(sR))for(const g of v)f.includes(g)&&(u.includes(p)||u.push(p),m.includes(g)||m.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:m,sourceLine:o+1})}return{rules:n,summary:{total:n.length,enforced:n.filter(o=>o.enforcement==="structural").length,advisory:n.filter(o=>o.enforcement==="advisory").length},sourceText:e}}function oR(e){const t=[];for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++){const o=e[n],i=e[r],a=o.affectedVariables.filter(l=>i.affectedVariables.includes(l));if(a.length!==0){if(o.category==="prohibit"&&(i.category==="encourage"||i.category==="require")||i.category==="prohibit"&&(o.category==="encourage"||o.category==="require")){t.push({ruleA:o,ruleB:i,type:"direct_conflict",description:`${o.id} ${o.category}s ${a.join(", ")} while ${i.id} ${i.category}s it`});continue}if(o.category===i.category&&a.length>0&&o.description!==i.description){t.push({ruleA:o,ruleB:i,type:"overlap",description:`Both ${o.id} and ${i.id} ${o.category} on "${a.join(", ")}" — may cause redundancy or conflict`});continue}o.affectedVariables.length>i.affectedVariables.length&&i.affectedVariables.every(l=>o.affectedVariables.includes(l))&&t.push({ruleA:o,ruleB:i,type:"subsumption",description:`${o.id} may already cover what ${i.id} specifies — ${i.id} may be redundant`})}}return t}function fo(e){const t=[];let n=0;const r=()=>`POL-${String(++n).padStart(3,"0")}`,o=oR(e.rules);for(const x of o)if(x.type==="direct_conflict"){const b=`Limit ${x.ruleA.affectedVariables.filter(N=>x.ruleB.affectedVariables.includes(N)).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:b,targetLines:[x.ruleA.sourceLine,x.ruleB.sourceLine]}})}else if(x.type==="overlap"){const b=`Limit ${x.ruleA.affectedVariables.filter(N=>x.ruleB.affectedVariables.includes(N)).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:b,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(y=>{const b=y.description.toLowerCase();return b.includes("encourage")||b.includes("promote")?y.description.replace(/\b(encourage|promote)\b/i,"Require"):b.includes("should")?y.description.replace(/\bshould\b/i,"Must"):`Limit ${y.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(y=>y.id),fix:'Add enforceable rules using action verbs: "must", "shall", "limit", "block", "require"',category:"strength",quickFix:{label:"Strengthen enforcement",operation:"insert",text:x.join(`
|
|
464
|
+
`)}})}else if(e.summary.enforced<e.summary.total*.3&&e.rules.length>2){const x=e.rules.find(b=>b.enforcement==="advisory"),y=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(b=>b.enforcement==="advisory").map(b=>b.id),fix:"Strengthen advisory rules with specific thresholds and action verbs",category:"strength",quickFix:x?{label:"Strengthen weakest rule",operation:"replace",text:y,targetLines:[x.sourceLine]}:{label:"Add enforced rule",operation:"insert",text:y}})}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
|
|
465
|
+
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(y=>{switch(y){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 ${y} 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(y=>y.charAt(0).toUpperCase()+y.slice(1)).join(", ")}`,category:"coverage",quickFix:{label:`Add ${u.length} coverage rule${u.length>1?"s":""}`,operation:"insert",text:x.join(`
|
|
466
|
+
`)}})}const m=e.rules.filter(x=>x.confidence<.5);if(m.length>0){const x=m[0],y=`Require ${x.affectedVariables[0]??"compliance"} controls to prevent ${x.keywords[0]??"violations"}`;t.push({id:r(),severity:"hint",message:`${m.length} rule(s) parsed with low confidence`,detail:"Some lines were difficult to classify. They may be descriptions rather than actionable rules.",relatedRules:m.map(b=>b.id),fix:"Rephrase ambiguous rules with clear action verbs and specific thresholds",category:"structure",quickFix:{label:"Rephrase ambiguous rule",operation:"replace",text:y,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
|
|
467
|
+
Limit maximum leverage to 5x
|
|
468
|
+
Halt automated trading when volatility exceeds critical threshold
|
|
469
|
+
Maintain minimum liquidity floor at 15% of baseline
|
|
470
|
+
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 p={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},v=p.errors>0&&e.rules.length===0,g=Math.max(0,100-p.errors*25-p.warnings*10-p.info*3-p.hints*1);let w;return p.errors>0&&v?w="critical":p.errors>0?w="errors":p.warnings>0?w="warnings":w="healthy",{status:w,diagnostics:t,counts:p,canSimulate:e.rules.length>0,healthScore:g}}function iR(e,t){const n=e.split(`
|
|
471
|
+
`);switch(t.operation){case"insert":return e.trimEnd()+`
|
|
472
|
+
`+t.text;case"replace":{if(!t.targetLines||t.targetLines.length===0)return e;const r=[...t.targetLines].sort((a,l)=>a-l),o=[];let i=!1;for(let a=0;a<n.length;a++){const l=a+1;r.includes(l)?i||(o.push(t.text),i=!0):o.push(n[a])}return o.join(`
|
|
473
|
+
`)}case"remove":return!t.targetLines||t.targetLines.length===0?e:n.filter((r,o)=>!t.targetLines.includes(o+1)).join(`
|
|
474
|
+
`);default:return e}}function xl(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 m=u[1]?parseFloat(u[1]):null,f=u[2]?parseFloat(u[2]):null,p=u[3]?parseFloat(u[3]):null,v=d.affectedVariables[0];m!==null?n.set(v,{value:m,direction:"below",ruleDesc:d.description}):f!==null?n.set(v,{value:f,direction:"above",ruleDesc:d.description}):p!==null&&n.set(v,{value:p,direction:"above",ruleDesc:d.description})}}const o=[...new Set(e.rules.flatMap(d=>d.affectedVariables))].map(d=>{const u=n.get(d),m=vl[d];if(m)return{...m};const f=u?Math.max(100,u.value*2):100,p=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:f},default_value:Math.min(p,f)}}),i=[];let a=0;for(const[d,u]of n.entries()){a++;const m=((c=vl[d])==null?void 0:c.id)??`${d}_index`,f=u.direction==="below"?`${m} < ${u.value}`:`${m} > ${u.value}`;i.push({id:`GATE-${String(a).padStart(3,"0")}`,label:`${d.charAt(0).toUpperCase()+d.slice(1).replace(/_/g," ")} Threshold`,condition:f,severity:"warning"})}for(const d of e.rules)(d.category==="circuit_breaker"||d.category==="prohibit")&&(d.affectedVariables.some(m=>n.has(m))||(a++,i.push({id:`GATE-${String(a).padStart(3,"0")}`,label:d.description.slice(0,60),condition:lR(d),severity:d.category==="circuit_breaker"?"critical":"warning"})));return{thesis:aR(e),state_variables:o,invariants:t,gates:i}}const vl={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 aR(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))],o=n.slice(0,4).map(c=>{const d=vl[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=o.length>0?` across ${o.join(", ")}`:"";return`This world ${a}${l} — ${t.length} rule${t.length>1?"s":""} governing agent behavior to maintain system integrity`}function lR(e){const t=e.affectedVariables;return t.length===0?"system_stress > 80":t.map(n=>{const r=vl[n],o=(r==null?void 0:r.id)??`${n}_index`;return["diversity","stability","trust","quality","compliance","transparency","liquidity"].includes(n)?`${o} < 20`:`${o} > 80`}).join(" || ")}function cR(){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 dR(){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 uR(e,t={}){const n=mo(e),r=fo(n),o=xl(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??cR(),l=dR(),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 _u(c,o,l),u=mR(d),m=fR(d,n,u);return{policy:n,healthCheck:r,comparison:d,impact:u,explanation:m}}function mR(e,t){const n=e.baseline.metrics,r=e.governed.metrics,o=e.governanceStats,i=(r.stabilityScore-n.stabilityScore)*100,a=(r.collapseProbability-n.collapseProbability)*-100,l=e.governed.swarm.rounds.reduce((m,f)=>m+f.reactions.length,0),c=o.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:o.totalEvaluations,actionsBlocked:Number(d.toFixed(1)),preventedCollapse:n.collapseProbability>.5&&r.collapseProbability<.3,overConstraintScore:Number(u.toFixed(2))}}function fR(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 o=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 o.length>0&&r.push(`Circuit breaker rules (${o.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 pR(e,t,n){return pf({policyText:n,worldState:t}).evaluate(e,t)}function pf(e){let t=mo(e.policyText),n=fo(t),r=xl(t);const o=e.sensitivity??.5,i=e.auditTrail??null,a={totalEvaluations:0,allowed:0,blocked:0,modified:0,paused:0,rewarded:0,penalized:0,rulesFired:0},l=new Map;function c(v){return l.has(v)||l.set(v,{agentId:v,cooldownRemaining:0,influence:1,rewardMultiplier:1,totalPenalties:0,totalRewards:0}),l.get(v)}function d(v,g){a.totalEvaluations++;const w=c(v.agentId);if(w.cooldownRemaining>0)return w.cooldownRemaining--,a.penalized++,{status:"PENALIZE",action:null,reason:`Agent frozen: ${w.cooldownRemaining+1} round(s) remaining on cooldown`,rulesFired:[],confidence:1,timestamp:Date.now(),consequence:{type:"cooldown",rounds:w.cooldownRemaining+1,description:"Agent still in cooldown period"}};const x=[];let y=v.magnitude,b=!1,N=null,j=null;for(const _ of r.invariants){if(!_.enforceable){yR(_.description,v)?(j={inv:_,reward:{type:"boost_influence",magnitude:.1,description:_.description}},x.push({id:_.id,description:_.description,effect:"rewarded",impactReduction:0})):x.push({id:_.id,description:_.description,effect:"monitored",impactReduction:0});continue}if(vR(_.description,v)){N={inv:_,consequence:{type:"freeze",rounds:1,magnitude:.5,description:_.description}},x.push({id:_.id,description:_.description,effect:"penalized",impactReduction:1});continue}const M=hR(_,v,y,g,o);M&&(x.push(M),y=v.magnitude*(1-M.impactReduction),b=!0)}for(const _ of r.gates??[]){const M=gR(_,v,y,g);M&&(x.push(M),y=y*(1-M.impactReduction),b=!0)}if(N){a.penalized++,a.rulesFired++;const _=N.consequence;w.totalPenalties++,w.cooldownRemaining=_.rounds??1,w.influence=Math.max(0,w.influence-(_.magnitude??.2));const M={status:"PENALIZE",action:null,reason:Mo("penalized",v,x),rulesFired:x,confidence:rd(x,1),timestamp:Date.now(),consequence:_};return i&&i.logVerdict({agent:v.agentId,action:v.description,actionType:v.type,verdict:"BLOCK",reason:M.reason,confidence:M.confidence,rulesFired:x.map(O=>({id:O.id,description:O.description,effect:O.effect,impactReduction:O.impactReduction}))}),M}if(j&&!b){a.rewarded++,a.rulesFired++;const _=j.reward;w.totalRewards++,w.influence=Math.min(2,w.influence+(_.magnitude??.1)),w.rewardMultiplier=Math.min(3,w.rewardMultiplier+.05);const M={status:"REWARD",action:v,reason:Mo("rewarded",v,x),rulesFired:x,confidence:rd(x,0),timestamp:Date.now(),reward:_};return i&&i.logVerdict({agent:v.agentId,action:v.description,actionType:v.type,verdict:"ALLOW",reason:M.reason,confidence:M.confidence,rulesFired:x.map(O=>({id:O.id,description:O.description,effect:O.effect,impactReduction:O.impactReduction}))}),M}a.rulesFired+=x.filter(_=>_.effect!=="monitored").length;const C=1-y/Math.max(v.magnitude,.001);let k,P,E;C>.85?(k="BLOCK",P=Mo("blocked",v,x),E=null,a.blocked++):C>.5?(k="PAUSE",P=Mo("paused",v,x),E={...v,magnitude:Number(y.toFixed(3))},a.paused++):b&&C>.05?(k="MODIFY",P=Mo("modified",v,x),E={...v,magnitude:Number(y.toFixed(3))},a.modified++):(k="ALLOW",P=x.length>0?`Allowed — ${x.filter(_=>_.effect==="monitored").length} advisory rule(s) noted`:"Allowed — no rules apply to this action",E=v,a.allowed++);const R={status:k,action:E,reason:P,rulesFired:x,confidence:rd(x,C),timestamp:Date.now()};return i&&i.logVerdict({agent:v.agentId,action:v.description,actionType:v.type,verdict:k==="MODIFY"?"MODIFY":k,reason:P,confidence:R.confidence,rulesFired:x.map(_=>({id:_.id,description:_.description,effect:_.effect,impactReduction:_.impactReduction}))}),R}function u(v,g){return v.map(w=>d(w,g))}function m(v){t=mo(v),n=fo(t),r=xl(t)}function f(){for(const[,v]of l)v.cooldownRemaining=Math.max(0,v.cooldownRemaining-1)}function p(){return l}return{evaluate:d,evaluateBatch:u,updatePolicy:m,tickCooldowns:f,getAgentStates:p,get policy(){return{ruleCount:t.summary.total,enforcedCount:t.summary.enforced,advisoryCount:t.summary.advisory,healthScore:n.healthScore}},get stats(){return{...a}}}}function hR(e,t,n,r,o){const i=e.description.toLowerCase(),a=t.description.toLowerCase(),l=t.type.toLowerCase(),c=.6-o*.3;if(Tn(i,["block","prohibit","prevent","forbid","ban","stop","halt"])){const u=hf(i,["block","prohibit","prevent","forbid","ban","stop","halt"]).some(f=>a.includes(f)||l.includes(f)),m=t.magnitude>c;if(u||m)return{id:e.id,description:e.description,effect:"blocked",impactReduction:.85+o*.1}}return Tn(i,["panic","cascade","contagion","crash","circuit","emergency","runaway"])&&(r?Vy(r):t.magnitude>.6)&&t.magnitude>c*.8?{id:e.id,description:e.description,effect:"blocked",impactReduction:.7+o*.2}:Tn(i,["slow","cool","gradual","dampen","reduce volatility","moderate"])&&t.magnitude>c?{id:e.id,description:e.description,effect:"dampened",impactReduction:.35+o*.15}:Tn(i,["floor","maintain","minimum","at least","no less"])&&t.magnitude>.4&&xR(i,a)?{id:e.id,description:e.description,effect:"capped",impactReduction:Math.min(.5,t.magnitude-.3)}:Tn(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)}:Tn(i,["rebalance","equilibrium","balance","correlat","diversif"])&&t.magnitude>.5?{id:e.id,description:e.description,effect:"rebalanced",impactReduction:.3*o}:Tn(i,["transparency","report","monitor","audit","disclose","accountab"])&&t.magnitude>.3?{id:e.id,description:e.description,effect:"monitored",impactReduction:0}:null}function gR(e,t,n,r){return e.severity==="critical"&&(r?Vy(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 Tn(e,t){return t.some(n=>e.includes(n))}function hf(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 xR(e,t){return e.split(/\s+/).filter(r=>r.length>3).some(r=>t.includes(r))}function Vy(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 rd(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 Mo(e,t,n){const r=n.filter(a=>a.effect!=="monitored");if(r.length===0)return`${bR(e)} due to aggregate policy thresholds`;const o=r[0],i=r.length>1?` (+${r.length-1} more)`:"";switch(e){case"blocked":return`Blocked by "${o.description}"${i} — action "${t.description}" violates governance constraints`;case"paused":return`Paused by "${o.description}"${i} — action "${t.description}" requires review`;case"modified":return`Modified by "${o.description}"${i} — magnitude reduced from ${t.magnitude.toFixed(2)} to stay within policy limits`;case"penalized":return`Penalized by "${o.description}"${i} — agent "${t.agentId}" frozen for violating governance`;case"rewarded":return`Rewarded by "${o.description}"${i} — agent "${t.agentId}" demonstrated compliant behavior`}}function vR(e,t){const n=e.toLowerCase(),r=t.description.toLowerCase(),o=t.type.toLowerCase();return Tn(n,["penalize","freeze","suspend","cooldown","punish","sanction"])?hf(n,["penalize","freeze","suspend","cooldown","punish","sanction"]).some(a=>r.includes(a)||o.includes(a)):!1}function yR(e,t){const n=e.toLowerCase(),r=t.description.toLowerCase(),o=t.type.toLowerCase();return Tn(n,["reward","boost","incentivize","encourage","promote","prioritize"])?hf(n,["reward","boost","incentivize","encourage","promote","prioritize"]).some(a=>r.includes(a)||o.includes(a)):!1}function bR(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Wh=[{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}}],sd={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 wR(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 NR(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},o={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:o[e.regulatory_climate??"neutral"]??50}}function jR(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",o=e.regulatoryClimate>=80?"adversarial":e.regulatoryClimate>=60?"strict":e.regulatoryClimate>=35?"neutral":"permissive";return{severity:t,environmental_hostility:n,time_pressure:r,regulatory_climate:o}}const SR=Object.entries(uo).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:wR(e),defaultSliders:NR(t.assumptions)}));function kR(e){return e==="critical"||e==="high"?"high":e==="moderate"?"medium":"low"}function CR(e){var o;const t=e.analysis.paths,r=(o=[...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:o.id;return t.map(i=>({name:i.label,description:i.description,probability:Math.round(i.probability*100),riskLevel:kR(i.risk),tradeoffs:[...i.tradeoffs],recommended:i.id===r}))}function ER(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),o=n.length>0?n:["Stakeholder A","Stakeholder B","Stakeholder C"],i=o.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:o,reactions:i}}function RR(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 PR(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 _R(e){return e.analysis.recommendations.map(t=>({priority:t.priority,action:t.action,rationale:t.rationale,timeframe:t.timeframe}))}function AR(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 TR(e){var f;const t=e.analysis.paths,n=e.analysis.assumption_challenges,r=t.filter(p=>p.risk==="high"||p.risk==="critical").length,o=t.reduce((p,v)=>p+v.probability,0)/Math.max(t.length,1),i=(f=e.governance)==null?void 0:f.neuroverse,a=i==null?void 0:i.world_health_score,l=i==null?void 0:i.collapse_risk;let c="medium",d;const m=o-(l==="high"?.15:l==="moderate"?.08:0);return n.length<=1&&r===0&&m>.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||m<.3?(c="low",d=`High uncertainty: ${n.length} assumptions challenged, ${r} high-risk paths, average probability ${(o*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 IR(e,t){var r,o,i,a,l,c;const n=[];return(r=e.assumptions)!=null&&r.severity&&n.push({text:`Severity is ${e.assumptions.severity}`,source:"caller"}),(o=e.assumptions)!=null&&o.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 MR(e,t){return{paths:CR(e),matrix:ER(e),outcomes:RR(e),challenges:PR(e),recommendations:_R(e),governance:AR(e),confidence:TR(e),keyAssumptions:IR(t),goalResult:e.goal_reasoning,mode:e.mode,lastRequest:t}}async function LR(e,t,n){var m;const r=typeof e=="string"?e:((m=uo[e.id])==null?void 0:m.scenario)??e.description,o=jR(t),i=typeof e=="object"?e.id:void 0,a=i?uo[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:o,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=`${window.location.protocol}//${window.location.hostname}:3456/api/v1/reason`;let u;try{u=await(await fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json()}catch(f){console.error("Failed to reach governance server:",f),u={status:"error"}}return u.status==="error"?{paths:[],matrix:{strategies:[],stakeholders:[],reactions:[]},outcomes:[],challenges:[],recommendations:[]}:MR(u,c)}function Wy(e){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{const n=JSON.parse(t);return OR(n)?"agent_swarm":"generic_json"}catch{}return $R(t)?"anylogic_csv":DR(t)?"netlogo":FR(t)?"mesa":"freeform_text"}function OR(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 $R(e){const t=e.split(`
|
|
475
|
+
`).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()),o=t[1].split(","),i=r.some(l=>/^[a-zA-Z_]/.test(l)),a=o.some(l=>!isNaN(Number(l.trim())));return i&&a&&r.length>=2}function DR(e){const t=e.split(`
|
|
476
|
+
`).filter(a=>a.trim()),n=/^[\w-]+\s*:\s*.+$/,r=/tick|step|round|iteration/i,o=t.filter(a=>n.test(a.trim())).length,i=t.some(a=>r.test(a));return o>=3&&o>=t.length*.5||o>=2&&i}function FR(e){const t=e.split(`
|
|
477
|
+
`).filter(o=>o.trim()),n=/^(?:agent|player|entity)\s+\d+\s*:\s*.+$/i,r=t.filter(o=>n.test(o.trim())).length;return r>=2&&r>=t.length*.3}function zR(e){switch(Wy(e)){case"agent_swarm":return BR(e);case"netlogo":return VR(e);case"mesa":return WR(e);case"anylogic_csv":return UR(e);case"generic_json":return HR(e);case"freeform_text":return KR(e)}}function BR(e){const t=JSON.parse(e.trim()),n=[],r=[],o=[],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:Uy(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:m,step:f,round:p,tick:v,...g}=u;a.push({time:m??f??p??v??a.length,state:g})}}if(t.steps&&Array.isArray(t.steps))for(const u of t.steps){const m=u.step??u.round??a.length;if(u.actions&&Array.isArray(u.actions))for(const f of u.actions)r.push({time:m,agents:f.agent?[f.agent]:void 0,action:f.action||f.type||JSON.stringify(f),effect:f.result||f.effect,category:"action"})}for(const[u,m]of Object.entries(t))typeof m=="number"&&!["version","seed","id"].includes(u)&&i.push({name:ls(u),value:m});return{sourceFormat:"agent_swarm",agents:n,events:r,stateChanges:o,coalitions:l,metrics:i,timeline:a,emergentBehaviors:d.length>0?d:void 0,summary:t.summary||t.description}}function VR(e){const t=e.split(`
|
|
478
|
+
`).filter(l=>l.trim()),n=[],r=[],o=[];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 f=u[1].trim(),p=u[2].trim(),v=parseFloat(p.replace("%",""));if(isNaN(v))o.push({id:f,type:"entity",state:p});else{const g=p.includes("%");n.push({name:ls(f),value:g?v/100:v,unit:g?"%":void 0}),r.push({variable:f,to:g?v/100:v,time:i})}continue}const m=c.match(/^([\w-]+)\s+([-\d.]+%?)$/);if(m){const f=parseFloat(m[2].replace("%",""));isNaN(f)||n.push({name:ls(m[1]),value:m[2].includes("%")?f/100:f,unit:m[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&&!o.some(d=>d.type===c[0].toLowerCase())&&o.push({id:c[0].toLowerCase(),type:c[0].toLowerCase(),attributes:{[l.name]:l.value}})}return{sourceFormat:"netlogo",agents:o,events:[],stateChanges:r,coalitions:[],metrics:n,timeline:i!==void 0?[{time:i,state:Object.fromEntries(n.map(l=>[l.name,l.value]))}]:[]}}function WR(e){const t=e.split(`
|
|
479
|
+
`).filter(i=>i.trim()),n=[],r=[],o=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(o.has(d))o.get(d).action=u;else{const m={id:`agent_${d}`,type:"agent",action:u};o.set(d,m),n.push(m)}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(!o.has(d)){const m={id:d,type:yl(d),action:u};o.set(d,m),n.push(m)}r.push({agents:[d],action:u,category:"action"})}}return{sourceFormat:"mesa",agents:n,events:r,stateChanges:[],coalitions:[],metrics:[],timeline:[]}}function UR(e){var d;const t=e.split(`
|
|
480
|
+
`).filter(u=>u.trim());if(t.length<2)return GR("anylogic_csv");const n=t[0].split(",").map(u=>u.trim().replace(/^["']|["']$/g,"")),r=[],o=[],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 m=t[u].split(",").map(v=>v.trim().replace(/^["']|["']$/g,""));if(m.length<n.length)continue;const f=a>=0?isNaN(Number(m[a]))?m[a]:Number(m[a]):u,p={};for(let v=0;v<n.length;v++){if(v===a)continue;const g=m[v],w=Number(g);p[n[v]]=isNaN(w)?g:w,isNaN(w)||(i.has(n[v])||i.set(n[v],[]),i.get(n[v]).push({time:f,value:w}))}r.push({time:f,state:p})}for(const[u,m]of i){const f=m[m.length-1].value,p=m[0].value,v=m.length<2?"stable":f>p*1.05?"rising":f<p*.95?"falling":"stable";o.push({name:ls(u),value:f,trend:v,series:m})}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 f=(d=r[r.length-1])==null?void 0:d.state;l.push({id:u,type:yl(u),attributes:f?{value:f[u]}:void 0})}return{sourceFormat:"anylogic_csv",agents:l,events:[],stateChanges:[],coalitions:[],metrics:o,timeline:r}}function HR(e){const t=JSON.parse(e.trim()),n=[],r=[],o=[],i=[],a=[],l=[];function c(d,u=""){if(Array.isArray(d)){if(d.length>0&&typeof d[0]=="object"&&d[0]!==null){const m=d[0];if(m.id||m.name||m.agent||m.type){for(const f of d){const p=f;n.push({id:String(p.id||p.name||p.agent||`${u}_${n.length}`),type:String(p.type||p.role||p.class||"agent"),state:p.state?String(p.state):void 0,action:p.action?String(p.action):p.reaction?String(p.reaction):void 0,attributes:Uy(p,["id","name","agent","type","role","class","state","action","reaction"])})}return}if(m.time||m.step||m.tick){for(const f of d){const p=f,v=p.time??p.step??p.tick??a.length,g={};for(const[w,x]of Object.entries(p))["time","step","tick"].includes(w)||(typeof x=="number"||typeof x=="string"||typeof x=="boolean")&&(g[w]=x);a.push({time:v,state:g})}return}if(m.action||m.event){for(const f of d){const p=f;r.push({agents:p.agent?[String(p.agent)]:p.agents?p.agents:void 0,action:String(p.action||p.event||p.type||"unknown"),effect:p.effect?String(p.effect):p.result?String(p.result):void 0,time:p.time??p.step,category:"action"})}return}}}else if(typeof d=="object"&&d!==null)for(const[m,f]of Object.entries(d))typeof f=="number"?o.push({name:ls(m),value:f}):typeof f=="object"&&c(f,u?`${u}.${m}`:m)}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 m=u;l.push({name:String(m.name||`coalition_${l.length}`),members:Array.isArray(m.members)?m.members.map(String):[],objective:m.objective?String(m.objective):void 0,strength:typeof m.strength=="number"?m.strength:void 0})}for(const[u,m]of Object.entries(d))["agents","events","timeline","coalitions"].includes(u)||(typeof m=="number"?o.push({name:ls(u),value:m}):typeof m=="object"&&m!==null&&c(m,u))}return{sourceFormat:"generic_json",agents:n,events:r,stateChanges:i,coalitions:l,metrics:o,timeline:a,summary:typeof t.summary=="string"?t.summary:void 0}}function KR(e){const t=e.trim(),n=[],r=[],o=[],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 m of i){let f;for(;(f=m.exec(t))!==null;){const p=f[1].trim();p.length>1&&p.length<25&&!Uh(p)&&!a.has(p.toLowerCase())&&(a.add(p.toLowerCase()),n.push({id:p,type:yl(p)}))}}const l=/(\w[\w\s]{1,20}?)\s*(?::|—)\s*(.+?)(?:\n|$)/g;let c;for(;(c=l.exec(t))!==null;){const m=c[1].trim(),f=c[2].trim();!Uh(m)&&f.length>2&&(r.push({agents:[m],action:f,category:"action"}),a.has(m.toLowerCase())||(a.add(m.toLowerCase()),n.push({id:m,type:yl(m),action:f})))}const d=/(\w[\w\s]{1,30}?)\s*(?:=|:)\s*([-\d.]+%?)/g;let u;for(;(u=d.exec(t))!==null;){const m=u[1].trim(),f=u[2],p=parseFloat(f.replace("%",""));!isNaN(p)&&m.length>1&&o.push({name:ls(m),value:f.includes("%")?p/100:p,unit:f.includes("%")?"%":void 0})}return{sourceFormat:"freeform_text",agents:n,events:r,stateChanges:[],coalitions:[],metrics:o,timeline:[],summary:t.length>200?t.slice(0,200)+"...":t}}function GR(e){return{sourceFormat:e,agents:[],events:[],stateChanges:[],coalitions:[],metrics:[],timeline:[]}}function ls(e){return e.replace(/[-_]/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function yl(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 Uh(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 Uy(e,t){const n={};let r=0;for(const[o,i]of Object.entries(e))t.includes(o)||(typeof i=="string"||typeof i=="number"||typeof i=="boolean")&&(n[o]=i,r++);return r>0?n:void 0}const Hy={agent_swarm:"Agent Swarm",netlogo:"NetLogo",mesa:"Mesa (Python)",anylogic_csv:"AnyLogic / CSV",generic_json:"JSON",freeform_text:"Text"};function qR(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 YR(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 QR(e){let t=e;return()=>(t=(t*16807+0)%2147483647,t/2147483647)}function XR(e){const t=zR(e),n=t.sourceFormat,r=qR(t),o=YR(e),i=QR(o),a=t.emergentBehaviors&&t.emergentBehaviors.length>0?t.emergentBehaviors.map((w,x)=>({name:w.length>40?w.slice(0,40)+"...":w,description:w,strength:["strong","moderate","weak"][Math.min(x,2)],agents:r.filter(()=>i()>.4)})):ZR(r,i),l=t.agents.length>0?t.agents.slice(0,8).map(w=>({agent:w.id,strategy:w.action||w.state||"Adaptive",rationale:w.action?`Agent exhibits "${w.action}" behavior based on simulation data`:"Strategy inferred from simulation context",effectiveness:Math.round(40+i()*55)})):JR(r,i),c=t.coalitions.length>0?t.coalitions.map(w=>({name:w.name,members:w.members,sharedObjective:w.objective||"Coordinated strategy",cohesion:w.strength??Math.round(50+i()*45)})):e4(r,i),d=t4(r,i),u=n4(r,i),m=r4(r,i),f=s4(r,m,i),p=o4(i),v=i4(r,i),g=a4(r,m);return{patterns:a,agentStrategies:l,coalitions:c,powerDynamics:d,equilibrium:u,paths:m,matrix:f,outcomes:p,challenges:v,recommendations:g,detectedFormat:n,formatLabel:Hy[n],normalized:t}}function ZR(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),o=["strong","moderate","weak"];return n.slice(0,r).map(i=>({...i,strength:o[Math.floor(t()*3)],agents:e.filter(()=>t()>.4)}))}function JR(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 o=Math.floor(t()*n.length);return{agent:r,strategy:n[o].strategy,rationale:n[o].rationale,effectiveness:Math.round(40+t()*55)}})}function e4(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"],o=[...e].sort(()=>t()-.5),i=Math.floor(o.length/2);return n.push({name:"Primary Coalition",members:o.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:o.slice(i+1),sharedObjective:r[Math.floor(t()*r.length)],cohesion:Math.round(30+t()*50)}),n}function t4(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(o=>{const i=n[Math.floor(t()*n.length)],a=r[i];return{agent:o,role:i,influence:Math.round(20+t()*75),description:a[Math.floor(t()*a.length)]}})}function n4(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)],o=t()>.4;return{isStable:o,type:r.type,description:r.description,stabilityScore:Math.round(o?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 r4(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 o=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 o.forEach(i=>{i.probability=Math.round(i.probability/r*100)}),o}function s4(e,t,n){const r=t.slice(0,3).map(i=>i.name),o=e.map(()=>r.map(()=>{const i=n();return i>.55?"positive":i>.25?"neutral":"negative"}));return{strategies:r,stakeholders:e,reactions:o}}function o4(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 i4(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 a4(e,t,n){const r=t.find(o=>o.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 Hh="neuroverse_theme";function gf(){const[e,t]=h.useState(()=>typeof window<"u"&&localStorage.getItem(Hh)||"dark");h.useEffect(()=>{const r=document.documentElement;e==="light"?r.classList.add("light"):r.classList.remove("light"),localStorage.setItem(Hh,e)},[e]);const n=h.useCallback(()=>{t(r=>r==="dark"?"light":"dark")},[]);return{theme:e,toggle:n}}const l4=Ql("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"}}),Z=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const a=r?Ok:"button";return s.jsx(a,{className:I(l4({variant:t,size:n,className:e})),ref:i,...o})});Z.displayName="Button";const c4=({showSimulatedFuture:e,theme:t,onToggleTheme:n,isSimulating:r})=>s.jsx("header",{className:"fixed top-0 left-0 right-0 z-50 border-b border-border bg-background/80 backdrop-blur-md",children:s.jsxs("div",{className:"container mx-auto flex items-center justify-between px-6 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-lg font-bold tracking-tight text-foreground",children:"NeuroVerse"}),s.jsx("span",{className:"text-[10px] text-muted-foreground tracking-wider hidden sm:inline",children:"Governed Discovery"})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[(r||e)&&s.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[s.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:[s.jsx(ul,{className:"h-3 w-3 text-emerald-400 animate-pulse"}),s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.15em] text-emerald-400",children:"Simulation Active"})]}),s.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:[s.jsx(ul,{className:"h-3 w-3 text-violet-400 animate-pulse"}),s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.15em] text-violet-400",children:"Governed by NeuroVerse"})]})]}),n&&s.jsx(Z,{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"?s.jsx(Bv,{className:"h-4 w-4 text-muted-foreground hover:text-foreground transition-colors"}):s.jsx(Dv,{className:"h-4 w-4 text-muted-foreground hover:text-foreground transition-colors"})}),s.jsx("div",{className:"hidden text-right md:block",children:e?s.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary animate-pulse",children:"SIMULATED FUTURE"}):s.jsx("p",{className:"text-xs text-muted-foreground tracking-wider",children:"Define what matters. Agents do the rest."})})]})]})}),d4=({governance:e})=>{const t=e==null?void 0:e.neuroverse;return s.jsx("footer",{className:"border-t border-border py-8",children:s.jsxs("div",{className:"container mx-auto px-6",children:[e&&s.jsxs("div",{className:"mx-auto mb-6 max-w-3xl space-y-3",children:[s.jsx("div",{className:"rounded-lg border border-border bg-card/50 px-5 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ma,{className:"h-4 w-4 text-primary"}),s.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[s.jsxs("span",{children:["Authority: ",s.jsx("span",{className:"text-foreground font-medium",children:e.authorityLevel.replace(/_/g," ")})]}),s.jsxs("span",{children:[e.constitutionalChecks.length," rules checked"]}),s.jsxs("span",{children:["Trace: ",s.jsx("span",{className:"font-mono",children:e.traceId.slice(0,12)})]})]})]})}),t&&s.jsx("div",{className:"rounded-lg border border-border bg-card/50 px-5 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Lr,{className:"h-4 w-4 text-primary"}),s.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[s.jsxs("span",{children:["Governance: ",s.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&&s.jsxs("span",{children:["Status: ",s.jsx("span",{className:"text-foreground font-medium",children:t.worldViability})]}),t.rulesFired!==void 0&&s.jsxs("span",{children:[t.rulesFired," rules applied"]}),t.collapseRisk&&t.collapseRisk!=="none"&&s.jsxs("span",{children:["System risk: ",s.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&&s.jsxs("span",{children:["Stability: ",t.worldHealthScore,"%"]})]})]})})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"mb-2 text-sm text-muted-foreground",children:"Powered by a governed multi-agent simulation engine"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"We simulate, enforce rules, and analyze results."})]})]})})},u4={dark:{swarm:"#1B5E7B",reasoning:"#5BC0BE",future:"#ffffff"},light:{swarm:"#134A5E",reasoning:"#2D8B88",future:"#0F3A4A"}},Kh=40,Gh=7,qh=3;function od(e,t,n,r,o){if(n==="reasoning")return{x:e/(o+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 m4(e,t,n){const{x:r,y:o,size:i,vx:a,vy:l,opacity:c}=t,d=Math.atan2(l,a);e.save(),e.translate(r,o),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 f4=()=>{const{theme:e}=gf(),t=h.useRef(null),n=h.useRef([]),r=h.useRef(0),[o]=h.useState({width:400,height:320}),i=u4[e];return h.useEffect(()=>{const{width:a,height:l}=o,c=[];for(let f=0;f<Kh;f++)c.push(od(a,l,"swarm",f,Kh));for(let f=0;f<Gh;f++)c.push(od(a,l,"reasoning",f,Gh));for(let f=0;f<qh;f++)c.push(od(a,l,"future",f,qh));n.current=c;const d=a*.45,u=l*.5;function m(){const f=t.current;if(!f)return;const p=f.getContext("2d");if(p){p.clearRect(0,0,a,l);for(const v of n.current){if(v.type==="swarm"){const w=d-v.x,x=u-v.y,y=Math.sqrt(w*w+x*x),b=60+Math.sin(Date.now()*.001+v.x)*30;v.vx+=w*3e-4,v.vy+=x*3e-4,v.vx+=-x*2e-4,v.vy+=w*2e-4,y<b&&(v.vx-=w*5e-4,v.vy-=x*5e-4),v.vx+=(Math.random()-.5)*.02,v.vy+=(Math.random()-.5)*.02,v.vx*=.99,v.vy*=.99}v.type==="reasoning"&&(v.vy+=(u-v.y)*.01,v.vy*=.95,v.vx=Math.max(.2,v.vx),v.x>a+20&&(v.x=-20)),v.type==="future"&&(v.vx=Math.max(.3,v.vx),v.x>a+20&&(v.x=a*.7,v.y=u+(Math.random()-.5)*50)),v.x+=v.vx,v.y+=v.vy,v.type==="swarm"&&(v.x<10&&(v.vx+=.1),v.x>a-10&&(v.vx-=.1),v.y<10&&(v.vy+=.1),v.y>l-10&&(v.vy-=.1));const g=v.type==="reasoning"?i.reasoning:v.type==="future"?i.future:i.swarm;m4(p,v,g)}r.current=requestAnimationFrame(m)}}return m(),()=>cancelAnimationFrame(r.current)},[o]),s.jsxs("div",{className:"relative",children:[s.jsx("canvas",{ref:t,width:o.width,height:o.height,className:"rounded-xl",style:{maxWidth:"100%",height:"auto"}}),s.jsx("div",{className:"absolute bottom-3 right-3",children:s.jsx("span",{className:"rounded bg-background/60 px-2 py-1 text-[10px] font-mono text-muted-foreground backdrop-blur",children:"LIVE SWARM"})})]})},p4=({onRunScenario:e,onPasteSimulation:t})=>s.jsx("section",{className:"relative overflow-hidden py-20 md:py-32",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"grid items-center gap-12 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"mb-4 text-4xl font-bold tracking-tight text-foreground md:text-6xl lg:text-7xl",children:["Change the rules.",s.jsx("br",{}),s.jsx("span",{className:"text-primary",children:"See why the system changed."})]}),s.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."}),s.jsxs("div",{className:"flex flex-wrap gap-4",children:[s.jsxs(Z,{size:"lg",className:"px-8 py-6 text-base font-semibold tracking-wider",onClick:e,children:[s.jsx(Li,{className:"mr-2 h-4 w-4"}),"START SIMULATION"]}),s.jsxs(Z,{size:"lg",variant:"outline",className:"px-8 py-6 text-base font-semibold tracking-wider",onClick:t,children:[s.jsx(Pr,{className:"mr-2 h-4 w-4"}),"LOAD DATA"]})]}),s.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."})]}),s.jsx("div",{className:"flex items-center justify-center",children:s.jsx(f4,{})})]})})}),ft=h.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:I("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}));ft.displayName="Input";const pe=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:I("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));pe.displayName="Card";const Pe=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:I("flex flex-col space-y-1.5 p-6",e),...t}));Pe.displayName="CardHeader";const _e=h.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:I("text-2xl font-semibold leading-none tracking-tight",e),...t}));_e.displayName="CardTitle";const h4=h.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:I("text-sm text-muted-foreground",e),...t}));h4.displayName="CardDescription";const he=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:I("p-6 pt-0",e),...t}));he.displayName="CardContent";const g4=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:I("flex items-center p-6 pt-0",e),...t}));g4.displayName="CardFooter";const x4=Ql("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 ce({className:e,variant:t,...n}){return s.jsx("div",{className:I(x4({variant:t}),e),...n})}const v4=[{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"}]}],y4=({onFullAnalysis:e})=>{const[t,n]=h.useState("Gas prices spike to $5/gallon"),[r,o]=h.useState("Stabilize prices under $3 within 6 months"),[i,a]=h.useState(!1),[l,c]=h.useState(null),[d,u]=h.useState(null),m=h.useCallback(()=>{a(!0),c(null),u(null)},[]),f={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 s.jsx("section",{className:"border-t border-border py-16 md:py-24",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"mx-auto max-w-3xl",children:[s.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"TRY IT NOW"}),s.jsx("p",{className:"mb-8 text-center text-muted-foreground",children:"Describe a situation and desired outcome. See what strategies emerge."}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Current Situation"}),s.jsx(ft,{value:t,onChange:p=>n(p.target.value),className:"text-sm",placeholder:"What's happening?"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"mb-1.5 block text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Desired Outcome"}),s.jsx(ft,{value:r,onChange:p=>o(p.target.value),className:"text-sm",placeholder:"Where do you want to end up?"})]}),s.jsxs("div",{className:"flex gap-3 pt-2",children:[s.jsx(Z,{className:"px-8 py-5 text-sm font-semibold tracking-wider",onClick:m,children:"FIND SOLUTIONS"}),i&&e&&s.jsxs(Z,{variant:"outline",className:"px-6 py-5 text-sm font-semibold tracking-wider",onClick:()=>e(t,r),children:["FULL REPORT ",s.jsx(Is,{className:"ml-1.5 h-4 w-4"})]})]})]}),i&&s.jsx("div",{className:"mt-10 space-y-4 animate-in fade-in-0 slide-in-from-bottom-4 duration-500",children:v4.map((p,v)=>s.jsxs(pe,{className:"border-border overflow-hidden",children:[s.jsx(Pe,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(_e,{className:"text-base",children:p.name}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ce,{className:I("text-xs font-mono",f[p.risk]),children:[p.risk," risk"]}),s.jsxs("span",{className:"text-lg font-bold text-primary",children:[p.probability,"%"]})]})]})}),s.jsxs(he,{children:[s.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:p.summary}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(Z,{size:"sm",variant:"ghost",className:"text-xs",onClick:()=>c(l===v?null:v),children:[s.jsx(at,{className:I("mr-1 h-3 w-3 transition-transform",l===v&&"rotate-180")}),"SHOW WHY"]}),s.jsxs(Z,{size:"sm",variant:"ghost",className:"text-xs",onClick:()=>u(d===v?null:v),children:[s.jsx(Xl,{className:"mr-1 h-3 w-3"}),"TIMELINE"]}),s.jsxs(Z,{size:"sm",variant:"ghost",className:"text-xs",children:[s.jsx(Ym,{className:"mr-1 h-3 w-3"}),"MODIFY"]})]}),l===v&&s.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:[s.jsx("h4",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Key Drivers"}),s.jsx("ul",{className:"space-y-1.5",children:p.drivers.map((g,w)=>s.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[s.jsx("span",{className:"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),g]},w))})]}),d===v&&s.jsx("div",{className:"mt-4 animate-in fade-in-0 slide-in-from-top-2",children:s.jsx("div",{className:"relative ml-3 border-l-2 border-primary/30 pl-6 space-y-4",children:p.timeline.map((g,w)=>s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute -left-[31px] top-1 h-3 w-3 rounded-full border-2 border-primary bg-background"}),s.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:g.period}),s.jsx("div",{className:"text-sm text-foreground",children:g.action}),s.jsx("div",{className:"text-xs text-muted-foreground",children:g.effect})]},w))})})]})]},v))})]})})})},$i=h.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:I("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}));$i.displayName="Textarea";const b4=({onExplain:e,isLoading:t})=>{const[n,r]=h.useState(""),o=h.useMemo(()=>{if(!n.trim()||n.trim().length<10)return null;try{const i=Wy(n);return{format:i,label:Hy[i]}}catch{return null}},[n]);return s.jsx("section",{className:"py-16 md:py-24",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[s.jsx("h2",{className:"mb-2 text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"ANALYZE RESULTS"}),s.jsx("h3",{className:"mb-3 text-3xl font-bold tracking-tight text-foreground md:text-4xl",children:"Upload Simulation Data"}),s.jsxs("p",{className:"mb-8 text-muted-foreground",children:["Paste results from any simulation tool — we auto-detect the format.",s.jsx("br",{}),s.jsx("span",{className:"text-xs",children:"JSON, CSV, key-value, or plain text supported."})]}),s.jsxs("div",{className:"relative rounded-lg border border-border bg-card p-1",children:[s.jsx($i,{placeholder:`Paste simulation results here...
|
|
481
|
+
|
|
482
|
+
Supported formats:
|
|
483
|
+
• JSON (agents, behaviors, metrics)
|
|
484
|
+
• CSV (time series, variable columns)
|
|
485
|
+
• Key-value logs (step: value)
|
|
486
|
+
• 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)}),o&&s.jsx("div",{className:"absolute bottom-3 right-3",children:s.jsxs(ce,{variant:"outline",className:"text-[10px] uppercase tracking-wider",children:["Detected: ",o.label]})})]}),s.jsx(Z,{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 xf="Progress",vf=100,[w4,Y3]=Bt(xf),[N4,j4]=w4(xf),Ky=h.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=S4,...a}=e;(o||o===0)&&!Yh(o)&&console.error(k4(`${o}`,"Progress"));const l=Yh(o)?o:vf;r!==null&&!Qh(r,l)&&console.error(C4(`${r}`,"Progress"));const c=Qh(r,l)?r:null,d=bl(c)?i(c,l):void 0;return s.jsx(N4,{scope:n,value:c,max:l,children:s.jsx(J.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":bl(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":Yy(c,l),"data-value":c??void 0,"data-max":l,...a,ref:t})})});Ky.displayName=xf;var Gy="ProgressIndicator",qy=h.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=j4(Gy,n);return s.jsx(J.div,{"data-state":Yy(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});qy.displayName=Gy;function S4(e,t){return`${Math.round(e/t*100)}%`}function Yy(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function bl(e){return typeof e=="number"}function Yh(e){return bl(e)&&!isNaN(e)&&e>0}function Qh(e,t){return bl(e)&&!isNaN(e)&&e<=t&&e>=0}function k4(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${vf}\`.`}function C4(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
487
|
+
- a positive number
|
|
488
|
+
- less than the value passed to \`max\` (or ${vf} if no \`max\` prop is set)
|
|
489
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
490
|
+
|
|
491
|
+
Defaulting to \`null\`.`}var Qy=Ky,E4=qy;const Bo=h.forwardRef(({className:e,value:t,...n},r)=>s.jsx(Qy,{ref:r,className:I("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(E4,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Bo.displayName=Qy.displayName;const R4={strong:"bg-primary text-primary-foreground",moderate:"bg-secondary text-secondary-foreground",weak:"bg-muted text-muted-foreground"},P4={driver:"bg-primary text-primary-foreground",reactor:"bg-secondary text-secondary-foreground",stabilizer:"bg-accent text-accent-foreground",disruptor:"bg-destructive text-destructive-foreground"},_4=({result:e})=>s.jsxs("section",{className:"space-y-12 py-12",children:[s.jsxs("div",{className:"container mx-auto px-6",children:[s.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Emergent Patterns"}),s.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.patterns.map((t,n)=>s.jsxs(pe,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:[s.jsx(Pe,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(_e,{className:"text-base",children:t.name}),s.jsx(ce,{className:R4[t.strength],children:t.strength})]})}),s.jsxs(he,{children:[s.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:t.description}),s.jsx("div",{className:"flex flex-wrap gap-1",children:t.agents.map((r,o)=>s.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:r},o))})]})]},n))})]}),s.jsxs("div",{className:"container mx-auto px-6",children:[s.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Dominant Strategies per Agent"}),s.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.agentStrategies.map((t,n)=>s.jsx(pe,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*80}ms`},children:s.jsxs(he,{className:"pt-6",children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("span",{className:"font-semibold text-foreground",children:t.agent}),s.jsxs("span",{className:"text-sm text-primary",children:[t.effectiveness,"% effective"]})]}),s.jsx("p",{className:"mb-1 text-sm font-medium text-foreground",children:t.strategy}),s.jsx("p",{className:"text-xs text-muted-foreground",children:t.rationale}),s.jsx(Bo,{value:t.effectiveness,className:"mt-3 h-1.5"})]})},n))})]}),s.jsxs("div",{className:"container mx-auto px-6",children:[s.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Coalition Detection"}),s.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.coalitions.map((t,n)=>s.jsxs(pe,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:[s.jsx(Pe,{className:"pb-3",children:s.jsx(_e,{className:"text-base",children:t.name})}),s.jsxs(he,{children:[s.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:t.sharedObjective}),s.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:t.members.map((r,o)=>s.jsx(ce,{variant:"outline",className:"text-xs",children:r},o))}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Cohesion"}),s.jsx(Bo,{value:t.cohesion,className:"h-1.5 flex-1"}),s.jsxs("span",{className:"text-xs text-primary",children:[t.cohesion,"%"]})]})]})]},n))})]}),s.jsxs("div",{className:"container mx-auto px-6",children:[s.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Power Dynamics"}),s.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.powerDynamics.map((t,n)=>s.jsx(pe,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*80}ms`},children:s.jsxs(he,{className:"pt-6",children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("span",{className:"font-semibold text-foreground",children:t.agent}),s.jsx(ce,{className:P4[t.role],children:t.role})]}),s.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:t.description}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Influence"}),s.jsx(Bo,{value:t.influence,className:"h-1.5 flex-1"}),s.jsxs("span",{className:"text-xs text-primary",children:[t.influence,"%"]})]})]})},n))})]}),s.jsxs("div",{className:"container mx-auto px-6",children:[s.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Equilibrium Analysis"}),s.jsx(pe,{className:"border-border",children:s.jsxs(he,{className:"pt-6",children:[s.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[s.jsx(ce,{className:e.equilibrium.isStable?"bg-primary text-primary-foreground":"bg-destructive text-destructive-foreground",children:e.equilibrium.isStable?"Stable":"Unstable"}),s.jsx("span",{className:"text-lg font-semibold text-foreground",children:e.equilibrium.type})]}),s.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:e.equilibrium.description}),s.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Stability Score"}),s.jsx(Bo,{value:e.equilibrium.stabilityScore,className:"h-2 flex-1"}),s.jsxs("span",{className:"text-sm font-medium text-primary",children:[e.equilibrium.stabilityScore,"%"]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-2 text-sm font-medium text-foreground",children:"Vulnerabilities:"}),s.jsx("ul",{className:"space-y-1",children:e.equilibrium.vulnerabilities.map((t,n)=>s.jsxs("li",{className:"flex items-start gap-2 text-sm text-muted-foreground",children:[s.jsx("span",{className:"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-destructive"}),t]},n))})]})]})})]})]}),Xh=[{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"}],A4=[{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"}],T4=()=>s.jsx("section",{className:"border-t border-border py-16 md:py-24",children:s.jsxs("div",{className:"container mx-auto px-6",children:[s.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"HOW IT WORKS"}),s.jsx("p",{className:"mb-12 text-center text-lg text-muted-foreground",children:"From scenario to insight in five steps"}),s.jsx("div",{className:"mx-auto max-w-sm",children:Xh.map((e,t)=>s.jsxs("div",{children:[s.jsxs("div",{className:"rounded-lg border border-border bg-card px-5 py-4 text-center",children:[s.jsx("div",{className:`text-sm font-bold tracking-wider ${e.color}`,children:e.label}),s.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:e.description})]}),t<Xh.length-1&&s.jsx("div",{className:"flex justify-center py-2",children:s.jsx(R2,{className:"h-4 w-4 text-primary/50"})})]},e.label))}),s.jsx("div",{className:"mx-auto mt-16 grid max-w-3xl gap-8 md:grid-cols-3",children:A4.map(e=>s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"mb-2 text-2xl font-bold tracking-tight text-foreground",children:e.word}),s.jsx("div",{className:"text-sm text-muted-foreground",children:e.description})]},e.word))})]})}),I4=`{
|
|
492
|
+
"actor": "agent_1",
|
|
493
|
+
"action": "publish_result",
|
|
494
|
+
"world": "protein_discovery",
|
|
495
|
+
"context": {
|
|
496
|
+
"confidence": 0.45,
|
|
497
|
+
"sources_count": 1,
|
|
498
|
+
"reproduced": false
|
|
499
|
+
}
|
|
500
|
+
}`,M4=`{
|
|
501
|
+
"decision": "BLOCK",
|
|
502
|
+
"reason": "Confidence below 70% threshold",
|
|
503
|
+
"rule_id": "exclude-low-confidence",
|
|
504
|
+
"evidence": {
|
|
505
|
+
"condition": "result.confidence < 0.7",
|
|
506
|
+
"actual_value": 0.45,
|
|
507
|
+
"source": "exclude"
|
|
508
|
+
},
|
|
509
|
+
"modified_action": null
|
|
510
|
+
}`,L4=`// Define your world in plain language → AI generates this
|
|
511
|
+
{
|
|
512
|
+
"world": {
|
|
513
|
+
"name": "Protein Discovery",
|
|
514
|
+
"thesis": "Governed investigation of binding mutations"
|
|
515
|
+
},
|
|
516
|
+
"rules": [
|
|
517
|
+
{
|
|
518
|
+
"source": "exclude",
|
|
519
|
+
"ruleType": "BLOCK",
|
|
520
|
+
"condition": { "field": "result.confidence", "operator": "<", "value": 0.7 },
|
|
521
|
+
"effect": "Block publication"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"source": "experiment",
|
|
525
|
+
"ruleType": "REWARD",
|
|
526
|
+
"condition": { "field": "result.sources_count", "operator": ">=", "value": 3 },
|
|
527
|
+
"effect": "boost_influence for 3 rounds"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"source": "experiment",
|
|
531
|
+
"ruleType": "PENALIZE",
|
|
532
|
+
"condition": { "field": "agent.behavior", "operator": "matches", "value": "publish without peer validation" },
|
|
533
|
+
"effect": "reduce_influence for 3 rounds"
|
|
534
|
+
}
|
|
535
|
+
],
|
|
536
|
+
"invariants": [
|
|
537
|
+
{ "id": "INV-001", "label": "No unverified claims published" }
|
|
538
|
+
]
|
|
539
|
+
}`,O4=`import { govern, createGovernor } from "@neuroverseos/governance"
|
|
540
|
+
|
|
541
|
+
// One-shot evaluation
|
|
542
|
+
const verdict = govern(action, worldState, policyText)
|
|
543
|
+
|
|
544
|
+
// Or create a reusable governor
|
|
545
|
+
const gov = createGovernor({ policyText: myPolicy })
|
|
546
|
+
const result = gov.evaluate(action)
|
|
547
|
+
|
|
548
|
+
// result.status: "ALLOW" | "BLOCK" | "MODIFY" | "PAUSE" | "REWARD" | "PENALIZE"
|
|
549
|
+
// result.reason: "Confidence below 70% threshold"
|
|
550
|
+
// result.consequence?: { type: "freeze", rounds: 3 }
|
|
551
|
+
// result.reward?: { type: "boost_influence", magnitude: 2 }`,$4=()=>s.jsx("section",{className:"border-t border-border py-16 md:py-24",children:s.jsxs("div",{className:"container mx-auto px-6",children:[s.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"OPEN SOURCE — BUILD WITH US"}),s.jsx("p",{className:"mb-4 text-center text-lg text-muted-foreground",children:"Everything here is built on open-source governance tools you can use today."}),s.jsxs("p",{className:"mb-8 text-center text-sm text-muted-foreground/70",children:["World files, guard evaluation, simulation, validation — all from ",s.jsx("code",{className:"text-primary",children:"@neuroverseos/governance"}),"."]}),s.jsxs("div",{className:"mx-auto max-w-4xl mb-12 flex flex-wrap items-center justify-center gap-3",children:[s.jsxs("a",{href:"https://www.npmjs.com/org/neuroverseos",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 rounded-full border border-primary/30 bg-primary/5 px-4 py-2 text-xs font-semibold text-primary hover:bg-primary/10 transition-colors",children:["npm: @neuroverseos",s.jsx(Jo,{className:"h-3 w-3"})]}),s.jsxs("a",{href:"https://github.com/NeuroverseOS",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 rounded-full border border-border bg-card px-4 py-2 text-xs font-semibold text-foreground hover:bg-muted transition-colors",children:["GitHub: NeuroverseOS",s.jsx(Jo,{className:"h-3 w-3"})]})]}),s.jsxs("div",{className:"mx-auto max-w-4xl space-y-8",children:[s.jsxs("div",{children:[s.jsx("div",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:'World File — what "Build World" generates'}),s.jsx("pre",{className:"overflow-auto rounded-lg border border-border bg-card p-4 text-xs text-foreground max-h-[300px]",children:s.jsx("code",{children:L4})}),s.jsx("p",{className:"mt-2 text-[11px] text-muted-foreground",children:"This is a NeuroverseOS World Definition. Scientists describe intent in plain language → AI translates into this structure → governance engine enforces it."})]}),s.jsxs("div",{children:[s.jsx("div",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"JavaScript/TypeScript — integrate in any agent system"}),s.jsx("pre",{className:"overflow-auto rounded-lg border border-border bg-card p-4 text-xs text-foreground",children:s.jsx("code",{children:O4})})]}),s.jsx("div",{className:"mb-4 rounded-md bg-card border border-border px-4 py-2",children:s.jsx("code",{className:"text-sm font-bold text-primary",children:"POST /api/evaluate"})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Request"}),s.jsx("pre",{className:"overflow-auto rounded-lg border border-border bg-card p-4 text-xs text-foreground",children:s.jsx("code",{children:I4})})]}),s.jsxs("div",{children:[s.jsx("div",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Response"}),s.jsx("pre",{className:"overflow-auto rounded-lg border border-border bg-card p-4 text-xs text-foreground",children:s.jsx("code",{children:M4})})]})]}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-3 lg:grid-cols-6",children:[s.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-3 text-center",children:[s.jsx("div",{className:"mb-1 text-sm font-bold text-red-400",children:"BLOCK"}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Action stopped"})]}),s.jsxs("div",{className:"rounded-lg border border-yellow-500/20 bg-yellow-500/5 p-3 text-center",children:[s.jsx("div",{className:"mb-1 text-sm font-bold text-yellow-400",children:"MODIFY"}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Action constrained"})]}),s.jsxs("div",{className:"rounded-lg border border-orange-500/20 bg-orange-500/5 p-3 text-center",children:[s.jsx("div",{className:"mb-1 text-sm font-bold text-orange-400",children:"PAUSE"}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Action held"})]}),s.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 p-3 text-center",children:[s.jsx("div",{className:"mb-1 text-sm font-bold text-green-400",children:"ALLOW"}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Action proceeds"})]}),s.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/5 p-3 text-center",children:[s.jsx("div",{className:"mb-1 text-sm font-bold text-emerald-400",children:"REWARD"}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Agent boosted"})]}),s.jsxs("div",{className:"rounded-lg border border-violet-500/20 bg-violet-500/5 p-3 text-center",children:[s.jsx("div",{className:"mb-1 text-sm font-bold text-violet-400",children:"PENALIZE"}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Agent dampened"})]})]}),s.jsxs("div",{className:"rounded-xl border border-primary/20 bg-primary/5 p-5 space-y-3",children:[s.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"How this tool is built"}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-foreground font-semibold",children:"World Builder"})," → translates plain language into NeuroverseOS World Definition files using AI"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-foreground font-semibold",children:"Guard Engine"})," → ",s.jsx("code",{className:"text-primary",children:"evaluateGuard()"})," from @neuroverseos/governance evaluates every action deterministically"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-foreground font-semibold",children:"Simulation"})," → ",s.jsx("code",{className:"text-primary",children:"simulateWorld()"})," runs deterministic state evolution through rules and gates"]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-foreground font-semibold",children:"Validation"})," → ",s.jsx("code",{className:"text-primary",children:"validateWorld()"})," checks world health, invariant coverage, and governance completeness"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-foreground font-semibold",children:"Incentive System"})," → REWARD/PENALIZE verdicts with consequences (freeze, cooldown, boost_influence) tracked per-agent"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-foreground font-semibold",children:"Audit Trail"})," → every governance decision is traced with full evidence for reproducibility"]})]})]})]}),s.jsx("div",{className:"mt-4 text-center text-xs text-muted-foreground",children:"Stateless. Deterministic. Open source. Works with any agent system."})]})]})}),D4=[{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"]}],F4=({onSelect:e})=>s.jsx("section",{className:"border-t border-border py-16 md:py-24",children:s.jsxs("div",{className:"container mx-auto px-6",children:[s.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"EXAMPLE SCENARIOS"}),s.jsx("p",{className:"mb-12 text-center text-lg text-muted-foreground",children:"Click to load a scenario capsule and start exploring"}),s.jsx("div",{className:"mx-auto grid max-w-5xl gap-4 sm:grid-cols-2 lg:grid-cols-3",children:D4.map(t=>s.jsxs(pe,{className:"cursor-pointer border-border transition-all duration-200 hover:border-primary/50 hover:glow-teal",onClick:()=>e(t.title,t.description),children:[s.jsx(Pe,{className:"pb-2",children:s.jsx(_e,{className:"text-base",children:t.title})}),s.jsxs(he,{children:[s.jsx("p",{className:"mb-3 text-xs text-muted-foreground leading-relaxed",children:t.description}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.tags.map(n=>s.jsx(ce,{variant:"outline",className:"text-[10px] uppercase tracking-wider",children:n},n))})]})]},t.title))})]})}),z4=({onSelectScenario:e,onCustomScenario:t,onCalculate:n,selectedId:r,customText:o,isLoading:i,hasScenario:a})=>s.jsx("section",{className:"py-16 md:py-24",children:s.jsxs("div",{className:"container mx-auto px-6",children:[s.jsxs("div",{className:"mx-auto max-w-4xl text-center",children:[s.jsx("h1",{className:"mb-3 text-3xl font-bold tracking-tight text-foreground md:text-5xl",children:"Choose a scenario."}),s.jsx("p",{className:"mb-12 text-lg text-muted-foreground",children:"Pick a preset or describe your own situation to begin"})]}),s.jsx("div",{className:"mx-auto grid max-w-5xl gap-4 md:grid-cols-3",children:SR.map(l=>s.jsxs(pe,{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:[s.jsx(Pe,{className:"pb-3",children:s.jsx(_e,{className:"text-base leading-tight",children:l.title})}),s.jsxs(he,{children:[s.jsx("p",{className:"mb-3 text-xs text-muted-foreground leading-relaxed",children:l.description}),s.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:l.tags.map(c=>s.jsx(ce,{variant:"outline",className:"text-[10px] uppercase tracking-wider",children:c},c))}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.stakeholderCount," participants"]})]})]},l.id))}),s.jsxs("div",{className:"mx-auto mt-8 max-w-3xl",children:[s.jsx("div",{className:"rounded-lg border border-border bg-card p-1",children:s.jsx($i,{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:o,onChange:l=>t(l.target.value)})}),s.jsx("div",{className:"mt-6 text-center",children:s.jsx(Z,{className:"px-12 py-6 text-base font-semibold tracking-wider",onClick:n,disabled:!a||i,children:i?"RUNNING...":"RUN SIMULATION"})})]})]})});function ji(e,[t,n]){return Math.min(n,Math.max(t,e))}var B4=h.createContext(void 0);function Di(e){const t=h.useContext(B4);return e||t||"ltr"}function yf(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 Xy=["PageUp","PageDown"],Zy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Jy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},No="Slider",[Au,V4,W4]=Kl(No),[eb,Q3]=Bt(No,[W4]),[U4,cc]=eb(No),tb=h.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[r],value:u,onValueChange:m=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:v,...g}=e,w=h.useRef(new Set),x=h.useRef(0),b=a==="horizontal"?H4:K4,[N=[],j]=Rr({prop:u,defaultProp:d,onChange:_=>{var O;(O=[...w.current][x.current])==null||O.focus(),m(_)}}),C=h.useRef(N);function k(_){const M=X4(N,_);R(_,M)}function P(_){R(_,x.current)}function E(){const _=C.current[x.current];N[x.current]!==_&&f(N)}function R(_,M,{commit:O}={commit:!1}){const A=tP(i),H=nP(Math.round((_-r)/i)*i+r,A),z=ji(H,[r,o]);j((U=[])=>{const T=Y4(U,z,M);if(eP(T,c*i)){x.current=T.indexOf(z);const L=String(T)!==String(U);return L&&O&&f(T),L?T:U}else return U})}return s.jsx(U4,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:o,valueIndexToChangeRef:x,thumbs:w.current,values:N,orientation:a,form:v,children:s.jsx(Au.Provider,{scope:e.__scopeSlider,children:s.jsx(Au.Slot,{scope:e.__scopeSlider,children:s.jsx(b,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:X(g.onPointerDown,()=>{l||(C.current=N)}),min:r,max:o,inverted:p,onSlideStart:l?void 0:k,onSlideMove:l?void 0:P,onSlideEnd:l?void 0:E,onHomeKeyDown:()=>!l&&R(r,0,{commit:!0}),onEndKeyDown:()=>!l&&R(o,N.length-1,{commit:!0}),onStepKeyDown:({event:_,direction:M})=>{if(!l){const H=Xy.includes(_.key)||_.shiftKey&&Zy.includes(_.key)?10:1,z=x.current,U=N[z],T=i*H*M;R(U+T,z,{commit:!0})}}})})})})});tb.displayName=No;var[nb,rb]=eb(No,{startEdge:"left",endEdge:"right",size:"width",direction:1}),H4=h.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...u}=e,[m,f]=h.useState(null),p=le(t,b=>f(b)),v=h.useRef(void 0),g=Di(o),w=g==="ltr",x=w&&!i||!w&&i;function y(b){const N=v.current||m.getBoundingClientRect(),j=[0,N.width],k=bf(j,x?[n,r]:[r,n]);return v.current=N,k(b-N.left)}return s.jsx(nb,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:s.jsx(sb,{dir:g,"data-orientation":"horizontal",...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const N=y(b.clientX);a==null||a(N)},onSlideMove:b=>{const N=y(b.clientX);l==null||l(N)},onSlideEnd:()=>{v.current=void 0,c==null||c()},onStepKeyDown:b=>{const j=Jy[x?"from-left":"from-right"].includes(b.key);d==null||d({event:b,direction:j?-1:1})}})})}),K4=h.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...d}=e,u=h.useRef(null),m=le(t,u),f=h.useRef(void 0),p=!o;function v(g){const w=f.current||u.current.getBoundingClientRect(),x=[0,w.height],b=bf(x,p?[r,n]:[n,r]);return f.current=w,b(g-w.top)}return s.jsx(nb,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:s.jsx(sb,{"data-orientation":"vertical",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const w=v(g.clientY);i==null||i(w)},onSlideMove:g=>{const w=v(g.clientY);a==null||a(w)},onSlideEnd:()=>{f.current=void 0,l==null||l()},onStepKeyDown:g=>{const x=Jy[p?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:x?-1:1})}})})}),sb=h.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:l,onStepKeyDown:c,...d}=e,u=cc(No,n);return s.jsx(J.span,{...d,ref:t,onKeyDown:X(e.onKeyDown,m=>{m.key==="Home"?(a(m),m.preventDefault()):m.key==="End"?(l(m),m.preventDefault()):Xy.concat(Zy).includes(m.key)&&(c(m),m.preventDefault())}),onPointerDown:X(e.onPointerDown,m=>{const f=m.target;f.setPointerCapture(m.pointerId),m.preventDefault(),u.thumbs.has(f)?f.focus():r(m)}),onPointerMove:X(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&o(m)}),onPointerUp:X(e.onPointerUp,m=>{const f=m.target;f.hasPointerCapture(m.pointerId)&&(f.releasePointerCapture(m.pointerId),i(m))})})}),ob="SliderTrack",ib=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=cc(ob,n);return s.jsx(J.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});ib.displayName=ob;var Tu="SliderRange",ab=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=cc(Tu,n),i=rb(Tu,n),a=h.useRef(null),l=le(t,a),c=o.values.length,d=o.values.map(f=>db(f,o.min,o.max)),u=c>1?Math.min(...d):0,m=100-Math.max(...d);return s.jsx(J.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:l,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:m+"%"}})});ab.displayName=Tu;var Iu="SliderThumb",lb=h.forwardRef((e,t)=>{const n=V4(e.__scopeSlider),[r,o]=h.useState(null),i=le(t,l=>o(l)),a=h.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return s.jsx(G4,{...e,ref:i,index:a})}),G4=h.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=cc(Iu,n),l=rb(Iu,n),[c,d]=h.useState(null),u=le(t,y=>d(y)),m=c?a.form||!!c.closest("form"):!0,f=af(c),p=a.values[r],v=p===void 0?0:db(p,a.min,a.max),g=Q4(r,a.values.length),w=f==null?void 0:f[l.size],x=w?Z4(w,v,l.direction):0;return h.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${v}% + ${x}px)`},children:[s.jsx(Au.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(J.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":a.min,"aria-valuenow":p,"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:p===void 0?{display:"none"}:e.style,onFocus:X(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),m&&s.jsx(cb,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:p},r)]})});lb.displayName=Iu;var q4="RadioBubbleInput",cb=h.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=h.useRef(null),i=le(o,r),a=yf(t);return h.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const m=new Event("input",{bubbles:!0});u.call(l,t),l.dispatchEvent(m)}},[a,t]),s.jsx(J.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});cb.displayName=q4;function Y4(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function db(e,t,n){const i=100/(n-t)*(e-t);return ji(i,[0,100])}function Q4(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function X4(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function Z4(e,t,n){const r=e/2,i=bf([0,50],[0,r]);return(r-i(t)*n)*n}function J4(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function eP(e,t){if(t>0){const n=J4(e);return Math.min(...n)>=t}return!0}function bf(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 tP(e){return(String(e).split(".")[1]||"").length}function nP(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var ub=tb,rP=ib,sP=ab,oP=lb;const wf=h.forwardRef(({className:e,...t},n)=>s.jsxs(ub,{ref:n,className:I("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(rP,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(sP,{className:"absolute h-full bg-primary"})}),s.jsx(oP,{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"})]}));wf.displayName=ub.displayName;const iP=[{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"}],aP=({values:e,onChange:t,showRecalculate:n,onRecalculate:r})=>{const o=(i,a)=>{t({...e,[i]:a[0]})};return s.jsxs(pe,{className:"border-border",children:[s.jsx(Pe,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(_e,{className:"text-base",children:"Assumptions"}),n&&s.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"})]})}),s.jsx(he,{children:s.jsx("div",{className:"space-y-6",children:iP.map(i=>s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("label",{className:"text-sm font-medium text-foreground",children:i.label}),s.jsx("span",{className:"text-sm font-mono text-primary",children:e[i.key]})]}),s.jsx(wf,{value:[e[i.key]],onValueChange:a=>o(i.key,a),min:0,max:100,step:1}),s.jsxs("div",{className:"mt-1 flex justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:i.low}),s.jsx("span",{className:"text-xs text-muted-foreground",children:i.high})]})]},i.key))})})]})};var id=0;function lP(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Zh()),document.body.insertAdjacentElement("beforeend",e[1]??Zh()),id++,()=>{id===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),id--}},[])}function Zh(){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 ad="focusScope.autoFocusOnMount",ld="focusScope.autoFocusOnUnmount",Jh={bubbles:!1,cancelable:!0},cP="FocusScope",mb=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,c]=h.useState(null),d=Be(o),u=Be(i),m=h.useRef(null),f=le(t,g=>c(g)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let g=function(b){if(p.paused||!l)return;const N=b.target;l.contains(N)?m.current=N:sr(m.current,{select:!0})},w=function(b){if(p.paused||!l)return;const N=b.relatedTarget;N!==null&&(l.contains(N)||sr(m.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const j of b)j.removedNodes.length>0&&sr(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",w);const y=new MutationObserver(x);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",w),y.disconnect()}}},[r,l,p.paused]),h.useEffect(()=>{if(l){tg.add(p);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(ad,Jh);l.addEventListener(ad,d),l.dispatchEvent(x),x.defaultPrevented||(dP(hP(fb(l)),{select:!0}),document.activeElement===g&&sr(l))}return()=>{l.removeEventListener(ad,d),setTimeout(()=>{const x=new CustomEvent(ld,Jh);l.addEventListener(ld,u),l.dispatchEvent(x),x.defaultPrevented||sr(g??document.body,{select:!0}),l.removeEventListener(ld,u),tg.remove(p)},0)}}},[l,d,u,p]);const v=h.useCallback(g=>{if(!n&&!r||p.paused)return;const w=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(w&&x){const y=g.currentTarget,[b,N]=uP(y);b&&N?!g.shiftKey&&x===N?(g.preventDefault(),n&&sr(b,{select:!0})):g.shiftKey&&x===b&&(g.preventDefault(),n&&sr(N,{select:!0})):x===y&&g.preventDefault()}},[n,r,p.paused]);return s.jsx(J.div,{tabIndex:-1,...a,ref:f,onKeyDown:v})});mb.displayName=cP;function dP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(sr(r,{select:t}),document.activeElement!==n)return}function uP(e){const t=fb(e),n=eg(t,e),r=eg(t.reverse(),e);return[n,r]}function fb(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function eg(e,t){for(const n of e)if(!mP(n,{upTo:t}))return n}function mP(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 fP(e){return e instanceof HTMLInputElement&&"select"in e}function sr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&fP(e)&&t&&e.select()}}var tg=pP();function pP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ng(e,t),e.unshift(t)},remove(t){var n;e=ng(e,t),(n=e[0])==null||n.resume()}}}function ng(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function hP(e){return e.filter(t=>t.tagName!=="A")}var gP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xs=new WeakMap,ma=new WeakMap,fa={},cd=0,pb=function(e){return e&&(e.host||pb(e.parentNode))},xP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=pb(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})},vP=function(e,t,n,r){var o=xP(t,Array.isArray(e)?e:[e]);fa[n]||(fa[n]=new WeakMap);var i=fa[n],a=[],l=new Set,c=new Set(o),d=function(m){!m||l.has(m)||(l.add(m),d(m.parentNode))};o.forEach(d);var u=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(f){if(l.has(f))u(f);else try{var p=f.getAttribute(r),v=p!==null&&p!=="false",g=(xs.get(f)||0)+1,w=(i.get(f)||0)+1;xs.set(f,g),i.set(f,w),a.push(f),g===1&&v&&ma.set(f,!0),w===1&&f.setAttribute(n,"true"),v||f.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",f,x)}})};return u(t),l.clear(),cd++,function(){a.forEach(function(m){var f=xs.get(m)-1,p=i.get(m)-1;xs.set(m,f),i.set(m,p),f||(ma.has(m)||m.removeAttribute(r),ma.delete(m)),p||m.removeAttribute(n)}),cd--,cd||(xs=new WeakMap,xs=new WeakMap,ma=new WeakMap,fa={})}},yP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=gP(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),vP(r,o,n,"aria-hidden")):function(){return null}},yn=function(){return yn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},yn.apply(this,arguments)};function hb(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function bP(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;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 Oa="right-scroll-bar-position",$a="width-before-scroll-bar",wP="with-scroll-bars-hidden",NP="--removed-body-scroll-bar-size";function dd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function jP(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var SP=typeof window<"u"?h.useLayoutEffect:h.useEffect,rg=new WeakMap;function kP(e,t){var n=jP(null,function(r){return e.forEach(function(o){return dd(o,r)})});return SP(function(){var r=rg.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(l){i.has(l)||dd(l,null)}),i.forEach(function(l){o.has(l)||dd(l,a)})}rg.set(n,e)},[e]),n}function CP(e){return e}function EP(e,t){t===void 0&&(t=CP);var n=[],r=!1,o={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 o}function RP(e){e===void 0&&(e={});var t=EP(null);return t.options=yn({async:!0,ssr:!1},e),t}var gb=function(e){var t=e.sideCar,n=hb(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,yn({},n))};gb.isSideCarExport=!0;function PP(e,t){return e.useMedium(t),gb}var xb=RP(),ud=function(){},dc=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:ud,onWheelCapture:ud,onTouchMoveCapture:ud}),o=r[0],i=r[1],a=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,m=e.shards,f=e.sideCar,p=e.noRelative,v=e.noIsolation,g=e.inert,w=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,N=hb(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,C=kP([n,t]),k=yn(yn({},N),o);return h.createElement(h.Fragment,null,u&&h.createElement(j,{sideCar:xb,removeScrollBar:d,shards:m,noRelative:p,noIsolation:v,inert:g,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:b}),a?h.cloneElement(h.Children.only(l),yn(yn({},k),{ref:C})):h.createElement(y,yn({},k,{className:c,ref:C}),l))});dc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};dc.classNames={fullWidth:$a,zeroRight:Oa};var _P=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_P();return t&&e.setAttribute("nonce",t),e}function TP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function IP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var MP=function(){var e=0,t=null;return{add:function(n){e==0&&(t=AP())&&(TP(t,n),IP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LP=function(){var e=MP();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vb=function(){var e=LP(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},OP={left:0,top:0,right:0,gap:0},md=function(e){return parseInt(e||"",10)||0},$P=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[md(n),md(r),md(o)]},DP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return OP;var t=$P(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])}},FP=vb(),Us="data-scroll-locked",zP=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
552
|
+
.`.concat(wP,` {
|
|
553
|
+
overflow: hidden `).concat(r,`;
|
|
554
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
555
|
+
}
|
|
556
|
+
body[`).concat(Us,`] {
|
|
557
|
+
overflow: hidden `).concat(r,`;
|
|
558
|
+
overscroll-behavior: contain;
|
|
559
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
560
|
+
padding-left: `.concat(o,`px;
|
|
561
|
+
padding-top: `).concat(i,`px;
|
|
562
|
+
padding-right: `).concat(a,`px;
|
|
563
|
+
margin-left:0;
|
|
564
|
+
margin-top:0;
|
|
565
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
566
|
+
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
.`).concat(Oa,` {
|
|
570
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.`).concat($a,` {
|
|
574
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.`).concat(Oa," .").concat(Oa,` {
|
|
578
|
+
right: 0 `).concat(r,`;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.`).concat($a," .").concat($a,` {
|
|
582
|
+
margin-right: 0 `).concat(r,`;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
body[`).concat(Us,`] {
|
|
586
|
+
`).concat(NP,": ").concat(l,`px;
|
|
587
|
+
}
|
|
588
|
+
`)},sg=function(){var e=parseInt(document.body.getAttribute(Us)||"0",10);return isFinite(e)?e:0},BP=function(){h.useEffect(function(){return document.body.setAttribute(Us,(sg()+1).toString()),function(){var e=sg()-1;e<=0?document.body.removeAttribute(Us):document.body.setAttribute(Us,e.toString())}},[])},VP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;BP();var i=h.useMemo(function(){return DP(o)},[o]);return h.createElement(FP,{styles:zP(i,!t,o,n?"":"!important")})},Mu=!1;if(typeof window<"u")try{var pa=Object.defineProperty({},"passive",{get:function(){return Mu=!0,!0}});window.addEventListener("test",pa,pa),window.removeEventListener("test",pa,pa)}catch{Mu=!1}var vs=Mu?{passive:!1}:!1,WP=function(e){return e.tagName==="TEXTAREA"},yb=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!WP(e)&&n[t]==="visible")},UP=function(e){return yb(e,"overflowY")},HP=function(e){return yb(e,"overflowX")},og=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=bb(e,r);if(o){var i=wb(e,r),a=i[1],l=i[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},KP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},GP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},bb=function(e,t){return e==="v"?UP(t):HP(t)},wb=function(e,t){return e==="v"?KP(t):GP(t)},qP=function(e,t){return e==="h"&&t==="rtl"?-1:1},YP=function(e,t,n,r,o){var i=qP(e,window.getComputedStyle(t).direction),a=i*r,l=n.target,c=t.contains(l),d=!1,u=a>0,m=0,f=0;do{if(!l)break;var p=wb(e,l),v=p[0],g=p[1],w=p[2],x=g-w-i*v;(v||x)&&bb(e,l)&&(m+=x,f+=v);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&(Math.abs(m)<1||!o)||!u&&(Math.abs(f)<1||!o))&&(d=!0),d},ha=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ig=function(e){return[e.deltaX,e.deltaY]},ag=function(e){return e&&"current"in e?e.current:e},QP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},XP=function(e){return`
|
|
589
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
590
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
591
|
+
`)},ZP=0,ys=[];function JP(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(ZP++)[0],i=h.useState(vb)[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(o));var g=bP([e.lockRef.current],(e.shards||[]).map(ag),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var x=ha(g),y=n.current,b="deltaX"in g?g.deltaX:y[0]-x[0],N="deltaY"in g?g.deltaY:y[1]-x[1],j,C=g.target,k=Math.abs(b)>Math.abs(N)?"h":"v";if("touches"in g&&k==="h"&&C.type==="range")return!1;var P=og(k,C);if(!P)return!0;if(P?j=k:(j=k==="v"?"h":"v",P=og(k,C)),!P)return!1;if(!r.current&&"changedTouches"in g&&(b||N)&&(r.current=j),!j)return!0;var E=r.current||j;return YP(E,w,g,E==="h"?b:N,!0)},[]),c=h.useCallback(function(g){var w=g;if(!(!ys.length||ys[ys.length-1]!==i)){var x="deltaY"in w?ig(w):ha(w),y=t.current.filter(function(j){return j.name===w.type&&(j.target===w.target||w.target===j.shadowParent)&&QP(j.delta,x)})[0];if(y&&y.should){w.cancelable&&w.preventDefault();return}if(!y){var b=(a.current.shards||[]).map(ag).filter(Boolean).filter(function(j){return j.contains(w.target)}),N=b.length>0?l(w,b[0]):!a.current.noIsolation;N&&w.cancelable&&w.preventDefault()}}},[]),d=h.useCallback(function(g,w,x,y){var b={name:g,delta:w,target:x,should:y,shadowParent:e_(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(N){return N!==b})},1)},[]),u=h.useCallback(function(g){n.current=ha(g),r.current=void 0},[]),m=h.useCallback(function(g){d(g.type,ig(g),g.target,l(g,e.lockRef.current))},[]),f=h.useCallback(function(g){d(g.type,ha(g),g.target,l(g,e.lockRef.current))},[]);h.useEffect(function(){return ys.push(i),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:f}),document.addEventListener("wheel",c,vs),document.addEventListener("touchmove",c,vs),document.addEventListener("touchstart",u,vs),function(){ys=ys.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,vs),document.removeEventListener("touchmove",c,vs),document.removeEventListener("touchstart",u,vs)}},[]);var p=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(i,{styles:XP(o)}):null,p?h.createElement(VP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function e_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const t_=PP(xb,JP);var Nb=h.forwardRef(function(e,t){return h.createElement(dc,yn({},e,{ref:t,sideCar:t_}))});Nb.classNames=dc.classNames;var n_=[" ","Enter","ArrowUp","ArrowDown"],r_=[" ","Enter"],cs="Select",[uc,mc,s_]=Kl(cs),[jo,X3]=Bt(cs,[s_,nc]),fc=nc(),[o_,Or]=jo(cs),[i_,a_]=jo(cs),jb=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:m,disabled:f,required:p,form:v}=e,g=fc(t),[w,x]=h.useState(null),[y,b]=h.useState(null),[N,j]=h.useState(!1),C=Di(d),[k,P]=Rr({prop:r,defaultProp:o??!1,onChange:i,caller:cs}),[E,R]=Rr({prop:a,defaultProp:l,onChange:c,caller:cs}),_=h.useRef(null),M=w?v||!!w.closest("form"):!0,[O,A]=h.useState(new Set),H=Array.from(O).map(z=>z.props.value).join(";");return s.jsx(t5,{...g,children:s.jsxs(o_,{required:p,scope:t,trigger:w,onTriggerChange:x,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:N,onValueNodeHasChildrenChange:j,contentId:yo(),value:E,onValueChange:R,open:k,onOpenChange:P,dir:C,triggerPointerDownPosRef:_,disabled:f,children:[s.jsx(uc.Provider,{scope:t,children:s.jsx(i_,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(z=>{A(U=>new Set(U).add(z))},[]),onNativeOptionRemove:h.useCallback(z=>{A(U=>{const T=new Set(U);return T.delete(z),T})},[]),children:n})}),M?s.jsxs(Gb,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:m,value:E,onChange:z=>R(z.target.value),disabled:f,form:v,children:[E===void 0?s.jsx("option",{value:""}):null,Array.from(O)]},H):null]})})};jb.displayName=cs;var Sb="SelectTrigger",kb=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=fc(n),a=Or(Sb,n),l=a.disabled||r,c=le(t,a.onTriggerChange),d=mc(n),u=h.useRef("touch"),[m,f,p]=Yb(g=>{const w=d().filter(b=>!b.disabled),x=w.find(b=>b.value===a.value),y=Qb(w,g,x);y!==void 0&&a.onValueChange(y.value)}),v=g=>{l||(a.onOpenChange(!0),p()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return s.jsx(Ny,{asChild:!0,...i,children:s.jsx(J.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":qb(a.value)?"":void 0,...o,ref:c,onClick:X(o.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&v(g)}),onPointerDown:X(o.onPointerDown,g=>{u.current=g.pointerType;const w=g.target;w.hasPointerCapture(g.pointerId)&&w.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(v(g),g.preventDefault())}),onKeyDown:X(o.onKeyDown,g=>{const w=m.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(w&&g.key===" ")&&n_.includes(g.key)&&(v(),g.preventDefault())})})})});kb.displayName=Sb;var Cb="SelectValue",Eb=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...l}=e,c=Or(Cb,n),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,m=le(t,c.onValueNodeChange);return We(()=>{d(u)},[d,u]),s.jsx(J.span,{...l,ref:m,style:{pointerEvents:"none"},children:qb(c.value)?s.jsx(s.Fragment,{children:a}):i})});Eb.displayName=Cb;var l_="SelectIcon",Rb=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return s.jsx(J.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Rb.displayName=l_;var c_="SelectPortal",Pb=e=>s.jsx(Um,{asChild:!0,...e});Pb.displayName=c_;var ds="SelectContent",_b=h.forwardRef((e,t)=>{const n=Or(ds,e.__scopeSelect),[r,o]=h.useState();if(We(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?fs.createPortal(s.jsx(Ab,{scope:e.__scopeSelect,children:s.jsx(uc.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(Tb,{...e,ref:t})});_b.displayName=ds;var Xt=10,[Ab,$r]=jo(ds),d_="SelectContentImpl",u_=yi("SelectContent.RemoveScroll"),Tb=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:v,hideWhenDetached:g,avoidCollisions:w,...x}=e,y=Or(ds,n),[b,N]=h.useState(null),[j,C]=h.useState(null),k=le(t,B=>N(B)),[P,E]=h.useState(null),[R,_]=h.useState(null),M=mc(n),[O,A]=h.useState(!1),H=h.useRef(!1);h.useEffect(()=>{if(b)return yP(b)},[b]),lP();const z=h.useCallback(B=>{const[ee,...be]=M().map(ie=>ie.ref.current),[ue]=be.slice(-1),oe=document.activeElement;for(const ie of B)if(ie===oe||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===ee&&j&&(j.scrollTop=0),ie===ue&&j&&(j.scrollTop=j.scrollHeight),ie==null||ie.focus(),document.activeElement!==oe))return},[M,j]),U=h.useCallback(()=>z([P,b]),[z,P,b]);h.useEffect(()=>{O&&U()},[O,U]);const{onOpenChange:T,triggerPointerDownPosRef:L}=y;h.useEffect(()=>{if(b){let B={x:0,y:0};const ee=ue=>{var oe,ie;B={x:Math.abs(Math.round(ue.pageX)-(((oe=L.current)==null?void 0:oe.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((ie=L.current)==null?void 0:ie.y)??0))}},be=ue=>{B.x<=10&&B.y<=10?ue.preventDefault():b.contains(ue.target)||T(!1),document.removeEventListener("pointermove",ee),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",be,{capture:!0})}}},[b,T,L]),h.useEffect(()=>{const B=()=>T(!1);return window.addEventListener("blur",B),window.addEventListener("resize",B),()=>{window.removeEventListener("blur",B),window.removeEventListener("resize",B)}},[T]);const[S,D]=Yb(B=>{const ee=M().filter(oe=>!oe.disabled),be=ee.find(oe=>oe.ref.current===document.activeElement),ue=Qb(ee,B,be);ue&&setTimeout(()=>ue.ref.current.focus())}),F=h.useCallback((B,ee,be)=>{const ue=!H.current&&!be;(y.value!==void 0&&y.value===ee||ue)&&(E(B),ue&&(H.current=!0))},[y.value]),G=h.useCallback(()=>b==null?void 0:b.focus(),[b]),Q=h.useCallback((B,ee,be)=>{const ue=!H.current&&!be;(y.value!==void 0&&y.value===ee||ue)&&_(B)},[y.value]),re=r==="popper"?Lu:Ib,K=re===Lu?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:v,hideWhenDetached:g,avoidCollisions:w}:{};return s.jsx(Ab,{scope:n,content:b,viewport:j,onViewportChange:C,itemRefCallback:F,selectedItem:P,onItemLeave:G,itemTextRefCallback:Q,focusSelectedItem:U,selectedItemText:R,position:r,isPositioned:O,searchRef:S,children:s.jsx(Nb,{as:u_,allowPinchZoom:!0,children:s.jsx(mb,{asChild:!0,trapped:y.open,onMountAutoFocus:B=>{B.preventDefault()},onUnmountAutoFocus:X(o,B=>{var ee;(ee=y.trigger)==null||ee.focus({preventScroll:!0}),B.preventDefault()}),children:s.jsx(Gl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:B=>B.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:s.jsx(re,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:B=>B.preventDefault(),...x,...K,onPlaced:()=>A(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:X(x.onKeyDown,B=>{const ee=B.ctrlKey||B.altKey||B.metaKey;if(B.key==="Tab"&&B.preventDefault(),!ee&&B.key.length===1&&D(B.key),["ArrowUp","ArrowDown","Home","End"].includes(B.key)){let ue=M().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);if(["ArrowUp","End"].includes(B.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(B.key)){const oe=B.target,ie=ue.indexOf(oe);ue=ue.slice(ie+1)}setTimeout(()=>z(ue)),B.preventDefault()}})})})})})})});Tb.displayName=d_;var m_="SelectItemAlignedPosition",Ib=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Or(ds,n),a=$r(ds,n),[l,c]=h.useState(null),[d,u]=h.useState(null),m=le(t,k=>u(k)),f=mc(n),p=h.useRef(!1),v=h.useRef(!0),{viewport:g,selectedItem:w,selectedItemText:x,focusSelectedItem:y}=a,b=h.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&g&&w&&x){const k=i.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),R=x.getBoundingClientRect();if(i.dir!=="rtl"){const oe=R.left-P.left,ie=E.left-oe,Me=k.left-ie,Ke=k.width+Me,Wt=Math.max(Ke,P.width),Ut=window.innerWidth-Xt,Rn=ji(ie,[Xt,Math.max(Xt,Ut-Wt)]);l.style.minWidth=Ke+"px",l.style.left=Rn+"px"}else{const oe=P.right-R.right,ie=window.innerWidth-E.right-oe,Me=window.innerWidth-k.right-ie,Ke=k.width+Me,Wt=Math.max(Ke,P.width),Ut=window.innerWidth-Xt,Rn=ji(ie,[Xt,Math.max(Xt,Ut-Wt)]);l.style.minWidth=Ke+"px",l.style.right=Rn+"px"}const _=f(),M=window.innerHeight-Xt*2,O=g.scrollHeight,A=window.getComputedStyle(d),H=parseInt(A.borderTopWidth,10),z=parseInt(A.paddingTop,10),U=parseInt(A.borderBottomWidth,10),T=parseInt(A.paddingBottom,10),L=H+z+O+T+U,S=Math.min(w.offsetHeight*5,L),D=window.getComputedStyle(g),F=parseInt(D.paddingTop,10),G=parseInt(D.paddingBottom,10),Q=k.top+k.height/2-Xt,re=M-Q,K=w.offsetHeight/2,B=w.offsetTop+K,ee=H+z+B,be=L-ee;if(ee<=Q){const oe=_.length>0&&w===_[_.length-1].ref.current;l.style.bottom="0px";const ie=d.clientHeight-g.offsetTop-g.offsetHeight,Me=Math.max(re,K+(oe?G:0)+ie+U),Ke=ee+Me;l.style.height=Ke+"px"}else{const oe=_.length>0&&w===_[0].ref.current;l.style.top="0px";const Me=Math.max(Q,H+g.offsetTop+(oe?F:0)+K)+be;l.style.height=Me+"px",g.scrollTop=ee-Q+g.offsetTop}l.style.margin=`${Xt}px 0`,l.style.minHeight=S+"px",l.style.maxHeight=M+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,i.trigger,i.valueNode,l,d,g,w,x,i.dir,r]);We(()=>b(),[b]);const[N,j]=h.useState();We(()=>{d&&j(window.getComputedStyle(d).zIndex)},[d]);const C=h.useCallback(k=>{k&&v.current===!0&&(b(),y==null||y(),v.current=!1)},[b,y]);return s.jsx(p_,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:s.jsx(J.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Ib.displayName=m_;var f_="SelectPopperPosition",Lu=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Xt,...i}=e,a=fc(n);return s.jsx(jy,{...a,...i,ref:t,align:r,collisionPadding:o,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)"}})});Lu.displayName=f_;var[p_,Nf]=jo(ds,{}),Ou="SelectViewport",Mb=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=$r(Ou,n),a=Nf(Ou,n),l=le(t,i.onViewportChange),c=h.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(uc.Slot,{scope:n,children:s.jsx(J.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:X(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&m){const p=Math.abs(c.current-u.scrollTop);if(p>0){const v=window.innerHeight-Xt*2,g=parseFloat(m.style.minHeight),w=parseFloat(m.style.height),x=Math.max(g,w);if(x<v){const y=x+p,b=Math.min(v,y),N=y-b;m.style.height=b+"px",m.style.bottom==="0px"&&(u.scrollTop=N>0?N:0,m.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Mb.displayName=Ou;var Lb="SelectGroup",[h_,g_]=jo(Lb),x_=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=yo();return s.jsx(h_,{scope:n,id:o,children:s.jsx(J.div,{role:"group","aria-labelledby":o,...r,ref:t})})});x_.displayName=Lb;var Ob="SelectLabel",$b=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=g_(Ob,n);return s.jsx(J.div,{id:o.id,...r,ref:t})});$b.displayName=Ob;var wl="SelectItem",[v_,Db]=jo(wl),Fb=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,l=Or(wl,n),c=$r(wl,n),d=l.value===r,[u,m]=h.useState(i??""),[f,p]=h.useState(!1),v=le(t,y=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,y,r,o)}),g=yo(),w=h.useRef("touch"),x=()=>{o||(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 s.jsx(v_,{scope:n,value:r,disabled:o,textId:g,isSelected:d,onItemTextChange:h.useCallback(y=>{m(b=>b||((y==null?void 0:y.textContent)??"").trim())},[]),children:s.jsx(uc.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:s.jsx(J.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:v,onFocus:X(a.onFocus,()=>p(!0)),onBlur:X(a.onBlur,()=>p(!1)),onClick:X(a.onClick,()=>{w.current!=="mouse"&&x()}),onPointerUp:X(a.onPointerUp,()=>{w.current==="mouse"&&x()}),onPointerDown:X(a.onPointerDown,y=>{w.current=y.pointerType}),onPointerMove:X(a.onPointerMove,y=>{var b;w.current=y.pointerType,o?(b=c.onItemLeave)==null||b.call(c):w.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:X(a.onPointerLeave,y=>{var b;y.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:X(a.onKeyDown,y=>{var N;((N=c.searchRef)==null?void 0:N.current)!==""&&y.key===" "||(r_.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});Fb.displayName=wl;var Vo="SelectItemText",zb=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=Or(Vo,n),l=$r(Vo,n),c=Db(Vo,n),d=a_(Vo,n),[u,m]=h.useState(null),f=le(t,x=>m(x),c.onItemTextChange,x=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,x,c.value,c.disabled)}),p=u==null?void 0:u.textContent,v=h.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:w}=d;return We(()=>(g(v),()=>w(v)),[g,w,v]),s.jsxs(s.Fragment,{children:[s.jsx(J.span,{id:c.textId,...i,ref:f}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?fs.createPortal(i.children,a.valueNode):null]})});zb.displayName=Vo;var Bb="SelectItemIndicator",Vb=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Db(Bb,n).isSelected?s.jsx(J.span,{"aria-hidden":!0,...r,ref:t}):null});Vb.displayName=Bb;var $u="SelectScrollUpButton",Wb=h.forwardRef((e,t)=>{const n=$r($u,e.__scopeSelect),r=Nf($u,e.__scopeSelect),[o,i]=h.useState(!1),a=le(t,r.onScrollButtonChange);return We(()=>{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]),o?s.jsx(Hb,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Wb.displayName=$u;var Du="SelectScrollDownButton",Ub=h.forwardRef((e,t)=>{const n=$r(Du,e.__scopeSelect),r=Nf(Du,e.__scopeSelect),[o,i]=h.useState(!1),a=le(t,r.onScrollButtonChange);return We(()=>{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]),o?s.jsx(Hb,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Ub.displayName=Du;var Hb=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=$r("SelectScrollButton",n),a=h.useRef(null),l=mc(n),c=h.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),We(()=>{var u;const d=l().find(m=>m.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),s.jsx(J.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:X(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:X(o.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:X(o.onPointerLeave,()=>{c()})})}),y_="SelectSeparator",Kb=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(J.div,{"aria-hidden":!0,...r,ref:t})});Kb.displayName=y_;var Fu="SelectArrow",b_=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=fc(n),i=Or(Fu,n),a=$r(Fu,n);return i.open&&a.position==="popper"?s.jsx(Sy,{...o,...r,ref:t}):null});b_.displayName=Fu;var w_="SelectBubbleInput",Gb=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),i=le(r,o),a=yf(t);return h.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const m=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(m)}},[a,t]),s.jsx(J.select,{...n,style:{...fv,...n.style},ref:i,defaultValue:t})});Gb.displayName=w_;function qb(e){return e===""||e===void 0}function Yb(e){const t=Be(e),n=h.useRef(""),r=h.useRef(0),o=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,o,i]}function Qb(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=N_(e,Math.max(i,0));o.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function N_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var j_=jb,Xb=kb,S_=Eb,k_=Rb,C_=Pb,Zb=_b,E_=Mb,Jb=$b,ew=Fb,R_=zb,P_=Vb,tw=Wb,nw=Ub,rw=Kb;const jf=j_,Sf=S_,pc=h.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Xb,{ref:r,className:I("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,s.jsx(k_,{asChild:!0,children:s.jsx(at,{className:"h-4 w-4 opacity-50"})})]}));pc.displayName=Xb.displayName;const sw=h.forwardRef(({className:e,...t},n)=>s.jsx(tw,{ref:n,className:I("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(_2,{className:"h-4 w-4"})}));sw.displayName=tw.displayName;const ow=h.forwardRef(({className:e,...t},n)=>s.jsx(nw,{ref:n,className:I("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(at,{className:"h-4 w-4"})}));ow.displayName=nw.displayName;const hc=h.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>s.jsx(C_,{children:s.jsxs(Zb,{ref:o,className:I("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:[s.jsx(sw,{}),s.jsx(E_,{className:I("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(ow,{})]})}));hc.displayName=Zb.displayName;const __=h.forwardRef(({className:e,...t},n)=>s.jsx(Jb,{ref:n,className:I("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));__.displayName=Jb.displayName;const sn=h.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(ew,{ref:r,className:I("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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(P_,{children:s.jsx(qm,{className:"h-4 w-4"})})}),s.jsx(R_,{children:t})]}));sn.displayName=ew.displayName;const A_=h.forwardRef(({className:e,...t},n)=>s.jsx(rw,{ref:n,className:I("-mx-1 my-1 h-px bg-muted",e),...t}));A_.displayName=rw.displayName;const T_={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"},I_=({stakeholders:e,onChange:t})=>{const[n,r]=h.useState(""),[o,i]=h.useState("neutral"),a=()=>{n.trim()&&(t([...e,{id:n.trim(),disposition:o}]),r(""),i("neutral"))},l=c=>{t(e.filter((d,u)=>u!==c))};return s.jsxs(pe,{className:"border-border",children:[s.jsx(Pe,{className:"pb-3",children:s.jsx(_e,{className:"text-base",children:"Participants"})}),s.jsxs(he,{children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ft,{placeholder:"Participant name...",value:n,onChange:c=>r(c.target.value),onKeyDown:c=>c.key==="Enter"&&a(),className:"flex-1"}),s.jsxs(jf,{value:o,onValueChange:c=>i(c),children:[s.jsx(pc,{className:"w-[130px]",children:s.jsx(Sf,{})}),s.jsxs(hc,{children:[s.jsx(sn,{value:"supportive",children:"Supportive"}),s.jsx(sn,{value:"neutral",children:"Neutral"}),s.jsx(sn,{value:"hostile",children:"Hostile"}),s.jsx(sn,{value:"unknown",children:"Unknown"})]})]}),s.jsx(Z,{size:"icon",variant:"outline",onClick:a,disabled:!n.trim(),children:s.jsx(Dn,{className:"h-4 w-4"})})]}),e.length>0&&s.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:e.map((c,d)=>s.jsxs(ce,{variant:"outline",className:`gap-1.5 pr-1 ${T_[c.disposition]}`,children:[c.id,s.jsxs("span",{className:"text-[10px] opacity-70",children:["(",c.disposition,")"]}),s.jsx("button",{onClick:()=>l(d),className:"ml-0.5 rounded-full p-0.5 hover:bg-background/50",children:s.jsx(ts,{className:"h-3 w-3"})})]},d))})]})]})};var M_="Label",iw=h.forwardRef((e,t)=>s.jsx(J.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));iw.displayName=M_;var aw=iw;const L_=Ql("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xn=h.forwardRef(({className:e,...t},n)=>s.jsx(aw,{ref:n,className:I(L_(),e),...t}));xn.displayName=aw.displayName;const O_=({values:e,onChange:t})=>s.jsxs(pe,{className:"border-border",children:[s.jsx(Pe,{className:"pb-3",children:s.jsx(_e,{className:"text-base",children:"Rules & Limits"})}),s.jsxs(he,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(xn,{className:"text-xs text-muted-foreground",children:"Time Horizon"}),s.jsx(ft,{placeholder:"e.g. 30 days, 6 months",value:e.timeHorizon,onChange:n=>t({...e,timeHorizon:n.target.value}),className:"mt-1"})]}),s.jsxs("div",{children:[s.jsx(xn,{className:"text-xs text-muted-foreground",children:"Risk Tolerance"}),s.jsxs(jf,{value:e.riskTolerance,onValueChange:n=>t({...e,riskTolerance:n}),children:[s.jsx(pc,{className:"mt-1",children:s.jsx(Sf,{})}),s.jsxs(hc,{children:[s.jsx(sn,{value:"conservative",children:"Conservative"}),s.jsx(sn,{value:"moderate",children:"Moderate"}),s.jsx(sn,{value:"aggressive",children:"Aggressive"})]})]})]}),s.jsxs("div",{children:[s.jsx(xn,{className:"text-xs text-muted-foreground",children:"Budget"}),s.jsx(ft,{placeholder:"e.g. $10M, Unlimited",value:e.budget,onChange:n=>t({...e,budget:n.target.value}),className:"mt-1"})]})]})]}),$_=[{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"}],D_=({value:e,onChange:t})=>s.jsxs(pe,{className:"border-border",children:[s.jsx(Pe,{className:"pb-3",children:s.jsx(_e,{className:"text-base",children:"Analysis Depth"})}),s.jsx(he,{children:s.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:$_.map(n=>s.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:[s.jsx("p",{className:"text-sm font-medium",children:n.label}),s.jsx("p",{className:"mt-0.5 text-[10px]",children:n.description})]},n.value))})})]}),fd="neuroverse_api_key",kf=({onKeyChange:e})=>{const[t,n]=h.useState(""),[r,o]=h.useState(!1),[i,a]=h.useState(!1);h.useEffect(()=>{const d=localStorage.getItem(fd);d&&(n(d),a(!0),e==null||e(d))},[]);const l=()=>{t.trim()?localStorage.setItem(fd,t.trim()):localStorage.removeItem(fd),e==null||e(t.trim()),a(!0),setTimeout(()=>a(!1),2e3)},c=t.trim().length>0;return s.jsxs("div",{className:"rounded-xl border-2 border-primary/20 bg-card p-5 shadow-md",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10",children:s.jsx(D2,{className:"h-4 w-4 text-primary"})}),s.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Your AI Key"}),c&&i&&s.jsx("span",{className:"ml-auto rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary",children:"Saved ✓"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-1 ml-10",children:c&&i?"Key saved in your browser — ready to use.":"Powers the analysis with your chosen AI service."}),s.jsxs("p",{className:"text-[10px] text-muted-foreground/70 mb-3 ml-10",children:["Get a key from"," ",s.jsxs("a",{href:"https://console.anthropic.com/settings/keys",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["Anthropic ",s.jsx(Jo,{className:"h-2.5 w-2.5"})]}),","," ",s.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 ",s.jsx(Jo,{className:"h-2.5 w-2.5"})]}),", or"," ",s.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 ",s.jsx(Jo,{className:"h-2.5 w-2.5"})]}),". Stored in your browser only — never sent to our servers."]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(ft,{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"}),s.jsx("button",{onClick:()=>o(!r),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:r?s.jsx(T2,{className:"h-4 w-4"}):s.jsx(Zl,{className:"h-4 w-4"})})]}),s.jsx(Z,{size:"sm",onClick:l,className:"min-w-[60px]",children:i?s.jsx(qm,{className:"h-4 w-4"}):"Save"})]})]})},F_=({mode:e,onChange:t})=>s.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-border bg-card p-1",children:[s.jsxs("button",{onClick:()=>t("explore"),className:I("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:[s.jsx("span",{className:"block text-xs opacity-70",children:"EXPLORE"}),s.jsx("span",{className:"block text-[10px]",children:"What might happen?"})]}),s.jsxs("button",{onClick:()=>t("goal"),className:I("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:[s.jsx("span",{className:"block text-xs opacity-70",children:"GOAL"}),s.jsx("span",{className:"block text-[10px]",children:"How do I get here?"})]})]}),z_=({values:e,onChange:t})=>{const[n,r]=h.useState(""),[o,i]=h.useState(""),[a,l]=h.useState(""),c=(u,m,f)=>{m.trim()&&(t({...e,[u]:[...e[u],m.trim()]}),f(""))},d=(u,m)=>{t({...e,[u]:e[u].filter((f,p)=>p!==m)})};return s.jsxs(pe,{className:"border-primary/30 bg-primary/5",children:[s.jsx(Pe,{className:"pb-3",children:s.jsx(_e,{className:"text-base",children:"Goal: How do I get here?"})}),s.jsxs(he,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(xn,{className:"text-xs text-muted-foreground",children:"Desired Outcome"}),s.jsx($i,{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]"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx(xn,{className:"text-xs text-muted-foreground",children:"Priority"}),s.jsxs(jf,{value:e.priority,onValueChange:u=>t({...e,priority:u}),children:[s.jsx(pc,{className:"mt-1",children:s.jsx(Sf,{})}),s.jsxs(hc,{children:[s.jsx(sn,{value:"preferred",children:"Preferred"}),s.jsx(sn,{value:"important",children:"Important"}),s.jsx(sn,{value:"critical",children:"Critical"})]})]})]}),s.jsxs("div",{children:[s.jsx(xn,{className:"text-xs text-muted-foreground",children:"Timeframe"}),s.jsx(ft,{placeholder:"e.g. 30 days",value:e.timeframe,onChange:u=>t({...e,timeframe:u.target.value}),className:"mt-1"})]})]}),s.jsxs("div",{children:[s.jsx(xn,{className:"text-xs text-muted-foreground",children:"Success Criteria"}),s.jsxs("div",{className:"mt-1 flex gap-2",children:[s.jsx(ft,{placeholder:"Measurable condition...",value:n,onChange:u=>r(u.target.value),onKeyDown:u=>u.key==="Enter"&&c("successCriteria",n,r)}),s.jsx("button",{onClick:()=>c("successCriteria",n,r),className:"shrink-0 rounded-md border border-border p-2 hover:bg-muted",children:s.jsx(Dn,{className:"h-4 w-4"})})]}),e.successCriteria.length>0&&s.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.successCriteria.map((u,m)=>s.jsxs(ce,{variant:"outline",className:"gap-1 pr-1 text-xs",children:[u,s.jsx("button",{onClick:()=>d("successCriteria",m),children:s.jsx(ts,{className:"h-3 w-3"})})]},m))})]}),s.jsxs("div",{children:[s.jsx(xn,{className:"text-xs text-destructive",children:"Red Lines (must NOT happen)"}),s.jsxs("div",{className:"mt-1 flex gap-2",children:[s.jsx(ft,{placeholder:"Hard constraint...",value:o,onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&c("redLines",o,i)}),s.jsx("button",{onClick:()=>c("redLines",o,i),className:"shrink-0 rounded-md border border-destructive/30 p-2 hover:bg-destructive/10",children:s.jsx(Dn,{className:"h-4 w-4 text-destructive"})})]}),e.redLines.length>0&&s.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.redLines.map((u,m)=>s.jsxs(ce,{variant:"outline",className:"gap-1 pr-1 text-xs border-destructive/30 text-destructive",children:[u,s.jsx("button",{onClick:()=>d("redLines",m),children:s.jsx(ts,{className:"h-3 w-3"})})]},m))})]}),s.jsxs("div",{children:[s.jsx(xn,{className:"text-xs text-muted-foreground",children:"Available Levers"}),s.jsxs("div",{className:"mt-1 flex gap-2",children:[s.jsx(ft,{placeholder:"Tool or resource you can deploy...",value:a,onChange:u=>l(u.target.value),onKeyDown:u=>u.key==="Enter"&&c("availableLevers",a,l)}),s.jsx("button",{onClick:()=>c("availableLevers",a,l),className:"shrink-0 rounded-md border border-border p-2 hover:bg-muted",children:s.jsx(Dn,{className:"h-4 w-4"})})]}),e.availableLevers.length>0&&s.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.availableLevers.map((u,m)=>s.jsxs(ce,{variant:"outline",className:"gap-1 pr-1 text-xs border-primary/30 text-primary",children:[u,s.jsx("button",{onClick:()=>d("availableLevers",m),children:s.jsx(ts,{className:"h-3 w-3"})})]},m))})]})]})]})},pd={REWARD:[{value:"boost_influence",label:"Boost influence"},{value:"priority",label:"Boost priority"},{value:"faster_execution",label:"Faster execution"}],PENALIZE:[{value:"reduce_influence",label:"Reduce influence"},{value:"cooldown",label:"Cooldown period"},{value:"freeze",label:"Freeze agent"}],NEUTRAL:[{value:"flag",label:"Flag for attention"},{value:"review",label:"Require review"}]},bs={explore:["Protein mutations that improve binding affinity for SSTR2","Lightweight ceramics under 5 g/cm³ with high stiffness","Cross-domain resonance patterns between biology and engineering","Novel drug candidates for treatment-resistant depression"],exclude:["Results based on a single data source","Claims with confidence below 70%","Conclusions that contradict established thermodynamic laws","Findings that cannot be reproduced computationally"],elevate:["Multiple independent evidence streams converging","Results validated by at least two different methods","Cross-domain agreement between structural and evolutionary data","Findings with clear mechanistic explanations"],experiment:{conditions:["An agent publishes without peer validation","Two agents converge on the same finding independently","Confidence drops below 50% after replication attempt","An agent uses more than 3 data sources","A hypothesis contradicts a previously validated result"],outcomes:["Reduce that agent's influence for 3 rounds","Boost priority of the finding by 2x","Freeze the claim and require manual review","Reward with faster execution privileges","Flag for adversarial review before continuing"],verdicts:["PENALIZE","REWARD","PENALIZE","REWARD","NEUTRAL"]},openEnded:["What happens if we let agents form coalitions but penalize groupthink?","Can we make agents compete for evidence quality rather than quantity?","Try running with no exclusion rules and see what breaks","What if we reward agents that challenge the dominant consensus?"]},lw=({onWorldReady:e,onIntentChange:t,isTranslating:n,aiTranslate:r,hasAIKey:o})=>{const[i,a]=h.useState({explore:"",exclude:"",elevate:"",experiment:[],openEnded:""}),[l,c]=h.useState([]),[d,u]=h.useState(!1),[m,f]=h.useState(!1),[p,v]=h.useState(null),[g,w]=h.useState(!1),[x,y]=h.useState(""),[b,N]=h.useState(""),[j,C]=h.useState("PENALIZE"),[k,P]=h.useState("reduce_influence"),[E,R]=h.useState(3),_=h.useCallback((S,D)=>{const F={...i,[S]:D};a(F),t==null||t(F)},[i,t]),M=h.useCallback(S=>{const D=bs[S],F=D[Math.floor(Math.random()*D.length)];_(S,F)},[_]),O=h.useCallback(()=>{if(!x.trim()||!b.trim())return;const S={id:`ifthen_${Date.now()}`,condition:x.trim(),outcome:b.trim(),verdict:j,action:k,rounds:E},D={...i,experiment:[...i.experiment,S]};a(D),t==null||t(D),y(""),N("")},[x,b,j,k,E,i,t]),A=h.useCallback(S=>{const D={...i,experiment:i.experiment.filter(F=>F.id!==S)};a(D),t==null||t(D)},[i,t]),H=h.useCallback(()=>{const S=Math.floor(Math.random()*bs.experiment.conditions.length),D=bs.experiment.verdicts[S];y(bs.experiment.conditions[S]),N(bs.experiment.outcomes[S]),C(D),P(pd[D][0].value),R(3)},[]),z=h.useCallback(()=>{const S=bs.openEnded;_("openEnded",S[Math.floor(Math.random()*S.length)])},[_]),U=i.explore.trim()||i.exclude.trim()||i.elevate.trim()||i.experiment.length>0||i.openEnded.trim(),T=h.useCallback(async()=>{if(!U)return;if(v(null),r){f(!0);try{const D=await r(i);if(D.length>0){c(D),u(!0),w(!0),f(!1),e==null||e({intent:i,rules:D,worldName:dg(i)});return}}catch(D){const F=D instanceof Error?D.message:"AI translation failed";v(F)}f(!1)}const S=V_(i);c(S),u(!0),w(!1),e==null||e({intent:i,rules:S,worldName:dg(i)})},[i,U,e,r]),L=h.useCallback(S=>{c(D=>D.filter(F=>F.id!==S))},[]);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-bold text-foreground tracking-tight",children:"Define Your World"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Describe what matters in plain language. AI translates your intent into governance rules."})]}),s.jsx(ga,{icon:s.jsx(A2,{className:"h-4 w-4"}),label:"Explore",color:"emerald",description:"What should agents investigate?",placeholder:"e.g. Protein mutations that improve binding affinity for cancer targets...",value:i.explore,onChange:S=>_("explore",S),onExample:()=>M("explore")}),s.jsx(ga,{icon:s.jsx(zv,{className:"h-4 w-4"}),label:"Exclude",color:"red",description:"What should never be concluded or published?",placeholder:"e.g. Results based on a single data source, claims below 70% confidence...",value:i.exclude,onChange:S=>_("exclude",S),onExample:()=>M("exclude")}),s.jsx(ga,{icon:s.jsx(Q2,{className:"h-4 w-4"}),label:"Elevate",color:"amber",description:"What makes a result valuable?",placeholder:"e.g. Multiple independent evidence streams converging on the same finding...",value:i.elevate,onChange:S=>_("elevate",S),onExample:()=>M("elevate")}),s.jsxs("div",{className:"rounded-xl border border-violet-500/20 bg-violet-500/5 p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-violet-500/10",children:s.jsx(Z2,{className:"h-4 w-4 text-violet-400"})}),s.jsx("span",{className:"text-sm font-bold text-violet-400",children:"Shape Behavior"})]}),s.jsxs("button",{onClick:H,className:"flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(Dn,{className:"h-3 w-3"}),"Example"]})]}),s.jsx("p",{className:"text-[11px] text-muted-foreground ml-9",children:"Define if/then rules with concrete consequences. This is how you engineer agent incentives."}),s.jsxs("div",{className:"space-y-2 ml-9",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-violet-400 shrink-0 w-6",children:"If"}),s.jsx(ft,{placeholder:"An agent publishes without peer validation...",value:x,onChange:S=>y(S.target.value),className:"flex-1 text-sm border-violet-500/20"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-violet-400 shrink-0 w-6",children:"Then"}),s.jsx(ft,{placeholder:"Describe what should happen...",value:b,onChange:S=>N(S.target.value),onKeyDown:S=>S.key==="Enter"&&O(),className:"flex-1 text-sm border-violet-500/20"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-violet-400 shrink-0 w-6",children:"Act"}),s.jsx("div",{className:"flex gap-1.5",children:["REWARD","PENALIZE","NEUTRAL"].map(S=>s.jsx("button",{onClick:()=>{C(S),P(pd[S][0].value)},className:`rounded-full px-3 py-1 text-[10px] font-bold uppercase tracking-wider transition-all ${j===S?S==="REWARD"?"bg-emerald-500/20 text-emerald-400 border border-emerald-500/40":S==="PENALIZE"?"bg-red-500/20 text-red-400 border border-red-500/40":"bg-zinc-500/20 text-zinc-400 border border-zinc-500/40":"text-muted-foreground/50 hover:text-muted-foreground border border-transparent"}`,children:S},S))})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-violet-400 shrink-0 w-6",children:"How"}),s.jsx("div",{className:"flex gap-1.5 flex-wrap",children:pd[j].map(S=>s.jsx("button",{onClick:()=>P(S.value),className:`rounded-md px-2.5 py-1 text-[10px] font-medium transition-all ${k===S.value?"bg-violet-500/20 text-violet-300 border border-violet-500/40":"text-muted-foreground/60 hover:text-muted-foreground border border-transparent"}`,children:S.label},S.value))}),j!=="NEUTRAL"&&s.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[s.jsx("span",{className:"text-[10px] text-muted-foreground",children:"for"}),s.jsx("select",{value:E,onChange:S=>R(Number(S.target.value)),className:"rounded border border-violet-500/20 bg-transparent px-1.5 py-0.5 text-[10px] text-foreground",children:[1,2,3,5,10].map(S=>s.jsx("option",{value:S,children:S},S))}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:"rounds"})]}),s.jsx("button",{onClick:O,disabled:!x.trim()||!b.trim(),className:"shrink-0 rounded-md border border-violet-500/30 p-1.5 hover:bg-violet-500/10 disabled:opacity-30 disabled:cursor-not-allowed",children:s.jsx(Dn,{className:"h-4 w-4 text-violet-400"})})]})]}),i.experiment.length>0&&s.jsx("div",{className:"space-y-1.5 ml-9",children:i.experiment.map(S=>{var D;return s.jsxs("div",{className:`flex items-center gap-2 rounded-lg border p-2 text-xs ${S.verdict==="REWARD"?"border-emerald-500/20 bg-emerald-500/5":S.verdict==="PENALIZE"?"border-red-500/20 bg-red-500/5":"border-zinc-500/20 bg-zinc-500/5"}`,children:[s.jsx(ce,{variant:"outline",className:`shrink-0 text-[9px] ${S.verdict==="REWARD"?"border-emerald-500/30 text-emerald-400":S.verdict==="PENALIZE"?"border-red-500/30 text-red-400":"border-zinc-500/30 text-zinc-400"}`,children:S.verdict}),s.jsxs("span",{className:"text-muted-foreground",children:["If ",s.jsx("span",{className:"text-foreground",children:S.condition})]}),s.jsx(Is,{className:"h-3 w-3 text-muted-foreground/50 shrink-0"}),s.jsxs("span",{className:"text-muted-foreground",children:[(D=S.action)==null?void 0:D.replace(/_/g," "),S.rounds&&S.verdict!=="NEUTRAL"?` (${S.rounds}r)`:""," — ",S.outcome]}),s.jsx("button",{onClick:()=>A(S.id),className:"shrink-0 ml-auto text-muted-foreground/50 hover:text-foreground",children:s.jsx(ts,{className:"h-3 w-3"})})]},S.id)})})]}),s.jsx(ga,{icon:s.jsx(B2,{className:"h-4 w-4"}),label:"Advanced",color:"blue",description:"Anything else you want to test? AI will interpret this into rules.",placeholder:"e.g. What happens if we reward agents that challenge the dominant consensus?",value:i.openEnded,onChange:S=>_("openEnded",S),onExample:z}),o?s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-emerald-500/20 bg-emerald-500/5 px-3 py-2",children:[s.jsx(Fn,{className:"h-3.5 w-3.5 text-emerald-400"}),s.jsx("span",{className:"text-xs text-emerald-400 font-medium",children:"AI-enhanced mode"}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:"— your API key will generate smarter rules"})]}):s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border/50 bg-muted/20 px-3 py-2",children:[s.jsx(et,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Heuristic mode"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"— add an AI key in the header for smarter rule generation"})]}),p&&s.jsxs("div",{className:"rounded-lg border border-yellow-500/20 bg-yellow-500/5 px-3 py-2 text-xs text-yellow-400",children:["AI unavailable: ",p,". Fell back to heuristic rules."]}),s.jsx(Z,{onClick:T,disabled:!U||n||m,className:"w-full gap-2",size:"lg",children:m?s.jsxs(s.Fragment,{children:[s.jsx(wu,{className:"h-4 w-4 animate-spin"}),"AI is generating rules..."]}):n?s.jsxs(s.Fragment,{children:[s.jsx(wu,{className:"h-4 w-4 animate-spin"}),"Translating intent into rules..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Fn,{className:"h-4 w-4"}),"Build World"]})}),d&&l.length>0&&s.jsx("div",{className:"flex items-center justify-center gap-1.5 text-[10px] text-muted-foreground/60",children:g?s.jsxs(s.Fragment,{children:[s.jsx(Fn,{className:"h-2.5 w-2.5 text-emerald-400/60"}),"Generated with AI"]}):s.jsxs(s.Fragment,{children:[s.jsx(et,{className:"h-2.5 w-2.5"}),"Generated with heuristics"]})}),d&&l.length>0&&s.jsxs("div",{className:"rounded-xl border-2 border-primary/30 bg-card p-5 space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(et,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"text-sm font-bold text-foreground",children:"Your World Rules"}),s.jsxs(ce,{variant:"outline",className:"text-[10px]",children:[l.length," rules"]})]}),s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"What this will enforce:"}),s.jsx("div",{className:"space-y-1.5",children:l.map(S=>s.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[s.jsx(ce,{variant:"outline",className:`shrink-0 mt-0.5 text-[9px] ${lg(S.ruleType).badge}`,children:S.ruleType}),s.jsx("span",{className:"text-foreground leading-relaxed",children:S.naturalLanguage}),s.jsx("button",{onClick:()=>L(S.id),className:"shrink-0 ml-auto text-muted-foreground/50 hover:text-foreground",children:s.jsx(ts,{className:"h-3 w-3"})})]},S.id))}),s.jsxs("details",{className:"group",children:[s.jsx("summary",{className:"cursor-pointer text-[11px] text-muted-foreground hover:text-foreground transition-colors",children:"Show enforcement conditions"}),s.jsx("div",{className:"mt-2 space-y-1 rounded-lg border border-border bg-muted/30 p-3",children:l.filter(S=>S.condition).map(S=>s.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[s.jsxs("span",{className:`font-mono shrink-0 ${lg(S.ruleType).badge}`,children:["[",S.ruleType,"]"]}),s.jsx("code",{className:"text-muted-foreground",children:S.condition})]},S.id))})]})]})]})},B_={emerald:{border:"border-emerald-500/20",bg:"bg-emerald-500/5",iconBg:"bg-emerald-500/10",iconText:"text-emerald-400",label:"text-emerald-400"},red:{border:"border-red-500/20",bg:"bg-red-500/5",iconBg:"bg-red-500/10",iconText:"text-red-400",label:"text-red-400"},amber:{border:"border-amber-500/20",bg:"bg-amber-500/5",iconBg:"bg-amber-500/10",iconText:"text-amber-400",label:"text-amber-400"},blue:{border:"border-blue-500/20",bg:"bg-blue-500/5",iconBg:"bg-blue-500/10",iconText:"text-blue-400",label:"text-blue-400"}},ga=({icon:e,label:t,color:n,description:r,placeholder:o,value:i,onChange:a,onExample:l})=>{const c=B_[n];return s.jsxs("div",{className:`rounded-xl border ${c.border} ${c.bg} p-4 space-y-2`,children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`flex h-7 w-7 items-center justify-center rounded-lg ${c.iconBg}`,children:s.jsx("span",{className:c.iconText,children:e})}),s.jsx("span",{className:`text-sm font-bold ${c.label}`,children:t})]}),s.jsxs("button",{onClick:l,className:"flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(Dn,{className:"h-3 w-3"}),"Example"]})]}),s.jsx("p",{className:"text-[11px] text-muted-foreground ml-9",children:r}),s.jsx($i,{placeholder:o,value:i,onChange:d=>a(d.target.value),className:"min-h-[60px] resize-none border-0 bg-transparent px-0 text-sm placeholder:text-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0"})]})};function lg(e){switch(e){case"BLOCK":case"PENALIZE":return{bg:"border-red-500/20 bg-red-500/5",badge:"border-red-500/30 text-red-400"};case"REWARD":return{bg:"border-emerald-500/20 bg-emerald-500/5",badge:"border-emerald-500/30 text-emerald-400"};case"PRIORITIZE":return{bg:"border-amber-500/20 bg-amber-500/5",badge:"border-amber-500/30 text-amber-400"};case"NEUTRAL":return{bg:"border-zinc-500/20 bg-zinc-500/5",badge:"border-zinc-500/30 text-zinc-400"};default:return{bg:"border-emerald-500/20 bg-emerald-500/5",badge:"border-emerald-500/30 text-emerald-400"}}}function V_(e){const t=[];let n=0;if(e.explore.trim()){const r=xa(e.explore);for(const o of r)t.push({id:`rule_${n++}`,source:"explore",naturalLanguage:`Agents should investigate: ${o}`,ruleType:"ALLOW",condition:`action.domain matches "${cg(o)}"`,effect:"ALLOW with priority",confidence:.8})}if(e.exclude.trim()){const r=xa(e.exclude);for(const o of r){const i=o.toLowerCase();t.push({id:`rule_${n++}`,source:"exclude",naturalLanguage:`BLOCK: ${o}`,ruleType:"BLOCK",condition:W_(i),effect:"BLOCK action",confidence:.85})}}if(e.elevate.trim()){const r=xa(e.elevate);for(const o of r)t.push({id:`rule_${n++}`,source:"elevate",naturalLanguage:`PRIORITIZE: ${o}`,ruleType:"PRIORITIZE",condition:`result satisfies "${o}"`,effect:"Boost priority score",confidence:.75})}for(const r of e.experiment){const o=r.verdict==="REWARD"?`Reward: ${r.outcome}`:r.verdict==="PENALIZE"?`Penalize: ${r.outcome}`:`Neutral observation: ${r.outcome}`;t.push({id:`rule_${n++}`,source:"experiment",naturalLanguage:`If ${r.condition} → ${r.outcome}`,ruleType:r.verdict,condition:`agent.behavior matches "${r.condition}"`,effect:o,confidence:.9})}if(e.openEnded.trim()){const r=xa(e.openEnded);for(const o of r)t.push({id:`rule_${n++}`,source:"open_ended",naturalLanguage:o,ruleType:"NEUTRAL",condition:`scenario includes "${cg(o)}"`,effect:"AI will translate this into specific rules",confidence:.6})}return t}function xa(e){return e.split(/[.;\n]+/).map(t=>t.trim()).filter(t=>t.length>3)}function cg(e){const t=new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","that","this","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","can"]);return e.toLowerCase().split(/\s+/).filter(n=>n.length>2&&!t.has(n)).slice(0,5).join(" ")}function W_(e){if(e.includes("single")&&e.includes("source"))return"result.sources.length < 2";if(e.includes("confidence")||e.includes("below")){const t=e.match(/(\d+)%?/);return`result.confidence < ${t?parseInt(t[1])/100:.7}`}return e.includes("reproduc")?"result.reproducibility === false":e.includes("contradict")?"result.contradicts_established_laws === true":`result matches exclusion: "${e.slice(0,60)}"`}function dg(e){const t=e.explore.trim();if(!t)return"Custom World";const n=t.split(/[.,;\n]/)[0].trim();return n.length<=40?n:n.slice(0,37)+"..."}const U_={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"},H_=({confidence:e})=>{const[t,n]=h.useState(!1);return s.jsxs("div",{className:"inline-block",children:[s.jsxs("button",{onClick:()=>n(!t),className:I("inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium transition-all",U_[e.level]),children:["Confidence: ",e.level.toUpperCase(),s.jsx(at,{className:I("h-3 w-3 transition-transform",t&&"rotate-180")})]}),t&&s.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})]})},K_={caller:"bg-primary/20 text-primary",inferred:"bg-warning/20 text-warning",default:"bg-muted text-muted-foreground"},G_=({assumptions:e})=>e.length===0?null:s.jsx("section",{className:"border-t border-border py-8",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsx("div",{className:"mx-auto max-w-4xl",children:s.jsxs(pe,{className:"border-border",children:[s.jsx(Pe,{className:"pb-3",children:s.jsx(_e,{className:"text-base",children:"Key Assumptions"})}),s.jsx(he,{children:s.jsx("ul",{className:"space-y-2",children:e.map((t,n)=>s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(ce,{className:`shrink-0 text-[10px] ${K_[t.source]}`,children:t.source}),s.jsx("span",{className:"text-sm text-foreground",children:t.text})]},n))})})]})})})});var hd="rovingFocusGroup.onEntryFocus",q_={bubbles:!1,cancelable:!0},Fi="RovingFocusGroup",[zu,cw,Y_]=Kl(Fi),[Q_,dw]=Bt(Fi,[Y_]),[X_,Z_]=Q_(Fi),uw=h.forwardRef((e,t)=>s.jsx(zu.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(zu.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(J_,{...e,ref:t})})}));uw.displayName=Fi;var J_=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...m}=e,f=h.useRef(null),p=le(t,f),v=Di(i),[g,w]=Rr({prop:a,defaultProp:l??null,onChange:c,caller:Fi}),[x,y]=h.useState(!1),b=Be(d),N=cw(n),j=h.useRef(!1),[C,k]=h.useState(0);return h.useEffect(()=>{const P=f.current;if(P)return P.addEventListener(hd,b),()=>P.removeEventListener(hd,b)},[b]),s.jsx(X_,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:g,onItemFocus:h.useCallback(P=>w(P),[w]),onItemShiftTab:h.useCallback(()=>y(!0),[]),onFocusableItemAdd:h.useCallback(()=>k(P=>P+1),[]),onFocusableItemRemove:h.useCallback(()=>k(P=>P-1),[]),children:s.jsx(J.div,{tabIndex:x||C===0?-1:0,"data-orientation":r,...m,ref:p,style:{outline:"none",...e.style},onMouseDown:X(e.onMouseDown,()=>{j.current=!0}),onFocus:X(e.onFocus,P=>{const E=!j.current;if(P.target===P.currentTarget&&E&&!x){const R=new CustomEvent(hd,q_);if(P.currentTarget.dispatchEvent(R),!R.defaultPrevented){const _=N().filter(z=>z.focusable),M=_.find(z=>z.active),O=_.find(z=>z.id===g),H=[M,O,..._].filter(Boolean).map(z=>z.ref.current);pw(H,u)}}j.current=!1}),onBlur:X(e.onBlur,()=>y(!1))})})}),mw="RovingFocusGroupItem",fw=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:a,...l}=e,c=yo(),d=i||c,u=Z_(mw,n),m=u.currentTabStopId===d,f=cw(n),{onFocusableItemAdd:p,onFocusableItemRemove:v,currentTabStopId:g}=u;return h.useEffect(()=>{if(r)return p(),()=>v()},[r,p,v]),s.jsx(zu.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:s.jsx(J.span,{tabIndex:m?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:X(e.onMouseDown,w=>{r?u.onItemFocus(d):w.preventDefault()}),onFocus:X(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:X(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){u.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=nA(w,u.orientation,u.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let b=f().filter(N=>N.focusable).map(N=>N.ref.current);if(x==="last")b.reverse();else if(x==="prev"||x==="next"){x==="prev"&&b.reverse();const N=b.indexOf(w.currentTarget);b=u.loop?rA(b,N+1):b.slice(N+1)}setTimeout(()=>pw(b))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:g!=null}):a})})});fw.displayName=mw;var eA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nA(e,t,n){const r=tA(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return eA[r]}function pw(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sA=uw,oA=fw,gc="Tabs",[iA,Z3]=Bt(gc,[dw]),hw=dw(),[aA,Cf]=iA(gc),gw=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Di(l),[m,f]=Rr({prop:r,onChange:o,defaultProp:i??"",caller:gc});return s.jsx(aA,{scope:n,baseId:yo(),value:m,onValueChange:f,orientation:a,dir:u,activationMode:c,children:s.jsx(J.div,{dir:u,"data-orientation":a,...d,ref:t})})});gw.displayName=gc;var xw="TabsList",vw=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Cf(xw,n),a=hw(n);return s.jsx(sA,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(J.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});vw.displayName=xw;var yw="TabsTrigger",bw=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=Cf(yw,n),l=hw(n),c=jw(a.baseId,r),d=Sw(a.baseId,r),u=r===a.value;return s.jsx(oA,{asChild:!0,...l,focusable:!o,active:u,children:s.jsx(J.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:X(e.onMouseDown,m=>{!o&&m.button===0&&m.ctrlKey===!1?a.onValueChange(r):m.preventDefault()}),onKeyDown:X(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(r)}),onFocus:X(e.onFocus,()=>{const m=a.activationMode!=="manual";!u&&!o&&m&&a.onValueChange(r)})})})});bw.displayName=yw;var ww="TabsContent",Nw=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,l=Cf(ww,n),c=jw(l.baseId,r),d=Sw(l.baseId,r),u=r===l.value,m=h.useRef(u);return h.useEffect(()=>{const f=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(f)},[]),s.jsx(qn,{present:o||u,children:({present:f})=>s.jsx(J.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:d,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:f&&i})})});Nw.displayName=ww;function jw(e,t){return`${e}-trigger-${t}`}function Sw(e,t){return`${e}-content-${t}`}var lA=gw,kw=vw,Cw=bw,Ew=Nw;const Rw=lA,Ef=h.forwardRef(({className:e,...t},n)=>s.jsx(kw,{ref:n,className:I("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Ef.displayName=kw.displayName;const Hs=h.forwardRef(({className:e,...t},n)=>s.jsx(Cw,{ref:n,className:I("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}));Hs.displayName=Cw.displayName;const Ks=h.forwardRef(({className:e,...t},n)=>s.jsx(Ew,{ref:n,className:I("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ks.displayName=Ew.displayName;const Pw=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:I("w-full caption-bottom text-sm",e),...t})}));Pw.displayName="Table";const _w=h.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:I("[&_tr]:border-b",e),...t}));_w.displayName="TableHeader";const Aw=h.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:I("[&_tr:last-child]:border-0",e),...t}));Aw.displayName="TableBody";const cA=h.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:I("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));cA.displayName="TableFooter";const Bu=h.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:I("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Bu.displayName="TableRow";const Vu=h.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:I("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Vu.displayName="TableHead";const Wu=h.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:I("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Wu.displayName="TableCell";const dA=h.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:I("mt-4 text-sm text-muted-foreground",e),...t}));dA.displayName="TableCaption";const uA={low:"bg-primary text-primary-foreground",medium:"bg-warning text-primary-foreground",high:"bg-destructive text-destructive-foreground"},mA={best:"border-primary/50",likely:"border-secondary",worst:"border-warning",tail:"border-destructive"},fA={best:"text-primary",likely:"text-secondary-foreground",worst:"text-warning",tail:"text-destructive"},ug={positive:{color:"bg-primary",label:"+"},neutral:{color:"bg-muted-foreground",label:"○"},negative:{color:"bg-destructive",label:"−"}},pA=({result:e})=>s.jsx("section",{className:"border-t border-border py-12",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs(Rw,{defaultValue:"paths",className:"mx-auto max-w-5xl",children:[s.jsxs(Ef,{className:"mb-8 w-full justify-start",children:[s.jsx(Hs,{value:"paths",children:"Reasoning Paths"}),s.jsx(Hs,{value:"matrix",children:"Strategy Matrix"}),s.jsx(Hs,{value:"outcomes",children:"Projected Outcomes"})]}),s.jsx(Ks,{value:"paths",children:s.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.paths.map((t,n)=>s.jsxs(pe,{className:`animate-fade-in-up border-border ${t.recommended?"border-primary glow-teal":""}`,style:{animationDelay:`${n*100}ms`},children:[s.jsx(Pe,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(_e,{className:"text-base",children:[t.name,t.recommended&&s.jsx("span",{className:"ml-2 text-xs font-normal text-primary",children:"★ Recommended"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm font-mono text-primary",children:[t.probability,"%"]}),s.jsx(ce,{className:uA[t.riskLevel],children:t.riskLevel})]})]})}),s.jsxs(he,{children:[s.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:t.description}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-1.5 text-xs font-medium text-foreground",children:"Key Tradeoffs:"}),s.jsx("ul",{className:"space-y-1",children:t.tradeoffs.map((r,o)=>s.jsxs("li",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[s.jsx("span",{className:"mt-1 h-1 w-1 shrink-0 rounded-full bg-muted-foreground"}),r]},o))})]})]})]},n))})}),s.jsx(Ks,{value:"matrix",children:s.jsx(pe,{className:"border-border",children:s.jsx(he,{className:"pt-6",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Pw,{children:[s.jsx(_w,{children:s.jsxs(Bu,{children:[s.jsx(Vu,{className:"text-foreground",children:"Stakeholder"}),e.matrix.strategies.map((t,n)=>s.jsx(Vu,{className:"text-center text-foreground",children:t},n))]})}),s.jsx(Aw,{children:e.matrix.stakeholders.map((t,n)=>s.jsxs(Bu,{children:[s.jsx(Wu,{className:"font-medium text-foreground",children:t}),e.matrix.reactions[n].map((r,o)=>s.jsx(Wu,{className:"text-center",children:s.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[s.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${ug[r].color}`}),s.jsx("span",{className:"text-xs text-muted-foreground",children:ug[r].label})]})},o))]},n))})]})})})})}),s.jsx(Ks,{value:"outcomes",children:s.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.outcomes.map((t,n)=>s.jsxs(pe,{className:`animate-fade-in-up border-l-4 ${mA[t.type]}`,style:{animationDelay:`${n*100}ms`},children:[s.jsx(Pe,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(_e,{className:"text-base",children:t.label}),s.jsxs("span",{className:`text-sm font-mono ${fA[t.type]}`,children:[t.likelihood,"%"]})]})}),s.jsxs(he,{children:[s.jsx("p",{className:"mb-2 text-xs text-muted-foreground italic",children:t.conditions}),s.jsx("p",{className:"mb-3 text-sm text-foreground",children:t.description}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Impact"}),s.jsx("div",{className:"flex gap-0.5",children:Array.from({length:10}).map((r,o)=>s.jsx("div",{className:`h-2 w-2 rounded-sm ${o<t.impactRating?"bg-primary":"bg-muted"}`},o))}),s.jsxs("span",{className:"text-xs font-mono text-primary",children:[t.impactRating,"/10"]})]})]})]},n))})})]})})}),hA={low:"bg-muted text-muted-foreground",medium:"bg-secondary text-secondary-foreground",high:"bg-warning text-primary-foreground",critical:"bg-destructive text-destructive-foreground"},gA=({challenges:e})=>s.jsx("section",{className:"border-t border-border py-12",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"mx-auto max-w-4xl",children:[s.jsx("h2",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Your assumptions were challenged"}),s.jsx("div",{className:"space-y-4",children:e.map((t,n)=>s.jsx(pe,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:s.jsxs(he,{className:"pt-6",children:[s.jsxs("div",{className:"mb-3 flex items-start justify-between gap-4",children:[s.jsx("h4",{className:"font-semibold text-foreground",children:t.assumption}),s.jsx(ce,{className:hA[t.severity],children:t.severity})]}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-muted-foreground",children:"Why it might not hold: "}),s.jsx("span",{className:"text-foreground",children:t.whyItMightFail})]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-muted-foreground",children:"What changes if you're wrong: "}),s.jsx("span",{className:"text-foreground",children:t.whatChanges})]})]})]})},n))})]})})}),xA=({recommendations:e})=>s.jsx("section",{className:"border-t border-border py-12",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"mx-auto max-w-4xl",children:[s.jsx("h2",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Recommendations"}),s.jsx("div",{className:"space-y-4",children:e.map((t,n)=>s.jsx(pe,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:s.jsxs(he,{className:"flex gap-5 pt-6",children:[s.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}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"mb-1 font-semibold text-foreground",children:t.action}),s.jsx("p",{className:"mb-2 text-sm text-muted-foreground",children:t.rationale}),s.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:t.timeframe})]})]})},n))})]})})});var xc="Switch",[vA,J3]=Bt(xc),[yA,bA]=vA(xc),Tw=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:l,value:c="on",onCheckedChange:d,form:u,...m}=e,[f,p]=h.useState(null),v=le(t,b=>p(b)),g=h.useRef(!1),w=f?u||!!f.closest("form"):!0,[x,y]=Rr({prop:o,defaultProp:i??!1,onChange:d,caller:xc});return s.jsxs(yA,{scope:n,checked:x,disabled:l,children:[s.jsx(J.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":Ow(x),"data-disabled":l?"":void 0,disabled:l,value:c,...m,ref:v,onClick:X(e.onClick,b=>{y(N=>!N),w&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),w&&s.jsx(Lw,{control:f,bubbles:!g.current,name:r,value:c,checked:x,required:a,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});Tw.displayName=xc;var Iw="SwitchThumb",Mw=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=bA(Iw,n);return s.jsx(J.span,{"data-state":Ow(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Mw.displayName=Iw;var wA="SwitchBubbleInput",Lw=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const a=h.useRef(null),l=le(a,i),c=yf(n),d=af(t);return h.useEffect(()=>{const u=a.current;if(!u)return;const m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&p){const v=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(v)}},[c,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:l,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Lw.displayName=wA;function Ow(e){return e?"checked":"unchecked"}var $w=Tw,NA=Mw;const Rf=h.forwardRef(({className:e,...t},n)=>s.jsx($w,{className:I("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:s.jsx(NA,{className:I("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")})}));Rf.displayName=$w.displayName;const jA={low:"bg-primary/20 text-primary",moderate:"bg-warning/20 text-warning",high:"bg-destructive/20 text-destructive",critical:"bg-destructive text-destructive-foreground"},SA=({goalResult:e,onForkStrategy:t})=>{var v;const[n,r]=h.useState(null),[o,i]=h.useState(null),[a,l]=h.useState({}),[c,d]=h.useState({}),u=g=>{r(n===g?null:g)},m=g=>{i(o===g.id?null:g.id);const w={};g.levers_used.forEach(x=>{w[x]=!0}),l(w)},f=g=>{const w=Object.entries(a).filter(([,x])=>x).map(([x])=>x);t==null||t(g,w),i(null)},p=g=>e.swarm_tests.find(w=>w.strategy_id===g);return s.jsx("section",{className:"border-t border-border py-8",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"mx-auto max-w-5xl",children:[s.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[s.jsx("h2",{className:"text-2xl font-bold tracking-tight text-foreground",children:"Strategy Lab"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Recommended: ",s.jsx("span",{className:"text-primary font-medium",children:(v=e.strategies.find(g=>g.id===e.recommended_strategy_id))==null?void 0:v.label})]})]}),s.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.strategies.map(g=>{const w=p(g.id),x=g.id===e.recommended_strategy_id,y=c[g.id]||"overview";return s.jsxs(pe,{className:I("border-border transition-all",x&&"border-primary glow-teal"),children:[s.jsx(Pe,{className:"pb-2",children:s.jsx("div",{className:"flex items-start justify-between gap-2",children:s.jsxs("div",{children:[s.jsxs(_e,{className:"text-base",children:[g.label,x&&s.jsx("span",{className:"ml-2 text-xs text-primary",children:"★"})]}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[s.jsxs("span",{className:"text-xs font-mono text-primary",children:[(g.success_probability*100).toFixed(0),"% success"]}),s.jsxs(ce,{className:jA[g.risk],children:[g.risk," risk"]}),g.red_line_violations.length>0&&s.jsx(ce,{variant:"destructive",className:"text-[10px]",children:"RED LINE"})]})]})})}),s.jsxs(he,{className:"space-y-3",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:g.description}),s.jsxs(Rw,{value:y,onValueChange:b=>d(N=>({...N,[g.id]:b})),children:[s.jsxs(Ef,{className:"h-8 w-full",children:[s.jsx(Hs,{value:"overview",className:"text-xs flex-1",children:"Overview"}),s.jsxs(Hs,{value:"timeline",className:"text-xs flex-1",children:[s.jsx(Xl,{className:"mr-1 h-3 w-3"}),"Timeline"]})]}),s.jsxs(Ks,{value:"overview",className:"mt-3 space-y-2",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.jsx("span",{className:"font-medium text-foreground",children:"Levers:"})," ",g.levers_used.join(", ")]}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.jsx("span",{className:"font-medium text-foreground",children:"Timeframe:"})," ",g.estimated_timeframe]}),w&&s.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.jsx("span",{className:"font-medium text-foreground",children:"Swarm result:"})," ",w.goal_reached?"Goal reached":`${(w.goal_proximity*100).toFixed(0)}% proximity`]})]}),s.jsx(Ks,{value:"timeline",className:"mt-3",children:s.jsx("div",{className:"relative ml-3 border-l border-border pl-4",children:g.steps.map(b=>s.jsxs("div",{className:"relative mb-4 last:mb-0",children:[s.jsx("div",{className:"absolute -left-[21px] top-1 h-3 w-3 rounded-full border-2 border-primary bg-background"}),s.jsx("p",{className:"text-[10px] text-muted-foreground",children:b.timeframe}),s.jsx("p",{className:"text-xs font-medium text-foreground",children:b.action}),s.jsxs("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["Lever: ",b.lever," · Effect: ",b.expected_effect]})]},b.order))})})]}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsxs(Z,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>u(g.id),children:[s.jsx(Zl,{className:"mr-1 h-3 w-3"}),n===g.id?"HIDE":"SHOW WHY"]}),s.jsxs(Z,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>m(g),children:[s.jsx(Ym,{className:"mr-1 h-3 w-3"}),"FORK STRATEGY"]})]}),n===g.id&&s.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3 animate-in fade-in-0 slide-in-from-top-1",children:[s.jsx("h4",{className:"mb-2 text-xs font-semibold text-foreground",children:"Why this strategy?"}),s.jsxs("div",{className:"space-y-2 text-xs text-muted-foreground",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-foreground",children:"Drivers:"})," ",g.dependencies.join("; ")]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-foreground",children:"Failure modes:"})," ",g.failure_modes.join("; ")]}),g.likely_allies&&g.likely_allies.length>0&&s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-foreground",children:"Allies:"})," ",g.likely_allies.join(", ")]}),g.likely_opponents&&g.likely_opponents.length>0&&s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-foreground",children:"Opponents:"})," ",g.likely_opponents.join(", ")]})]})]}),o===g.id&&s.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:[s.jsx("h4",{className:"mb-2 text-xs font-semibold text-foreground",children:"Toggle Levers"}),s.jsx("div",{className:"space-y-2",children:g.levers_used.map(b=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-foreground",children:b}),s.jsx(Rf,{checked:a[b]??!0,onCheckedChange:N=>l(j=>({...j,[b]:N}))})]},b))}),s.jsx(Z,{size:"sm",className:"mt-3 w-full text-xs",onClick:()=>f(g.id),children:"RUN NEW PATH"})]})]})]},g.id)})}),s.jsxs("div",{className:"mt-6 rounded-lg border border-border bg-card p-4",children:[s.jsx("p",{className:"text-sm text-foreground",children:e.recommendation_rationale}),s.jsxs("p",{className:"mt-2 text-xs text-primary font-medium",children:["Immediate next step: ",e.immediate_next_step]})]})]})})})},kA=["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"],CA=({strategy:e,onInjectEvent:t,forkedTimeline:n})=>{const[r,o]=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 s.jsx("section",{className:"border-t border-border py-8",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"mx-auto max-w-4xl",children:[s.jsx("h2",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Decision Time Machine"}),s.jsxs(pe,{className:"border-border",children:[s.jsx(Pe,{className:"pb-3",children:s.jsxs(_e,{className:"flex items-center gap-2 text-base",children:[s.jsx(kr,{className:"h-4 w-4 text-primary"}),"Timeline: ",e.label]})}),s.jsxs(he,{className:"space-y-6",children:[s.jsxs("div",{className:"relative ml-3 border-l-2 border-border pl-6",children:[e.steps.map((m,f)=>s.jsxs("div",{className:`relative mb-6 last:mb-0 transition-opacity ${n&&f>n.injectedEvent.atStep?"opacity-40":""}`,children:[s.jsx("div",{className:`absolute -left-[29px] top-1 h-4 w-4 rounded-full border-2 ${f===r?"border-primary bg-primary":f<=r?"border-primary bg-background":"border-muted-foreground bg-background"}`}),s.jsx("p",{className:"text-[10px] font-mono text-muted-foreground",children:m.timeframe}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:m.action}),s.jsx("p",{className:"text-xs text-muted-foreground",children:m.expected_effect}),n&&f===n.injectedEvent.atStep&&s.jsxs("div",{className:"mt-2 flex items-start gap-2 rounded border border-warning/30 bg-warning/10 px-3 py-2",children:[s.jsx(kr,{className:"mt-0.5 h-3 w-3 shrink-0 text-warning"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-bold text-warning",children:"EVENT INJECTED"}),s.jsx("p",{className:"text-xs text-foreground",children:n.injectedEvent.event})]})]})]},m.order)),n&&s.jsxs("div",{className:"mt-4 ml-4 border-l-2 border-primary/50 pl-6",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(Ym,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"text-xs font-bold text-primary",children:"FORKED TIMELINE"})]}),n.forkedSteps.map((m,f)=>s.jsxs("div",{className:"relative mb-4 last:mb-0",children:[s.jsx("div",{className:"absolute -left-[29px] top-1 h-3 w-3 rounded-full border-2 border-primary/50 bg-background"}),s.jsx("p",{className:"text-[10px] font-mono text-muted-foreground",children:m.timeframe}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:m.action}),s.jsx("p",{className:"text-xs text-muted-foreground",children:m.expected_effect})]},f)),s.jsxs("div",{className:"mt-3 flex gap-3",children:[s.jsxs(ce,{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),"%"]}),s.jsxs(ce,{variant:"outline",children:["Risk: ",n.riskDelta]})]})]})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"mb-2 block text-xs font-medium text-muted-foreground",children:["Time Scrubber — Step ",r+1," of ",d+1]}),s.jsx(wf,{value:[r],onValueChange:m=>o(m[0]),min:0,max:d,step:1})]}),s.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(kr,{className:"h-4 w-4 text-warning"}),s.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Inject Event at Step ",r+1]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ft,{placeholder:"What happens at this point?",value:i,onChange:m=>a(m.target.value),onKeyDown:m=>m.key==="Enter"&&u()}),s.jsx(Z,{size:"sm",onClick:u,disabled:!i.trim(),children:"RUN FROM HERE"})]}),s.jsxs(Z,{size:"sm",variant:"ghost",className:"mt-2 text-xs",onClick:()=>c(!l),children:[s.jsx(Qm,{className:"mr-1 h-3 w-3"}),"SUGGEST EVENTS"]}),l&&s.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5 animate-in fade-in-0",children:kA.map((m,f)=>s.jsx("button",{onClick:()=>{a(m),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:m},f))})]})]})]})]})})})},EA=({request:e,title:t})=>{const[n,r]=h.useState(null),[o,i]=h.useState(!1),a=h.useCallback(()=>{const c=_5(t,e),d=I5(c);r(d)},[e,t]),l=h.useCallback(async()=>{n&&(await navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2e3))},[n]);return s.jsx("div",{className:"inline-flex flex-col items-start gap-2",children:n?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ft,{value:n,readOnly:!0,className:"w-[320px] text-xs font-mono",onClick:c=>c.target.select()}),s.jsx(Z,{size:"icon",variant:"outline",onClick:l,children:o?s.jsx(qm,{className:"h-4 w-4 text-primary"}):s.jsx(bi,{className:"h-4 w-4"})})]}):s.jsxs(Z,{size:"sm",variant:"outline",onClick:a,className:"text-xs",children:[s.jsx(Y2,{className:"mr-1.5 h-3.5 w-3.5"}),"SHARE SCENARIO"]})})};var vc="Collapsible",[RA,eT]=Bt(vc),[PA,Pf]=RA(vc),Dw=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:a,...l}=e,[c,d]=Rr({prop:r,defaultProp:o??!1,onChange:a,caller:vc});return s.jsx(PA,{scope:n,disabled:i,contentId:yo(),open:c,onOpenToggle:h.useCallback(()=>d(u=>!u),[d]),children:s.jsx(J.div,{"data-state":Af(c),"data-disabled":i?"":void 0,...l,ref:t})})});Dw.displayName=vc;var Fw="CollapsibleTrigger",zw=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Pf(Fw,n);return s.jsx(J.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Af(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:X(e.onClick,o.onOpenToggle)})});zw.displayName=Fw;var _f="CollapsibleContent",Bw=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Pf(_f,e.__scopeCollapsible);return s.jsx(qn,{present:n||o.open,children:({present:i})=>s.jsx(_A,{...r,ref:t,present:i})})});Bw.displayName=_f;var _A=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,a=Pf(_f,n),[l,c]=h.useState(r),d=h.useRef(null),u=le(t,d),m=h.useRef(0),f=m.current,p=h.useRef(0),v=p.current,g=a.open||l,w=h.useRef(g),x=h.useRef(void 0);return h.useEffect(()=>{const y=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(y)},[]),We(()=>{const y=d.current;if(y){x.current=x.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const b=y.getBoundingClientRect();m.current=b.height,p.current=b.width,w.current||(y.style.transitionDuration=x.current.transitionDuration,y.style.animationName=x.current.animationName),c(r)}},[a.open,r]),s.jsx(J.div,{"data-state":Af(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!g,...i,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:g&&o})});function Af(e){return e?"open":"closed"}var AA=Dw;const Qe=AA,Xe=zw,Ze=Bw,TA=({governance:e,engineLoaded:t})=>{const[n,r]=h.useState(!1),o=e.constitutionalChecks.every(u=>u.passed),i=e.constitutionalChecks.filter(u=>!u.passed),a=e.neuroverse,l=(a==null?void 0:a.guardStatus)==="BLOCK"||i.length>0,c=(a==null?void 0:a.guardStatus)==="PAUSE",d=t??(a!==void 0&&a.guardStatus!==void 0);return s.jsx("section",{className:"border-t border-border py-8",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"mx-auto max-w-4xl space-y-3",children:[s.jsxs("div",{className:I("flex items-center gap-2 rounded-lg border px-4 py-2.5",d?"border-emerald-500/30 bg-emerald-500/5":"border-yellow-500/30 bg-yellow-500/5"),children:[s.jsx(ul,{className:I("h-3.5 w-3.5",d?"text-emerald-400":"text-yellow-400")}),s.jsx("span",{className:I("text-xs font-bold uppercase tracking-wider",d?"text-emerald-400":"text-yellow-400"),children:d?"Enforced":"Preview"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:d?"Rules active — governance engine loaded":"Rules shown but not enforced — governance engine not connected"})]}),(l||c)&&s.jsxs("div",{className:I("rounded-lg border-2 px-5 py-4 flex items-start gap-3",l?"border-red-500/50 bg-red-500/10":"border-yellow-500/50 bg-yellow-500/10"),children:[l?s.jsx(W2,{className:"h-5 w-5 text-red-400 shrink-0 mt-0.5"}):s.jsx(Un,{className:"h-5 w-5 text-yellow-400 shrink-0 mt-0.5"}),s.jsxs("div",{className:"space-y-2 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:I("inline-flex items-center rounded px-2 py-0.5 text-xs font-bold uppercase tracking-wider",l?"bg-red-500/20 text-red-400":"bg-yellow-500/20 text-yellow-400"),children:l?"BLOCK":"PAUSE"}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Governance Intervention Active"})]}),i.map(u=>s.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[s.jsxs("span",{className:"font-mono text-xs text-red-400/70 mt-0.5",children:["[",u.ruleId,"]"]}),s.jsx("span",{className:"text-foreground/90",children:u.rule}),u.detail&&s.jsxs("span",{className:"text-muted-foreground",children:["— ",u.detail]})]},u.ruleId)),(a==null?void 0:a.guardStatus)==="BLOCK"&&i.length===0&&s.jsx("p",{className:"text-sm text-foreground/90",children:"Liquidity floor violated — impacts capped by governance rules"}),(a==null?void 0:a.collapseRisk)&&a.collapseRisk!=="none"&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["System risk: ",s.jsx("span",{className:I("font-medium",a.collapseRisk==="high"?"text-red-400":a.collapseRisk==="moderate"?"text-yellow-400":"text-emerald-400"),children:a.collapseRisk}),a.worldHealthScore!==void 0&&s.jsxs(s.Fragment,{children:[" · Stability: ",a.worldHealthScore,"%"]})]})]})]}),s.jsxs(Qe,{open:n,onOpenChange:r,children:[s.jsxs(Xe,{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:[s.jsxs("div",{className:"flex items-center gap-3",children:[o?s.jsx(Ma,{className:"h-5 w-5 text-primary"}):s.jsx(Fv,{className:"h-5 w-5 text-destructive"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Rules & Constraints"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.constitutionalChecks.length," rules checked · Status: ",e.authorityLevel.replace(/_/g," "),a&&s.jsxs(s.Fragment,{children:[" · Permission: ",s.jsx("span",{className:I("font-medium",a.guardStatus==="ALLOW"?"text-emerald-400":a.guardStatus==="BLOCK"?"text-red-400":"text-yellow-400"),children:a.guardStatus})]})]})]})]}),s.jsx(at,{className:I("h-4 w-4 text-muted-foreground transition-transform duration-200",n&&"rotate-180")})]}),s.jsxs(Ze,{className:"mt-3 space-y-4 animate-in fade-in-0 slide-in-from-top-2",children:[s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[{icon:I2,label:"Request ID",value:e.traceId.slice(0,12)+"…"},{icon:Ma,label:"Permission",value:e.authorityLevel.replace(/_/g," ")},{icon:Xl,label:"Timestamp",value:new Date(e.timestamp).toLocaleTimeString()},{icon:Ma,label:"Version",value:`v${e.engineVersion}`}].map(u=>s.jsxs("div",{className:"rounded-md border border-border bg-card p-3",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(u.icon,{className:"h-3 w-3"}),u.label]}),s.jsx("p",{className:"mt-1 text-xs font-medium text-foreground",children:u.value})]},u.label))}),s.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[s.jsx("div",{className:"border-b border-border px-4 py-2.5",children:s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Safety Rules"})}),s.jsx("div",{className:"divide-y divide-border",children:e.constitutionalChecks.map(u=>s.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[s.jsx("span",{className:I("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-bold",u.passed?"bg-primary/20 text-primary":"bg-destructive/20 text-destructive"),children:u.passed?"✓":"✗"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:u.rule}),u.detail&&s.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:u.detail}),s.jsx("span",{className:"mt-1 inline-block rounded bg-muted px-1.5 py-0.5 text-[10px] font-mono text-muted-foreground",children:u.ruleId})]})]},u.ruleId))})]}),e.enforcedConstraints.length>0&&s.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[s.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Active Rules"}),s.jsx("ul",{className:"space-y-1.5",children:e.enforcedConstraints.map((u,m)=>s.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[s.jsx("span",{className:"mt-1 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),u]},m))})]})]})]})]})})})},IA=({report:e,governance:t,isGenerating:n,aiEnabled:r,provider:o,onGenerate:i,onToggleAI:a})=>{const[l,c]=h.useState(!1),d=()=>{if(!e)return;const m=mg(e);navigator.clipboard.writeText(m),c(!0),setTimeout(()=>c(!1),2e3)},u=()=>{if(!e)return;const m=mg(e),f=new Blob([m],{type:"text/markdown"}),p=URL.createObjectURL(f),v=document.createElement("a");v.href=p,v.download="governed-report.md",v.click(),URL.revokeObjectURL(p)};return s.jsx("section",{className:"border-t border-border py-8",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Pr,{className:"h-5 w-5 text-primary"}),s.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Governed Report"}),t&&s.jsxs("span",{className:I("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:[s.jsx(et,{className:"h-3 w-3"}),t.trace.passed?"Governed":"Violations"]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"AI Assist"}),s.jsx(Rf,{checked:r,onCheckedChange:a})]}),s.jsx(Z,{variant:"outline",size:"sm",onClick:i,disabled:n,className:"gap-2",children:n?s.jsxs(s.Fragment,{children:[s.jsx(ul,{className:"h-3 w-3 animate-pulse"}),"Generating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Pr,{className:"h-3 w-3"}),"Generate Report"]})})]})]}),e&&s.jsxs("div",{className:"space-y-4 animate-in fade-in-0 slide-in-from-top-2",children:[t&&s.jsx("div",{className:I("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:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(et,{className:"h-3 w-3"}),s.jsxs("span",{children:["Actor: ",s.jsx("span",{className:"text-foreground font-mono",children:t.actor})," · ","Action: ",s.jsx("span",{className:"text-foreground font-mono",children:t.action})," · ","Provider: ",s.jsx("span",{className:"text-foreground font-medium",children:o})," · ","Constraints: ",t.trace.constraints.length," checked",t.trace.violations.length>0&&s.jsxs("span",{className:"text-yellow-400",children:[" · ",t.trace.violations.length," violation(s)"]})]})]})}),s.jsxs("div",{className:"rounded-lg border border-border bg-card p-5",children:[s.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Executive Summary"}),s.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:e.executiveSummary})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.keyEvents.length>0&&s.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[s.jsx("h4",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Key Events"}),s.jsx("div",{className:"space-y-2",children:e.keyEvents.map((m,f)=>s.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[s.jsxs("span",{className:I("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-[10px] font-bold",m.severity==="critical"?"bg-red-500/20 text-red-400":m.severity==="high"?"bg-orange-500/20 text-orange-400":"bg-yellow-500/20 text-yellow-400"),children:["R",m.round]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-foreground/90",children:m.description}),s.jsx("p",{className:"text-xs text-muted-foreground",children:m.agents.join(", ")})]})]},f))})]}),e.governanceActions.length>0&&s.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[s.jsx("h4",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Governance Actions"}),s.jsx("div",{className:"space-y-2",children:e.governanceActions.map((m,f)=>s.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[s.jsx("span",{className:I("mt-0.5 shrink-0 rounded px-1.5 py-0.5 text-[10px] font-bold uppercase",m.type==="BLOCK"?"bg-red-500/20 text-red-400":m.type==="PAUSE"?"bg-yellow-500/20 text-yellow-400":m.type==="CIRCUIT_BREAKER"?"bg-purple-500/20 text-purple-400":"bg-blue-500/20 text-blue-400"),children:m.type}),s.jsxs("div",{children:[s.jsx("p",{className:"text-foreground/90",children:m.description}),s.jsx("p",{className:"text-xs text-muted-foreground",children:m.agent})]})]},f))})]})]}),s.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(m=>s.jsxs("div",{className:"rounded-md border border-border bg-card p-3 text-center",children:[s.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:m.label}),s.jsx("p",{className:"mt-1 text-sm font-bold text-foreground",children:m.value})]},m.label))}),e.counterfactual&&s.jsxs("div",{className:"rounded-lg border border-dashed border-yellow-500/30 bg-yellow-500/5 p-4",children:[s.jsx("h4",{className:"mb-1 text-xs font-semibold uppercase tracking-wider text-yellow-400/80",children:"Counterfactual"}),s.jsx("p",{className:"text-sm text-foreground/80 italic",children:e.counterfactual})]}),e.observations.length>0&&s.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[s.jsx("h4",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Observations"}),s.jsx("ul",{className:"space-y-1.5",children:e.observations.map((m,f)=>s.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground/90",children:[s.jsx("span",{className:"mt-1 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),m]},f))})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Z,{variant:"ghost",size:"sm",onClick:d,className:"gap-2 text-xs",children:[l?s.jsx(Sn,{className:"h-3 w-3 text-emerald-400"}):s.jsx(bi,{className:"h-3 w-3"}),l?"Copied":"Copy"]}),s.jsxs(Z,{variant:"ghost",size:"sm",onClick:u,className:"gap-2 text-xs",children:[s.jsx(Ov,{className:"h-3 w-3"}),"Download .md"]}),s.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["Generated by ",s.jsx("span",{className:"font-medium text-foreground",children:e.generatedBy})," · Governed by ",s.jsx("span",{className:"font-medium text-foreground",children:e.governedBy})]})]})]})]})})})};function mg(e){const t=[];if(t.push(`# Governed Simulation Report
|
|
592
|
+
`),t.push(`> Generated by: ${e.generatedBy} | Governed by: ${e.governedBy}
|
|
593
|
+
`),t.push(`## Executive Summary
|
|
594
|
+
`),t.push(e.executiveSummary+`
|
|
595
|
+
`),e.keyEvents.length>0){t.push(`## Key Events
|
|
596
|
+
`);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
|
|
597
|
+
`);for(const n of e.governanceActions)t.push(`- **[${n.type}]** ${n.agent}: ${n.description}`);t.push("")}if(t.push(`## Metrics
|
|
598
|
+
`),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
|
|
599
|
+
`),t.push(`> ${e.counterfactual}
|
|
600
|
+
`)),e.observations.length>0){t.push(`## Observations
|
|
601
|
+
`);for(const n of e.observations)t.push(`- ${n}`);t.push("")}return t.join(`
|
|
602
|
+
`)}const Vw={error:{icon:Ii,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:Un,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:$v,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:Qm,color:"text-muted-foreground",bg:"bg-muted/30",border:"border-border",label:"Hint",badgeBg:"bg-muted text-muted-foreground"}},Ww={conflict:"Rule Conflicts",coverage:"Coverage Gaps",strength:"Enforcement Strength",constraint:"Constraint Balance",structure:"Structure"};function MA({counts:e}){return s.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:[s.jsx("span",{className:"text-muted-foreground uppercase tracking-wider",children:"Problems"}),s.jsxs("div",{className:"flex items-center gap-3",children:[e.errors>0&&s.jsxs("span",{className:"flex items-center gap-1 text-red-400",children:[s.jsx(Ii,{className:"h-3.5 w-3.5"}),e.errors]}),e.warnings>0&&s.jsxs("span",{className:"flex items-center gap-1 text-yellow-400",children:[s.jsx(Un,{className:"h-3.5 w-3.5"}),e.warnings]}),e.info>0&&s.jsxs("span",{className:"flex items-center gap-1 text-blue-400",children:[s.jsx($v,{className:"h-3.5 w-3.5"}),e.info]}),e.hints>0&&s.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[s.jsx(Qm,{className:"h-3.5 w-3.5"}),e.hints]}),e.errors===0&&e.warnings===0&&e.info===0&&e.hints===0&&s.jsx("span",{className:"text-green-400",children:"No problems detected"})]})]})}function LA({diagnostic:e,policyText:t,onApplyFix:n,isFixed:r}){const[o,i]=h.useState(!1),a=Vw[e.severity],l=a.icon;let c=null;if(e.source&&t){const u=t.split(`
|
|
603
|
+
`),m=e.source.startLine-1;m>=0&&m<u.length&&(c=u[m].trim())}const d=e.quickFix;return s.jsx(Qe,{open:o,onOpenChange:i,children:s.jsxs("div",{className:I("rounded-lg border transition-colors",r?"border-green-500/30 bg-green-500/5":a.border,!r&&a.bg,o&&"ring-1 ring-primary/20"),children:[s.jsxs(Xe,{className:"flex w-full items-start gap-3 px-4 py-3 text-left",children:[r?s.jsx(Sn,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-400"}):s.jsx(l,{className:I("mt-0.5 h-4 w-4 shrink-0",a.color)}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:I("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}),s.jsx("span",{className:I("text-sm font-medium",r?"text-green-400 line-through opacity-70":"text-foreground"),children:e.message}),r&&s.jsx("span",{className:"text-[10px] font-bold uppercase text-green-400",children:"Fixed"})]}),e.source&&!r&&s.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(Pr,{className:"h-3 w-3"}),s.jsxs("span",{children:["Line ",e.source.startLine,e.source.endLine!==e.source.startLine&&`–${e.source.endLine}`]}),e.relatedRules.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(F2,{className:"ml-2 h-3 w-3"}),s.jsx("span",{children:e.relatedRules.join(", ")})]})]})]}),d&&!r&&n&&s.jsxs(Z,{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:[s.jsx(Fn,{className:"h-3 w-3"}),d.label]}),!r&&(o?s.jsx(at,{className:"mt-1 h-4 w-4 shrink-0 text-muted-foreground"}):s.jsx(Ye,{className:"mt-1 h-4 w-4 shrink-0 text-muted-foreground"}))]}),!r&&s.jsx(Ze,{children:s.jsxs("div",{className:"space-y-3 border-t border-border/50 px-4 py-3",children:[s.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:e.detail}),c&&s.jsxs("div",{className:"rounded-md border border-border bg-background/80 p-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[s.jsx(Pr,{className:"h-3 w-3"}),s.jsxs("span",{children:["policy.txt:",e.source.startLine]})]}),s.jsx("pre",{className:"mt-1.5 overflow-x-auto text-xs",children:s.jsxs("code",{children:[s.jsxs("span",{className:"select-none text-muted-foreground/50",children:[e.source.startLine," │"," "]}),s.jsx("span",{className:I(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&&s.jsxs("div",{className:"space-y-2 rounded-md border border-green-500/20 bg-green-500/5 px-3 py-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(jh,{className:"h-3.5 w-3.5 shrink-0 text-green-400"}),s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-green-400",children:"Quick Fix"})]}),s.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"&&s.jsx("div",{className:"space-y-0.5",children:d.text.split(`
|
|
604
|
+
`).map((u,m)=>s.jsxs("div",{className:"text-green-400",children:[s.jsx("span",{className:"select-none text-green-600",children:"+ "}),u]},m))}),d.operation==="replace"&&s.jsxs("div",{className:"space-y-0.5",children:[c&&s.jsxs("div",{className:"text-red-400",children:[s.jsx("span",{className:"select-none text-red-600",children:"- "}),c]}),d.text.split(`
|
|
605
|
+
`).map((u,m)=>s.jsxs("div",{className:"text-green-400",children:[s.jsx("span",{className:"select-none text-green-600",children:"+ "}),u]},m))]}),d.operation==="remove"&&c&&s.jsxs("div",{className:"text-red-400",children:[s.jsx("span",{className:"select-none text-red-600",children:"- "}),c]})]}),n&&s.jsxs(Z,{size:"sm",className:"w-full gap-1.5 bg-green-600 text-white hover:bg-green-500",onClick:()=>n(d,e.id),children:[s.jsx(Fn,{className:"h-3.5 w-3.5"}),"Apply: ",d.label]})]}),!d&&e.fix&&s.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-muted bg-muted/30 px-3 py-2",children:[s.jsx(jh,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:e.fix})]}),s.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:s.jsx("span",{className:"rounded-full border border-border px-2 py-0.5",children:Ww[e.category]??e.category})})]})})]})})}const OA=({healthCheck:e,policyText:t,onApplyFix:n,fixedDiagnostics:r})=>{const[o,i]=h.useState("all"),a=r??new Set,c=(o==="all"?e.diagnostics:e.diagnostics.filter(u=>u.severity===o)).reduce((u,m)=>{const f=m.category;return u[f]||(u[f]=[]),u[f].push(m),u},{}),d=e.diagnostics.filter(u=>u.quickFix&&!a.has(u.id)).length;return s.jsxs("div",{className:"space-y-4",children:[s.jsx(MA,{counts:e.counts}),d>0&&n&&s.jsx("div",{className:"flex items-center justify-between rounded-md border border-green-500/20 bg-green-500/5 px-4 py-2",children:s.jsxs("span",{className:"text-xs text-green-400",children:[s.jsx(Fn,{className:"mr-1.5 inline h-3.5 w-3.5"}),d," issue",d>1?"s":""," can be auto-fixed"]})}),s.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 m=u==="all"?e.diagnostics.length:e.counts[`${u}s`];return u!=="all"&&m===0?null:s.jsxs("button",{onClick:()=>i(u),className:I("rounded px-3 py-1.5 text-xs font-medium transition-colors",o===u?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[u==="all"?"All":Vw[u].label,m>0&&s.jsxs("span",{className:"ml-1.5 opacity-60",children:["(",m,")"]})]},u)})}),Object.entries(c).length>0?s.jsx("div",{className:"space-y-4",children:Object.entries(c).map(([u,m])=>s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:Ww[u]??u}),m.map(f=>s.jsx(LA,{diagnostic:f,policyText:t,onApplyFix:n,isFixed:a.has(f.id)},f.id))]},u))}):s.jsx("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 px-4 py-6 text-center",children:s.jsx("span",{className:"text-sm text-green-400",children:"No issues found — policy is clean"})})]})},$A={ALLOW:{icon:et,color:"text-green-400",bg:"bg-green-500/10",border:"border-green-500/30",label:"ALLOWED"},BLOCK:{icon:zv,color:"text-red-400",bg:"bg-red-500/10",border:"border-red-500/30",label:"BLOCKED"},MODIFY:{icon:Fv,color:"text-yellow-400",bg:"bg-yellow-500/10",border:"border-yellow-500/30",label:"MODIFIED"},PAUSE:{icon:U2,color:"text-orange-400",bg:"bg-orange-500/10",border:"border-orange-500/30",label:"PAUSED"}};function DA({verdict:e,action:t}){const[n,r]=h.useState(!1),o=$A[e.status],i=o.icon,a=e.rulesFired.filter(l=>l.effect!=="monitored");return s.jsx(Qe,{open:n,onOpenChange:r,children:s.jsxs("div",{className:I("rounded-lg border transition-colors",o.border,o.bg),children:[s.jsxs(Xe,{className:"flex w-full items-start gap-3 px-4 py-3 text-left",children:[s.jsx(i,{className:I("mt-0.5 h-5 w-5 shrink-0",o.color)}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:I("rounded px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",o.bg,o.color),children:o.label}),s.jsx("span",{className:"text-xs text-muted-foreground",children:t.agentId})]}),s.jsx("p",{className:"mt-1 text-sm text-foreground",children:t.description}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:e.reason})]}),s.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[e.status==="MODIFY"&&e.action&&s.jsxs("span",{className:"text-xs text-yellow-400",children:[t.magnitude.toFixed(2)," → ",e.action.magnitude.toFixed(2)]}),n?s.jsx(at,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(Ye,{className:"h-4 w-4 text-muted-foreground"})]})]}),s.jsx(Ze,{children:s.jsxs("div",{className:"space-y-2 border-t border-border/50 px-4 py-3",children:[e.rulesFired.length>0&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Rules Evaluated"}),e.rulesFired.map((l,c)=>s.jsxs("div",{className:I("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:[s.jsx("span",{className:"shrink-0 font-mono text-[10px] opacity-60",children:l.id}),s.jsx("span",{className:"flex-1",children:l.description}),s.jsx("span",{className:"shrink-0 font-bold uppercase text-[10px]",children:l.effect}),l.impactReduction>0&&s.jsxs("span",{className:"shrink-0 font-mono opacity-70",children:["-",(l.impactReduction*100).toFixed(0),"%"]})]},`${l.id}-${c}`))]}),s.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[s.jsxs("span",{children:["Confidence: ",(e.confidence*100).toFixed(0),"%"]}),a.length>0&&s.jsxs("span",{children:[a.length," rule",a.length>1?"s":""," enforced"]})]})]})})]})})}function FA({governor:e,verdictCount:t}){const n=e.stats,r=e.policy;return s.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:[s.jsx("span",{className:"text-muted-foreground uppercase tracking-wider",children:"Governor"}),s.jsxs("span",{className:"text-foreground",children:[r.ruleCount," rules"]}),s.jsxs("span",{className:"text-green-400",children:[r.enforcedCount," enforced"]}),t>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-border",children:"|"}),n.allowed>0&&s.jsxs("span",{className:"text-green-400",children:[n.allowed," allowed"]}),n.blocked>0&&s.jsxs("span",{className:"text-red-400",children:[n.blocked," blocked"]}),n.modified>0&&s.jsxs("span",{className:"text-yellow-400",children:[n.modified," modified"]}),n.paused>0&&s.jsxs("span",{className:"text-orange-400",children:[n.paused," paused"]})]})]})}function zA({onSubmit:e}){const[t,n]=h.useState("custom-agent"),[r,o]=h.useState(""),[i,a]=h.useState(.5),l=()=>{r.trim()&&(e({agentId:t,type:"custom",description:r.trim(),magnitude:i}),o(""))};return s.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-muted/30 p-4",children:[s.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Custom Action"}),s.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-[1fr_2fr_auto]",children:[s.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"}),s.jsx("input",{value:r,onChange:c=>o(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"}),s.jsxs(Z,{onClick:l,disabled:!r.trim(),size:"sm",className:"gap-1.5",children:[s.jsx(kr,{className:"h-3 w-3"}),"Evaluate"]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Magnitude:"}),s.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:i,onChange:c=>a(Number(c.target.value)),className:"flex-1"}),s.jsx("span",{className:I("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 BA=({policyText:e})=>{var f;const[t,n]=h.useState("stressed"),[r,o]=h.useState([]),[i,a]=h.useState(!1),l=h.useMemo(()=>pf({policyText:e,sensitivity:.5}),[e]),c=((f=sd[t])==null?void 0:f.state)??sd.stressed.state,d=h.useCallback(p=>{const v=l.evaluate(p,c);o(g=>[{action:p,verdict:v},...g])},[l,c]),u=h.useCallback(()=>{const p=Wh.map(v=>({action:v,verdict:l.evaluate(v,c)}));o(p)},[l,c]),m=h.useCallback(()=>{o([])},[]);return s.jsxs("div",{className:"space-y-4",children:[s.jsx(FA,{governor:l,verdictCount:r.length}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Lr,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Market Conditions"}),s.jsx("div",{className:"flex gap-1",children:Object.entries(sd).map(([p,{label:v,state:g}])=>s.jsx("button",{onClick:()=>{n(p),o([])},className:I("rounded-full border px-3 py-1 text-xs font-medium transition-colors",t===p?p==="crisis"?"border-red-500/30 bg-red-500/10 text-red-400":p==="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:v},p))})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(c).map(([p,v])=>s.jsxs("span",{className:I("rounded border px-2 py-0.5 font-mono text-[10px]",typeof v=="number"&&v>70||typeof v=="number"&&v<20||v==="panic"||v==="systemic"?"border-red-500/20 text-red-400":"border-border text-muted-foreground"),children:[p,": ",String(v)]},p))}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Z,{onClick:u,size:"sm",className:"gap-1.5",children:[s.jsx(Li,{className:"h-3 w-3"}),"Evaluate All Example Actions"]}),s.jsxs(Z,{onClick:()=>a(!i),variant:"outline",size:"sm",className:"gap-1.5",children:[s.jsx(Dn,{className:"h-3 w-3"}),"Custom Action"]}),r.length>0&&s.jsx("button",{onClick:m,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear results"})]}),i&&s.jsx(zA,{onSubmit:d}),r.length===0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Or evaluate individually:"}),s.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:Wh.map(p=>s.jsxs("button",{onClick:()=>d(p),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:[s.jsx(Uv,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:p.agentId}),s.jsx("p",{className:"text-xs text-foreground",children:p.description}),s.jsx("div",{className:"mt-1 flex items-center gap-2",children:s.jsxs("span",{className:I("font-mono text-[10px] font-bold",p.magnitude>.7?"text-red-400":p.magnitude>.4?"text-yellow-400":"text-green-400"),children:["magnitude: ",p.magnitude.toFixed(2)]})})]})]},p.agentId+p.description))})]}),r.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Governance Verdicts (",r.length,")"]}),r.map(({action:p,verdict:v},g)=>s.jsx(DA,{verdict:v,action:p},`${p.agentId}-${g}`))]})]})},VA={upload:"Upload Policy",parsed:"Rules Parsed",validated:"Logic Validated",simulating:"Simulating...",complete:"Results Ready"};function WA({current:e}){const t=["upload","parsed","validated","simulating","complete"],n=t.indexOf(e);return s.jsx("div",{className:"flex items-center gap-1",children:t.map((r,o)=>{const i=o===n,a=o<n,l=o>n;return s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("div",{className:I("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&&s.jsx(Sn,{className:"h-3 w-3"}),i&&r==="simulating"&&s.jsx(Nu,{className:"h-3 w-3 animate-spin"}),s.jsx("span",{className:"hidden sm:inline",children:VA[r]}),s.jsx("span",{className:"sm:hidden",children:o+1})]}),o<t.length-1&&s.jsx("div",{className:I("h-px w-4 transition-colors",a?"bg-green-500/50":"bg-border")})]},r)})})}function UA({onUpload:e,policyText:t,onTextChange:n}){const r=h.useRef(null),[o,i]=h.useState(!1),a=h.useCallback(d=>{if(!d.name.endsWith(".txt")&&!d.name.endsWith(".md"))return;const u=new FileReader;u.onload=m=>{var p;const f=(p=m.target)==null?void 0:p.result;n(f),e(f)},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 s.jsxs("div",{className:"space-y-4",children:[s.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:I("cursor-pointer rounded-lg border-2 border-dashed p-6 text-center transition-all",o?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-muted/30"),children:[s.jsx(Xm,{className:I("mx-auto mb-2 h-8 w-8",o?"text-primary":"text-muted-foreground")}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Drop your policy document here"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:".txt or .md files accepted"}),s.jsx("input",{ref:r,type:"file",accept:".txt,.md",className:"hidden",onChange:d=>{var m;const u=(m=d.target.files)==null?void 0:m[0];u&&a(u)}})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Or paste policy text directly"}),s.jsx("textarea",{value:t,onChange:d=>n(d.target.value),placeholder:fg,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"}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("button",{onClick:()=>n(fg),className:"text-xs text-primary/70 underline-offset-2 hover:text-primary hover:underline",children:"Load example policy"}),s.jsxs(Z,{onClick:c,disabled:!t.trim(),size:"sm",children:[s.jsx(Li,{className:"mr-1.5 h-3.5 w-3.5"}),"Parse & Validate"]})]})]})]})}function HA({rule:e}){const t=e.enforcement==="structural";return s.jsxs("div",{className:I("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?s.jsx(et,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-400"}):s.jsx(Zl,{className:"mt-0.5 h-4 w-4 shrink-0 text-yellow-400"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.id}),s.jsx("span",{className:I("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"}),s.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:e.category})]}),s.jsx("p",{className:"mt-1 text-sm text-foreground",children:e.description}),e.affectedVariables.length>0&&s.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.affectedVariables.map(n=>s.jsx("span",{className:"rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground",children:n},n))})]})]})}function KA({parsed:e}){const[t,n]=h.useState(!1),r=t?e.rules:e.rules.slice(0,6);return s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/50 px-4 py-2",children:[s.jsx(Pr,{className:"h-4 w-4 text-primary"}),s.jsxs("span",{className:"text-sm font-medium",children:["Parsed ",e.summary.total," rules"]}),s.jsx("span",{className:"mx-1 text-muted-foreground",children:"—"}),s.jsxs("span",{className:"text-sm text-green-400",children:[e.summary.enforced," enforced"]}),s.jsxs("span",{className:"text-sm text-yellow-400",children:[e.summary.advisory," advisory"]})]})}),s.jsx("div",{className:"space-y-2",children:r.map(o=>s.jsx(HA,{rule:o},o.id))}),e.rules.length>6&&s.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 GA({result:e}){const{impact:t,comparison:n}=e,r=[{label:"Stability Change",value:t.stabilityChange,suffix:"%",positive:t.stabilityChange>0,icon:t.stabilityChange>0?Wv:Vv},{label:"Cascade Risk",value:-t.cascadeRiskChange,suffix:"%",positive:t.cascadeRiskChange>0,icon:Lr},{label:"Governance Actions",value:t.governanceActions,suffix:"",positive:!0,icon:et},{label:"Actions Blocked",value:t.actionsBlocked,suffix:"%",positive:t.actionsBlocked<70,icon:Ii}];return s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:r.map(o=>{const i=o.icon;return s.jsxs("div",{className:I("rounded-lg border p-4 text-center",o.positive?"border-green-500/20 bg-green-500/5":"border-red-500/20 bg-red-500/5"),children:[s.jsx(i,{className:I("mx-auto mb-1 h-5 w-5",o.positive?"text-green-400":"text-red-400")}),s.jsxs("div",{className:I("text-2xl font-bold",o.positive?"text-green-400":"text-red-400"),children:[o.value>0?"+":"",o.value.toFixed(0),o.suffix]}),s.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:o.label})]},o.label)})}),t.preventedCollapse&&s.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:[s.jsx(Sn,{className:"h-5 w-5 text-green-400"}),s.jsx("span",{className:"text-sm font-medium text-green-400",children:"Policy prevented system collapse"})]}),t.overConstraintScore>.7&&s.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:[s.jsx(Un,{className:"h-5 w-5 text-red-400"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm font-medium text-red-400",children:"Over-constrained Policy Detected"}),s.jsxs("p",{className:"mt-0.5 text-xs text-red-300/70",children:[t.actionsBlocked.toFixed(0),"% of actions blocked — risk of system freeze"]})]})]}),s.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-4 py-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Governance Effectiveness"}),s.jsxs("span",{className:"text-sm font-bold text-primary",children:[(n.comparison.governanceEffectiveness*100).toFixed(0),"%"]})]}),s.jsx("div",{className:"mt-2 h-2 overflow-hidden rounded-full bg-muted",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${n.comparison.governanceEffectiveness*100}%`}})})]})]})}function qA({explanation:e}){return s.jsxs("div",{className:"rounded-lg border border-primary/20 bg-primary/5 px-5 py-4",children:[s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[s.jsx(kr,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"What the Policy Did"})]}),s.jsx("p",{className:"text-sm leading-relaxed text-foreground/90",children:e})]})}function YA({result:e}){const{comparison:t}=e,n=t.baseline.metrics,r=t.governed.metrics,o=[{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 s.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[s.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:[s.jsx("span",{children:"Metric"}),s.jsx("span",{className:"text-center",children:"Baseline"}),s.jsx("span",{className:"text-center",children:"With Policy"})]}),o.map(i=>s.jsxs("div",{className:"grid grid-cols-3 items-center border-b border-border/50 px-4 py-2.5 last:border-b-0",children:[s.jsx("span",{className:"text-sm text-foreground",children:i.label}),s.jsx("span",{className:"text-center font-mono text-sm text-muted-foreground",children:i.baseline}),s.jsx("span",{className:I("text-center font-mono text-sm font-medium",i.better?"text-green-400":"text-red-400"),children:i.policy})]},i.label))]})}const fg=`# Market Stability Policy
|
|
606
|
+
|
|
607
|
+
- Block all large trades exceeding $10M during periods of extreme volatility
|
|
608
|
+
- Require mandatory position reporting for all leveraged positions above 3x
|
|
609
|
+
- Limit maximum system leverage to 5x during elevated volatility conditions
|
|
610
|
+
- Halt all automated trading when volatility index exceeds 80
|
|
611
|
+
- Monitor and report all correlated position clusters exceeding 15% of market volume
|
|
612
|
+
- Encourage diversification of counterparty exposure across market participants
|
|
613
|
+
- Maintain minimum liquidity floor — no agent may drain liquidity below 15% of baseline
|
|
614
|
+
- Require coalition rebalancing when concentration exceeds threshold limits
|
|
615
|
+
- Promote transparency in all large position changes to reduce information asymmetry
|
|
616
|
+
- Suspend new short positions during market panic conditions`,QA=()=>{const[e,t]=h.useState("upload"),[n,r]=h.useState(""),[o,i]=h.useState(null),[a,l]=h.useState(null),[c,d]=h.useState(null),[u,m]=h.useState(!1),[f,p]=h.useState(!0),[v,g]=h.useState(!0),[w,x]=h.useState(!0),[y,b]=h.useState(!0),[N,j]=h.useState(new Set),[C,k]=h.useState(null),P=h.useCallback(O=>{const A=mo(O);i(A);const H=fo(A);return l(H),d(null),{parseResult:A,health:H}},[]),E=h.useCallback(O=>{P(O),t("validated"),j(new Set),k(null)},[P]),R=h.useCallback((O,A)=>{const H=iR(n,O);r(H),P(H),j(z=>new Set([...z,A])),k(O.label),setTimeout(()=>k(null),3e3)},[n,P]),_=h.useCallback(async()=>{if(!(!o||!(a!=null&&a.canSimulate))){m(!0),t("simulating");try{const O=await uR(n);d(O),t("complete")}catch(O){console.error("Policy simulation failed:",O),t("validated")}finally{m(!1)}}},[o,a,n]),M=h.useCallback(()=>{t("upload"),r(""),i(null),l(null),d(null),m(!1),j(new Set),k(null)},[]);return s.jsx("section",{className:"border-t border-border py-12",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"mx-auto max-w-4xl space-y-8",children:[s.jsxs("div",{className:"space-y-3 text-center",children:[s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-primary/30 bg-primary/10 px-4 py-1.5",children:[s.jsx(et,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"Policy Enforcement Lab"})]}),s.jsx("h2",{className:"text-2xl font-bold tracking-tight text-foreground sm:text-3xl",children:"Test a policy before it exists"}),s.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."})]}),s.jsx("div",{className:"flex justify-center",children:s.jsx(WA,{current:e})}),e==="upload"&&s.jsx(UA,{onUpload:E,policyText:n,onTextChange:r}),o&&e!=="upload"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Qe,{open:v,onOpenChange:g,children:[s.jsxs(Xe,{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:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Pr,{className:"h-4 w-4 text-primary"}),s.jsxs("span",{className:"text-sm font-medium",children:["Parsed Rules (",o.summary.total,")"]}),s.jsxs("span",{className:"text-xs text-green-400",children:[o.summary.enforced," enforced"]}),s.jsxs("span",{className:"text-xs text-yellow-400",children:[o.summary.advisory," advisory"]})]}),v?s.jsx(at,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(Ye,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(Ze,{children:s.jsx("div",{className:"mt-3",children:s.jsx(KA,{parsed:o})})})]}),a&&s.jsxs(Qe,{open:f,onOpenChange:p,children:[s.jsxs(Xe,{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:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Lr,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"text-sm font-medium",children:"Policy Health Check"}),a.counts.errors>0&&s.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:[s.jsx(Ii,{className:"h-3 w-3"}),a.counts.errors," errors"]}),a.counts.warnings>0&&s.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:[s.jsx(Un,{className:"h-3 w-3"}),a.counts.warnings," warnings"]}),a.counts.errors===0&&a.counts.warnings===0&&s.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:[s.jsx(Sn,{className:"h-3 w-3"}),"Healthy"]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Score: ",a.healthScore,"/100"]})]}),f?s.jsx(at,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(Ye,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(Ze,{children:s.jsx("div",{className:"mt-3",children:s.jsx(OA,{healthCheck:a,policyText:n,onApplyFix:R,fixedDiagnostics:N})})})]}),a&&o&&o.summary.total>0&&s.jsxs(Qe,{open:w,onOpenChange:x,children:[s.jsxs(Xe,{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:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(et,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"text-sm font-medium",children:"Governance Playground"}),s.jsx("span",{className:"rounded bg-primary/20 px-1.5 py-0.5 text-[10px] font-bold uppercase text-primary",children:"Live"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Test agent actions against your policy"})]}),w?s.jsx(at,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(Ye,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(Ze,{children:s.jsx("div",{className:"mt-3",children:s.jsx(BA,{policyText:n})})})]}),C&&s.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:[s.jsx(Sn,{className:"h-4 w-4 text-green-400"}),s.jsxs("span",{className:"text-sm text-green-400",children:["Applied: ",C]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— Policy re-parsed with ",o==null?void 0:o.summary.total," rules (",o==null?void 0:o.summary.enforced," enforced)"]}),c&&s.jsxs(Z,{size:"sm",variant:"outline",className:"ml-auto gap-1.5",onClick:_,children:[s.jsx(Nu,{className:"h-3 w-3"}),"Re-simulate"]})]}),e==="validated"&&(a==null?void 0:a.canSimulate)&&s.jsx("div",{className:"flex justify-center",children:s.jsxs(Z,{onClick:_,size:"lg",className:"gap-2",children:[s.jsx(bh,{className:"h-4 w-4"}),"Run Simulation — Baseline vs. Policy"]})}),e==="simulating"&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[s.jsx(Nu,{className:"h-8 w-8 animate-spin text-primary"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Running baseline and governed simulations..."})]}),c&&e==="complete"&&s.jsxs("div",{className:"space-y-6",children:[s.jsx(GA,{result:c}),s.jsx(qA,{explanation:c.explanation}),s.jsxs(Qe,{open:y,onOpenChange:b,children:[s.jsxs(Xe,{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:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(bh,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"text-sm font-medium",children:"Baseline vs. Policy Comparison"})]}),y?s.jsx(at,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(Ye,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(Ze,{children:s.jsx("div",{className:"mt-3",children:s.jsx(YA,{result:c})})})]}),s.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-4 py-3",children:s.jsx("p",{className:"text-xs italic text-muted-foreground",children:c.comparison.comparison.narrative})})]}),e!=="simulating"&&s.jsx("div",{className:"flex justify-center pt-4",children:s.jsx("button",{onClick:M,className:"text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:"Upload a different policy"})})]})]})})})};function Si(e){var i;const t=XA(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,o=uo[r];if(!o)throw new Error(`Unknown preset: ${e}. Available: ${Object.keys(uo).join(", ")}`);if(!((i=o.world)!=null&&i.inline_definition))throw new Error(`Preset "${e}" has no world definition.`);return{id:o.world.world_id,title:o.title,scenario:o.scenario,stakeholders:o.stakeholders,assumptions:o.assumptions,constraints:o.constraints,swarm:o.swarm??{enabled:!0,rounds:5,reaction_model:"mixed"},depth:o.depth,world:o.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:o.stakeholders.filter(a=>a.disposition==="supportive").map(a=>a.id),harms_stakeholders:o.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:o.stakeholders.filter(a=>a.disposition!=="hostile").map(a=>a.id),harms_stakeholders:[]}]}}function XA(e){try{const t=Z5(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"]}],o={severity:"high"},i={};try{const a=Si(t.basePreset);n=a.scenario,r=a.stakeholders,o=a.assumptions,i=a.constraints}catch{}return{id:t.id,title:t.name,scenario:n,stakeholders:r,assumptions:o,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 ZA(e,t,n){var N,j;const r=Si(e),o=Si(t),i=r.scenario+" "+o.scenario,a=JA(r.stakeholders,o.stakeholders),l=r.paths;(N=n==null?void 0:n.onProgress)==null||N.call(n,"World A","simulating");const c=await _u({scenario:i,stakeholders:a,assumptions:r.assumptions,constraints:r.constraints,depth:r.depth,swarm:r.swarm},r.world,l);(j=n==null?void 0:n.onProgress)==null||j.call(n,"World B","simulating");const d=await _u({scenario:i,stakeholders:a,assumptions:o.assumptions,constraints:o.constraints,depth:o.depth,swarm:o.swarm},o.world,l),u=pg(c),m=pg(d),f=c.governed.metrics,p=d.governed.metrics,v=f.stabilityScore-p.stabilityScore,g=f.maxVolatility-p.maxVolatility,w=f.coalitionRisks-p.coalitionRisks,x=f.collapseProbability-p.collapseProbability,y=Math.abs(v)<.02?"equal":v>0?"A":"B",b=e3(r,o,f,p,y);return{scenario:i,worldA:{id:e,thesis:r.world.thesis,invariantCount:r.world.invariants.length,gateCount:(r.world.gates??[]).length,metrics:f,trajectory:c.governed.swarm.trajectory,governanceStats:c.governanceStats,rounds:u},worldB:{id:t,thesis:o.world.thesis,invariantCount:o.world.invariants.length,gateCount:(o.world.gates??[]).length,metrics:p,trajectory:d.governed.swarm.trajectory,governanceStats:d.governanceStats,rounds:m},delta:{stabilityDiff:Number((v*100).toFixed(1)),volatilityDiff:Number((g*100).toFixed(1)),coalitionRiskDiff:w,collapseDiff:Number((x*100).toFixed(1)),moreStable:y,narrative:b}}}function JA(e,t){const n=new Set,r=[];for(const o of[...e,...t])n.has(o.id)||(n.add(o.id),r.push(o));return r}function pg(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 e3(e,t,n,r,o){const i=[];i.push(`World A ("${e.world.thesis.slice(0,60)}...") vs World B ("${t.world.thesis.slice(0,60)}...").`),o==="A"?i.push(`World A produced a more stable system (${(n.stabilityScore*100).toFixed(0)}% vs ${(r.stabilityScore*100).toFixed(0)}%).`):o==="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 t3(){var t;const e=[];for(const[n,r]of Object.entries(uo))(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 n3(e){const t=Si(e),n=t.world.invariants,r=t.world.gates??[],o=n.filter(m=>m.enforceable).length,i=n.length-o,a=n.length===0?"No invariants defined — ungoverned.":`${n.length} rules (${o} enforced, ${i} advisory): ${n.map(m=>m.description).join("; ")}`,l=r.filter(m=>m.severity==="critical"),c=r.filter(m=>m.severity==="warning"),d=r.length===0?"No viability gates — no collapse detection.":`${r.length} gates (${l.length} critical, ${c.length} warning): ${r.map(m=>`${m.label} [${m.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 r3(e){const{worldA:t,worldB:n,delta:r}=e,o=r.moreStable,i=o==="A"?t:o==="B"?n:t,a=o==="A"?n:o==="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:o,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 hg({label:e,selected:t,onSelect:n,presets:r,savedWorlds:o,explanation:i,disabled:a,onDeleteSaved:l}){return s.jsxs("div",{className:"space-y-3",children:[s.jsx("h4",{className:"text-xs font-bold uppercase tracking-[0.15em] text-muted-foreground",children:e}),o.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"text-[10px] font-bold uppercase tracking-wider text-primary/70 flex items-center gap-1",children:[s.jsx(M2,{className:"h-3 w-3"})," My Worlds"]}),o.map(c=>s.jsxs("div",{className:"flex items-stretch gap-1",children:[s.jsxs("button",{disabled:a,onClick:()=>n(c.id),className:I("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:[s.jsx("div",{className:"text-sm font-medium text-foreground",children:c.name}),s.jsx("div",{className:"mt-1 text-xs text-muted-foreground line-clamp-1",children:c.world.thesis}),s.jsxs("div",{className:"mt-2 flex gap-3 text-[10px] font-medium text-muted-foreground",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(wh,{className:"h-3 w-3"})," ",c.world.invariants.length," rules"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Un,{className:"h-3 w-3"})," ",(c.world.gates??[]).length," gates"]}),s.jsx("span",{className:"text-primary/50",children:"saved"})]})]}),s.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:s.jsx(X2,{className:"h-3.5 w-3.5"})})]},c.id))]}),s.jsxs("div",{className:"space-y-1.5",children:[o.length>0&&s.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground/50 mt-2",children:"Presets"}),r.map(c=>s.jsxs("button",{disabled:a,onClick:()=>n(c.id),className:I("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:[s.jsx("div",{className:"text-sm font-medium text-foreground",children:c.title}),s.jsx("div",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:c.thesis}),s.jsxs("div",{className:"mt-2 flex gap-3 text-[10px] font-medium text-muted-foreground",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(wh,{className:"h-3 w-3"})," ",c.invariantCount," rules"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Un,{className:"h-3 w-3"})," ",c.gateCount," gates"]})]})]},c.id))]}),i&&s.jsxs("div",{className:"rounded-lg border border-dashed border-muted-foreground/20 bg-muted/30 p-3 space-y-2",children:[s.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Governance posture"}),s.jsx("div",{className:"text-xs text-foreground/80",children:i.invariantSummary}),s.jsx("div",{className:"text-xs text-muted-foreground",children:i.gateSummary}),s.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[s.jsx("span",{className:I("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")}),s.jsxs("span",{className:"text-muted-foreground",children:["Risk profile: ",i.riskProfile]})]})]})]})}function gg({worldId:e,onSave:t,onCancel:n}){const[r,o]=h.useState("");return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"text",value:r,onChange:i=>o(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()}}),s.jsx(Z,{size:"sm",onClick:()=>r.trim()&&t(r.trim()),disabled:!r.trim(),children:"Save"}),s.jsx(Z,{size:"sm",variant:"ghost",onClick:n,children:"Cancel"})]})}function xg({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"},o=e.trajectory==="stabilizing"||e.trajectory==="converging"?s.jsx(Wv,{className:"h-3.5 w-3.5 text-green-400"}):e.trajectory==="escalating"?s.jsx(Vv,{className:"h-3.5 w-3.5 text-red-400"}):s.jsx(Lr,{className:"h-3.5 w-3.5 text-yellow-400"});return s.jsxs("div",{className:I("rounded-xl border p-5 space-y-4",r.border,r.bg),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:I("text-xs font-bold uppercase tracking-[0.15em]",r.text),children:t}),s.jsx("span",{className:I("rounded-full px-2 py-0.5 text-[10px] font-medium",r.badge),children:e.id})]}),s.jsx("p",{className:"text-sm text-foreground/90 leading-relaxed",children:e.thesis}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(va,{label:"Stability",value:`${(e.metrics.stabilityScore*100).toFixed(0)}%`}),s.jsx(va,{label:"Cascade Risk",value:`${(e.metrics.collapseProbability*100).toFixed(0)}%`}),s.jsx(va,{label:"Volatility",value:`${(e.metrics.maxVolatility*100).toFixed(0)}%`}),s.jsx(va,{label:"Trajectory",value:e.trajectory,icon:o})]}),s.jsxs("div",{className:"border-t border-border/50 pt-3 space-y-2",children:[s.jsxs("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[s.jsx(et,{className:"h-3 w-3"})," Governance Engine"]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-lg font-bold text-foreground",children:e.governanceStats.totalEvaluations}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"evaluations"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-lg font-bold text-red-400",children:e.governanceStats.verdicts.block}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"blocked"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-lg font-bold text-green-400",children:e.governanceStats.verdicts.allow}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"allowed"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[s.jsxs("span",{children:[e.invariantCount," invariants"]}),s.jsx("span",{className:"text-border",children:"|"}),s.jsxs("span",{children:[e.gateCount," gates"]}),s.jsx("span",{className:"text-border",children:"|"}),s.jsxs("span",{children:[e.governanceStats.rulesFired," rules fired"]})]})]})]})}function va({label:e,value:t,icon:n}){return s.jsxs("div",{className:"rounded-lg bg-background/50 px-3 py-2",children:[s.jsx("div",{className:"text-[10px] text-muted-foreground",children:e}),s.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[n,s.jsx("span",{className:"text-sm font-semibold text-foreground",children:t})]})]})}function s3({impact:e}){return s.jsxs("div",{className:"rounded-xl border border-primary/20 bg-primary/5 p-5 space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(kr,{className:"h-4 w-4 text-primary"}),s.jsx("h4",{className:"text-xs font-bold uppercase tracking-[0.15em] text-primary",children:"Impact Delta"})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[s.jsx(gd,{label:"Stability",value:e.stabilityDelta}),s.jsx(gd,{label:"Cascade Risk",value:e.cascadeRiskDelta,invert:!0}),s.jsx(gd,{label:"Volatility",value:e.volatilityDelta,invert:!0})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-center border-t border-border/50 pt-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-bold text-foreground",children:e.totalInterventionsA}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"World A interventions"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-bold text-foreground",children:e.totalInterventionsB}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"World B interventions"})]})]}),s.jsxs("div",{className:"space-y-2 border-t border-border/50 pt-3",children:[s.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Key Findings"}),s.jsx("ul",{className:"space-y-1",children:e.keyFindings.map((t,n)=>s.jsxs("li",{className:"flex items-start gap-2 text-xs text-foreground/80",children:[s.jsx("span",{className:"mt-1 block h-1 w-1 rounded-full bg-primary shrink-0"}),t]},n))})]}),s.jsx("div",{className:"rounded-lg bg-background/60 p-3",children:s.jsx("div",{className:"text-xs text-foreground/80 leading-relaxed",children:e.verdict})}),s.jsxs("div",{className:"text-[10px] text-muted-foreground/60 text-center",children:["Powered by ",e.poweredBy]})]})}function gd({label:e,value:t,invert:n}){const r=parseFloat(t),o=n?r<0:r>0,i=n?r>0:r<0,a=r===0||isNaN(r);return s.jsxs("div",{children:[s.jsx("div",{className:I("text-xl font-bold",o&&"text-green-400",i&&"text-red-400",a&&"text-muted-foreground"),children:t}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:e})]})}const o3=()=>{const e=t3(),[t,n]=h.useState(()=>Kr()),[r,o]=h.useState(null),[i,a]=h.useState(null),[l,c]=h.useState(null),[d,u]=h.useState(null),[m,f]=h.useState(!1),[p,v]=h.useState(""),[g,w]=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 y=E=>{if(!E)return null;const R=t.find(_=>_.id===E);if(R){const _=R.world.invariants,M=R.world.gates??[],O=_.filter(U=>U.enforceable).length,A=_.length-O,H=M.filter(U=>U.severity==="critical"),z=M.filter(U=>U.severity==="warning");return{worldId:E,title:R.name,thesis:R.world.thesis,invariantSummary:_.length===0?"No invariants defined — ungoverned.":`${_.length} rules (${O} enforced, ${A} advisory): ${_.map(U=>U.description).join("; ")}`,gateSummary:M.length===0?"No viability gates — no collapse detection.":`${M.length} gates (${H.length} critical, ${z.length} warning)`,riskProfile:H.length>=2?"high":H.length>=1||z.length>=2?"moderate":"low"}}try{return n3(E)}catch{return null}},b=r&&i&&r!==i&&!m,N=h.useCallback(async()=>{if(!(!r||!i)){f(!0),c(null),u(null),v("Initializing worlds...");try{const E=await ZA(r,i,{onProgress:(R,_)=>v(`${R}: ${_}...`)});c(E),u(r3(E)),v("")}catch(E){console.error("World comparison failed:",E),v("Comparison failed — check console for details.")}finally{f(!1)}}},[r,i]),j=h.useCallback((E,R)=>{const _=E==="A"?r:i;if(_)try{const M=Si(_),O=nR(R,M.world,_,{description:`Saved from comparison: ${M.title}`,tags:["comparison"]});Vh(O),n(Kr()),w(null)}catch(M){console.error("Failed to save world:",M)}},[r,i]),C=h.useCallback(E=>{J5(E),n(Kr()),r===E&&o(null),i===E&&a(null)},[r,i]),k=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"}),_=URL.createObjectURL(R),M=document.createElement("a");M.href=_,M.download=`world-comparison-${l.worldA.id}-vs-${l.worldB.id}.json`,M.click(),URL.revokeObjectURL(_)},[l,d]),P=h.useCallback(E=>{var M;const R=(M=E.target.files)==null?void 0:M[0];if(!R)return;const _=new FileReader;_.onload=()=>{try{const O=tR(_.result);Vh(O),n(Kr())}catch(O){console.error("Failed to import world:",O),alert(`Import failed: ${O instanceof Error?O.message:"Invalid file"}`)}},_.readAsText(R),E.target.value=""},[]);return h.useCallback(E=>{const R=t.find(A=>A.id===E);if(!R)return;const _=new Blob([eR(R)],{type:"application/json"}),M=URL.createObjectURL(_),O=document.createElement("a");O.href=M,O.download=`${R.name.replace(/\s+/g,"-").toLowerCase()}.nv-world.json`,O.click(),URL.revokeObjectURL(M)},[t]),s.jsx("section",{className:"border-t border-border py-10",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"mx-auto max-w-5xl space-y-8",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(L2,{className:"h-5 w-5 text-primary"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Compare Worlds"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Same agents, different rules. See how governance changes the outcome."})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{ref:x,type:"file",accept:".json",onChange:P,className:"hidden"}),s.jsxs(Z,{size:"sm",variant:"outline",className:"gap-1.5 text-xs",onClick:()=>{var E;return(E=x.current)==null?void 0:E.click()},children:[s.jsx(Xm,{className:"h-3.5 w-3.5"}),"Import World"]})]})]}),s.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[s.jsx(hg,{label:"World A",selected:r,onSelect:o,presets:e,savedWorlds:t,explanation:y(r),disabled:m,onDeleteSaved:C}),s.jsx(hg,{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:y(i),disabled:m,onDeleteSaved:C})]}),s.jsx("div",{className:"flex justify-center",children:s.jsx(Z,{onClick:N,disabled:!b,size:"lg",className:"gap-2",children:m?s.jsxs(s.Fragment,{children:[s.jsx(Lr,{className:"h-4 w-4 animate-pulse"}),p||"Simulating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Li,{className:"h-4 w-4"}),"Run Comparison"]})})}),l&&d&&s.jsxs("div",{className:"space-y-6 animate-in fade-in-0 slide-in-from-bottom-4 duration-500",children:[s.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(xg,{side:l.worldA,label:"World A",color:"blue"}),g==="A"?s.jsx(gg,{worldId:l.worldA.id,onSave:E=>j("A",E),onCancel:()=>w(null)}):s.jsxs(Z,{size:"sm",variant:"ghost",className:"w-full gap-1.5 text-xs text-muted-foreground",onClick:()=>w("A"),children:[s.jsx(Nh,{className:"h-3.5 w-3.5"})," Save World A"]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(xg,{side:l.worldB,label:"World B",color:"amber"}),g==="B"?s.jsx(gg,{worldId:l.worldB.id,onSave:E=>j("B",E),onCancel:()=>w(null)}):s.jsxs(Z,{size:"sm",variant:"ghost",className:"w-full gap-1.5 text-xs text-muted-foreground",onClick:()=>w("B"),children:[s.jsx(Nh,{className:"h-3.5 w-3.5"})," Save World B"]})]})]}),s.jsx(s3,{impact:d}),s.jsx("div",{className:"flex justify-center",children:s.jsxs(Z,{size:"sm",variant:"outline",className:"gap-1.5 text-xs",onClick:k,children:[s.jsx(Ov,{className:"h-3.5 w-3.5"})," Export Comparison as JSON"]})})]})]})})})},i3=()=>s.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[s.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=>s.jsx("div",{className:"absolute left-0 right-0 h-px bg-primary/60 scan-line",style:{animationDelay:`${e*.5}s`}},e)),s.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)=>s.jsx("div",{className:"rounded-full bg-primary/20 animate-pulse",style:{animationDelay:`${t*50}ms`}},t))})]}),s.jsx("p",{className:"text-sm text-muted-foreground animate-pulse",children:"Building reasoning graph..."})]}),a3=()=>{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?s.jsx(Z,{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:s.jsx(P2,{className:"h-5 w-5"})}):null},l3={severity:50,environmentalHostility:50,timePressure:50,regulatoryClimate:50},c3={timeHorizon:"",riskTolerance:"moderate",budget:""},d3={outcome:"",priority:"important",timeframe:"",successCriteria:[],redLines:[],availableLevers:[]},u3=()=>{const{theme:e,toggle:t}=gf(),n=h.useRef(null),r=h.useRef(null),o=h.useRef(null),[i,a]=h.useState(null),[l,c]=h.useState(""),[d,u]=h.useState(l3),[m,f]=h.useState([]),[p,v]=h.useState(c3),[g,w]=h.useState("full"),[x,y]=h.useState("explore"),[b,N]=h.useState(d3),[j,C]=h.useState(null),[k,P]=h.useState(null),[E,R]=h.useState(!1),[_,M]=h.useState(!1),[O,A]=h.useState(!1),[H,z]=h.useState(null),[U,T]=h.useState(null),[L,S]=h.useState(null),[D,F]=h.useState(null),[G,Q]=h.useState(!1),[re,K]=h.useState(!1),[B,ee]=h.useState("deterministic");h.useEffect(()=>{if(window.location.hash.includes("capsule="))try{const me=M5(window.location.href);me&&(c(me.scenario),setTimeout(()=>{var fe;return(fe=n.current)==null?void 0:fe.scrollIntoView({behavior:"smooth"})},300))}catch{}},[]);const be=h.useCallback(()=>{var ae;(ae=n.current)==null||ae.scrollIntoView({behavior:"smooth"})},[]),ue=h.useCallback(()=>{var ae;(ae=r.current)==null||ae.scrollIntoView({behavior:"smooth"})},[]),oe=h.useCallback((ae,me)=>{c(ae),y("goal"),N(fe=>({...fe,outcome:me})),setTimeout(()=>{var fe;return(fe=n.current)==null?void 0:fe.scrollIntoView({behavior:"smooth"})},100)},[]),ie=h.useCallback((ae,me)=>{c(`${ae}: ${me}`),setTimeout(()=>{var fe;return(fe=n.current)==null?void 0:fe.scrollIntoView({behavior:"smooth"})},100)},[]),Me=h.useCallback(ae=>{a(ae),c(""),u(ae.defaultSliders),A(_)},[_]),Ke=h.useCallback(ae=>{c(ae),ae.trim()&&a(null)},[]),Wt=h.useCallback(ae=>{u(ae),_&&A(!0)},[_]),Ut=h.useCallback(async()=>{R(!0),A(!1),z(null);try{const ae=i||l,me={stakeholders:m.length>0?m:void 0,constraints:p,depth:g,mode:x,goal:x==="goal"&&b.outcome.trim()?{outcome:b.outcome,priority:b.priority,timeframe:b.timeframe||void 0,success_criteria:b.successCriteria.length>0?b.successCriteria:void 0,red_lines:b.redLines.length>0?b.redLines:void 0,available_levers:b.availableLevers.length>0?b.availableLevers:void 0}:void 0},fe=await LR(ae,d,me);C(fe),M(!0),setTimeout(()=>{var Ge;return(Ge=o.current)==null?void 0:Ge.scrollIntoView({behavior:"smooth",block:"start"})},100)}catch(ae){console.error("Reasoning engine error:",ae)}finally{R(!1)}},[i,l,d,m,p,g,x,b]),Rn=h.useCallback(ae=>{R(!0),setTimeout(()=>{const me=XR(ae);P(me),C(me),R(!1),setTimeout(()=>{var fe;return(fe=o.current)==null?void 0:fe.scrollIntoView({behavior:"smooth",block:"start"})},100)},2e3)},[]),Dr=h.useCallback((ae,me)=>{if(!(j!=null&&j.goalResult))return;const fe=j.goalResult.strategies.find(ct=>ct.id===ae);if(!fe)return;const Ge=fe.steps.map(ct=>({...ct,action:me.includes(ct.lever)?ct.action:`[DISABLED] ${ct.action}`,expected_effect:me.includes(ct.lever)?ct.expected_effect:"Lever disabled — effect removed from path"})),Fr=me.length/Math.max(fe.levers_used.length,1);z({originalStrategy:fe,injectedEvent:{atStep:0,event:`Levers modified: ${me.join(", ")}`},forkedSteps:Ge,probabilityDelta:(Fr-1)*fe.success_probability*.3,riskDelta:Fr<.5?"increased":fe.risk})},[j]),Yn=h.useCallback(ae=>{if(!(j!=null&&j.goalResult))return;const me=j.goalResult.strategies.find(Ge=>Ge.id===j.goalResult.recommended_strategy_id);if(!me)return;const fe=me.steps.filter(Ge=>Ge.order>ae.atStep+1).map(Ge=>({...Ge,action:`[ADAPTED] ${Ge.action}`,expected_effect:`Modified by event: "${ae.event}" — ${Ge.expected_effect}`}));fe.length===0&&fe.push({order:ae.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"}),z({originalStrategy:me,injectedEvent:ae,forkedSteps:fe,probabilityDelta:-.1-Math.random()*.15,riskDelta:"elevated"})},[j]),zi=h.useCallback(async()=>{var ae,me,fe,Ge;if(j){Q(!0);try{const{generateGovernedReport:Fr}=await Ru(async()=>{const{generateGovernedReport:xt}=await import("./reportEngine-Bu8bB5Yq.js");return{generateGovernedReport:xt}},[]),{generateDeterministicReport:ct}=await Ru(async()=>{const{generateDeterministicReport:xt}=await Promise.resolve().then(()=>C5);return{generateDeterministicReport:xt}},void 0),Ne=j.governance,Vi={scenario:l||(i==null?void 0:i.title)||"Simulation",rounds:[],metrics:{avgImpact:-.15,collapseProbability:((ae=Ne==null?void 0:Ne.neuroverse)==null?void 0:ae.collapseRisk)==="high"?.65:.25,stabilityScore:(((me=Ne==null?void 0:Ne.neuroverse)==null?void 0:me.worldHealthScore)??65)/100,maxVolatility:.45,peakNegativeSentiment:-.5},interventions:(Ne==null?void 0:Ne.enforcedConstraints)??[],governanceStats:{totalEvaluations:(Ne==null?void 0:Ne.constitutionalChecks.length)??0,blocks:(Ne==null?void 0:Ne.constitutionalChecks.filter(xt=>!xt.passed).length)??0,pauses:((fe=Ne==null?void 0:Ne.neuroverse)==null?void 0:fe.guardStatus)==="PAUSE"?1:0,allows:(Ne==null?void 0:Ne.constitutionalChecks.filter(xt=>xt.passed).length)??0,rulesFired:((Ge=Ne==null?void 0:Ne.neuroverse)==null?void 0:Ge.rulesFired)??0}},ps=ct(Vi);S(ps),F({result:ps,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:[]}}),ee(re?"ai":"deterministic")}catch(Fr){console.error("Report generation failed:",Fr)}finally{Q(!1)}}},[j,re,l,i]),Qn=!!(i||l.trim()),Bi=Qn&&!k,De=_&&j&&!E||k&&!E,wc=(i==null?void 0:i.title)||l.slice(0,60)||"Custom Scenario";return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(c4,{showSimulatedFuture:!!De,theme:e,onToggleTheme:t,isSimulating:E||!!De}),s.jsxs("main",{className:"pt-20",children:[s.jsx(p4,{onRunScenario:be,onPasteSimulation:ue}),s.jsx(y4,{onFullAnalysis:oe}),s.jsx(T4,{}),s.jsx("div",{ref:r,children:s.jsx(b4,{onExplain:Rn,isLoading:E})}),s.jsx(F4,{onSelect:ie}),s.jsx(QA,{}),s.jsx($4,{}),s.jsx("div",{ref:n,children:s.jsx(z4,{onSelectScenario:Me,onCustomScenario:Ke,onCalculate:Ut,selectedId:(i==null?void 0:i.id)||null,customText:l,isLoading:E,hasScenario:Qn})}),Bi&&s.jsx("section",{className:"border-t border-border py-8",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[s.jsx(lw,{onWorldReady:T}),s.jsx(kf,{}),s.jsxs("details",{className:"group",children:[s.jsx("summary",{className:"cursor-pointer text-xs font-semibold uppercase tracking-[0.15em] text-muted-foreground hover:text-foreground transition-colors",children:"Advanced Configuration"}),s.jsxs("div",{className:"mt-4 space-y-6",children:[s.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:s.jsx(F_,{mode:x,onChange:y})}),x==="goal"&&s.jsx(z_,{values:b,onChange:N}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsx(I_,{stakeholders:m,onChange:f}),s.jsx(O_,{values:p,onChange:v})]}),s.jsx(D_,{value:g,onChange:w}),s.jsx(aP,{values:d,onChange:Wt,showRecalculate:O,onRecalculate:Ut})]})]})]})})}),E&&s.jsx(i3,{}),s.jsx("div",{ref:o}),k&&!E&&s.jsx(_4,{result:k}),De&&j&&s.jsx("section",{className:"border-t border-border py-6",children:s.jsx("div",{className:"container mx-auto px-6",children:s.jsx("div",{className:"mx-auto max-w-5xl",children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("h2",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"SIMULATED FUTURE"}),j.confidence&&s.jsx(H_,{confidence:j.confidence})]}),j.lastRequest&&s.jsx(EA,{request:j.lastRequest,title:wc})]})})})}),De&&(j==null?void 0:j.keyAssumptions)&&s.jsx(G_,{assumptions:j.keyAssumptions}),De&&j&&s.jsx(pA,{result:j}),De&&j&&s.jsx(gA,{challenges:j.challenges}),De&&j&&s.jsx(xA,{recommendations:j.recommendations}),De&&(j==null?void 0:j.goalResult)&&s.jsx(SA,{goalResult:j.goalResult,onForkStrategy:Dr}),De&&(j==null?void 0:j.goalResult)&&s.jsx(CA,{strategy:j.goalResult.strategies.find(ae=>ae.id===j.goalResult.recommended_strategy_id)||j.goalResult.strategies[0],onInjectEvent:Yn,forkedTimeline:H}),De&&(j==null?void 0:j.governance)&&s.jsx(TA,{governance:j.governance}),s.jsx(o3,{}),De&&j&&s.jsx(IA,{report:L,governance:D,isGenerating:G,aiEnabled:re,provider:B,onGenerate:zi,onToggleAI:K})]}),s.jsx(a3,{}),s.jsx(d4,{governance:De&&(j!=null&&j.governance)?j.governance:void 0})]})};function m3(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Tf="ScrollArea",[Uw,tT]=Bt(Tf),[f3,Vt]=Uw(Tf),Hw=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...a}=e,[l,c]=h.useState(null),[d,u]=h.useState(null),[m,f]=h.useState(null),[p,v]=h.useState(null),[g,w]=h.useState(null),[x,y]=h.useState(0),[b,N]=h.useState(0),[j,C]=h.useState(!1),[k,P]=h.useState(!1),E=le(t,_=>c(_)),R=Di(o);return s.jsx(f3,{scope:n,type:r,dir:R,scrollHideDelay:i,scrollArea:l,viewport:d,onViewportChange:u,content:m,onContentChange:f,scrollbarX:p,onScrollbarXChange:v,scrollbarXEnabled:j,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:w,scrollbarYEnabled:k,onScrollbarYEnabledChange:P,onCornerWidthChange:y,onCornerHeightChange:N,children:s.jsx(J.div,{dir:R,...a,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});Hw.displayName=Tf;var Kw="ScrollAreaViewport",Gw=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,a=Vt(Kw,n),l=h.useRef(null),c=le(t,l,a.onViewportChange);return s.jsxs(s.Fragment,{children:[s.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:o}),s.jsx(J.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Gw.displayName=Kw;var En="ScrollAreaScrollbar",If=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Vt(En,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,l=e.orientation==="horizontal";return h.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),o.type==="hover"?s.jsx(p3,{...r,ref:t,forceMount:n}):o.type==="scroll"?s.jsx(h3,{...r,ref:t,forceMount:n}):o.type==="auto"?s.jsx(qw,{...r,ref:t,forceMount:n}):o.type==="always"?s.jsx(Mf,{...r,ref:t}):null});If.displayName=En;var p3=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Vt(En,e.__scopeScrollArea),[i,a]=h.useState(!1);return h.useEffect(()=>{const l=o.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),a(!0)},u=()=>{c=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),s.jsx(qn,{present:n||i,children:s.jsx(qw,{"data-state":i?"visible":"hidden",...r,ref:t})})}),h3=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Vt(En,e.__scopeScrollArea),i=e.orientation==="horizontal",a=bc(()=>c("SCROLL_END"),100),[l,c]=m3("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"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,o.scrollHideDelay,c]),h.useEffect(()=>{const d=o.viewport,u=i?"scrollLeft":"scrollTop";if(d){let m=d[u];const f=()=>{const p=d[u];m!==p&&(c("SCROLL"),a()),m=p};return d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[o.viewport,i,c,a]),s.jsx(qn,{present:n||l!=="hidden",children:s.jsx(Mf,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:X(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:X(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),qw=h.forwardRef((e,t)=>{const n=Vt(En,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,a]=h.useState(!1),l=e.orientation==="horizontal",c=bc(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?d:u)}},10);return po(n.viewport,c),po(n.content,c),s.jsx(qn,{present:r||i,children:s.jsx(Mf,{"data-state":i?"visible":"hidden",...o,ref:t})})}),Mf=h.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=Vt(En,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=Jw(l.viewport,l.content),u={...r,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function m(f,p){return w3(f,a.current,l,p)}return n==="horizontal"?s.jsx(g3,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,p=vg(f,l,o.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=m(f,o.dir))}}):n==="vertical"?s.jsx(x3,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,p=vg(f,l);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=m(f))}}):null}),g3=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Vt(En,e.__scopeScrollArea),[a,l]=h.useState(),c=h.useRef(null),d=le(t,c,i.onScrollbarXChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(Qw,{"data-orientation":"horizontal",...o,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":yc(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,m)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),t1(f,m)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:jl(a.paddingLeft),paddingEnd:jl(a.paddingRight)}})}})}),x3=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Vt(En,e.__scopeScrollArea),[a,l]=h.useState(),c=h.useRef(null),d=le(t,c,i.onScrollbarYChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(Qw,{"data-orientation":"vertical",...o,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":yc(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,m)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),t1(f,m)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:jl(a.paddingTop),paddingEnd:jl(a.paddingBottom)}})}})}),[v3,Yw]=Uw(En),Qw=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:u,onResize:m,...f}=e,p=Vt(En,n),[v,g]=h.useState(null),w=le(t,E=>g(E)),x=h.useRef(null),y=h.useRef(""),b=p.viewport,N=r.content-r.viewport,j=Be(u),C=Be(c),k=bc(m,10);function P(E){if(x.current){const R=E.clientX-x.current.left,_=E.clientY-x.current.top;d({x:R,y:_})}}return h.useEffect(()=>{const E=R=>{const _=R.target;(v==null?void 0:v.contains(_))&&j(R,N)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[b,v,N,j]),h.useEffect(C,[r,C]),po(v,k),po(p.content,k),s.jsx(v3,{scope:n,scrollbar:v,hasThumb:o,onThumbChange:Be(i),onThumbPointerUp:Be(a),onThumbPositionChange:C,onThumbPointerDown:Be(l),children:s.jsx(J.div,{...f,ref:w,style:{position:"absolute",...f.style},onPointerDown:X(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),x.current=v.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),P(E))}),onPointerMove:X(e.onPointerMove,P),onPointerUp:X(e.onPointerUp,E=>{const R=E.target;R.hasPointerCapture(E.pointerId)&&R.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=""),x.current=null})})})}),Nl="ScrollAreaThumb",Xw=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Yw(Nl,e.__scopeScrollArea);return s.jsx(qn,{present:n||o.hasThumb,children:s.jsx(y3,{ref:t,...r})})}),y3=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=Vt(Nl,n),a=Yw(Nl,n),{onThumbPositionChange:l}=a,c=le(t,m=>a.onThumbChange(m)),d=h.useRef(void 0),u=bc(()=>{d.current&&(d.current(),d.current=void 0)},100);return h.useEffect(()=>{const m=i.viewport;if(m){const f=()=>{if(u(),!d.current){const p=N3(m,l);d.current=p,l()}};return l(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[i.viewport,u,l]),s.jsx(J.div,{"data-state":a.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:X(e.onPointerDownCapture,m=>{const p=m.target.getBoundingClientRect(),v=m.clientX-p.left,g=m.clientY-p.top;a.onThumbPointerDown({x:v,y:g})}),onPointerUp:X(e.onPointerUp,a.onThumbPointerUp)})});Xw.displayName=Nl;var Lf="ScrollAreaCorner",Zw=h.forwardRef((e,t)=>{const n=Vt(Lf,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(b3,{...e,ref:t}):null});Zw.displayName=Lf;var b3=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Vt(Lf,n),[i,a]=h.useState(0),[l,c]=h.useState(0),d=!!(i&&l);return po(o.scrollbarX,()=>{var m;const u=((m=o.scrollbarX)==null?void 0:m.offsetHeight)||0;o.onCornerHeightChange(u),c(u)}),po(o.scrollbarY,()=>{var m;const u=((m=o.scrollbarY)==null?void 0:m.offsetWidth)||0;o.onCornerWidthChange(u),a(u)}),d?s.jsx(J.div,{...r,ref:t,style:{width:i,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function jl(e){return e?parseInt(e,10):0}function Jw(e,t){const n=e/t;return isNaN(n)?0:n}function yc(e){const t=Jw(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function w3(e,t,n,r="ltr"){const o=yc(n),i=o/2,a=t||i,l=o-a,c=n.scrollbar.paddingStart+a,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,u=n.content-n.viewport,m=r==="ltr"?[0,u]:[u*-1,0];return e1([c,d],m)(e)}function vg(e,t,n="ltr"){const r=yc(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,l=i-r,c=n==="ltr"?[0,a]:[a*-1,0],d=ji(e,c);return e1([0,a],[0,l])(d)}function e1(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 t1(e,t){return e>0&&e<t}var N3=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){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(o)}(),()=>window.cancelAnimationFrame(r)};function bc(e,t){const n=Be(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 po(e,t){const n=Be(t);We(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var n1=Hw,j3=Gw,S3=Zw;const r1=h.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(n1,{ref:r,className:I("relative overflow-hidden",e),...n,children:[s.jsx(j3,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(s1,{}),s.jsx(S3,{})]}));r1.displayName=n1.displayName;const s1=h.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(If,{ref:r,orientation:t,className:I("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:s.jsx(Xw,{className:"relative flex-1 rounded-full bg-border"})}));s1.displayName=If.displayName;const Lo="http://localhost:3456";function k3(e){var o,i,a,l,c,d;const t=(i=(o=e.verdict)==null?void 0:o.status)==null?void 0:i.toUpperCase(),n=((a=e.action)==null?void 0:a.agentId)??"Agent",r=((l=e.action)==null?void 0:l.type)??"action";switch(t){case"BLOCK":return`${n} attempted to ${r.replace(/_/g," ")} — stopped before it could propagate`;case"PENALIZE":return`${n} tried to ${r.replace(/_/g," ")} — influence reduced for ${((d=(c=e.verdict)==null?void 0:c.consequence)==null?void 0:d.rounds)??1} round(s)`;case"MODIFY":case"PAUSE":return`${n} wanted to ${r.replace(/_/g," ")} — action adjusted to meet quality standards`;case"REWARD":return`${n} produced validated work via ${r.replace(/_/g," ")} — influence boosted`;case"ALLOW":return`${n} proceeded with ${r.replace(/_/g," ")}`;default:return`${n}: ${r.replace(/_/g," ")}`}}function C3(e){switch(e==null?void 0:e.toUpperCase()){case"BLOCK":case"PENALIZE":return"bg-red-500";case"MODIFY":case"PAUSE":return"bg-yellow-500";case"REWARD":return"bg-emerald-500";case"ALLOW":return"bg-green-500";default:return"bg-muted-foreground"}}function E3(){const[e,t]=h.useState("disconnected"),[n,r]=h.useState("disconnected"),[o,i]=h.useState(""),[a,l]=h.useState(!1),[c,d]=h.useState([]),[u,m]=h.useState({total:0,allowed:0,blocked:0,modified:0,penalized:0,rewarded:0}),[f,p]=h.useState(!1),[v,g]=h.useState("agent_alpha"),[w,x]=h.useState("publish_hypothesis"),[y,b]=h.useState("Initial hypothesis about material property X"),[N,j]=h.useState("0.6"),[C,k]=h.useState(!1),P=h.useRef(null),E=h.useCallback(async()=>{try{if((await fetch(`${Lo}/api/v1/reason/health`)).ok){t("connected");const H=await fetch(`${Lo}/api/v1/policy`);if(H.ok){const z=await H.json();z.active&&z.policyText&&(i(z.policyText),l(!0))}}else t("error")}catch{t("disconnected")}},[]),R=h.useCallback(()=>{P.current&&P.current.close(),r("connecting");const A=new EventSource(`${Lo}/api/v1/events`);P.current=A,A.onopen=()=>r("connected"),A.onmessage=H=>{var z,U;try{const T=JSON.parse(H.data);if(T.type==="connected")return;if(T.type==="evaluation"){d(S=>[T,...S].slice(0,200));const L=(U=(z=T.verdict)==null?void 0:z.status)==null?void 0:U.toUpperCase();m(S=>({total:S.total+1,allowed:S.allowed+(L==="ALLOW"?1:0),blocked:S.blocked+(L==="BLOCK"?1:0),modified:S.modified+(L==="MODIFY"||L==="PAUSE"?1:0),penalized:S.penalized+(L==="PENALIZE"?1:0),rewarded:S.rewarded+(L==="REWARD"?1:0)}))}T.type==="policy_updated"&&(i(T.policyText??""),l(!0))}catch{}},A.onerror=()=>r("error")},[]),_=h.useCallback(async()=>{if(o.trim())try{(await fetch(`${Lo}/api/v1/policy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({policyText:o})})).ok&&l(!0)}catch{}},[o]),M=h.useCallback(async()=>{k(!0);try{await fetch(`${Lo}/api/v1/evaluate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:{agentId:v,type:w,description:y,magnitude:parseFloat(N)||.5}})})}catch{}k(!1)},[v,w,y,N]),O=A=>{navigator.clipboard.writeText(A).catch(()=>{})};return h.useEffect(()=>{E();const A=setInterval(E,1e4);return()=>clearInterval(A)},[E]),h.useEffect(()=>(e==="connected"&&n==="disconnected"&&R(),()=>{var A;(A=P.current)==null||A.close()}),[e,R,n]),s.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[s.jsx("div",{className:"border-b bg-card/50 backdrop-blur-sm",children:s.jsxs("div",{className:"flex items-center justify-between px-6 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(et,{className:"h-5 w-5 text-primary"}),s.jsx("span",{className:"font-semibold text-foreground",children:"NeuroVerse"}),s.jsx(ce,{variant:"outline",className:"text-[10px] border-primary/30 text-primary",children:"ScienceClaw"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[e==="connected"?s.jsx(H2,{className:"h-3.5 w-3.5 text-green-400"}):s.jsx(K2,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:I("text-xs",e==="connected"?"text-green-400":"text-muted-foreground"),children:e==="connected"?"Server connected":"Server offline"})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:I("w-2 h-2 rounded-full",n==="connected"?"bg-green-500 animate-pulse":"bg-muted-foreground")}),s.jsx("span",{className:I("text-xs",n==="connected"?"text-green-400":"text-muted-foreground"),children:n==="connected"?"Live":"Not streaming"})]})]})]})}),s.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[s.jsx("div",{className:"w-[440px] border-r flex flex-col overflow-y-auto",children:s.jsxs("div",{className:"p-5 space-y-4",children:[s.jsx(kf,{}),s.jsxs(pe,{children:[s.jsx(Pe,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:I("w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-bold",e==="connected"?"bg-green-500/20 text-green-400":"bg-muted text-muted-foreground"),children:"1"}),s.jsx(_e,{className:"text-sm",children:"Start governance server"}),e==="connected"&&s.jsx(Sn,{className:"h-3.5 w-3.5 text-green-400"})]})}),s.jsx(he,{className:"pt-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("code",{className:"flex-1 text-xs bg-muted/50 border rounded px-3 py-2 font-mono",children:"npx tsx src/server/index.ts"}),s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>O("npx tsx src/server/index.ts"),children:s.jsx(bi,{className:"h-3.5 w-3.5"})})]})})]}),s.jsxs(pe,{children:[s.jsx(Pe,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:I("w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-bold",a?"bg-green-500/20 text-green-400":"bg-muted text-muted-foreground"),children:"2"}),s.jsx(_e,{className:"text-sm",children:"Write your rules"}),a&&s.jsx(Sn,{className:"h-3.5 w-3.5 text-green-400"})]})}),s.jsxs(he,{className:"pt-0 space-y-2",children:[s.jsx("textarea",{className:"w-full h-36 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:`Write rules in plain English, one per line.
|
|
617
|
+
|
|
618
|
+
Examples:
|
|
619
|
+
Block unvalidated hypotheses from spreading
|
|
620
|
+
Require independent replication before citation
|
|
621
|
+
Halt cascade when false positive risk exceeds 70%
|
|
622
|
+
Penalize self-citation loops`,value:o,onChange:A=>{i(A.target.value),l(!1)}}),o.trim().length===0&&s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx("span",{className:"text-[10px] text-muted-foreground/60 self-center",children:"Try:"}),[{label:"Replication First",rules:`Block any hypothesis from spreading until independently replicated
|
|
623
|
+
Require at least 2 independent confirmations before citation
|
|
624
|
+
Halt cascade when false positive probability exceeds 60%
|
|
625
|
+
Penalize self-citation loops across all agents`},{label:"Open Science",rules:`Require full methodology transparency for all published results
|
|
626
|
+
Block proprietary claims on publicly funded research
|
|
627
|
+
Monitor data provenance for all derivative work
|
|
628
|
+
Reward sharing of negative results and null findings`},{label:"Anti-Hype",rules:`Limit citation amplification when media attention spikes
|
|
629
|
+
Halt viral spread of findings without expert consensus
|
|
630
|
+
Block sensationalized claims that lack statistical rigor
|
|
631
|
+
Require peer review before wide dissemination`}].map(A=>s.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:()=>{i(A.rules),l(!1)},children:A.label},A.label))]}),s.jsx(Z,{size:"sm",className:"w-full",onClick:_,disabled:!o.trim()||e!=="connected",children:a?"Rules active on server":e!=="connected"?"Start server first":"Save rules"})]})]}),s.jsxs(pe,{children:[s.jsx(Pe,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-bold bg-muted text-muted-foreground",children:"3"}),s.jsx(_e,{className:"text-sm",children:"Run ScienceClaw"})]})}),s.jsxs(he,{className:"pt-0 space-y-2",children:[s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use the NeuroVerse wrapper instead of ",s.jsx("code",{className:"text-[11px] bg-muted/50 px-1 rounded",children:"scienceclaw-post"}),":"]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("code",{className:"flex-1 text-xs bg-muted/50 border rounded px-3 py-2 font-mono whitespace-pre-wrap leading-relaxed",children:`NEUROVERSE_URL=http://localhost:3456 \\
|
|
632
|
+
npx tsx src/connectors/nv-scienceclaw-post.ts \\
|
|
633
|
+
--agent MyAgent \\
|
|
634
|
+
--topic "your research topic"`}),s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 mt-1",onClick:()=>O('NEUROVERSE_URL=http://localhost:3456 npx tsx src/connectors/nv-scienceclaw-post.ts --agent MyAgent --topic "your research topic"'),children:s.jsx(bi,{className:"h-3.5 w-3.5"})})]}),s.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Every artifact ScienceClaw produces is evaluated against your rules. Results appear on the right."})]})]}),s.jsx(Qe,{open:f,onOpenChange:p,children:s.jsxs(pe,{children:[s.jsx(Xe,{asChild:!0,children:s.jsx(Pe,{className:"cursor-pointer pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(q2,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx(_e,{className:"text-xs text-muted-foreground",children:"Test an action manually"})]}),f?s.jsx(at,{className:"h-3.5 w-3.5 text-muted-foreground"}):s.jsx(Ye,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})}),s.jsx(Ze,{children:s.jsxs(he,{className:"pt-0 space-y-2",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-[10px] text-muted-foreground font-medium",children:"Agent ID"}),s.jsx("input",{className:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono",value:v,onChange:A=>g(A.target.value)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-[10px] text-muted-foreground font-medium",children:"Action"}),s.jsx("input",{className:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono",value:w,onChange:A=>x(A.target.value)})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-[10px] text-muted-foreground font-medium",children:"Description"}),s.jsx("input",{className:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono",value:y,onChange:A=>b(A.target.value)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-[10px] text-muted-foreground font-medium",children:"Magnitude (0-1)"}),s.jsx("input",{className:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono",value:N,onChange:A=>j(A.target.value),type:"number",min:"0",max:"1",step:"0.1"})]}),s.jsx(Z,{size:"sm",className:"w-full",onClick:M,disabled:C||e!=="connected"||!a,children:C?"Sending...":a?"Send to governance":"Save rules first"})]})})]})})]})}),s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden bg-card/30",children:[u.total>0&&s.jsx("div",{className:"border-b px-6 py-3",children:s.jsxs("div",{className:"flex items-center gap-6 text-xs",children:[s.jsxs("span",{className:"text-muted-foreground",children:[u.total," actions observed"]}),s.jsxs("span",{className:"text-green-400",children:[u.allowed," proceeded"]}),s.jsxs("span",{className:"text-red-400",children:[u.blocked," stopped"]}),u.modified>0&&s.jsxs("span",{className:"text-yellow-400",children:[u.modified," adjusted"]}),u.penalized>0&&s.jsxs("span",{className:"text-orange-400",children:[u.penalized," penalized"]}),u.rewarded>0&&s.jsxs("span",{className:"text-emerald-400",children:[u.rewarded," rewarded"]})]})}),s.jsx(r1,{className:"flex-1",children:s.jsx("div",{className:"p-6",children:c.length===0?s.jsxs("div",{className:"text-center py-20 space-y-4",children:[s.jsx(et,{className:"h-12 w-12 text-muted-foreground/15 mx-auto"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:e!=="connected"?"Start the governance server to begin":a?"Waiting for agent activity...":"Write and save your governance rules on the left"}),s.jsx("div",{className:"text-xs text-muted-foreground/50",children:a?"Run ScienceClaw or send a test action. Every evaluation appears here.":""})]})]}):s.jsx("div",{className:"space-y-2",children:c.map(A=>{var H,z,U,T,L,S,D,F;return s.jsx(Qe,{children:s.jsxs("div",{className:"rounded-lg border bg-card p-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:I("w-2.5 h-2.5 rounded-full mt-1.5 shrink-0",C3((H=A.verdict)==null?void 0:H.status))}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm text-foreground",children:k3(A)}),((z=A.action)==null?void 0:z.description)&&s.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:A.action.description})]}),s.jsx("span",{className:"text-[10px] text-muted-foreground/40 shrink-0 font-mono",children:new Date(A.timestamp).toLocaleTimeString()})]}),s.jsxs(Xe,{className:"mt-2 text-[10px] text-muted-foreground/50 hover:text-muted-foreground flex items-center gap-1",children:[s.jsx(Ye,{className:"h-3 w-3"}),"governance details"]}),s.jsx(Ze,{children:s.jsxs("div",{className:"mt-2 ml-5 rounded bg-muted/30 border border-border/40 p-2 text-[10px] space-y-1",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Verdict:"})," ",s.jsx("span",{className:"font-mono",children:(U=A.verdict)==null?void 0:U.status})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Reason:"})," ",(T=A.verdict)==null?void 0:T.reason]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Confidence:"})," ",((((L=A.verdict)==null?void 0:L.confidence)??0)*100).toFixed(0),"%"]}),((S=A.verdict)==null?void 0:S.rulesFired)&&A.verdict.rulesFired.length>0&&s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Rules fired:"}),A.verdict.rulesFired.map((G,Q)=>s.jsx("div",{className:"ml-2 text-muted-foreground/70",children:G.description||G.ruleId},Q))]}),((D=A.verdict)==null?void 0:D.consequence)&&s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Consequence:"})," ",A.verdict.consequence.description]}),((F=A.verdict)==null?void 0:F.reward)&&s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Reward:"})," ",A.verdict.reward.description]})]})})]})},A.id)})})})})]})]})]})}var R3="Separator",yg="horizontal",P3=["horizontal","vertical"],o1=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=yg,...o}=e,i=_3(r)?r:yg,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(J.div,{"data-orientation":i,...l,...o,ref:t})});o1.displayName=R3;function _3(e){return P3.includes(e)}var i1=o1;const a1=h.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>s.jsx(i1,{ref:o,decorative:n,orientation:t,className:I("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));a1.displayName=i1.displayName;const Uu={scienceclaw:{id:"scienceclaw",name:"ScienceClaw",description:"Autonomous research discovery agent. Evaluates artifacts like hypotheses, papers, synthesis, and ML predictions.",outputFormat:"jsonl",color:"blue",icon:"Microscope",fieldMap:{agentId:["agent_id","agentId","agent"],actionType:["type","artifact_type","action"],description:["description","title","summary"],magnitude:["confidence","magnitude"],cycle:["cycle","step","round"],contextFields:["citations","paper_count","insight_count","sources","features","reproduced","provenance"]},exampleLine:'{"agent_id": "harry", "type": "synthesis", "description": "Cross-domain analysis of coordination failures", "confidence": 0.85, "cycle": 3, "paper_count": 0, "insight_count": 0}',exampleRules:["Block synthesis when paper_count is 0","Block results with no peer-reviewed sources","Require at least 2 independent data sources before analysis","Penalize agents that publish without citations","Halt investigation when confidence drops below 0.4","Reward findings validated by multiple methods"].join(`
|
|
635
|
+
`),captureInstructions:["# Option A: Use the replay demo (no ScienceClaw needed)","# Place your ScienceClaw JSONL output in examples/scienceclaw/","","# Option B: Capture live output","# Run ScienceClaw and save output to JSONL:","scienceclaw run --topic 'your topic' --output artifacts.jsonl","","# Option C: Use existing demo data","# We include Harry's investigation: examples/scienceclaw/harry-investigation.jsonl"].join(`
|
|
636
|
+
`),tags:["science","research","discovery"]},mirofish:{id:"mirofish",name:"MiroFish / OASIS",description:"Social simulation platform. Evaluates agent behaviors like posting, sharing, belief formation, and swarm dynamics.",outputFormat:"jsonl",color:"violet",icon:"Users",fieldMap:{agentId:["agent_id","agentId","user_id","agent"],actionType:["action","type","action_type","event_type"],description:["content","text","description","message"],magnitude:["influence","reach","magnitude","impact"],cycle:["step","tick","round","cycle","timestamp"],contextFields:["sentiment","hashtags","mentions","followers","retweets","likes","belief","confidence","group","coalition"]},exampleLine:'{"agent_id": "user_42", "action": "create_post", "content": "Breaking: new study confirms X", "influence": 0.7, "step": 5, "sentiment": "positive", "followers": 1200}',exampleRules:["Block posts that amplify unverified claims","Penalize agents that repeat unvalidated information","Halt cascade when echo amplification exceeds 60%","Require independent sources before sharing conclusions","Reward agents that challenge dominant consensus","Slow viral spread of unverified content"].join(`
|
|
637
|
+
`),captureInstructions:["# Option A: Capture OASIS output","# Run your OASIS/MiroFish simulation and save agent actions:","python run_simulation.py --output agent_actions.jsonl","","# Option B: Export from existing run","# If you have a completed simulation, export the action log:","python export_actions.py --run-id <id> --format jsonl > actions.jsonl","","# Each line should have: agent_id, action, content, step"].join(`
|
|
638
|
+
`),tags:["social","swarm","simulation"]},langchain:{id:"langchain",name:"LangChain / LangGraph",description:"LLM agent framework. Evaluates tool calls, chain steps, and agent decisions.",outputFormat:"jsonl",color:"green",icon:"Link",fieldMap:{agentId:["agent_id","agent","chain_id","run_id"],actionType:["tool","action","type","step_type"],description:["input","description","query","tool_input"],magnitude:["confidence","score","magnitude"],cycle:["step","iteration","cycle"],contextFields:["output","tool_output","tokens","latency","model"]},exampleLine:'{"agent_id": "researcher", "tool": "web_search", "input": "latest findings on CRISPR efficiency", "step": 2, "confidence": 0.6}',exampleRules:["Block web searches without clear research purpose","Require source validation before generating conclusions","Penalize agents that skip verification steps","Halt chain when confidence drops below 0.5","Reward tool use that cross-references multiple sources"].join(`
|
|
639
|
+
`),captureInstructions:["# Enable LangChain callback logging:","from langchain.callbacks import FileCallbackHandler","handler = FileCallbackHandler('agent_log.jsonl')","agent.run('your query', callbacks=[handler])","","# Or use LangSmith export:","langsmith export --run-id <id> --format jsonl > actions.jsonl"].join(`
|
|
640
|
+
`),tags:["llm","agent","tools"]},custom:{id:"custom",name:"Custom / Any System",description:"Any agent system that produces structured output. We auto-detect common field patterns.",outputFormat:"jsonl",color:"zinc",icon:"FileJson",fieldMap:{agentId:["agent_id","agentId","agent","id","user_id","actor","name"],actionType:["type","action","action_type","event","event_type","tool","step_type"],description:["description","content","text","message","summary","title","input","query"],magnitude:["confidence","magnitude","score","impact","influence","weight","intensity"],cycle:["cycle","step","round","tick","iteration","timestamp","sequence"],contextFields:[]},exampleLine:'{"agent_id": "agent_1", "type": "decision", "description": "Chose option A based on analysis", "confidence": 0.75, "step": 1}',exampleRules:["Block actions with confidence below 0.5","Require validation before final decisions","Penalize agents that skip verification","Halt when error rate exceeds threshold","Reward independent convergence on same conclusion"].join(`
|
|
641
|
+
`),captureInstructions:["# Save your agent system's output as JSONL (one JSON object per line).","# Each line should have at minimum:","# - An agent identifier (agent_id, agent, id, etc.)","# - An action type (type, action, event, etc.)","# - A description (description, content, text, etc.)","","# Example:",'# {"agent_id": "bot_1", "type": "decision", "description": "Selected strategy X", "step": 1}','# {"agent_id": "bot_2", "type": "analysis", "description": "Analyzed data from source Y", "step": 1}'].join(`
|
|
642
|
+
`),tags:["custom","generic"]}};function Sl(e,t){const n=typeof t=="string"?[t]:t;for(const r of n)if(r in e&&e[r]!=null)return e[r]}function xd(e,t,n){const r=Sl(e,t);return typeof r=="string"?r:r!=null?String(r):n}function A3(e,t,n){const r=Sl(e,t);if(typeof r=="number")return Math.max(0,Math.min(1,r));if(typeof r=="string"){const o=parseFloat(r);if(!isNaN(o))return Math.max(0,Math.min(1,o))}return n}function bg(e,t,n){const r=t.fieldMap,o=xd(e,r.agentId,"");if(!o)return{error:"No agent identifier found"};const i=xd(e,r.actionType,"unknown"),a=xd(e,r.description,`${o}: ${i}`),l=A3(e,r.magnitude,.5),c=typeof Sl(e,r.cycle)=="number"?Sl(e,r.cycle):0,d={source:t.id,cycle:c};if(r.contextFields)for(const u of r.contextFields)u in e&&(d[u]=e[u]);return{action:{agentId:o,type:i,description:a,magnitude:l,context:d},cycle:c}}function Hu(e){const t=e.trim();if(!t)return[];if(t.startsWith("["))try{const r=JSON.parse(t);if(Array.isArray(r))return r}catch{}const n=[];for(const r of t.split(`
|
|
643
|
+
`)){const o=r.trim();if(!(!o||o.startsWith("#")||o.startsWith("//")))try{const i=JSON.parse(o);typeof i=="object"&&i!==null&&!Array.isArray(i)&&n.push(i)}catch{}}return n}function T3(e){const t=Uu[e];if(!t)throw new Error(`Unknown engine: ${e}. Available: ${Object.keys(Uu).join(", ")}`);return{profile:t,evaluateAll(n,r){const o=Hu(n),i=[],a=[],l=pf({policyText:r});for(let v=0;v<o.length;v++){const g=bg(o[v],t);if("error"in g){a.push({index:v,error:g.error});continue}const w=l.evaluate(g.action);i.push({raw:o[v],action:g.action,verdict:w,cycle:g.cycle,index:v})}const c={allowed:0,blocked:0,modified:0,paused:0,rewarded:0,penalized:0},d=new Set,u=new Set,m=new Set;for(const v of i){const g=v.verdict.status;g==="ALLOW"?c.allowed++:g==="BLOCK"?c.blocked++:g==="MODIFY"?c.modified++:g==="PAUSE"?c.paused++:g==="REWARD"?c.rewarded++:g==="PENALIZE"&&c.penalized++,d.add(v.action.agentId),u.add(v.action.type),(g==="BLOCK"||g==="PENALIZE")&&m.add(v.verdict.reason)}const f=i.length,p=f>0?(c.blocked+c.penalized)/f:0;return{results:i,total:f,counts:c,failRate:p,agents:[...d],actionTypes:[...u],blockReasons:[...m],parseErrors:a,engineId:t.id}},evaluateOne(n,r){const o=bg(n,t);if("error"in o)return o;const i=pR(o.action,{},r);return{raw:n,action:o.action,verdict:i,cycle:o.cycle,index:0}}}}function I3(){return Object.values(Uu)}function M3(e){if(e.length===0)return"custom";const t=e[0],n=Object.keys(t).join(",").toLowerCase();return n.includes("paper_count")||n.includes("insight_count")||n.includes("artifact_type")?"scienceclaw":n.includes("followers")||n.includes("retweets")||n.includes("hashtags")||n.includes("sentiment")?"mirofish":n.includes("tool_input")||n.includes("tool_output")||n.includes("chain_id")?"langchain":"custom"}const L3={Microscope:V2,Users:Uv,Link:z2,FileJson:Mi};function O3({name:e,className:t}){const n=L3[e]??Mi;return s.jsx(n,{className:t})}const ya={blue:{bg:"bg-blue-500/10",border:"border-blue-500/30",text:"text-blue-400",badge:"bg-blue-500/20 text-blue-400 border-blue-500/30"},violet:{bg:"bg-violet-500/10",border:"border-violet-500/30",text:"text-violet-400",badge:"bg-violet-500/20 text-violet-400 border-violet-500/30"},green:{bg:"bg-green-500/10",border:"border-green-500/30",text:"text-green-400",badge:"bg-green-500/20 text-green-400 border-green-500/30"},zinc:{bg:"bg-zinc-500/10",border:"border-zinc-500/30",text:"text-zinc-400",badge:"bg-zinc-500/20 text-zinc-400 border-zinc-500/30"}};function vd({step:e,current:t,label:n,done:r}){const o=e===t,i=e<t||r;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:I("w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold transition-all",i?"bg-green-500/20 text-green-400":o?"bg-primary/20 text-primary ring-2 ring-primary/30":"bg-muted text-muted-foreground"),children:i?s.jsx(Sn,{className:"h-4 w-4"}):e}),s.jsx("span",{className:I("text-sm font-medium transition-colors",o?"text-foreground":i?"text-green-400":"text-muted-foreground"),children:n})]})}function l1({status:e}){const t={ALLOW:{bg:"bg-green-500/15",text:"text-green-400"},BLOCK:{bg:"bg-red-500/15",text:"text-red-400"},MODIFY:{bg:"bg-yellow-500/15",text:"text-yellow-400"},PAUSE:{bg:"bg-yellow-500/15",text:"text-yellow-400"},REWARD:{bg:"bg-emerald-500/15",text:"text-emerald-400"},PENALIZE:{bg:"bg-orange-500/15",text:"text-orange-400"}},n=t[e]??t.ALLOW;return s.jsx("span",{className:I("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",n.bg,n.text),children:e})}function $3({result:e}){const[t,n]=h.useState(!1),r=e.verdict.status,o=r==="BLOCK"||r==="PENALIZE"?"border-red-500/20":r==="REWARD"?"border-emerald-500/20":r==="MODIFY"||r==="PAUSE"?"border-yellow-500/20":"border-border/50";return s.jsxs("div",{className:I("rounded-lg border bg-card p-3 transition-colors",o),children:[s.jsxs("div",{className:"flex items-start gap-3 cursor-pointer",onClick:()=>n(!t),children:[s.jsx(l1,{status:r}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"text-sm text-foreground truncate",children:[s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:e.action.agentId})," → ",s.jsx("span",{className:"font-medium",children:e.action.type})]}),s.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:e.action.description})]}),s.jsx("div",{className:"shrink-0 text-muted-foreground/50",children:t?s.jsx(at,{className:"h-4 w-4"}):s.jsx(Ye,{className:"h-4 w-4"})})]}),t&&s.jsxs("div",{className:"mt-3 pt-3 border-t border-border/30 space-y-2",children:[s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"text-muted-foreground",children:"Reason: "}),s.jsx("span",{className:"text-foreground",children:e.verdict.reason})]}),s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"text-muted-foreground",children:"Confidence: "}),s.jsxs("span",{className:"text-foreground font-mono",children:[(e.verdict.confidence*100).toFixed(0),"%"]})]}),e.verdict.rulesFired.length>0&&s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"text-muted-foreground",children:"Rules fired:"}),e.verdict.rulesFired.map((i,a)=>s.jsxs("div",{className:"ml-2 text-muted-foreground/80 mt-0.5",children:[s.jsxs("span",{className:"font-mono text-[10px]",children:["[",i.effect,"]"]})," ",i.description]},a))]}),e.verdict.consequence&&s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"text-muted-foreground",children:"Consequence: "}),s.jsx("span",{className:"text-orange-400",children:e.verdict.consequence.description})]})]})]})}function wg({policyText:e,worldOutput:t,engineName:n}){const[r,o]=h.useState(!1),i=h.useMemo(()=>e.trim()?mo(e):null,[e]),a=h.useMemo(()=>i?fo(i):null,[i]),l=h.useMemo(()=>i?xl(i):null,[i]);return e.trim()?s.jsxs(Qe,{open:r,onOpenChange:o,children:[s.jsxs(Xe,{className:"flex items-center gap-2 w-full rounded-lg border border-border/50 bg-muted/20 px-4 py-2.5 hover:bg-muted/40 transition-colors text-left",children:[s.jsx(O2,{className:"h-4 w-4 text-primary shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-foreground flex-1",children:"View Generated World File"}),a&&s.jsxs(ce,{variant:"outline",className:I("text-[10px]",a.status==="healthy"?"border-green-500/30 text-green-400":a.status==="warnings"?"border-yellow-500/30 text-yellow-400":"border-red-500/30 text-red-400"),children:[a.healthScore,"/100"]}),i&&s.jsxs(ce,{variant:"secondary",className:"text-[10px]",children:[i.summary.total," rules"]}),r?s.jsx(at,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(Ye,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(Ze,{children:s.jsxs("div",{className:"mt-2 rounded-lg border bg-card p-4 space-y-4",children:[t&&s.jsxs("div",{children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Your Intent"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.intent.explore&&s.jsxs("div",{className:"rounded border border-green-500/20 bg-green-500/5 p-2",children:[s.jsx("div",{className:"text-[10px] font-bold text-green-400 mb-0.5",children:"EXPLORE"}),s.jsx("div",{className:"text-xs text-foreground/80",children:t.intent.explore})]}),t.intent.exclude&&s.jsxs("div",{className:"rounded border border-red-500/20 bg-red-500/5 p-2",children:[s.jsx("div",{className:"text-[10px] font-bold text-red-400 mb-0.5",children:"EXCLUDE"}),s.jsx("div",{className:"text-xs text-foreground/80",children:t.intent.exclude})]}),t.intent.elevate&&s.jsxs("div",{className:"rounded border border-amber-500/20 bg-amber-500/5 p-2",children:[s.jsx("div",{className:"text-[10px] font-bold text-amber-400 mb-0.5",children:"ELEVATE"}),s.jsx("div",{className:"text-xs text-foreground/80",children:t.intent.elevate})]}),t.intent.experiment.length>0&&s.jsxs("div",{className:"rounded border border-violet-500/20 bg-violet-500/5 p-2",children:[s.jsx("div",{className:"text-[10px] font-bold text-violet-400 mb-0.5",children:"BEHAVIOR RULES"}),t.intent.experiment.map((c,d)=>s.jsxs("div",{className:"text-xs text-foreground/80 mt-0.5",children:["IF ",c.condition," THEN ",c.outcome,s.jsxs("span",{className:I("ml-1 font-mono text-[10px]",c.verdict==="REWARD"?"text-emerald-400":c.verdict==="PENALIZE"?"text-orange-400":"text-muted-foreground"),children:["[",c.verdict,"]"]})]},d))]})]}),t.rules.length>0&&s.jsxs("div",{className:"mt-3",children:[s.jsxs("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:["Generated Rules (",t.rules.length,")"]}),s.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:t.rules.map((c,d)=>s.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[s.jsx(ce,{variant:"outline",className:I("text-[9px] px-1 py-0 shrink-0",c.ruleType==="BLOCK"?"border-red-500/30 text-red-400":c.ruleType==="REWARD"?"border-emerald-500/30 text-emerald-400":c.ruleType==="PENALIZE"?"border-orange-500/30 text-orange-400":c.ruleType==="PRIORITIZE"?"border-blue-500/30 text-blue-400":"border-border text-muted-foreground"),children:c.ruleType}),s.jsx("span",{className:"text-foreground/80",children:c.naturalLanguage}),s.jsx("span",{className:"text-muted-foreground/40 font-mono text-[10px] shrink-0",children:c.source})]},d))})]})]}),i&&s.jsxs("div",{children:[s.jsxs("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:["Parsed Policy (",i.summary.enforced," enforced / ",i.summary.advisory," advisory)"]}),s.jsx("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:i.rules.map((c,d)=>s.jsxs("div",{className:"flex items-start gap-2 text-xs rounded bg-muted/30 px-2 py-1.5",children:[s.jsx("span",{className:"font-mono text-[10px] text-muted-foreground shrink-0 w-16",children:c.id}),s.jsx(ce,{variant:"outline",className:I("text-[9px] px-1 py-0 shrink-0",c.category==="prohibit"?"border-red-500/30 text-red-400":c.category==="require"?"border-blue-500/30 text-blue-400":c.category==="encourage"?"border-emerald-500/30 text-emerald-400":c.category==="limit"?"border-yellow-500/30 text-yellow-400":c.category==="circuit_breaker"?"border-red-500/30 text-red-400":"border-border text-muted-foreground"),children:c.category}),s.jsx("span",{className:"text-foreground/80 flex-1",children:c.description}),s.jsx("span",{className:I("text-[10px] font-mono shrink-0",c.enforcement==="structural"?"text-primary":"text-muted-foreground/50"),children:c.enforcement==="structural"?"ENFORCED":"advisory"})]},d))})]}),l&&s.jsxs("div",{children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"World Definition"}),s.jsxs("div",{className:"rounded border bg-muted/20 p-3",children:[s.jsxs("div",{className:"text-xs text-foreground/80 mb-2 italic",children:['"',l.thesis,'"']}),l.state_variables.length>0&&s.jsxs("div",{className:"mb-2",children:[s.jsx("div",{className:"text-[10px] text-muted-foreground font-semibold mb-1",children:"State Variables:"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:l.state_variables.map((c,d)=>s.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-muted/50 px-1.5 py-0.5 text-[10px] font-mono",children:[s.jsx($2,{className:"h-2.5 w-2.5 text-muted-foreground"}),c.label,c.range&&s.jsxs("span",{className:"text-muted-foreground/50",children:["(",c.range.min,"-",c.range.max,")"]})]},d))})]}),l.invariants.length>0&&s.jsxs("div",{className:"mb-2",children:[s.jsx("div",{className:"text-[10px] text-muted-foreground font-semibold mb-1",children:"Invariants:"}),s.jsx("div",{className:"space-y-0.5",children:l.invariants.map((c,d)=>s.jsxs("div",{className:"text-[11px] text-foreground/70",children:[s.jsx("span",{className:"font-mono text-[10px] text-muted-foreground mr-1",children:c.id}),c.description,c.enforceable&&s.jsx("span",{className:"text-primary text-[10px] ml-1",children:"(enforced)"})]},d))})]}),l.gates&&l.gates.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-[10px] text-muted-foreground font-semibold mb-1",children:"Gates:"}),s.jsx("div",{className:"space-y-0.5",children:l.gates.map((c,d)=>s.jsxs("div",{className:"text-[11px] text-foreground/70",children:[s.jsx("span",{className:I("font-mono text-[10px] mr-1",c.severity==="critical"?"text-red-400":c.severity==="warning"?"text-yellow-400":"text-blue-400"),children:c.severity.toUpperCase()}),c.label,": ",s.jsx("code",{className:"text-[10px] text-muted-foreground",children:c.condition})]},d))})]})]})]}),a&&a.diagnostics.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Policy Health Diagnostics"}),s.jsx("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:a.diagnostics.map((c,d)=>s.jsxs("div",{className:I("flex items-start gap-2 text-xs rounded px-2 py-1.5",c.severity==="error"?"bg-red-500/5":c.severity==="warning"?"bg-yellow-500/5":"bg-muted/30"),children:[s.jsx("span",{className:I("font-mono text-[10px] shrink-0",c.severity==="error"?"text-red-400":c.severity==="warning"?"text-yellow-400":c.severity==="info"?"text-blue-400":"text-muted-foreground"),children:c.severity.toUpperCase()}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-foreground/80",children:c.message}),c.fix&&s.jsxs("div",{className:"text-primary/70 mt-0.5 text-[10px]",children:["Fix: ",c.fix]})]})]},d))})]}),s.jsxs(Qe,{children:[s.jsxs(Xe,{className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/50 hover:text-muted-foreground transition-colors",children:[s.jsx(Mi,{className:"h-3 w-3"}),"View raw world JSON",s.jsx(Ye,{className:"h-3 w-3"})]}),s.jsx(Ze,{children:s.jsx("pre",{className:"mt-2 rounded border bg-muted/30 p-3 text-[10px] font-mono text-muted-foreground overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap",children:JSON.stringify(l,null,2)})})]})]})})]}):null}function D3({summary:e,policyText:t}){const[n,r]=h.useState(!1),o=h.useMemo(()=>{const l=new Map;for(const c of e.results){const d=c.action.agentId;l.has(d)||l.set(d,{total:0,allowed:0,blocked:0,modified:0,penalized:0,rewarded:0,rulesFired:new Map});const u=l.get(d);u.total++;const m=c.verdict.status;m==="ALLOW"?u.allowed++:m==="BLOCK"?u.blocked++:m==="MODIFY"?u.modified++:m==="PENALIZE"?u.penalized++:m==="REWARD"&&u.rewarded++;for(const f of c.verdict.rulesFired)u.rulesFired.set(f.description,(u.rulesFired.get(f.description)??0)+1)}return l},[e]),i=h.useMemo(()=>{const l=new Map;for(const c of e.results)for(const d of c.verdict.rulesFired){const u=d.description;l.has(u)||l.set(u,{count:0,effect:d.effect,id:d.id,totalReduction:0});const m=l.get(u);m.count++,m.totalReduction+=d.impactReduction}return[...l.entries()].sort((c,d)=>d[1].count-c[1].count)},[e]),a=h.useMemo(()=>{const l=new Map;for(const c of e.results){const d=c.cycle;l.has(d)||l.set(d,[]),l.get(d).push(c)}return[...l.entries()].sort((c,d)=>c[0]-d[0])},[e]);return s.jsxs(Qe,{open:n,onOpenChange:r,children:[s.jsxs(Xe,{className:"flex items-center gap-2 w-full rounded-lg border border-border/50 bg-muted/20 px-4 py-2.5 hover:bg-muted/40 transition-colors text-left",children:[s.jsx(G2,{className:"h-4 w-4 text-primary shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-foreground flex-1",children:"View Audit Trail"}),s.jsxs(ce,{variant:"secondary",className:"text-[10px]",children:[e.total," evaluations"]}),n?s.jsx(at,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(Ye,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(Ze,{children:s.jsxs("div",{className:"mt-2 rounded-lg border bg-card p-4 space-y-5",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Per-Agent Breakdown"}),s.jsx("div",{className:"space-y-2",children:[...o.entries()].map(([l,c])=>s.jsxs(Qe,{children:[s.jsxs(Xe,{className:"flex items-center gap-2 w-full rounded bg-muted/30 px-3 py-2 hover:bg-muted/50 transition-colors text-left",children:[s.jsx("span",{className:"font-mono text-xs text-foreground flex-1",children:l}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[c.blocked>0&&s.jsxs("span",{className:"text-[10px] font-mono text-red-400",children:[c.blocked," blocked"]}),c.penalized>0&&s.jsxs("span",{className:"text-[10px] font-mono text-orange-400",children:[c.penalized," penalized"]}),c.modified>0&&s.jsxs("span",{className:"text-[10px] font-mono text-yellow-400",children:[c.modified," modified"]}),c.allowed>0&&s.jsxs("span",{className:"text-[10px] font-mono text-green-400",children:[c.allowed," allowed"]}),c.rewarded>0&&s.jsxs("span",{className:"text-[10px] font-mono text-emerald-400",children:[c.rewarded," rewarded"]}),s.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["(",c.total," total)"]})]}),s.jsx(Ye,{className:"h-3 w-3 text-muted-foreground/50"})]}),s.jsx(Ze,{children:s.jsxs("div",{className:"ml-3 mt-1 space-y-1 border-l-2 border-border/30 pl-3 pb-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex-1 h-2 rounded-full bg-muted overflow-hidden",children:s.jsxs("div",{className:"h-full flex",children:[s.jsx("div",{className:"bg-green-500",style:{width:`${(c.allowed+c.rewarded)/c.total*100}%`}}),s.jsx("div",{className:"bg-yellow-500",style:{width:`${c.modified/c.total*100}%`}}),s.jsx("div",{className:"bg-red-500",style:{width:`${(c.blocked+c.penalized)/c.total*100}%`}})]})}),s.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[Math.round((c.allowed+c.rewarded)/c.total*100),"% pass"]})]}),c.rulesFired.size>0&&s.jsxs("div",{className:"mt-1",children:[s.jsx("div",{className:"text-[10px] text-muted-foreground mb-0.5",children:"Rules triggered:"}),[...c.rulesFired.entries()].map(([d,u],m)=>s.jsxs("div",{className:"text-[11px] text-foreground/60 flex items-center gap-1.5",children:[s.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/50",children:[u,"x"]}),d]},m))]})]})})]},l))})]}),i.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Rule Firing Frequency"}),s.jsx("div",{className:"space-y-1.5",children:i.map(([l,c],d)=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[s.jsx(ce,{variant:"outline",className:I("text-[9px] px-1 py-0 shrink-0",c.effect==="blocked"?"border-red-500/30 text-red-400":c.effect==="penalized"?"border-orange-500/30 text-orange-400":c.effect==="dampened"||c.effect==="capped"?"border-yellow-500/30 text-yellow-400":c.effect==="rewarded"?"border-emerald-500/30 text-emerald-400":"border-border text-muted-foreground"),children:c.effect}),s.jsx("span",{className:"text-xs text-foreground/80 truncate",children:l})]}),s.jsxs("div",{className:"shrink-0 flex items-center gap-2",children:[s.jsx("div",{className:"w-20 h-1.5 rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:I("h-full rounded-full",c.effect==="blocked"?"bg-red-500":c.effect==="penalized"?"bg-orange-500":c.effect==="rewarded"?"bg-emerald-500":"bg-yellow-500"),style:{width:`${Math.min(100,c.count/e.total*100)}%`}})}),s.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground w-6 text-right",children:[c.count,"x"]})]})]},d))})]}),a.length>1&&s.jsxs("div",{children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Timeline (by cycle)"}),s.jsx("div",{className:"space-y-1",children:a.map(([l,c])=>{const d=c.filter(m=>m.verdict.status==="BLOCK"||m.verdict.status==="PENALIZE").length,u=c.length-d;return s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground w-14 shrink-0",children:[s.jsx(Xl,{className:"h-2.5 w-2.5 inline mr-0.5"}),"Cycle ",l]}),s.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:s.jsxs("div",{className:"h-full flex",children:[s.jsx("div",{className:"bg-green-500",style:{width:`${u/c.length*100}%`}}),s.jsx("div",{className:"bg-red-500",style:{width:`${d/c.length*100}%`}})]})}),s.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono w-16 text-right",children:[u,"/",c.length," pass"]})]},l)})})]}),s.jsxs(Qe,{children:[s.jsxs(Xe,{className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/50 hover:text-muted-foreground transition-colors",children:[s.jsx(Lr,{className:"h-3 w-3"}),"View full evaluation log (",e.total," entries)",s.jsx(Ye,{className:"h-3 w-3"})]}),s.jsx(Ze,{children:s.jsx("div",{className:"mt-2 space-y-0.5 max-h-80 overflow-y-auto",children:e.results.map((l,c)=>s.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono rounded px-2 py-1 bg-muted/20 hover:bg-muted/40 transition-colors",children:[s.jsx("span",{className:"text-muted-foreground/40 w-6 shrink-0 text-right",children:c+1}),s.jsxs("span",{className:"text-muted-foreground/60 w-10 shrink-0",children:["c:",l.cycle]}),s.jsx(l1,{status:l.verdict.status}),s.jsx("span",{className:"text-muted-foreground w-20 shrink-0 truncate",children:l.action.agentId}),s.jsx("span",{className:"text-foreground/60 w-16 shrink-0",children:l.action.type}),s.jsx("span",{className:"text-foreground/40 flex-1 truncate",children:l.action.description}),s.jsxs("span",{className:"text-muted-foreground/30 w-8 shrink-0 text-right",children:[(l.action.magnitude*100).toFixed(0),"%"]}),l.verdict.rulesFired.length>0&&s.jsxs("span",{className:"text-muted-foreground/30 shrink-0",children:[l.verdict.rulesFired.length," rules"]})]},c))})})]}),s.jsxs(Qe,{children:[s.jsxs(Xe,{className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/50 hover:text-muted-foreground transition-colors",children:[s.jsx(Mi,{className:"h-3 w-3"}),"View raw audit JSON",s.jsx(Ye,{className:"h-3 w-3"})]}),s.jsx(Ze,{children:s.jsx("pre",{className:"mt-2 rounded border bg-muted/30 p-3 text-[10px] font-mono text-muted-foreground overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap",children:JSON.stringify({session:{engine:e.engineId,totalEvaluations:e.total,agents:e.agents,actionTypes:e.actionTypes},verdictCounts:e.counts,failRate:e.failRate,blockReasons:e.blockReasons,policyText:t,evaluations:e.results.map(l=>({cycle:l.cycle,agent:l.action.agentId,type:l.action.type,description:l.action.description,magnitude:l.action.magnitude,verdict:l.verdict.status,reason:l.verdict.reason,confidence:l.verdict.confidence,rulesFired:l.verdict.rulesFired,consequence:l.verdict.consequence,reward:l.verdict.reward}))},null,2)})})]})]})})]})}function F3({summary:e}){const[t,n]=h.useState(!1),{signals:r,blindSpots:o,agentProfiles:i,echoGroups:a,driftSignal:l}=h.useMemo(()=>{const c=[],d=[],u=new Map;for(const y of e.results){const b=y.action.agentId;u.has(b)||u.set(b,{total:0,failRate:0,dominantFailType:"",dominantFailCount:0,avgMagnitude:0,actionTypes:new Map,failReasons:new Map});const N=u.get(b);if(N.total++,N.avgMagnitude+=y.action.magnitude,N.actionTypes.set(y.action.type,(N.actionTypes.get(y.action.type)??0)+1),y.verdict.status==="BLOCK"||y.verdict.status==="PENALIZE"){N.failRate++;const j=y.verdict.reason;N.failReasons.set(j,(N.failReasons.get(j)??0)+1)}}for(const[,y]of u){y.avgMagnitude=y.avgMagnitude/y.total,y.failRate=y.failRate/y.total;let b=0;for(const[N,j]of y.failReasons)j>b&&(b=j,y.dominantFailType=N,y.dominantFailCount=j)}for(const[y,b]of u)b.failRate>.6&&c.push({label:`${y} fails ${Math.round(b.failRate*100)}% of the time`,detail:b.dominantFailType?`Most common failure: "${b.dominantFailType}" (${b.dominantFailCount}x)`:`High failure rate across ${b.total} actions`,severity:b.failRate>.8?"critical":"warning"});const m=new Map;for(const y of e.results)if(y.verdict.status==="BLOCK"||y.verdict.status==="PENALIZE")for(const b of y.verdict.rulesFired){const N=b.description;m.has(N)||m.set(N,{count:0,agents:new Set,type:b.effect});const j=m.get(N);j.count++,j.agents.add(y.action.agentId)}const f=[...m.entries()].sort((y,b)=>b[1].count-y[1].count).slice(0,3);for(const[y,b]of f)b.count>=2&&c.push({label:`"${y}" triggered ${b.count}x across ${b.agents.size} agent${b.agents.size>1?"s":""}`,detail:"Systemic pattern — not isolated to one agent",severity:b.count>3?"critical":"warning"});const p=new Map;for(const y of e.results){const b=y.action.description.toLowerCase().trim().slice(0,80);p.has(b)||p.set(b,{agents:new Set,actions:[]});const N=p.get(b);N.agents.add(y.action.agentId),N.actions.push(y)}const v=[];for(const[y,b]of p)if(b.agents.size>1){const N=b.actions.some(j=>{var C,k;return((C=j.action.context)==null?void 0:C.reproduced)===!0||typeof((k=j.action.context)==null?void 0:k.references)=="number"&&j.action.context.references>0});v.push({description:y,agents:[...b.agents],independent:N})}if(v.length>0)for(const y of v.slice(0,2))c.push({label:`${y.agents.length} agents produced similar output: "${y.description.slice(0,60)}..."`,detail:y.independent?"At least one agent had independent evidence — possible real convergence":"No independent evidence detected — possible echo amplification",severity:y.independent?"info":"warning"});const g=new Map;for(const y of e.results){const b=y.cycle;g.has(b)||g.set(b,{total:0,failed:0,avgMag:0});const N=g.get(b);N.total++,N.avgMag+=y.action.magnitude,(y.verdict.status==="BLOCK"||y.verdict.status==="PENALIZE")&&N.failed++}const w=[...g.entries()].sort((y,b)=>y[0]-b[0]);let x=null;if(w.length>=2){const y=w[0][1],b=w[w.length-1][1],N=y.failed/y.total,j=b.failed/b.total,C=j-N;Math.abs(C)>.15?(x={direction:C>0?"degrading":"improving",detail:C>0?`Failure rate increased from ${Math.round(N*100)}% to ${Math.round(j*100)}% across ${w.length} cycles`:`Failure rate decreased from ${Math.round(N*100)}% to ${Math.round(j*100)}% across ${w.length} cycles`},c.push({label:x.direction==="degrading"?"Output quality is degrading over time":"Output quality is improving over time",detail:x.detail,severity:x.direction==="degrading"?"critical":"info"})):x={direction:"stable",detail:`Failure rate steady at ~${Math.round(N*100)}% across ${w.length} cycles`}}e.failRate>.5&&c.push({label:`System produces ${Math.round(e.failRate*100)}% non-compliant output`,detail:`Across ${e.agents.length} agent(s) and ${e.actionTypes.length} action type(s)`,severity:e.failRate>.7?"critical":"warning"});for(const[y,b]of u)if(b.failRate>.4){d.push({question:`Did ${y} change strategy after being blocked?`,detail:`${y} was blocked ${Math.round(b.failRate*100)}% of the time, but we can't see if it adapted its approach in subsequent actions.`,unlockLabel:"Agent adaptation tracking"});break}if(v.length>0){const y=v[0];d.push({question:`Did ${y.agents.join(" and ")} converge independently or echo each other?`,detail:"Both produced similar output, but without tracing the decision chain, we can't distinguish true convergence from amplification.",unlockLabel:"Provenance chain tracing"})}return x&&x.direction!=="stable"&&d.push({question:x.direction==="degrading"?"Is this quality drop caused by drift or a deliberate strategy shift?":"Are agents improving because of learning, or just producing less?",detail:`${x.detail}. Inside the loop, we'd see the decision chain that led to this trajectory.`,unlockLabel:"Decision trajectory analysis"}),d.push({question:"Would blocking these outputs actually change agent behavior?",detail:"Right now we evaluate after the fact. Inside the loop, blocked actions create feedback pressure — agents must adapt or get frozen.",unlockLabel:"Closed-loop behavioral shaping"}),e.agents.length>1&&d.push({question:"Are agents coordinating, competing, or drifting apart?",detail:`${e.agents.length} agents observed, but without seeing their inter-round decisions, we can't map coalition formation or competitive dynamics.`,unlockLabel:"Multi-agent dynamics tracking"}),{signals:c,blindSpots:d,agentProfiles:u,echoGroups:v,driftSignal:x}},[e]);return s.jsxs(Qe,{open:t,onOpenChange:n,children:[s.jsxs(Xe,{className:"flex items-center gap-2 w-full rounded-lg border border-border/50 bg-muted/20 px-4 py-2.5 hover:bg-muted/40 transition-colors text-left",children:[s.jsx(Lr,{className:"h-4 w-4 text-violet-400 shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-foreground flex-1",children:"Behavioral Insights"}),r.length>0&&s.jsxs(ce,{variant:"outline",className:I("text-[10px]",r.some(c=>c.severity==="critical")?"border-red-500/30 text-red-400":r.some(c=>c.severity==="warning")?"border-yellow-500/30 text-yellow-400":"border-blue-500/30 text-blue-400"),children:[r.length," observed"]}),s.jsxs(ce,{variant:"outline",className:"text-[10px] border-violet-500/30 text-violet-400",children:[o.length," blind spots"]}),t?s.jsx(at,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(Ye,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(Ze,{children:s.jsx("div",{className:"mt-2 rounded-lg border bg-card p-4",children:s.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(Zl,{className:"h-4 w-4 text-green-400"}),s.jsx("div",{className:"text-xs font-bold text-foreground uppercase tracking-wider",children:"Observed"}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"(from your data)"})]}),r.length===0?s.jsxs("div",{className:"rounded border border-dashed border-border/50 bg-muted/10 p-4 text-center",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"No strong behavioral signals detected"}),s.jsx("div",{className:"text-[10px] text-muted-foreground/50 mt-1",children:"Feed more data or adjust rules to surface patterns"})]}):s.jsx("div",{className:"space-y-2",children:r.map((c,d)=>s.jsx("div",{className:I("rounded-lg border p-3",c.severity==="critical"?"border-red-500/20 bg-red-500/5":c.severity==="warning"?"border-yellow-500/20 bg-yellow-500/5":"border-blue-500/20 bg-blue-500/5"),children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:I("w-1.5 h-1.5 rounded-full mt-1.5 shrink-0",c.severity==="critical"?"bg-red-400":c.severity==="warning"?"bg-yellow-400":"bg-blue-400")}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-medium text-foreground",children:c.label}),s.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:c.detail})]})]})},d))}),i.size>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Agent Output Tendencies"}),s.jsx("div",{className:"space-y-1.5",children:[...i.entries()].map(([c,d])=>{const u=[...d.actionTypes.entries()].sort((m,f)=>f[1]-m[1])[0];return s.jsxs("div",{className:"rounded bg-muted/30 px-3 py-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-mono text-xs text-foreground",children:c}),s.jsxs("span",{className:I("text-[10px] font-mono",d.failRate>.6?"text-red-400":d.failRate>.3?"text-yellow-400":"text-green-400"),children:[Math.round((1-d.failRate)*100),"% compliant"]})]}),s.jsx("div",{className:"flex items-center gap-3 mt-1",children:s.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:s.jsxs("div",{className:"h-full flex",children:[s.jsx("div",{className:"bg-green-500",style:{width:`${(1-d.failRate)*100}%`}}),s.jsx("div",{className:"bg-red-500",style:{width:`${d.failRate*100}%`}})]})})}),s.jsxs("div",{className:"flex gap-3 mt-1 text-[10px] text-muted-foreground",children:[s.jsxs("span",{children:[d.total," actions"]}),u&&s.jsxs("span",{children:["mostly: ",u[0]]}),s.jsxs("span",{children:["avg intensity: ",(d.avgMagnitude*100).toFixed(0),"%"]})]})]},c)})})]}),l&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Output Drift"}),s.jsxs("div",{className:I("rounded-lg border p-3 flex items-center gap-3",l.direction==="degrading"?"border-red-500/20 bg-red-500/5":l.direction==="improving"?"border-green-500/20 bg-green-500/5":"border-border/50 bg-muted/20"),children:[s.jsx("div",{className:I("text-lg",l.direction==="degrading"?"text-red-400":l.direction==="improving"?"text-green-400":"text-muted-foreground"),children:l.direction==="degrading"?"↘":l.direction==="improving"?"↗":"→"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-medium text-foreground",children:l.direction==="degrading"?"Quality Degrading":l.direction==="improving"?"Quality Improving":"Quality Stable"}),s.jsx("div",{className:"text-[11px] text-muted-foreground",children:l.detail})]})]})]}),a.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Echo Detection"}),s.jsx("div",{className:"space-y-1.5",children:a.slice(0,3).map((c,d)=>s.jsxs("div",{className:I("rounded border p-2",c.independent?"border-green-500/20 bg-green-500/5":"border-yellow-500/20 bg-yellow-500/5"),children:[s.jsxs("div",{className:"text-xs text-foreground/80 line-clamp-1",children:['"',c.description,'"']}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsx("div",{className:"flex gap-1",children:c.agents.map((u,m)=>s.jsx("span",{className:"font-mono text-[10px] bg-muted/50 rounded px-1 py-0.5",children:u},m))}),s.jsx("span",{className:I("text-[10px] font-bold",c.independent?"text-green-400":"text-yellow-400"),children:c.independent?"possible convergence":"possible echo"})]})]},d))})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(et,{className:"h-4 w-4 text-violet-400"}),s.jsx("div",{className:"text-xs font-bold text-foreground uppercase tracking-wider",children:"Requires Integration"}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"(blind spots)"})]}),s.jsx("div",{className:"space-y-2",children:o.map((c,d)=>s.jsxs("div",{className:"rounded-lg border border-violet-500/15 bg-violet-500/5 p-3",children:[s.jsx("div",{className:"text-xs font-medium text-foreground",children:c.question}),s.jsx("div",{className:"text-[11px] text-muted-foreground mt-1",children:c.detail}),s.jsxs("div",{className:"flex items-center gap-1.5 mt-2",children:[s.jsx("div",{className:"h-px flex-1 bg-violet-500/10"}),s.jsxs("span",{className:"text-[9px] font-bold uppercase tracking-wider text-violet-400/70",children:["unlocks: ",c.unlockLabel]}),s.jsx("div",{className:"h-px flex-1 bg-violet-500/10"})]})]},d))}),s.jsxs("div",{className:"mt-4 rounded-lg border border-dashed border-violet-500/20 bg-violet-500/5 p-4",children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-violet-400/70 mb-2",children:"If you integrate — it becomes enforcement"}),s.jsx("div",{className:"space-y-2",children:[{now:"Evaluate after",next:"Enforce before",icon:"→"},{now:"Observe outputs",next:"Block bad actions",icon:"→"},{now:"See what failed",next:"Prevent failures",icon:"→"}].map((c,d)=>s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx("span",{className:"text-muted-foreground w-24 text-right",children:c.now}),s.jsx("span",{className:"text-violet-400/50",children:c.icon}),s.jsx("span",{className:"text-foreground font-medium",children:c.next})]},d))}),s.jsx("div",{className:"mt-3 text-[10px] text-muted-foreground/60 text-center",children:"Same rules. Same logic. Now enforced in real time."}),s.jsx("div",{className:"mt-1 text-center",children:s.jsx("code",{className:"text-[10px] bg-muted/30 border border-violet-500/10 rounded px-2 py-0.5 font-mono text-violet-400/70",children:"my_agent | neuroverse guard --world ./world"})})]})]})]})})})]})}function z3(){var T,L;const{theme:e,toggle:t}=gf(),[n,r]=h.useState(1),[o,i]=h.useState(()=>{try{return!!localStorage.getItem("neuroverse_api_key")}catch{return!1}}),[a,l]=h.useState(!1),c=h.useCallback(S=>{i(!!S)},[]),d=h.useMemo(()=>{if(o)return async S=>{const D=ac();if(D==="deterministic")return[];const F=lc(D),G=[];if(S.explore.trim()&&G.push(`EXPLORE (what agents should investigate): ${S.explore}`),S.exclude.trim()&&G.push(`EXCLUDE (what should be blocked): ${S.exclude}`),S.elevate.trim()&&G.push(`ELEVATE (what makes results valuable): ${S.elevate}`),S.experiment.length>0){const B=S.experiment.map(ee=>` IF ${ee.condition} THEN ${ee.outcome} [${ee.verdict}]`);G.push(`BEHAVIOR SHAPING:
|
|
644
|
+
${B.join(`
|
|
645
|
+
`)}`)}S.openEnded.trim()&&G.push(`OPEN-ENDED: ${S.openEnded}`);const Q=`You are a governance rule generator for a multi-agent AI system.
|
|
646
|
+
|
|
647
|
+
Given the following user intent, generate governance rules as a JSON array.
|
|
648
|
+
|
|
649
|
+
USER INTENT:
|
|
650
|
+
${G.join(`
|
|
651
|
+
|
|
652
|
+
`)}
|
|
653
|
+
|
|
654
|
+
Generate a JSON array of rules. Each rule must have:
|
|
655
|
+
- id: string (rule_0, rule_1, etc.)
|
|
656
|
+
- source: "explore" | "exclude" | "elevate" | "experiment" | "open_ended"
|
|
657
|
+
- naturalLanguage: string (human-readable description of the rule)
|
|
658
|
+
- ruleType: "ALLOW" | "BLOCK" | "PRIORITIZE" | "GATE" | "REWARD" | "PENALIZE" | "NEUTRAL"
|
|
659
|
+
- condition: string (machine-readable condition expression)
|
|
660
|
+
- effect: string (what happens when the rule fires)
|
|
661
|
+
- confidence: number (0-1, how confident you are in the rule interpretation)
|
|
662
|
+
|
|
663
|
+
Guidelines:
|
|
664
|
+
- EXCLUDE items should become BLOCK rules with high confidence
|
|
665
|
+
- EXPLORE items should become ALLOW rules that scope agent behavior
|
|
666
|
+
- ELEVATE items should become PRIORITIZE rules
|
|
667
|
+
- Experiment IF/THEN should map directly to REWARD/PENALIZE/NEUTRAL
|
|
668
|
+
- Open-ended items should be interpreted creatively into specific rules
|
|
669
|
+
- Generate specific, enforceable conditions (e.g., "action.confidence < 0.7" not vague descriptions)
|
|
670
|
+
- Avoid generating conflicting rules (e.g., don't block and require the same thing)
|
|
671
|
+
|
|
672
|
+
Respond with ONLY the JSON array, no markdown fences, no explanation.`,K=(await F.translate(Q)).map((B,ee)=>({id:`rule_${ee}`,source:B.sector??"open_ended",naturalLanguage:B.action??B.type??"AI-generated rule",ruleType:B.severity&&B.severity>.7?"BLOCK":B.impact&&B.impact>.5?"REWARD":B.impact&&B.impact<-.5?"PENALIZE":"ALLOW",condition:B.action??"",effect:B.type??"",confidence:B.confidence??.8}));return K.length>0?K:[]}},[o]),[u,m]=h.useState(null),[f,p]=h.useState(null),[v,g]=h.useState(""),[w,x]=h.useState(""),[y,b]=h.useState(!1),[N,j]=h.useState(null),[C,k]=h.useState("all"),P=h.useRef(null),E=I3(),R=u?E.find(S=>S.id===u):null,_=h.useCallback(S=>{m(S);const D=E.find(F=>F.id===S);D&&g(D.exampleRules)},[E]),M=h.useCallback(S=>{p(S);const D=S.rules.map(F=>F.ruleType==="BLOCK"?`Block ${F.naturalLanguage.replace(/^BLOCK:\s*/i,"")}`:F.ruleType==="PRIORITIZE"?`Prioritize ${F.naturalLanguage.replace(/^PRIORITIZE:\s*/i,"")}`:F.ruleType==="PENALIZE"?`Penalize when ${F.naturalLanguage}`:F.ruleType==="REWARD"?`Reward when ${F.naturalLanguage}`:F.naturalLanguage);g(D.join(`
|
|
673
|
+
`))},[]),O=h.useCallback(S=>{var G;const D=(G=S.target.files)==null?void 0:G[0];if(!D)return;const F=new FileReader;F.onload=Q=>{var K;const re=(K=Q.target)==null?void 0:K.result;if(x(re),u==="custom"){const B=Hu(re),ee=M3(B);ee!=="custom"&&m(ee)}},F.readAsText(D)},[u]);h.useCallback(()=>{R&&x(R.exampleLine)},[R]);const A=h.useCallback(()=>{!w.trim()||!v.trim()||!u||(b(!0),j(null),setTimeout(()=>{const D=T3(u).evaluateAll(w,v);j(D),b(!1)},100))},[w,v,u]),H=h.useCallback(async()=>{if(u==="scienceclaw")try{const S=await fetch("/examples/scienceclaw/harry-investigation.jsonl");if(S.ok){x(await S.text());return}}catch{}R&&x(R.exampleLine)},[u,R]),z=(N==null?void 0:N.results.filter(S=>C==="all"?!0:S.verdict.status===C))??[],U=S=>{navigator.clipboard.writeText(S).catch(()=>{})};return s.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[s.jsx("div",{className:"border-b bg-card/50 backdrop-blur-sm",children:s.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(et,{className:"h-5 w-5 text-primary"}),s.jsx("span",{className:"font-semibold text-foreground",children:"NeuroVerse"}),s.jsx(ce,{variant:"outline",className:"text-[10px] border-primary/30 text-primary",children:"Governance"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs text-muted-foreground hidden sm:block",children:"Define the rules. See what actually holds up."}),s.jsx("button",{onClick:()=>l(!a),className:I("rounded-lg border p-2 transition-colors",o?"border-emerald-500/30 bg-emerald-500/10 hover:bg-emerald-500/20":"border-border/50 hover:bg-muted/50"),title:o?"AI key configured — click to manage":"Add your AI API key for smarter rule generation",children:s.jsx(Fn,{className:I("h-4 w-4",o?"text-emerald-400":"text-muted-foreground")})}),s.jsx("button",{onClick:t,className:"rounded-lg border border-border/50 p-2 hover:bg-muted/50 transition-colors",title:e==="dark"?"Switch to light mode":"Switch to dark mode",children:e==="dark"?s.jsx(Bv,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(Dv,{className:"h-4 w-4 text-muted-foreground"})})]})]}),s.jsxs("div",{className:"flex items-center gap-8 mt-4",children:[s.jsx(vd,{step:1,current:n,label:"Pick Your System",done:u!==null&&n>1}),s.jsx(Is,{className:"h-4 w-4 text-muted-foreground/30"}),s.jsx(vd,{step:2,current:n,label:"Define Rules",done:v.length>0&&n>2}),s.jsx(Is,{className:"h-4 w-4 text-muted-foreground/30"}),s.jsx(vd,{step:3,current:n,label:"Run Governance",done:N!==null})]})]})}),a&&s.jsx("div",{className:"border-b bg-card/80 backdrop-blur-sm",children:s.jsx("div",{className:"max-w-md mx-auto px-6 py-4",children:s.jsx(kf,{onKeyChange:c})})}),s.jsxs("div",{className:"flex-1 max-w-6xl mx-auto px-6 py-6 w-full",children:[n===1&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-foreground",children:"Pick your system"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose what you're evaluating. We map the fields automatically."})]}),s.jsx("div",{className:"grid grid-cols-2 gap-4",children:E.map(S=>{const D=ya[S.color]??ya.zinc,F=u===S.id;return s.jsxs("button",{onClick:()=>_(S.id),className:I("rounded-xl border-2 p-5 text-left transition-all hover:scale-[1.01]",F?`${D.border} ${D.bg} ring-2 ring-primary/20`:"border-border/50 hover:border-border hover:bg-muted/30"),children:[s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx("div",{className:I("flex h-10 w-10 items-center justify-center rounded-lg",D.bg),children:s.jsx(O3,{name:S.icon,className:I("h-5 w-5",D.text)})}),s.jsxs("div",{children:[s.jsx("div",{className:"font-bold text-foreground",children:S.name}),s.jsx("div",{className:"flex gap-1.5 mt-0.5",children:S.tags.map(G=>s.jsx(ce,{variant:"secondary",className:"text-[9px] px-1.5 py-0",children:G},G))})]}),F&&s.jsx(Sn,{className:"h-5 w-5 text-primary ml-auto"})]}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:S.description})]},S.id)})}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(Z,{onClick:()=>r(2),disabled:!u,className:"gap-2",children:["Next: Define Rules",s.jsx(Is,{className:"h-4 w-4"})]})})]}),n===2&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-foreground",children:"Define your rules"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Describe what matters — in plain language. Or write rules directly."})]}),R&&s.jsx(ce,{variant:"outline",className:(T=ya[R.color])==null?void 0:T.badge,children:R.name})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[s.jsx("div",{children:s.jsx(lw,{onWorldReady:M,onIntentChange:()=>{},aiTranslate:d,hasAIKey:o})}),s.jsx("div",{className:"space-y-4",children:s.jsxs(pe,{children:[s.jsx(Pe,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Pr,{className:"h-4 w-4 text-muted-foreground"}),s.jsx(_e,{className:"text-sm",children:"Rules (plain English)"})]})}),s.jsxs(he,{className:"space-y-3",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the builder, or write rules directly. One rule per line."}),s.jsx("textarea",{className:"w-full h-64 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:(R==null?void 0:R.exampleRules)??"Write your rules here...",value:v,onChange:S=>g(S.target.value)}),v.trim().length===0&&R&&s.jsxs(Z,{variant:"outline",size:"sm",className:"w-full text-xs",onClick:()=>g(R.exampleRules),children:[s.jsx(Fn,{className:"h-3.5 w-3.5 mr-1.5"}),"Load example rules for ",R.name]}),v.trim().length>0&&s.jsxs("div",{className:"rounded-lg border bg-muted/30 p-3",children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"What this will enforce:"}),s.jsx("div",{className:"space-y-1",children:v.split(`
|
|
674
|
+
`).filter(S=>S.trim()).map((S,D)=>{const F=S.toLowerCase(),G=F.startsWith("block")||F.startsWith("halt")||F.startsWith("prohibit"),Q=F.startsWith("penalize")||F.startsWith("freeze"),re=F.startsWith("reward")||F.startsWith("boost"),K=F.startsWith("require");return s.jsxs("div",{className:"flex items-start gap-1.5 text-xs",children:[s.jsx("span",{className:I("shrink-0 font-mono font-bold text-[10px] mt-0.5",G?"text-red-400":Q?"text-orange-400":re?"text-emerald-400":K?"text-blue-400":"text-muted-foreground"),children:G?"BLOCK":Q?"PEN":re?"REWARD":K?"REQ":"RULE"}),s.jsx("span",{className:"text-foreground/80",children:S.trim()})]},D)})})]})]})]})})]}),v.trim()&&(()=>{const S=mo(v),D=fo(S),F=D.diagnostics.length>0,G=D.diagnostics.filter(K=>K.severity==="error"),Q=D.diagnostics.filter(K=>K.severity==="warning"),re=D.diagnostics.filter(K=>K.severity==="info"||K.severity==="hint");return F?s.jsxs("div",{className:I("rounded-xl border-2 p-5 space-y-3",G.length>0?"border-red-500/30 bg-red-500/5":Q.length>0?"border-yellow-500/30 bg-yellow-500/5":"border-blue-500/30 bg-blue-500/5"),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Un,{className:I("h-5 w-5",G.length>0?"text-red-400":"text-yellow-400")}),s.jsx("span",{className:"text-sm font-bold text-foreground",children:"Policy Issues Found"}),s.jsxs(ce,{variant:"outline",className:I("text-[10px]",G.length>0?"border-red-500/30 text-red-400":"border-yellow-500/30 text-yellow-400"),children:[D.healthScore,"/100 health"]})]}),s.jsxs("div",{className:"flex gap-2",children:[G.length>0&&s.jsxs("span",{className:"text-[10px] font-mono text-red-400",children:[G.length," error",G.length>1?"s":""]}),Q.length>0&&s.jsxs("span",{className:"text-[10px] font-mono text-yellow-400",children:[Q.length," warning",Q.length>1?"s":""]})]})]}),G.length>0&&s.jsx("div",{className:"space-y-2",children:G.map((K,B)=>s.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 p-3",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"shrink-0 text-[10px] font-mono font-bold text-red-400 mt-0.5",children:"ERROR"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs font-medium text-foreground",children:K.message}),K.detail&&s.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:K.detail}),K.fix&&s.jsxs("div",{className:"mt-2 flex items-start gap-2 rounded bg-background/30 p-2",children:[s.jsx(Fn,{className:"h-3 w-3 text-primary shrink-0 mt-0.5"}),s.jsx("div",{className:"text-[11px] text-primary",children:K.fix})]}),K.quickFix&&s.jsxs(Z,{variant:"outline",size:"sm",className:"mt-2 h-6 text-[10px] gap-1 border-red-500/20 text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>{var ee,be,ue;if(((ee=K.quickFix)==null?void 0:ee.operation)==="replace"&&K.quickFix.text){const oe=v.split(`
|
|
675
|
+
`),ie=K.quickFix.targetLines??[],Me=oe.filter((Ke,Wt)=>!ie.includes(Wt+1));Me.push(K.quickFix.text),g(Me.join(`
|
|
676
|
+
`))}else if(((be=K.quickFix)==null?void 0:be.operation)==="insert"&&K.quickFix.text)g(v.trim()+`
|
|
677
|
+
`+K.quickFix.text);else if(((ue=K.quickFix)==null?void 0:ue.operation)==="remove"&&K.quickFix.targetLines){const ie=v.split(`
|
|
678
|
+
`).filter((Me,Ke)=>!K.quickFix.targetLines.includes(Ke+1));g(ie.join(`
|
|
679
|
+
`))}},children:[s.jsx(kr,{className:"h-3 w-3"}),K.quickFix.label]})]})]})},B))}),Q.length>0&&s.jsx("div",{className:"space-y-2",children:Q.map((K,B)=>s.jsx("div",{className:"rounded-lg border border-yellow-500/15 bg-yellow-500/5 p-3",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"shrink-0 text-[10px] font-mono font-bold text-yellow-400 mt-0.5",children:"WARN"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs font-medium text-foreground",children:K.message}),K.fix&&s.jsx("div",{className:"text-[11px] text-primary/70 mt-1",children:K.fix}),K.quickFix&&s.jsxs(Z,{variant:"outline",size:"sm",className:"mt-2 h-6 text-[10px] gap-1 border-yellow-500/20 text-yellow-400 hover:text-yellow-300 hover:bg-yellow-500/10",onClick:()=>{var ee;((ee=K.quickFix)==null?void 0:ee.operation)==="insert"&&K.quickFix.text&&g(v.trim()+`
|
|
680
|
+
`+K.quickFix.text)},children:[s.jsx(kr,{className:"h-3 w-3"}),K.quickFix.label]})]})]})},B))}),re.length>0&&s.jsxs("details",{className:"group",children:[s.jsxs("summary",{className:"cursor-pointer text-[11px] text-muted-foreground hover:text-foreground",children:[re.length," suggestion",re.length>1?"s":""," to improve coverage"]}),s.jsx("div",{className:"mt-2 space-y-1.5",children:re.map((K,B)=>s.jsxs("div",{className:"flex items-start gap-2 text-xs rounded bg-muted/30 p-2",children:[s.jsx("span",{className:"shrink-0 text-[10px] font-mono text-blue-400",children:"INFO"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("span",{className:"text-foreground/80",children:K.message}),K.quickFix&&s.jsxs(Z,{variant:"ghost",size:"sm",className:"ml-2 h-5 text-[10px] gap-1 text-primary/70",onClick:()=>{var ee;((ee=K.quickFix)==null?void 0:ee.operation)==="insert"&&K.quickFix.text&&g(v.trim()+`
|
|
681
|
+
`+K.quickFix.text)},children:[s.jsx(Dn,{className:"h-2.5 w-2.5"}),K.quickFix.label]})]})]},B))})]})]}):null})(),v.trim()&&s.jsx(wg,{policyText:v,worldOutput:f,engineName:(R==null?void 0:R.name)??"Custom"}),s.jsxs("div",{className:"flex justify-between",children:[s.jsxs(Z,{variant:"outline",onClick:()=>r(1),className:"gap-2",children:[s.jsx(yh,{className:"h-4 w-4"}),"Back"]}),s.jsxs(Z,{onClick:()=>r(3),disabled:!v.trim(),className:"gap-2",children:["Next: Evaluate Output",s.jsx(Is,{className:"h-4 w-4"})]})]})]}),n===3&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-foreground",children:"Run governance"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Upload your system's real output. We evaluate every action against your rules — and show you exactly what fails, why, and what your rules actually enforce."})]}),R&&s.jsx(ce,{variant:"outline",className:(L=ya[R.color])==null?void 0:L.badge,children:R.name})]}),N?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[s.jsx(pe,{className:"bg-card",children:s.jsxs(he,{className:"pt-4 pb-3 text-center",children:[s.jsx("div",{className:"text-3xl font-bold text-foreground tabular-nums",children:N.total}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Total Actions"})]})}),s.jsx(pe,{className:I("bg-card",N.counts.blocked>0&&"border-red-500/30"),children:s.jsxs(he,{className:"pt-4 pb-3 text-center",children:[s.jsx("div",{className:"text-3xl font-bold text-red-400 tabular-nums",children:N.counts.blocked+N.counts.penalized}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Blocked / Penalized"})]})}),s.jsx(pe,{className:"bg-card",children:s.jsxs(he,{className:"pt-4 pb-3 text-center",children:[s.jsx("div",{className:"text-3xl font-bold text-yellow-400 tabular-nums",children:N.counts.modified+N.counts.paused}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Modified / Paused"})]})}),s.jsx(pe,{className:I("bg-card",N.counts.allowed>0&&"border-green-500/30"),children:s.jsxs(he,{className:"pt-4 pb-3 text-center",children:[s.jsx("div",{className:"text-3xl font-bold text-green-400 tabular-nums",children:N.counts.allowed+N.counts.rewarded}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Allowed / Rewarded"})]})})]}),s.jsxs("div",{className:I("rounded-xl border-2 p-6 text-center",N.failRate>.5?"border-red-500/40 bg-red-500/5":N.failRate>.2?"border-yellow-500/40 bg-yellow-500/5":"border-green-500/40 bg-green-500/5"),children:[s.jsxs("div",{className:I("text-2xl font-bold",N.failRate>.5?"text-red-400":N.failRate>.2?"text-yellow-400":"text-green-400"),children:[Math.round(N.failRate*100),"% of outputs fail your rules"]}),s.jsxs("div",{className:"text-sm text-muted-foreground mt-2",children:[N.agents.length," agent",N.agents.length!==1?"s":""," evaluated"," · ",N.actionTypes.length," action type",N.actionTypes.length!==1?"s":""," observed"]}),N.blockReasons.length>0&&s.jsxs("div",{className:"mt-4 text-left max-w-xl mx-auto",children:[s.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:"Why outputs failed:"}),s.jsx("div",{className:"space-y-1",children:N.blockReasons.map((S,D)=>s.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[s.jsx(Ii,{className:"h-3.5 w-3.5 text-red-400 shrink-0 mt-0.5"}),s.jsx("span",{className:"text-foreground/80",children:S})]},D))})]})]}),s.jsx(pe,{className:"border-primary/30 bg-primary/5",children:s.jsx(he,{className:"pt-5 pb-5",children:s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx(et,{className:"h-8 w-8 text-primary shrink-0 mt-0.5"}),s.jsxs("div",{className:"flex-1 space-y-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-bold text-foreground",children:"Want this enforced — not just observed?"}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Right now you're evaluating outputs after the fact. Put governance inside your loop and agents must follow your rules — or get blocked before they act."})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"rounded-lg border border-border/50 bg-background/50 p-3",children:[s.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground mb-1.5",children:"Pipe mode"}),s.jsx("code",{className:"text-[11px] font-mono text-primary block",children:"my_agent | neuroverse guard --world ./world"})]}),s.jsxs("div",{className:"rounded-lg border border-border/50 bg-background/50 p-3",children:[s.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground mb-1.5",children:"HTTP mode"}),s.jsx("code",{className:"text-[11px] font-mono text-primary block",children:"POST /api/evaluate"})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"text-[10px] text-muted-foreground",children:["Same rules. Same logic. Now enforced in real time."," ",s.jsx("a",{href:"https://github.com/NeuroverseOS/Neuroverseos-governance",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Open source"})]}),s.jsx("code",{className:"text-[10px] bg-muted/50 border rounded px-2 py-1 font-mono text-muted-foreground",children:"npm i @neuroverseos/governance"})]})]})]})})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Show:"}),["all","BLOCK","PENALIZE","MODIFY","ALLOW","REWARD"].map(S=>s.jsx("button",{onClick:()=>k(S),className:I("rounded-full px-2.5 py-1 text-[10px] font-bold uppercase tracking-wider transition-all",C===S?"bg-primary/20 text-primary border border-primary/30":"text-muted-foreground/60 hover:text-muted-foreground border border-transparent"),children:S==="all"?`All (${N.total})`:`${S} (${S==="BLOCK"?N.counts.blocked:S==="PENALIZE"?N.counts.penalized:S==="MODIFY"?N.counts.modified:S==="ALLOW"?N.counts.allowed:S==="REWARD"?N.counts.rewarded:0})`},S))]}),s.jsxs("div",{className:"space-y-2",children:[z.map((S,D)=>s.jsx($3,{result:S},D)),z.length===0&&s.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No results match this filter"})]}),N.parseErrors.length>0&&s.jsxs(Qe,{children:[s.jsxs(Xe,{className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground",children:[s.jsx(Un,{className:"h-3.5 w-3.5 text-yellow-400"}),N.parseErrors.length," line(s) could not be parsed",s.jsx(Ye,{className:"h-3 w-3"})]}),s.jsx(Ze,{children:s.jsx("div",{className:"mt-2 rounded border bg-muted/30 p-3 space-y-1",children:N.parseErrors.map((S,D)=>s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Line ",S.index+1,": ",S.error]},D))})})]}),s.jsx(a1,{className:"my-2"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(F3,{summary:N}),s.jsx(wg,{policyText:v,worldOutput:f,engineName:(R==null?void 0:R.name)??"Custom"}),s.jsx(D3,{summary:N,policyText:v})]})]}):s.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[s.jsx("div",{className:"space-y-4",children:s.jsxs(pe,{children:[s.jsx(Pe,{className:"pb-2",children:s.jsx(_e,{className:"text-sm",children:"System Output"})}),s.jsxs(he,{className:"space-y-3",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(Z,{variant:"outline",size:"sm",className:"flex-1 text-xs",onClick:()=>{var S;return(S=P.current)==null?void 0:S.click()},children:[s.jsx(Xm,{className:"h-3.5 w-3.5 mr-1.5"}),"Upload JSONL"]}),s.jsx("input",{ref:P,type:"file",accept:".jsonl,.json,.txt",className:"hidden",onChange:O}),s.jsxs(Z,{variant:"outline",size:"sm",className:"flex-1 text-xs",onClick:H,children:[s.jsx(Mi,{className:"h-3.5 w-3.5 mr-1.5"}),"Load Demo Data"]})]}),s.jsx("textarea",{className:"w-full h-72 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:`Paste your ${(R==null?void 0:R.name)??"system"} output here (JSONL format — one JSON object per line)
|
|
682
|
+
|
|
683
|
+
Example:
|
|
684
|
+
${(R==null?void 0:R.exampleLine)??'{"agent_id": "agent_1", "type": "decision", "description": "...", "step": 1}'}`,value:w,onChange:S=>x(S.target.value)}),w.trim()&&s.jsxs("div",{className:"text-xs text-muted-foreground",children:[Hu(w).length," records detected"]})]})]})}),s.jsxs("div",{className:"space-y-4",children:[R&&s.jsxs(pe,{children:[s.jsx(Pe,{className:"pb-2",children:s.jsx(_e,{className:"text-sm",children:"How to get your output"})}),s.jsx(he,{children:s.jsxs("div",{className:"relative",children:[s.jsx("pre",{className:"text-xs bg-muted/50 border rounded p-3 font-mono whitespace-pre-wrap leading-relaxed overflow-x-auto max-h-48",children:R.captureInstructions}),s.jsx(Z,{variant:"ghost",size:"sm",className:"absolute top-1 right-1 h-7 w-7 p-0",onClick:()=>U(R.captureInstructions),children:s.jsx(bi,{className:"h-3 w-3"})})]})})]}),s.jsxs(pe,{children:[s.jsx(Pe,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(et,{className:"h-4 w-4 text-primary"}),s.jsx(_e,{className:"text-sm",children:"Active Rules"}),s.jsxs(ce,{variant:"secondary",className:"text-[10px]",children:[v.split(`
|
|
685
|
+
`).filter(S=>S.trim()).length," rules"]})]})}),s.jsxs(he,{children:[s.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:v.split(`
|
|
686
|
+
`).filter(S=>S.trim()).map((S,D)=>s.jsx("div",{className:"text-xs text-muted-foreground truncate",children:S.trim()},D))}),s.jsx(Z,{variant:"ghost",size:"sm",className:"w-full mt-2 text-xs text-muted-foreground",onClick:()=>r(2),children:"Edit rules"})]})]})]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsxs(Z,{variant:"outline",onClick:()=>{r(2),j(null)},className:"gap-2",children:[s.jsx(yh,{className:"h-4 w-4"}),"Edit Rules"]}),N?s.jsx("div",{className:"flex gap-2",children:s.jsx(Z,{variant:"outline",onClick:()=>{j(null),x("")},className:"gap-2",children:"Evaluate New Data"})}):s.jsx(Z,{onClick:A,disabled:!w.trim()||!v.trim()||y,className:"gap-2",size:"lg",children:y?s.jsxs(s.Fragment,{children:[s.jsx(wu,{className:"h-4 w-4 animate-spin"}),"Evaluating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Li,{className:"h-4 w-4"}),"Run Governance"]})})]})]})]}),s.jsxs("div",{className:"border-t bg-muted/30 py-3 text-center",children:[s.jsx("div",{className:"text-[10px] text-muted-foreground",children:"You define what counts. This shows you what actually does."}),s.jsxs("div",{className:"text-[10px] text-muted-foreground/60 mt-1",children:["Governance engine is"," ",s.jsx("a",{href:"https://github.com/NeuroverseOS/Neuroverseos-governance",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground hover:underline",children:"fully open source"})]})]})]})}const B3=()=>{const e=iv();return h.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),s.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},V3=new cS,W3=()=>s.jsx(uS,{client:V3,children:s.jsxs(y5,{children:[s.jsx(MC,{}),s.jsx(Rk,{}),s.jsx(QS,{children:s.jsxs(GS,{children:[s.jsx(zo,{path:"/",element:s.jsx(u3,{})}),s.jsx(zo,{path:"/science",element:s.jsx(E3,{})}),s.jsx(zo,{path:"/govern",element:s.jsx(z3,{})}),s.jsx(zo,{path:"*",element:s.jsx(B3,{})})]})})]})});U0(document.getElementById("root")).render(s.jsx(W3,{}));export{j5 as A,oc as a,k5 as e,lc as g};
|