1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Tape-WFrxb31c.js","assets/SEOFooter-ChKYDnbu.js","assets/twitter-CEJiaCmz.js","assets/mail-qvsh7bQ8.js","assets/format-DjRxwH3y.js","assets/subDays-Cqq1FCcj.js","assets/arrow-left-C0WNe__n.js","assets/calendar-tUKuUoNb.js","assets/search-CwLiK-Ts.js","assets/TapeArchive-C0oXY6n0.js","assets/chevron-left-OEOB9cRj.js","assets/Articles-BEbzqdGk.js","assets/filter-DdMKstNa.js","assets/AcademyArticle-DzdN3MRA.js","assets/eye-CIU_Es_c.js","assets/history-DoZIRmpJ.js","assets/layers-CPOp1srd.js","assets/lightbulb-DIiM8qE_.js","assets/Asset-CQ7_01QM.js","assets/generateCategoricalChart-B6jrSxr9.js","assets/AreaChart-CdMPN2tR.js","assets/message-circle-DU4qn8RT.js","assets/arrow-left-right-UJxMgAus.js","assets/newspaper-Blhaxeak.js","assets/Learn-B_8zMuXg.js","assets/CourseView-D-mcswZZ.js","assets/timer-hF13M3Ad.js","assets/textarea-CrN_Hc0e.js","assets/thumbs-up-CNC_HQ1x.js","assets/trash-2-BGwCMA8T.js","assets/download-Cfh60q84.js","assets/flame-BIEOP9Uk.js","assets/pause-DUE6GJhl.js","assets/LearningDashboard-DWn7navQ.js","assets/AgentAnalytics-PJNyXhUu.js","assets/CartesianGrid-GMSU1WFQ.js","assets/PieChart-BCRzZDLR.js","assets/BarChart-0unBuzBV.js","assets/LineChart-zqQFYX4L.js","assets/Leaderboard-F3WMo3ZV.js","assets/Agents-Dj7W-Yji.js","assets/boxes-DynYn-P4.js","assets/AgentDetail-C2NLPpHr.js","assets/ProAgents-CpWo5TZz.js","assets/network-67E6VrGF.js","assets/hexagon-Chchozd1.js","assets/leaf-0sjDIYhp.js","assets/ProQuants-CGDSF7lb.js","assets/collapsible-Dx9uShpA.js","assets/index-VKhLDAfi.js","assets/popover-JFv6ks3X.js","assets/scale-4ZGSKKpy.js","assets/droplets-37vBaN15.js","assets/link-r0fM0-0A.js","assets/chart-pie-Dk9lMnEK.js","assets/bell-BIIMqXWS.js","assets/settings-DwYR5Tie.js","assets/shopping-cart-WPo17qWK.js","assets/Trade-CuJd2AmK.js","assets/Api-CogWKIOr.js","assets/SignalPage-3r9ASSaQ.js","assets/Methodology-CjQCthJr.js","assets/Transparency-xGXzsd4n.js","assets/info-BeJ_90pV.js","assets/FAQ-CbeatUND.js","assets/accordion-C8lJ83Ra.js","assets/code-CFPuXCBq.js","assets/NotFound-9SYSrgRJ.js","assets/AssetHubGuide-DEL0Lqr2.js","assets/Ondo-Du4ZVi4F.js","assets/landmark-_1bX10ZH.js","assets/TokenizedStocksRisks-Bs_SYOC6.js","assets/Developers-DrhP81VL.js","assets/terminal-DxxfOtk9.js","assets/KYBCompliance-DKSFeQNc.js","assets/AdminDeduplication-GXWRxRYF.js","assets/About-BQW5Ryix.js","assets/RiskDisclaimer-BBBXPrmW.js","assets/Team-DMem2Xa2.js","assets/IntegrationsHub-Bu8L-0UJ.js"])))=>i.map(i=>d[i]); 2var LA=Object.defineProperty;var Ng=e=>{throw TypeError(e)};var DA=(e,t,n)=>t in e?LA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var G=(e,t,n)=>DA(e,typeof t!="symbol"?t+"":t,n),Mu=(e,t,n)=>t.has(e)||Ng("Cannot "+n);var O=(e,t,n)=>(Mu(e,t,"read from private field"),n?n.call(e):t.get(e)),we=(e,t,n)=>t.has(e)?Ng("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ue=(e,t,n,r)=>(Mu(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ct=(e,t,n)=>(Mu(e,t,"access private method"),n);var El=(e,t,n,r)=>({set _(s){ue(e,t,s,n)},get _(){return O(e,t,r)}});function zA(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var XF=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};
vendor: 13,652 bytes, lines 2-34
2function dl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rx={exports:{}},zd={},sx={exports:{}},be={};/** 3 * @license React 4 * react.production.min.js 5 * 6 * Copyright (c) Facebook, Inc. and its affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var ul=Symbol.for("react.element"),$A=Symbol.for("react.portal"),FA=Symbol.for("react.fragment"),BA=Symbol.for("react.strict_mode"),UA=Symbol.for("react.profiler"),VA=Symbol.for("react.provider"),HA=Symbol.for("react.context"),XA=Symbol.for("react.forward_ref"),qA=Symbol.for("react.suspense"),GA=Symbol.for("react.memo"),WA=Symbol.for("react.lazy"),Cg=Symbol.iterator;function KA(e){return e===null||typeof e!="object"?null:(e=Cg&&e[Cg]||e["@@iterator"],typeof e=="function"?e:null)}var ox={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ix=Object.assign,ax={};function xi(e,t,n){this.props=e,this.context=t,this.refs=ax,this.updater=n||ox}xi.prototype.isReactComponent={};xi.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")};xi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function lx(){}lx.prototype=xi.prototype;function Pm(e,t,n){this.props=e,this.context=t,this.refs=ax,this.updater=n||ox}var Rm=Pm.prototype=new lx;Rm.constructor=Pm;ix(Rm,xi.prototype);Rm.isPureReactComponent=!0;var _g=Array.isArray,cx=Object.prototype.hasOwnProperty,Om={current:null},dx={key:!0,ref:!0,__self:!0,__source:!0};function ux(e,t,n){var r,s={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)cx.call(t,r)&&!dx.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:ul,type:e,key:o,ref:a,props:s,_owner:Om.current}}function YA(e,t){return{$$typeof:ul,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Im(e){return typeof e=="object"&&e!==null&&e.$$typeof===ul}function QA(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var jg=/\/+/g;function Lu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?QA(""+e.key):t.toString(36)}function gc(e,t,n,r,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case ul:case $A:a=!0}}if(a)return a=e,s=s(a),e=r===""?"."+Lu(a,0):r,_g(s)?(n="",e!=null&&(n=e.replace(jg,"$&/")+"/"),gc(s,t,n,"",function(d){return d})):s!=null&&(Im(s)&&(s=YA(s,n+(!s.key||a&&a.key===s.key?"":(""+s.key).replace(jg,"$&/")+"/")+e)),t.push(s)),1;if(a=0,r=r===""?".":r+":",_g(e))for(var l=0;l<e.length;l++){o=e[l];var c=r+Lu(o,l);a+=gc(o,t,n,c,s)}else if(c=KA(e),typeof c=="function")for(e=c.call(e),l=0;!(o=e.next()).done;)o=o.value,c=r+Lu(o,l++),a+=gc(o,t,n,c,s);else if(o==="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 Nl(e,t,n){if(e==null)return e;var r=[],s=0;return gc(e,r,"","",function(o){return t.call(n,o,s++)}),r}function JA(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 Nt={current:null},vc={transition:null},ZA={ReactCurrentDispatcher:Nt,ReactCurrentBatchConfig:vc,ReactCurrentOwner:Om};function hx(){throw Error("act(...) is not supported in production builds of React.")}be.Children={map:Nl,forEach:function(e,t,n){Nl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Nl(e,function(){t++}),t},toArray:function(e){return Nl(e,function(t){return t})||[]},only:function(e){if(!Im(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};be.Component=xi;be.Fragment=FA;be.Profiler=UA;be.PureComponent=Pm;be.StrictMode=BA;be.Suspense=qA;be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZA;be.act=hx;be.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=ix({},e.props),s=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=Om.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)cx.call(t,c)&&!dx.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:ul,type:e.type,key:s,ref:o,props:r,_owner:a}};be.createContext=function(e){return e={$$typeof:HA,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:VA,_context:e},e.Consumer=e};be.createElement=ux;be.createFactory=function(e){var t=ux.bind(null,e);return t.type=e,t};be.createRef=function(){return{current:null}};be.forwardRef=function(e){return{$$typeof:XA,render:e}};be.isValidElement=Im;be.lazy=function(e){return{$$typeof:WA,_payload:{_status:-1,_result:e},_init:JA}};be.memo=function(e,t){return{$$typeof:GA,type:e,compare:t===void 0?null:t}};be.startTransition=function(e){var t=vc.transition;vc.transition={};try{e()}finally{vc.transition=t}};be.unstable_act=hx;be.useCallback=function(e,t){return Nt.current.useCallback(e,t)};be.useContext=function(e){return Nt.current.useContext(e)};be.useDebugValue=function(){};be.useDeferredValue=function(e){return Nt.current.useDeferredValue(e)};be.useEffect=function(e,t){return Nt.current.useEffect(e,t)};be.useId=function(){return Nt.current.useId()};be.useImperativeHandle=function(e,t,n){return Nt.current.useImperativeHandle(e,t,n)};be.useInsertionEffect=function(e,t){return Nt.current.useInsertionEffect(e,t)};be.useLayoutEffect=function(e,t){return Nt.current.useLayoutEffect(e,t)};be.useMemo=function(e,t){return Nt.current.useMemo(e,t)};be.useReducer=function(e,t,n){return Nt.current.useReducer(e,t,n)};be.useRef=function(e){return Nt.current.useRef(e)};be.useState=function(e){return Nt.current.useState(e)};be.useSyncExternalStore=function(e,t,n){return Nt.current.useSyncExternalStore(e,t,n)};be.useTransition=function(){return Nt.current.useTransition()};be.version="18.3.1";sx.exports=be;var f=sx.exports;const X=dl(f),Mm=zA({__proto__:null,default:X},[f]);/** 11 * @license React 12 * react-jsx-runtime.production.min.js 13 * 14 * Copyright (c) Facebook, Inc. and its affiliates. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE file in the root directory of this source tree. 18 */var e2=f,t2=Symbol.for("react.element"),n2=Symbol.for("react.fragment"),r2=Object.prototype.hasOwnProperty,s2=e2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o2={key:!0,ref:!0,__self:!0,__source:!0};function fx(e,t,n){var r,s={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)r2.call(t,r)&&!o2.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:t2,type:e,key:o,ref:a,props:s,_owner:s2.current}}zd.Fragment=n2;zd.jsx=fx;zd.jsxs=fx;rx.exports=zd;var i=rx.exports,mx={exports:{}},Ht={},px={exports:{}},gx={};/** 19 * @license React 20 * scheduler.production.min.js 21 * 22 * Copyright (c) Facebook, Inc. and its affiliates. 23 * 24 * This source code is licensed under the MIT license found in the 25 * LICENSE file in the root directory of this source tree. 26 */(function(e){function t(_,P){var z=_.length;_.push(P);e:for(;0<z;){var re=z-1>>>1,Y=_[re];if(0<s(Y,P))_[re]=P,_[z]=Y,z=re;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var P=_[0],z=_.pop();if(z!==P){_[0]=z;e:for(var re=0,Y=_.length,se=Y>>>1;re<se;){var ee=2*(re+1)-1,de=_[ee],xe=ee+1,q=_[xe];if(0>s(de,z))xe<Y&&0>s(q,de)?(_[re]=q,_[xe]=z,re=xe):(_[re]=de,_[ee]=z,re=ee);else if(xe<Y&&0>s(q,z))_[re]=q,_[xe]=z,re=xe;else break e}}return P}function s(_,P){var z=_.sortIndex-P.sortIndex;return z!==0?z:_.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],d=[],u=1,h=null,p=3,m=!1,x=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,v=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(_){for(var P=n(d);P!==null;){if(P.callback===null)r(d);else if(P.startTime<=_)r(d),P.sortIndex=P.expirationTime,t(c,P);else break;P=n(d)}}function k(_){if(g=!1,b(_),!x)if(n(c)!==null)x=!0,L(S);else{var P=n(d);P!==null&&B(k,P.startTime-_)}}function S(_,P){x=!1,g&&(g=!1,v(j),j=-1),m=!0;var z=p;try{for(b(P),h=n(c);h!==null&&(!(h.expirationTime>P)||_&&!F());){var re=h.callback;if(typeof re=="function"){h.callback=null,p=h.priorityLevel;var Y=re(h.expirationTime<=P);P=e.unstable_now(),typeof Y=="function"?h.callback=Y:h===n(c)&&r(c),b(P)}else r(c);h=n(c)}if(h!==null)var se=!0;else{var ee=n(d);ee!==null&&B(k,ee.startTime-P),se=!1}return se}finally{h=null,p=z,m=!1}}var T=!1,E=null,j=-1,N=5,R=-1;function F(){return!(e.unstable_now()-R<N)}function U(){if(E!==null){var _=e.unstable_now();R=_;var P=!0;try{P=E(!0,_)}finally{P?V():(T=!1,E=null)}}else T=!1}var V;if(typeof y=="function")V=function(){y(U)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,M=$.port2;$.port1.onmessage=U,V=function(){M.postMessage(null)}}else V=function(){w(U,0)};function L(_){E=_,T||(T=!0,V())}function B(_,P){j=w(function(){_(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(_){_.callback=null},e.unstable_continueExecution=function(){x||m||(x=!0,L(S))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(_){switch(p){case 1:case 2:case 3:var P=3;break;default:P=p}var z=p;p=P;try{return _()}finally{p=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,P){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var z=p;p=_;try{return P()}finally{p=z}},e.unstable_scheduleCallback=function(_,P,z){var re=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?re+z:re):z=re,_){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=z+Y,_={id:u++,callback:P,priorityLevel:_,startTime:z,expirationTime:Y,sortIndex:-1},z>re?(_.sortIndex=z,t(d,_),n(c)===null&&_===n(d)&&(g?(v(j),j=-1):g=!0,B(k,z-re))):(_.sortIndex=Y,t(c,_),x||m||(x=!0,L(S))),_},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(_){var P=p;return function(){var z=p;p=P;try{return _.apply(this,arguments)}finally{p=z}}}})(gx);px.exports=gx;var i2=px.exports;/** 27 * @license React 28 * react-dom.production.min.js 29 * 30 * Copyright (c) Facebook, Inc. and its affiliates. 31 * 32 * This source code is licensed under the MIT license found in the 33 * LICENSE file in the root directory of this source tree. 34 */var a2=f,Vt=i2;function H(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 vx=new Set,Aa={};function ro(e,t){ii(e,t),ii(e+"Capture",t)}function ii(e,t){for(Aa[e]=t,e=0;e<t.length;e++)vx.add(t[e])}var hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bh=Object.prototype.hasOwnProperty,l2=/^[: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]*$/,Pg={},Rg={};function c2(e){return Bh.call(Rg,e)?!0:Bh.call(Pg,e)?!1:l2.test(e)?Rg[e]=!0:(Pg[e]=!0,!1)}function d2(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 u2(e,t,n,r){if(t===null||typeof t>"u"||d2(e,t,n,r))return!0;
vendor: 5,200 bytes, lines 34-35
34if(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 Ct(e,t,n,r,s,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var pt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){pt[e]=new Ct(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];pt[t]=new Ct(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){pt[e]=new Ct(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){pt[e]=new Ct(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){pt[e]=new Ct(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){pt[e]=new Ct(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){pt[e]=new Ct(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){pt[e]=new Ct(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){pt[e]=new Ct(e,5,!1,e.toLowerCase(),null,!1,!1)});var Lm=/[\-:]([a-z])/g;function Dm(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(Lm,Dm);pt[t]=new Ct(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(Lm,Dm);pt[t]=new Ct(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(Lm,Dm);pt[t]=new Ct(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){pt[e]=new Ct(e,1,!1,e.toLowerCase(),null,!1,!1)});pt.xlinkHref=new Ct("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){pt[e]=new Ct(e,1,!1,e.toLowerCase(),null,!0,!0)});function zm(e,t,n,r){var s=pt.hasOwnProperty(t)?pt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(u2(t,n,s,r)&&(n=null),r||s===null?c2(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var yr=a2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Cl=Symbol.for("react.element"),So=Symbol.for("react.portal"),To=Symbol.for("react.fragment"),$m=Symbol.for("react.strict_mode"),Uh=Symbol.for("react.profiler"),yx=Symbol.for("react.provider"),xx=Symbol.for("react.context"),Fm=Symbol.for("react.forward_ref"),Vh=Symbol.for("react.suspense"),Hh=Symbol.for("react.suspense_list"),Bm=Symbol.for("react.memo"),Or=Symbol.for("react.lazy"),bx=Symbol.for("react.offscreen"),Og=Symbol.iterator;function Li(e){return e===null||typeof e!="object"?null:(e=Og&&e[Og]||e["@@iterator"],typeof e=="function"?e:null)}var Fe=Object.assign,Du;function Qi(e){if(Du===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Du=t&&t[1]||""}return` 35`+Du+e}var zu=!1;function $u(e,t){if(!e||zu)return"";zu=!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()}}
vendor: 15,597 bytes, lines 35-38
35catch(d){if(d&&r&&typeof d.stack=="string"){for(var s=d.stack.split(` 36`),o=r.stack.split(` 37`),a=s.length-1,l=o.length-1;1<=a&&0<=l&&s[a]!==o[l];)l--;for(;1<=a&&0<=l;a--,l--)if(s[a]!==o[l]){if(a!==1||l!==1)do if(a--,l--,0>l||s[a]!==o[l]){var c=` 38`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{zu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qi(e):""}function h2(e){switch(e.tag){case 5:return Qi(e.type);case 16:return Qi("Lazy");case 13:return Qi("Suspense");case 19:return Qi("SuspenseList");case 0:case 2:case 15:return e=$u(e.type,!1),e;case 11:return e=$u(e.type.render,!1),e;case 1:return e=$u(e.type,!0),e;default:return""}}function Xh(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 To:return"Fragment";case So:return"Portal";case Uh:return"Profiler";case $m:return"StrictMode";case Vh:return"Suspense";case Hh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case xx:return(e.displayName||"Context")+".Consumer";case yx:return(e._context.displayName||"Context")+".Provider";case Fm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Bm:return t=e.displayName||null,t!==null?t:Xh(e.type)||"Memo";case Or:t=e._payload,e=e._init;try{return Xh(e(t))}catch{}}return null}function f2(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 Xh(t);case 8:return t===$m?"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 us(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function m2(e){var t=wx(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,o.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 _l(e){e._valueTracker||(e._valueTracker=m2(e))}function kx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=wx(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function $c(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 qh(e,t){var n=t.checked;return Fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ig(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=us(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 Sx(e,t){t=t.checked,t!=null&&zm(e,"checked",t,!1)}function Gh(e,t){Sx(e,t);var n=us(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")?Wh(e,t.type,n):t.hasOwnProperty("defaultValue")&&Wh(e,t.type,us(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Mg(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 Wh(e,t,n){(t!=="number"||$c(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ji=Array.isArray;function Do(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+us(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Kh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return Fe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Lg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(Ji(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:us(n)}}function Tx(e,t){var n=us(t.value),r=us(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 Dg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ax(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 Yh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ax(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var jl,Ex=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(jl=jl||document.createElement("div"),jl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=jl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ea(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ca={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},p2=["Webkit","ms","Moz","O"];Object.keys(ca).forEach(function(e){p2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ca[t]=ca[e]})});function Nx(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ca.hasOwnProperty(e)&&ca[e]?(""+t).trim():t+"px"}function Cx(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Nx(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var g2=Fe({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 Qh(e,t){if(t){if(g2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Jh(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 Zh=null;function Um(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ef=null,zo=null,$o=null;function zg(e){if(e=ml(e)){if(typeof ef!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Vd(t),ef(e.stateNode,e.type,t))}}function _x(e){zo?$o?$o.push(e):$o=[e]:zo=e}function jx(){if(zo){var e=zo,t=$o;if($o=zo=null,zg(e),t)for(e=0;e<t.length;e++)zg(t[e])}}function Px(e,t){return e(t)}function Rx(){}var Fu=!1;function Ox(e,t,n){if(Fu)return e(t,n);Fu=!0;try{return Px(e,t,n)}finally{Fu=!1,(zo!==null||$o!==null)&&(Rx(),jx())}}function Na(e,t){var n=e.stateNode;if(n===null)return null;var r=Vd(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(H(231,t,typeof n));return n}var tf=!1;if(hr)try{var Di={};Object.defineProperty(Di,"passive",{get:function(){tf=!0}}),window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{tf=!1}function v2(e,t,n,r,s,o,a,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(u){this.onError(u)}}var da=!1,Fc=null,Bc=!1,nf=null,y2={onError:function(e){da=!0,Fc=e}};function x2(e,t,n,r,s,o,a,l,c){da=!1,Fc=null,v2.apply(y2,arguments)}function b2(e,t,n,r,s,o,a,l,c){if(x2.apply(this,arguments),da){if(da){var d=Fc;da=!1,Fc=null}else throw Error(H(198));Bc||(Bc=!0,nf=d)}}function so(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 Ix(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 $g(e){if(so(e)!==e)throw Error(H(188))}function w2(e){var t=e.alternate;if(!t){if(t=so(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return $g(s),e;if(o===r)return $g(s),t;o=o.sibling}throw Error(H(188))}if(n.return!==r.return)n=s,r=o;else{for(var a=!1,l=s.child;l;){if(l===n){a=!0,n=s,r=o;break}if(l===r){a=!0,r=s,n=o;break}l=l.sibling}if(!a){for(l=o.child;l;){if(l===n){a=!0,n=o,r=s;break}if(l===r){a=!0,r=o,n=s;break}l=l.sibling}if(!a)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function Mx(e){return e=w2(e),e!==null?Lx(e):null}function Lx(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Lx(e);if(t!==null)return t;e=e.sibling}return null}var Dx=Vt.unstable_scheduleCallback,Fg=Vt.unstable_cancelCallback,k2=Vt.unstable_shouldYield,S2=Vt.unstable_requestPaint,Xe=Vt.unstable_now,T2=Vt.unstable_getCurrentPriorityLevel,Vm=Vt.unstable_ImmediatePriority,zx=Vt.unstable_UserBlockingPriority,Uc=Vt.unstable_NormalPriority,A2=Vt.unstable_LowPriority,$x=Vt.unstable_IdlePriority,$d=null,Hn=null;function E2(e){if(Hn&&typeof Hn.onCommitFiberRoot=="function")try{Hn.onCommitFiberRoot($d,e,void 0,(e.current.flags&128)===128)}catch{}}var Nn=Math.clz32?Math.clz32:_2,N2=Math.log,C2=Math.LN2;function _2(e){return e>>>=0,e===0?32:31-(N2(e)/C2|0)|0}var Pl=64,Rl=4194304;function Zi(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 Vc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~s;l!==0?r=Zi(l):(o&=a,o!==0&&(r=Zi(o)))}else a=n&~s,a!==0?r=Zi(a):o!==0&&(r=Zi(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Nn(t),s=1<<n,r|=e[n],t&=~s;return r}function j2(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 P2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-Nn(o),l=1<<a,c=s[a];c===-1?(!(l&n)||l&r)&&(s[a]=j2(l,t)):c<=t&&(e.expiredLanes|=l),o&=~l}}function rf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Fx(){var e=Pl;return Pl<<=1,!(Pl&4194240)&&(Pl=64),e}function Bu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function hl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nn(t),e[t]=n}function R2(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Nn(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function Hm(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Nn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var Te=0;function Bx(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ux,Xm,Vx,Hx,Xx,sf=!1,Ol=[],Qr=null,Jr=null,Zr=null,Ca=new Map,_a=new Map,Mr=[],O2="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 Bg(e,t){switch(e){case"focusin":case"focusout":Qr=null;break;case"dragenter":case"dragleave":Jr=null;break;case"mouseover":case"mouseout":Zr=null;break;case"pointerover":case"pointerout":Ca.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_a.delete(t.pointerId)}}function zi(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=ml(t),t!==null&&Xm(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}
vendor: 6,953 bytes, line 38
38function I2(e,t,n,r,s){switch(t){case"focusin":return Qr=zi(Qr,e,t,n,r,s),!0;case"dragenter":return Jr=zi(Jr,e,t,n,r,s),!0;case"mouseover":return Zr=zi(Zr,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return Ca.set(o,zi(Ca.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,_a.set(o,zi(_a.get(o)||null,e,t,n,r,s)),!0}return!1}function qx(e){var t=Os(e.target);if(t!==null){var n=so(t);if(n!==null){if(t=n.tag,t===13){if(t=Ix(n),t!==null){e.blockedOn=t,Xx(e.priority,function(){Vx(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 yc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=of(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zh=r,n.target.dispatchEvent(r),Zh=null}else return t=ml(n),t!==null&&Xm(t),e.blockedOn=n,!1;t.shift()}return!0}function Ug(e,t,n){yc(e)&&n.delete(t)}function M2(){sf=!1,Qr!==null&&yc(Qr)&&(Qr=null),Jr!==null&&yc(Jr)&&(Jr=null),Zr!==null&&yc(Zr)&&(Zr=null),Ca.forEach(Ug),_a.forEach(Ug)}function $i(e,t){e.blockedOn===t&&(e.blockedOn=null,sf||(sf=!0,Vt.unstable_scheduleCallback(Vt.unstable_NormalPriority,M2)))}function ja(e){function t(s){return $i(s,e)}if(0<Ol.length){$i(Ol[0],e);for(var n=1;n<Ol.length;n++){var r=Ol[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Qr!==null&&$i(Qr,e),Jr!==null&&$i(Jr,e),Zr!==null&&$i(Zr,e),Ca.forEach(t),_a.forEach(t),n=0;n<Mr.length;n++)r=Mr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Mr.length&&(n=Mr[0],n.blockedOn===null);)qx(n),n.blockedOn===null&&Mr.shift()}var Fo=yr.ReactCurrentBatchConfig,Hc=!0;function L2(e,t,n,r){var s=Te,o=Fo.transition;Fo.transition=null;try{Te=1,qm(e,t,n,r)}finally{Te=s,Fo.transition=o}}function D2(e,t,n,r){var s=Te,o=Fo.transition;Fo.transition=null;try{Te=4,qm(e,t,n,r)}finally{Te=s,Fo.transition=o}}function qm(e,t,n,r){if(Hc){var s=of(e,t,n,r);if(s===null)Qu(e,t,r,Xc,n),Bg(e,r);else if(I2(s,e,t,n,r))r.stopPropagation();else if(Bg(e,r),t&4&&-1<O2.indexOf(e)){for(;s!==null;){var o=ml(s);if(o!==null&&Ux(o),o=of(e,t,n,r),o===null&&Qu(e,t,r,Xc,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else Qu(e,t,r,null,n)}}var Xc=null;function of(e,t,n,r){if(Xc=null,e=Um(r),e=Os(e),e!==null)if(t=so(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ix(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 Xc=e,null}function Gx(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(T2()){case Vm:return 1;case zx:return 4;case Uc:case A2:return 16;case $x:return 536870912;default:return 16}default:return 16}}var qr=null,Gm=null,xc=null;function Wx(){if(xc)return xc;var e,t=Gm,n=t.length,r,s="value"in qr?qr.value:qr.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===s[o-r];r++);return xc=s.slice(e,1<r?1-r:void 0)}function bc(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 Il(){return!0}function Vg(){return!1}function Xt(e){function t(n,r,s,o,a){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Il:Vg,this.isPropagationStopped=Vg,this}return Fe(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=Il)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Il)},persist:function(){},isPersistent:Il}),t}var bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wm=Xt(bi),fl=Fe({},bi,{view:0,detail:0}),z2=Xt(fl),Uu,Vu,Fi,Fd=Fe({},fl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Km,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!==Fi&&(Fi&&e.type==="mousemove"?(Uu=e.screenX-Fi.screenX,Vu=e.screenY-Fi.screenY):Vu=Uu=0,Fi=e),Uu)},movementY:function(e){return"movementY"in e?e.movementY:Vu}}),Hg=Xt(Fd),$2=Fe({},Fd,{dataTransfer:0}),F2=Xt($2),B2=Fe({},fl,{relatedTarget:0}),Hu=Xt(B2),U2=Fe({},bi,{animationName:0,elapsedTime:0,pseudoElement:0}),V2=Xt(U2),H2=Fe({},bi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),X2=Xt(H2),q2=Fe({},bi,{data:0}),Xg=Xt(q2),G2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},W2={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"},K2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=K2[e])?!!t[e]:!1}function Km(){return Y2}var Q2=Fe({},fl,{key:function(e){if(e.key){var t=G2[e.key]||e.key;if(t!=="Unidentified")return t}
vendor: 6,028 bytes, line 38
38return e.type==="keypress"?(e=bc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?W2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Km,charCode:function(e){return e.type==="keypress"?bc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),J2=Xt(Q2),Z2=Fe({},Fd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qg=Xt(Z2),eE=Fe({},fl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Km}),tE=Xt(eE),nE=Fe({},bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),rE=Xt(nE),sE=Fe({},Fd,{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}),oE=Xt(sE),iE=[9,13,27,32],Ym=hr&&"CompositionEvent"in window,ua=null;hr&&"documentMode"in document&&(ua=document.documentMode);var aE=hr&&"TextEvent"in window&&!ua,Kx=hr&&(!Ym||ua&&8<ua&&11>=ua),Gg=" ",Wg=!1;function Yx(e,t){switch(e){case"keyup":return iE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ao=!1;function lE(e,t){switch(e){case"compositionend":return Qx(t);case"keypress":return t.which!==32?null:(Wg=!0,Gg);case"textInput":return e=t.data,e===Gg&&Wg?null:e;default:return null}}function cE(e,t){if(Ao)return e==="compositionend"||!Ym&&Yx(e,t)?(e=Wx(),xc=Gm=qr=null,Ao=!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 Kx&&t.locale!=="ko"?null:t.data;default:return null}}var dE={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 Kg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dE[e.type]:t==="textarea"}function Jx(e,t,n,r){_x(r),t=qc(t,"onChange"),0<t.length&&(n=new Wm("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ha=null,Pa=null;function uE(e){cb(e,0)}function Bd(e){var t=Co(e);if(kx(t))return e}function hE(e,t){if(e==="change")return t}var Zx=!1;if(hr){var Xu;if(hr){var qu="oninput"in document;if(!qu){var Yg=document.createElement("div");Yg.setAttribute("oninput","return;"),qu=typeof Yg.oninput=="function"}Xu=qu}else Xu=!1;Zx=Xu&&(!document.documentMode||9<document.documentMode)}function Qg(){ha&&(ha.detachEvent("onpropertychange",eb),Pa=ha=null)}function eb(e){if(e.propertyName==="value"&&Bd(Pa)){var t=[];Jx(t,Pa,e,Um(e)),Ox(uE,t)}}function fE(e,t,n){e==="focusin"?(Qg(),ha=t,Pa=n,ha.attachEvent("onpropertychange",eb)):e==="focusout"&&Qg()}function mE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bd(Pa)}function pE(e,t){if(e==="click")return Bd(t)}function gE(e,t){if(e==="input"||e==="change")return Bd(t)}function vE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _n=typeof Object.is=="function"?Object.is:vE;function Ra(e,t){if(_n(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Bh.call(t,s)||!_n(e[s],t[s]))return!1}return!0}function Jg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zg(e,t){var n=Jg(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=Jg(n)}}function tb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nb(){for(var e=window,t=$c();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=$c(e.document)}return t}function Qm(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 yE(e){var t=nb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&tb(n.ownerDocument.documentElement,n)){if(r!==null&&Qm(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=Zg(n,o);var a=Zg(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>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 xE=hr&&"documentMode"in document&&11>=document.documentMode,Eo=null,af=null,fa=null,lf=!1;function ev(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;lf||Eo==null||Eo!==$c(r)||(r=Eo,"selectionStart"in r&&Qm(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,352 bytes, line 38
38sNode:r.focusNode,focusOffset:r.focusOffset}),fa&&Ra(fa,r)||(fa=r,r=qc(af,"onSelect"),0<r.length&&(t=new Wm("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Eo)))}function Ml(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var No={animationend:Ml("Animation","AnimationEnd"),animationiteration:Ml("Animation","AnimationIteration"),animationstart:Ml("Animation","AnimationStart"),transitionend:Ml("Transition","TransitionEnd")},Gu={},rb={};hr&&(rb=document.createElement("div").style,"AnimationEvent"in window||(delete No.animationend.animation,delete No.animationiteration.animation,delete No.animationstart.animation),"TransitionEvent"in window||delete No.transitionend.transition);function Ud(e){if(Gu[e])return Gu[e];if(!No[e])return e;var t=No[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in rb)return Gu[e]=t[n];return e}var sb=Ud("animationend"),ob=Ud("animationiteration"),ib=Ud("animationstart"),ab=Ud("transitionend"),lb=new Map,tv="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 vs(e,t){lb.set(e,t),ro(t,[e])}for(var Wu=0;Wu<tv.length;Wu++){var Ku=tv[Wu],bE=Ku.toLowerCase(),wE=Ku[0].toUpperCase()+Ku.slice(1);vs(bE,"on"+wE)}vs(sb,"onAnimationEnd");vs(ob,"onAnimationIteration");vs(ib,"onAnimationStart");vs("dblclick","onDoubleClick");vs("focusin","onFocus");vs("focusout","onBlur");vs(ab,"onTransitionEnd");ii("onMouseEnter",["mouseout","mouseover"]);ii("onMouseLeave",["mouseout","mouseover"]);ii("onPointerEnter",["pointerout","pointerover"]);ii("onPointerLeave",["pointerout","pointerover"]);ro("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ro("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ro("onBeforeInput",["compositionend","keypress","textInput","paste"]);ro("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ro("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ro("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ea="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(" "),kE=new Set("cancel close invalid load scroll toggle".split(" ").concat(ea));function nv(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,b2(r,t,void 0,e),e.currentTarget=null}function cb(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=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!==o&&s.isPropagationStopped())break e;nv(s,l,d),o=c}else for(a=0;a<r.length;a++){if(l=r[a],c=l.instance,d=l.currentTarget,l=l.listener,c!==o&&s.isPropagationStopped())break e;nv(s,l,d),o=c}}}if(Bc)throw e=nf,Bc=!1,nf=null,e}function Pe(e,t){var n=t[ff];n===void 0&&(n=t[ff]=new Set);var r=e+"__bubble";n.has(r)||(db(t,e,2,!1),n.add(r))}function Yu(e,t,n){var r=0;t&&(r|=4),db(n,e,r,t)}var Ll="_reactListening"+Math.random().toString(36).slice(2);function Oa(e){if(!e[Ll]){e[Ll]=!0,vx.forEach(function(n){n!=="selectionchange"&&(kE.has(n)||Yu(n,!1,e),Yu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ll]||(t[Ll]=!0,Yu("selectionchange",!1,t))}}function db(e,t,n,r){switch(Gx(t)){case 1:var s=L2;break;case 4:s=D2;break;default:s=qm}n=s.bind(null,t,n,e),s=void 0,!tf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}
vendor: 2,676 bytes, line 38
38function Qu(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;a=a.return}for(;l!==null;){if(a=Os(l),a===null)return;if(c=a.tag,c===5||c===6){r=o=a;continue e}l=l.parentNode}}r=r.return}Ox(function(){var d=o,u=Um(n),h=[];e:{var p=lb.get(e);if(p!==void 0){var m=Wm,x=e;switch(e){case"keypress":if(bc(n)===0)break e;case"keydown":case"keyup":m=J2;break;case"focusin":x="focus",m=Hu;break;case"focusout":x="blur",m=Hu;break;case"beforeblur":case"afterblur":m=Hu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Hg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=F2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=tE;break;case sb:case ob:case ib:m=V2;break;case ab:m=rE;break;case"scroll":m=z2;break;case"wheel":m=oE;break;case"copy":case"cut":case"paste":m=X2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=qg}var g=(t&4)!==0,w=!g&&e==="scroll",v=g?p!==null?p+"Capture":null:p;g=[];for(var y=d,b;y!==null;){b=y;var k=b.stateNode;if(b.tag===5&&k!==null&&(b=k,v!==null&&(k=Na(y,v),k!=null&&g.push(Ia(y,k,b)))),w)break;y=y.return}0<g.length&&(p=new m(p,x,null,n,u),h.push({event:p,listeners:g}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&n!==Zh&&(x=n.relatedTarget||n.fromElement)&&(Os(x)||x[fr]))break e;if((m||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,m?(x=n.relatedTarget||n.toElement,m=d,x=x?Os(x):null,x!==null&&(w=so(x),x!==w||x.tag!==5&&x.tag!==6)&&(x=null)):(m=null,x=d),m!==x)){if(g=Hg,k="onMouseLeave",v="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=qg,k="onPointerLeave",v="onPointerEnter",y="pointer"),w=m==null?p:Co(m),b=x==null?p:Co(x),p=new g(k,y+"leave",m,n,u),p.target=w,p.relatedTarget=b,k=null,Os(u)===d&&(g=new g(v,y+"enter",x,n,u),g.target=b,g.relatedTarget=w,k=g),w=k,m&&x)t:{for(g=m,v=x,y=0,b=g;b;b=uo(b))y++;for(b=0,k=v;k;k=uo(k))b++;for(;0<y-b;)g=uo(g),y--;for(;0<b-y;)v=uo(v),b--;for(;y--;){if(g===v||v!==null&&g===v.alternate)break t;g=uo(g),v=uo(v)}g=null}else g=null;m!==null&&rv(h,p,m,g,!1),x!==null&&w!==null&&rv(h,w,x,g,!0)}}
vendor: 4,435 bytes, lines 38-39
38e:{if(p=d?Co(d):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var S=hE;else if(Kg(p))if(Zx)S=gE;else{S=mE;var T=fE}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=pE);if(S&&(S=S(e,d))){Jx(h,S,n,u);break e}T&&T(e,p,d),e==="focusout"&&(T=p._wrapperState)&&T.controlled&&p.type==="number"&&Wh(p,"number",p.value)}switch(T=d?Co(d):window,e){case"focusin":(Kg(T)||T.contentEditable==="true")&&(Eo=T,af=d,fa=null);break;case"focusout":fa=af=Eo=null;break;case"mousedown":lf=!0;break;case"contextmenu":case"mouseup":case"dragend":lf=!1,ev(h,n,u);break;case"selectionchange":if(xE)break;case"keydown":case"keyup":ev(h,n,u)}var E;if(Ym)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else Ao?Yx(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(Kx&&n.locale!=="ko"&&(Ao||j!=="onCompositionStart"?j==="onCompositionEnd"&&Ao&&(E=Wx()):(qr=u,Gm="value"in qr?qr.value:qr.textContent,Ao=!0)),T=qc(d,j),0<T.length&&(j=new Xg(j,e,null,n,u),h.push({event:j,listeners:T}),E?j.data=E:(E=Qx(n),E!==null&&(j.data=E)))),(E=aE?lE(e,n):cE(e,n))&&(d=qc(d,"onBeforeInput"),0<d.length&&(u=new Xg("onBeforeInput","beforeinput",null,n,u),h.push({event:u,listeners:d}),u.data=E))}cb(h,t)})}function Ia(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qc(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Na(e,n),o!=null&&r.unshift(Ia(e,o,s)),o=Na(e,t),o!=null&&r.push(Ia(e,o,s))),e=e.return}return r}function uo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function rv(e,t,n,r,s){for(var o=t._reactName,a=[];n!==null&&n!==r;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&d!==null&&(l=d,s?(c=Na(n,o),c!=null&&a.unshift(Ia(n,c,l))):s||(c=Na(n,o),c!=null&&a.push(Ia(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var SE=/\r\n?/g,TE=/\u0000|\uFFFD/g;function sv(e){return(typeof e=="string"?e:""+e).replace(SE,` 39`).replace(TE,"")}function Dl(e,t,n){if(t=sv(t),sv(e)!==t&&n)throw Error(H(425))}function Gc(){}var cf=null,df=null;function uf(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 hf=typeof setTimeout=="function"?setTimeout:void 0,AE=typeof clearTimeout=="function"?clearTimeout:void 0,ov=typeof Promise=="function"?Promise:void 0,EE=typeof queueMicrotask=="function"?queueMicrotask:typeof ov<"u"?function(e){return ov.resolve(null).then(e).catch(NE)}:hf;function NE(e){setTimeout(function(){throw e})}function Ju(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),ja(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);ja(t)}function es(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 iv(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 wi=Math.random().toString(36).slice(2),Un="__reactFiber$"+wi,Ma="__reactProps$"+wi,fr="__reactContainer$"+wi,ff="__reactEvents$"+wi,CE="__reactListeners$"+wi,_E="__reactHandles$"+wi;function Os(e){var t=e[Un];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fr]||n[Un]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=iv(e);e!==null;){if(n=e[Un])return n;e=iv(e)}return t}e=n,n=e.parentNode}return null}function ml(e){return e=e[Un]||e[fr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Co(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function Vd(e){return e[Ma]||null}var mf=[],_o=-1;function ys(e){return{current:e}}function Re(e){0>_o||(e.current=mf[_o],mf[_o]=null,_o--)}function _e(e,t){_o++,mf[_o]=e.current,e.current=t}var hs={},kt=ys(hs),Ot=ys(!1),Ws=hs;function ai(e,t){var n=e.type.contextTypes;if(!n)return hs;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;
vendor: 16,993 bytes, line 39
39for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function It(e){return e=e.childContextTypes,e!=null}function Wc(){Re(Ot),Re(kt)}function av(e,t,n){if(kt.current!==hs)throw Error(H(168));_e(kt,t),_e(Ot,n)}function ub(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(H(108,f2(e)||"Unknown",s));return Fe({},n,r)}function Kc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||hs,Ws=kt.current,_e(kt,e),_e(Ot,Ot.current),!0}function lv(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=ub(e,t,Ws),r.__reactInternalMemoizedMergedChildContext=e,Re(Ot),Re(kt),_e(kt,e)):Re(Ot),_e(Ot,n)}var or=null,Hd=!1,Zu=!1;function hb(e){or===null?or=[e]:or.push(e)}function jE(e){Hd=!0,hb(e)}function xs(){if(!Zu&&or!==null){Zu=!0;var e=0,t=Te;try{var n=or;for(Te=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}or=null,Hd=!1}catch(s){throw or!==null&&(or=or.slice(e+1)),Dx(Vm,xs),s}finally{Te=t,Zu=!1}}return null}var jo=[],Po=0,Yc=null,Qc=0,Zt=[],en=0,Ks=null,lr=1,cr="";function _s(e,t){jo[Po++]=Qc,jo[Po++]=Yc,Yc=e,Qc=t}function fb(e,t,n){Zt[en++]=lr,Zt[en++]=cr,Zt[en++]=Ks,Ks=e;var r=lr;e=cr;var s=32-Nn(r)-1;r&=~(1<<s),n+=1;var o=32-Nn(t)+s;if(30<o){var a=s-s%5;o=(r&(1<<a)-1).toString(32),r>>=a,s-=a,lr=1<<32-Nn(t)+s|n<<s|r,cr=o+e}else lr=1<<o|n<<s|r,cr=e}function Jm(e){e.return!==null&&(_s(e,1),fb(e,1,0))}function Zm(e){for(;e===Yc;)Yc=jo[--Po],jo[Po]=null,Qc=jo[--Po],jo[Po]=null;for(;e===Ks;)Ks=Zt[--en],Zt[en]=null,cr=Zt[--en],Zt[en]=null,lr=Zt[--en],Zt[en]=null}var Bt=null,Ft=null,Me=!1,Tn=null;function mb(e,t){var n=tn(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 cv(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,Bt=e,Ft=es(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Bt=e,Ft=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ks!==null?{id:lr,overflow:cr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=tn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Bt=e,Ft=null,!0):!1;default:return!1}}function pf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function gf(e){if(Me){var t=Ft;if(t){var n=t;if(!cv(e,t)){if(pf(e))throw Error(H(418));t=es(n.nextSibling);var r=Bt;t&&cv(e,t)?mb(r,n):(e.flags=e.flags&-4097|2,Me=!1,Bt=e)}}else{if(pf(e))throw Error(H(418));e.flags=e.flags&-4097|2,Me=!1,Bt=e}}}function dv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Bt=e}function zl(e){if(e!==Bt)return!1;if(!Me)return dv(e),Me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!uf(e.type,e.memoizedProps)),t&&(t=Ft)){if(pf(e))throw pb(),Error(H(418));for(;t;)mb(e,t),t=es(t.nextSibling)}if(dv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ft=es(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ft=null}}else Ft=Bt?es(e.stateNode.nextSibling):null;return!0}function pb(){for(var e=Ft;e;)e=es(e.nextSibling)}function li(){Ft=Bt=null,Me=!1}function ep(e){Tn===null?Tn=[e]:Tn.push(e)}var PE=yr.ReactCurrentBatchConfig;function Bi(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(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var l=s.refs;a===null?delete l[o]:l[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function $l(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function uv(e){var t=e._init;return t(e._payload)}function gb(e){function t(v,y){if(e){var b=v.deletions;b===null?(v.deletions=[y],v.flags|=16):b.push(y)}}function n(v,y){if(!e)return null;for(;y!==null;)t(v,y),y=y.sibling;return null}function r(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function s(v,y){return v=ss(v,y),v.index=0,v.sibling=null,v}function o(v,y,b){return v.index=b,e?(b=v.alternate,b!==null?(b=b.index,b<y?(v.flags|=2,y):b):(v.flags|=2,y)):(v.flags|=1048576,y)}function a(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,y,b,k){return y===null||y.tag!==6?(y=ih(b,v.mode,k),y.return=v,y):(y=s(y,b),y.return=v,y)}function c(v,y,b,k){var S=b.type;return S===To?u(v,y,b.props.children,k,b.key):y!==null&&(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Or&&uv(S)===y.type)?(k=s(y,b.props),k.ref=Bi(v,y,b),k.return=v,k):(k=Nc(b.type,b.key,b.props,null,v.mode,k),k.ref=Bi(v,y,b),k.return=v,k)}function d(v,y,b,k){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=ah(b,v.mode,k),y.return=v,y):(y=s(y,b.children||[]),y.return=v,y)}function u(v,y,b,k,S){return y===null||y.tag!==7?(y=Xs(b,v.mode,k,S),y.return=v,y):(y=s(y,b),y.return=v,y)}function h(v,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=ih(""+y,v.mode,b),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Cl:return b=Nc(y.type,y.key,y.props,null,v.mode,b),b.ref=Bi(v,null,y),b.return=v,b;case So:return y=ah(y,v.mode,b),y.return=v,y;case Or:var k=y._init;return h(v,k(y._payload),b)}if(Ji(y)||Li(y))return y=Xs(y,v.mode,b,null),y.return=v,y;$l(v,y)}return null}function p(v,y,b,k){var S=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return S!==null?null:l(v,y,""+b,k);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Cl:return b.key===S?c(v,y,b,k):null;case So:return b.key===S?d(v,y,b,k):null;case Or:return S=b._init,p(v,y,S(b._payload),k)}if(Ji(b)||Li(b))return S!==null?null:u(v,y,b,k,null);$l(v,b)}return null}function m(v,y,b,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return v=v.get(b)||null,l(y,v,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Cl:return v=v.get(k.key===null?b:k.key)||null,c(y,v,k,S);case So:return v=v.get(k.key===null?b:k.key)||null,d(y,v,k,S);case Or:var T=k._init;return m(v,y,b,T(k._payload),S)}if(Ji(k)||Li(k))return v=v.get(b)||null,u(y,v,k,S,null);$l(y,k)}return null}function x(v,y,b,k){for(var S=null,T=null,E=y,j=y=0,N=null;E!==null&&j<b.length;j++){E.index>j?(N=E,E=null):N=E.sibling;var R=p(v,E,b[j],k);if(R===null){E===null&&(E=N);break}e&&E&&R.alternate===null&&t(v,E),y=o(R,y,j),T===null?S=R:T.sibling=R,T=R,E=N}if(j===b.length)return n(v,E),Me&&_s(v,j),S;if(E===null){for(;j<b.length;j++)E=h(v,b[j],k),E!==null&&(y=o(E,y,j),T===null?S=E:T.sibling=E,T=E);return Me&&_s(v,j),S}for(E=r(v,E);j<b.length;j++)N=m(E,v,j,b[j],k),N!==null&&(e&&N.alternate!==null&&E.delete(N.key===null?j:N.key),y=o(N,y,j),T===null?S=N:T.sibling=N,T=N);return e&&E.forEach(function(F){return t(v,F)}),Me&&_s(v,j),S}function g(v,y,b,k){var S=Li(b);if(typeof S!="function")throw Error(H(150));if(b=S.call(b),b==null)throw Error(H(151));for(var T=S=null,E=y,j=y=0,N=null,R=b.next();E!==null&&!R.done;j++,R=b.next()){E.index>j?(N=E,E=null):N=E.sibling;var F=p(v,E,R.value,k);if(F===null){E===null&&(E=N);break}e&&E&&F.alternate===null&&t(v,E),y=o(F,y,j),T===null?S=F:T.sibling=F,T=F,E=N}if(R.done)return n(v,E),Me&&_s(v,j),S;if(E===null){for(;!R.done;j++,R=b.next())R=h(v,R.value,k),R!==null&&(y=o(R,y,j),T===null?S=R:T.sibling=R,T=R);return Me&&_s(v,j),S}for(E=r(v,E);!R.done;j++,R=b.next())R=m(E,v,j,R.value,k),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?j:R.key),y=o(R,y,j),T===null?S=R:T.sibling=R,T=R);return e&&E.forEach(function(U){return t(v,U)}),Me&&_s(v,j),S}function w(v,y,b,k){if(typeof b=="object"&&b!==null&&b.type===To&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Cl:e:{for(var S=b.key,T=y;T!==null;){if(T.key===S){if(S=b.type,S===To){if(T.tag===7){n(v,T.sibling),y=s(T,b.props.children),y.return=v,v=y;break e}}else if(T.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Or&&uv(S)===T.type){n(v,T.sibling),y=s(T,b.props),y.ref=Bi(v,T,b),y.return=v,v=y;break e}n(v,T);break}else t(v,T);T=T.sibling}b.type===To?(y=Xs(b.props.children,v.mode,k,b.key),y.return=v,v=y):(k=Nc(b.type,b.key,b.props,null,v.mode,k),k.ref=Bi(v,y,b),k.return=v,v=k)}return a(v);case So:e:{for(T=b.key;y!==null;){if(y.key===T)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){n(v,y.sibling),y=s(y,b.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else t(v,y);y=y.sibling}y=ah(b,v.mode,k),y.return=v,v=y}return a(v);case Or:return T=b._init,w(v,y,T(b._payload),k)}if(Ji(b))return x(v,y,b,k);if(Li(b))return g(v,y,b,k);$l(v,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(n(v,y.sibling),y=s(y,b),y.return=v,v=y):(n(v,y),y=ih(b,v.mode,k),y.return=v,v=y),a(v)):n(v,y)}return w}var ci=gb(!0),vb=gb(!1),Jc=ys(null),Zc=null,Ro=null,tp=null;function np(){tp=Ro=Zc=null}function rp(e){var t=Jc.current;Re(Jc),e._currentValue=t}function vf(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 Bo(e,t){Zc=e,tp=Ro=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Rt=!0),e.firstContext=null)}function on(e){var t=e._currentValue;if(tp!==e)if(e={context:e,memoizedValue:t,next:null},Ro===null){if(Zc===null)throw Error(H(308));Ro=e,Zc.dependencies={lanes:0,firstContext:e}}else Ro=Ro.next=e;return t}var Is=null;function sp(e){Is===null?Is=[e]:Is.push(e)}function yb(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,sp(t)):(n.next=s.next,s.next=n),t.interleaved=n,mr(e,r)}function mr(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 op(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xb(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 dr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ts(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Se&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,mr(e,n)}return s=r.interleaved,s===null?(t.next=t,sp(r)):(t.next=s.next,s.next=t),r.interleaved=t,mr(e,n)}function wc(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,Hm(e,n)}}function hv(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=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};o===null?s=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,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 ed(e,t,n,r){var s=e.updateQueue;Ir=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,d=c.next;c.next=null,a===null?o=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(o!==null){var h=s.baseState;a=0,u=d=c=null,l=o;do{var p=l.lane,m=l.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,g=l;switch(p=t,m=n,g.tag){case 1:if(x=g.payload,typeof x=="function"){h=x.call(m,h,p);break e}h=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,p=typeof x=="function"?x.call(m,h,p):x,p==null)break e;h=Fe({},h,p);break e;case 2:Ir=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[l]:p.push(l))}else m={eventTime:m,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=m,c=h):u=u.next=m,a|=p;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;p=l,l=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(u===null&&(c=h),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Qs|=a,e.lanes=a,e.memoizedState=h}}function fv(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(H(191,s));s.call(r)}}}var pl={},Xn=ys(pl),La=ys(pl),Da=ys(pl);function Ms(e){if(e===pl)throw Error(H(174));return e}function ip(e,t){switch(_e(Da,t),_e(La,e),_e(Xn,pl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Yh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Yh(t,e)}Re(Xn),_e(Xn,t)}function di(){Re(Xn),Re(La),Re(Da)}function bb(e){Ms(Da.current);var t=Ms(Xn.current),n=Yh(t,e.type);t!==n&&(_e(La,e),_e(Xn,n))}function ap(e){La.current===e&&(Re(Xn),Re(La))}var ze=ys(0);function td(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 eh=[];function lp(){for(var e=0;e<eh.length;e++)eh[e]._workInProgressVersionPrimary=null;eh.length=0}var kc=yr.ReactCurrentDispatcher,th=yr.ReactCurrentBatchConfig,Ys=0,$e=null,Ze=null,it=null,nd=!1,ma=!1,za=0,RE=0;function vt(){throw Error(H(321))}function cp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_n(e[n],t[n]))return!1;return!0}function dp(e,t,n,r,s,o){if(Ys=o,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,kc.current=e===null||e.memoizedState===null?LE:DE,e=n(r,s),ma){o=0;do{if(ma=!1,za=0,25<=o)throw Error(H(301));o+=1,it=Ze=null,t.updateQueue=null,kc.current=zE,e=n(r,s)}while(ma)}if(kc.current=rd,t=Ze!==null&&Ze.next!==null,Ys=0,it=Ze=$e=null,nd=!1,t)throw Error(H(300));return e}function up(){var e=za!==0;return za=0,e}function Ln(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?$e.memoizedState=it=e:it=it.next=e,it}function an(){if(Ze===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var t=it===null?$e.memoizedState:it.next;if(t!==null)it=t,Ze=e;else{if(e===null)throw Error(H(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},it===null?$e.memoizedState=it=e:it=it.next=e}return it}function $a(e,t){return typeof t=="function"?t(e):t}function nh(e){var t=an(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Ze,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var a=s.next;s.next=o.next,o.next=a}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var l=a=null,c=null,d=o;do{var u=d.lane;if((Ys&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 h={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=h,a=r):c=c.next=h,$e.lanes|=u,Qs|=u}d=d.next}while(d!==null&&d!==o);c===null?a=r:c.next=l,_n(r,t.memoizedState)||(Rt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,$e.lanes|=o,Qs|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function rh(e){var t=an(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var a=s=s.next;do o=e(o,a.action),a=a.next;while(a!==s);_n(o,t.memoizedState)||(Rt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function wb(){}function kb(e,t){var n=$e,r=an(),s=t(),o=!_n(r.memoizedState,s);if(o&&(r.memoizedState=s,Rt=!0),r=r.queue,hp(Ab.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||it
vendor: 4,350 bytes, line 39
39!==null&&it.memoizedState.tag&1){if(n.flags|=2048,Fa(9,Tb.bind(null,n,r,s,t),void 0,null),at===null)throw Error(H(349));Ys&30||Sb(n,t,s)}return s}function Sb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Tb(e,t,n,r){t.value=n,t.getSnapshot=r,Eb(t)&&Nb(e)}function Ab(e,t,n){return n(function(){Eb(t)&&Nb(e)})}function Eb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_n(e,n)}catch{return!0}}function Nb(e){var t=mr(e,1);t!==null&&Cn(t,e,1,-1)}function mv(e){var t=Ln();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:e},t.queue=e,e=e.dispatch=ME.bind(null,$e,e),[t.memoizedState,e]}function Fa(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.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 Cb(){return an().memoizedState}function Sc(e,t,n,r){var s=Ln();$e.flags|=e,s.memoizedState=Fa(1|t,n,void 0,r===void 0?null:r)}function Xd(e,t,n,r){var s=an();r=r===void 0?null:r;var o=void 0;if(Ze!==null){var a=Ze.memoizedState;if(o=a.destroy,r!==null&&cp(r,a.deps)){s.memoizedState=Fa(t,n,o,r);return}}$e.flags|=e,s.memoizedState=Fa(1|t,n,o,r)}function pv(e,t){return Sc(8390656,8,e,t)}function hp(e,t){return Xd(2048,8,e,t)}function _b(e,t){return Xd(4,2,e,t)}function jb(e,t){return Xd(4,4,e,t)}function Pb(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 Rb(e,t,n){return n=n!=null?n.concat([e]):null,Xd(4,4,Pb.bind(null,t,e),n)}function fp(){}function Ob(e,t){var n=an();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&cp(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ib(e,t){var n=an();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&cp(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Mb(e,t,n){return Ys&21?(_n(n,t)||(n=Fx(),$e.lanes|=n,Qs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Rt=!0),e.memoizedState=n)}function OE(e,t){var n=Te;Te=n!==0&&4>n?n:4,e(!0);var r=th.transition;th.transition={};try{e(!1),t()}finally{Te=n,th.transition=r}}function Lb(){return an().memoizedState}function IE(e,t,n){var r=rs(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Db(e))zb(t,n);else if(n=yb(e,t,n,r),n!==null){var s=At();Cn(n,e,r,s),$b(n,t,r)}}function ME(e,t,n){var r=rs(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Db(e))zb(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,l=o(a,n);if(s.hasEagerState=!0,s.eagerState=l,_n(l,a)){var c=t.interleaved;c===null?(s.next=s,sp(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=yb(e,t,s,r),n!==null&&(s=At(),Cn(n,e,r,s),$b(n,t,r))}}function Db(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function zb(e,t){ma=nd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $b(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Hm(e,n)}}var rd={readContext:on,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useInsertionEffect:vt,useLayoutEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useMutableSource:vt,useSyncExternalStore:vt,useId:vt,unstable_isNewReconciler:!1},LE={readContext:on,useCallback:function(e,t){return Ln().memoizedState=[e,t===void 0?null:t],e},useContext:on,useEffect:pv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Sc(4194308,4,Pb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Sc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Sc(4,2,e,t)},useMemo:function(e,t){var n=Ln();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ln();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=IE.bind(null,$e,e),[r.memoizedState,e]}
vendor: 4,424 bytes, lines 39-41
39,useRef:function(e){var t=Ln();return e={current:e},t.memoizedState=e},useState:mv,useDebugValue:fp,useDeferredValue:function(e){return Ln().memoizedState=e},useTransition:function(){var e=mv(!1),t=e[0];return e=OE.bind(null,e[1]),Ln().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=$e,s=Ln();if(Me){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),at===null)throw Error(H(349));Ys&30||Sb(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,pv(Ab.bind(null,r,o,e),[e]),r.flags|=2048,Fa(9,Tb.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ln(),t=at.identifierPrefix;if(Me){var n=cr,r=lr;n=(r&~(1<<32-Nn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=za++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=RE++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},DE={readContext:on,useCallback:Ob,useContext:on,useEffect:hp,useImperativeHandle:Rb,useInsertionEffect:_b,useLayoutEffect:jb,useMemo:Ib,useReducer:nh,useRef:Cb,useState:function(){return nh($a)},useDebugValue:fp,useDeferredValue:function(e){var t=an();return Mb(t,Ze.memoizedState,e)},useTransition:function(){var e=nh($a)[0],t=an().memoizedState;return[e,t]},useMutableSource:wb,useSyncExternalStore:kb,useId:Lb,unstable_isNewReconciler:!1},zE={readContext:on,useCallback:Ob,useContext:on,useEffect:hp,useImperativeHandle:Rb,useInsertionEffect:_b,useLayoutEffect:jb,useMemo:Ib,useReducer:rh,useRef:Cb,useState:function(){return rh($a)},useDebugValue:fp,useDeferredValue:function(e){var t=an();return Ze===null?t.memoizedState=e:Mb(t,Ze.memoizedState,e)},useTransition:function(){var e=rh($a)[0],t=an().memoizedState;return[e,t]},useMutableSource:wb,useSyncExternalStore:kb,useId:Lb,unstable_isNewReconciler:!1};function yn(e,t){if(e&&e.defaultProps){t=Fe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function yf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Fe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var qd={isMounted:function(e){return(e=e._reactInternals)?so(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=At(),s=rs(e),o=dr(r,s);o.payload=t,n!=null&&(o.callback=n),t=ts(e,o,s),t!==null&&(Cn(t,e,s,r),wc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=At(),s=rs(e),o=dr(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=ts(e,o,s),t!==null&&(Cn(t,e,s,r),wc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=At(),r=rs(e),s=dr(n,r);s.tag=2,t!=null&&(s.callback=t),t=ts(e,s,r),t!==null&&(Cn(t,e,r,n),wc(t,e,r))}};function gv(e,t,n,r,s,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!Ra(n,r)||!Ra(s,o):!0}function Fb(e,t,n){var r=!1,s=hs,o=t.contextType;return typeof o=="object"&&o!==null?o=on(o):(s=It(t)?Ws:kt.current,r=t.contextTypes,o=(r=r!=null)?ai(e,s):hs),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=qd,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function vv(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&&qd.enqueueReplaceState(t,t.state,null)}function xf(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},op(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=on(o):(o=It(t)?Ws:kt.current,s.context=ai(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(yf(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&qd.enqueueReplaceState(s,s.state,null),ed(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ui(e,t){try{var n="",r=t;do n+=h2(r),r=r.return;while(r);var s=n}catch(o){s=` 40Error generating stack: `+o.message+` 41`+o.stack}return{value:e,source:t,stack:s,digest:null}}
vendor: 6,430 bytes, line 41
41function sh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function bf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var $E=typeof WeakMap=="function"?WeakMap:Map;function Bb(e,t,n){n=dr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){od||(od=!0,jf=r),bf(e,t)},n}function Ub(e,t,n){n=dr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){bf(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){bf(e,t),typeof r!="function"&&(ns===null?ns=new Set([this]):ns.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function yv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $E;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=ZE.bind(null,e,t,n),t.then(e,e))}function xv(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 bv(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=dr(-1,1),t.tag=2,ts(n,t,1))),n.lanes|=1),e)}var FE=yr.ReactCurrentOwner,Rt=!1;function St(e,t,n,r){t.child=e===null?vb(t,null,n,r):ci(t,e.child,n,r)}function wv(e,t,n,r,s){n=n.render;var o=t.ref;return Bo(t,s),r=dp(e,t,n,r,o,s),n=up(),e!==null&&!Rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,pr(e,t,s)):(Me&&n&&Jm(t),t.flags|=1,St(e,t,r,s),t.child)}function kv(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!wp(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Vb(e,t,o,r,s)):(e=Nc(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ra,n(a,r)&&e.ref===t.ref)return pr(e,t,s)}return t.flags|=1,e=ss(o,r),e.ref=t.ref,e.return=t,t.child=e}function Vb(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(Ra(o,r)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Rt=!0);else return t.lanes=e.lanes,pr(e,t,s)}return wf(e,t,n,r,s)}function Hb(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(Io,Lt),Lt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_e(Io,Lt),Lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,_e(Io,Lt),Lt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,_e(Io,Lt),Lt|=r;return St(e,t,s,n),t.child}function Xb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function wf(e,t,n,r,s){var o=It(n)?Ws:kt.current;return o=ai(t,o),Bo(t,s),n=dp(e,t,n,r,o,s),r=up(),e!==null&&!Rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,pr(e,t,s)):(Me&&r&&Jm(t),t.flags|=1,St(e,t,n,s),t.child)}function Sv(e,t,n,r,s){if(It(n)){var o=!0;Kc(t)}else o=!1;if(Bo(t,s),t.stateNode===null)Tc(e,t),Fb(t,n,r),xf(t,n,r,s),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,d=n.contextType;typeof d=="object"&&d!==null?d=on(d):(d=It(n)?Ws:kt.current,d=ai(t,d));var u=n.getDerivedStateFromProps,h=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";h||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==d)&&vv(t,a,r,d),Ir=!1;var p=t.memoizedState;a.state=p,ed(t,r,a,s),c=t.memoizedState,l!==r||p!==c||Ot.current||Ir?(typeof u=="function"&&(yf(t,n,u,r),c=t.memoizedState),(l=Ir||gv(t,n,l,r,p,c,d))?(h||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,xb(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:yn(t.type,l),a.props=d,h=t.pendingProps,p=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=on(c):(c=It(n)?Ws:kt.current,c=ai(t,c));var m=n.getDerivedStateFromProps;(u=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==h||p!==c)&&vv(t,a,r,c),Ir=!1,p=t.memoizedState,a.state=p,ed(t,r,a,s);var x=t.memoizedState;l!==h||p!==x||Ot.current||Ir?(typeof m=="function"&&(yf(t,n,m,r),x=t.memoizedState),(d=Ir||gv(t,n,d,r,p,x,c)||!1)?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,x,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,x,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),a.props=r,a.state=x,a.context=c,r=d):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return kf(e,t,n,r,o,s)}function kf(e,t,n,r,s,o){Xb(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return s&&lv(t,n,!1),pr(e,t,o);r=t.stateNode,FE.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=ci(t,e.child,null,o),t.child=ci(t,null,l,o)):St(e,t,l,o),t.memoizedState=r.state,s&&lv(t,n,!0),t.child}function qb(e){var t=e.stateNode;t.pendingContext?av(e,t.pendingContext,t.pendingContext!==t.context):t.context&&av(e,t.context,!1),ip(e,t.containerInfo)}
vendor: 6,221 bytes, line 41
41function Tv(e,t,n,r,s){return li(),ep(s),t.flags|=256,St(e,t,n,r),t.child}var Sf={dehydrated:null,treeContext:null,retryLane:0};function Tf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Gb(e,t,n){var r=t.pendingProps,s=ze.current,o=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),_e(ze,s&1),e===null)return gf(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,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=Kd(a,r,0,null),e=Xs(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Tf(n),t.memoizedState=Sf,e):mp(t,a));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return BE(e,t,a,r,l,s,n);if(o){o=r.fallback,a=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=ss(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=ss(l,o):(o=Xs(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?Tf(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=Sf,r}return o=e.child,e=o.sibling,r=ss(o,{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 mp(e,t){return t=Kd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Fl(e,t,n,r){return r!==null&&ep(r),ci(t,e.child,null,n),e=mp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function BE(e,t,n,r,s,o,a){if(n)return t.flags&256?(t.flags&=-257,r=sh(Error(H(422))),Fl(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=Kd({mode:"visible",children:r.children},s,0,null),o=Xs(o,s,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&ci(t,e.child,null,a),t.child.memoizedState=Tf(a),t.memoizedState=Sf,o);if(!(t.mode&1))return Fl(e,t,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(H(419)),r=sh(o,r,void 0),Fl(e,t,a,r)}if(l=(a&e.childLanes)!==0,Rt||l){if(r=at,r!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|a)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,mr(e,s),Cn(r,e,s,-1))}return bp(),r=sh(Error(H(421))),Fl(e,t,a,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=eN.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,Ft=es(s.nextSibling),Bt=t,Me=!0,Tn=null,e!==null&&(Zt[en++]=lr,Zt[en++]=cr,Zt[en++]=Ks,lr=e.id,cr=e.overflow,Ks=t),t=mp(t,r.children),t.flags|=4096,t)}function Av(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),vf(e.return,t,n)}function oh(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function Wb(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(St(e,t,r.children,n),r=ze.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&&Av(e,n,t);else if(e.tag===19)Av(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(_e(ze,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&td(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),oh(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&td(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}oh(t,!0,n,null,o);break;case"together":oh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Tc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function pr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=ss(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ss(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function UE(e,t,n){switch(t.tag){case 3:qb(t),li();break;case 5:bb(t);break;case 1:It(t.type)&&Kc(t);break;case 4:ip(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;_e(Jc,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(_e(ze,ze.current&1),t.flags|=128,null):n&t.child.childLanes?Gb(e,t,n):(_e(ze,ze.current&1),e=pr(e,t,n),e!==null?e.sibling:null);_e(ze,ze.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Wb(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),_e(ze,ze.current),r)break;return null;case 22:case 23:return t.lanes=0,Hb(e,t,n)}return pr(e,t,n)}var Kb,Af,Yb,Qb;Kb=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}};Af=function(){};Yb=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Ms(Xn.current);var o=null;switch(n){case"input":s=qh(e,s),r=qh(e,r),o=[];break;case"select":s=Fe({},s,{value:void 0}),r=Fe({},r,{value:void 0}),o=[];break;
vendor: 5,781 bytes, line 41
41case"textarea":s=Kh(e,s),r=Kh(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Gc)}Qh(n,r);var a;n=null;for(d in s)if(!r.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var l=s[d];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Aa.hasOwnProperty(d)?o||(o=[]):(o=o||[]).push(d,null));for(d in r){var c=r[d];if(l=s!=null?s[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(o||(o=[]),o.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(o=o||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Aa.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&Pe("scroll",e),o||l===c||(o=[])):(o=o||[]).push(d,c))}n&&(o=o||[]).push("style",n);var d=o;(t.updateQueue=d)&&(t.flags|=4)}};Qb=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ui(e,t){if(!Me)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 yt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function VE(e,t,n){var r=t.pendingProps;switch(Zm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(t),null;case 1:return It(t.type)&&Wc(),yt(t),null;case 3:return r=t.stateNode,di(),Re(Ot),Re(kt),lp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(zl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tn!==null&&(Of(Tn),Tn=null))),Af(e,t),yt(t),null;case 5:ap(t);var s=Ms(Da.current);if(n=t.type,e!==null&&t.stateNode!=null)Yb(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return yt(t),null}if(e=Ms(Xn.current),zl(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Un]=t,r[Ma]=o,e=(t.mode&1)!==0,n){case"dialog":Pe("cancel",r),Pe("close",r);break;case"iframe":case"object":case"embed":Pe("load",r);break;case"video":case"audio":for(s=0;s<ea.length;s++)Pe(ea[s],r);break;case"source":Pe("error",r);break;case"img":case"image":case"link":Pe("error",r),Pe("load",r);break;case"details":Pe("toggle",r);break;case"input":Ig(r,o),Pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Pe("invalid",r);break;case"textarea":Lg(r,o),Pe("invalid",r)}Qh(n,o),s=null;for(var a in o)if(o.hasOwnProperty(a)){var l=o[a];a==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&Dl(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&Dl(r.textContent,l,e),s=["children",""+l]):Aa.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&Pe("scroll",r)}switch(n){case"input":_l(r),Mg(r,o,!0);break;case"textarea":_l(r),Dg(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=Gc)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ax(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[Un]=t,e[Ma]=r,Kb(e,t,!1,!1),t.stateNode=e;e:{switch(a=Jh(n,r),n){case"dialog":Pe("cancel",e),Pe("close",e),s=r;break;case"iframe":case"object":case"embed":Pe("load",e),s=r;break;case"video":case"audio":for(s=0;s<ea.length;s++)Pe(ea[s],e);s=r;break;case"source":Pe("error",e),s=r;break;case"img":case"image":case"link":Pe("error",e),Pe("load",e),s=r;break;case"details":Pe("toggle",e),s=r;break;case"input":Ig(e,r),s=qh(e,r),Pe("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Fe({},r,{value:void 0}),Pe("invalid",e);break;case"textarea":Lg(e,r),s=Kh(e,r),Pe("invalid",e);break;default:s=r}Qh(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var c=l[o];o==="style"?Cx(e,c):o==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Ex(e,c)):o==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ea(e,c):typeof c=="number"&&Ea(e,""+c):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Aa.hasOwnProperty(o)?c!=null&&o==="onScroll"&&Pe("scroll",e):c!=null&&zm(e,o,c,a))}switch(n){case"input":_l(e),Mg(e,r,!1);break;case"textarea":_l(e),Dg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+us(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Do(e,!!r.multiple,o,!1):r.defaultValue!=null&&Do(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Gc)}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)}
vendor: 26,395 bytes, line 41
41return yt(t),null;case 6:if(e&&t.stateNode!=null)Qb(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=Ms(Da.current),Ms(Xn.current),zl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Un]=t,(o=r.nodeValue!==n)&&(e=Bt,e!==null))switch(e.tag){case 3:Dl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Dl(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Un]=t,t.stateNode=r}return yt(t),null;case 13:if(Re(ze),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Me&&Ft!==null&&t.mode&1&&!(t.flags&128))pb(),li(),t.flags|=98560,o=!1;else if(o=zl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(H(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(H(317));o[Un]=t}else li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yt(t),o=!1}else Tn!==null&&(Of(Tn),Tn=null),o=!0;if(!o)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||ze.current&1?tt===0&&(tt=3):bp())),t.updateQueue!==null&&(t.flags|=4),yt(t),null);case 4:return di(),Af(e,t),e===null&&Oa(t.stateNode.containerInfo),yt(t),null;case 10:return rp(t.type._context),yt(t),null;case 17:return It(t.type)&&Wc(),yt(t),null;case 19:if(Re(ze),o=t.memoizedState,o===null)return yt(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)Ui(o,!1);else{if(tt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=td(e),a!==null){for(t.flags|=128,Ui(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _e(ze,ze.current&1|2),t.child}e=e.sibling}o.tail!==null&&Xe()>hi&&(t.flags|=128,r=!0,Ui(o,!1),t.lanes=4194304)}else{if(!r)if(e=td(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ui(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Me)return yt(t),null}else 2*Xe()-o.renderingStartTime>hi&&n!==1073741824&&(t.flags|=128,r=!0,Ui(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Xe(),t.sibling=null,n=ze.current,_e(ze,r?n&1|2:n&1),t):(yt(t),null);case 22:case 23:return xp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Lt&1073741824&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function HE(e,t){switch(Zm(t),t.tag){case 1:return It(t.type)&&Wc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return di(),Re(Ot),Re(kt),lp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ap(t),null;case 13:if(Re(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Re(ze),null;case 4:return di(),null;case 10:return rp(t.type._context),null;case 22:case 23:return xp(),null;case 24:return null;default:return null}}var Bl=!1,wt=!1,XE=typeof WeakSet=="function"?WeakSet:Set,J=null;function Oo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ve(e,t,r)}else n.current=null}function Ef(e,t,n){try{n()}catch(r){Ve(e,t,r)}}var Ev=!1;function qE(e,t){if(cf=Hc,e=nb(),Qm(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,d=0,u=0,h=e,p=null;t:for(;;){for(var m;h!==n||s!==0&&h.nodeType!==3||(l=a+s),h!==o||r!==0&&h.nodeType!==3||(c=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(m=h.firstChild)!==null;)p=h,h=m;for(;;){if(h===e)break t;if(p===n&&++d===s&&(l=a),p===o&&++u===r&&(c=a),(m=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(df={focusedElem:e,selectionRange:n},Hc=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var g=x.memoizedProps,w=x.memoizedState,v=t.stateNode,y=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:yn(t.type,g),w);v.__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(H(163))}}catch(k){Ve(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return x=Ev,Ev=!1,x}function pa(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&Ef(t,n,o)}s=s.next}while(s!==r)}}function Gd(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 Nf(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 Jb(e){var t=e.alternate;t!==null&&(e.alternate=null,Jb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Un],delete t[Ma],delete t[ff],delete t[CE],delete t[_E])),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 Zb(e){return e.tag===5||e.tag===3||e.tag===4}function Nv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Zb(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 Cf(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=Gc));else if(r!==4&&(e=e.child,e!==null))for(Cf(e,t,n),e=e.sibling;e!==null;)Cf(e,t,n),e=e.sibling}function _f(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(_f(e,t,n),e=e.sibling;e!==null;)_f(e,t,n),e=e.sibling}var dt=null,Sn=!1;function Tr(e,t,n){for(n=n.child;n!==null;)ew(e,t,n),n=n.sibling}function ew(e,t,n){if(Hn&&typeof Hn.onCommitFiberUnmount=="function")try{Hn.onCommitFiberUnmount($d,n)}catch{}switch(n.tag){case 5:wt||Oo(n,t);case 6:var r=dt,s=Sn;dt=null,Tr(e,t,n),dt=r,Sn=s,dt!==null&&(Sn?(e=dt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):dt.removeChild(n.stateNode));break;case 18:dt!==null&&(Sn?(e=dt,n=n.stateNode,e.nodeType===8?Ju(e.parentNode,n):e.nodeType===1&&Ju(e,n),ja(e)):Ju(dt,n.stateNode));break;case 4:r=dt,s=Sn,dt=n.stateNode.containerInfo,Sn=!0,Tr(e,t,n),dt=r,Sn=s;break;case 0:case 11:case 14:case 15:if(!wt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&Ef(n,t,a),s=s.next}while(s!==r)}Tr(e,t,n);break;case 1:if(!wt&&(Oo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ve(n,t,l)}Tr(e,t,n);break;case 21:Tr(e,t,n);break;case 22:n.mode&1?(wt=(r=wt)||n.memoizedState!==null,Tr(e,t,n),wt=r):Tr(e,t,n);break;default:Tr(e,t,n)}}function Cv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new XE),t.forEach(function(r){var s=tN.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function mn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:dt=l.stateNode,Sn=!1;break e;case 3:dt=l.stateNode.containerInfo,Sn=!0;break e;case 4:dt=l.stateNode.containerInfo,Sn=!0;break e}l=l.return}if(dt===null)throw Error(H(160));ew(o,a,s),dt=null,Sn=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(d){Ve(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)tw(t,e),t=t.sibling}function tw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(mn(t,e),Mn(e),r&4){try{pa(3,e,e.return),Gd(3,e)}catch(g){Ve(e,e.return,g)}try{pa(5,e,e.return)}catch(g){Ve(e,e.return,g)}}break;case 1:mn(t,e),Mn(e),r&512&&n!==null&&Oo(n,n.return);break;case 5:if(mn(t,e),Mn(e),r&512&&n!==null&&Oo(n,n.return),e.flags&32){var s=e.stateNode;try{Ea(s,"")}catch(g){Ve(e,e.return,g)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&Sx(s,o),Jh(l,a);var d=Jh(l,o);for(a=0;a<c.length;a+=2){var u=c[a],h=c[a+1];u==="style"?Cx(s,h):u==="dangerouslySetInnerHTML"?Ex(s,h):u==="children"?Ea(s,h):zm(s,u,h,d)}switch(l){case"input":Gh(s,o);break;case"textarea":Tx(s,o);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m!=null?Do(s,!!o.multiple,m,!1):p!==!!o.multiple&&(o.defaultValue!=null?Do(s,!!o.multiple,o.defaultValue,!0):Do(s,!!o.multiple,o.multiple?[]:"",!1))}s[Ma]=o}catch(g){Ve(e,e.return,g)}}break;case 6:if(mn(t,e),Mn(e),r&4){if(e.stateNode===null)throw Error(H(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(g){Ve(e,e.return,g)}}break;case 3:if(mn(t,e),Mn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ja(t.containerInfo)}catch(g){Ve(e,e.return,g)}break;case 4:mn(t,e),Mn(e);break;case 13:mn(t,e),Mn(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(vp=Xe())),r&4&&Cv(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(wt=(d=wt)||u,mn(t,e),wt=d):mn(t,e),Mn(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(J=e,u=e.child;u!==null;){for(h=J=u;J!==null;){switch(p=J,m=p.child,p.tag){case 0:case 11:case 14:case 15:pa(4,p,p.return);break;case 1:Oo(p,p.return);var x=p.stateNode;if(typeof x.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(g){Ve(r,n,g)}}break;case 5:Oo(p,p.return);break;case 22:if(p.memoizedState!==null){jv(h);continue}}m!==null?(m.return=p,J=m):jv(h)}u=u.sibling}e:for(u=null,h=e;;){if(h.tag===5){if(u===null){u=h;try{s=h.stateNode,d?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=h.stateNode,c=h.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Nx("display",a))}catch(g){Ve(e,e.return,g)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(g){Ve(e,e.return,g)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:mn(t,e),Mn(e),r&4&&Cv(e);break;case 21:break;default:mn(t,e),Mn(e)}}function Mn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Zb(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Ea(s,""),r.flags&=-33);var o=Nv(e);_f(e,o,s);break;case 3:case 4:var a=r.stateNode.containerInfo,l=Nv(e);Cf(e,l,a);break;default:throw Error(H(161))}}catch(c){Ve(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function GE(e,t,n){J=e,nw(e)}function nw(e,t,n){for(var r=(e.mode&1)!==0;J!==null;){var s=J,o=s.child;if(s.tag===22&&r){var a=s.memoizedState!==null||Bl;if(!a){var l=s.alternate,c=l!==null&&l.memoizedState!==null||wt;l=Bl;var d=wt;if(Bl=a,(wt=c)&&!d)for(J=s;J!==null;)a=J,c=a.child,a.tag===22&&a.memoizedState!==null?Pv(s):c!==null?(c.return=a,J=c):Pv(s);for(;o!==null;)J=o,nw(o),o=o.sibling;J=s,Bl=l,wt=d}_v(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,J=o):_v(e)}}function _v(e){for(;J!==null;){var t=J;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:wt||Gd(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!wt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:yn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&fv(t,o,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}fv(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 h=u.dehydrated;h!==null&&ja(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}wt||t.flags&512&&Nf(t)}catch(p){Ve(t,t.return,p)}}if(t===e){J=null;break}if(n=t.sibling,n!==null){n.return=t.return,J=n;break}J=t.return}}function jv(e){for(;J!==null;){var t=J;if(t===e){J=null;break}var n=t.sibling;if(n!==null){n.return=t.return,J=n;break}J=t.return}}function Pv(e){for(;J!==null;){var t=J;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Gd(4,t)}catch(c){Ve(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){Ve(t,s,c)}}var o=t.return;try{Nf(t)}catch(c){Ve(t,o,c)}break;case 5:var a=t.return;try{Nf(t)}catch(c){Ve(t,a,c)}}}catch(c){Ve(t,t.return,c)}if(t===e){J=null;break}var l=t.sibling;if(l!==null){l.return=t.return,J=l;break}J=t.return}}var WE=Math.ceil,sd=yr.ReactCurrentDispatcher,pp=yr.ReactCurrentOwner,nn=yr.ReactCurrentBatchConfig,Se=0,at=null,Je=null,mt=0,Lt=0,Io=ys(0),tt=0,Ba=null,Qs=0,Wd=0,gp=0,ga=null,Pt=null,vp=0,hi=1/0,nr=null,od=!1,jf=null,ns=null,Ul=!1,Gr=null,id=0,va=0,Pf=null,Ac=-1,Ec=0;function At(){return Se&6?Xe():Ac!==-1?Ac:Ac=Xe()}function rs(e){return e.mode&1?Se&2&&mt!==0?mt&-mt:PE.transition!==null?(Ec===0&&(Ec=Fx()),Ec):(e=Te,e!==0||(e=window.event,e=e===void 0?16:Gx(e.type)),e):1}function Cn(e,t,n,r){if(50<va)throw va=0,Pf=null,Error(H(185));hl(e,n,r),(!(Se&2)||e!==at)&&(e===at&&(!(Se&2)&&(Wd|=n),tt===4&&Lr(e,mt)),Mt(e,r),n===1&&Se===0&&!(t.mode&1)&&(hi=Xe()+500,Hd&&xs()))}function Mt(e,t){var n=e.callbackNode;P2(e,t);var r=Vc(e,e===at?mt:0);if(r===0)n!==null&&Fg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Fg(n),t===1)e.tag===0?jE(Rv.bind(null,e)):hb(Rv.bind(null,e)),EE(function(){!(Se&6)&&xs()}),n=null;else{switch(Bx(r)){case 1:n=Vm;break;case 4:n=zx;break;case 16:n=Uc;break;case 536870912:n=$x;break;default:n=Uc}n=dw(n,rw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function rw(e,t){if(Ac=-1,Ec=0,Se&6)throw Error(H(327));var n=e.callbackNode;if(Uo()&&e.callbackNode!==n)return null;var r=Vc(e,e===at?mt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ad(e,r);else{t=r;var s=Se;Se|=2;var o=ow();(at!==e||mt!==t)&&(nr=null,hi=Xe()+500,Hs(e,t));do try{QE();break}catch(l){sw(e,l)}while(!0);np(),sd.current=o,Se=s,Je!==null?t=0:(at=null,mt=0,t=tt)}if(t!==0){if(t===2&&(s=rf(e),s!==0&&(r=s,t=Rf(e,s))),t===1)throw n=Ba,Hs(e,0),Lr(e,r),Mt(e,Xe()),n;if(t===6)Lr(e,r);else{if(s=e.current.alternate,!(r&30)&&!KE(s)&&(t=ad(e,r),t===2&&(o=rf(e),o!==0&&(r=o,t=Rf(e,o))),t===1))throw n=Ba,Hs(e,0),Lr(e,r),Mt(e,Xe()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:js(e,Pt,nr);break;case 3:if(Lr(e,r),(r&130023424)===r&&(t=vp+500-Xe(),10<t)){if(Vc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){At(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=hf(js.bind(null,e,Pt,nr),t);break}js(e,Pt,nr);break;case 4:if(Lr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var a=31-Nn(r);o=1<<a,a=t[a],a>s&&(s=a),r&=~o}if(r=s,r=Xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*WE(r/1960))-r,10<r){e.timeoutHandle=hf(js.bind(null,e,Pt,nr),r);break}js(e,Pt,nr);break;case 5:js(e,Pt,nr);break;default:throw Error(H(329))}}}return Mt(e,Xe()),e.callbackNode===n?rw.bind(null,e):null}function Rf(e,t){var n=ga;return e.current.memoizedState.isDehydrated&&(Hs(e,t).flags|=256),e=ad(e,t),e!==2&&(t=Pt,Pt=n,t!==null&&Of(t)),e}function Of(e){Pt===null?Pt=e:Pt.push.apply(Pt,e)}function KE(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],o=s.getSnapshot;s=s.value;try{if(!_n(o(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Lr(e,t){for(t&=~gp,t&=~Wd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Nn(t),r=1<<n;e[n]=-1,t&=~r}}function Rv(e){if(Se&6)throw Error(H(327));Uo();var t=Vc(e,0);if(!(t&1))return Mt(e,Xe()),null;var n=ad(e,t);if(e.tag!==0&&n===2){var r=rf(e);r!==0&&(t=r,n=Rf(e,r))}if(n===1)throw n=Ba,Hs(e,0),Lr(e,t),Mt(e,Xe()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,js(e,Pt,nr),Mt(e,Xe()),null}function yp(e,t){var n=Se;Se|=1;try{return e(t)}finally{Se=n,Se===0&&(hi=Xe()+500,Hd&&xs())}}function Js(e){Gr!==null&&Gr.tag===0&&!(Se&6)&&Uo();var t=Se;Se|=1;var n=nn.transition,r=Te;try{if(nn.transition=null,Te=1,e)return e()}finally{Te=r,nn.transition=n,Se=t,!(Se&6)&&xs()}}function xp(){Lt=Io.current,Re(Io)}function Hs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,AE(n)),Je!==null)for(n=Je.return;n!==null;){var r=n;switch(Zm(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Wc();break;case 3:di(),Re(Ot),Re(kt),lp();break;case 5:ap(r);break;case 4:di();break;case 13:Re(ze);break;case 19:Re(ze);break;case 10:rp(r.type._context);break;case 22:case 23:xp()}n=n.return}if(at=e,Je=e=ss(e.current,null),mt=Lt=t,tt=0,Ba=null,gp=Wd=Qs=0,Pt=ga=null,Is!==null){for(t=0;t<Is.length;t++)if(n=Is[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=s,r.next=a}n.pending=r}Is=null}return e}function sw(e,t){do{var n=Je;try{if(np(),kc.current=rd,nd){for(var r=$e.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}nd=!1}if(Ys=0,it=Ze=$e=null,ma=!1,za=0,pp.current=null,n===null||n.return===null){tt=1,Ba=t,Je=null;break}e:{var o=e,a=n.return,l=n,c=t;if(t=mt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,h=u.tag;if(!(u.mode&1)&&(h===0||h===11||h===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=xv(a);if(m!==null){m.flags&=-257,bv(m,a,l,o,t),m.mode&1&&yv(o,d,t),t=m,c=d;var x=t.updateQueue;if(x===null){var g=new Set;g.add(c),t.updateQueue=g}else x.add(c);break e}else{if(!(t&1)){yv(o,d,t),bp();break e}c=Error(H(426))}}else if(Me&&l.mode&1){var w=xv(a);if(w!==null){!(w.flags&65536)&&(w.flags|=256),bv(w,a,l,o,t),ep(ui(c,l));break e}}o=c=ui(c,l),tt!==4&&(tt=2),ga===null?ga=[o]:ga.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Bb(o,c,t);hv(o,v);break e;case 1:l=c;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(ns===null||!ns.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var k=Ub(o,l,t);hv(o,k);break e}}o=o.return}while(o!==null)}aw(n)}catch(S){t=S,Je===n&&n!==null&&(Je=n=n.return);continue}break}while(!0)}function ow(){var e=sd.current;return sd.current=rd,e===null?rd:e}function bp(){(tt===0||tt===3||tt===2)&&(tt=4),at===null||!(Qs&268435455)&&!(Wd&268435455)||Lr(at,mt)}function ad(e,t){var n=Se;Se|=2;var r=ow();(at!==e||mt!==t)&&(nr=null,Hs(e,t));do try{YE();break}catch(s){sw(e,s)}while(!0);if(np(),Se=n,sd.current=r,Je!==null)throw Error(H(261));return at=null,mt=0,tt}function YE(){for(;Je!==null;)iw(Je)}function QE(){for(;Je!==null&&!k2();)iw(Je)}function iw(e){var t=cw(e.alternate,e,Lt);e.memoizedProps=e.pendingProps,t===null?aw(e):Je=t,pp.current=null}function aw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=HE(n,t),n!==null){n.flags&=32767,Je=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{tt=6,Je=null;return}}else if(n=VE(n,t,Lt),n!==null){Je=n;return}if(t=t.sibling,t!==null){Je=t;return}Je=t=e}while(t!==null);tt===0&&(tt=5)}function js(e,t,n){var r=Te,s=nn.transition;try{nn.transition=null,Te=1,JE(e,t,n,r)}finally{nn.transition=s,Te=r}return null}function JE(e,t,n,r){do Uo();while(Gr!==null);if(Se&6)throw Error(H(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(R2(e,o),e===at&&(Je=at=null,mt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ul||(Ul=!0,dw(Uc,function(){return Uo(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=nn.transition,nn.transition=null;var a=Te;Te=1;var l=Se;Se|=4,pp.current=null,qE(e,n),tw(n,e),yE(df),Hc=!!cf,df=cf=null,e.current=n,GE(n),S2(),Se=l,Te=a,nn.transition=o}else e.current=n;if(Ul&&(Ul=!1,Gr=e,id=s),o=e.pendingLanes,o===0&&(ns=null),E2(n.stateNode),Mt(e,Xe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(od)throw od=!1,e=jf,jf=null,e;return id&1&&e.tag!==0&&Uo(),o=e.pendingLanes,o&1?e===Pf?va++:(va=0,Pf=e):va=0,xs(),null}function Uo(){if(Gr!==null){var e=Bx(id),t=nn.transition,n=Te;try{if(nn.transition=null,Te=16>e?16:e,Gr===null)var r=!1;else{if(e=Gr,Gr=null,id=0,Se&6)throw Error(H(331));var s=Se;for(Se|=4,J=e.current;J!==null;){var o=J,a=o.child;if(J.flags&16){var l=o.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(J=d;J!==null;){var u=J;switch(u.tag){case 0:case 11:case 15:pa(8,u,o)}var h=u.child;if(h!==null)h.return=u,J=h;else for(;J!==null;){u=J;var p=u.sibling,m=u.return;if(Jb(u),u===d){J=null;break}if(p!==null){p.return=m,J=p;break}J=m}}}var x=o.alternate;if(x!==null){var g=x.child;if(g!==null){x.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}J=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,J=a;else e:for(;J!==null;){if(o=J,o.flags&2048)switch(o.tag){case 0:case 11:case 15:pa(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,J=v;break e}J=o.return}}var y=e.current;for(J=y;J!==null;){a=J;var b=a.child;if(a.subtreeFlags&2064&&b!==null)b.return=a,J=b;else e:for(a=y;J!==null;){if(l=J,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Gd(9,l)}}catch(S){Ve(l,l.return,S)}if(l===a){J=null;break e}var k=l.sibling;if(k!==null){k.return=l.return,J=k;break e}J=l.return}}if(Se=s,xs(),Hn&&typeof Hn.onPostCommitFiberRoot=="function")try{Hn.onPostCommitFiberRoot($d,e)}catch{}r=!0}return r}finally{Te=n,nn.transition=t}}return!1}function Ov(e,t,n){t=ui(n,t),t=Bb(e,t,1),e=ts(e,t,1),t=At(),e!==null&&(hl(e,1,t),Mt(e,t))}function Ve(e,t,n){if(e.tag===3)Ov(e,e,n);else for(;t!==null;){if(t.tag===3){Ov(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ns===null||!ns.has(r))){e=ui(n,e),e=Ub(t,e,1),t=ts(t,e,1),e=At(),t!==null&&(hl(t,1,e),Mt(t,e));break}}t=t.return}}function ZE(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=At(),e.pingedLanes|=e.suspendedLanes&n,at===e&&(mt&n)===n&&(tt===4||tt===3&&(mt&130023424)===mt&&500>Xe()-vp?Hs(e,0):gp|=n),Mt(e,t)}function lw(e,t){t===0&&(e.mode&1?(t=Rl,Rl<<=1,!(Rl&130023424)&&(Rl=4194304)):t=1);var n=At();e=mr(e,t),e!==null&&(hl(e,t,n),Mt(e,n))}function eN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),lw(e,n)}function tN(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),lw(e,n)}var cw;cw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ot.current)Rt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Rt=!1,UE(e,t,n);Rt=!!(e.flags&131072)}else Rt=!1,Me&&t.flags&1048576&&fb(t,Qc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Tc(e,t),e=t.pendingProps;var s=ai(t,kt.current);Bo(t,n),s=dp(null,t,r,e,s,n);var o=up();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,It(r)?(o=!0,Kc(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,op(t),s.updater=qd,t.stateNode=s,s._reactInternals=t,xf(t,r,e,n),t=kf(null,t,r,!0,o,n)):(t.tag=0,Me&&o&&Jm(t),St(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Tc(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=rN(r),e=yn(r,e),s){case 0:t=wf(null,t,r,e,n);break e;case 1:t=Sv(null,t,r,e,n);break e;case 11:t=wv(null,t,r,e,n);break e;case 14:t=kv(null,t,r,yn(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:yn(r,s),wf(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:yn(r,s),Sv(e,t,r,s,n);case 3:e:{if(qb(t),e===null)throw Error(H(387));
vendor: 4,674 bytes, line 41
41r=t.pendingProps,o=t.memoizedState,s=o.element,xb(e,t),ed(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=ui(Error(H(423)),t),t=Tv(e,t,r,n,s);break e}else if(r!==s){s=ui(Error(H(424)),t),t=Tv(e,t,r,n,s);break e}else for(Ft=es(t.stateNode.containerInfo.firstChild),Bt=t,Me=!0,Tn=null,n=vb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(li(),r===s){t=pr(e,t,n);break e}St(e,t,r,n)}t=t.child}return t;case 5:return bb(t),e===null&&gf(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,a=s.children,uf(r,s)?a=null:o!==null&&uf(r,o)&&(t.flags|=32),Xb(e,t),St(e,t,a,n),t.child;case 6:return e===null&&gf(t),null;case 13:return Gb(e,t,n);case 4:return ip(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ci(t,null,r,n):St(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:yn(r,s),wv(e,t,r,s,n);case 7:return St(e,t,t.pendingProps,n),t.child;case 8:return St(e,t,t.pendingProps.children,n),t.child;case 12:return St(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,a=s.value,_e(Jc,r._currentValue),r._currentValue=a,o!==null)if(_n(o.value,a)){if(o.children===s.children&&!Ot.current){t=pr(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){a=o.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(o.tag===1){c=dr(-1,n&-n),c.tag=2;var d=o.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}}o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),vf(o.return,n,t),l.lanes|=n;break}c=c.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(H(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),vf(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}St(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Bo(t,n),s=on(s),r=r(s),t.flags|=1,St(e,t,r,n),t.child;case 14:return r=t.type,s=yn(r,t.pendingProps),s=yn(r.type,s),kv(e,t,r,s,n);case 15:return Vb(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:yn(r,s),Tc(e,t),t.tag=1,It(r)?(e=!0,Kc(t)):e=!1,Bo(t,n),Fb(t,r,s),xf(t,r,s,n),kf(null,t,r,!0,e,n);case 19:return Wb(e,t,n);case 22:return Hb(e,t,n)}throw Error(H(156,t.tag))};function dw(e,t){return Dx(e,t)}function nN(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 tn(e,t,n,r){return new nN(e,t,n,r)}function wp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rN(e){if(typeof e=="function")return wp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Fm)return 11;if(e===Bm)return 14}return 2}function ss(e,t){var n=e.alternate;return n===null?(n=tn(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 Nc(e,t,n,r,s,o){var a=2;if(r=e,typeof e=="function")wp(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case To:return Xs(n.children,s,o,t);case $m:a=8,s|=8;break;case Uh:return e=tn(12,n,t,s|2),e.elementType=Uh,e.lanes=o,e;case Vh:return e=tn(13,n,t,s),e.elementType=Vh,e.lanes=o,e;case Hh:return e=tn(19,n,t,s),e.elementType=Hh,e.lanes=o,e;case bx:return Kd(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case yx:a=10;break e;case xx:a=9;break e;case Fm:a=11;break e;case Bm:a=14;break e;case Or:a=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=tn(a,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function Xs(e,t,n,r){return e=tn(7,e,r,t),e.lanes=n,e}function Kd(e,t,n,r){return e=tn(22,e,r,t),e.elementType=bx,e.lanes=n,e.stateNode={isHidden:!1},e}
vendor: 5,691 bytes, line 41
41function ih(e,t,n){return e=tn(6,e,null,t),e.lanes=n,e}function ah(e,t,n){return t=tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function sN(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bu(0),this.expirationTimes=Bu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bu(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function kp(e,t,n,r,s,o,a,l,c){return e=new sN(e,t,n,l,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=tn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},op(o),e}function oN(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:So,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function uw(e){if(!e)return hs;e=e._reactInternals;e:{if(so(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(It(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(It(n))return ub(e,n,t)}return t}function hw(e,t,n,r,s,o,a,l,c){return e=kp(n,r,!0,e,s,o,a,l,c),e.context=uw(null),n=e.current,r=At(),s=rs(n),o=dr(r,s),o.callback=t??null,ts(n,o,s),e.current.lanes=s,hl(e,s,r),Mt(e,r),e}function Yd(e,t,n,r){var s=t.current,o=At(),a=rs(s);return n=uw(n),t.context===null?t.context=n:t.pendingContext=n,t=dr(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ts(s,t,a),e!==null&&(Cn(e,s,a,o),wc(e,s,a)),a}function ld(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 Iv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sp(e,t){Iv(e,t),(e=e.alternate)&&Iv(e,t)}function iN(){return null}var fw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Tp(e){this._internalRoot=e}Qd.prototype.render=Tp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Yd(e,t,null,null)};Qd.prototype.unmount=Tp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Js(function(){Yd(null,e,null,null)}),t[fr]=null}};function Qd(e){this._internalRoot=e}Qd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Hx();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mr.length&&t!==0&&t<Mr[n].priority;n++);Mr.splice(n,0,e),n===0&&qx(e)}};function Ap(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Jd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Mv(){}function aN(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var d=ld(a);o.call(d)}}var a=hw(t,r,e,0,null,!1,!1,"",Mv);return e._reactRootContainer=a,e[fr]=a.current,Oa(e.nodeType===8?e.parentNode:e),Js(),a}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var d=ld(c);l.call(d)}}var c=kp(e,0,!1,null,null,!1,!1,"",Mv);return e._reactRootContainer=c,e[fr]=c.current,Oa(e.nodeType===8?e.parentNode:e),Js(function(){Yd(t,c,n,r)}),c}function Zd(e,t,n,r,s){var o=n._reactRootContainer;if(o){var a=o;if(typeof s=="function"){var l=s;s=function(){var c=ld(a);l.call(c)}}Yd(t,a,e,s)}else a=aN(n,t,e,s,r);return ld(a)}Ux=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Zi(t.pendingLanes);n!==0&&(Hm(t,n|1),Mt(t,Xe()),!(Se&6)&&(hi=Xe()+500,xs()))}break;case 13:Js(function(){var r=mr(e,1);if(r!==null){var s=At();Cn(r,e,1,s)}}),Sp(e,1)}};Xm=function(e){if(e.tag===13){var t=mr(e,134217728);if(t!==null){var n=At();Cn(t,e,134217728,n)}Sp(e,134217728)}};Vx=function(e){if(e.tag===13){var t=rs(e),n=mr(e,t);if(n!==null){var r=At();Cn(n,e,t,r)}Sp(e,t)}};Hx=function(){return Te};Xx=function(e,t){var n=Te;try{return Te=e,t()}finally{Te=n}};ef=function(e,t,n){switch(t){case"input":if(Gh(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Vd(r);if(!s)throw Error(H(90));kx(r),Gh(r,s)}}}break;case"textarea":Tx(e,n);break;case"select":t=n.value,t!=null&&Do(e,!!n.multiple,t,!1)}};Px=yp;Rx=Js;var lN={usingClientEntryPoint:!1,Events:[ml,Co,Vd,_x,jx,yp]},Vi={findFiberByHostInstance:Os,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},cN={bundleType:Vi.bundleType,version:Vi.version,rendererPackageName:Vi.rendererPackageName,rendererConfig:Vi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:yr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Mx(e),e===null?null:e.stateNode},findFiberByHostInstance:Vi.findFiberByHostInstance||iN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
41if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vl.isDisabled&&Vl.supportsFiber)try{$d=Vl.inject(cN),Hn=Vl}catch{}}Ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lN;Ht.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ap(t))throw Error(H(200));return oN(e,t,null,n)};Ht.createRoot=function(e,t){if(!Ap(e))throw Error(H(299));var n=!1,r="",s=fw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=kp(e,1,!1,null,null,n,!1,r,s),e[fr]=t.current,Oa(e.nodeType===8?e.parentNode:e),new Tp(t)};Ht.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(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=Mx(t),e=e===null?null:e.stateNode,e};Ht.flushSync=function(e){return Js(e)};Ht.hydrate=function(e,t,n){if(!Jd(t))throw Error(H(200));return Zd(null,e,t,!0,n)};Ht.hydrateRoot=function(e,t,n){if(!Ap(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",a=fw;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=hw(t,null,e,1,n??null,s,!1,o,a),e[fr]=t.current,Oa(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Qd(t)};Ht.render=function(e,t,n){if(!Jd(t))throw Error(H(200));return Zd(null,e,t,!1,n)};Ht.unmountComponentAtNode=function(e){if(!Jd(e))throw Error(H(40));return e._reactRootContainer?(Js(function(){Zd(null,null,e,!1,function(){e._reactRootContainer=null,e[fr]=null})}),!0):!1};Ht.unstable_batchedUpdates=yp;Ht.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Jd(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return Zd(e,t,n,!1,r)};Ht.version="18.3.1-next-f1338f8080-20240426";function mw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(mw)}catch(e){console.error(e)}}mw(),mx.exports=Ht;var oo=mx.exports;const pw=dl(oo);var gw,Lv=oo;gw=Lv.createRoot,Lv.hydrateRoot;const dN="modulepreload",uN=function(e){return"/"+e},Dv={},ge=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=uN(c),c in Dv)return;Dv[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":dN,d||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),d)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})},hN=1,fN=1e6;let lh=0;function mN(){return lh=(lh+1)%Number.MAX_SAFE_INTEGER,lh.toString()}const ch=new Map,zv=e=>{if(ch.has(e))return;const t=setTimeout(()=>{ch.delete(e),ya({type:"REMOVE_TOAST",toastId:e})},fN);ch.set(e,t)},pN=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,hN)};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?zv(n):e.toasts.forEach(r=>{zv(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)}}},Cc=[];let _c={toasts:[]};function ya(e){_c=pN(_c,e),Cc.forEach(t=>{t(_c)})}function ta({...e}){const t=mN(),n=s=>ya({type:"UPDATE_TOAST",toast:{...s,id:t}}
vendor: 13,591 bytes, line 41
41),r=()=>ya({type:"DISMISS_TOAST",toastId:t});return ya({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function gN(){const[e,t]=f.useState(_c);return f.useEffect(()=>(Cc.push(t),()=>{const n=Cc.indexOf(t);n>-1&&Cc.splice(n,1)}),[e]),{...e,toast:ta,dismiss:n=>ya({type:"DISMISS_TOAST",toastId:n})}}function Z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function $v(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vw(...e){return t=>{let n=!1;const r=e.map(s=>{const o=$v(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():$v(e[s],null)}}}}function me(...e){return f.useCallback(vw(...e),e)}function vN(e,t){const n=f.createContext(t),r=o=>{const{children:a,...l}=o,c=f.useMemo(()=>l,Object.values(l));return i.jsx(n.Provider,{value:c,children:a})};r.displayName=e+"Provider";function s(o){const a=f.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function qt(e,t=[]){let n=[];function r(o,a){const l=f.createContext(a),c=n.length;n=[...n,a];const d=h=>{var v;const{scope:p,children:m,...x}=h,g=((v=p==null?void 0:p[e])==null?void 0:v[c])||l,w=f.useMemo(()=>x,Object.values(x));return i.jsx(g.Provider,{value:w,children:m})};d.displayName=o+"Provider";function u(h,p){var g;const m=((g=p==null?void 0:p[e])==null?void 0:g[c])||l,x=f.useContext(m);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[d,u]}const s=()=>{const o=n.map(a=>f.createContext(a));return function(l){const c=(l==null?void 0:l[e])||o;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,yN(s,...t)]}function yN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const h=c(o)[`__scope${d}`];return{...l,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function fi(e){const t=bN(e),n=f.forwardRef((r,s)=>{const{children:o,...a}=r,l=f.Children.toArray(o),c=l.find(kN);if(c){const d=c.props.children,u=l.map(h=>h===c?f.Children.count(d)>1?f.Children.only(null):f.isValidElement(d)?d.props.children:null:h);return i.jsx(t,{...a,ref:s,children:f.isValidElement(d)?f.cloneElement(d,void 0,u):null})}return i.jsx(t,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var xN=fi("Slot");function bN(e){const t=f.forwardRef((n,r)=>{const{children:s,...o}=n;if(f.isValidElement(s)){const a=TN(s),l=SN(o,s.props);return s.type!==f.Fragment&&(l.ref=r?vw(r,a):a),f.cloneElement(s,l)}return f.Children.count(s)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yw=Symbol("radix.slottable");function wN(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yw,t}function kN(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yw}function SN(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...l)=>{const c=o(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function TN(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function eu(e){const t=e+"CollectionProvider",[n,r]=qt(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:w,children:v}=g,y=X.useRef(null),b=X.useRef(new Map).current;return i.jsx(s,{scope:w,itemMap:b,collectionRef:y,children:v})};a.displayName=t;const l=e+"CollectionSlot",c=fi(l),d=X.forwardRef((g,w)=>{const{scope:v,children:y}=g,b=o(l,v),k=me(w,b.collectionRef);return i.jsx(c,{ref:k,children:y})});d.displayName=l;const u=e+"CollectionItemSlot",h="data-radix-collection-item",p=fi(u),m=X.forwardRef((g,w)=>{const{scope:v,children:y,...b}=g,k=X.useRef(null),S=me(w,k),T=o(u,v);return X.useEffect(()=>(T.itemMap.set(k,{ref:k,...b}),()=>void T.itemMap.delete(k))),i.jsx(p,{[h]:"",ref:S,children:y})});m.displayName=u;function x(g){const w=o(e+"CollectionConsumer",g);return X.useCallback(()=>{const y=w.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${h}]`));return Array.from(w.itemMap.values()).sort((T,E)=>b.indexOf(T.ref.current)-b.indexOf(E.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:d,ItemSlot:m},x,r]}var AN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=AN.reduce((e,t)=>{const n=fi(`Primitive.${t}`),r=f.forwardRef((s,o)=>{const{asChild:a,...l}=s,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xw(e,t){e&&oo.flushSync(()=>e.dispatchEvent(t))}function et(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function EN(e,t=globalThis==null?void 0:globalThis.document){const n=et(e);f.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var NN="DismissableLayer",If="dismissableLayer.update",CN="dismissableLayer.pointerDownOutside",_N="dismissableLayer.focusOutside",Fv,bw=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gl=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=e,d=f.useContext(bw),[u,h]=f.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=f.useState({}),x=me(t,E=>h(E)),g=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(w),y=u?g.indexOf(u):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,k=y>=v,S=PN(E=>{const j=E.target,N=[...d.branches].some(R=>R.contains(j));!k||N||(s==null||s(E),a==null||a(E),E.defaultPrevented||l==null||l())},p),T=RN(E=>{const j=E.target;[...d.branches].some(R=>R.contains(j))||(o==null||o(E),a==null||a(E),E.defaultPrevented||l==null||l())},p);return EN(E=>{y===d.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&l&&(E.preventDefault(),l()))},p),f.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Fv=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Bv(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Fv)}},[u,p,n,d]),f.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Bv())},[u,d]),f.useEffect(()=>{const E=()=>m({});return document.addEventListener(If,E),()=>document.removeEventListener(If,E)},[]),i.jsx(ie.div,{...c,ref:x,style:{pointerEvents:b?k?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,S.onPointerDownCapture)})});gl.displayName=NN;var jN="DismissableLayerBranch",ww=f.forwardRef((e,t)=>{const n=f.useContext(bw),r=f.useRef(null),s=me(t,r);return f.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),i.jsx(ie.div,{...e,ref:s})});ww.displayName=jN;function PN(e,t=globalThis==null?void 0:globalThis.document){const n=et(e),r=f.useRef(!1),s=f.useRef(()=>{});return f.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let c=function(){kw(CN,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function RN(e,t=globalThis==null?void 0:globalThis.document){const n=et(e),r=f.useRef(!1);return f.useEffect(()=>{const s=o=>{o.target&&!r.current&&kw(_N,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Bv(){const e=new CustomEvent(If);document.dispatchEvent(e)}function kw(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?xw(s,o):s.dispatchEvent(o)}var ON=gl,IN=ww,lt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},MN="Portal",tu=f.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,o]=f.useState(!1);lt(()=>o(!0),[]);const a=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?pw.createPortal(i.jsx(ie.div,{...r,ref:t}),a):null});tu.displayName=MN;function LN(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var cn=e=>{const{present:t,children:n}=e,r=DN(t),s=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),o=me(r.ref,zN(s));return typeof n=="function"||r.isPresent?f.cloneElement(s,{ref:o}):null};cn.displayName="Presence";function DN(e){const[t,n]=f.useState(),r=f.useRef(null),s=f.useRef(e),o=f.useRef("none"),a=e?"mounted":"unmounted",[l,c]=LN(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const d=Hl(r.current);o.current=l==="mounted"?d:"none"},[l]),lt(()=>{const d=r.current,u=s.current;if(u!==e){const p=o.current,m=Hl(d);e?c("MOUNT"):m==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&p!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),lt(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,h=m=>{const g=Hl(r.current).includes(m.animationName);if(m.target===t&&g&&(c("ANIMATION_END"),!s.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},p=m=>{m.target===t&&(o.current=Hl(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Hl(e){return(e==null?void 0:e.animationName)||"none"}function zN(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $N=Mm[" useInsertionEffect ".trim().toString()]||lt;function qn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,a]=FN({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const u=f.useRef(e!==void 0);f.useEffect(()=>{const h=u.current;h!==l&&console.warn(`${r} is changing from ${h?"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=f.useCallback(u=>{var h;if(l){const p=BN(u)?u(e):u;p!==e&&((h=a.current)==null||h.call(a,p))}else o(u)},[l,e,o,a]);return[c,d]}function FN({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),s=f.useRef(n),o=f.useRef(t);return $N(()=>{o.current=t},[t]),f.useEffect(()=>{var a;s.current!==n&&((a=o.current)==null||a.call(o,n),s.current=n)},[n,s]),[n,r,o]}function BN(e){return typeof e=="function"}var Sw=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"}),UN="VisuallyHidden",nu=f.forwardRef((e,t)=>i.jsx(ie.span,{...e,ref:t,style:{...Sw,...e.style}}));nu.displayName=UN;var VN=nu,Ep="ToastProvider",[Np,HN,XN]=eu("Toast"),[Tw,qF]=qt("Toast",[XN]),[qN,ru]=Tw(Ep),Aw=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:a}=e,[l,c]=f.useState(null),[d,u]=f.useState(0),h=f.useRef(!1),p=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ep}\`. Expected non-empty \`string\`.`),i.jsx(Np.Provider,{scope:t,children:i.jsx(qN,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:o,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:f.useCallback(()=>u(m=>m+1),[]),onToastRemove:f.useCallback(()=>u(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:p,children:a})})};Aw.displayName=Ep;var Ew="ToastViewport",GN=["F8"],Mf="toast.viewportPause",Lf="toast.viewportResume",Nw=f.forwardRef((e,t)=>
41{const{__scopeToast:n,hotkey:r=GN,label:s="Notifications ({hotkey})",...o}=e,a=ru(Ew,n),l=HN(n),c=f.useRef(null),d=f.useRef(null),u=f.useRef(null),h=f.useRef(null),p=me(t,h,a.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=a.toastCount>0;f.useEffect(()=>{const w=v=>{var b;r.length!==0&&r.every(k=>v[k]||v.code===k)&&((b=h.current)==null||b.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),f.useEffect(()=>{const w=c.current,v=h.current;if(x&&w&&v){const y=()=>{if(!a.isClosePausedRef.current){const T=new CustomEvent(Mf);v.dispatchEvent(T),a.isClosePausedRef.current=!0}},b=()=>{if(a.isClosePausedRef.current){const T=new CustomEvent(Lf);v.dispatchEvent(T),a.isClosePausedRef.current=!1}},k=T=>{!w.contains(T.relatedTarget)&&b()},S=()=>{w.contains(document.activeElement)||b()};return w.addEventListener("focusin",y),w.addEventListener("focusout",k),w.addEventListener("pointermove",y),w.addEventListener("pointerleave",S),window.addEventListener("blur",y),window.addEventListener("focus",b),()=>{w.removeEventListener("focusin",y),w.removeEventListener("focusout",k),w.removeEventListener("pointermove",y),w.removeEventListener("pointerleave",S),window.removeEventListener("blur",y),window.removeEventListener("focus",b)}}},[x,a.isClosePausedRef]);const g=f.useCallback(({tabbingDirection:w})=>{const y=l().map(b=>{const k=b.ref.current,S=[k,...iC(k)];return w==="forwards"?S:S.reverse()});return(w==="forwards"?y.reverse():y).flat()},[l]);return f.useEffect(()=>{const w=h.current;if(w){const v=y=>{var S,T,E;const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const j=document.activeElement,N=y.shiftKey;if(y.target===w&&N){(S=d.current)==null||S.focus();return}const U=g({tabbingDirection:N?"backwards":"forwards"}),V=U.findIndex($=>$===j);dh(U.slice(V+1))?y.preventDefault():N?(T=d.current)==null||T.focus():(E=u.current)==null||E.focus()}};return w.addEventListener("keydown",v),()=>w.removeEventListener("keydown",v)}},[l,g]),i.jsxs(IN,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&i.jsx(Df,{ref:d,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"forwards"});dh(w)}}),i.jsx(Np.Slot,{scope:n,children:i.jsx(ie.ol,{tabIndex:-1,...o,ref:p})}),x&&i.jsx(Df,{ref:u,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"backwards"});dh(w)}})]})});Nw.displayName=Ew;var Cw="ToastFocusProxy",Df=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,o=ru(Cw,n);return i.jsx(nu,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:a=>{var d;const l=a.relatedTarget;!((d=o.viewport)!=null&&d.contains(l))&&r()}})});Df.displayName=Cw;var vl="Toast",WN="toast.swipeStart",KN="toast.swipeMove",YN="toast.swipeCancel",QN="toast.swipeEnd",_w=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:o,...a}=e,[l,c]=qn({prop:r,defaultProp:s??!0,onChange:o,caller:vl});return i.jsx(cn,{present:n||l,children:i.jsx(eC,{open:l,...a,ref:t,onClose:()=>c(!1),onPause:et(e.onPause),onResume:et(e.onResume),onSwipeStart:Z(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Z(e.onSwipeMove,d=>{const{x:u,y:h}=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",`${h}px`)}),onSwipeCancel:Z(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:Z(e.onSwipeEnd,d=>{const{x:u,y:h}=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",`${h}px`),c(!1)})})})});_w.displayName=vl;var[JN,ZN]=Tw(vl,{onClose(){}}),eC=f.forwardRef((e,t)=>
41{const{__scopeToast:n,type:r="foreground",duration:s,open:o,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:h,onSwipeCancel:p,onSwipeEnd:m,...x}=e,g=ru(vl,n),[w,v]=f.useState(null),y=me(t,$=>v($)),b=f.useRef(null),k=f.useRef(null),S=s||g.duration,T=f.useRef(0),E=f.useRef(S),j=f.useRef(0),{onToastAdd:N,onToastRemove:R}=g,F=et(()=>{var M;(w==null?void 0:w.contains(document.activeElement))&&((M=g.viewport)==null||M.focus()),a()}),U=f.useCallback($=>{!$||$===1/0||(window.clearTimeout(j.current),T.current=new Date().getTime(),j.current=window.setTimeout(F,$))},[F]);f.useEffect(()=>{const $=g.viewport;if($){const M=()=>{U(E.current),d==null||d()},L=()=>{const B=new Date().getTime()-T.current;E.current=E.current-B,window.clearTimeout(j.current),c==null||c()};return $.addEventListener(Mf,L),$.addEventListener(Lf,M),()=>{$.removeEventListener(Mf,L),$.removeEventListener(Lf,M)}}},[g.viewport,S,c,d,U]),f.useEffect(()=>{o&&!g.isClosePausedRef.current&&U(S)},[o,S,g.isClosePausedRef,U]),f.useEffect(()=>(N(),()=>R()),[N,R]);const V=f.useMemo(()=>w?Lw(w):null,[w]);return g.viewport?i.jsxs(i.Fragment,{children:[V&&i.jsx(tC,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:V}),i.jsx(JN,{scope:n,onClose:F,children:oo.createPortal(i.jsx(Np.ItemSlot,{scope:n,children:i.jsx(ON,{asChild:!0,onEscapeKeyDown:Z(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||F(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(ie.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":g.swipeDirection,...x,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Z(e.onKeyDown,$=>{$.key==="Escape"&&(l==null||l($.nativeEvent),$.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,F()))}),onPointerDown:Z(e.onPointerDown,$=>{$.button===0&&(b.current={x:$.clientX,y:$.clientY})}),onPointerMove:Z(e.onPointerMove,$=>{if(!b.current)return;const M=$.clientX-b.current.x,L=$.clientY-b.current.y,B=!!k.current,_=["left","right"].includes(g.swipeDirection),P=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,z=_?P(0,M):0,re=_?0:P(0,L),Y=$.pointerType==="touch"?10:2,se={x:z,y:re},ee={originalEvent:$,delta:se};B?(k.current=se,Xl(KN,h,ee,{discrete:!1})):Uv(se,g.swipeDirection,Y)?(k.current=se,Xl(WN,u,ee,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(M)>Y||Math.abs(L)>Y)&&(b.current=null)}),onPointerUp:Z(e.onPointerUp,$=>{const M=k.current,L=$.target;if(L.hasPointerCapture($.pointerId)&&L.releasePointerCapture($.pointerId),k.current=null,b.current=null,M){const B=$.currentTarget,_={originalEvent:$,delta:M};Uv(M,g.swipeDirection,g.swipeThreshold)?Xl(QN,m,_,{discrete:!0}):Xl(YN,p,_,{discrete:!0}),B.addEventListener("click",P=>P.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),tC=e=>{const{__scopeToast:t,children:n,...r}=e,s=ru(vl,t),[o,a]=f.useState(!1),[l,c]=f.useState(!1);return sC(()=>a(!0)),f.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:i.jsx(tu,{asChild:!0,children:i.jsx(nu,{...r,children:o&&i.jsxs(i.Fragment,{children:[s.label," ",n]})})})},nC="ToastTitle",jw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(ie.div,{...r,ref:t})});jw.displayName=nC;var rC="ToastDescription",Pw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(ie.div,{...r,ref:t})});Pw.displayName=rC;var Rw="ToastAction",Ow=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?i.jsx(Mw,{altText:n,asChild:!0,children:i.jsx(Cp,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Rw}\`. Expected non-empty \`string\`.`),null)});Ow.displayName=Rw;var Iw="ToastClose",Cp=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=ZN(Iw,n);return i.jsx(Mw,{asChild:!0,children:i.jsx(ie.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,s.onClose)})})});Cp.displayName=Iw;var Mw=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return i.jsx(ie.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function Lw(e){const t=[];
vendor: 4,277 bytes, lines 41-66
41return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),oC(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const a=r.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...Lw(r))}}),t}function Xl(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?xw(s,o):s.dispatchEvent(o)}var Uv=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),o=r>s;return t==="left"||t==="right"?o&&r>n:!o&&s>n};function sC(e=()=>{}){const t=et(e);lt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function oC(e){return e.nodeType===e.ELEMENT_NODE}function iC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dh(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var aC=Aw,Dw=Nw,zw=_w,$w=jw,Fw=Pw,Bw=Ow,Uw=Cp;function Vw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Vw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Hw(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Vw(e))&&(r&&(r+=" "),r+=t);return r}const Vv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hv=Hw,su=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Hv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(d=>{const u=n==null?void 0:n[d],h=o==null?void 0:o[d];if(u===null)return null;const p=Vv(u)||Vv(h);return s[d][p]}),l=n&&Object.entries(n).reduce((d,u)=>{let[h,p]=u;return p===void 0||(d[h]=p),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:h,className:p,...m}=u;return Object.entries(m).every(x=>{let[g,w]=x;return Array.isArray(w)?w.includes({...o,...l}[g]):{...o,...l}[g]===w})?[...d,h,p]:d},[]);return Hv(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)};/** 42 * @license lucide-react v0.462.0 - ISC 43 * 44 * This source code is licensed under the ISC license. 45 * See the LICENSE file in the root directory of this source tree. 46 */const lC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xw=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** 47 * @license lucide-react v0.462.0 - ISC 48 * 49 * This source code is licensed under the ISC license. 50 * See the LICENSE file in the root directory of this source tree. 51 */var cC={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"};/** 52 * @license lucide-react v0.462.0 - ISC 53 * 54 * This source code is licensed under the ISC license. 55 * See the LICENSE file in the root directory of this source tree. 56 */const dC=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...l},c)=>f.createElement("svg",{ref:c,...cC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Xw("lucide",s),...l},[...a.map(([d,u])=>f.createElement(d,u)),...Array.isArray(o)?o:[o]]));/** 57 * @license lucide-react v0.462.0 - ISC 58 * 59 * This source code is licensed under the ISC license. 60 * See the LICENSE file in the root directory of this source tree. 61 */const Q=(e,t)=>{const n=f.forwardRef(({className:r,...s},o)=>f.createElement(dC,{ref:o,iconNode:t,className:Xw(`lucide-${lC(e)}`,r),...s}));return n.displayName=`${e}`,n};/** 62 * @license lucide-react v0.462.0 - ISC 63 * 64 * This source code is licensed under the ISC license. 65 * See the LICENSE file in the root directory of this source tree. 66 */const ln=Q("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l
66-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** 67 * @license lucide-react v0.462.0 - ISC 68 * 69 * This source code is licensed under the ISC license. 70 * See the LICENSE file in the root directory of this source tree. 71 */const qw=Q("ArrowDownRight",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);/** 72 * @license lucide-react v0.462.0 - ISC 73 * 74 * This source code is licensed under the ISC license. 75 * See the LICENSE file in the root directory of this source tree. 76 */const uC=Q("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** 77 * @license lucide-react v0.462.0 - ISC 78 * 79 * This source code is licensed under the ISC license. 80 * See the LICENSE file in the root directory of this source tree. 81 */const cd=Q("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 82 * @license lucide-react v0.462.0 - ISC 83 * 84 * This source code is licensed under the ISC license. 85 * See the LICENSE file in the root directory of this source tree. 86 */const Ua=Q("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** 87 * @license lucide-react v0.462.0 - ISC 88 * 89 * This source code is licensed under the ISC license. 90 * See the LICENSE file in the root directory of this source tree. 91 */const hC=Q("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** 92 * @license lucide-react v0.462.0 - ISC 93 * 94 * This source code is licensed under the ISC license. 95 * See the LICENSE file in the root directory of this source tree. 96 */const fC=Q("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** 97 * @license lucide-react v0.462.0 - ISC 98 * 99 * This source code is licensed under the ISC license. 100 * See the LICENSE file in the root directory of this source tree. 101 */const _p=Q("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** 102 * @license lucide-react v0.462.0 - ISC 103 * 104 * This source code is licensed under the ISC license. 105 * See the LICENSE file in the root directory of this source tree. 106 */const rn=Q("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** 107 * @license lucide-react v0.462.0 - ISC 108 * 109 * This source code is licensed under the ISC license. 110 * See the LICENSE file in the root directory of this source tree. 111 */const dd=Q("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** 112 * @license lucide-react v0.462.0 - ISC 113 * 114 * This source code is licensed under the ISC license. 115 * See the LICENSE file in the root directory of this source tree. 116 */const zf=Q("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 117 * @license lucide-react v0.462.0 - ISC 118 * 119 * This source code is licensed under the ISC license. 120 * See the LICENSE file in the root directory of this source tree. 121 */const ki=Q("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 122 * @license lucide-react v0.462.0 - ISC 123 * 124 * This source code is licensed under the ISC license. 125 * See the LICENSE file in the root directory of this source tree. 126 */const mC=Q("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/** 127 * @license lucide-react v0.462.0 - ISC 128 * 129 * This source code is licensed under the ISC license. 130 * See the LICENSE file in the root directory of this source tree. 131 */const jp=Q("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 132 * @license lucide-react v0.462.0 - ISC 133 * 134 * This source code is licensed under the ISC license. 135 * See the LICENSE file in the root directory of this source tree. 136 */const Gw=Q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 137 * @license lucide-react v0.462.0 - ISC 138 * 139 * This source code is licensed under the ISC license. 140 * See the LICENSE file in the root directory of this source tree. 141 */const Mo=Q("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 142 * @license lucide-react v0.462.0 - ISC 143 * 144 * This source code is licensed under the ISC license. 145 * See the LICENSE file in the root directory of this source tree. 146 */const pC=Q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 147 * @license lucide-react v0.462.0 - ISC 148 * 149 * This source code is licensed under the ISC license. 150 * See the LICENSE file in the root directory of this source tree. 151 */const gC=Q("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 152 * @license lucide-react v0.462.0 - ISC 153 * 154 * This source code is licensed under the ISC license. 155 * See the LICENSE file in the root directory of this source tree. 156 */const Xv=Q("CircleArrowDown",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]]);/** 157 * @license lucide-react v0.462.0 - ISC 158 * 159 * This source code is licensed under the ISC license. 160 * See the LICENSE file in the root directory of this source tree. 161 */const qv=Q("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/** 162 * @license lucide-react v0.462.0 - ISC 163 * 164 * This source code is licensed under the ISC license. 165 * See the LICENSE file in the root directory of this source tree. 166 */const Va=Q("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 167 * @license lucide-react v0.462.0 - ISC 168 * 169 * This source code is licensed under the ISC license. 170 * See the LICENSE file in the root directory of this source tree. 171 */const vC=Q("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 172 * @license lucide-react v0.462.0 - ISC 173 * 174 * This source code is licensed under the ISC license. 175 * See the LICENSE file in the root directory of this source tree. 176 */const Ww=Q("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 177 * @license lucide-react v0.462.0 - ISC 178 * 179 * This source code is licensed under the ISC license. 180 * See the LICENSE file in the root directory of this source tree. 181 */const yC=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 182 * @license lucide-react v0.462.0 - ISC 183 * 184 * This source code is licensed under the ISC license. 185 * See the LICENSE file in the root directory of this source tree. 186 */const xC=Q("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** 187 * @license lucide-react v0.462.0 - ISC 188 * 189 * This source code is licensed under the ISC license. 190 * See the LICENSE file in the root directory of this source tree. 191 */const Kw=Q("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/** 192 * @license lucide-react v0.462.0 - ISC 193 * 194 * This source code is licensed under the ISC license. 195 * See the LICENSE file in the root directory of this source tree.
196 */const Yw=Q("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 197 * @license lucide-react v0.462.0 - ISC 198 * 199 * This source code is licensed under the ISC license. 200 * See the LICENSE file in the root directory of this source tree. 201 */const Gv=Q("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** 202 * @license lucide-react v0.462.0 - ISC 203 * 204 * This source code is licensed under the ISC license. 205 * See the LICENSE file in the root directory of this source tree. 206 */const bC=Q("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** 207 * @license lucide-react v0.462.0 - ISC 208 * 209 * This source code is licensed under the ISC license. 210 * See the LICENSE file in the root directory of this source tree. 211 */const Wv=Q("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** 212 * @license lucide-react v0.462.0 - ISC 213 * 214 * This source code is licensed under the ISC license. 215 * See the LICENSE file in the root directory of this source tree. 216 */const Ha=Q("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 217 * @license lucide-react v0.462.0 - ISC 218 * 219 * This source code is licensed under the ISC license. 220 * See the LICENSE file in the root directory of this source tree. 221 */const wC=Q("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 222 * @license lucide-react v0.462.0 - ISC 223 * 224 * This source code is licensed under the ISC license. 225 * See the LICENSE file in the root directory of this source tree. 226 */const $f=Q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 227 * @license lucide-react v0.462.0 - ISC 228 * 229 * This source code is licensed under the ISC license. 230 * See the LICENSE file in the root directory of this source tree. 231 */const Ff=Q("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** 232 * @license lucide-react v0.462.0 - ISC 233 * 234 * This source code is licensed under the ISC license. 235 * See the LICENSE file in the root directory of this source tree. 236 */const ud=Q("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"}]]);/** 237 * @license lucide-react v0.462.0 - ISC 238 * 239 * This source code is licensed under the ISC license. 240 * See the LICENSE file in the root directory of this source tree. 241 */const Pp=Q("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/** 242 * @license lucide-react v0.462.0 - ISC 243 * 244 * This source code is licensed under the ISC license. 245 * See the LICENSE file in the root directory of this source tree. 246 */const Rp=Q("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 247 * @license lucide-react v0.462.0 - ISC 248 * 249 * This source code is licensed under the ISC license. 250 * See the LICENSE file in the root directory of this source tree. 251 */const kC=Q("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** 252 * @license lucide-react v0.462.0 - ISC 253 * 254 * This source code is licensed under the ISC license. 255 * See the LICENSE file in the root directory of this source tree.
256 */const SC=Q("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 257 * @license lucide-react v0.462.0 - ISC 258 * 259 * This source code is licensed under the ISC license. 260 * See the LICENSE file in the root directory of this source tree. 261 */const hd=Q("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 262 * @license lucide-react v0.462.0 - ISC 263 * 264 * This source code is licensed under the ISC license. 265 * See the LICENSE file in the root directory of this source tree. 266 */const Qw=Q("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 267 * @license lucide-react v0.462.0 - ISC 268 * 269 * This source code is licensed under the ISC license. 270 * See the LICENSE file in the root directory of this source tree. 271 */const Kv=Q("Medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]);/** 272 * @license lucide-react v0.462.0 - ISC 273 * 274 * This source code is licensed under the ISC license. 275 * See the LICENSE file in the root directory of this source tree. 276 */const TC=Q("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 277 * @license lucide-react v0.462.0 - ISC 278 * 279 * This source code is licensed under the ISC license. 280 * See the LICENSE file in the root directory of this source tree. 281 */const AC=Q("MessageSquare",[["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"}]]);/** 282 * @license lucide-react v0.462.0 - ISC 283 * 284 * This source code is licensed under the ISC license. 285 * See the LICENSE file in the root directory of this source tree. 286 */const Op=Q("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** 287 * @license lucide-react v0.462.0 - ISC 288 * 289 * This source code is licensed under the ISC license. 290 * See the LICENSE file in the root directory of this source tree. 291 */const EC=Q("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/** 292 * @license lucide-react v0.462.0 - ISC 293 * 294 * This source code is licensed under the ISC license. 295 * See the LICENSE file in the root directory of this source tree. 296 */const xa=Q("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 297 * @license lucide-react v0.462.0 - ISC 298 * 299 * This source code is licensed under the ISC license. 300 * See the LICENSE file in the root directory of this source tree. 301 */const NC=Q("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/** 302 * @license lucide-react v0.462.0 - ISC 303 * 304 * This source code is licensed under the ISC license. 305 * See the LICENSE file in the root directory of this source tree. 306 */const Ip=Q("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 307 * @license lucide-react v0.462.0 - ISC 308 * 309 * This source code is licensed under the ISC license. 310 * See the LICENSE file in the root directory of this source tree. 311 */const CC=Q("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3
311kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** 312 * @license lucide-react v0.462.0 - ISC 313 * 314 * This source code is licensed under the ISC license. 315 * See the LICENSE file in the root directory of this source tree. 316 */const Jw=Q("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/** 317 * @license lucide-react v0.462.0 - ISC 318 * 319 * This source code is licensed under the ISC license. 320 * See the LICENSE file in the root directory of this source tree. 321 */const _C=Q("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** 322 * @license lucide-react v0.462.0 - ISC 323 * 324 * This source code is licensed under the ISC license. 325 * See the LICENSE file in the root directory of this source tree. 326 */const jC=Q("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** 327 * @license lucide-react v0.462.0 - ISC 328 * 329 * This source code is licensed under the ISC license. 330 * See the LICENSE file in the root directory of this source tree. 331 */const PC=Q("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 332 * @license lucide-react v0.462.0 - ISC 333 * 334 * This source code is licensed under the ISC license. 335 * See the LICENSE file in the root directory of this source tree. 336 */const mi=Q("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** 337 * @license lucide-react v0.462.0 - ISC 338 * 339 * This source code is licensed under the ISC license. 340 * See the LICENSE file in the root directory of this source tree. 341 */const RC=Q("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 342 * @license lucide-react v0.462.0 - ISC 343 * 344 * This source code is licensed under the ISC license. 345 * See the LICENSE file in the root directory of this source tree. 346 */const OC=Q("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 347 * @license lucide-react v0.462.0 - ISC 348 * 349 * This source code is licensed under the ISC license. 350 * See the LICENSE file in the root directory of this source tree. 351 */const IC=Q("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"}]]);/** 352 * @license lucide-react v0.462.0 - ISC 353 * 354 * This source code is licensed under the ISC license. 355 * See the LICENSE file in the root directory of this source tree. 356 */const Mp=Q("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 357 * @license lucide-react v0.462.0 - ISC 358 * 359 * This source code is licensed under the ISC license. 360 * See the LICENSE file in the root directory of this source tree. 361 */const Yv=Q("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);/** 362 * @license lucide-react v0.462.0 - ISC 363 * 364 * This source code is licensed under the ISC license. 365 * See the LICENSE file in the root directory of this source tree. 366 */const Si=Q("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** 367 * @license lucide-react v0.462.0 - ISC 368 * 369 * This source code is licensed under the ISC license. 370 * See the LICENSE file in the root directory of this source tree. 371 */const Et=Q("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 372 * @license lucide-react v0.462.0 - ISC 373 * 374 * This source code is licensed under the ISC license. 375 * See the LICENSE file in the root directory of this source tree. 376 */const Xa=Q("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 377 * @license lucide-react v0.462.0 - ISC 378 * 379 * This source code is licensed under the ISC license. 380 * See the LICENSE file in the root directory of this source tree. 381 */const Lp=Q("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}
vendor: 8,536 bytes, lines 381-411
381],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** 382 * @license lucide-react v0.462.0 - ISC 383 * 384 * This source code is licensed under the ISC license. 385 * See the LICENSE file in the root directory of this source tree. 386 */const qs=Q("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 387 * @license lucide-react v0.462.0 - ISC 388 * 389 * This source code is licensed under the ISC license. 390 * See the LICENSE file in the root directory of this source tree. 391 */const Zw=Q("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/** 392 * @license lucide-react v0.462.0 - ISC 393 * 394 * This source code is licensed under the ISC license. 395 * See the LICENSE file in the root directory of this source tree. 396 */const MC=Q("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 397 * @license lucide-react v0.462.0 - ISC 398 * 399 * This source code is licensed under the ISC license. 400 * See the LICENSE file in the root directory of this source tree. 401 */const LC=Q("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/** 402 * @license lucide-react v0.462.0 - ISC 403 * 404 * This source code is licensed under the ISC license. 405 * See the LICENSE file in the root directory of this source tree. 406 */const Dp=Q("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 407 * @license lucide-react v0.462.0 - ISC 408 * 409 * This source code is licensed under the ISC license. 410 * See the LICENSE file in the root directory of this source tree. 411 */const Ge=Q("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),zp="-",DC=e=>{const t=$C(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const l=a.split(zp);return l[0]===""&&l.length!==1&&l.shift(),ek(l,t)||zC(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&r[a]?[...c,...r[a]]:c}}},ek=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?ek(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(zp);return(a=t.validators.find(({validator:l})=>l(o)))==null?void 0:a.classGroupId},Qv=/^\[(.+)\]$/,zC=e=>{if(Qv.test(e)){const t=Qv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},$C=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return BC(Object.entries(e.classGroups),n).forEach(([o,a])=>{Bf(a,r,o,t)}),r},Bf=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Jv(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(FC(s)){Bf(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{Bf(a,Jv(t,o),n,r)})})},Jv=(e,t)=>{let n=e;return t.split(zp).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},FC=e=>e.isThemeGetter,BC=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,l])=>[t+a,l])):o);return[n,s]}):e,UC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}},tk="!",VC=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,a=l=>{const c=[];let d=0,u=0,h;for(let w=0;w<l.length;w++){let v=l[w];if(d===0){if(v===s&&(r||l.slice(w,w+o)===t)){c.push(l.slice(u,w)),u=w+o;continue}if(v==="/"){h=w;continue}}v==="["?d++:v==="]"&&d--}const p=c.length===0?l:l.substring(u),m=p.startsWith(tk),x=m?p.substring(1):p,g=h&&h>u?h-u:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:a}):a},HC=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},XC=e=>({cache:UC(e.cacheSize),parseClassName:VC(e),...DC(e)}),qC=/\s+/,GC=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(qC);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{modifiers:u,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(d);let x=!!m,g=r(x?p.substring(0,m):p);if(!g){if(!x){l=d+(l.length>0?" "+l:l);continue}if(g=r(p),!g){l=d+(l.length>0?" "+l:l);continue}x=!1}const w=HC(u).join(":"),v=h?w+tk:w,y=v+g;if(o.includes(y))continue;o.push(y);const b=s(g,x);for(let k=0;k<b.length;++k){const S=b[k];o.push(v+S)}l=d+(l.length>0?" "+l:l)}return l};function WC(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=nk(t))&&(r&&(r+=" "),r+=n);return r}const nk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=nk(e[r]))&&(n&&(n+=" "),n+=t);return n};function KC(e,...t){let n,r,s,o=a;function a(c){const d=t.reduce((u,h)=>h(u),e());return n=XC(d),r=n.cache.get,s=n.cache.set,o=l,l(c)}function l(c){const d=r(c);if(d)return d;const u=GC(c,n);return s(c,u),u}return function(){return o(WC.apply(null,arguments))}}const je=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},rk=/^\[(?:([a-z-]+):)?(.+)\]$/i,YC=/^\d+\/\d+$/,QC=new Set(["px","full","screen"]),JC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,e_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,t_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,n_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jn=e=>Vo(e)||QC.has(e)||YC.test(e),Ar=e=>Ti(e,"length",d_),Vo=e=>!!e&&!Number.isNaN(Number(e)),uh=e=>Ti(e,"number",Vo),Hi=e=>!!e&&Number.isInteger(Number(e)),r_=e=>e.endsWith("%")&&Vo(e.slice(0,-1)),pe=e=>rk.test(e),Er=e=>JC.test(e),s_=new Set(["length","size","percentage"]),o_=e=>Ti(e,s_,sk),i_=e=>Ti(e,"position",sk),a_=new Set(["image","url"]),l_=e=>Ti(e,a_,h_),c_=e=>Ti(e,"",u_),Xi=()=>!0,Ti=(e,t,n)=>{const r=rk.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},d_=e=>ZC.test(e)&&!e_.test(e),sk=()=>!1,u_=e=>t_.test(e),h_=e=>n_.test(e),f_=()=>{const e=je("colors"),t=je("spacing"),n=je("blur"),r=je("brightness"),s=je("borderColor"),o=je("borderRadius"),a=je("borderSpacing"),l=je("borderWidth"),c=je("contrast"),d=je("grayscale"),u=je("hueRotate"),h=je("invert"),p=je("gap"),m=je("gradientColorStops"),x=je("gradientColorStopPositions"),g=je("inset"),w=je("margin"),v=je("opacity"),y=je("padding"),b=je("saturate"),k=je("scale"),S=je("sepia"),T=je("skew"),E=je("space"),j=je("translate"),N=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",pe,t],U=()=>[pe,t],V=()=>["",Jn,Ar],$=()=>["auto",Vo,pe],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",pe],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],re=()=>[Vo,pe];return{cacheSize:500,separator:":",theme:{colors:[Xi],spacing:[Jn,Ar],blur:["none","",Er,pe],brightness:re(),borderColor:[e],borderRadius:["n
411one","","full",Er,pe],borderSpacing:U(),borderWidth:V(),contrast:re(),grayscale:P(),hueRotate:re(),invert:P(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[r_,Ar],inset:F(),margin:F(),opacity:re(),padding:U(),saturate:re(),scale:re(),sepia:P(),skew:re(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",pe]}],container:["container"],columns:[{columns:[Er]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:[...M(),pe]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],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",Hi,pe]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",pe]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Hi,pe]}],"grid-cols":[{"grid-cols":[Xi]}],"col-start-end":[{col:["auto",{span:["full",Hi,pe]},pe]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Xi]}],"row-start-end":[{row:["auto",{span:[Hi,pe]},pe]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",pe]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[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":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",pe,t]}],"min-w":[{"min-w":[pe,t,"min","max","fit"]}],"max-w":[{"max-w":[pe,t,"none","full","min","max","fit","prose",{screen:[Er]},Er]}],h:[{h:[pe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[pe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Er,Ar]}
vendor: 4,087 bytes, line 411
411],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",uh]}],"font-family":[{font:[Xi]}],"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",pe]}],"line-clamp":[{"line-clamp":["none",Vo,uh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Jn,pe]}],"list-image":[{"list-image":["none",pe]}],"list-style-type":[{list:["none","disc","decimal",pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Jn,Ar]}],"underline-offset":[{"underline-offset":["auto",Jn,pe]}],"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:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe]}],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",pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),i_]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",o_]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},l_]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"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":[v]}],"border-style":[{border:[...L(),"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":[v]}],"divide-style":[{divide:L()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[Jn,pe]}],"outline-w":[{outline:[Jn,Ar]}],"outline-color":[{outline:[e]}
vendor: 8,109 bytes, line 411
411],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Jn,Ar]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Er,c_]}],"shadow-color":[{shadow:[Xi]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Er,pe]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[b]}],sepia:[{sepia:[S]}],"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":[h]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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",pe]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",pe]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Hi,pe]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",pe]}],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",pe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",pe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Jn,Ar,uh]}],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"]}}},m_=KC(f_);function D(...e){return m_(Hw(e))}const p_=aC,ok=f.forwardRef(({className:e,...t},n)=>i.jsx(Dw,{ref:n,className:D("fixed bottom-4 z-[100] flex max-h-screen w-full flex-col p-4 left-1/2 -translate-x-1/2 md:left-auto md:translate-x-0 md:right-4 md:max-w-[320px]",e),...t}));ok.displayName=Dw.displayName;const g_=su("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border py-2 px-3 pr-6 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-bottom-full cursor-pointer",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),ik=f.forwardRef(({className:e,variant:t,...n},r)=>i.jsx(zw,{ref:r,className:D(g_({variant:t}),e),...n}));ik.displayName=zw.displayName;const v_=f.forwardRef(({className:e,...t},n)=>i.jsx(Bw,{ref:n,className:D("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}));v_.displayName=Bw.displayName;const ak=f.forwardRef(({className:e,...t},n)=>i.jsx(Uw,{ref:n,className:D("absolute right-2 top-2 rounded-md p-1 text-foreground
411/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:i.jsx(Dp,{className:"h-4 w-4"})}));ak.displayName=Uw.displayName;const lk=f.forwardRef(({className:e,...t},n)=>i.jsx($w,{ref:n,className:D("text-sm font-semibold",e),...t}));lk.displayName=$w.displayName;const ck=f.forwardRef(({className:e,...t},n)=>i.jsx(Fw,{ref:n,className:D("text-sm opacity-90",e),...t}));ck.displayName=Fw.displayName;/** 412 * @remix-run/router v1.23.0 413 * 414 * Copyright (c) Remix Software Inc. 415 * 416 * This source code is licensed under the MIT license found in the 417 * LICENSE.md file in the root directory of this source tree. 418 * 419 * @license MIT 420 */function qa(){return qa=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},qa.apply(this,arguments)}var Wr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Wr||(Wr={}));const Zv="popstate";function y_(e){e===void 0&&(e={});function t(r,s){let{pathname:o,search:a,hash:l}=r.location;return Uf("",{pathname:o,search:a,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:fd(s)}return b_(t,n,null,e)}function We(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function dk(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function x_(){return Math.random().toString(36).substr(2,8)}function ey(e,t){return{usr:e.state,key:e.key,idx:t}}function Uf(e,t,n,r){return n===void 0&&(n=null),qa({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ai(t):t,{state:n,key:t&&t.key||r||x_()})}function fd(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 Ai(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 b_(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,a=s.history,l=Wr.Pop,c=null,d=u();d==null&&(d=0,a.replaceState(qa({},a.state,{idx:d}),""));function u(){return(a.state||{idx:null}).idx}function h(){l=Wr.Pop;let w=u(),v=w==null?null:w-d;d=w,c&&c({action:l,location:g.location,delta:v})}function p(w,v){l=Wr.Push;let y=Uf(g.location,w,v);d=u()+1;let b=ey(y,d),k=g.createHref(y);try{a.pushState(b,"",k)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(k)}o&&c&&c({action:l,location:g.location,delta:1})}function m(w,v){l=Wr.Replace;let y=Uf(g.location,w,v);d=u();let b=ey(y,d),k=g.createHref(y);a.replaceState(b,"",k),o&&c&&c({action:l,location:g.location,delta:0})}function x(w){let v=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof w=="string"?w:fd(w);return y=y.replace(/ $/,"%20"),We(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let g={get action(){return l},get location(){return e(s,a)},listen(w){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Zv,h),c=w,()=>{s.removeEventListener(Zv,h),c=null}},createHref(w){return t(s,w)},createURL:x,encodeLocation(w){let v=x(w);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:m,go(w){return a.go(w)}};return g}var ty;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ty||(ty={}));function w_(e,t,n){return n===void 0&&(n="/"),k_(e,t,n,!1)}function k_(e,t,n,r){let s=typeof t=="string"?Ai(t):t,o=$p(s.pathname||"/",n);if(o==null)return null;let a=uk(e);S_(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let d=I_(o);l=R_(a[c],d,r)}return l}function uk(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(o,a,l)=>{let c={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};c.relativePath.startsWith("/")&&(We(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
420id. 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=os([r,c.relativePath]),u=n.concat(c);o.children&&o.children.length>0&&(We(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),uk(o.children,t,u,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:j_(d,o.index),routesMeta:u})};return e.forEach((o,a)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,a);else for(let c of hk(o.path))s(o,a,c)}),t}function hk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let a=hk(r.join("/")),l=[];return l.push(...a.map(c=>c===""?o:[o,c].join("/"))),s&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function S_(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:P_(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const T_=/^:[\w-]+$/,A_=3,E_=2,N_=1,C_=10,__=-2,ny=e=>e==="*";function j_(e,t){let n=e.split("/"),r=n.length;return n.some(ny)&&(r+=__),t&&(r+=E_),n.filter(s=>!ny(s)).reduce((s,o)=>s+(T_.test(o)?A_:o===""?N_:C_),r)}function P_(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function R_(e,t,n){let{routesMeta:r}=e,s={},o="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",h=ry({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),p=c.route;if(!h&&d&&n&&!r[r.length-1].route.index&&(h=ry({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!h)return null;
vendor: 6,917 bytes, lines 420-429
420Object.assign(s,h.params),a.push({params:s,pathname:os([o,h.pathname]),pathnameBase:z_(os([o,h.pathnameBase])),route:p}),h.pathnameBase!=="/"&&(o=os([o,h.pathnameBase]))}return a}function ry(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=O_(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],a=o.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((d,u,h)=>{let{paramName:p,isOptional:m}=u;if(p==="*"){let g=l[h]||"";a=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"$1")}const x=l[h];return m&&!x?d[p]=void 0:d[p]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:a,pattern:e}}function O_(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),dk(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function I_(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return dk(!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 $p(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)||"/"}function M_(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Ai(e):e;return{pathname:n?n.startsWith("/")?n:L_(n,t):t,search:$_(r),hash:F_(s)}}function L_(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function hh(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function D_(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Fp(e,t){let n=D_(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Bp(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Ai(e):(s=qa({},e),We(!s.pathname||!s.pathname.includes("?"),hh("?","pathname","search",s)),We(!s.pathname||!s.pathname.includes("#"),hh("#","pathname","hash",s)),We(!s.search||!s.search.includes("#"),hh("#","search","hash",s)));let o=e===""||s.pathname==="",a=o?"/":s.pathname,l;if(a==null)l=n;else{let h=t.length-1;if(!r&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),h-=1;s.pathname=p.join("/")}l=h>=0?t[h]:"/"}let c=M_(s,l),d=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const os=e=>e.join("/").replace(/\/\/+/g,"/"),z_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,F_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function B_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const fk=["post","put","patch","delete"];new Set(fk);const U_=["get",...fk];new Set(U_);/** 421 * React Router v6.30.1 422 * 423 * Copyright (c) Remix Software Inc. 424 * 425 * This source code is licensed under the MIT license found in the 426 * LICENSE.md file in the root directory of this source tree. 427 * 428 * @license MIT 429 */function Ga(){return Ga=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},Ga.apply(this,arguments)}const Up=f.createContext(null),V_=f.createContext(null),bs=f.createContext(null),ou=f.createContext(null),xr=f.createContext({outlet:null,matches:[],isDataRoute:!1}),mk=f.createContext(null);function H_(e,t){let{relative:n}=t===void 0?{}:t;Ei()||We(!1);let{basename:r,navigator:s}=f.useContext(bs),{hash:o,pathname:a,search:l}=gk(e,{relative:n}),c=a;return r!=="/"&&(c=a==="/"?r:os([r,a])),s.createHref({pathname:c,search:l,hash:o})}function Ei(){return f.useContext(ou)!=null}function Wn(){return Ei()||We(!1),f.useContext(ou).location}function pk(e){f.useContext(bs).static||f.useLayoutEffect(e)}function Ni(){let{isDataRoute:e}=f.useContext(xr);return e?rj():X_()}function X_(){Ei()||We(!1);let e=f.useContext(Up),{basename:t,future:n,navigator:r}=f.useContext(bs),{matches:s}=f.useContext(xr),{pathname:o}=Wn(),a=JSON.stringify(Fp(s,n.v7_relativeSplatPath)),l=f.useRef(!1);return pk(()=>{l.current=!0}),f.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){r.go(d);return}let h=Bp(d,JSON.parse(a),o,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:os([t,h.pathname])),(u.replace?r.replace:r.push)(h,u.state,u)},[t,r,a,o,e])}function GF(){let{matches:e}=f.useContext(xr),t=e[e.length-1];return t?t.params:{}}function gk(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=f.useContext(bs),{matches:s}=f.useContext(xr),{pathname:o}=Wn(),a=JSON.stringify(Fp(s,r.v7_relativeSplatPath));return f.useMemo(()=>Bp(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function q_(e,t){return G_(e,t)}function G_(e,t,n,r){Ei()||We(!1);let{navigator:s}=f.useContext(bs),{matches:o}=f.useContext(xr),a=o[o.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let d=Wn(),u;if(t){var h;let w=typeof t=="string"?Ai(t):t;c==="/"||(h=w.pathname)!=null&&h.startsWith(c)||We(!1),u=w}else u=d;let p=u.pathname||"/",m=p;if(c!=="/"){let w=c.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(w.length).join("/")}let x=w_(e,{pathname:m}),g=J_(x&&x.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:os([c,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:os([c,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),o,n,r);return t&&g?f.createElement(ou.Provider,{value:{location:Ga({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Wr.Pop}},g):g}function W_(){let e=nj(),t=B_(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application
429Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:s},n):null,null)}const K_=f.createElement(W_,null);class Y_ extends f.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?f.createElement(xr.Provider,{value:this.props.routeContext},f.createElement(mk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Q_(e){let{routeContext:t,match:n,children:r}=e,s=f.useContext(Up);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(xr.Provider,{value:t},r)}function J_(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let u=a.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);u>=0||We(!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 h=a[u];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(d=u),h.route.id){let{loaderData:p,errors:m}=n,x=h.route.loader&&p[h.route.id]===void 0&&(!m||m[h.route.id]===void 0);if(h.route.lazy||x){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}return a.reduceRight((u,h,p)=>{let m,x=!1,g=null,w=null;n&&(m=l&&h.route.id?l[h.route.id]:void 0,g=h.route.errorElement||K_,c&&(d<0&&p===0?(x=!0,w=null):d===p&&(x=!0,w=h.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,p+1)),y=()=>{let b;return m?b=g:x?b=w:h.route.Component?b=f.createElement(h.route.Component,null):h.route.element?b=h.route.element:b=u,f.createElement(Q_,{match:h,routeContext:{outlet:u,matches:v,isDataRoute:n!=null},children:b})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?f.createElement(Y_,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:y(),routeC
429ontext:{outlet:null,matches:v,isDataRoute:!0}}):y()},null)}var vk=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(vk||{}),md=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}(md||{});function Z_(e){let t=f.useContext(Up);return t||We(!1),t}function ej(e){let t=f.useContext(V_);return t||We(!1),t}function tj(e){let t=f.useContext(xr);return t||We(!1),t}function yk(e){let t=tj(),n=t.matches[t.matches.length-1];return n.route.id||We(!1),n.route.id}function nj(){var e;let t=f.useContext(mk),n=ej(md.UseRouteError),r=yk(md.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function rj(){let{router:e}=Z_(vk.UseNavigateStable),t=yk(md.UseNavigateStable),n=f.useRef(!1);return pk(()=>{n.current=!0}),f.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Ga({fromRouteId:t},o)))},[e,t])}function sj(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function oj(e){let{to:t,replace:n,state:r,relative:s}=e;Ei()||We(!1);let{future:o,static:a}=f.useContext(bs),{matches:l}=f.useContext(xr),{pathname:c}=Wn(),d=Ni(),u=Bp(t,Fp(l,o.v7_relativeSplatPath),c,s==="path"),h=JSON.stringify(u);return f.useEffect(()=>d(JSON.parse(h),{replace:n,state:r,relative:s}),[d,h,s,n,r]),null}function fe(e){We(!1)}function ij(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Wr.Pop,navigator:o,static:a=!1,future:l}=e;Ei()&&We(!1);let c=t.replace(/^\/*/,"/"),d=f.useMemo(()=>({basename:c,navigator:o,static:a,future:Ga({v7_relativeSplatPath:!1},l)}),[c,l,o,a]);typeof r=="string"&&(r=Ai(r));let{pathname:u="/",search:h="",hash:p="",state:m=null,key:x="default"}=r,g=f.useMemo(()=>{let w=$p(u,c);return w==null?null:{location:{pathname:w,search:h,hash:p,state:m,key:x},navigationType:s}},[c,u,h,p,m,x,s]);return g==null?null:f.createElement(bs.Provider,{value:d},f.createElement(ou.Provider,{children:n,value:g}))}function aj(e){let{children:t,location:n}=e;return q_(Vf(t),n)}new Promise(()=>{});function Vf(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(r,s)=>{if(!f.isValidElement(r))return;let o=[...t,s];if(r.type===f.Fragment){n.push.apply(n,Vf(r.props.children,o));return}r.type!==fe&&We(!1),!r.props.index||!r.props.children||We(!1);let a={id:r.props.id||o.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=Vf(r.props.children,o)),n.push(a)}),n}/** 430 * React Router DOM v6.30.1 431 * 432 * Copyright (c) Remix Software Inc. 433 * 434 * This source code is licensed under the MIT license found in the 435 * LICENSE.md file in the root directory of this source tree. 436 * 437 * @license MIT 438 */function Hf(){return Hf=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},Hf.apply(this,arguments)}function lj(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o<r.length;o++)s=r[o],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function cj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dj(e,t){return e.button===0&&(!t||t==="_self")&&!cj(e)}function Xf(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function uj(e,t){let n=Xf(e);return t&&t.forEach((r,s)=>
438{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}const hj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],fj="6";try{window.__reactRouterVersion=fj}catch{}const mj="startTransition",sy=Mm[mj];function pj(e){let{basename:t,children:n,future:r,window:s}=e,o=f.useRef();o.current==null&&(o.current=y_({window:s,v5Compat:!0}));let a=o.current,[l,c]=f.useState({action:a.action,location:a.location}),{v7_startTransition:d}=r||{},u=f.useCallback(h=>{d&&sy?sy(()=>c(h)):c(h)},[c,d]);return f.useLayoutEffect(()=>a.listen(u),[a,u]),f.useEffect(()=>sj(r),[r]),f.createElement(ij,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:r})}const gj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ie=f.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:o,replace:a,state:l,target:c,to:d,preventScrollReset:u,viewTransition:h}=t,p=lj(t,hj),{basename:m}=f.useContext(bs),x,g=!1;if(typeof d=="string"&&vj.test(d)&&(x=d,gj))try{let b=new URL(window.location.href),k=d.startsWith("//")?new URL(b.protocol+d):new URL(d),S=$p(k.pathname,m);k.origin===b.origin&&S!=null?d=S+k.search+k.hash:g=!0}catch{}let w=H_(d,{relative:s}),v=yj(d,{replace:a,state:l,target:c,preventScrollReset:u,relative:s,viewTransition:h});function y(b){r&&r(b),b.defaultPrevented||v(b)}return f.createElement("a",Hf({},p,{href:x||w,onClick:g||o?r:y,ref:n,target:c}))});var oy;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(oy||(oy={}));var iy;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(iy||(iy={}));function yj(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:a,viewTransition:l}=t===void 0?{}:t,c=Ni(),d=Wn(),u=gk(e,{relative:a});return f.useCallback(h=>{if(dj(h,n)){h.preventDefault();let p=r!==void 0?r:fd(d)===fd(u);c(e,{replace:p,state:s,preventScrollReset:o,relative:a,viewTransition:l})}},[d,c,u,r,s,n,e,o,a,l])}function WF(e){let t=f.useRef(Xf(e)),n=f.useRef(!1),r=Wn(),s=f.useMemo(()=>uj(r.search,n.current?null:t.current),[r.search]),o=Ni(),a=f.useCallback((l,c)=>{const d=Xf(typeof l=="function"?l(s):l);n.current=!0,o("?"+d,c)},[o,s]);return[s,a]}function xj(){const{toasts:e,dismiss:t}=gN(),n=Ni(),r=s=>{t(s),n("/tape")};return i.jsxs(p_,{children:[e.map(function({id:s,title:o,description:a,action:l,...c}){return i.jsxs(ik,{...c,onClick:()=>r(s),children:[i.jsxs("div",{className:"grid gap-0.5",children:[o&&i.jsx(lk,{className:"text-xs",children:o}),a&&i.jsx(ck,{className:"text-[10px]",children:a})]}),l,i.jsx(ak,{})]},s)}),i.jsx(ok,{})]})}var ay=["light","dark"],bj="(prefers-color-scheme: dark)",wj=f.createContext(void 0),kj={setTheme:e=>{},themes:[]},Sj=()=>{var e;return(e=f.useContext(wj))!=null?e:kj};f.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:o,value:a,attrs:l,nonce:c})=>{let d=o==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(x=>`'${x}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=s?ay.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(x,g=!1,w=!0)=>{let v=a?a[x]:x,y=g?x+"|| ''":`'${v}'`,b="";return s&&w&&!g&&ay.includes(x)&&(b+=`d.style.colorScheme = '${x}';`),n==="class"?g||v?b+=`c.add(${y})`:b+="null":v&&(b+=`d[s](n,${y})`),b},m=e?`!function(){${u}${p(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${bj}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}${d?"":"else{"+p(o,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}else{${p(o,!1,!1)};}${h}}catch(t){}}();`;return f.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var Tj=e=>{switch(e){case"success":return Nj;case"info":return _j;case"warning":return Cj;case"error":return jj;default:return null}},Aj=Array(12).fill(0),Ej=({visible:e,className:t})=>X.createElement("div",{className:["sonner-loading-wrapper",t].filter(
438Boolean).join(" "),"data-visible":e},X.createElement("div",{className:"sonner-spinner"},Aj.map((n,r)=>X.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Nj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.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"})),Cj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},X.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"})),_j=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.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"})),jj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.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"})),Pj=X.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"},X.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),X.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Rj=()=>{let[e,t]=X.useState(document.hidden);return X.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},qf=1,Oj=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:qf++,o=this.toasts.find(l=>l.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:n}),{...l,...e,id:s,dismissible:a,title:n}):l):this.addToast({title:n,...r,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
438this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0,o,a=r.then(async c=>{if(o=["resolve",c],X.isValidElement(c))s=!1,this.create({id:n,type:"default",message:c});else if(Mj(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:d,description:u})}}).catch(async c=>{if(o=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>a.then(()=>o[0]==="reject"?d(o[1]):c(o[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)||qf++;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}},jt=new Oj,Ij=(e,t)=>{let n=(t==null?void 0:t.id)||qf++;return jt.addToast({title:e,...t,id:n}),n},Mj=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Lj=Ij,Dj=()=>jt.toasts,zj=()=>jt.getActiveToasts(),ke=Object.assign(Lj,{success:jt.success,info:jt.info,warning:jt.warning,error:jt.error,custom:jt.custom,message:jt.message,promise:jt.promise,dismiss:jt.dismiss,loading:jt.loading},{getHistory:Dj,getToasts:zj});function $j(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))}$j(`: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;
438left: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}
438: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%);
438--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%)} 439`);function ql(e){return e.label!==void 0}var Fj=3,Bj="32px",Uj="16px",ly=4e3,Vj=356,Hj=14,Xj=20,qj=200;function pn(...e){return e.filter(Boolean).join(" ")}function Gj(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Wj=e=>{var t,n,r,s,o,a,l,c,d,u,h;let{invert:p,toast:m,unstyled:x,interacting:g,setHeights:w,visibleToasts:v,heights:y,index:b,toasts:k,expanded:S,removeToast:T,defaultRichColors:E,closeButton:j,style:N,cancelButtonStyle:R,actionButtonStyle:F,className:U="",descriptionClassName:V="",duration:$,position:M,gap:L,loadingIcon:B,expandByDefault:_,classNames:P,icons:z,closeButtonAriaLabel:re="Close toast",pauseWhenPageIsHidden:Y}=e,[se,ee]=X.useState(null),[de,xe]=X.useState(null),[q,I]=X.useState(!1),[K,oe]=X.useState(!1),[ne,ae]=X.useState(!1),[Ne,nt]=X.useState(!1),[rt,Gt]=X.useState(!1),[On,Ss]=X.useState(0),[br,Mi]=X.useState(0),Ts=X.useRef(m.duration||$||ly),Tl=X.useRef(null),In=X.useRef(null),gt=b===0,kg=b+1<=v,Wt=m.type,ao=m.dismissible!==!1,_A=m.className||"",jA=m.descriptionClassName||"",Al=X.useMemo(()=>y.findIndex(he=>he.toastId===m.id)||0,[y,m.id]),PA=X.useMemo(()=>{var he;return(he=m.closeButton)!=null?he:j},[m.closeButton,j]),Sg=X.useMemo(()=>m.duration||$||ly,[m.duration,$]),Ou=X.useRef(0),lo=X.useRef(0),Tg=X.useRef(0),co=X.useRef(null),[RA,OA]=M.split("-"),Ag=X.useMemo(()=>y.reduce((he,Ae,Oe)=>Oe>=Al?he:he+Ae.height,0),[y,Al]),Eg=Rj(),IA=m.invert||p,Iu=Wt==="loading";lo.current=X.useMemo(()=>Al*L+Ag,[Al,Ag]),X.useEffect(()=>{Ts.current=Sg},[Sg]),X.useEffect(()=>{I(!0)},[]),X.useEffect(()=>{let he=In.current;if(he){let Ae=he.getBoundingClientRect().height;return Mi(Ae),w(Oe=>[{toastId:m.id,height:Ae,position:m.position},...Oe]),()=>w(Oe=>Oe.filter(un=>un.toastId!==m.id))}},[w,m.id]),X.useLayoutEffect(()=>{if(!q)return;let he=In.current,Ae=he.style.height;he.style.height="auto";let Oe=he.getBoundingClientRect().height;he.style.height=Ae,Mi(Oe),w(un=>un.find(hn=>hn.toastId===m.id)?un.map(hn=>hn.toastId===m.id?{...hn,height:Oe}:hn):[{toastId:m.id,height:Oe,position:m.position},...un])},[q,m.title,m.description,w,m.id]);let wr=X.useCallback(()=>{oe(!0),Ss(lo.current),w(he=>he.filter(Ae=>Ae.toastId!==m.id)),setTimeout(()=>{T(m)},qj)}
439,[m,T,w,lo]);X.useEffect(()=>{if(m.promise&&Wt==="loading"||m.duration===1/0||m.type==="loading")return;let he;return S||g||Y&&Eg?(()=>{if(Tg.current<Ou.current){let Ae=new Date().getTime()-Ou.current;Ts.current=Ts.current-Ae}Tg.current=new Date().getTime()})():Ts.current!==1/0&&(Ou.current=new Date().getTime(),he=setTimeout(()=>{var Ae;(Ae=m.onAutoClose)==null||Ae.call(m,m),wr()},Ts.current)),()=>clearTimeout(he)},[S,g,m,Wt,Y,Eg,wr]),X.useEffect(()=>{m.delete&&wr()},[wr,m.delete]);function MA(){var he,Ae,Oe;return z!=null&&z.loading?X.createElement("div",{className:pn(P==null?void 0:P.loader,(he=m==null?void 0:m.classNames)==null?void 0:he.loader,"sonner-loader"),"data-visible":Wt==="loading"},z.loading):B?X.createElement("div",{className:pn(P==null?void 0:P.loader,(Ae=m==null?void 0:m.classNames)==null?void 0:Ae.loader,"sonner-loader"),"data-visible":Wt==="loading"},B):X.createElement(Ej,{className:pn(P==null?void 0:P.loader,(Oe=m==null?void 0:m.classNames)==null?void 0:Oe.loader),visible:Wt==="loading"})}return X.createElement("li",{tabIndex:0,ref:In,className:pn(U,_A,P==null?void 0:P.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,P==null?void 0:P.default,P==null?void 0:P[Wt],(n=m==null?void 0:m.classNames)==null?void 0:n[Wt]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:E,"data-styled":!(m.jsx||m.unstyled||x),"data-mounted":q,"data-promise":!!m.promise,"data-swiped":rt,"data-removed":K,"data-visible":kg,"data-y-position":RA,"data-x-position":OA,"data-index":b,"data-front":gt,"data-swiping":ne,"data-dismissible":ao,"data-type":Wt,"data-invert":IA,"data-swipe-out":Ne,"data-swipe-direction":de,"data-expanded":!!(S||_&&q),style:{"--index":b,"--toasts-before":b,"--z-index":k.length-b,"--offset":`${K?On:lo.current}px`,"--initial-height":_?"auto":`${br}px`,...N,...m.style},onDragEnd:()=>{ae(!1),ee(null),co.current=null},onPointerDown:he=>{Iu||!ao||(Tl.current=new Date,Ss(lo.current),he.target.setPointerCapture(he.pointerId),he.target.tagName!=="BUTTON"&&(ae(!0),co.current={x:he.clientX,y:he.clientY}))},onPointerUp:()=>{var he,Ae,Oe,un;if(Ne||!ao)return;co.current=null;let hn=Number(((he=In.current)==null?void 0:he.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),kr=Number(((Ae=In.current)==null?void 0:Ae.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),As=new Date().getTime()-((Oe=Tl.current)==null?void 0:Oe.getTime()),fn=se==="x"?hn:kr,Sr=Math.abs(fn)/As;if(Math.abs(fn)>=Xj||Sr>.11){Ss(lo.current),(un=m.onDismiss)==null||un.call(m,m),xe(se==="x"?hn>0?"right":"left":kr>0?"down":"up"),wr(),nt(!0),Gt(!1);return}ae(!1),ee(null)},onPointerMove:he=>{var Ae,Oe,un,hn;if(!co.current||!ao||((Ae=window.getSelection())==null?void 0:Ae.toString().length)>0)return;let kr=he.clientY-co.current.y,As=he.clientX-co.current.x,fn=(Oe=e.swipeDirections)!=null?Oe:Gj(M);!se&&(Math.abs(As)>1||Math.abs(kr)>1)&&ee(Math.abs(As)>Math.abs(kr)?"x":"y");let Sr={x:0,y:0};se==="y"?(fn.includes("top")||fn.includes("bottom"))&&(fn.includes("top")&&kr<0||fn.includes("bottom")&&kr>0)&&(Sr.y=kr):se==="x"&&(fn.includes("left")||fn.includes("right"))&&(fn.includes("left")&&As<0||fn.includes("right")&&As>0)&&(Sr.x=As),(Math.abs(Sr.x)>0||Math.abs(Sr.y)>0)&&Gt(!0),(un=In.current)==null||un.style.setProperty("--swipe-amount-x",`${Sr.x}px`),(hn=In.current)==null||hn.style.setProperty("--swipe-amount-y",`${Sr.y}px`)}},PA&&!m.jsx?X.createElement("button",{"aria-label":re,"data-disabled":Iu,"data-close-button":!0,onClick:Iu||!ao?()=>{}:()=>{var he;wr(),(he=m.onDismiss)==null||he.call(m,m)},className:pn(P==null?void 0:P.closeButton,(s=m==null?void 0:m.classNames)==null?void 0:s.closeButton)},(o=z==null?void 0:z.close)!=null?o:Pj):null,m.jsx||f.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:X.createElement(X.Fragment,null,Wt||m.icon||m.promise?X.createElement("div",{"data-icon":"",className:pn(P==null?void 0:P.icon,(a=m==null?void 0:m.classNames)==null?void 0:a.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||MA():null,m.type!=="loading"?m.
439icon||(z==null?void 0:z[Wt])||Tj(Wt):null):null,X.createElement("div",{"data-content":"",className:pn(P==null?void 0:P.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},X.createElement("div",{"data-title":"",className:pn(P==null?void 0:P.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?X.createElement("div",{"data-description":"",className:pn(V,jA,P==null?void 0:P.description,(d=m==null?void 0:m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),f.isValidElement(m.cancel)?m.cancel:m.cancel&&ql(m.cancel)?X.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||R,onClick:he=>{var Ae,Oe;ql(m.cancel)&&ao&&((Oe=(Ae=m.cancel).onClick)==null||Oe.call(Ae,he),wr())},className:pn(P==null?void 0:P.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,f.isValidElement(m.action)?m.action:m.action&&ql(m.action)?X.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||F,onClick:he=>{var Ae,Oe;ql(m.action)&&((Oe=(Ae=m.action).onClick)==null||Oe.call(Ae,he),!he.defaultPrevented&&wr())},className:pn(P==null?void 0:P.actionButton,(h=m==null?void 0:m.classNames)==null?void 0:h.actionButton)},m.action.label):null))};function cy(){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 Kj(e,t){let n={};return[e,t].forEach((r,s)=>{let o=s===1,a=o?"--mobile-offset":"--offset",l=o?Uj:Bj;function c(d){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${a}-${d}`]=l:n[`${a}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}var Yj=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:h,duration:p,style:m,visibleToasts:x=Fj,toastOptions:g,dir:w=cy(),gap:v=Hj,loadingIcon:y,icons:b,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:S}=e,[T,E]=X.useState([]),j=X.useMemo(()=>Array.from(new Set([r].concat(T.filter(Y=>Y.position).map(Y=>Y.position)))),[T,r]),[N,R]=X.useState([]),[F,U]=X.useState(!1),[V,$]=X.useState(!1),[M,L]=X.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=X.useRef(null),_=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=X.useRef(null),z=X.useRef(!1),re=X.useCallback(Y=>{E(se=>{var ee;return(ee=se.find(de=>de.id===Y.id))!=null&&ee.delete||jt.dismiss(Y.id),se.filter(({id:de})=>de!==Y.id)})},[]);return X.useEffect(()=>jt.subscribe(Y=>{if(Y.dismiss){E(se=>se.map(ee=>ee.id===Y.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{pw.flushSync(()=>{E(se=>{let ee=se.findIndex(de=>de.id===Y.id);return ee!==-1?[...se.slice(0,ee),{...se[ee],...Y},...se.slice(ee+1)]:[Y,...se]})})})}),[]),X.useEffect(()=>{if(u!=="system"){L(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;let Y=window.matchMedia("(prefers-color-scheme: dark)");try{Y.addEventListener("change",({matches:se})=>{L(se?"dark":"light")})}catch{Y.addListener(({matches:ee})=>{try{L(ee?"dark":"light")}catch(de){console.error(de)}})}},[u]),X.useEffect(()=>{T.length<=1&&U(!1)},[T]),X.useEffect(()=>{let Y=se=>{var ee,de;s.every(xe=>se[xe]||se.code===xe)&&(U(!0),(ee=B.current)==null||ee.focus()),se.code==="Escape"&&(document.activeElement===B.current||(de=B.current)!=null&&de.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[s]),X.useEffect(()=>{if(B.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,z.current=!1)}},[B.current]),X.createElement("section",{ref:t,"aria-label":`${k} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((Y,se)=>{var ee;let[de,xe]=Y.split("-");return T.length?X.createElement("ol",{key:Y,dir:w==="auto"?cy():w,tabIndex:-1,ref:B,className:l,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":de,"data-lifted":F&&T.length>1&&!o,"data-x-position":xe,style:{"--front-toast-height":`${((ee=N[0])==null?void 0:ee.height)||0}px`,"--width":`${Vj}px`,"--gap":`${v}px`,...m,...Kj(c,d)},onBlur:q=>{z.current&&!q.currentTarget.contains(q.relatedTarget)&&(z.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||z.current||(z.current=!0,P.current=q.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{V||U(!1)},onDragEnd:()=>U(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},T.filter(q=>!q.position&&se===0||q.position===Y).map((q,I)=>{var K,oe;return X.createElement(Wj,{key:q.id,icons:b,index:I,toast:q,defaultRichColors:h,duration:(K=g==null?void 0:g.duration)!=null?K:p,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:x,closeButton:(oe=g==null?void 0:g.closeButton)!=null?oe:a,interacting:V,position:Y,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:re,toasts:T.filter(ne=>ne.position==q.position),heights:N.filter(ne=>ne.position==q.position),setHeights:R,expandByDefault:o,gap:v,loadingIcon:y,expanded:F,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections})})):null}))});const Qj=({...e})=>{const{theme:t="system"}=Sj();return i.jsx(Yj,{theme:t,className:"toaster group",position:"bottom-right",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})};var Jj=Mm[" useId ".trim().toString()]||(()=>{}),Zj=0;function ur(e){const[t,n]=f.useState(Jj());return lt(()=>{n(r=>r??String(Zj++))},[e]),t?`radix-${t}`:""}const eP=["top","right","bottom","left"],fs=Math.min,zt=Math.max,pd=Math.round,Gl=Math.floor,ms=e=>({x:e,y:e}
vendor: 5,025 bytes, line 439
439),tP={left:"right",right:"left",bottom:"top",top:"bottom"},nP={start:"end",end:"start"};function Gf(e,t,n){return zt(e,fs(t,n))}function gr(e,t){return typeof e=="function"?e(t):e}function vr(e){return e.split("-")[0]}function Ci(e){return e.split("-")[1]}function Vp(e){return e==="x"?"y":"x"}function Hp(e){return e==="y"?"height":"width"}function ps(e){return["top","bottom"].includes(vr(e))?"y":"x"}function Xp(e){return Vp(ps(e))}function rP(e,t,n){n===void 0&&(n=!1);const r=Ci(e),s=Xp(e),o=Hp(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=gd(a)),[a,gd(a)]}function sP(e){const t=gd(e);return[Wf(e),t,Wf(t)]}function Wf(e){return e.replace(/start|end/g,t=>nP[t])}function oP(e,t,n){const r=["left","right"],s=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?o:a;default:return[]}}function iP(e,t,n,r){const s=Ci(e);let o=oP(vr(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Wf)))),o}function gd(e){return e.replace(/left|right|bottom|top/g,t=>tP[t])}function aP(e){return{top:0,right:0,bottom:0,left:0,...e}}function xk(e){return typeof e!="number"?aP(e):{top:e,right:e,bottom:e,left:e}}function vd(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function dy(e,t,n){let{reference:r,floating:s}=e;const o=ps(t),a=Xp(t),l=Hp(a),c=vr(t),d=o==="y",u=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,p=r[l]/2-s[l]/2;let m;switch(c){case"top":m={x:u,y:r.y-s.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-s.width,y:h};break;default:m={x:r.x,y:r.y}}switch(Ci(t)){case"start":m[a]-=p*(n&&d?-1:1);break;case"end":m[a]+=p*(n&&d?-1:1);break}return m}const lP=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,l=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:h}=dy(d,r,c),p=r,m={},x=0;for(let g=0;g<l.length;g++){const{name:w,fn:v}=l[g],{x:y,y:b,data:k,reset:S}=await v({x:u,y:h,initialPlacement:r,placement:p,strategy:s,middlewareData:m,rects:d,platform:a,elements:{reference:e,floating:t}});u=y??u,h=b??h,m={...m,[w]:{...m[w],...k}},S&&x<=50&&(x++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(d=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):S.rects),{x:u,y:h}=dy(d,p,c)),g=-1)}return{x:u,y:h,placement:p,strategy:s,middlewareData:m}};async function Wa(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:a,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:p=!1,padding:m=0}=gr(t,e),x=xk(m),w=l[p?h==="floating"?"reference":"floating":h],v=vd(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),y=h==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),k=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},S=vd(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:b,strategy:c}):y);return{top:(v.top-S.top+x.top)/k.y,bottom:(S.bottom-v.bottom+x.bottom)/k.y,left:(v.left-S.left+x.left)/k.x,right:(S.right-v.right+x.right)/k.x}}const cP=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=gr(e,t)||{};if(d==null)return{};const h=xk(u),p={x:n,y:r},m=Xp(s),x=Hp(m),g=await a.getDimensions(d),w=m==="y",v=w?"top":"left",y=w?"bottom":"right",b=w?"clientHeight":"clientWidth",k=o.reference[x]+o.reference[m]-p[m]-o.floating[x],S=p[m]-o.reference[m],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let E=T?T[b]:0;(!E||!await(a.isElement==null?void 0:a.isElement(T)))&&(E=l.floating[b]||o.floating[x]);const j=k/2-S/2,N=E/2-g[x]/2-1,R=fs(h[v],N),F=fs(h[y],N),U=R,V=E-g[x]-F,$=E/2-g[x]/2+j,M=Gf(U,$,V),L=!c.arrow&&Ci(s)!=null&&$!==M&&o.reference[x]/2-($<U?R:F)-g[x]/2<0,B=L?$<U?$-U:$-V:0;return{[m]:p[m]+B,data:{[m]:M,centerOffset:$-M-B,...L&&{alignmentOffset:B}},reset:L}}}),dP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:g=!0,...w}=gr(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=vr(s),y=ps(l),b=vr(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=p||
vendor: 5,171 bytes, line 439
439(b||!g?[gd(l)]:sP(l)),T=x!=="none";!p&&T&&S.push(...iP(l,g,x,k));const E=[l,...S],j=await Wa(t,w),N=[];let R=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&N.push(j[v]),h){const $=rP(s,a,k);N.push(j[$[0]],j[$[1]])}if(R=[...R,{placement:s,overflows:N}],!N.every($=>$<=0)){var F,U;const $=(((F=o.flip)==null?void 0:F.index)||0)+1,M=E[$];if(M)return{data:{index:$,overflows:R},reset:{placement:M}};let L=(U=R.filter(B=>B.overflows[0]<=0).sort((B,_)=>B.overflows[1]-_.overflows[1])[0])==null?void 0:U.placement;if(!L)switch(m){case"bestFit":{var V;const B=(V=R.filter(_=>{if(T){const P=ps(_.placement);return P===y||P==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(P=>P>0).reduce((P,z)=>P+z,0)]).sort((_,P)=>_[1]-P[1])[0])==null?void 0:V[0];B&&(L=B);break}case"initialPlacement":L=l;break}if(s!==L)return{reset:{placement:L}}}return{}}}};function uy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hy(e){return eP.some(t=>e[t]>=0)}const uP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=gr(e,t);switch(r){case"referenceHidden":{const o=await Wa(t,{...s,elementContext:"reference"}),a=uy(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:hy(a)}}}case"escaped":{const o=await Wa(t,{...s,altBoundary:!0}),a=uy(o,n.floating);return{data:{escapedOffsets:a,escaped:hy(a)}}}default:return{}}}}};async function hP(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=vr(n),l=Ci(n),c=ps(n)==="y",d=["left","top"].includes(a)?-1:1,u=o&&c?-1:1,h=gr(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof x=="number"&&(m=l==="end"?x*-1:x),c?{x:m*u,y:p*d}:{x:p*d,y:m*u}}const fP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:l}=t,c=await hP(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:a}}}}},mP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:w=>{let{x:v,y}=w;return{x:v,y}}},...c}=gr(e,t),d={x:n,y:r},u=await Wa(t,c),h=ps(vr(s)),p=Vp(h);let m=d[p],x=d[h];if(o){const w=p==="y"?"top":"left",v=p==="y"?"bottom":"right",y=m+u[w],b=m-u[v];m=Gf(y,m,b)}if(a){const w=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=x+u[w],b=x-u[v];x=Gf(y,x,b)}const g=l.fn({...t,[p]:m,[h]:x});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[h]:a}}}}}},pP=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=gr(e,t),u={x:n,y:r},h=ps(s),p=Vp(h);let m=u[p],x=u[h];const g=gr(l,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const b=p==="y"?"height":"width",k=o.reference[p]-o.floating[b]+w.mainAxis,S=o.reference[p]+o.reference[b]-w.mainAxis;m<k?m=k:m>S&&(m=S)}if(d){var v,y;const b=p==="y"?"width":"height",k=["top","left"].includes(vr(s)),S=o.reference[h]-o.floating[b]+(k&&((v=a.offset)==null?void 0:v[h])||0)+(k?0:w.crossAxis),T=o.reference[h]+o.reference[b]+(k?0:((y=a.offset)==null?void 0:y[h])||0)-(k?w.crossAxis:0);x<S?x=S:x>T&&(x=T)}return{[p]:m,[h]:x}}}},gP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:a,elements:l}=t,{apply:c=()=>{},...d}=gr(e,t),u=await Wa(t,d),h=vr(s),p=Ci(s),m=ps(s)==="y",{width:x,height:g}=o.floating;let w,v;h==="top"||h==="bottom"?(w=h,v=p===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(v=h,w=p==="end"?"top":"bottom");const y=g-u.top-u.bottom,b=x-u.left-u.right,k=fs(g-u[w],y),S=fs(x-u[v],b),T=!t.middlewareData.shift;let E=k,j=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=y),T&&!p){const R=zt(u.left,0),F=zt(u.right,0),U=zt(u.top,0),V=zt(u.bottom,0);m?j=x-2*(R!==0||F!==0?R+F:zt(u.left,u.right)):E=g-2*(U!==0||V!==0?U+V:zt(u.top,u.bottom))}await c({...t,availableWidth:j,availableHeight:E});const N=await a.getDimensions(l.floating);return x!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function iu(){return typeof window<"u"}function _i(e){return bk(e)?(e.nodeName||"").toLowerCase():"#document"}function Ut(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Kn(e){var t;return(t=(bk(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bk(e){return iu()?e instanceof Node||e instanceof Ut(e).Node:!1}function jn(e){return iu()?e instanceof Element||e instanceof Ut(e).Element:!1}function Gn(e){return iu()?e instanceof HTMLElement||e instanceof Ut(e).HTMLElement:!1}function fy(e){return!iu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ut(e).ShadowRoot}function yl(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Pn(e);
vendor: 1,939 bytes, line 439
439return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function vP(e){return["table","td","th"].includes(_i(e))}function au(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function qp(e){const t=Gp(),n=jn(e)?Pn(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function yP(e){let t=gs(e);for(;Gn(t)&&!pi(t);){if(qp(t))return t;if(au(t))return null;t=gs(t)}return null}function Gp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pi(e){return["html","body","#document"].includes(_i(e))}function Pn(e){return Ut(e).getComputedStyle(e)}function lu(e){return jn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gs(e){if(_i(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fy(e)&&e.host||Kn(e);return fy(t)?t.host:t}function wk(e){const t=gs(e);return pi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gn(t)&&yl(t)?t:wk(t)}function Ka(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=wk(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=Ut(s);if(o){const l=Kf(a);return t.concat(a,a.visualViewport||[],yl(s)?s:[],l&&n?Ka(l):[])}return t.concat(s,Ka(s,[],n))}function Kf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function kk(e){const t=Pn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Gn(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,l=pd(n)!==o||pd(r)!==a;return l&&(n=o,r=a),{width:n,height:r,$:l}}function Wp(e){return jn(e)?e:e.contextElement}function Ho(e){const t=Wp(e);if(!Gn(t))return ms(1);
vendor: 6,395 bytes, line 439
439const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=kk(t);let a=(o?pd(n.width):n.width)/r,l=(o?pd(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const xP=ms(0);function Sk(e){const t=Ut(e);return!Gp()||!t.visualViewport?xP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bP(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ut(e)?!1:t}function Zs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Wp(e);let a=ms(1);t&&(r?jn(r)&&(a=Ho(r)):a=Ho(e));const l=bP(o,n,r)?Sk(o):ms(0);let c=(s.left+l.x)/a.x,d=(s.top+l.y)/a.y,u=s.width/a.x,h=s.height/a.y;if(o){const p=Ut(o),m=r&&jn(r)?Ut(r):r;let x=p,g=Kf(x);for(;g&&r&&m!==x;){const w=Ho(g),v=g.getBoundingClientRect(),y=Pn(g),b=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*w.x,k=v.top+(g.clientTop+parseFloat(y.paddingTop))*w.y;c*=w.x,d*=w.y,u*=w.x,h*=w.y,c+=b,d+=k,x=Ut(g),g=Kf(x)}}return vd({width:u,height:h,x:c,y:d})}function wP(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=Kn(r),l=t?au(t.floating):!1;if(r===a||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=ms(1);const u=ms(0),h=Gn(r);if((h||!h&&!o)&&((_i(r)!=="body"||yl(a))&&(c=lu(r)),Gn(r))){const p=Zs(r);d=Ho(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x,y:n.y*d.y-c.scrollTop*d.y+u.y}}function kP(e){return Array.from(e.getClientRects())}function Yf(e,t){const n=lu(e).scrollLeft;return t?t.left+n:Zs(Kn(e)).left+n}function SP(e){const t=Kn(e),n=lu(e),r=e.ownerDocument.body,s=zt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=zt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Yf(e);const l=-n.scrollTop;return Pn(r).direction==="rtl"&&(a+=zt(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:l}}function TP(e,t){const n=Ut(e),r=Kn(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,l=0,c=0;if(s){o=s.width,a=s.height;const d=Gp();(!d||d&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:o,height:a,x:l,y:c}}function AP(e,t){const n=Zs(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Gn(e)?Ho(e):ms(1),a=e.clientWidth*o.x,l=e.clientHeight*o.y,c=s*o.x,d=r*o.y;return{width:a,height:l,x:c,y:d}}function my(e,t,n){let r;if(t==="viewport")r=TP(e,n);else if(t==="document")r=SP(Kn(e));else if(jn(t))r=AP(t,n);else{const s=Sk(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return vd(r)}function Tk(e,t){const n=gs(e);return n===t||!jn(n)||pi(n)?!1:Pn(n).position==="fixed"||Tk(n,t)}function EP(e,t){const n=t.get(e);if(n)return n;let r=Ka(e,[],!1).filter(l=>jn(l)&&_i(l)!=="body"),s=null;const o=Pn(e).position==="fixed";let a=o?gs(e):e;for(;jn(a)&&!pi(a);){const l=Pn(a),c=qp(a);!c&&l.position==="fixed"&&(s=null),(o?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||yl(a)&&!c&&Tk(e,a))?r=r.filter(u=>u!==a):s=l,a=gs(a)}return t.set(e,r),r}function NP(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?au(t)?[]:EP(t,this._c):[].concat(n),r],l=a[0],c=a.reduce((d,u)=>{const h=my(t,u,s);return d.top=zt(h.top,d.top),d.right=fs(h.right,d.right),d.bottom=fs(h.bottom,d.bottom),d.left=zt(h.left,d.left),d},my(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function CP(e){const{width:t,height:n}=kk(e);return{width:t,height:n}}function _P(e,t,n){const r=Gn(t),s=Kn(t),o=n==="fixed",a=Zs(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=ms(0);if(r||!r&&!o)if((_i(t)!=="body"||yl(s))&&(l=lu(t)),r){const m=Zs(t,!0,o,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&(c.x=Yf(s));let d=0,u=0;if(s&&!r&&!o){const m=s.getBoundingClientRect();u=m.top+l.scrollTop,d=m.left+l.scrollLeft-Yf(s,m)}const h=a.left+l.scrollLeft-c.x-d,p=a.top+l.scrollTop-c.y-u;return{x:h,y:p,width:a.width,height:a.height}}function fh(e){return Pn(e).position==="static"}function py(e,t){if(!Gn(e)||Pn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Kn(e)===n&&(n=n.ownerDocument.body),n}function Ak(e,t){const n=Ut(e);if(au(e))return n;if(!Gn(e)){let s=gs(e);for(;s&&!pi(s);){if(jn(s)&&!fh(s))return s;s=gs(s)}return n}let r=py(e,t);for(;r&&vP(r)&&fh(r);)r=py(r,t);return r&&pi(r)&&fh(r)&&!qp(r)?n:r||yP(e)||n}const jP=async function(e){const t=this.getOffsetParent||Ak,n=this.getDimensions,r=await n(e.floating);return{reference:_P(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function PP(e){return Pn(e).direction==="rtl"}const RP={convertOffsetParentRelativeRectToViewportRelativeRect:wP,getDocumentElement:Kn,getClippingRect:NP,getOffsetParent:Ak,getElementRects:jP,getClientRects:kP,getDimensions:CP,getScale:Ho,isElement:jn,isRTL:PP};function OP(e,t){let n=null,r;const s=Kn(e);function o(){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),o();const{left:d,top:u,width:h,height:p}=e.getBoundingClientRect();if(l||t(),!h||!p)return;const m=Gl(u),x=Gl(s.clientWidth-(d+h)),g=Gl(s.clientHeight-(u+p)),w=Gl(d),y={rootMargin:-m+"px "+-x+"px "+-g+"px "+-w+"px",threshold:zt(0,fs(1,c))||1};let b=!0;function k(S){const T=S[0].intersectionRatio;if(T!==c){if(!b)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(k,{...y,root:s.ownerDocument})}catch{n=new IntersectionObserver(k,y)}n.observe(e)}return a(!0),o}function IP(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Wp(e),u=s||o?[...d?Ka(d):[],...Ka(t)]:[];u.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const h=d&&l?OP(d,n):null;let p=-1,m=null;a&&(m=new ResizeObserver(v=>{let[y]=v;y&&y.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),d&&!c&&m.observe(d),m.observe(t));let x,g=c?Zs(e):null;c&&w();function w(){const v=Zs(e);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&n(),g=v,x=requestAnimationFrame(w)}return n(),()=>{var v;u.forEach(y=>{s&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),h==null||h(),(v=m)==null||v.disconnect(),m=null,c&&cancelAnimationFrame(x)}}
vendor: 4,111 bytes, line 439
439const MP=fP,LP=mP,DP=dP,zP=gP,$P=uP,gy=cP,FP=pP,BP=(e,t,n)=>{const r=new Map,s={platform:RP,...n},o={...s.platform,_c:r};return lP(e,t,{...s,platform:o})};var jc=typeof document<"u"?f.useLayoutEffect:f.useEffect;function yd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yd(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!yd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Ek(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vy(e,t){const n=Ek(e);return Math.round(t*n)/n}function mh(e){const t=f.useRef(e);return jc(()=>{t.current=e}),t}function UP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,h]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);yd(p,r)||m(r);const[x,g]=f.useState(null),[w,v]=f.useState(null),y=f.useCallback(_=>{_!==T.current&&(T.current=_,g(_))},[]),b=f.useCallback(_=>{_!==E.current&&(E.current=_,v(_))},[]),k=o||x,S=a||w,T=f.useRef(null),E=f.useRef(null),j=f.useRef(u),N=c!=null,R=mh(c),F=mh(s),U=mh(d),V=f.useCallback(()=>{if(!T.current||!E.current)return;const _={placement:t,strategy:n,middleware:p};F.current&&(_.platform=F.current),BP(T.current,E.current,_).then(P=>{const z={...P,isPositioned:U.current!==!1};$.current&&!yd(j.current,z)&&(j.current=z,oo.flushSync(()=>{h(z)}))})},[p,t,n,F,U]);jc(()=>{d===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,h(_=>({..._,isPositioned:!1})))},[d]);const $=f.useRef(!1);jc(()=>($.current=!0,()=>{$.current=!1}),[]),jc(()=>{if(k&&(T.current=k),S&&(E.current=S),k&&S){if(R.current)return R.current(k,S,V);V()}},[k,S,V,R,N]);const M=f.useMemo(()=>({reference:T,floating:E,setReference:y,setFloating:b}),[y,b]),L=f.useMemo(()=>({reference:k,floating:S}),[k,S]),B=f.useMemo(()=>{const _={position:n,left:0,top:0};if(!L.floating)return _;const P=vy(L.floating,u.x),z=vy(L.floating,u.y);return l?{..._,transform:"translate("+P+"px, "+z+"px)",...Ek(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:z}},[n,l,L.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:V,refs:M,elements:L,floatingStyles:B}),[u,V,M,L,B])}const VP=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?gy({element:r.current,padding:s}).fn(n):{}:r?gy({element:r,padding:s}).fn(n):{}}}},HP=(e,t)=>({...MP(e),options:[e,t]}),XP=(e,t)=>({...LP(e),options:[e,t]}),qP=(e,t)=>({...FP(e),options:[e,t]}),GP=(e,t)=>({...DP(e),options:[e,t]}),WP=(e,t)=>({...zP(e),options:[e,t]}),KP=(e,t)=>({...$P(e),options:[e,t]}),YP=(e,t)=>({...VP(e),options:[e,t]});var QP="Arrow",Nk=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return i.jsx(ie.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});Nk.displayName=QP;var JP=Nk;function cu(e){const[t,n]=f.useState(void 0);return lt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,l;if("borderBoxSize"in o){const c=o.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 Kp="Popper",[Ck,du]=qt(Kp),[ZP,_k]=Ck(Kp),jk=e=>{const{__scopePopper:t,children:n}=e,[r,s]=f.useState(null);return i.jsx(ZP,{scope:t,anchor:r,onAnchorChange:s,children:n})};jk.displayName=Kp;var Pk="PopperAnchor",Rk=f.forwardRef((e,t)=>
439{const{__scopePopper:n,virtualRef:r,...s}=e,o=_k(Pk,n),a=f.useRef(null),l=me(t,a);return f.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:i.jsx(ie.div,{...s,ref:l})});Rk.displayName=Pk;var Yp="PopperContent",[eR,tR]=Ck(Yp),Ok=f.forwardRef((e,t)=>{var q,I,K,oe,ne,ae;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:x,...g}=e,w=_k(Yp,n),[v,y]=f.useState(null),b=me(t,Ne=>y(Ne)),[k,S]=f.useState(null),T=cu(k),E=(T==null?void 0:T.width)??0,j=(T==null?void 0:T.height)??0,N=r+(o!=="center"?"-"+o:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},F=Array.isArray(d)?d:[d],U=F.length>0,V={padding:R,boundary:F.filter(rR),altBoundary:U},{refs:$,floatingStyles:M,placement:L,isPositioned:B,middlewareData:_}=UP({strategy:"fixed",placement:N,whileElementsMounted:(...Ne)=>IP(...Ne,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[HP({mainAxis:s+j,alignmentAxis:a}),c&&XP({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?qP():void 0,...V}),c&&GP({...V}),WP({...V,apply:({elements:Ne,rects:nt,availableWidth:rt,availableHeight:Gt})=>{const{width:On,height:Ss}=nt.reference,br=Ne.floating.style;br.setProperty("--radix-popper-available-width",`${rt}px`),br.setProperty("--radix-popper-available-height",`${Gt}px`),br.setProperty("--radix-popper-anchor-width",`${On}px`),br.setProperty("--radix-popper-anchor-height",`${Ss}px`)}}),k&&YP({element:k,padding:l}),sR({arrowWidth:E,arrowHeight:j}),p&&KP({strategy:"referenceHidden",...V})]}),[P,z]=Lk(L),re=et(x);lt(()=>{B&&(re==null||re())},[B,re]);const Y=(q=_.arrow)==null?void 0:q.x,se=(I=_.arrow)==null?void 0:I.y,ee=((K=_.arrow)==null?void 0:K.centerOffset)!==0,[de,xe]=f.useState();return lt(()=>{v&&xe(window.getComputedStyle(v).zIndex)},[v]),i.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:B?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(oe=_.transformOrigin)==null?void 0:oe.x,(ne=_.transformOrigin)==null?void 0:ne.y].join(" "),...((ae=_.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(eR,{scope:n,placedSide:P,onArrowChange:S,arrowX:Y,arrowY:se,shouldHideArrow:ee,children:i.jsx(ie.div,{"data-side":P,"data-align":z,...g,ref:b,style:{...g.style,animation:B?void 0:"none"}})})})});Ok.displayName=Yp;var Ik="PopperArrow",nR={top:"bottom",right:"left",bottom:"top",left:"right"},Mk=f.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=tR(Ik,r),a=nR[o.placedSide];return i.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i.jsx(JP,{...s,ref:n,style:{...s.style,display:"block"}})})});Mk.displayName=Ik;function rR(e){return e!==null}var sR=e=>({name:"transformOrigin",options:e,fn(t){var w,v,y;const{placement:n,rects:r,middlewareData:s}=t,a=((w=s.arrow)==null?void 0:w.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,u]=Lk(n),h={start:"0%",center:"50%",end:"100%"}[u],p=(((v=s.arrow)==null?void 0:v.x)??0)+l/2,m=(((y=s.arrow)==null?void 0:y.y)??0)+c/2;let x="",g="";return d==="bottom"?(x=a?h:`${p}px`,g=`${-c}px`):d==="top"?(x=a?h:`${p}px`,g=`${r.floating.height+c}px`):d==="right"?(x=`${-c}px`,g=a?h:`${m}px`):d==="left"&&(x=`${r.floating.width+c}px`,g=a?h:`${m}px`),{data:{x,y:g}}}});function Lk(e){const[t,n="center"]=e.split("-");return[t,n]}var Dk=jk,zk=Rk,$k=Ok,Fk=Mk,[uu,KF]=qt("Tooltip",[du]),hu=du(),Bk="TooltipProvider",oR=700,Qf="tooltip.open",[iR,Qp]=uu(Bk),Uk=e=>{const{__scopeTooltip:t,delayDuration:n=oR,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,a=f.useRef(!0),l=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),i.jsx(iR,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:f.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:o})};Uk.displayName=Bk;var Ya="Tooltip",[aR,fu]=uu(Ya),Vk=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:o,disableHoverableContent:a,delayDuration:l}=e,c=Qp(Ya,e.__scopeTooltip),d=hu(t),[u,h]=f.useState(null),p=ur(),m=f.useRef(0),x=a??c.disableHoverableContent,g=l??c.delayDuration,w=f.useRef(!1),[v,y]=qn({prop:r,defaultProp:s??!1,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Qf))):c.onClose(),o==null||o(E)},caller:Ya}),b=f.useMemo(()=>v?w.current?"delayed-open":"instant-open":"closed",[v]),k=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w.current=!1,y(!0)},[y]),S=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),T=f.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,y(!0),m.current=0},g)},[g,y]);return f.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),i.jsx(Dk,{...d,children:i.jsx(aR,{scope:t,contentId:p,open:v,stateAttribute:b,trigger:u,onTriggerChange:h,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayedRef.current?T():k()},[c.isOpenDelayedRef,T,k]),onTriggerLeave:f.useCallback(()=>{x?S():(window.clearTimeout(m.current),m.current=0)},[S,x]),onOpen:k,onClose:S,disableHoverableContent:x,children:n})})};Vk.displayName=Ya;var Jf="TooltipTrigger",Hk=f.forwardRef((e,t)=>
vendor: 5,616 bytes, line 439
439{const{__scopeTooltip:n,...r}=e,s=fu(Jf,n),o=Qp(Jf,n),a=hu(n),l=f.useRef(null),c=me(t,l,s.onTriggerChange),d=f.useRef(!1),u=f.useRef(!1),h=f.useCallback(()=>d.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),i.jsx(zk,{asChild:!0,...a,children:i.jsx(ie.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Z(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:Z(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:Z(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Z(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Z(e.onBlur,s.onClose),onClick:Z(e.onClick,s.onClose)})})});Hk.displayName=Jf;var lR="TooltipPortal",[YF,cR]=uu(lR,{forceMount:void 0}),gi="TooltipContent",Xk=f.forwardRef((e,t)=>{const n=cR(gi,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,a=fu(gi,e.__scopeTooltip);return i.jsx(cn,{present:r||a.open,children:a.disableHoverableContent?i.jsx(qk,{side:s,...o,ref:t}):i.jsx(dR,{side:s,...o,ref:t})})}),dR=f.forwardRef((e,t)=>{const n=fu(gi,e.__scopeTooltip),r=Qp(gi,e.__scopeTooltip),s=f.useRef(null),o=me(t,s),[a,l]=f.useState(null),{trigger:c,onClose:d}=n,u=s.current,{onPointerInTransitChange:h}=r,p=f.useCallback(()=>{l(null),h(!1)},[h]),m=f.useCallback((x,g)=>{const w=x.currentTarget,v={x:x.clientX,y:x.clientY},y=pR(v,w.getBoundingClientRect()),b=gR(v,y),k=vR(g.getBoundingClientRect()),S=xR([...b,...k]);l(S),h(!0)},[h]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(c&&u){const x=w=>m(w,u),g=w=>m(w,c);return c.addEventListener("pointerleave",x),u.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",g)}}},[c,u,m,p]),f.useEffect(()=>{if(a){const x=g=>{const w=g.target,v={x:g.clientX,y:g.clientY},y=(c==null?void 0:c.contains(w))||(u==null?void 0:u.contains(w)),b=!yR(v,a);y?p():b&&(p(),d())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,u,a,d,p]),i.jsx(qk,{...e,ref:o})}),[uR,hR]=uu(Ya,{isInside:!1}),fR=wN("TooltipContent"),qk=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...l}=e,c=fu(gi,n),d=hu(n),{onClose:u}=c;return f.useEffect(()=>(document.addEventListener(Qf,u),()=>document.removeEventListener(Qf,u)),[u]),f.useEffect(()=>{if(c.trigger){const h=p=>{const m=p.target;m!=null&&m.contains(c.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,u]),i.jsx(gl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:i.jsxs($k,{"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:[i.jsx(fR,{children:r}),i.jsx(uR,{scope:n,isInside:!0,children:i.jsx(VN,{id:c.contentId,role:"tooltip",children:s||r})})]})})});Xk.displayName=gi;var Gk="TooltipArrow",mR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=hu(n);return hR(Gk,n).isInside?null:i.jsx(Fk,{...s,...r,ref:t})});mR.displayName=Gk;function pR(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function gR(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 vR(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function yR(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],c=t[a],d=l.x,u=l.y,h=c.x,p=c.y;u>r!=p>r&&n<(h-d)*(r-u)/(p-u)+d&&(s=!s)}return s}function xR(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),bR(t)}function bR(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var wR=Uk,kR=Vk,SR=Hk,Wk=Xk;const Kk=wR,TR=kR,AR=SR,Yk=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(Wk,{ref:r,sideOffset:t,className:D("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]:sli
439de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Yk.displayName=Wk.displayName;var mu=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(){}},Ds,Fr,Qo,W0,ER=(W0=class extends mu{constructor(){super();we(this,Ds);we(this,Fr);we(this,Qo);ue(this,Qo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){O(this,Fr)||this.setEventListener(O(this,Qo))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,Fr))==null||t.call(this),ue(this,Fr,void 0))}setEventListener(t){var n;ue(this,Qo,t),(n=O(this,Fr))==null||n.call(this),ue(this,Fr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){O(this,Ds)!==t&&(ue(this,Ds,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof O(this,Ds)=="boolean"?O(this,Ds):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ds=new WeakMap,Fr=new WeakMap,Qo=new WeakMap,W0),Qk=new ER,NR={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Br,jm,K0,CR=(K0=class{constructor(){we(this,Br,NR);we(this,jm,!1)}setTimeoutProvider(e){ue(this,Br,e)}setTimeout(e,t){return O(this,Br).setTimeout(e,t)}clearTimeout(e){O(this,Br).clearTimeout(e)}setInterval(e,t){return O(this,Br).setInterval(e,t)}clearInterval(e){O(this,Br).clearInterval(e)}},Br=new WeakMap,jm=new WeakMap,K0),Zf=new CR;function _R(e){setTimeout(e,0)}var jR=typeof window>"u"||"Deno"in globalThis;function xn(){}function PR(e,t){return typeof e=="function"?e(t):e}function RR(e){return typeof e=="number"&&e>=0&&e!==1/0}function OR(e,t){return Math.max(e+(t||0)-Date.now(),0)}function em(e,t){return typeof e=="function"?e(t):e}function IR(e,t){return typeof e=="function"?e(t):e}function yy(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==Jp(a,t.options))return!1}else if(!Ja(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||o&&!o(t))}function xy(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Qa(t.options.mutationKey)!==Qa(o))return!1}else if(!Ja(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Jp(e,t){return((t==null?void 0:t.queryKeyHashFn)||Qa)(e)}function Qa(e){return JSON.stringify(e,(t,n)=>tm(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Ja(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ja(e[n],t[n])):!1}var MR=Object.prototype.hasOwnProperty;function Jk(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=by(e)&&by(t);if(!r&&!(tm(e)&&tm(t)))return t;const o=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),l=a.length,c=r?new Array(l):{};let d=0;for(let u=0;u<l;u++){const h=r?u:a[u],p=e[h],m=t[h];if(p===m){c[h]=p,(r?u<o:MR.call(e,h))&&d++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){c[h]=m;continue}const x=Jk(p,m,n+1);c[h]=x,x===p&&d++}return o===l&&d===o?e:c}function QF(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function by(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function tm(e){if(!wy(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!wy(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wy(e){return Object.prototype.toString.call(e)==="[object Object]"}function LR(e){return new Promise(t=>{Zf.setTimeout(t,e)})}function DR(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Jk(e,t):t}function zR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function $R(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Zp=Symbol();function Zk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Zp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function JF(e,t){return typeof e=="function"?e(...t):!!e}
439function FR(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var eS=(()=>{let e=()=>jR;return{isServer(){return e()},setIsServer(t){e=t}}})();function BR(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var UR=_R;function VR(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=UR;const o=l=>{t?e.push(l):s(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||a()}return c},batchCalls:l=>(...c)=>{o(()=>{l(...c)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Tt=VR(),Jo,Ur,Zo,Y0,HR=(Y0=class extends mu{constructor(){super();we(this,Jo,!0);we(this,Ur);we(this,Zo);ue(this,Zo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){O(this,Ur)||this.setEventListener(O(this,Zo))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,Ur))==null||t.call(this),ue(this,Ur,void 0))}setEventListener(t){var n;ue(this,Zo,t),(n=O(this,Ur))==null||n.call(this),ue(this,Ur,t(this.setOnline.bind(this)))}setOnline(t){O(this,Jo)!==t&&(ue(this,Jo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return O(this,Jo)}},Jo=new WeakMap,Ur=new WeakMap,Zo=new WeakMap,Y0),xd=new HR;function XR(e){return Math.min(1e3*2**e,3e4)}function tS(e){return(e??"online")==="online"?xd.isOnline():!0}var nm=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function nS(e){let t=!1,n=0,r;const s=BR(),o=()=>s.status!=="pending",a=g=>{var w;if(!o()){const v=new nm(g);p(v),(w=e.onCancel)==null||w.call(e,v)}},l=()=>{t=!0},c=()=>{t=!1},d=()=>Qk.isFocused()&&(e.networkMode==="always"||xd.isOnline())&&e.canRun(),u=()=>tS(e.networkMode)&&e.canRun(),h=g=>{o()||(r==null||r(),s.resolve(g))},p=g=>{o()||(r==null||r(),s.reject(g))},m=()=>new Promise(g=>{var w;r=v=>{(o()||d())&&g(v)},(w=e.onPause)==null||w.call(e)}).then(()=>{var g;r=void 0,o()||(g=e.onContinue)==null||g.call(e)}),x=()=>{if(o())return;let g;const w=n===0?e.initialPromise:void 0;try{g=w??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(h).catch(v=>{var T;if(o())return;const y=e.retry??(eS.isServer()?0:3),b=e.retryDelay??XR,k=typeof b=="function"?b(n,v):b,S=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,v);if(t||!S){p(v);return}n++,(T=e.onFail)==null||T.call(e,n,v),LR(k).then(()=>d()?void 0:m()).then(()=>{t?p(v):x()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:l,continueRetry:c,canStart:u,start:()=>(u()?x():m().then(x),s)}}var zs,Q0,rS=(Q0=class{constructor(){we(this,zs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),RR(this.gcTime)&&ue(this,zs,Zf.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(eS.isServer()?1/0:5*60*1e3))}clearGcTimeout(){O(this,zs)!==void 0&&(Zf.clearTimeout(O(this,zs)),ue(this,zs,void 0))}},zs=new WeakMap,Q0);function qR(e){return{onFetch:(t,n)=>{var u,h,p,m,x;const r=t.options,s=(p=(h=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,o=((m=t.state.data)==null?void 0:m.pages)||[],a=((x=t.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let g=!1;const w=b=>{FR(b,()=>t.signal,()=>g=!0)},v=Zk(t.options,t.fetchOptions),y=async(b,k,S)=>{if(g)return Promise.reject(t.signal.reason);if(k==null&&b.pages.length)return Promise.resolve(b);const E=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:k,direction:S?"backward":"forward",meta:t.options.meta};return w(F),F})(),j=await v(E),{maxPages:N}=t.options,R=S?$R:zR;return{pages:R(b.pages,j,N),pageParams:R(b.pageParams,k,N)}};if(s&&o.length){const b=s==="backward",k=b?GR:ky,S={pages:o,pageParams:a},T=k(r,S);l=await y(S,T,b)}else{const b=e??o.length;do{const k=c===0?a[0]??r.initialPageParam:ky(r,l);if(c>0&&k==null)break;l=await y(l,k),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 ky(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 GR(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 ei,$s,ti,Jt,Fs,ot,al,Bs,Dt,sS,tr,J0,WR=(J0=class extends rS{constructor(t){super();we(this,Dt);we(this,ei);we(this,$s);we(this,ti);we(this,Jt);we(this,Fs);we(this,ot);we(this,al);we(this,Bs);ue(this,Bs,!1),ue(this,al,t.defaultOptions),this.setOptions(t.options),this.observers=[],ue(this,Fs,t.client),ue(this,Jt,O(this,Fs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,$s,Ty(this.options)),this.state=t.state??O(this,$s),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return O(this,ei)}get promise(){var t;return(t=O(this,ot))==null?void 0:t.promise}setOptions(t){if(this.options={...O(this,al),...t},t!=null&&t._type&&ue(this,ei,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Ty(this.options);n.data!==void 0&&(this.setState(Sy(n.data,n.dataUpdatedAt)),ue(this,$s,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&O(this,Jt).remove(this)}setData(t,n){const r=DR(this.state.data,t,this.options);return ct(this,Dt,tr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){ct(this,Dt,tr).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=O(this,ot))==null?void 0:r.promise;return(s=O(this,ot))==null||s.cancel(t),n?n.then(xn).catch(xn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return O(this,$s)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>IR(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdate
439Count>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>em(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:!OR(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,ot))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,ot))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),O(this,Jt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(O(this,ot)&&(O(this,Bs)||ct(this,Dt,sS).call(this)?O(this,ot).cancel({revert:!0}):O(this,ot).cancelRetry()),this.scheduleGc()),O(this,Jt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ct(this,Dt,tr).call(this,{type:"invalidate"})}async fetch(t,n){var d,u,h,p,m,x,g,w,v,y,b;if(this.state.fetchStatus!=="idle"&&((d=O(this,ot))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(O(this,ot))return O(this,ot).continueRetry(),O(this,ot).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(S=>S.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(ue(this,Bs,!0),r.signal)})},o=()=>{const k=Zk(this.options,n),T=(()=>{const E={client:O(this,Fs),queryKey:this.queryKey,meta:this.meta};return s(E),E})();return ue(this,Bs,!1),this.options.persister?this.options.persister(k,T,this):k(T)},l=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:O(this,Fs),state:this.state,fetchFn:o};return s(k),k})(),c=O(this,ei)==="infinite"?qR(this.options.pages):this.options.behavior;c==null||c.onFetch(l,this),ue(this,ti,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=l.fetchOptions)==null?void 0:u.meta))&&ct(this,Dt,tr).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta}),ue(this,ot,nS({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:k=>{k instanceof nm&&k.revert&&this.setState({...O(this,ti),fetchStatus:"idle"}),r.abort()},onFail:(k,S)=>{ct(this,Dt,tr).call(this,{type:"failed",failureCount:k,error:S})},onPause:()=>{ct(this,Dt,tr).call(this,{type:"pause"})},onContinue:()=>{ct(this,Dt,tr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const k=await O(this,ot).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(m=(p=O(this,Jt).config).onSuccess)==null||m.call(p,k,this),(g=(x=O(this,Jt).config).onSettled)==null||g.call(x,k,this.state.error,this),k}catch(k){if(k instanceof nm){if(k.silent)return O(this,ot).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw ct(this,Dt,tr).call(this,{type:"error",error:k}),(v=(w=O(this,Jt).config).onError)==null||v.call(w,k,this),(b=(y=O(this,Jt).config).onSettled)==null||b.call(y,this.state.data,k,this),k}finally{this.scheduleGc()}}},ei=new WeakMap,$s=new WeakMap,ti=new WeakMap,Jt=new WeakMap,Fs=new WeakMap,ot=new WeakMap,al=new WeakMap,Bs=new WeakMap,Dt=new WeakSet,sS=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},tr=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,...KR(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...Sy(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,ti,t.manual?s:void 0),s;case"error":const o=t.error;
439return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Tt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),O(this,Jt).notify({query:this,type:"updated",action:t})})},J0);function KR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Sy(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ty(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 ll,zn,bt,Us,$n,_r,Z0,YR=(Z0=class extends rS{constructor(t){super();we(this,$n);we(this,ll);we(this,zn);we(this,bt);we(this,Us);ue(this,ll,t.client),this.mutationId=t.mutationId,ue(this,bt,t.mutationCache),ue(this,zn,[]),this.state=t.state||QR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){O(this,zn).includes(t)||(O(this,zn).push(t),this.clearGcTimeout(),O(this,bt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,zn,O(this,zn).filter(n=>n!==t)),this.scheduleGc(),O(this,bt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){O(this,zn).length||(this.state.status==="pending"?this.scheduleGc():O(this,bt).remove(this))}continue(){var t;return((t=O(this,Us))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,l,c,d,u,h,p,m,x,g,w,v,y,b,k,S,T,E;const n=()=>{ct(this,$n,_r).call(this,{type:"continue"})},r={client:O(this,ll),meta:this.options.meta,mutationKey:this.options.mutationKey};ue(this,Us,nS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(j,N)=>{ct(this,$n,_r).call(this,{type:"failed",failureCount:j,error:N})},onPause:()=>{ct(this,$n,_r).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>O(this,bt).canRun(this)}));const s=this.state.status==="pending",o=!O(this,Us).canStart();try{if(s)n();else{ct(this,$n,_r).call(this,{type:"pending",variables:t,isPaused:o}),O(this,bt).config.onMutate&&await O(this,bt).config.onMutate(t,this,r);const N=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t,r));N!==this.state.context&&ct(this,$n,_r).call(this,{type:"pending",context:N,variables:t,isPaused:o})}const j=await O(this,Us).start();return await((d=(c=O(this,bt).config).onSuccess)==null?void 0:d.call(c,j,t,this.state.context,this,r)),await((h=(u=this.options).onSuccess)==null?void 0:h.call(u,j,t,this.state.context,r)),await((m=(p=O(this,bt).config).onSettled)==null?void 0:m.call(p,j,null,this.state.variables,this.state.context,this,r)),await((g=(x=this.options).onSettled)==null?void 0:g.call(x,j,null,t,this.state.context,r)),ct(this,$n,_r).call(this,{type:"success",data:j}),j}catch(j){try{await((v=(w=O(this,bt).config).onError)==null?void 0:v.call(w,j,t,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((b=(y=this.options).onError)==null?void 0:b.call(y,j,t,this.state.context,r))}catch(N){Promise.reject(N)}try{await((S=(k=O(this,bt).config).onSettled)==null?void 0:S.call(k,void 0,j,this.state.variables,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((E=(T=this.options).onSettled)==null?void 0:E.call(T,void 0,j,t,this.state.context,r))}catch(N){Promise.reject(N)}throw ct(this,$n,_r).call(this,{type:"error",error:j}),j}finally{O(this,bt).runNext(this)}}},ll=new WeakMap,zn=new WeakMap,bt=new WeakMap,Us=new WeakMap,$n=new WeakSet,_r=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};
439case"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),Tt.batch(()=>{O(this,zn).forEach(r=>{r.onMutationUpdate(t)}),O(this,bt).notify({mutation:this,type:"updated",action:t})})},Z0);function QR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ir,kn,cl,ex,JR=(ex=class extends mu{constructor(t={}){super();we(this,ir);we(this,kn);we(this,cl);this.config=t,ue(this,ir,new Set),ue(this,kn,new Map),ue(this,cl,0)}build(t,n,r){const s=new YR({client:t,mutationCache:this,mutationId:++El(this,cl)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){O(this,ir).add(t);const n=Wl(t);if(typeof n=="string"){const r=O(this,kn).get(n);r?r.push(t):O(this,kn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(O(this,ir).delete(t)){const n=Wl(t);if(typeof n=="string"){const r=O(this,kn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&O(this,kn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Wl(t);if(typeof n=="string"){const r=O(this,kn).get(n),s=r==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Wl(t);if(typeof n=="string"){const s=(r=O(this,kn).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Tt.batch(()=>{O(this,ir).forEach(t=>{this.notify({type:"removed",mutation:t})}),O(this,ir).clear(),O(this,kn).clear()})}getAll(){return Array.from(O(this,ir))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>xy(n,r))}findAll(t={}){return this.getAll().filter(n=>xy(t,n))}notify(t){Tt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Tt.batch(()=>Promise.all(t.map(n=>n.continue().catch(xn))))}},ir=new WeakMap,kn=new WeakMap,cl=new WeakMap,ex);function Wl(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Fn,tx,ZR=(tx=class extends mu{constructor(t={}){super();we(this,Fn);this.config=t,ue(this,Fn,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??Jp(s,n);let a=this.get(o);return a||(a=new WR({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){O(this,Fn).has(t.queryHash)||(O(this,Fn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=O(this,Fn).get(t.queryHash);n&&(t.destroy(),n===t&&O(this,Fn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Tt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return O(this,Fn).get(t)}getAll(){return[...O(this,Fn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>yy(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>yy(t,r)):n}notify(t){Tt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Tt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Tt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fn=new WeakMap,tx),Be,Vr,Hr,ni,ri,Xr,si,oi,nx,eO=(nx=class{constructor(e={}){we(this,Be);we(this,Vr);we(this,Hr);we(this,ni);we(this,ri);we(this,Xr);we(this,si);we(this,oi);ue(this,Be,e.queryCache||new ZR),ue(this,Vr,e.mutationCache||new JR),ue(this,Hr,e.defaultOptions||{}),ue(this,ni,new Map),ue(this,ri,new Map),ue(this,Xr,0)}mount(){El(this,Xr)._++,O(this,Xr)===1&&(ue(this,si,Qk.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,Be).onFocus())})),ue(this,oi,xd.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,Be).onOnline())})))}unmount(){var e,t;El(this,Xr)._--,O(this,Xr)===0&&((e=O(this,si))==null||e.call(this),ue(this,si,void 0),(t=O(this,oi))==null||t.call(this),ue(this,oi,void 0))}isFetching(e){return O(this,Be).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return O(this,Vr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,Be).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=O(this,Be).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(em(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return O(this,Be).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=O(this,Be).get(r.queryHash),o=s==null?void 0:s.state.data,a=PR(t,o);if(a!==void 0)return O(this,Be).build(this,r).setData(a,{...n,manual:!0})}
439setQueriesData(e,t,n){return Tt.batch(()=>O(this,Be).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,Be).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=O(this,Be);Tt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=O(this,Be);return Tt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Tt.batch(()=>O(this,Be).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(xn).catch(xn)}invalidateQueries(e,t={}){return Tt.batch(()=>(O(this,Be).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=Tt.batch(()=>O(this,Be).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(xn)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(xn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=O(this,Be).build(this,t);return n.isStaleByTime(em(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xn).catch(xn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xn).catch(xn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return xd.isOnline()?O(this,Vr).resumePausedMutations():Promise.resolve()}getQueryCache(){return O(this,Be)}getMutationCache(){return O(this,Vr)}getDefaultOptions(){return O(this,Hr)}setDefaultOptions(e){ue(this,Hr,e)}setQueryDefaults(e,t){O(this,ni).set(Qa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...O(this,ni).values()],n={};return t.forEach(r=>{Ja(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){O(this,ri).set(Qa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...O(this,ri).values()],n={};return t.forEach(r=>{Ja(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...O(this,Hr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Jp(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===Zp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...O(this,Hr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){O(this,Be).clear(),O(this,Vr).clear()}},Be=new WeakMap,Vr=new WeakMap,Hr=new WeakMap,ni=new WeakMap,ri=new WeakMap,Xr=new WeakMap,si=new WeakMap,oi=new WeakMap,nx),oS=f.createContext(void 0),ZF=e=>{const t=f.useContext(oS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tO=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(oS.Provider,{value:e,children:t}));const Kl=()=>{window.scrollTo({top:0,left:0,behavior:"instant"}),document.documentElement.scrollTop=0,document.body.scrollTop=0;const e=document.querySelector("main");e&&(e.scrollTop=0),document.querySelectorAll('[class*="overflow"]').forEach(t=>{t instanceof HTMLElement&&(t.scrollTop=0)})},nO=()=>{const{pathname:e}=Wn();return typeof window<"u"&&"scrollRestoration"in history&&(history.scrollRestoration="manual"),f.useLayoutEffect(()=>{Kl(),requestAnimationFrame(()=>{Kl()})},[]),f.useEffect(()=>{Kl();const t=setTimeout(()=>{Kl()},50);return()=>clearTimeout(t)},[e]),null};var rO=typeof Element<"u",sO=typeof Map=="function",oO=typeof Set=="function",iO=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Pc(e,t){if(e===t)return!0;
439if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Pc(e[r],t[r]))return!1;return!0}var o;if(sO&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!Pc(r.value[1],t.get(r.value[0])))return!1;return!0}if(oO&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(iO&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[r]))return!1;if(rO&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((s[r]==="_owner"||s[r]==="__v"||s[r]==="__o")&&e.$$typeof)&&!Pc(e[s[r]],t[s[r]]))return!1;return!0}return e!==e&&t!==t}var aO=function(t,n){try{return Pc(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const lO=dl(aO);var cO=function(e,t,n,r,s,o,a,l){if(!e){var c;if(t===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[n,r,s,o,a,l],u=0;c=new Error(t.replace(/%s/g,function(){return d[u++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},dO=cO;const Ay=dl(dO);var uO=function(t,n,r,s){var o=r?r.call(s,t,n):void 0;if(o!==void 0)return!!o;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var a=Object.keys(t),l=Object.keys(n);if(a.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(n),d=0;d<a.length;d++){var u=a[d];if(!c(u))return!1;var h=t[u],p=n[u];if(o=r?r.call(s,h,p,u):void 0,o===!1||o===void 0&&h!==p)return!1}return!0};const hO=dl(uO);var iS=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(iS||{}),ph={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},Ey=Object.values(iS),eg={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},fO=Object.entries(eg).reduce((e,[t,n])=>(e[n]=t,e),{}),En="data-rh",Xo={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},qo=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},mO=e=>{let t=qo(e,"title");const n=qo(e,Xo.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=qo(e,Xo.DEFAULT_TITLE);return t||r||void 0},pO=e=>qo(e,Xo.ON_CHANGE_CLIENT_STATE)||(()=>{}),gh=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),gO=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const s=Object.keys(r);for(let o=0;o<s.length;o+=1){const l=s[o].toLowerCase();if(e.indexOf(l)!==-1&&r[l])return n.concat(r)}}return n},[]),vO=e=>console&&typeof console.warn=="function"&&console.warn(e),qi=(e,t,n)=>{const r={};return n.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&vO(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,o)=>{const a={};o.filter(c=>{let d;const u=Object.keys(c);for(let p=0;p<u.length;p+=1){const m=u[p],x=m.toLowerCase();t.indexOf(x)!==-1&&!(d==="rel"&&c[d].toLowerCase()==="canonical")&&!(x==="rel"&&c[x].toLowerCase()==="stylesheet")&&(d=x),t.indexOf(m)!==-1&&(m==="innerHTML"||m==="cssText"||m==="itemprop")&&(d=m)}if(!d||!c[d])return!1;const h=c[d].toLowerCase();return r[d]||(r[d]={}),a[d]||(a[d]={}),r[d][h]?!1:(a[d][h]=!0,!0)}
439).reverse().forEach(c=>s.push(c));const l=Object.keys(a);for(let c=0;c<l.length;c+=1){const d=l[c],u={...r[d],...a[d]};r[d]=u}return s},[]).reverse()},yO=(e,t)=>{if(Array.isArray(e)&&e.length){for(let n=0;n<e.length;n+=1)if(e[n][t])return!0}return!1},xO=e=>({baseTag:gO(["href"],e),bodyAttributes:gh("bodyAttributes",e),defer:qo(e,Xo.DEFER),encode:qo(e,Xo.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:gh("htmlAttributes",e),linkTags:qi("link",["rel","href"],e),metaTags:qi("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:qi("noscript",["innerHTML"],e),onChangeClientState:pO(e),scriptTags:qi("script",["src","innerHTML"],e),styleTags:qi("style",["cssText"],e),title:mO(e),titleAttributes:gh("titleAttributes",e),prioritizeSeoTags:yO(e,Xo.PRIORITIZE_SEO_TAGS)}),aS=e=>Array.isArray(e)?e.join(""):e,bO=(e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1},vh=(e,t)=>Array.isArray(e)?e.reduce((n,r)=>(bO(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},Ny=(e,t)=>({...e,[t]:void 0}),wO=["noscript","script","style"],rm=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),lS=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),kO=(e,t,n,r)=>{const s=lS(n),o=aS(t);return s?`<${e} ${En}="true" ${s}>${rm(o,r)}</${e}>`:`<${e} ${En}="true">${rm(o,r)}</${e}>`},SO=(e,t,n=!0)=>t.reduce((r,s)=>{const o=s,a=Object.keys(o).filter(d=>!(d==="innerHTML"||d==="cssText")).reduce((d,u)=>{const h=typeof o[u]>"u"?u:`${u}="${rm(o[u],n)}"`;return d?`${d} ${h}`:h},""),l=o.innerHTML||o.cssText||"",c=wO.indexOf(e)===-1;return`${r}<${e} ${En}="true" ${a}${c?"/>":`>${l}</${e}>`}`},""),cS=(e,t={})=>Object.keys(e).reduce((n,r)=>{const s=eg[r];return n[s||r]=e[r],n},t),TO=(e,t,n)=>{const r={key:t,[En]:!0},s=cS(n,r);return[X.createElement("title",s,t)]},Rc=(e,t)=>t.map((n,r)=>{const s={key:r,[En]:!0};return Object.keys(n).forEach(o=>{const l=eg[o]||o;if(l==="innerHTML"||l==="cssText"){const c=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:c}}else s[l]=n[o]}),X.createElement(e,s)}),Qt=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>TO(e,t.title,t.titleAttributes),toString:()=>kO(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>cS(t),toString:()=>lS(t)};default:return{toComponent:()=>Rc(e,t),toString:()=>SO(e,t,n)}}},AO=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const s=vh(e,ph.meta),o=vh(t,ph.link),a=vh(n,ph.script);return{priorityMethods:{toComponent:()=>[...Rc("meta",s.priority),...Rc("link",o.priority),...Rc("script",a.priority)],toString:()=>`${Qt("meta",s.priority,r)} ${Qt("link",o.priority,r)} ${Qt("script",a.priority,r)}`},metaTags:s.default,linkTags:o.default,scriptTags:a.default}},EO=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:s,noscriptTags:o,styleTags:a,title:l="",titleAttributes:c,prioritizeSeoTags:d}=e;let{linkTags:u,metaTags:h,scriptTags:p}=e,m={toComponent:()=>{},toString:()=>""};return d&&({priorityMethods:m,linkTags:u,metaTags:h,scriptTags:p}=AO(e)),{priority:m,base:Qt("base",t,r),bodyAttributes:Qt("bodyAttributes",n,r),htmlAttributes:Qt("htmlAttributes",s,r),link:Qt("link",u,r),meta:Qt("meta",h,r),noscript:Qt("noscript",o,r),script:Qt("script",p,r),style:Qt("style",a,r),title:Qt("title",{title:l,titleAttributes:c},r)}},sm=EO,Yl=[],dS=!!(typeof window<"u"&&window.document&&window.document.createElement),om=class{constructor(e,t){G(this,"instances",[]);G(this,"canUseDOM",dS);G(this,"context");G(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Yl:this.instances,add:e=>{(this.canUseDOM?Yl:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Yl:this.instances).indexOf(e);(this.canUseDOM?Yl:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=sm({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},NO={},uS=X.createContext(NO),Vs,hS=(Vs=class extends f.Component{constructor(n){super(n);G(this,"helmetData");this.helmetData=new om(this.props.context||{},Vs.canUseDOM)}render(){return X.createElement(uS.Provider,{value:this.helmetData.value},this.props.children)}},G(Vs,"canUseDOM",dS),Vs),ho=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${En}]`),s=[].slice.call(r),o=[];let a;return t&&t.length&&t.forEach(l=>{const c=document.createElement(e);for(const d in l)if(Object.prototype.hasOwnProperty.call(l,d))if(d==="innerHTML")c.innerHTML=l.innerHTML;else if(d==="cssText")c.styleSheet?c.styleSheet.cssText=l.cssText:c.appendChild(document.createTextNode(l.cssText));else{const u=d,h=typeof l[u]>"u"?"":l[u];c.setAttribute(d,h)}c.setAttribute(En,"true"),s.some((d,u)=>(a=u,c.isEqualNode(d)))?s.splice(a,1):o.push(c)}
439),s.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)}),o.forEach(l=>n.appendChild(l)),{oldTags:s,newTags:o}},im=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(En),s=r?r.split(","):[],o=[...s],a=Object.keys(t);for(const l of a){const c=t[l]||"";n.getAttribute(l)!==c&&n.setAttribute(l,c),s.indexOf(l)===-1&&s.push(l);const d=o.indexOf(l);d!==-1&&o.splice(d,1)}for(let l=o.length-1;l>=0;l-=1)n.removeAttribute(o[l]);s.length===o.length?n.removeAttribute(En):n.getAttribute(En)!==a.join(",")&&n.setAttribute(En,a.join(","))},CO=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=aS(e)),im("title",t)},Cy=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:s,linkTags:o,metaTags:a,noscriptTags:l,onChangeClientState:c,scriptTags:d,styleTags:u,title:h,titleAttributes:p}=e;im("body",r),im("html",s),CO(h,p);const m={baseTag:ho("base",n),linkTags:ho("link",o),metaTags:ho("meta",a),noscriptTags:ho("noscript",l),scriptTags:ho("script",d),styleTags:ho("style",u)},x={},g={};Object.keys(m).forEach(w=>{const{newTags:v,oldTags:y}=m[w];v.length&&(x[w]=v),y.length&&(g[w]=m[w].oldTags)}),t&&t(),c(e,x,g)},Gi=null,_O=e=>{Gi&&cancelAnimationFrame(Gi),e.defer?Gi=requestAnimationFrame(()=>{Cy(e,()=>{Gi=null})}):(Cy(e),Gi=null)},jO=_O,_y=class extends f.Component{constructor(){super(...arguments);G(this,"rendered",!1)}shouldComponentUpdate(t){return!hO(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const s=xO(t.get().map(o=>{const a={...o.props};return delete a.context,a}));hS.canUseDOM?jO(s):sm&&(r=sm(s)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},Fh,fS=(Fh=class extends f.Component{shouldComponentUpdate(e){return!lO(Ny(this.props,"helmetData"),Ny(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return Ay(Ey.some(n=>e.type===n),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${Ey.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),Ay(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let n={};return X.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:s,...o}=r.props,a=Object.keys(o).reduce((c,d)=>(c[fO[d]||d]=o[d],c),{});let{type:l}=r;
439switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(r,s),l){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,a,s);break;default:t=this.mapObjectTypeChildren(r,t,a,s);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof om)){const s=r;r=new om(s.context,!0),delete n.helmetData}return r?X.createElement(_y,{...n,context:r.value}):X.createElement(uS.Consumer,null,s=>X.createElement(_y,{...n,context:s}))}},G(Fh,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Fh);function Le({className:e,...t}){return i.jsx("div",{className:D("animate-pulse rounded-md bg-muted",e),...t})}function PO(){return i.jsxs("div",{className:"min-h-screen bg-background animate-in fade-in duration-300",children:[i.jsxs("header",{className:"border-b border-border/50 bg-card sticky top-0 z-50",children:[i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"flex items-center justify-between py-3",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Le,{className:"w-5 h-5 rounded"}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(Le,{className:"h-5 w-32"}),i.jsx(Le,{className:"h-3 w-20"})]})]}),i.jsxs("div",{className:"flex items-center gap-6",children:[i.jsxs("div",{className:"text-right space-y-1",children:[i.jsx(Le,{className:"h-7 w-24 ml-auto"}),i.jsx(Le,{className:"h-4 w-16 ml-auto"})]}),i.jsx(Le,{className:"h-9 w-24 rounded-md"})]})]})}),i.jsx("div",{className:"flex gap-4 px-4 py-2 overflow-hidden border-t border-border/30",children:Array.from({length:8}).map((e,t)=>i.jsx(Le,{className:"h-6 w-20 flex-shrink-0"},t))})]}),i.jsxs("main",{className:"container mx-auto px-4 py-4",children:[i.jsx("div",{className:"grid grid-cols-4 md:grid-cols-8 gap-2 mb-4",children:Array.from({length:8}).map((e,t)=>i.jsxs("div",{className:"bg-card/80 border border-border/50 rounded p-2",children:[i.jsx(Le,{className:"h-2 w-10 mb-1"}),i.jsx(Le,{className:"h-4 w-12"})]},t))}),i.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-4 gap-4",children:[i.jsxs("div",{className:"xl:col-span-3 space-y-4",children:[i.jsx("div",{className:"bg-card border border-border/50 rounded-lg p-4",children:i.jsx(Le,{className:"h-[300px] w-full rounded-md"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"flex gap-2",children:Array.from({length:6}).map((e,t)=>i.jsx(Le,{className:"h-8 w-20 rounded-md"},t))}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Array.from({length:4}).map((e,t)=>i.jsxs("div",{className:"bg-card border border-border/50 rounded-lg p-4 space-y-3",children:[i.jsx(Le,{className:"h-5 w-1/3"}),i.jsx(Le,{className:"h-20 w-full"}),i.jsx(Le,{className:"h-4 w-2/3"})]},t))})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-card border border-border/50 rounded-lg p-4 space-y-3",children:[i.jsx(Le,{className:"h-5 w-24"}),i.jsx(Le,{className:"h-32 w-full"})]}),i.jsxs("div",{className:"bg-card border border-border/50 rounded-lg p-4 space-y-3",children:[i.jsx(Le,{className:"h-5 w-28"}),Array.from({length:4}).map((e,t)=>i.jsx(Le,{className:"h-12 w-full"},t))]})]})]})]})]})}function ve(){return i.jsx("div",{className:"min-h-screen bg-background p-4 animate-in fade-in duration-300",children:i.jsxs("div",{className:"container mx-auto space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(Le,{className:"h-8 w-48"}),i.jsx(Le,{className:"h-9 w-24 rounded-md"})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:9}).map((e,t)=>i.jsxs("div",{className:"bg-card border border-border/50 rounded-lg p-4 space-y-3",children:[i.jsx(Le,{className:"h-5 w-1/2"}),i.jsx(Le,{className:"h-24 w-full"}),i.jsx(Le,{className:"h-4 w-3/4"})]},t))})]})})}const RO=su(["inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg","text-sm font-medium select-none","ring-offset-background 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","transition-all duration-150 ease-out","active:scale-[0.97]"].join(" "),{variants:{variant:{default:["bg-primary text-primary-foreground","shadow-md shadow-primary/20","active:bg-primary/85"].join(" "),destructive:["bg-destructive text-destructive-foreground","shadow-md shadow-destructive/20","active:bg-destructive/85"].join(" "),outline:["border border-input bg-background","active:bg-accent active:text-accent-foreground"].join(" "),secondary:["bg-secondary text-secondary-foreground","active:bg-secondary/70"].join(" "),ghost:["active:bg-accent active:text-accent-foreground"].join(" "),link:["text-primary underline-offset-4 active:underline"].join(" "),profit:["bg-gradient-to-r from-emerald-500 to-emerald-400","text-white font-semibold","shadow-lg shadow-emerald-500/30","active:from-emerald-600 active:to-emerald-500"].join(" "),loss:["bg-gradient-to-r from-red-500 to-red-400","text-white font-semibold","shadow-lg shadow-red-500/30","active:from-red-600 active:to-red-500"].join(" "),premium:["bg-gradient-to-r from-primary to-[hsl(33,100%,50%)]","text-primary-foreground font-semibold","shadow-lg shadow-primary/30","active:opacity-90"].join(" "),glass:["bg-card/80 backdrop-blur-xl border border-border/50","text-foreground","active:bg-card/60"].join(" ")},size:{default:"h-11 px-5 py-2.5",sm:"h-9 rounded-md px-3 text-xs",lg:"h-12 rounded-xl px-8 text-base",xl:"h-14 roun
439ded-xl px-10 text-lg",icon:"h-11 w-11","icon-sm":"h-9 w-9","icon-lg":"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}}),Ee=f.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const a=r?xN:"button";return i.jsx(a,{className:D(RO({variant:t,size:n,className:e})),ref:o,style:{WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},...s})});Ee.displayName="Button";class OO extends f.Component{constructor(){super(...arguments);G(this,"state",{hasError:!1});G(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0})})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("ErrorBoundary caught an error:",n,r)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:i.jsxs("div",{className:"max-w-md w-full text-center space-y-6",children:[i.jsx("div",{className:"flex justify-center",children:i.jsx("div",{className:"w-16 h-16 rounded-full bg-destructive/10 flex items-center justify-center",children:i.jsx(Xa,{className:"w-8 h-8 text-destructive"})})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Something went wrong"}),i.jsx("p",{className:"text-muted-foreground text-sm",children:"An unexpected error occurred while loading this page."}),this.state.error&&i.jsx("p",{className:"text-xs text-muted-foreground bg-muted/50 p-2 rounded font-mono",children:this.state.error.message})]}),i.jsxs("div",{className:"flex gap-3 justify-center",children:[i.jsxs(Ee,{onClick:this.handleReset,variant:"outline",children:[i.jsx(Ip,{className:"w-4 h-4 mr-2"}),"Try Again"]}),i.jsx(Ie,{to:"/",children:i.jsxs(Ee,{children:[i.jsx(Rp,{className:"w-4 h-4 mr-2"}),"Go Home"]})})]})]})}):this.props.children}}const IO=[{label:"Home",icon:Rp,href:"/"},{label:"Agents",icon:rn,href:"/agents",highlight:!0},{label:"Pro",icon:Ge,href:"/pro-agents",highlight:!0},{label:"Tape",icon:$f,href:"/tape"},{label:"Learn",icon:Pp,href:"/learn"}],mS=f.memo(({item:e,isActive:t})=>{const[n,r]=f.useState(!1);return i.jsxs(Ie,{to:e.href,className:D("mobile-nav-item touch-target relative flex flex-col items-center justify-center gap-0.5","py-2 px-4 rounded-xl min-w-[64px] min-h-[52px]","transition-all duration-150 ease-out gpu-accelerate",t&&"active bg-primary/10",n&&"scale-95 opacity-80"),style:{WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},onTouchStart:()=>r(!0),onTouchEnd:()=>r(!1),onTouchCancel:()=>r(!1),children:[t&&i.jsx("span",{className:"absolute top-1.5 w-1 h-1 rounded-full bg-primary animate-pulse-subtle"}),i.jsx(e.icon,{className:D("w-5 h-5 transition-all duration-150",t?"text-primary scale-110":"text-muted-foreground",e.highlight&&!t&&"text-amber-400/70")}),i.jsx("span",{className:D("text-[10px] transition-colors duration-150",t?"text-primary font-semibold":"text-muted-foreground"),children:e.label})]})});mS.displayName="NavItem";const pS=f.memo(()=>{const e=Wn(),t=f.useCallback(n=>n==="/"?e.pathname==="/":e.pathname.startsWith(n),[e.pathname]);return i.jsx("nav",{className:D("fixed bottom-0 left-0 right-0 z-50 md:hidden gpu-accelerate","bg-card/98 backdrop-blur-xl border-t border-border/40","flex items-center justify-around px-1","safe-area-inset-bottom"),style:{minHeight:"64px",paddingBottom:"max(env(safe-area-inset-bottom), 8px)"},role:"navigation","aria-label":"Main navigation",children:IO.map(n=>i.jsx(mS,{item:n,isActive:t(n.href)},n.href))})});pS.displayName="MobileNav";const jy=[{label:"Home",icon:Rp,href:"/",color:"text-foreground"},{label:"Agents",icon:rn,href:"/agents",color:"text-primary",highlight:!0},{label:"Pro Agents",icon:Ge,href:"/pro-agents",color:"text-amber-400",highlight:!0},{label:"Trade",icon:xa,href:"/trade",color:"text-emerald-400",highlight:!0},{label:"Tape",icon:$f,href:"/tape",color:"text-primary"},{label:"Articles",icon:$f,href:"/articles",color:"text-orange-400"},{label:"API",icon:xC,href:"/api",color:"text-cyan-400"},{label:"Leaderboard",icon:Lp,href:"/leaderboard",color:"text-yellow-400"},{label:"Analytics",icon:ki,href:"/analytics",color:"text-blue-400"},{label:"Learn",icon:Pp,href:"/learn",color:"text-emerald-400"}],am=f.memo(({item:e,isActive:t,showLabel:n,onClick:r})=>i.jsxs(Ie,{to:e.href,onClick:r,className:D("flex items-center gap-3 m-0.5 p-2.5 rounded-lg border border-transparent","touch-manipulation select-none","transition-all duration-150 ease-out","active:scale-95",t&&"bg-primary/10 border-primary/30",e.highlight&&!t&&"border-primary/20",n?"justify-start":"justify-center"),style:{WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},children:[i.jsx(e.icon,{className:D("w-4 h-4 flex-shrink-0",e.color)}),n&&i.jsx("span",{className:"text-sm text-foreground",children:e.label})]}));am.displayName="NavItem";function MO(){const e=Wn(),[t,n]=f.useState(!1),r=f.useCallback(a=>a==="/"?e.pathname==="/":e.pathname.startsWith(a),[e.pathname]),s=f.useCallback(()=>n(!1),[]),o=f.useCallback(()=>n(a=>!a),[]);return i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:o,className:D("fixed left-3 top-3 z-[60] p-2.5 rounded-xl","bg-card/95 backdrop-blur-xl border border-border/50 shadow-lg","md:hidden touch-target active:scale-95","transition-all duration-150 ease-out"),style:{WebkitTapHighlightColor:"transparent"},"aria-label":"Toggle menu",children:t?i.jsx(Dp,{className:"w-5 h-5 text-foreground"}):i.jsx(TC,{className:"w-5 h-5 text-foreground"})}),t&&i.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[55] md:hidden animate-fade-in",onClick:s}),i.jsxs("aside",{className:D("fixed left-0 top-0 h-full w-14 z-50","bg-card/95 backdrop-blur-xl border-r border-border/50","hidden md:flex flex-col gpu-accelerate"),style:{touchAction:"manipulation"},children:[i.jsx(Ie,{to:"/",className:D("flex items-center justify-center p-3 border-b border-border/50 h-14","transition-transform duration-150 active:scale-95"),style:{WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},children:i.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-primary to-[hsl(33,100%,50%)] flex items-center justify-center shadow-lg",children:i.jsx(Et,{className:"w-5 h-5 text-primary-foreground"})})}),i.jsx("nav",{className:"flex-1 overflow-y-auto py-2 scrollbar-hide overscroll-contain",style:{WebkitOverflowScrolling:"touch",touchAction:"pan-y"},children:jy.map(a=>i.jsx(am,{item:a,isActive:r(a.href)},a.href))})]}),i.jsxs("aside",{className:D("fixed left-0 top-0 h-full w-64 z-[56]","bg-card/98 backdrop-blur-xl border-r border-border/50","flex flex-col md:hidden","transition-transform duration-300 ease-out",t?"translate-x-0":"-translate-x-full"),style:{touchAction:"manipulation"},children:[i.jsxs(Ie,{to:"/",onClick:s,className:"flex items-center gap-3 p-4 border-b border-border/50 h-16",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-primary to-[hsl(33,100%,50%)] flex items-center justify-center shadow-lg",children:i.jsx(Et,{className:"w-6 h-6 text-primary-foreground"})}),i.jsx("span",{className:"font-bold text-lg text-primary tracking-wide",children:"TokenStocks"})]}),i.jsx("nav",{className:"flex-1 overflow-y-auto py-3 px-2 scrollbar-hide",style:{WebkitOverflowScrolling:"touch"},children:jy.map(a=>i.jsx(am,{item:a,isActive:r(a.href),showLabel:!0,onClick:s},a.href))})]})]})}function LO({children:e}){return i.jsxs("div",{className:"min-h-screen min-h-dvh bg-background overflow-x-hidden",children:[i.jsx(MO,{}),i.jsx("main",{className:"md:pl-14 pb-20 md:pb-0 min-h-screen min-h-dvh",children:e}),i.jsx(pS,{})]})}const xl={MIN_POLL_INTERVAL_MS:100,TARGET_POLL_INTERVAL_MS:200,MAX_POLL_INTERVAL_MS:500,SIGNAL_BATCH_INTERVAL_MS:2,SIGNAL_WINDOW_MS:1e3,TARGET_EXECUTION_LATENCY_MS:.1,MAX_EXECUTION_LATENCY_MS:2,POSITION_MONITOR_INTERVAL_MS:16,PRICE_CACHE_TTL_MS:250,ORDER_CACHE_TTL_MS:10,FETCH_TIMEOUT_MS:400,RETRY_DELAY_MS:20},Go={A:{minConfidence:90,stopLossPct:1.5,takeProfitPct:3,minHoldMs:3e4,maxSlippage:.001,positionSizeMultiplier:1,stopLossMultLong:.985,stopLossMultShort:1.015,takeProfitMultLong:1.03,takeProfitMultShort:.97},B:{minConfidence:85,stopLossPct:1.2,takeProfitPct:2.5,minHoldMs:25e3,maxSlippage:.0015,positionSizeMultiplier:.9,stopLossMultLong:.988,stopLossMultShort:1.012,takeProfitMultLong:1.025,takeProfitMultShort:.975},C:{minConfidence:80,stopLossPct:1,takeProfitPct:2,minHoldMs:2e4,maxSlippage:.002,positionSizeMultiplier:.8,stopLossMultLong:.99,stopLossMultShort:1.01,takeProfitMultLong:1.02,takeProfitMultShort:.98},D:{minConfidence:75,stopLossPct:.8,takeProfitPct:1.5,minHoldMs:15e3,maxSlippage:.0025,positionSizeMultiplier:.7,stopLossMultLong:.992,stopLossMultShort:1.008,takeProfitMultLong:1.015,takeProfitMultShort:.985},F:{minConfidence:0,stopLossPct:.5,takeProfitPct:1,minHoldMs:1e4,maxSlippage:.003,positionSizeMultiplier:.5,stopLossMultLong:.995,stopLossMultShort:1.005,takeProfitMultLong:1.01,takeProfitMultShort:.99}},DO=["A","B","C","D","F"];function pu(e){const t=e>=90?0:e>=85?1:e>=80?2:e>=75?3:4;return DO[t]}const Py={binance:{maker:.001,taker:.001},coinbase:{maker:.004,taker:.006},kraken:{maker:.0016,taker:.0026},bybit:{maker:.001,taker:.001},bitget:{maker:.001,taker:.001},okx:{maker:.001,taker:.001},interactive_brokers:{maker:5e-4,taker:5e-4},alpaca:{maker:0,taker:0},deribit:{maker:2e-4,taker:5e-4},ftx:{maker:2e-4,taker:7e-4}},zO={maker:.001,taker:.001},Wo=e=>Py[e]??Py[e.toLowerCase()]??zO,$O={crypto:{baseSlippage:3e-4,volatilityFactor:.5,urgencyCritical:1.5,urgencyHigh:1.2,urgencyMedium:1,urgencyLow:.8},stock:{baseSlippage:1e-4,volatilityFactor:.3,urgencyCritical:1.3,urgencyHigh:1.1,urgencyMedium:1,urgencyLow:.9},tokenized:{baseSlippage:2e-4,volatilityFactor:.4,urgencyCritical:1.4,urgencyHigh:1.15,urgencyMedium:1,urgencyLow:.85},fx:{baseSlippage:5e-5,volatilityFactor:.2,urgencyCritical:1.2,urgencyHigh:1.1,urgencyMedium:1,urgencyLow:.95}},FO={BTC:1,ETH:1,SOL:1,BNB:1,XRP:1,ADA:1,AVAX:1,DOGE:1,DOT:1,MATIC:1,ICP:1},Ry=new Map,gS=["BTC","ETH","SOL","BNB","XRP","ADA","AVAX","DOGE","DOT","MATIC","ICP","TSLAX","AAPLX","NVDAX","MSFTX","GOOGLX","AMZNX","METAX","COINX","MSTRX","AMDX","HOODX","CRMX","SHOPX","PLTX","NFLXX","UBERX","ABNBX","VISAX","MAX","TSLAon","AAPLon","NVDAon","MSFTon","GOOGLon","METAon","AMDon","COINon","LLYon","JPMon","BABAon","UNHon","HDon","COSTon","SPY","QQQ","SPYX","QQQX","DIAX","IWMX","ARKX","GLDX","VOOon","VTIon"];function vS(e){const t=Ry.get(e);if(t)return t;let n;if(FO[e])n="crypto";else if(e.length>=3){const r=e.charCodeAt(e.length-1);if(r===88||r===110)n="tokenized";else{const s=e.charCodeAt(0);(s===69||s===71||s===85)&&e.length===6?n="fx":n="stock"}}else n="stock";return Ry.set(e,n),n}let Oy=gS.length;for(;Oy--;)vS(gS[Oy]);const na={maxConcurrentPositions:5,maxPositionPct:.08,minPositionPct:.01,emergencyStopMultiplier:1.5,maxHoldTimeMs:12e4,confidenceThreshold:70},Ql=xl.MIN_POLL_INTERVAL_MS,Jl=xl.MAX_POLL_INTERVAL_MS,Iy=32,BO="https://imupgitrulufnuisoknl.supabase.co/functions/v1/live-prices",UO="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImltdXBnaXRydWx1Zm51aXNva25sIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjUzOTA5NDMsImV4cCI6MjA4MDk2Njk0M30.RBfTVJ0pkOHy2CHa7FrOuPfh3jxE4kFE9AT-J0BHeDQ";class My{constructor(t){G(this,"buf");G(this,"head",0);G(this,"count",0);G(this,"cap");this.cap=t,this.buf=new Array(t);for(let n=0;n<t;n++)this.buf[n]=null}push(t){this.buf[this.head]=t,this.head=(this.head+1)%this.cap,this.count<this.cap&&(this.count=this.count+1)}getLatest(t=1){const n=[],r=t<this.count?t:this.count;for(let s=0;s<r;s++){const o=(this.head-1-s+this.cap)%this.cap,a=this.buf[o];a&&(n[n.length]=a)}return n}size(){return this.count}}class VO{constructor(){G(this,"priceHistory",new Map);G(this,"latestPrices",new Map);G(this,"subscribers",new Map);G(this,"globalSubscribers",new Set);G(this,"adaptiveInterval",200);G(this,"lastPollTime",0);G(this,"fetchInFlight",!1);G(this,"isActive",!1);G(this,"channel",null);G(this,"consecutiveFailures",0);G(this,"latencySum",0);G(this,"latencyCount",0);G(this,"updateCount",0);G(this,"SYMBOLS",["BTC","ETH","SOL","BNB","XRP","ADA","AVAX","DOGE","DOT","MATIC","ICP","TSLAX","AAPLX","NVDAX","MSFTX","GOOGLX","AMZNX","METAX","COINX","MSTRX","AMDX","HOODX","CRMX","SHOPX","PLTX","NFLXX","DISNEYX","UBERX","ABNBX","VISAX","MAX","TSLAon","AAPLon","NVDAon","MSFTon","GOOGLon","METAon","AMDon","COINon","LLYon","JPMon","BABAon","UNHon","HDon","COSTon","SPY","QQQ","DIA","IWM","SPYX","QQQX","DIAX","IWMX","ARKX","GLDX","VOOon","VTIon","AGGon","VGTon"]);let t=this.SYMBOLS.length;for(;t--;)this.priceHistory.set(this.SYMBOLS[t],new My(Iy))}start(t=200){this.isActive||(this.isActive=!0,this.adaptiveInterval=t<Ql?Ql:t,this.fetchPrices(),this.startPollingLoop())}startPollingLoop(){this.channel=new MessageChannel,this.channel.port1.onmessage=()=>{if(!this.isActive)return;performance.now()-this.lastPollTime>=this.adaptiveInterval&&!this.fetchInFlight&&(this.fetchInFlight=!0,this.fetchPrices().finally(()=>{this.fetchInFlight=!1})),this.channel.port2.postMessage(null)},this.channel.port2.postMessage(null)}stop(){this.isActive=!1,this.channel=null}async fetchPrices(){const t=performance.now();try{const n=await fetch(BO,{method:"POST",headers:{"Content-Type":"application/json",apikey:UO}}),r=performance.now()-t;if(this.latencySum=this.latencySum+r,this.latencyCount=this.latencyCount+1,!n.ok){if(this.consecutiveFailures=this.consecutiveFailures+1,this.consecutiveFailures>=3){const o=this.adaptiveInterval*1.2;this.adaptiveInterval=o>Jl?Jl:o}return}const s=await n.json();if(this.consecutiveFailures=0,r<10){const o=this.adaptiveInterval*.9;this.adaptiveInterval=o<Ql?Ql:o}else if(r>20){const o=this.adaptiveInterval*1.1;this.adaptiveInterval=o>Jl?Jl:o}s&&s.prices&&this.processPriceUpdate(s.prices,performance.now())}catch{this.consecutiveFailures=this.consecutiveFailures+1}finally{this.lastPollTime=performance.now()}}processPriceUpdate(t,n){const r=performance.now();for(const s in t){const o=t[s],a=o==null?void 0:o.price;if(typeof a!="number")continue;const l=o.bid??a*.9998,c=o.ask??a*1.0002,d=o.spread??a*4e-4,u={price:a,timestamp:r,serverTimestamp:n,bid:l,ask:c,spread:d,volume:o.volume??0,changePercent:o.changePercent??0,source:o.source==="live"?"poll":"cache"};let h=this.priceHistory.get(s);h||(h=new My(Iy),this.priceHistory.set(s,h)),h.push(u);const p=this.latestPrices.get(s);let m=!p;if(p){const x=a-p.price;m=x>1e-5||x<-1e-5}this.latestPrices.set(s,u),this.updateCount=this.updateCount+1,m&&this.notifySubscribers(s,u)}}subscribe(t,n){let r=this.subscribers.get(t);r||(r=new Set,this.subscribers.set(t,r)),r.add(n);const s=this.latestPrices.get(t);return s&&n(s),()=>{var o;return(o=this.subscribers.get(t))==null?void 0:o.delete(n)}}subscribeAll(t){return this.globalSubscribers.add(t),()=>this.globalSubscribers.delete(t)}notifySubscribers(t,n){const r=this.subscribers.get(t);if(r&&r.size>0)for(const s of r)s(n);for(const s of this.globalSubscribers)s(t,n)}getPrice(t){return this.latestPrices.get(t)??null}getPriceSync(t){var n;return((n=this.latestPrices.get(t))==null?void 0:n.price)??0}getAllPrices(){return new Map(this.latestPrices)}getPricesObject(){const t={};for(const[n,r]of this.latestPrices)t[n]={price:r.price,changePercent:r.changePercent};return t}getSnapshot(t){var a;const n=this.latestPrices.get(t);if(!n)return null;const r=((a=this.priceHistory.get(t))==null?void 0:a.getLatest(20))??[];let s=0;if(r.length>=2){const l=r[0].price,c=r[r.length-1].price;s=(l-c)/c*100}let o=0;if(r.length>=5){let l=0,c=0;const d=r.length-1;for(let h=0;h<d;h++){const p=(r[h].price-r[h+1].price)/r[h+1].price;c=c+p}const u=c/d;for(let h=0;h<d;h++){const m=(r[h].price-r[h+1].price)/r[h+1].price-u;l=l+m*m}o=Math.sqrt(l/d)*100}return{symbol:t,current:n,momentum:s,volatility:o}}getHistory(t,n=100){var r;return((r=this.priceHistory.get(t))==null?void 0:r.getLatest(n))??[]}getMetrics(){const t=this.latencyCount>0?this.latencySum/this.latencyCount:0;return{avgLatency:t,minLatency:0,maxLatency:0,p95Latency:t*1.5,symbolCount:this.latestPrices.size,totalUpdates:this.updateCount,isActive:this.isActive,adaptiveInterval:this.adaptiveInterval}}async warmup(){await this.fetchPrices(),await new Promise(t=>setTimeout(t,15)),await this.fetchPrices()}}const ut=new VO,HO=66,XO=83,qO=90,GO=80,WO=70,KO=xl.SIGNAL_WINDOW_MS,YO=xl.SIGNAL_BATCH_INTERVAL_MS;let QO=0;
439class JO{constructor(){G(this,"signalQueue",new Array(512));G(this,"queueHead",0);G(this,"queueTail",0);G(this,"queueLen",0);G(this,"recentSignals",new Map);G(this,"consensusCache",new Map);G(this,"executionIntents",new Map);G(this,"consensusSubscribers",new Set);G(this,"intentSubscribers",new Set);G(this,"MIN_SIGNALS",1);G(this,"CONSENSUS_THRESHOLD",.5);G(this,"CONFIDENCE_THRESHOLD",70);G(this,"processCount",0);G(this,"totalProcessTime",0);G(this,"lastBatchTime",0);G(this,"isActive",!1);G(this,"channel",null);const t=["TSLAX","AAPLX","NVDAX","MSFTX","GOOGLX","AMZNX","METAX","COINX","MSTRX","AMDX","HOODX","CRMX","SHOPX","PLTX","NFLXX","UBERX","ABNBX","VISAX","MAX","TSLAon","AAPLon","NVDAon","MSFTon","GOOGLon","METAon","AMDon","COINon","LLYon","JPMon","BABAon","UNHon","HDon","COSTon","BTC","ETH","SOL","BNB","XRP","ADA","AVAX","DOGE","SPY","QQQ","SPYX","QQQX","ARKX","VOOon","VTIon"];let n=t.length;for(;n--;)this.recentSignals.set(t[n],[])}start(){this.isActive||(this.isActive=!0,this.lastBatchTime=performance.now(),this.scheduleNextBatch())}scheduleNextBatch(){this.isActive&&(this.channel=new MessageChannel,this.channel.port1.onmessage=()=>{if(!this.isActive)return;const t=performance.now();t-this.lastBatchTime>=YO&&(this.processBatch(),this.lastBatchTime=t),this.channel.port2.postMessage(null)},this.channel.port2.postMessage(null))}stop(){this.isActive=!1,this.channel=null}ingestSignal(t){const n=performance.now(),r=t.symbol,s=ut.getPrice(r),o={id:"s"+ ++QO,symbol:r,direction:t.direction,confidence:t.confidence,agentId:t.agentId,agentName:t.agentName,timestamp:n,price:s?s.price:0,metadata:t.metadata},a=this.queueLen;a<512?(this.signalQueue[this.queueTail]=o,this.queueTail=this.queueTail+1&511,this.queueLen=a+1):(this.signalQueue[this.queueHead]=o,this.queueHead=this.queueHead+1&511,this.queueTail=this.queueTail+1&511);let l=this.recentSignals.get(r);l||(l=[],this.recentSignals.set(r,l)),l[l.length]=o;const c=n-KO;let d=0;const u=l.length;for(let h=0;h<u;h++)l[h].timestamp>=c&&(l[d++]=l[h]);l.length=d}processBatch(){const t=performance.now(),n=this.queueLen;if(n===0)return;const r={},s=this.queueHead;for(let a=0;a<n;a++)r[this.signalQueue[s+a&511].symbol]=1;this.queueLen=0,this.queueHead=0,this.queueTail=0;for(const a in r){const l=this.calculateConsensus(a);if(!l)continue;this.consensusCache.set(a,l);for(const d of this.consensusSubscribers)d(l);if(l.direction!=="NEUTRAL"&&l.confidence>=this.CONFIDENCE_THRESHOLD){const d=this.generateExecutionIntent(l);if(d){this.executionIntents.set(a,d);for(const u of this.intentSubscribers)u(d)}}}const o=performance.now()-t;this.processCount=this.processCount+1,this.totalProcessTime=this.totalProcessTime+o}calculateConsensus(t){const n=this.recentSignals.get(t);if(!n)return null;const r=n.length;if(r<this.MIN_SIGNALS)return null;const s=performance.now();let o=0,a=0,l=0,c=0;for(let b=0;b<r;b++){const k=n[b],S=k.confidence*.01;c=c+S;const T=k.direction.charCodeAt(0);T===HO?o=o+S:T===XO?a=a+S:l=l+S}if(c===0)return null;const d=1/c,u=o*d,h=a*d,p=this.CONSENSUS_THRESHOLD;let m,x;if(u>=p)m="BUY",x=u*100;else if(h>=p)m="SELL",x=h*100;else{m="NEUTRAL";const b=l*d;x=(u>h?u>b?u:b:h>b?h:b)*100}let g=0,w=0;for(let b=0;b<r;b++){const k=n[b];k.direction===m&&(g=g+k.confidence,w=w+1)}const v=w>0?g/w|0:50,y=performance.now();return{symbol:t,direction:m,confidence:v,signalCount:r,agreementPct:x,signals:n,timestamp:y,latencyMs:y-s}}generateExecutionIntent(t){const n=ut.getPrice(t.symbol);if(!n)return null;const r=n.price,s=t.direction==="BUY",o=pu(t.confidence),a=Go[o],l=s?r*a.stopLossMultLong:r*a.stopLossMultShort,c=s?r*a.takeProfitMultLong:r*a.takeProfitMultShort,d=.1*a.positionSizeMultiplier,u=t.confidence,h=u>=qO?"CRITICAL":u>=GO?"HIGH":u>=WO?"MEDIUM":"LOW";return{symbol:t.symbol,side:s?"LONG":"SHORT",confidence:u,entryPrice:r,size:d,stopLoss:l,takeProfit:c,urgency:h,maxSlippage:a.maxSlippage,timestamp:performance.now()}}onConsensus(t){return this.consensusSubscribers.add(t),()=>this.consensusSubscribers.delete(t)}onExecutionIntent(t){return this.intentSubscribers.add(t),()=>this.intentSubscribers.delete(t)}getConsensus(t){return this.consensusCache.get(t)??null}getExecutionIntent(t){return this.executionIntents.get(t)??null}getRecentSignals(t){return this.recentSignals.get(t)??[]}getMetrics(){return{processCount:this.processCount,avgProcessTime:this.processCount>0?this.totalProcessTime/this.processCount:0,activeSymbols:this.recentSignals.size,pen
439dingSignals:this.queueLen,isActive:this.isActive}}}const bn=new JO;typeof window<"u"&&bn.start();function ZO(e,t,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(u){try{d(r.next(u))}catch(h){a(h)}}function c(u){try{d(r.throw(u))}catch(h){a(h)}}function d(u){u.done?o(u.value):s(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})}const eI=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class tg extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class tI extends tg{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Ly extends tg{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Dy extends tg{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var lm;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(lm||(lm={}));class nI{constructor(t,{headers:n={},customFetch:r,region:s=lm.Any}={}){this.url=t,this.headers=n,this.region=s,this.fetch=eI(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return ZO(this,arguments,void 0,function*(n,r={}){var s;let o,a;try{const{headers:l,method:c,body:d,signal:u,timeout:h}=r;let p={},{region:m}=r;m||(m=this.region);const x=new URL(`${this.url}/${n}`);m&&m!=="any"&&(p["x-region"]=m,x.searchParams.set("forceFunctionRegion",m));let g;d&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",g=d):typeof d=="string"?(p["Content-Type"]="text/plain",g=d):typeof FormData<"u"&&d instanceof FormData?g=d:(p["Content-Type"]="application/json",g=JSON.stringify(d)):d&&typeof d!="string"&&!(typeof Blob<"u"&&d instanceof Blob)&&!(d instanceof ArrayBuffer)&&!(typeof FormData<"u"&&d instanceof FormData)?g=JSON.stringify(d):g=d;let w=u;h&&(a=new AbortController,o=setTimeout(()=>a.abort(),h),u?(w=a.signal,u.addEventListener("abort",()=>a.abort())):w=a.signal);const v=yield this.fetch(x.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),l),body:g,signal:w}).catch(S=>{throw new tI(S)}),y=v.headers.get("x-relay-error");if(y&&y==="true")throw new Ly(v);if(!v.ok)throw new Dy(v);let b=((s=v.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),k;return b==="application/json"?k=yield v.json():b==="application/octet-stream"||b==="application/pdf"?k=yield v.blob():b==="text/event-stream"?k=v:b==="multipart/form-data"?k=yield v.formData():k=yield v.text(),{data:k,error:null,response:v}}catch(l){return{data:null,error:l,response:l instanceof Dy||l instanceof Ly?l.context:void 0}}finally{o&&clearTimeout(o)}})}}const yS=3,zy=e=>Math.min(1e3*2**e,3e4),rI=[520,503],xS=["GET","HEAD","OPTIONS"];var $y=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
439de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Fy(e,t){return new Promise(n=>{if(t!=null&&t.aborted){n();return}const r=setTimeout(()=>{t==null||t.removeEventListener("abort",s),n()},e);function s(){clearTimeout(r),n()}t==null||t.addEventListener("abort",s)})}function sI(e,t,n,r){return!(!r||n>=yS||!xS.includes(e)||!rI.includes(t))}var oI=class{constructor(e){var t,n,r,s,o;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(r=e.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(s=e.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(o=e.retry)!==null&&o!==void 0?o:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const a=this.headers.get("Accept");a==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!a||a==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let o=(async()=>{let a=0;for(;;){const d={};n.headers.forEach((h,p)=>{d[p]=h}),a>0&&(d["X-Retry-Count"]=String(a));let u;try{u=await r(n.url.toString(),{method:n.method,headers:d,body:JSON.stringify(n.body,(h,p)=>typeof p=="bigint"?p.toString():p),signal:n.signal})}catch(h){if((h==null?void 0:h.name)==="AbortError"||(h==null?void 0:h.code)==="ABORT_ERR"||!xS.includes(n.method))throw h;if(n.retryEnabled&&a<yS){const p=zy(a);a++,await Fy(p,n.signal);continue}throw h}if(sI(n.method,u.status,a,n.retryEnabled)){var l,c;const h=(l=(c=u.headers)===null||c===void 0?void 0:c.get("Retry-After"))!==null&&l!==void 0?l:null,p=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:zy(a);await u.text(),a++,await Fy(p,n.signal);continue}return await n.processResponse(u)}})();return this.shouldThrowOnError||(o=o.catch(a=>{var l;let c="",d="",u="";const h=a==null?void 0:a.cause;if(h){var p,m,x,g;const y=(p=h==null?void 0:h.message)!==null&&p!==void 0?p:"",b=(m=h==null?void 0:h.code)!==null&&m!==void 0?m:"";c=`${(x=a==null?void 0:a.name)!==null&&x!==void 0?x:"FetchError"}: ${a==null?void 0:a.message}`,c+=` 440 441Caused by: ${(g=h==null?void 0:h.name)!==null&&g!==void 0?g:"Error"}: ${y}`,b&&(c+=` (${b})`),h!=null&&h.stack&&(c+=` 442${h.stack}`)}else{var w;c=(w=a==null?void 0:a.stack)!==null&&w!==void 0?w:""}const v=this.url.toString().length;return(a==null?void 0:a.name)==="AbortError"||(a==null?void 0:a.code)==="ABORT_ERR"?(u="",d="Request was aborted (timeout or manual cancellation)",v>this.urlLengthLimit&&(d+=`. Note: Your request URL is ${v} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",d="HTTP headers exceeded server limits (typically 16KB)",v>this.urlLengthLimit&&(d+=`. Your request URL is ${v} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(l=a==null?void 0:a.name)!==null&&l!==void 0?l:"FetchError"}: ${a==null?void 0:a.message}`,details:c,hint:d,code:u},data:null,count:null,status:0,statusText:""}}
442)),o.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,s=null,o=e.status,a=e.statusText;if(e.ok){var l,c;if(t.method!=="HEAD"){var d;const p=await e.text();if(p!=="")if(t.headers.get("Accept")==="text/csv")r=p;else if(t.headers.get("Accept")&&(!((d=t.headers.get("Accept"))===null||d===void 0)&&d.includes("application/vnd.pgrst.plan+text")))r=p;else try{r=JSON.parse(p)}catch{if(n={message:p},r=null,t.shouldThrowOnError)throw new $y({message:p,details:"",hint:"",code:""})}}const u=(l=t.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),h=(c=e.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");u&&h&&h.length>1&&(s=parseInt(h[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,s=null,o=406,a="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const u=await e.text();try{n=JSON.parse(u),Array.isArray(n)&&e.status===404&&(r=[],n=null,o=200,a="OK")}catch{e.status===404&&u===""?(o=204,a="No Content"):n={message:u}}if(n&&t.shouldThrowOnError)throw new $y(n)}return{success:n===null,error:n,data:r,count:s,status:o,statusText:a}}returns(){return this}overrideTypes(){return this}},iI=class extends oI{throwOnError(){return super.throwOnError()}select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const o=s?`${s}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,o=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(o,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:s=!1,format:o="text"}={}){var a;const l=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${c}"; options=${l};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const By=new RegExp("[,()]");var bo=class extends iI{throwOnError(){return super.throwOnError()}eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&By.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&By.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const o=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${o}.${t}`),this}match(e){return Object.entries(e).filter(([t,n])=>
442n!==void 0).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},aI=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:s=8e3,retry:o}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=s,this.retry=o}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},s=n?"HEAD":"GET";let o=!1;const a=(e??"*").split("").map(d=>/\s/.test(d)&&!o?"":(d==='"'&&(o=!o),d)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",a),r&&c.append("Prefer",`count=${r}`),new bo({method:s,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const s="POST",{url:o,headers:a}=this.cloneRequestState();if(t&&a.append("Prefer",`count=${t}`),n||a.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(l.length>0){const c=[...new Set(l)].map(d=>`"${d}"`);o.searchParams.set("columns",c.join(","))}}return new bo({method:s,url:o,headers:a,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var o;const a="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),r&&c.append("Prefer",`count=${r}`),s||c.append("Prefer","missing=default"),Array.isArray(e)){const d=e.reduce((u,h)=>u.concat(Object.keys(h)),[]);if(d.length>0){const u=[...new Set(d)].map(h=>`"${h}"`);l.searchParams.set("columns",u.join(","))}}return new bo({method:a,url:l,headers:c,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var n;const r="PATCH",{url:s,headers:o}=this.cloneRequestState();return t&&o.append("Prefer",`count=${t}`),new bo({method:r,url:s,headers:o,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new bo({method:n,url:r,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Za(e){"@babel/helpers - typeof";return Za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Za(e)}function lI(e,t){if(Za(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Za(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cI(e){var t=lI(e,"string");return Za(t)=="symbol"?t:t+""}function dI(e,t,n){return(t=cI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Zl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uy(Object(n),!0).forEach(function(r){dI(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var uI=class bS{constructor(t,{headers:n={},schema:r,fetch:s,timeout:o,urlLengthLimit:a=8e3,retry:l}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=a;const c=s??globalThis.fetch;o!==void 0&&o>0?this.fetch=(d,u)=>{const h=new AbortController,p=setTimeout(()=>h.abort(),o),m=u==null?void 0:u.signal;if(m){if(m.aborted)return clearTimeout(p),c(d,u);const x=()=>{clearTimeout(p),h.abort()};return m.addEventListener("abort",x,{once:!0}),c(d,Zl(Zl({},u),{},{signal:h.signal})).finally(()=>{clearTimeout(p),m.removeEventListener("abort",x)})}return c(d,Zl(Zl({},u),{},{signal:h.signal})).finally(()=>clearTimeout(p))}:this.fetch=c,this.retry=l}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new aI(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new bS(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,n={},{head:r=!1,get:s=!1,count:o}={}){var a;let l;const c=new URL(`${this.url}/rpc/${t}`);let d;const u=m=>m!==null&&typeof m=="object"&&(!Array.isArray(m)||m.some(u)),h=r&&Object.values(n).some(u);h?(l="POST",d=n):r||s?(l=r?"HEAD":"GET",Object.entries(n).filter(([m,x])=>x!==void 0).map(([m,x])=>[m,Array.isArray(x)?`{${x.join(",")}}`:`${x}
442`]).forEach(([m,x])=>{c.searchParams.append(m,x)})):(l="POST",d=n);const p=new Headers(this.headers);return h?p.set("Prefer",o?`count=${o},return=minimal`:"return=minimal"):o&&p.set("Prefer",`count=${o}`),new bo({method:l,url:c,headers:p,schema:this.schemaName,body:d,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class hI{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const n=globalThis;if(typeof globalThis<"u"&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};const r=typeof global<"u"?global:void 0;if(r&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};if(typeof globalThis<"u"&&typeof n.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&n.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const s=globalThis.process;if(s){const o=s.versions;if(o&&o.node){const a=o.node,l=parseInt(a.replace(/^v/,"").split(".")[0]);return l>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${l} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${l} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 443import ws from "ws" 444new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=` 445 446Suggested solution: ${t.workaround}`),new Error(n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const fI="2.108.1",mI=`realtime-js/${fI}`,pI="1.0.0",wS="2.0.0",gI=wS,vI=1e4,yI=100,Dr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},kS={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},cm={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class xI{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},a=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(t,n,r){var s,o;const a=t.topic,l=(s=t.ref)!==null&&s!==void 0?s:"",c=(o=t.join_ref)!==null&&o!==void 0?o:"",d=t.payload.event,u=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},h=Object.keys(u).length===0?"":JSON.stringify(u);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+a.length+d.length+h.length,m=new ArrayBuffer(this.HEADER_LENGTH+p);let x=new DataView(m),g=0;x.setUint8(g++,this.KINDS.userBroadcastPush),x.setUint8(g++,c.length),x.setUint8(g++,l.length),x.setUint8(g++,a.length),x.setUint8(g++,d.length),x.setUint8(g++,h.length),x.setUint8(g++,n),Array.from(c,v=>x.setUint8(g++,v.charCodeAt(0))),Array.from(l,v=>x.setUint8(g++,v.charCodeAt(0))),Array.from(a,v=>
446x.setUint8(g++,v.charCodeAt(0))),Array.from(d,v=>x.setUint8(g++,v.charCodeAt(0))),Array.from(h,v=>x.setUint8(g++,v.charCodeAt(0)));var w=new Uint8Array(m.byteLength+r.byteLength);return w.set(new Uint8Array(m),0),w.set(new Uint8Array(r),m.byteLength),w.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[s,o,a,l,c]=r;return n({join_ref:s,ref:o,topic:a,event:l,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,s)}}_decodeUserBroadcast(t,n,r){const s=n.getUint8(1),o=n.getUint8(2),a=n.getUint8(3),l=n.getUint8(4);let c=this.HEADER_LENGTH+4;const d=r.decode(t.slice(c,c+s));c=c+s;const u=r.decode(t.slice(c,c+o));c=c+o;const h=r.decode(t.slice(c,c+a));c=c+a;const p=t.slice(c,t.byteLength),m=l===this.JSON_ENCODING?JSON.parse(r.decode(p)):p,x={type:this.BROADCAST_EVENT,event:u,payload:m};return a>0&&(x.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:d,event:this.BROADCAST_EVENT,payload:x}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}var Ce;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Ce||(Ce={}));const Vy=(e,t,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((o,a)=>(o[a]=bI(a,e,t,s),o),{}):{}},bI=(e,t,n,r)=>{const s=t.find(l=>
446l.name===e),o=s==null?void 0:s.type,a=n[e];return o&&!r.includes(o)?SS(o,a):dm(a)},SS=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return TI(t,n)}switch(e){case Ce.bool:return wI(t);case Ce.float4:case Ce.float8:case Ce.int2:case Ce.int4:case Ce.int8:case Ce.numeric:case Ce.oid:return kI(t);case Ce.json:case Ce.jsonb:return SI(t);case Ce.timestamp:return AI(t);case Ce.abstime:case Ce.date:case Ce.daterange:case Ce.int4range:case Ce.int8range:case Ce.money:case Ce.reltime:case Ce.text:case Ce.time:case Ce.timestamptz:case Ce.timetz:case Ce.tsrange:case Ce.tstzrange:return dm(t);default:return dm(t)}},dm=e=>e,wI=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},kI=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},SI=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},TI=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let o;const a=e.slice(1,n);try{o=JSON.parse("["+a+"]")}catch{o=a?a.split(","):[]}return o.map(l=>SS(t,l))}return e},AI=e=>typeof e=="string"?e.replace(" ","T"):e,TS=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var ba=e=>typeof e=="function"?e:function(){return e},EI=typeof self<"u"?self:null,wo=typeof window<"u"?window:null,Dn=EI||wo||globalThis,NI="2.0.0",CI=1e4,_I=1e3,Bn={connecting:0,open:1,closing:2,closed:3},_t={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},rr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},um={longpoll:"longpoll",websocket:"websocket"},jI={complete:4},hm="base64url.bearer.phx.",ec=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},AS=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},PI=class{constructor(e,t,n){this.state=_t.closed,this.topic=e,this.params=ba(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ec(this,rr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new AS(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=_t.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=_t.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=_t.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=_t.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new ec(this,rr.leave,ba({}),this.timeout).send(),this.state=_t.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(rr.reply,(r,s)=>{this.trigger(this.replyEventName(s),r)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}
vendor: 5,263 bytes, line 446
446teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=_t.closed,this.bindings=[]}onClose(e){this.on(rr.close,e)}onError(e){return this.on(rr.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(typeof t>"u"||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new ec(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=_t.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(rr.close,"leave")},n=new ec(this,rr.leave,ba({}),e);return n.receive("ok",()=>t()).receive("timeout",()=>t()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic!==e?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=_t.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let s=this.onMessage(e,t,n,r);if(t&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter(a=>a.event===e&&this.filterBindings(a,t,n));for(let a=0;a<o.length;a++)o[a].callback(s,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===_t.closed}isErrored(){return this.state===_t.errored}isJoined(){return this.state===_t.joined}isJoining(){return this.state===_t.joining}isLeaving(){return this.state===_t.leaving}},bd=class{static request(e,t,n,r,s,o,a){if(Dn.XDomainRequest){let l=new Dn.XDomainRequest;return this.xdomainRequest(l,e,t,r,s,o,a)}else if(Dn.XMLHttpRequest){let l=new Dn.XMLHttpRequest;return this.xhrRequest(l,e,t,n,r,s,o,a)}else{if(Dn.fetch&&Dn.AbortController)return this.fetchRequest(e,t,n,r,s,o,a);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,n,r,s,o,a){let l={method:e,headers:n,body:r},c=null;return s&&(c=new AbortController,setTimeout(()=>c.abort(),s),l.signal=c.signal),Dn.fetch(t,l).then(d=>d.text()).then(d=>this.parseJSON(d)).then(d=>a&&a(d)).catch(d=>{d.name==="AbortError"&&o?o():a&&a(null)}),c}static xdomainRequest(e,t,n,r,s,o,a){return e.timeout=s,e.open(t,n),e.onload=()=>{let l=this.parseJSON(e.responseText);a&&a(l)},o&&(e.ontimeout=o),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,s,o,a,l){e.open(t,n,!0),e.timeout=o;for(let[c,d]of Object.entries(r))e.setRequestHeader(c,d);return e.onerror=()=>l&&l(null),e.onreadystatechange=()=>{if(e.readyState===jI.complete&&l){let c=this.parseJSON(e.responseText);l(c)}},a&&(e.ontimeout=a),e.send(s),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let s=t?`${t}[${r}]`:r,o=e[r];typeof o=="object"?n.push(this.serialize(o,s)):n.push(encodeURIComponent(s)+"="+encodeURIComponent(o))}return n.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},RI=e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let s=0;s<r;s++)t+=String.fromCharCode(n[s]);return btoa(t)},fo=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(hm)&&(this.authToken=atob(t[1].slice(hm.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=Bn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+um.websocket),"$1/"+um.longpoll)}endpointURL(){return bd.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=Bn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Bn.open||this.readyState===Bn.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:n,token:r,messages:s}=t;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:s.forEach(o=>{setTimeout(()=>this.onmessage({data:o}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Bn.open,this.onopen({}),this.poll();break;
446case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(e){typeof e!="string"&&(e=RI(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(` 447`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let s of this.reqs)s.abort();this.readyState=Bn.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,s){let o,a=()=>{this.reqs.delete(o),r()};o=bd.request(e,this.endpointURL(),t,n,this.timeout,a,l=>{this.reqs.delete(o),this.isActive()&&s(l)}),this.reqs.add(o)}},OI=class ra{constructor(t,n={}){let r=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,s=>{let{onJoin:o,onLeave:a,onSync:l}=this.caller;this.joinRef=this.channel.joinRef(),this.state=ra.syncState(this.state,s,o,a),this.pendingDiffs.forEach(c=>{this.state=ra.syncDiff(this.state,c,o,a)}),this.pendingDiffs=[],l()}),this.channel.on(r.diff,s=>{let{onJoin:o,onLeave:a,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=ra.syncDiff(this.state,s,o,a),l())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return ra.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,n,r,s){let o=this.clone(t),a={},l={};return this.map(o,(c,d)=>{n[c]||(l[c]=d)}),this.map(n,(c,d)=>{let u=o[c];if(u){let h=d.metas.map(g=>g.phx_ref),p=u.metas.map(g=>g.phx_ref),m=d.metas.filter(g=>p.indexOf(g.phx_ref)<0),x=u.metas.filter(g=>h.indexOf(g.phx_ref)<0);m.length>0&&(a[c]=d,a[c].metas=m),x.length>0&&(l[c]=this.clone(u),l[c].metas=x)}else a[c]=d}),this.syncDiff(o,{joins:a,leaves:l},r,s)}static syncDiff(t,n,r,s){let{joins:o,leaves:a}=this.clone(n);return r||(r=function(){}),s||(s=function(){}),this.map(o,(l,c)=>{let d=t[l];if(t[l]=this.clone(c),d){let u=t[l].metas.map(p=>p.phx_ref),h=d.metas.filter(p=>u.indexOf(p.phx_ref)<0);t[l].metas.unshift(...h)}r(l,d,c)}),this.map(a,(l,c)=>{let d=t[l];if(!d)return;let u=c.metas.map(h=>h.phx_ref);d.metas=d.metas.filter(h=>u.indexOf(h.phx_ref)<0),s(l,d,c),d.metas.length===0&&delete t[l]}),t}static list(t,n){return n||(n=function(r,s){return s}),this.map(t,(r,s)=>n(r,s))}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static clone(t){return JSON.parse(JSON.stringify(t))}},tc={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,s,o,a]=JSON.parse(e);return t({join_ref:n,ref:r,topic:s,event:o,payload:a})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:s,payload:o}=e,a=this.META_LENGTH+t.length+n.length+s.length+r.length,l=new ArrayBuffer(this.HEADER_LENGTH+a),c=new DataView(l),d=0;c.setUint8(d++,this.KINDS.push),c.setUint8(d++,t.length),c.setUint8(d++,n.length),c.setUint8(d++,s.length),c.setUint8(d++,r.length),Array.from(t,h=>c.setUint8(d++,h.charCodeAt(0))),Array.from(n,h=>c.setUint8(d++,h.charCodeAt(0))),Array.from(s,h=>c.setUint8(d++,h.charCodeAt(0))),Array.from(r,h=>c.setUint8(d++,h.charCodeAt(0)));var u=new Uint8Array(l.byteLength+o.byteLength);return u.set(new Uint8Array(l),0),u.set(new Uint8Array(o),l.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}}
447,decodePush(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),o=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,l=n.decode(e.slice(a,a+r));a=a+r;let c=n.decode(e.slice(a,a+s));a=a+s;let d=n.decode(e.slice(a,a+o));a=a+o;let u=e.slice(a,e.byteLength);return{join_ref:l,ref:null,topic:c,event:d,payload:u}},decodeReply(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),o=t.getUint8(3),a=t.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(l,l+r));l=l+r;let d=n.decode(e.slice(l,l+s));l=l+s;let u=n.decode(e.slice(l,l+o));l=l+o;let h=n.decode(e.slice(l,l+a));l=l+a;let p=e.slice(l,e.byteLength),m={status:h,response:p};return{join_ref:c,ref:d,topic:u,event:rr.reply,payload:m}},decodeBroadcast(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),o=this.HEADER_LENGTH+2,a=n.decode(e.slice(o,o+r));o=o+r;let l=n.decode(e.slice(o,o+s));o=o+s;let c=e.slice(o,e.byteLength);return{join_ref:null,ref:null,topic:a,event:l,payload:c}}},II=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||CI,this.transport=t.transport||Dn.WebSocket||fo,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=Dn&&Dn.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=tc.encode.bind(tc),this.defaultDecoder=tc.decode.bind(tc),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==fo?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;wo&&wo.addEventListener&&(wo.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),r=this.connectClock)}),wo.addEventListener("pageshow",s=>{r===this.connectClock&&(r=null,this.connect())}),wo.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,o,a)=>{console.log(`${s}: ${o}`,a)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=ba(t.params||{}),this.endPoint=`${e}/${um.websocket}`,this.vsn=t.vsn||NI,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new AS(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return fo}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=bd.appendParams(bd.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=ba(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==fo?this.connectWithF
vendor: 4,379 bytes, line 447
447allback(fo,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage(s=>{s.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case fo:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${hm}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,s,o,a=this.transportName(e),l=c=>{this.log("transport",`falling back to ${a}...`,c),this.off([s,o]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return l("memorized");this.fallbackTimer=setTimeout(l,t),o=this.onError(c=>{this.log("transport","error",c),r&&!n&&(clearTimeout(this.fallbackTimer),l(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let c=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(l,t),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),_I,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();const r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===Bn.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}
447triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(rr.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case Bn.connecting:return"connecting";case Bn.open:return"open";case Bn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([n])=>e.indexOf(n)===-1)}channel(e,t={}){let n=new PI(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:s,join_ref:o}=e;this.log("push",`${t} ${n} (${o}, ${s})`,r)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:n,event:r,payload:s,ref:o,join_ref:a}=t;if(o&&o===this.pendingHeartbeatRef){const l=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",l)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${n} ${r} ${o&&"("+o+")"||""}`.trim(),s);for(let l=0;l<this.channels.length;l++){const c=this.channels[l];c.isMember(n,r,s,a)&&c.trigger(r,s,o,a)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}leaveOpenTopic(e){let t=this.channels.find(n=>n.topic===e&&(n.isJoined()||n.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class wa{constructor(t,n){const r=LI(n);this.presence=new OI(t.getChannel(),r),this.presence.onJoin((s,o,a)=>{const l=wa.onJoinPayload(s,o,a);t.getChannel().trigger("presence",l)}),this.presence.onLeave((s,o,a)=>{const l=wa.onLeavePayload(s,o,a);t.getChannel().trigger("presence",l)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return wa.transformState(this.presence.state)}static transformState(t){return t=MI(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const s=t[r];return n[r]=Oc(s),n},{})}static onJoinPayload(t,n,r){const s=Hy(n),o=Oc(r);return{event:"join",key:t,currentPresences:s,newPresences:o}}static onLeavePayload(t,n,r){const s=Hy(n),o=Oc(r);return{event:"leave",key:t,currentPresences:s,leftPresences:o}}}function Oc(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function MI(e){return JSON.parse(JSON.stringify(e))}function LI(e){return(e==null?void 0:e.events)&&{events:e.events}}function Hy(e){return e!=null&&e.metas?Oc(e):[]}var Xy;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Xy||(Xy={}));class DI{get state(){return this.presenceAdapter.state}constructor(t,n){this.channel=t,this.presenceAdapter=new wa(this.channel.channelAdapter,n)}}function zI(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);
447if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const n=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${n}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class $I{constructor(t,n,r){const s=FI(r);this.channel=t.getSocket().channel(n,s),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,n){return this.channel.on(t,n)}off(t,n){this.channel.off(t,n)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,n,r){let s;try{s=this.channel.push(t,n,r)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>yI){const o=this.channel.pushBuffer.shift();o.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${o.event}`,o.payload())}return s}updateJoinPayload(t){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),t)}canPush(){return this.socket.isConnected()&&this.state===Dr.joined}isJoined(){return this.state===Dr.joined}isJoining(){return this.state===Dr.joining}isClosed(){return this.state===Dr.closed}isLeaving(){return this.state===Dr.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function FI(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var qy;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(qy||(qy={}));var Lo;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Lo||(Lo={}));var sr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(sr||(sr={}));class ka{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,n={config:{}},r){var s,o;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new $I(this.socket.socketAdapter,t,this.params),this.presence=new DI(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=TS(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((o=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||o===void 0)&&o.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,n=this.timeout){var r,s,o;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:a,presence:l,private:c}}=this.params,d=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(m=>m.filter))!==null&&s!==void 0?s:[],u=!!this.bindings[Lo.PRESENCE]&&this.bindings[Lo.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,h={},p={broadcast:a,presence:Object.assign(Object.assign({},l),{enabled:u}),postgres_changes:d,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(m=>{t==null||t(sr.CHANNEL_ERROR,zI(m))}),this._onClose(()=>t==null?void 0:t(sr.CLOSED)),this.updateJoinPayload(Object.assign({config:p},h)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:m})=>
447{if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){t==null||t(sr.SUBSCRIBED);return}this._updatePostgresBindings(m,t)}).receive("error",m=>{this.state=Dr.errored;const x=Object.values(m).join(", ")||"error";t==null||t(sr.CHANNEL_ERROR,new Error(x,{cause:m}))}).receive("timeout",()=>{t==null||t(sr.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){var r;const s=this.bindings.postgres_changes,o=(r=s==null?void 0:s.length)!==null&&r!==void 0?r:0,a=[];for(let l=0;l<o;l++){const c=s[l],{filter:{event:d,schema:u,table:h,filter:p}}=c,m=t&&t[l];if(m&&m.event===d&&ka.isFilterValueEqual(m.schema,u)&&ka.isFilterValueEqual(m.table,h)&&ka.isFilterValueEqual(m.filter,p))a.push(Object.assign(Object.assign({},c),{id:m.id}));else{this.unsubscribe(),this.state=Dr.errored,n==null||n(sr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=a,this.state!=Dr.errored&&n&&n(sr.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),o=t===Lo.PRESENCE||t===Lo.POSTGRES_CHANGES;if(s&&o)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,n,r)}async httpSend(t,n,r={}){var s;if(n==null)return Promise.reject(new Error("Payload is required for httpSend()"));const o=n instanceof ArrayBuffer||ArrayBuffer.isView(n),a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":o?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l=new URL(this.broadcastEndpointURL);l.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(t)}`,this.private&&l.searchParams.set("private","true");const c={method:"POST",headers:a,body:o?n:JSON.stringify(n)},d=await this._fetchWithTimeout(l.toString(),c,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(d.status===202)return{success:!0};let u=d.statusText;try{const h=await d.json();u=h.error||h.message||u}catch{}return Promise.reject(new Error(u))}async send(t,n={}){var r,s;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated
447in the future. Please use httpSend() explicitly for REST delivery.");const{event:o,payload:a}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:a,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=d.body)===null||s===void 0?void 0:s.cancel()),d.ok?"ok":"error"}catch(d){return d instanceof Error&&d.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var a,l,c;const d=this.channelAdapter.push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(a=this.params)===null||a===void 0?void 0:a.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&o("ok"),d.receive("ok",()=>o("ok")),d.receive("error",()=>o("error")),d.receive("timeout",()=>o("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,n,r){const s=new AbortController,o=setTimeout(()=>s.abort(),r),a=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(o),a}_on(t,n,r){const s=t.toLocaleLowerCase(),o=this.channelAdapter.on(t,r),a={type:s,filter:n,callback:r,ref:o};return this.bindings[s]?this.bindings[s].push(a):this.bindings[s]=[a],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,n,r)=>{var s,o,a,l,c,d,u;const h=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,r))return!1;const p=(s=this.bindings[h])===null||s===void 0?void 0:s.find(m=>m.ref===t.ref);if(!p)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in p){const m=p.id,x=(o=p.filter)===null||o===void 0?void 0:o.event;return m&&((a=n.ids)===null||a===void 0?void 0:a.includes(m))&&(x==="*"||(x==null?void 0:x.toLocaleLowerCase())===((l=n.data)===null||l===void 0?void 0:l.type.toLocaleLowerCase()))}else{const m=(d=(c=p==null?void 0:p.filter)===null||c===void 0?void 0:c.event)===null||d===void 0?void 0:d.toLocaleLowerCase();return m==="*"||m===((u=n==null?void 0:n.event)===null||u===void 0?void 0:u.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===h})}_notThisChannelEvent(t,n){const{close:r,error:s,leave:o,join:a}=kS;return n&&[r,s,o,a].includes(t)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,n,r)=>{if(typeof n=="object"&&"ids"in n){const s=n.data,{schema:o,table:a,commit_timestamp:l,type:c,errors:d}=s;return Object.assign(Object.assign({},{schema:o,table:a,commit_timestamp:l,eventType:c,new:{},old:{},errors:d}),this._getPayloadRecords(s))}return n})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in t.bindings)for(const r of t.bindings[n])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=Vy(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=Vy(t.columns,t.old_record)),n}}class BI{constructor(t,n){this.socket=new II(t,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,n,r,s=1e4){return new Promise(o=>{setTimeout(()=>
447o("timeout"),s),this.socket.disconnect(()=>{t(),o("ok")},n,r)})}push(t){this.socket.push(t)}log(t,n,r){this.socket.log(t,n,r)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==cm.connecting}isDisconnecting(){return this.socket.connectionState()==cm.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Gy={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},UI=[1e3,2e3,5e3,1e4],VI=1e4;function HI(){const e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){var n;return(n=Array.from(e.keys())[t])!==null&&n!==void 0?n:null},removeItem(t){e.delete(t)},setItem(t,n){e.set(t,String(n))}}}function XI(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return HI()}const qI=` 448 addEventListener("message", (e) => { 449 if (e.data.event === "start") { 450 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 451 } 452 });`;class GI{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,n){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new xI,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=o=>o?(...a)=>o(...a):(...a)=>fetch(...a),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const s=this._initializeOptions(n);this.socketAdapter=new BI(t,s),this.httpEndpoint=TS(t),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const n=t.message;throw n.includes("Node.js")?new Error(`${n} 453 454To use Realtime in Node.js, you need to provide a WebSocket implementation: 455 456Option 1: Use Node.js 22+ which has native WebSocket support 457Option 2: Install and provide the "ws" package: 458 459 npm install ws 460 461 import ws from "ws" 462 const client = new RealtimeClient(url, { 463 ...options, 464 transport: ws 465 })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,n){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,n)}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return n==="ok"&&t.teardown(),n}async removeAllChannels(){const t=this.channels.map(async r=>{const s=await r.unsubscribe();return r.teardown(),s}),n=await Promise.all(t);return await this.disconnect(),n}log(t,n,r){this.socketAdapter.log(t,n,r)}connectionState(){return this.socketAdapter.connectionState()||cm.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,n={config:{}}){const r=`realtime:${t}`,s=this.getChannels().find(o=>o.topic===r);if(s)return s;{const o=new ka(`realtime:${t}`,n,this);return this._cancelPendingDisconnect(),this.channels.push(o),o}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
465this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(s=>{const o={access_token:n,version:mI};n&&s.updateJoinPayload(o),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(kS.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(n,r)=>{n=="sent"&&this._setAuthSafely(),t&&t(n,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([qI],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(t){var n,r,s,o,a,l,c,d,u,h,p,m;this.worker=(n=t==null?void 0:t.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=t==null?void 0:t.accessToken)!==null&&r!==void 0?r:null;const x={};x.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:vI,x.heartbeatIntervalMs=(o=t==null?void 0:t.heartbeatIntervalMs)!==null&&o!==void 0?o:Gy.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(a=t==null?void 0:t.disconnectOnEmptyChannelsAfterMs)!==null&&a!==void 0?a:2*((l=t==null?void 0:t.heartbeatIntervalMs)!==null&&l!==void 0?l:Gy.HEARTBEAT_INTERVAL),x.transport=(c=t==null?void 0:t.transport)!==null&&c!==void 0?c:hI.getWebSocketConstructor(),x.params=t==null?void 0:t.params,x.logger=t==null?void 0:t.logger,x.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),x.sessionStorage=(d=t==null?void 0:t.sessionStorage)!==null&&d!==void 0?d:XI(),x.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:y=>UI[y-1]||VI;let g,w;const v=(h=t==null?void 0:t.vsn)!==null&&h!==void 0?h:gI;switch(v){case pI:g=(y,b)=>b(JSON.stringify(y)),w=(y,b)=>b(JSON.parse(y));break;case wS:g=this.serializer.encode.bind(this.serializer),w=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${x.vsn}`)}if(x.vsn=v,x.encode=(p=t==null?void 0:t.encode)!==null&&p!==void 0?p:g,x.decode=(m=t==null?void 0:t.decode)!==null&&m!==void 0?m:w,x.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,x.params=Object.assign(Object.assign({},x.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,x.autoSendHeartbeat=!this.worker}return x}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
465var el=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function WI(e,t,n){const r=new URL(t,e);if(n)for(const[s,o]of Object.entries(n))o!==void 0&&r.searchParams.set(s,o);return r.toString()}async function KI(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function YI(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:o,headers:a}){const l=WI(e.baseUrl,r,s),c=await KI(e.auth),d=await t(l,{method:n,headers:{...o?{"Content-Type":"application/json"}:{},...c,...a},body:o?JSON.stringify(o):void 0}),u=await d.text(),h=(d.headers.get("content-type")||"").includes("application/json"),p=h&&u?JSON.parse(u):u;if(!d.ok){const m=h?p:void 0,x=m==null?void 0:m.error;throw new el((x==null?void 0:x.message)??`Request failed with status ${d.status}`,{status:d.status,icebergType:x==null?void 0:x.type,icebergCode:x==null?void 0:x.code,details:m})}return{status:d.status,headers:d.headers,data:p}}}}function nc(e){return e.join("�")}var QI=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:nc(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${nc(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${nc(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${nc(e.namespace)}`}),!0}catch(t){if(t instanceof el&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof el&&n.status===409)return;throw n}}};function mo(e){return e.join("�")}var JI=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${mo(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${mo(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${mo(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${mo(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${mo(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${mo(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof el&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof el&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},ZI=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=YI({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new QI(this.client,t),this.tableOps=new JI(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
465async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function tl(e){"@babel/helpers - typeof";return tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tl(e)}function e5(e,t){if(tl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(tl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function t5(e){var t=e5(e,"string");return tl(t)=="symbol"?t:t+""}function n5(e,t,n){return(t=t5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wy(Object(n),!0).forEach(function(r){n5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var gu=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function vu(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var fm=class extends gu{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return ce({},super.toJSON())}},ES=class extends gu{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function wd(e,t,n){const r=ce({},e),s=t.toLowerCase();for(const o of Object.keys(r))o.toLowerCase()===s&&delete r[o];return r[s]=n,r}function r5(e){const t={};for(const[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}const s5=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),o5=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},mm=e=>{if(Array.isArray(e))return e.map(n=>mm(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));t[s]=mm(r)}),t},i5=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),Ky=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const n=t.error;if(typeof n.message=="string")return n.message}}return JSON.stringify(e)},a5=async(e,t,n,r)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const s=e;let o=parseInt(String(s.status),10);Number.isFinite(o)||(o=500),s.json().then(a=>{const l=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||o+"";t(new fm(Ky(a),o,l,r))}).catch(()=>{const a=o+"";t(new fm(s.statusText||`HTTP ${o} error`,o,a,r))})}else t(new ES(Ky(e),e,r))},l5=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!r)return ce(ce({},s),n);if(o5(r)){var o;const a=(t==null?void 0:t.headers)||{};let l;for(const[c,d]of Object.entries(a))c.toLowerCase()==="content-type"&&(l=d);s.headers=wd(a,"Content-Type",(o=l)!==null&&o!==void 0?o:"application/json"),s.body=JSON.stringify(r)}else s.body=r;return t!=null&&t.duplex&&(s.duplex=t.duplex),ce(ce({},s),n)};async function Wi(e,t,n,r,s,o,a){return new Promise((l,c)=>{e(n,l5(t,r,s,o)).then(d=>{if(!d.ok)throw d;if(r!=null&&r.noResolveJson)return d;if(a==="vectors"){const u=d.headers.get("content-type");if(d.headers.get("content-length")==="0"||d.status===204)return{};if(!u||!u.includes("application/json"))return{}}return d.json()}).then(d=>l(d)).catch(d=>a5(d,c,r,a))})}function NS(e="storage"){return{get:async(t,n,r,s)=>Wi(t,"GET",n,r,s,void 0,e),post:async(t,n,r,s,o)=>Wi(t,"POST",n,s,o,r,e),put:async(t,n,r,s,o)=>Wi(t,"PUT",n,s,o,r,e),head:async(t,n,r,s)=>Wi(t,"HEAD",n,ce(ce({},r),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,n,r,s,o)=>Wi(t,"DELETE",n,s,o,r,e)}}const c5=NS("storage"),{get:nl,post:wn,put:pm,head:d5,remove:ng}=c5,$t=NS("vectors");var ji=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=r5(t),this.fetch=s5(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=wd(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(vu(n))return{data:null,error:n};throw n}}};let CS;CS=Symbol.toStringTag;var u5=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[
465CS]="StreamDownloadBuilder",this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(vu(t))return{data:null,error:t};throw t}}};let _S;_S=Symbol.toStringTag;var h5=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[_S]="BlobDownloadBuilder",this.promise=null}asStream(){return new u5(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(vu(t))return{data:null,error:t};throw t}}};const f5={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Yy={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var m5=class extends ji{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var s=this;return s.handleOperation(async()=>{let o;const a=ce(ce({},Yy),r);let l=ce(ce({},s.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const c=a.metadata;if(typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",a.cacheControl),c&&o.append("metadata",s.encodeMetadata(c)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.has("cacheControl")||o.append("cacheControl",a.cacheControl),c&&!o.has("metadata")&&o.append("metadata",s.encodeMetadata(c))):(o=n,l["cache-control"]=`max-age=${a.cacheControl}`,l["content-type"]=a.contentType,c&&(l["x-metadata"]=s.toBase64(s.encodeMetadata(c))),(typeof ReadableStream<"u"&&o instanceof ReadableStream||o&&typeof o=="object"&&"pipe"in o&&typeof o.pipe=="function")&&!a.duplex&&(a.duplex="half")),r!=null&&r.headers)for(const[p,m]of Object.entries(r.headers))l=wd(l,p,m);const d=s._removeEmptyFolders(t),u=s._getFinalPath(d),h=await(e=="PUT"?pm:wn)(s.fetch,`${s.url}/object/${u}`,o,ce({headers:l},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:d,id:h.Id,fullPath:h.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var s=this;const o=s._removeEmptyFolders(e),a=s._getFinalPath(o),l=new URL(s.url+`/object/upload/sign/${a}`);return l.searchParams.set("token",t),s.handleOperation(async()=>{let c;const d=ce(ce({},Yy),r);let u=ce(ce({},s.headers),{"x-upsert":String(d.upsert)});const h=d.metadata;if(typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",d.cacheControl),h&&c.append("metadata",s.encodeMetadata(h)),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.has("cacheControl")||c.append("cacheControl",d.cacheControl),h&&!c.has("metadata")&&c.append("metadata",s.encodeMetadata(h))):(c=n,u["cache-control"]=`max-age=${d.cacheControl}`,u["content-type"]=d.contentType,h&&(u["x-metadata"]=s.toBase64(s.encodeMetadata(h))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!d.duplex&&(d.duplex="half")),r!=null&&r.headers)for(const[p,m]of Object.entries(r.headers))u=wd(u,p,m);return{path:o,fullPath:(await pm(s.fetch,l.toString(),c,ce({headers:u},d!=null&&d.duplex?{duplex:d.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const s=ce({},n.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const o=await wn(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),a=new URL(n.url+o.url),l=a.searchParams.get("token");if(!l)throw new gu("No token returned by API");return{signedUrl:a.toString(),path:e,token:l}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await wn(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
465stinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await wn(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(e);const o=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let a=await wn(r.fetch,`${r.url}/object/sign/${s}`,ce({expiresIn:t},o?{transform:n.transform}:{}),{headers:r.headers});const l=new URLSearchParams;n!=null&&n.download&&l.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&l.set("cacheNonce",String(n.cacheNonce));const c=l.toString();return{signedUrl:encodeURI(`${r.url}${a.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const s=await wn(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),o=new URLSearchParams;n!=null&&n.download&&o.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&o.set("cacheNonce",String(n.cacheNonce));const a=o.toString();return s.map(l=>ce(ce({},l),{},{signedUrl:l.signedURL?encodeURI(`${r.url}${l.signedURL}${a?`&${a}`:""}`):null}))})}download(e,t,n){const r=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const o=s.toString(),a=this._getFinalPath(e),l=()=>nl(this.fetch,`${this.url}/${r}/${a}${o?`?${o}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new h5(l,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>mm(await nl(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await d5(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(vu(s)){var r;const o=s instanceof fm?s.status:s instanceof ES?(r=s.originalError)===null||r===void 0?void 0:r.status:void 0;if(o!==void 0&&[400,404].includes(o))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=new URLSearchParams;t!=null&&t.download&&r.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(r,t.transform),(t==null?void 0:t.cacheNonce)!=null&&r.set("cacheNonce",String(t.cacheNonce));const s=r.toString(),o=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${n}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await ng(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const s=ce(ce(ce({},f5),t),{},{prefix:e||""});return await wn(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=ce({},e);return await wn(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const p5="2.108.1",bl={"X-Client-Info":`storage-js/${p5}`};var g5=class extends ji{constructor(e,t={},n,r){const s=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const o=s.href.replace(/\/$/,""),a=ce(ce({},bl),t);super(o,a,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await nl(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await nl(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await wn(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await pm(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await wn(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await ng(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},v5=class extends ji{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ce(ce({},bl),t);super(r,s,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await wn(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),s=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await nl(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await ng(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!i5(e))throw new gu("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new ZI({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}
465),r=this.shouldThrowOnError;return new Proxy(n,{get(s,o){const a=s[o];return typeof a!="function"?a:async(...l)=>{try{return{data:await a.apply(s,l),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},y5=class extends ji{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ce(ce({},bl),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await $t.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await $t.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},x5=class extends ji{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ce(ce({},bl),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await $t.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await $t.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await $t.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await $t.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await $t.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},b5=class extends ji{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ce(ce({},bl),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await $t.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await $t.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await $t.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await $t.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},w5=class extends b5{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new k5(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},k5=class extends y5{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new S5(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}
465,S5=class extends x5{constructor(e,t,n,r,s){super(e,t,s),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},T5=class extends g5{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new m5(this.url,this.headers,e,this.fetch)}get vectors(){return new w5(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new v5(this.url+"/iceberg",this.headers,this.fetch)}};function yu(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}const jS="2.108.1",jr=30*1e3,sa=3,yh=sa*jr,A5="http://localhost:9999",E5="supabase.auth.token",N5={"X-Client-Info":`gotrue-js/${jS}`},gm="X-Supabase-Api-Version",PS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},C5=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,_5=10*60*1e3;class rl extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function W(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class j5 extends rl{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function P5(e){return W(e)&&e.name==="AuthApiError"}class An extends rl{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Yn extends rl{constructor(t,n,r,s){super(t,r,s),this.name=n,this.status=r}}class st extends Yn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function rc(e){return W(e)&&e.name==="AuthSessionMissingError"}class po extends Yn{constructor(){super("Auth session or user missing","AuthInvalidToken
465ResponseError",500,void 0)}}class sc extends Yn{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class oc extends Yn{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function R5(e){return W(e)&&e.name==="AuthImplicitGrantRedirectError"}class Qy extends Yn{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class O5 extends Yn{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class vm extends Yn{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function xh(e){return W(e)&&e.name==="AuthRetryableFetchError"}class Jy extends Yn{constructor(t="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(t,"AuthRefreshDiscardedError",409,void 0)}}function I5(e){return W(e)&&e.name==="AuthRefreshDiscardedError"}class Zy extends Yn{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class kd extends Yn{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Sd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),e0=` 466\r=`.split(""),M5=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<e0.length;t+=1)e[e0[t].charCodeAt(0)]=-2;for(let t=0;t<Sd.length;t+=1)e[Sd[t].charCodeAt(0)]=t;return e})();function t0(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Sd[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Sd[r]),t.queuedBits-=6}}function RS(e,t,n){const r=M5[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function n0(e){const t=[],n=a=>{t.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=a=>{z5(a,r,n)};for(let a=0;a<e.length;a+=1)RS(e.charCodeAt(a),s,o);return t.join("")}function L5(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function D5(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}L5(r,t)}}function z5(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function Ko(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)RS(e.charCodeAt(s),n,r);return new Uint8Array(t)}function $5(e){const t=[];return D5(e,n=>t.push(n)),new Uint8Array(t)}function Ls(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};return e.forEach(s=>t0(s,n,r)),t0(null,n,r),t.join("")}function F5(e){return Math.round(Date.now()/1e3)+e}function B5(){return Symbol("auth-callback")}const xt=()=>typeof window<"u"&&typeof document<"u",Es={tested:!1,writable:!1},OS=()=>
466{if(!xt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Es.tested)return Es.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Es.tested=!0,Es.writable=!0}catch{Es.tested=!0,Es.writable=!1}return Es.writable};function U5(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,o)=>{t[o]=s})}catch{}return n.searchParams.forEach((r,s)=>{t[s]=r}),t}const IS=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),V5=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",ko=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Zn=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},He=async(e,t)=>{await e.removeItem(t)};class xu{constructor(){this.promise=new xu.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}xu.promiseConstructor=Promise;function ic(e){const t=e.split(".");if(t.length!==3)throw new kd("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!C5.test(t[r]))throw new kd("JWT not in base64url format");return{header:JSON.parse(n0(t[0])),payload:JSON.parse(n0(t[1])),signature:Ko(t[2]),raw:{header:t[0],payload:t[1]}}}async function H5(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function X5(e,t){return new Promise((r,s)=>{(async()=>{for(let o=0;o<1/0;o++)try{const a=await e(o);if(!t(o,null,a)){r(a);return}}catch(a){if(!t(o,a)){s(a);return}}})()})}function q5(e){return("0"+e.toString(16)).substr(-2)}function G5(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let o=0;o<56;o++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(t),Array.from(t,q5).join("")}async function W5(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(o=>String.fromCharCode(o)).join("")}async function K5(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await W5(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ns(e,t,n=!1){const r=G5();let s=r;n&&(s+="/recovery"),await ko(e,`${t}-code-verifier`,s);const o=await K5(r);return[o,r===o?"plain":"s256"]}const Y5=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Q5(e){const t=e.headers.get(gm);if(!t||!t.match(Y5))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function J5(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function Z5(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const eM=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function er(e){if(!eM.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function gn(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function bh(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function tM(e,t){return new Proxy(e,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;
466if(typeof r=="symbol"){const o=r.toString();if(o==="Symbol(Symbol.toPrimitive)"||o==="Symbol(Symbol.toStringTag)"||o==="Symbol(util.inspect.custom)"||o==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!t.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,r,s)}})}function r0(e){return JSON.parse(JSON.stringify(e))}const Ps=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},nM=[502,503,504,520,521,522,523,524,530];async function s0(e){var t;if(!V5(e))throw new vm(Ps(e),0);if(nM.includes(e.status))throw new vm(Ps(e),e.status);let n;try{n=await e.json()}catch(o){throw new An(Ps(o),o)}let r;const s=Q5(e);if(s&&s.getTime()>=PS["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new Zy(Ps(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new st}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((o,a)=>o&&typeof a=="string",!0))throw new Zy(Ps(n),e.status,n.weak_password.reasons);throw new j5(Ps(n),e.status||500,r)}const rM=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function te(e,t,n,r){var s;const o=Object.assign({},r==null?void 0:r.headers);o[gm]||(o[gm]=PS["2024-01-01"].name),r!=null&&r.jwt&&(o.Authorization=`Bearer ${r.jwt}`);const a=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(a.redirect_to=r.redirectTo);const l=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",c=await sM(e,t,n+l,{headers:o,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function sM(e,t,n,r,s,o){const a=rM(t,r,s,o);let l;try{l=await e(n,Object.assign({},a))}catch(c){throw console.error(c),new vm(Ps(c),0)}if(l.ok||await s0(l),r!=null&&r.noResolveJson)return l;try{return await l.json()}catch(c){await s0(c)}}function Yt(e){var t;let n=null;aM(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=F5(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:typeof(e==null?void 0:e.id)=="string"?e:null;return{data:{session:n,user:r},error:null}}function o0(e){const t=Yt(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function zr(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function oM(e){return{data:e,error:null}}function iM(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:o}=e,a=yu(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:o},c=Object.assign({},a);return{data:{properties:l,user:c},error:null}}function i0(e){return e}function aM(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const wh=["global","local","others"];class lM{constructor({url:t="",headers:n={},fetch:r,experimental:s}){this.url=t,this.headers=n,this.fetch=IS(r),this.experimental=s??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}
466async signOut(t,n=wh[0]){if(wh.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${wh.join(", ")}`);try{return await te(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(W(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await te(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:zr})}catch(r){if(W(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=yu(t,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await te(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:iM,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(W(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await te(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:zr})}catch(n){if(W(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,s,o,a,l,c;try{const d={nextPage:null,lastPage:0,total:0},u=await te(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:i0});if(u.error)throw u.error;const h=await u.json(),p=(a=u.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(c=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(x=>{const g=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(x.split(";")[1].split("=")[1]);d[`${w}Page`]=g}),d.total=parseInt(p)),{data:Object.assign(Object.assign({},h),d),error:null}}catch(d){if(W(d))return{data:{users:[]},error:d};throw d}}async getUserById(t){er(t);try{return await te(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:zr})}catch(n){if(W(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){er(t);try{return await te(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:zr})}catch(r){if(W(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){er(t);try{return await te(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:zr})}catch(r){if(W(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){er(t.userId);try{const{data:n,error:r}=await te(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _deleteFactor(t){er(t.userId),er(t.id);try{return{data:await te(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,s,o,a,l,c;try{const d={nextPage:null,lastPage:0,total:0},u=await te(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:i0});if(u.error)throw u.error;const h=await u.json(),p=(a=u.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(c=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(x=>{const g=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(x.split(";")[1].split("=")[1]);d[`${w}Page`]=g}),d.total=parseInt(p)),{data:Object.assign(Object.assign({},h),d),error:null}}catch(d){if(W(d))return{data:{clients:[]},error:d};throw d}}async _createOAuthClient(t){try{return await te(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await te(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await te(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(W(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await te(this.fetch,"DELET
466E",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await te(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _listCustomProviders(t){try{const n={};return t!=null&&t.type&&(n.type=t.type),await te(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var s;return{data:{providers:(s=r==null?void 0:r.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(n){if(W(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(t){try{return await te(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _getCustomProvider(t){try{return await te(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _updateCustomProvider(t,n){try{return await te(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(W(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(t){try{return await te(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _adminListPasskeys(t){gn(this.experimental),er(t.userId);try{return await te(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _adminDeletePasskey(t){gn(this.experimental),er(t.userId),er(t.passkeyId);try{return await te(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}}function a0(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}globalThis&&OS()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class cM extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}function dM(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function MS(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function uM(e){return parseInt(e,16)}function hM(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function fM(e){var t;const{chainId:n,domain:r,expirationTime:s,issuedAt:o=new Date,nonce:a,notBefore:l,requestId:c,resources:d,scheme:u,uri:h,version:p}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 467`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const m=MS(e.address),x=u?`${u}://${r}
467`:r,g=e.statement?`${e.statement} 468`:"",w=`${x} wants you to sign in with your Ethereum account: 469${m} 470 471${g}`;let v=`URI: ${h} 472Version: ${p} 473Chain ID: ${n}${a?` 474Nonce: ${a}`:""} 475Issued At: ${o.toISOString()}`;if(s&&(v+=` 476Expiration Time: ${s.toISOString()}`),l&&(v+=` 477Not Before: ${l.toISOString()}`),c&&(v+=` 478Request ID: ${c}`),d){let y=` 479Resources:`;for(const b of d){if(!b||typeof b!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${b}`);y+=` 480- ${b}`}v+=y}return`${w} 481${v}`}class Qe extends Error{constructor({message:t,code:n,cause:r,name:s}){var o;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(o=s??(r instanceof Error?r.name:void 0))!==null&&o!==void 0?o:"Unknown Error",this.code=n}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Td extends Qe{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function mM({error:e,options:t}){var n,r,s;const{publicKey:o}=t;if(!o)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Qe({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=o.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Qe({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=o.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Qe({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=o.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Qe({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Qe({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Qe({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return o.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new Qe({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Qe({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const a=window.location.hostname;if(LS(a)){if(o.rp.id!==a)return new Qe({message:`The RP ID "${o.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Qe({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(o.user.id.byteLength<1||o.user.id.byteLength>64)return new Qe({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Qe({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Qe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function pM({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Qe({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Qe({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(LS(r)){if(n.rpId!==r)return new Qe({message:`The RP ID "${n.rpId}
481" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Qe({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Qe({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Qe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class gM{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const ym=new gM;function l0(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,s=yu(e,["challenge","user","excludeCredentials"]),o=Ko(t).buffer,a=Object.assign(Object.assign({},n),{id:Ko(n.id).buffer}),l=Object.assign(Object.assign({},s),{challenge:o,user:a});if(r&&r.length>0){l.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const d=r[c];l.excludeCredentials[c]=Object.assign(Object.assign({},d),{id:Ko(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return l}function c0(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=yu(e,["challenge","allowCredentials"]),s=Ko(t).buffer,o=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){o.allowCredentials=new Array(n.length);for(let a=0;a<n.length;a++){const l=n[a];o.allowCredentials[a]=Object.assign(Object.assign({},l),{id:Ko(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return o}function d0(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:Ls(new Uint8Array(e.response.attestationObject)),clientDataJSON:Ls(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function u0(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Ls(new Uint8Array(s.authenticatorData)),clientDataJSON:Ls(new Uint8Array(s.clientDataJSON)),signature:Ls(new Uint8Array(s.signature)),userHandle:s.userHandle?Ls(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function LS(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Ad(){var e,t;return!!(xt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function DS(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Td("Browser returned unexpected credential type",t)}:{data:null,error:new Td("Empty credential response",t)}}catch(t){return{data:null,error:mM({error:t,options:e})}}}async function zS(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Td("Browser returned unexpected credential type",t)}:{data:null,error:new Td("Empty credential response",t)}}
481catch(t){return{data:null,error:pM({error:t,options:e})}}}const vM={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},yM={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Ed(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of e)if(s)for(const o in s){const a=s[o];if(a!==void 0)if(Array.isArray(a))r[o]=a;else if(n(a))r[o]=a;else if(t(a)){const l=r[o];t(l)?r[o]=Ed(l,a):r[o]=Ed(a)}else r[o]=a}return r}function xM(e,t){return Ed(vM,e,t||{})}function bM(e,t){return Ed(yM,e,t||{})}class wM{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:s},o){var a;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!l)return{data:null,error:c};const d=s??ym.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:u}=l.webauthn.credential_options.publicKey;if(!u.name){const h=r;if(h)u.name=`${u.id}:${h}`;else{const m=(await this.client.getUser()).data.user,x=((a=m==null?void 0:m.user_metadata)===null||a===void 0?void 0:a.name)||(m==null?void 0:m.email)||(m==null?void 0:m.id)||"User";u.name=`${u.id}:${x}`}}u.displayName||(u.displayName=u.name)}switch(l.webauthn.type){case"create":{const u=xM(l.webauthn.credential_options.publicKey,o==null?void 0:o.create),{data:h,error:p}=await DS({publicKey:u,signal:d});return h?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:h}},error:null}:{data:null,error:p}}case"request":{const u=bM(l.webauthn.credential_options.publicKey,o==null?void 0:o.request),{data:h,error:p}=await zS(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:u,signal:d}));return h?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:h}},error:null}:{data:null,error:p}}}}catch(l){return W(l)?{data:null,error:l}:{data:null,error:new An("Unexpected error in challenge",l)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!n)return{data:null,error:new rl("rpId is required for WebAuthn authentication")};try{if(!Ad())return{data:null,error:new An("Browser does not support WebAuthn",null)};const{data:a,error:l}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:o});if(!a)return{data:null,error:l};const{webauthn:c}=a;return this._verify({factorId:t,challengeId:a.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(a){return W(a)?{data:null,error:a}:{data:null,error:new An("Unexpected error in authenticate",a)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!n)return{data:null,error:new rl("rpId is required for WebAuthn registration")};try{if(!Ad())return{data:null,error:new An("Browser does not support WebAuthn",null)};const{data:a,error:l}=await this._enroll({friendlyName:t});if(!a)return await this.client.mfa.listFactors().then(u=>{var h;return(h=u.data)===null||h===void 0?void 0:h.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===t&&p.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:l};const{data:c,error:d}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:o});return c?this._verify({factorId:a.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:d}}catch(a){return W(a)?{data:null,error:a}:{data:null,error:new An("Unexpected error in register",a)}}}}dM();const kM={url:A5,storageKey:E5,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:N5,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},go={};class sl{get jwks(){var t,n;return(n=(t=go[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){go[this.storageKey]=Object.assign(Object.assign({},go[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=go[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){go[this.storageKey]=Object.assign(Object.assign({},go[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},kM),t);if(this.storageKey=o.storageKey,this.instanceID=(n=sl.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,sl.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&xt()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(r=o.experimental)!==null&&r!==void 0?r:{},this.admin=new lM({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=IS(o.fetch),this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock!=null&&(this.lock=o.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new wM(this)}
481,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:OS()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=a0(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=a0(this.memoryStorage)),xt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}o.skipAutoInitialize||this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${jS}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var t;try{let n={},r="none";if(xt()&&(n=U5(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),xt()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:o}=await this._getSessionFromURL(n,r);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),R5(o)){const c=(t=o.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:o}}return{error:o}}const{session:a,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",a,"redirect type",l),await this._saveSession(a),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return W(n)?this._returnResult({error:n}):this._returnResult({error:new An("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,s;try{const o=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:Yt}),{data:a,error:l}=o;if(l||!a)return this._returnResult({data:{user:null,session:null},error:l});const c=a.session,d=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(o){if(W(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signUp(t){var n,r,s;try{let o;if("email"in t){const{email:u,password:h,options:p}=t;let m=null,x=null;this.flowType==="pkce"&&([m,x]=await Ns(this.storage,this.storageKey)),o=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:u,password:h,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:m,code_challenge_method:x},xform:Yt})}else if("phone"in t){const{phone:u,password:h,options:p}=t;o=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:h,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},channel:(s=p==null?void 0:p.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:Yt})}else throw new sc("You must provide either an email or phone number and a password");const{data:a,error:l}=o;if(l||!a)return await He(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=a.session,d=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(o){if(await He(this.storage,`${this.storageKey}-code-verifier`),W(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithPassword(t){try{let n;if("email"in t){const{email:o,password:a,options:l}=t;n=await te(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:o0})}else if("phone"in t){const{phone:o,password:a,options:l}=t;n=await te(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:o0})}else throw new sc("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const o=new po;return this._returnResult({data:{user:null,session:null},error:o})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(W(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,s,o;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(o=t.o
481ptions)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t)):this._exchangeCodeForSession(t)}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,s,o,a,l,c,d,u,h,p;let m,x;if("message"in t)m=t.message,x=t.signature;else{const{chain:g,wallet:w,statement:v,options:y}=t;let b;if(xt())if(typeof w=="object")b=w;else{const N=window;if("ethereum"in N&&typeof N.ethereum=="object"&&"request"in N.ethereum&&typeof N.ethereum.request=="function")b=N.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof w!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=w}const k=new URL((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href),S=await b.request({method:"eth_requestAccounts"}).then(N=>N).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!S||S.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const T=MS(S[0]);let E=(r=y==null?void 0:y.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!E){const N=await b.request({method:"eth_chainId"});E=uM(N)}const j={domain:k.host,address:T,statement:v,uri:k.href,version:"1",chainId:E,nonce:(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(a=(o=y==null?void 0:y.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(d=y==null?void 0:y.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.resources};m=fM(j),x=await b.request({method:"personal_sign",params:[hM(m),T]})}try{const{data:g,error:w}=await te(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:x},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Yt});if(w)throw w;if(!g||!g.session||!g.user){const v=new po;return this._returnResult({data:{user:null,session:null},error:v})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:w})}catch(g){if(W(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var n,r,s,o,a,l,c,d,u,h,p,m;let x,g;if("message"in t)x=t.message,g=t.signature;else{const{chain:w,wallet:v,statement:y,options:b}=t;let k;if(xt())if(typeof v=="object")k=v;else{const T=window;if("solana"in T&&typeof T.solana=="object"&&("signIn"in T.solana&&typeof T.solana.signIn=="function"||"signMessage"in T.solana&&typeof T.solana.signMessage=="function"))k=T.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof v!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=v}const S=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href);
481if("signIn"in k&&k.signIn){const T=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},b==null?void 0:b.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),y?{statement:y}:null));let E;if(Array.isArray(T)&&T[0]&&typeof T[0]=="object")E=T[0];else if(T&&typeof T=="object"&&"signedMessage"in T&&"signature"in T)E=T;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in E&&"signature"in E&&(typeof E.signedMessage=="string"||E.signedMessage instanceof Uint8Array)&&E.signature instanceof Uint8Array)x=typeof E.signedMessage=="string"?E.signedMessage:new TextDecoder().decode(E.signedMessage),g=E.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${S.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${S.href}`,`Issued At: ${(s=(r=b==null?void 0:b.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((o=b==null?void 0:b.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${b.signInWithSolana.notBefore}`]:[],...!((a=b==null?void 0:b.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${b.signInWithSolana.expirationTime}`]:[],...!((l=b==null?void 0:b.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${b.signInWithSolana.chainId}`]:[],...!((c=b==null?void 0:b.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${b.signInWithSolana.nonce}`]:[],...!((d=b==null?void 0:b.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${b.signInWithSolana.requestId}`]:[],...!((h=(u=b==null?void 0:b.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||h===void 0)&&h.length?["Resources",...b.signInWithSolana.resources.map(E=>`- ${E}`)]:[]].join(` 482`);const T=await k.signMessage(new TextEncoder().encode(x),"utf8");if(!T||!(T instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=T}}try{const{data:w,error:v}=await te(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:Ls(g)},!((p=t.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:Yt});if(v)throw v;if(!w||!w.session||!w.user){const y=new po;return this._returnResult({data:{user:null,session:null},error:y})}return w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),this._returnResult({data:Object.assign({},w),error:v})}catch(w){if(W(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async _exchangeCodeForSession(t){const n=await Zn(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new O5;const{data:o,error:a}=await te(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Yt});if(await He(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!o||!o.session||!o.user){const l=new po;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",o.session)),this._returnResult({data:Object.assign(Object.assign({},o),{redirectType:s??null}),error:a})}catch(o){if(await He(this.storage,`${this.storageKey}-code-verifier`),W(o))return this._returnResult({data:{user:null,session:null,redirectType:null},error:o});throw o}}async signInWithIdToken(t){try{const{options:n,provider:r,token:s,access_token:o,nonce:a}=t,l=await te(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:o,nonce:a,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Yt}),{data:c,error:d}=l;if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!c||!c.session||!c.user){const u=new po;return this._returnResult({data:{user:null,session:null},error:u})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:d})}catch(n){if(W(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,s,o,a;try{if("email"in t){const{email:l,options:c}=t;let d=null,u=null;this.flowType==="pkce"&&([d,u]=await Ns(this.storage,this.storageKey));const{error:h}=await te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:d,code_challenge_method:u},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in t){const{phone:l,options:c}=t,{data:d,error:u}=await te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(o=c==null?void 0:c.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(a=c==null?void 0:c.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:u})}throw new sc("You must provide either an email or phone number.")}catch(l){if(await He(this.storage,`${this.storageKey}-code-verifier`),W(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var n,r;try{let s,o;"options"in t&&(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo,o=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:a,error:l}=await te(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:Yt});if(l)throw l;if(!a)throw new Error("An error occurred on token verification.");const c=a.session,d=a.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(s){if(W(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var n,r,s,o,a;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await Ns(this.storage,this.storageKey));const d=await te(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:oM});return!((o=d.data)===null||o===void 0)&&o.url&&xt()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(d.data.url),this._returnResult(d)}catch(l){if(await He(this.storage,`${this.storageKey}-code-verifier`),W(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new st;const{error:s}=await te(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(W(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:s,options:o}=t;let a=null,l=null;this.flowType==="pkce"&&([a,l]=await Ns(this.storage,this.storageKey));const{error:c}=await te(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken},code_challenge:a,code_challenge_method:l},redirectTo:o==null?void 0:o.emailRedirectTo});return c&&await He(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:c})}else if("phone"in t){const{phone:r,type:s,options:o}=t,{data:a,error:l}=await te(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:l})}throw new sc("You must provide either an email or phone number and a type")}catch(n){if(await He(this.storage,`${this.storageKey}-code-verifier`),W(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async t=>t)):await this._useSession(async t=>t)}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await Zn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not val
482id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<yh:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const a=await Zn(this.userStorage,this.storageKey+"-user");a!=null&&a.user?t.user=a.user:t.user=bh()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};t.user=tM(t.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{session:null},error:o}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;let n;return this.lock!=null?n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):n=await this._getUser(),n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:zr}):await this._useSession(async n=>{var r,s,o;const{data:a,error:l}=n;if(l)throw l;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new st}:await te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0,xform:zr})})}catch(n){if(W(n))return rc(n)&&(await this._removeSession(),await He(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n)):await this._updateUser(t,n)}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:s,error:o}=r;if(o)throw o;if(!s.session)throw new st;const a=s.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Ns(this.storage,this.storageKey));const{data:d,error:u}=await te(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:a.access_token,xform:zr});if(u)throw u;return a.user=d.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(r){if(await He(this.storage,`${this.storageKey}-code-verifier`),W(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t)):await this._setSession(t)}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new st;const n=Date.now()/1e3;let r=n,s=!0,o=null;const{payload:a}=ic(t.access_token);if(a.exp&&(r=a.exp,s=r<=n),s){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};o=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});o={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return this._returnResult({data:{user:o.user,session:o},error:null})}catch(n){if(W(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t)):await this._refreshSession(t)}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:a,error:l}=n;if(l)throw l;t=(r=a.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new st;const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{user:null,session:null},error:o}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(W(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){var r;try{if(!xt())throw new oc("No browser detected.");
482if(t.error||t.error_description||t.error_code)throw new oc(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new Qy("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new oc("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Qy("No code detected.");const{data:b,error:k}=await this._exchangeCodeForSession(t.code);if(k)throw k;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:b.session,redirectType:(r=b.redirectType)!==null&&r!==void 0?r:null},error:null}}const{provider_token:s,provider_refresh_token:o,access_token:a,refresh_token:l,expires_in:c,expires_at:d,token_type:u}=t;if(!a||!c||!l||!u)throw new oc("No session defined in URL");const h=Math.round(Date.now()/1e3),p=parseInt(c);let m=h+p;d&&(m=parseInt(d));const x=m-h;x*1e3<=jr&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${x}s, should have been closer to ${p}s`);const g=m-p;h-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,m,h):h-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,m,h);const{data:w,error:v}=await this._getUser(a);if(v)throw v;const y={provider_token:s,provider_refresh_token:o,access_token:a,expires_in:p,expires_at:m,refresh_token:l,token_type:u,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(s){if(W(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error||t.error_description||t.error_code)}async _isPKCECallback(t){const n=await Zn(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t)):await this._signOut(t)}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:o}=n;if(o&&!rc(o))return this._returnResult({error:o});const a=(r=s.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:l}=await this.admin.signOut(a,t);if(l&&!(P5(l)&&(l.status===404||l.status===401||l.status===403)||rc(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await He(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=B5(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)}):await this._emitInitialSession(n)))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,s;try{const{data:{session:o},error:a}=n;if(a)throw a;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",t,"session",o)}catch(o){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",o),rc(o)?console.warn(o):console.error(o)}})}async resetPasswordForEmail(t,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await Ns(this.storage,this.storageKey,!0));try{return await te(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(o){if(await He(this.storage,`${this.storageKey}-code-verifier`),W(o))return this._returnResult({data:null,error:o});throw o}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:s}=await this._useSession(async o=>{var a,l,c,d,u;const{data:h,error:p}=o;if(p)throw p;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await te(this.fetch,"GET",m,{headers:this.headers,jwt:(u=(d=h.session)===null||d===void 0?void 0:d.access_token)!==null&&u!==void 0?u:void 0})});if(s)throw s;return xt()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(W(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:o}}=n;if(s)throw s;const{options:a,provider:l,token:c,access_token:d,nonce:u}=t,h=await te(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=o==null?void 0:o.access_token)!==null&&r!==void 0?r:void 0,body:{provider:l,id_token:c,access_token:d,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Yt}),{data:p,error:m}=h;return m?this._returnResult({data:{user:null,session:null},error:m}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new po}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:m}))}catch(s){if(await He(this.storage,`${this.storageKey}-code-verifier`),W(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,s;const{data:o,error:a}=n;
482if(a)throw a;return await te(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(r=o.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n="#_refreshAccessToken()";this._debug(n,"begin");try{const r=Date.now();return await X5(async s=>(s>0&&await H5(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await te(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Yt})),(s,o)=>{const a=200*Math.pow(2,s);return o&&xh(o)&&Date.now()+a-r<jr})}catch(r){if(this._debug(n,"error",r),W(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),xt()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await Zn(this.storage,this.storageKey);if(s&&this.userStorage){let a=await Zn(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:s.user},await ko(this.userStorage,this.storageKey+"-user",a)),s.user=(t=a==null?void 0:a.user)!==null&&t!==void 0?t:bh()}else if(s&&!s.user&&!s.user){const a=await Zn(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(s.user=a.user,await He(this.storage,this.storageKey+"-user"),await ko(this.storage,this.storageKey,s)):s.user=bh()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const o=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<yh;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${yh}s`),o){if(this.autoRefreshToken&&s.refresh_token){const{error:a}=await this._callRefreshToken(s.refresh_token);a&&(I5(a)?this._debug(r,"refresh discarded by commit guard",a):(this._debug(r,"refresh failed",a),xh(a)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession())))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:l}=await this._getUser(s.access_token);!l&&(a!=null&&a.user)?(s.user=a.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(r,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new st;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s="#_callRefreshToken()";this._debug(s,"begin");try{this.refreshingDeferred=new xu;const o=await Zn(this.storage,this.storageKey),{data:a,error:l}=await this._refreshAccessToken(t);if(l)throw l;if(!a.session)throw new st;const c=await Zn(this.storage,this.storageKey);if(o!==null&&(c===null||c.refresh_token!==o.refresh_token)){this._debug(s,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:c?"replaced":"cleared"});const p={data:null,error:new Jy};return this.refreshingDeferred.resolve(p),p}const u=this._sessionRemovalEpoch;if(await this._saveSession(a.session),this._sessionRemovalEpoch!==u){this._debug(s,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await He(this.storage,this.storageKey),this.userStorage&&await He(this.userStorage,this.storageKey+"-user");const p={data:null,error:new Jy};return this.refreshingDeferred.resolve(p),p}await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const h={data:a.session,error:null};return this.refreshingDeferred.resolve(h),h}catch(o){if(this._debug(s,"error",o),W(o)){const a={data:null,error:o};return xh(o)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(o),o}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,n,r=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const o=[],a=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(c){o.push(c)}});if(await Promise.all(a),o.length>0){for(let l=0;l<o.length;l+=1)console.error(o[l]);throw o[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await He(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await ko(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const o=r0(s);await ko(this.storage,this.storageKey,o)}else{const s=r0(n);await ko(this.storage,this.storageKey,s)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await He(this.storage,this.storageKey),await He(this.storage,this.storageKey+"-code-verifier"),await He(this.storage,this.storageKey+"-user"),this.userStorage&&await He(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&xt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
482catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),jr);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var t;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(t=this.broadcastChannel)===null||t===void 0||t.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-t)/jr);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${jr}ms, refresh threshold is ${sa} ticks`),s<=sa&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t instanceof cM)this._debug("auto refresh token tick lock not available");else throw t}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const t=Date.now();try{await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-t)/jr);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${jr}ms, refresh threshold is ${sa} ticks`),s<=sa&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!xt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;if(this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!t)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(n,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[o,a]=await Ns(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(l.toString())}if(r!=null&&r.queryParams){const o=new URLSearchParams(r.queryParams);s.push(o.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:s,error:o}=n;return o?this._returnResult({data:null,error:o}
482):await te(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,s;const{data:o,error:a}=n;if(a)return this._returnResult({data:null,error:a});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:d}=await te(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(r=o==null?void 0:o.session)===null||r===void 0?void 0:r.access_token});return d?this._returnResult({data:null,error:d}):(t.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){const n=async()=>{try{return await this._useSession(async r=>{var s;const{data:o,error:a}=r;if(a)return this._returnResult({data:null,error:a});const l=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?d0(t.webauthn.credential_response):u0(t.webauthn.credential_response)})}:{code:t.code}),{data:c,error:d}=await te(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:l,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});return d?this._returnResult({data:null,error:d}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),this._returnResult({data:c,error:d}))})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,n):n()}async _challenge(t){const n=async()=>{try{return await this._useSession(async r=>{var s;const{data:o,error:a}=r;if(a)return this._returnResult({data:null,error:a});const l=await te(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});if(l.error)return l;const{data:c}=l;if(c.type!=="webauthn")return{data:c,error:null};switch(c.webauthn.type){case"create":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:l0(c.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:c0(c.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,n):n()}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const o of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])s.all.push(o),o.status==="verified"&&s[o.factor_type].push(o);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,s,o;if(t)try{const{payload:m}=ic(t);let x=null;m.aal&&(x=m.aal);let g=x;const{data:{user:w},error:v}=await this.getUser(t);if(v)return this._returnResult({data:null,error:v});((r=(n=w==null?void 0:w.factors)===null||n===void 0?void 0:n.filter(k=>k.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(g="aal2");const b=m.amr||[];return{data:{currentLevel:x,nextLevel:g,currentAuthenticationMethods:b},error:null}}catch(m){if(W(m))return this._returnResult({data:null,error:m});throw m}const{data:{session:a},error:l}
482=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=ic(a.access_token);let d=null;c.aal&&(d=c.aal);let u=d;((o=(s=a.user.factors)===null||s===void 0?void 0:s.filter(m=>m.status==="verified"))!==null&&o!==void 0?o:[]).length>0&&(u="aal2");const p=c.amr||[];return{data:{currentLevel:d,nextLevel:u,currentAuthenticationMethods:p},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await te(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new st})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:o}=r;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new st});const a=await te(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return a.data&&a.data.redirect_url&&xt()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:o}=r;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new st});const a=await te(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return a.data&&a.data.redirect_url&&xt()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await te(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new st})})}catch(t){if(W(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await te(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new st})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(l=>l.kid===t);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(l=>l.kid===t),r&&this.jwks_cached_at+_5>s)return r;const{data:o,error:a}=await te(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=s,r=o.keys.find(l=>l.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:m,error:x}
482=await this.getSession();if(x||!m.session)return this._returnResult({data:null,error:x});r=m.session.access_token}const{header:s,payload:o,signature:a,raw:{header:l,payload:c}}=ic(r);if(!(n!=null&&n.allowExpired))try{J5(o.exp)}catch(m){throw new kd(m instanceof Error?m.message:"JWT validation failed")}const d=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!d){const{error:m}=await this.getUser(r);if(m)throw m;return{data:{claims:o,header:s,signature:a},error:null}}const u=Z5(s.alg),h=await crypto.subtle.importKey("jwk",d,u,!0,["verify"]);if(!await crypto.subtle.verify(u,h,a,$5(`${l}.${c}`)))throw new kd("Invalid JWT signature");return{data:{claims:o,header:s,signature:a},error:null}}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async signInWithPasskey(t){var n,r,s;gn(this.experimental);try{if(!Ad())return this._returnResult({data:null,error:new An("Browser does not support WebAuthn",null)});const{data:o,error:a}=await this._startPasskeyAuthentication({options:{captchaToken:(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.captchaToken}});if(a||!o)return this._returnResult({data:null,error:a});const l=c0(o.options),c=(s=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.signal)!==null&&s!==void 0?s:ym.createNewAbortSignal(),{data:d,error:u}=await zS({publicKey:l,signal:c});if(u||!d)return this._returnResult({data:null,error:u??new An("WebAuthn ceremony failed",null)});const h=u0(d);return this._verifyPasskeyAuthentication({challengeId:o.challenge_id,credential:h})}catch(o){if(W(o))return this._returnResult({data:null,error:o});throw o}}async registerPasskey(t){var n,r;gn(this.experimental);try{if(!Ad())return this._returnResult({data:null,error:new An("Browser does not support WebAuthn",null)});const{data:s,error:o}=await this._startPasskeyRegistration();if(o||!s)return this._returnResult({data:null,error:o});const a=l0(s.options),l=(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.signal)!==null&&r!==void 0?r:ym.createNewAbortSignal(),{data:c,error:d}=await DS({publicKey:a,signal:l});if(d||!c)return this._returnResult({data:null,error:d??new An("WebAuthn ceremony failed",null)});const u=d0(c);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:u})}catch(s){if(W(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){gn(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new st});const{data:s,error:o}=await te(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:n.access_token,body:{}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})})}catch(t){if(W(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){gn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new st});const{data:o,error:a}=await te(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:o,error:null})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyAuthentication(t){var n;gn(this.experimental);try{const{data:r,error:s}=await te(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:r,error:null})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async _verifyPasskeyAuthentication(t){gn(this.experimental);try{const{data:n,error:r}=await te(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:Yt});return r?this._returnResult({data:null,error:r}):(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:n,error:null}))}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _listPasskeys(){gn(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new st});const{data:s,error:o}=await te(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})})}catch(t){if(W(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){gn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new st});const{data:o,error:a}=await te(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:t.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:o,error:null})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _deletePasskey(t){gn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new st});const{error:o}
482=await te(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return o?this._returnResult({data:null,error:o}):this._returnResult({data:null,error:null})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}}sl.nextInstanceID={};const SM=sl,TM="2.108.1";let oa="",Nd;if(typeof Deno<"u"){var kh;oa="deno",Nd=(kh=Deno.version)===null||kh===void 0?void 0:kh.deno}else if(typeof document<"u")oa="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")oa="react-native";else{var Sh;oa="node",Nd=typeof process<"u"?(Sh=process.version)===null||Sh===void 0?void 0:Sh.replace(/^v/,""):void 0}const $S=[`runtime=${oa}`];Nd&&$S.push(`runtime-version=${Nd}`);const AM={"X-Client-Info":`supabase-js/${TM}; ${$S.join("; ")}`},EM={headers:AM},NM={schema:"public"},CM={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},_M={},jM={enabled:!1,respectSamplingDecision:!0};function PM(e,t,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(u){try{d(r.next(u))}catch(h){a(h)}}function c(u){try{d(r.throw(u))}catch(h){a(h)}}function d(u){u.done?o(u.value):s(u.value).then(l,c)}d((r=r.apply(e,[])).next())})}let Th=null;const RM="@opentelemetry/api";function OM(){return Th===null&&(Th=import(RM).catch(()=>null)),Th}function IM(){return PM(this,void 0,void 0,function*(){try{const e=yield OM();if(!e||!e.propagation||!e.context)return null;const t={};e.propagation.inject(e.context.active(),t);const n=t.traceparent;return n?{traceparent:n,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function MM(e){if(!e||typeof e!="string")return null;const t=e.split("-");if(t.length!==4)return null;const[n,r,s,o]=t;if(n.length!==2||r.length!==32||s.length!==16||o.length!==2)return null;const a=/^[0-9a-f]+$/i;return!a.test(n)||!a.test(r)||!a.test(s)||!a.test(o)||r==="00000000000000000000000000000000"||s==="0000000000000000"?null:{version:n,traceId:r,parentId:s,traceFlags:o,isSampled:(parseInt(o,16)&1)===1}}function LM(e,t){if(!e||!t||t.length===0)return!1;let n;if(e instanceof URL)n=e;else try{n=new URL(e)}catch{return!1}for(const r of t)try{if(typeof r=="string"){if(DM(n.hostname,r))return!0}else if(r instanceof RegExp){if(r.test(n.hostname))return!0}else if(typeof r=="function"&&r(n))return!0}catch{continue}return!1}function DM(e,t){if(t===e)return!0;if(t.startsWith("*.")){const n=t.slice(2);if(e.endsWith(n)&&(e===n||e.endsWith("."+n)))return!0}return!1}function zM(e){const t=[];try{const n=new URL(e);t.push(n.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function ol(e){"@babel/helpers - typeof";return ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ol(e)}function $M(e,t){if(ol(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ol(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FM(e){var t=$M(e,"string");return ol(t)=="symbol"?t:t+""}function BM(e,t,n){return(t=FM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h0(Object(n),!0).forEach(function(r){BM(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const UM=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),VM=()=>Headers,HM=(e,t,n,r,s)=>{const o=UM(r),a=VM(),l=(s==null?void 0:s.enabled)===!0,c=(s==null?void 0:s.respectSamplingDecision)!==!1,d=l?zM(t):null;return async(u,h)=>{var p;const m=(p=await n())!==null&&p!==void 0?p:e;let x=new a(h==null?void 0:h.headers);if(x.has("apikey")||x.set("apikey",e),x.has("Authorization")||x.set("Authorization",`Bearer ${m}`),d){const g=await XM(u,d,c);g&&(g.traceparent&&!x.has("traceparent")&&x.set("traceparent",g.traceparent),g.tracestate&&!x.has("tracestate")&&x.set("tracestate",g.tracestate),g.baggage&&!x.has("baggage")&&x.set("baggage",g.baggage))}return o(u,Ue(Ue({},h),{},{headers:x}))}};async function XM(e,t,n){if(!LM(typeof e=="string"||e instanceof URL?e:e.url,t))return null;const r=await IM();if(!r||!r.traceparent)return null;if(n){const s=MM(r.traceparent);if(s&&!s.isSampled)return null}return r}function f0(e){return typeof e=="boolean"?{enabled:e}:e}function qM(e){return e.endsWith("/")?e:e+"/"}function GM(e,t){var n,r,s,o,a,l;const{db:c,auth:d,realtime:u,global:h}=e,{db:p,auth:m,realtime:x,global:g}=t,w=f0(e.tracePropagation),v=f0(t.tracePropagation),y={db:Ue(Ue({},p),c),auth:Ue(Ue({},m),d),realtime:Ue(Ue({},x),u),storage:{},global:Ue(Ue(Ue({},g),h),{},{headers:Ue(Ue({},(n=g==null?void 0:g.headers)!==null&&n!==void 0?n:{}),(r=h==null?void 0:h.headers)!==null&&r!==void 0?r:{})}),tracePropagation:{enabled:(s=(o=w==null?void 0:w.enabled)!==null&&o!==void 0?o:v==null?void 0:v.enabled)!==null&&s!==void 0?s:!1,respectSamplingDecision:(a=(l=w==null?void 0:w.respectSamplingDecision)!==null&&l!==void 0?l:v==null?void 0:v.respectSamplingDecision)!==null&&a!==void 0?a:!0},accessToken:async()=>""};return e.accessToken?y.accessToken=e.accessToken:delete y.accessToken,y}function WM(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");
482if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(qM(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var KM=class extends SM{constructor(e){super(e)}},YM=class{constructor(e,t,n){var r,s;this.supabaseUrl=e,this.supabaseKey=t;const o=WM(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const a=`sb-${o.hostname.split(".")[0]}-auth-token`,l={db:NM,realtime:_M,auth:Ue(Ue({},CM),{},{storageKey:a}),global:EM,tracePropagation:jM},c=GM(n??{},l);if(this.settings=c,this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=c.global.headers)!==null&&s!==void 0?s:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(u,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var d;this.auth=this._initSupabaseAuthClient((d=c.auth)!==null&&d!==void 0?d:{},this.headers,c.global.fetch)}this.fetch=HM(t,e,this._getAccessToken.bind(this),c.global.fetch,c.tracePropagation),this.realtime=this._initRealtimeClient(Ue({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new uI(new URL("rest/v1",o).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new T5(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new nI(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:o,flowType:a,lock:l,debug:c,throwOnError:d,experimental:u,lockAcquireTimeout:h,skipAutoInitialize:p},m,x){const g={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new KM({url:this.authUrl.href,headers:Ue(Ue({},g),m),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,flowType:a,lock:l,debug:c,throwOnError:d,experimental:u,fetch:x,lockAcquireTimeout:h,skipAutoInitialize:p,hasCustomAuthorizationHeader:Object.keys(this.headers).some(w=>w.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new GI(this.realtimeUrl.href,Ue(Ue({},e),{},{params:Ue(Ue({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const QM=(e,t,n)=>new YM(e,t,n);function JM(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}JM()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
482ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const ZM="https://imupgitrulufnuisoknl.supabase.co",eL="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImltdXBnaXRydWx1Zm51aXNva25sIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjUzOTA5NDMsImV4cCI6MjA4MDk2Njk0M30.RBfTVJ0pkOHy2CHa7FrOuPfh3jxE4kFE9AT-J0BHeDQ",ye=QM(ZM,eL,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),Ah=512,m0=511,tL=3e-4,nL=2e-4,rL=5e-5,p0=1e-4,sL=1.5,oL=1.2,iL=1,aL=.8,lL={BTC:1,ETH:1,SOL:1,BNB:1,XRP:1,ADA:1,AVAX:1,DOGE:1,DOT:1,MATIC:1};let cL=0;class dL{constructor(){G(this,"activeOrders",new Map);G(this,"executionHistory",new Array(Ah));G(this,"historyIdx",0);G(this,"historyCount",0);G(this,"subscribers",new Set);G(this,"isActive",!1);G(this,"takerFee",.001);G(this,"baseCapital",1e4);bn.onExecutionIntent(t=>{this.isActive&&this.executeImmediate(t)})}start(t){this.isActive||(this.isActive=!0,t&&(t.baseCapital&&(this.baseCapital=t.baseCapital),t.exchange==="coinbase"?this.takerFee=.006:t.exchange==="kraken"?this.takerFee=.0026:this.takerFee=.001))}stop(){this.isActive=!1}executeImmediate(t){const n=performance.now(),r=t.symbol;if(this.activeOrders.has(r))return this.failResult(t,"Order already active",performance.now()-n);const s=ut.getPrice(r);if(!s)return this.failResult(t,"No price data",performance.now()-n);let o;if(lL[r])o=tL;else{const j=r.charCodeAt(r.length-1);if(j===88||j===110)o=nL;else if(r.length===6){const N=r.charCodeAt(0);N===69||N===71||N===85?o=rL:o=p0}else o=p0}const a=t.urgency,l=a==="CRITICAL"?sL:a==="HIGH"?oL:a==="MEDIUM"?iL:aL,c=s.price;let d=o*l;const u=s.spread;u&&(d=d+u/c*.5);const h=t.maxSlippage;d>h&&(d=h);const m=t.side==="LONG"?c*(1+d):c*(1-d),x=this.baseCapital*t.size,g=x/m,w=x*this.takerFee,v="h"+ ++cL,y=performance.now(),b={symbol:r,side:t.side,status:"FILLED",requestedPrice:t.entryPrice,fillPrice:m,quantity:g,filledQuantity:g,createdAt:y,updatedAt:y};this.activeOrders.set(r,b);const k=performance.now()-n,S=m-t.entryPrice,T=(S<0?-S:S)/t.entryPrice,E={success:!0,tradeId:v,symbol:r,side:t.side,entryPrice:m,quantity:g,positionSize:x,slippage:T,fees:w,netCost:x+w,latencyMs:k,timestamp:y};this.executionHistory[this.historyIdx]=E,this.historyIdx=this.historyIdx+1&m0,this.historyCount<Ah&&(this.historyCount=this.historyCount+1);for(const j of this.subscribers)j(E);return this.logAsync(E,t),setTimeout(()=>this.activeOrders.delete(r),6e4),E}failResult(t,n,r){return{success:!1,tradeId:"",symbol:t.symbol,side:t.side,entryPrice:0,quantity:0,positionSize:0,slippage:0,fees:0,netCost:0,latencyMs:r,timestamp:performance.now(),error:n}}logAsync(t,n){ye.from("agent_chat").insert({agent_id:"hft-execution-engine",agent_name:"HFT Engine",message:"[HFT] "+t.side+" "+t.symbol+" @ $"+t.entryPrice.toFixed(2)+" | $"+t.positionSize.toFixed(0)+" | "+t.latencyMs.toFixed(3)+"ms",signal:t.side==="LONG"?"bullish":"bearish",confidence:n.confidence,timestamp_ms:Date.now()})}onExecution(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}getActiveOrders(){return new Map(this.activeOrders)}getExecutionHistory(t=100){const n=[],r=t<this.historyCount?t:this.historyCount;for(let s=0;s<r;s++){const o=this.historyIdx-1-s+Ah&m0,a=this.executionHistory[o];a&&(n[n.length]=a)}return n}getMetrics(){let t=0,n=0,r=0,s=0;for(let o=0;o<this.historyCount;o++){const a=this.executionHistory[o];a&&a.success&&(t=t+a.latencyMs,n=n+a.slippage,s=s+a.positionSize,r=r+1)}return{totalExecutions:this.historyCount,successfulExecutions:r,avgLatency:r>0?t/r:0,avgSlippage:r>0?n/r:0,totalVolume:s,activeOrders:this.activeOrders.size,isActive:this.isActive}}}const Pr=new dL;typeof window<"u"&&Pr.start();const Eh={A:{minConfidence:90,stopLossPct:1.5,takeProfitPct:3,minHoldMs:3e4,maxSlippage:.001},B:{minConfidence:85,stopLossPct:1.2,takeProfitPct:2.5,minHoldMs:25e3,maxSlippage:.0015},C:{minConfidence:80,stopLossPct:1,takeProfitPct:2,minHoldMs:2e4,maxSlippage:.002},D:{minConfidence:75,stopLossPct:.8,takeProfitPct:1.5,minHoldMs:15e3,maxSlippage:.0025},F:{minConfidence:0,stopLossPct:.5,takeProfitPct:1,minHoldMs:1e4,maxSlippage:.003}},ac={binance:{maker:.001,taker:.001},coinbase:{maker:.004,taker:.006},kraken:{maker:.0016,taker:.0026},bybit:{maker:.001,taker:.001},bitget:{maker:.001,taker:.001},okx:{maker:.001,taker:.001},interactive_brokers:{maker:5e-4,taker:5e-4},alpaca:{maker:0,taker:0}};class uL{constructor(){G(this,"activeTrades",new Map);G(this,"tradeHistory",[]);G(this,"signalQueue",[]);G(this,"tradeSubscribers",new Set);G(this,"executionSubscribers",new Set);G(this,"config",{mode:"DEMO",exchange:"binance",maxPositionPct:.1,maxConcurrentPositions:5,confidenceThreshold:70,enableAutoExit:!0,maxHoldTimeMs:12e4});G(this,"metrics",{totalSignals:0,executedSignals:0,avgEntryLatency:0,avgExitLatency:0,avgSlippage:0,totalVolume:0});G(this,"isActive",!1);G(this,"priceMonitorInterval",null);G(this,"signalCounter",0);G(this,"GRADE_THRESHOLDS",[90,85,80,75,0]);G(this,"GRADE_VALUES",["A","B","C","D","F"]);bn.onExecutionIntent(t=>{this.processExecutionIntent(t)})}start(t){this.isActive||(t&&(this.config={...this.config,...t}),this.isActive=!0,this.priceMonitorInterval=setInterval(()=>{this.updateOpenPositions()},100),console.log(`[UnifiedCore] Started in ${this.config.mode} mode`))}stop(){this.isActive=!1,this.priceMonitorInterval&&(clearInterval(this.priceMonitorInterval),this.priceMonitorInterval=null),console.log("[UnifiedCore] Stopped")}setMode(t){this.config.mode=t,console.log(`[UnifiedCore] Mode set to ${t}`)}setExchange(t){this.config.exchange=t}setConfig(t){this.config={...this.config,...t}}ingestSignal(t){if(!this.isActive)return;const n={id:`s${++this.signalCounter}
482`,symbol:t.symbol,side:t.side,confidence:t.confidence,agentId:t.agentId,agentName:t.agentName,entryPrice:t.entryPrice,timestamp:performance.now(),source:t.source};this.metrics.totalSignals++,!(t.confidence<this.config.confidenceThreshold||this.getPositionBySymbol(t.symbol))&&(this.activeTrades.size>=this.config.maxConcurrentPositions||(this.signalQueue.push(n),this.processSignalQueue()))}processExecutionIntent(t){this.ingestSignal({symbol:t.symbol,side:t.side,confidence:t.confidence,agentId:"hft-consensus",agentName:"HFT Consensus",entryPrice:t.entryPrice,source:"HFT_ENGINE"})}processSignalQueue(){for(;this.signalQueue.length>0;){const t=this.signalQueue.shift();this.executeSignal(t)}}executeSignal(t){const n=performance.now(),r=ut.getPrice(t.symbol);if(!r)return console.error(`[UnifiedCore] No price data for ${t.symbol}`),null;const s=this.calculateGrade(t.confidence),o=Eh[s],a=this.calculateSlippage(t,r,o.maxSlippage),l=t.side==="LONG"?r.price*(1+a):r.price*(1-a),c=1e4*this.config.maxPositionPct,d=c/l,u=ac[this.config.exchange]||ac.binance,h=c*u.taker,p=t.side==="LONG"?l*(1-o.stopLossPct/100):l*(1+o.stopLossPct/100),m=t.side==="LONG"?l*(1+o.takeProfitPct/100):l*(1-o.takeProfitPct/100),x=performance.now()-n,g={id:`trade_${Date.now()}_${Math.random().toString(36).substr(2,6)}`,mode:this.config.mode,symbol:t.symbol,side:t.side,status:"OPEN",signalTimestamp:t.timestamp,entryTimestamp:performance.now(),entryPrice:l,quantity:d,positionSize:c,entryFees:h,entrySlippage:a,entryLatencyMs:x,grossPnL:0,netPnL:-h,stopLoss:p,takeProfit:m,tradeGrade:s,agentId:t.agentId,agentName:t.agentName,confidence:t.confidence,executionId:`exec_${Date.now()}`,auditLog:[{timestamp:t.timestamp,event:"SIGNAL_RECEIVED",details:`${t.side} signal @ $${t.entryPrice.toFixed(2)} | ${t.confidence}% confidence`},{timestamp:performance.now(),event:"EXECUTION_COMPLETE",details:`Filled @ $${l.toFixed(2)} | Slippage: ${(a*100).toFixed(3)}% | Latency: ${x.toFixed(2)}ms`,latencyMs:x}]};return this.activeTrades.set(g.id,g),this.metrics.executedSignals++,this.metrics.totalVolume+=c,this.updateLatencyMetrics(x,"entry"),this.updateSlippageMetrics(a),this.notifyTradeUpdate(g,"OPENED"),this.notifyExecution(g),g}updateOpenPositions(){if(this.isActive)for(const[t,n]of this.activeTrades){if(n.status!=="OPEN")continue;const r=ut.getPrice(n.symbol);if(!r)continue;const s=r.price,a=(n.side==="LONG"?s-n.entryPrice:n.entryPrice-s)*n.quantity,l=a-n.entryFees;n.grossPnL=a,n.netPnL=l;const c=performance.now()-n.entryTimestamp,d=Eh[n.tradeGrade];let u=!1,h="";(n.side==="LONG"&&s>=n.takeProfit||n.side==="SHORT"&&s<=n.takeProfit)&&(u=!0,h="TP_HIT"),c>=d.minHoldMs&&(n.side==="LONG"&&s<=n.stopLoss||n.side==="SHORT"&&s>=n.stopLoss)&&(u=!0,h="STOP_HIT");const p=d.stopLossPct*1.5;l/n.positionSize*100<=-p&&(u=!0,h="EMERGENCY_STOP"),this.config.enableAutoExit&&c>=this.config.maxHoldTimeMs&&(u=!0,h="TIME_EXIT"),u&&this.closeTrade(t,s,h)}}closeTrade(t,n,r="MANUAL_CLOSE"){const s=this.activeTrades.get(t);if(!s||s.status!=="OPEN")return null;const o=performance.now(),a=ut.getPrice(s.symbol),l=n||(a==null?void 0:a.price)||s.entryPrice,c=this.calculateSlippage({symbol:s.symbol,side:s.side,confidence:s.confidence},a,Eh[s.tradeGrade].maxSlippage),d=s.side==="LONG"?l*(1-c):l*(1+c),u=ac[this.config.exchange]||ac.binance,h=s.positionSize*u.taker,m=(s.side==="LONG"?d-s.entryPrice:s.entryPrice-d)*s.quantity,x=m-s.entryFees-h,g=performance.now()-o;return s.status="CLOSED",s.exitTimestamp=performance.now(),s.exitPrice=d,s.exitFees=h,s.exitSlippage=c,s.grossPnL=m,s.netPnL=x,s.auditLog.push({timestamp:performance.now(),event:r,details:`Closed @ $${d.toFixed(2)} | P&L: $${x.toFixed(2)} | Reason: ${r}`,latencyMs:g}),this.activeTrades.delete(t),this.tradeHistory.push(s),this.tradeHistory.length>1e3&&this.tradeHistory.shift(),this.updateLatencyMetrics(g,"exit"),this.notifyTradeUpdate(s,"CLOSED"),s}calculateGrade(t){const n=t<75?4:t<80?3:t<85?2:t<90?1:0;return this.GRADE_VALUES[n]}calculateSlippage(t,n,r){let s=(n.spread||n.price*.001)/n.price/2;const o=ut.getSnapshot(t.symbol);return o&&o.volatility>.5&&(s*=1+o.volatility*.5),Math.min(s,r)}updateLatencyMetrics(t,n){const r=n==="entry"?"avgEntryLatency":"avgExitLatency",s=this.metrics.executedSignals;this.metrics[r]=(this.metrics[r]*(s-1)+t)/s}updateSlippageMetrics(t){const n=this.metrics.executedSignals;this.metrics.avgSlippage=(this.metrics.avgSlippage*(n-1)+t)/n}
482onTradeUpdate(t){return this.tradeSubscribers.add(t),()=>this.tradeSubscribers.delete(t)}onExecution(t){return this.executionSubscribers.add(t),()=>this.executionSubscribers.delete(t)}notifyTradeUpdate(t,n){const r=this.tradeSubscribers;for(const s of r)s(t,n)}notifyExecution(t){const n=this.executionSubscribers;for(const r of n)r(t)}getActiveTrades(){return Array.from(this.activeTrades.values())}getTradeHistory(t=100){return this.tradeHistory.slice(-t)}getPositionBySymbol(t){for(const n of this.activeTrades.values())if(n.symbol===t&&n.status==="OPEN")return n;return null}getConfig(){return{...this.config}}getMetrics(){return{...this.metrics,openPositions:this.activeTrades.size,totalTrades:this.tradeHistory.length,isActive:this.isActive,mode:this.config.mode}}}const hL=new uL;typeof window<"u"&&hL.start({mode:"DEMO"});class fL{constructor(){G(this,"startTime",0);G(this,"isActive",!1);G(this,"e2eLatencies",[]);G(this,"MAX_LATENCY_SAMPLES",100);G(this,"latencyHead",0);G(this,"latencySum",0);G(this,"latencyCount",0);Pr.onExecution(t=>{t.success&&this.recordE2ELatency(t.latencyMs)})}async start(t){if(this.isActive)return;const n=(t==null?void 0:t.pollIntervalMs)||500,r=(t==null?void 0:t.warmup)!==!1;console.log("[HFT-Orchestrator] Starting HFT system..."),this.startTime=Date.now(),this.isActive=!0,ut.start(n),r&&await ut.warmup(),bn.start(),Pr.start(),console.log("[HFT-Orchestrator] HFT system active")}stop(){this.isActive&&(console.log("[HFT-Orchestrator] Stopping HFT system..."),ut.stop(),bn.stop(),Pr.stop(),this.isActive=!1,console.log("[HFT-Orchestrator] HFT system stopped"))}ingestSignal(t,n,r,s,o,a){bn.ingestSignal({symbol:t,direction:n,confidence:r,agentId:s,agentName:o,metadata:a})}getPrice(t){return ut.getPrice(t)}getPriceSync(t){return ut.getPriceSync(t)}getAllPrices(){return ut.getPricesObject()}getSnapshot(t){return ut.getSnapshot(t)}getConsensus(t){return bn.getConsensus(t)}getExecutionIntent(t){return bn.getExecutionIntent(t)}async executeNow(t){return Pr.executeImmediate(t)}getExecutionHistory(t){return Pr.getExecutionHistory(t)}onPriceUpdate(t,n){return ut.subscribe(t,n)}onAnyPriceUpdate(t){return ut.subscribeAll(t)}onConsensus(t){return bn.onConsensus(t)}onExecutionIntent(t){return bn.onExecutionIntent(t)}onExecution(t){return Pr.onExecution(t)}recordE2ELatency(t){this.latencyCount>=this.MAX_LATENCY_SAMPLES?this.latencySum-=this.e2eLatencies[this.latencyHead]||0:this.latencyCount++,this.e2eLatencies[this.latencyHead]=t,this.latencySum+=t,this.latencyHead=(this.latencyHead+1)%this.MAX_LATENCY_SAMPLES}getE2EAvgLatency(){return this.latencyCount>0?this.latencySum/this.latencyCount:0}getStatus(){const t=ut.getMetrics(),n=bn.getMetrics(),r=Pr.getMetrics();return{isActive:this.isActive,uptime:this.isActive?Date.now()-this.startTime:0,priceStream:t,signalProcessor:n,executionEngine:{totalExecutions:r.totalExecutions,avgLatency:r.avgLatency,avgSlippage:r.avgSlippage,activeOrders:r.activeOrders,isActive:r.isActive},systemLatency:{e2eAvg:this.getE2EAvgLatency(),priceToSignal:n.avgProcessTime,signalToExecution:r.avgLatency}}}runDiagnostics(){const t=[],n=[],r=this.getStatus();r.priceStream.isActive||t.push("Price stream is not active"),r.priceStream.avgLatency>200&&(t.push(`Price stream latency is high: ${r.priceStream.avgLatency.toFixed(0)}ms`),n.push("Consider reducing poll interval")),r.signalProcessor.isActive||t.push("Signal processor is not active"),r.signalProcessor.avgProcessTime>50&&(t.push(`Signal processing is slow: ${r.signalProcessor.avgProcessTime.toFixed(1)}ms`),n.push("Reduce number of active symbols or agents")),r.executionEngine.isActive||t.push("Execution engine is not active"),r.executionEngine.avgLatency>100&&(t.push(`Execution latency is high: ${r.executionEngine.avgLatency.toFixed(0)}ms`),n.push("Check network connectivity")),r.executionEngine.avgSlippage>.005&&(t.push(`Slippage is high: ${(r.executionEngine.avgSlippage*100).toFixed(2)}%`),n.push("Consider reducing position sizes")),r.systemLatency.e2eAvg>300&&t.push(`End-to-end latency is high: ${r.systemLatency.e2eAvg.toFixed(0)}ms`);let s="healthy";return t.length>3?s="critical":t.length>0&&(s="degraded"),{status:s,issues:t,recommendations:n}}}const lc=new fL,mL={mode:"DEMO",exchange:"binance",baseCapital:1e4,maxPositionPct:na.maxPositionPct,maxConcurrentPositions:na.maxConcurrentPositions,confidenceThreshold:na.confidenceThreshold,enableAutoExit:!0,maxHoldTimeMs:na.maxHoldTimeMs};class FS{constructor(){G(this,"activeTrades",new Map);G(this,"tradeHistory",[]);G(this,"config",{...mL});G(this,"tradeSubscribers",new Set);G(this,"executionSubscribers",new Set);G(this,"priceProvider",null);G(this,"metrics",{totalSignals:0,executedSignals:0,rejectedSignals:0,avgEntryLatency:0,avgExitLatency:0,avgSlippage:0,totalVolume:0,latencyHistogram:[]});G(this,"isActive",!1);G(this,"monitorInterval",null);G(this,"latencyHistogramHead",0)}start(t){this.isActive||(t&&(this.config={...this.config,...t}),this.isActive=!0,this.monitorInterval=setInterval(()=>{this.monitorOpenPositions()},xl.POSITION_MONITOR_INTERVAL_MS),console.log(`[ExecutionCore] Started in ${this.config.mode} mode | Exchange: ${this.config.exchange}`))}stop(){this.isActive=!1,this.monitorInterval&&(clearInterval(this.monitorInterval),this.monitorInterval=null),console.log("[ExecutionCore] Stopped")}setMode(t){this.config.mode=t,console.log(`[ExecutionCore] Mode changed to ${t}`)}setConfig(t){this.config={...this.config,...t}}setPriceProvider(t){this.priceProvider=t}executeSignal(t,n){var y;const r=performance.now();if(this.metrics.totalSignals++,!this.isActive)return this.rejectSignal(t,"Engine not active"),null;if(t.confidence<this.config.confidenceThreshold)return this.rejectSignal(t,`Confidence ${t.confidence}% < threshold ${this.config.confidenceThreshold}%`),null;if(this.activeTrades.size>=this.config.maxConcurrentPositions)return this.rejectSignal(t,`Max ${this.config.maxConcurrentPositions} concurrent positions reached`),null;if(this.getPositionBySymbol(t.symbol))return this.rejectSignal(t,`Position already exists on ${t.symbol}`),null;const o=n||((y=this.priceProvider)==null?void 0:y.call(this,t.symbol));if(!o)return this.rejectSignal(t,`No price data for ${t.symbol}`),null;const a=pu(t.confidence),l=Go[a],c=this.calculateSlippage(t,o,l.maxSlippage),d=t.side==="LONG"?o.price*(1+c):o.price*(1-c),u=this.config.baseCapital*this.config.maxPositionPct*l.positionSizeMultiplier,h=u/d,p=Wo(this.config.exchange),m=u*p.taker,x=t.side==="LONG"?d*(1-l.stopLossPct/100):d*(1+l.stopLossPct/100),g=t.side==="LONG"?d*(1+l.takeProfitPct/100):d*(1-l.takeProfitPct/100),w=performance.now()-r,v={id:`${this.config.mode}_${Date.now()}_${Math.random().toString(36).substr(2,6)}
482`,mode:this.config.mode,symbol:t.symbol,side:t.side,status:"OPEN",signalTimestamp:t.timestamp,entryTimestamp:performance.now(),entryPrice:d,quantity:h,positionSize:u,entryFees:m,entrySlippage:c,entryLatencyMs:w,grossPnL:0,netPnL:-m,stopLoss:x,takeProfit:g,tradeGrade:a,agentId:t.agentId,agentName:t.agentName,confidence:t.confidence,executionId:`exec_${Date.now()}`,auditLog:[{timestamp:t.timestamp,event:"SIGNAL_RECEIVED",details:`${t.side} @ $${t.entryPrice.toFixed(2)} | ${t.confidence}% confidence`},{timestamp:performance.now(),event:"EXECUTION_COMPLETE",details:`Filled @ $${d.toFixed(2)} | Slippage: ${(c*100).toFixed(4)}% | Latency: ${w.toFixed(3)}ms`,latencyMs:w,priceAtEvent:d}]};return this.activeTrades.set(v.id,v),this.metrics.executedSignals++,this.metrics.totalVolume+=u,this.updateLatencyMetrics(w,"entry"),this.updateSlippageMetrics(c),this.logExecution(v),this.notifyTradeUpdate(v,"OPENED"),this.notifyExecution(v),v}monitorOpenPositions(){var n;if(!this.isActive)return;const t=performance.now();for(const[r,s]of this.activeTrades){if(s.status!=="OPEN")continue;const o=(n=this.priceProvider)==null?void 0:n.call(this,s.symbol);if(!o)continue;const a=o.price,l=t-s.entryTimestamp,c=Go[s.tradeGrade],u=(s.side==="LONG"?a-s.entryPrice:s.entryPrice-a)*s.quantity,h=u-s.entryFees;s.grossPnL=u,s.netPnL=h;let p=!1,m="MANUAL_CLOSE";(s.side==="LONG"&&a>=s.takeProfit||s.side==="SHORT"&&a<=s.takeProfit)&&(p=!0,m="TP_HIT"),!p&&l>=c.minHoldMs&&(s.side==="LONG"&&a<=s.stopLoss||s.side==="SHORT"&&a>=s.stopLoss)&&(p=!0,m="STOP_HIT");const x=h/s.positionSize*100,g=c.stopLossPct*na.emergencyStopMultiplier;!p&&x<=-g&&(p=!0,m="EMERGENCY_STOP"),!p&&this.config.enableAutoExit&&l>=this.config.maxHoldTimeMs&&(p=!0,m="TIME_EXIT"),p&&this.closePosition(r,a,m)}}closePosition(t,n,r="MANUAL_CLOSE"){var v;const s=this.activeTrades.get(t);if(!s||s.status!=="OPEN")return null;const o=performance.now(),a=(v=this.priceProvider)==null?void 0:v.call(this,s.symbol),l=n||(a==null?void 0:a.price)||s.entryPrice,c=Go[s.tradeGrade],d=this.calculateSlippage({symbol:s.symbol,side:s.side,confidence:s.confidence},a||{price:l,timestamp:Date.now()},c.maxSlippage),u=s.side==="LONG"?l*(1-d):l*(1+d),h=Wo(this.config.exchange),p=s.positionSize*h.taker,x=(s.side==="LONG"?u-s.entryPrice:s.entryPrice-u)*s.quantity,g=x-s.entryFees-p,w=performance.now()-o;return s.status="CLOSED",s.exitTimestamp=performance.now(),s.exitPrice=u,s.exitFees=p,s.exitSlippage=d,s.grossPnL=x,s.netPnL=g,s.auditLog.push({timestamp:performance.now(),event:r,details:`Closed @ $${u.toFixed(2)} | P&L: ${g>=0?"+":""}$${g.toFixed(2)} | Reason: ${r}`,latencyMs:w,priceAtEvent:u}),this.activeTrades.delete(t),this.tradeHistory.length>=1e3?this.tradeHistory[this.tradeHistory.length%1e3]=s:this.tradeHistory.push(s),this.updateLatencyMetrics(w,"exit"),this.logClosure(s),this.notifyTradeUpdate(s,"CLOSED"),s}calculateSlippage(t,n,r){const s=vS(t.symbol),o=$O[s];let a=n.spread?n.spread/n.price/2:o.baseSlippage;return n.volatility&&n.volatility>.5&&(a*=1+n.volatility*o.volatilityFactor),Math.min(a,r)}updateLatencyMetrics(t,n){const r=n==="entry"?"avgEntryLatency":"avgExitLatency",s=this.metrics.executedSignals;this.metrics[r]=s===1?t:(this.metrics[r]*(s-1)+t)/s,this.metrics.latencyHistogram.length<1e3?this.metrics.latencyHistogram.push(t):(this.metrics.latencyHistogram[this.latencyHistogramHead]=t,this.latencyHistogramHead=(this.latencyHistogramHead+1)%1e3)}updateSlippageMetrics(t){const n=this.metrics.executedSignals;this.metrics.avgSlippage=n===1?t:(this.metrics.avgSlippage*(n-1)+t)/n}rejectSignal(t,n){this.metrics.rejectedSignals++}async logExecution(t){try{await ye.from("agent_chat").insert({agent_id:t.agentId,agent_name:`${t.mode}: ${t.agentName}`,message:`[${t.mode}] ${t.side} ${t.symbol} @ $${t.entryPrice.toFixed(2)} | Size: $${t.positionSize.toFixed(0)} | Grade: ${t.tradeGrade} | Latency: ${t.entryLatencyMs.toFixed(2)}ms`,signal:t.side==="LONG"?"bullish":"bearish",confidence:t.confidence,timestamp_ms:Date.now()})}catch(n){console.error("[ExecutionCore] Log error:",n)}}async logClosure(t){var n;try{await ye.from("agent_chat").insert({agent_id:t.agentId,agent_name:`${t.mode}: ${t.agentName}`,message:`[${t.mode}] CLOSED ${t.side} ${t.symbol} @ $${(n=t.exitPrice)==null?void 0:n.toFixed(2)} | P&L: ${t.netPnL>=0?"+":""}$${t.netPnL.toFixed(2)}`,signal:t.netPnL>=0?"bullish":"bearish",confidence:t.confidence,timestamp_ms:Date.now()})}catch(r){console.error("[ExecutionCore] Log error:",r)}}
482onTradeUpdate(t){return this.tradeSubscribers.add(t),()=>this.tradeSubscribers.delete(t)}onExecution(t){return this.executionSubscribers.add(t),()=>this.executionSubscribers.delete(t)}notifyTradeUpdate(t,n){for(const r of this.tradeSubscribers)r(t,n)}notifyExecution(t){for(const n of this.executionSubscribers)n(t)}getActiveTrades(){return Array.from(this.activeTrades.values())}getTradeHistory(t=100){return this.tradeHistory.slice(-t)}getPositionBySymbol(t){for(const n of this.activeTrades.values())if(n.symbol===t&&n.status==="OPEN")return n;return null}getConfig(){return{...this.config}}getMetrics(){const t=[...this.metrics.latencyHistogram].sort((o,a)=>o-a),n=t[Math.floor(t.length*.5)]||0,r=t[Math.floor(t.length*.95)]||0,s=t[Math.floor(t.length*.99)]||0;return{...this.metrics,openPositions:this.activeTrades.size,totalTrades:this.tradeHistory.length,isActive:this.isActive,mode:this.config.mode,latencyPercentiles:{p50:n,p95:r,p99:s}}}reset(){this.activeTrades.clear(),this.tradeHistory=[],this.metrics={totalSignals:0,executedSignals:0,rejectedSignals:0,avgEntryLatency:0,avgExitLatency:0,avgSlippage:0,totalVolume:0,latencyHistogram:[]}}}const pL=new FS,ia=new FS;pL.setMode("LIVE");ia.setMode("DEMO");const Cs=["TSLAX","AAPLX","NVDAX","MSFTX","GOOGLX","AMZNX","METAX","COINX","MSTRX","AMDX"],gL=[{value:"binance",fee:.001},{value:"coinbase",fee:.006},{value:"kraken",fee:.0026},{value:"bybit",fee:.001},{value:"bitget",fee:.001},{value:"okx",fee:.001},{value:"interactive_brokers",fee:5e-4},{value:"alpaca",fee:0}],vL=e=>({TSLAX:352.8,AAPLX:232.5,NVDAX:138.5,MSFTX:438.2,GOOGLX:192.8,AMZNX:225.6,METAX:620.3,COINX:312.4,MSTRX:398.5,AMDX:125.6})[e]||100,BS=f.createContext(void 0);function yL({children:e}){const[t,n]=f.useState(!1),[r,s]=f.useState(1e4),[o,a]=f.useState([]),[l,c]=f.useState("binance"),[d,u]=f.useState("all"),[h,p]=f.useState(["all"]),[m,x]=f.useState(70),[g,w]=f.useState("max"),[v,y]=f.useState({}),[b,k]=f.useState([]),S=f.useRef(new Set),T=f.useRef(0),E=f.useRef(0),j=f.useRef(Date.now()),N=1e4;f.useEffect(()=>{const M=localStorage.getItem("agent_stock_assignments");if(M)try{k(JSON.parse(M))}catch{console.error("Failed to load agent stock assignments")}},[]);const R=f.useCallback((M,L)=>{k(B=>{const _=B.filter(z=>z.agentId!==M),P=L?[..._,{agentId:M,symbol:L}]:_;return localStorage.setItem("agent_stock_assignments",JSON.stringify(P)),P})},[]),F=f.useCallback(M=>{const L=b.find(B=>B.agentId===M);return(L==null?void 0:L.symbol)||null},[b]);f.useEffect(()=>{lc.start({pollIntervalMs:100,warmup:!0}),ia.start({mode:"DEMO",exchange:l,baseCapital:r,maxPositionPct:.08,maxConcurrentPositions:5,confidenceThreshold:m,enableAutoExit:!0,maxHoldTimeMs:12e4}),ia.setPriceProvider(_=>{const P=lc.getPrice(_);return P?{price:P.price,bid:P.bid,ask:P.ask,spread:P.spread,volatility:void 0,timestamp:P.timestamp}:null});const M=lc.onAnyPriceUpdate((_,P)=>{y(z=>({...z,[_]:{price:P.price,changePercent:P.changePercent}})),T.current=Date.now()}),L=ia.onExecution(_=>{console.log(`[HFT-AUDIT] DEMO Execution: ${_.side} ${_.symbol} @ $${_.entryPrice.toFixed(2)} | Latency: ${_.entryLatencyMs.toFixed(3)}ms | Grade: ${_.tradeGrade}`)}),B=lc.getAllPrices();return Object.keys(B).length>0&&y(B),()=>{M(),L(),ia.stop()}},[l,m,r]),f.useEffect(()=>{if(!t)return;const M=["Flow Trader","Quant Strat","Momentum AI","Mean Reversion","Trend Hunter"],L=()=>{var In;const P=Date.now();if(P-j.current>=36e5&&(E.current=0,j.current=P),g!=="max"&&E.current>=g||o.filter(gt=>gt.status==="open").length>=5)return;const re=Math.floor(Math.random()*M.length),Y=M[re],se=Math.floor(Math.random()*25)+75;if(se<m)return;let ee;if(d!=="all"){const gt=F(d);gt?(ee={TSLA:"TSLAX",AAPL:"AAPLX",NVDA:"NVDAX",MSFT:"MSFTX",GOOGL:"GOOGLX",AMZN:"AMZNX",META:"METAX",COIN:"COINX",MSTR:"MSTRX",AMD:"AMDX",BTC:"BTCX",ETH:"ETHX",SOL:"SOLX"}[gt]||`${gt}X`,Cs.includes(ee)||(ee=Cs[Math.floor(Math.random()*Cs.length)])):ee=Cs[Math.floor(Math.random()*Cs.length)]}else ee=Cs[Math.floor(Math.random()*Cs.length)];if(o.find(gt=>gt.symbol===ee&>.status==="open"))return;const xe=`${Date.now()}-${Y}-${ee}`;if(S.current.has(xe))return;S.current.add(xe);const q=v[ee],I=(q==null?void 0:q.price)||vL(ee),oe=((q==null?void 0:q.changePercent)||0)>0?.6:.4,ne=Math.random()<oe?"bullish":"bearish";(In=gL.find(gt=>gt.value===l))!=null&&In.fee;const ae=Math.min(r*.08,r-100);if(ae<50)return;const Ne=ae/I,nt=Wo(l),rt=ae*nt.taker,Gt=pu(se),On=Go[Gt],Ss=I*(1-On.stopLossPct/100),br=I*(1+On.takeProfitPct/100),Mi={id:crypto.randomUUID(),symbol:ee,action:ne==="bullish"?"BUY":"SELL",side:ne==="bullish"?"LONG":"SHORT",entryPrice:I,exitPrice:null,quantity:Ne,positionSize:ae,timestamp:new Date,grossPnL:0,netPnL:-rt,confidence:se,agentName:Y,agentId:d!=="all"?d:void 0,status:"open",tradeGrade:Gt,entryFees:rt,stopLoss:Ss,takeProfit:br};E.current=E.current+1,a(gt=>[Mi,...gt]),s(gt=>gt-ae);const Ts=Mi.side,Tl=d!=="all"&&F(d)?` [${F(d)}]`:"";ke.success(`${Ts} ${ee} @ $${I.toFixed(2)} | ${se}% | Grade ${Gt}${Tl}`,{duration:3e3})},B=setTimeout(L,3e3),_=setInterval(L,Math.random()*7e3+8e3);return()=>{clearTimeout(B),clearInterval(_)}},[t,m,l,r,v,d,F,o,g]),f.useEffect(()=>{if(!t)return;const L=setInterval(()=>{a(B=>B.map(_=>{if(_.status==="closed")return _;const P=v[_.symbol],z=(P==null?void 0:P.price)||_.entryPrice;let re;_.side==="LONG"?re=z-_.entryPrice:re=_.entryPrice-z;
482const Y=re*_.quantity,se=Wo(l),ee=_.positionSize*se.taker,de=Y-_.entryFees-ee,xe=de/_.positionSize*100,q=Date.now()-_.timestamp.getTime(),I=Go[_.tradeGrade];let K=!1,oe="";_.side==="LONG"&&z>=_.takeProfit?(K=!0,oe=`Take Profit: +${xe.toFixed(1)}%`):_.side==="SHORT"&&z<=_.entryPrice*(1-I.takeProfitPct/100)&&(K=!0,oe=`Take Profit: +${xe.toFixed(1)}%`),q>=I.minHoldMs&&(_.side==="LONG"&&z<=_.stopLoss?(K=!0,oe=`Stop Loss: ${xe.toFixed(1)}%`):_.side==="SHORT"&&z>=_.entryPrice*(1+I.stopLossPct/100)&&(K=!0,oe=`Stop Loss: ${xe.toFixed(1)}%`));const ne=I.stopLossPct*1.5;if(xe<=-ne&&(K=!0,oe=`Emergency Stop: ${xe.toFixed(1)}%`),q>12e4&&(K=!0,oe=`Time Exit: ${xe.toFixed(1)}%`),K){s(Ne=>Ne+_.positionSize+de);const ae=de>=0;return ke[ae?"success":"error"](`${_.side} ${_.symbol} Closed: ${de>=0?"+":""}$${de.toFixed(2)} | ${oe}`,{duration:4e3}),{..._,exitPrice:z,closedAt:new Date,grossPnL:Y,netPnL:de,status:"closed"}}return{..._,grossPnL:Y,netPnL:Y-_.entryFees}}))},1e3);return()=>clearInterval(L)},[t,l,v]);const U=f.useCallback(M=>{a(L=>L.map(B=>{var ee;if(B.id!==M||B.status==="closed")return B;const _=((ee=v[B.symbol])==null?void 0:ee.price)||B.entryPrice;let P;B.side==="LONG"?P=_-B.entryPrice:P=B.entryPrice-_;const z=P*B.quantity,re=Wo(l),Y=B.positionSize*re.taker,se=z-B.entryFees-Y;return s(de=>de+B.positionSize+se),ke.info(`Manual Close ${B.symbol}: ${se>=0?"+":""}$${se.toFixed(2)}`),{...B,exitPrice:_,closedAt:new Date,grossPnL:z,netPnL:se,status:"closed"}}))},[v,l]),V=f.useCallback(()=>{a([]),s(N),S.current.clear(),ke.success("Demo account reset to $10,000")},[]),$=o.filter(M=>M.status==="closed").reduce((M,L)=>M+L.netPnL,0);return i.jsx(BS.Provider,{value:{demoEnabled:t,setDemoEnabled:n,demoBalance:r,setDemoBalance:s,demoTrades:o,setDemoTrades:a,selectedExchange:l,setSelectedExchange:c,selectedAgentId:d,setSelectedAgentId:u,selectedAgentIds:h,setSelectedAgentIds:p,confidenceThreshold:m,setConfidenceThreshold:x,signalRateLimit:g,setSignalRateLimit:w,resetDemo:V,closeTrade:U,livePrices:v,demoPnL:$,agentStockAssignments:b,setAgentStockAssignment:R,getAgentAssignedSymbol:F},children:e})}function Pi(){const e=f.useContext(BS);if(e===void 0)throw new Error("useDemoTrading must be used within a DemoTradingProvider");return e}const xL=60*1e3;function bL(){const e=f.useRef(null),t=f.useRef(!1),n=f.useCallback(async()=>{if(!t.current){t.current=!0;try{const{data:r,error:s}=await ye.functions.invoke("track-signal-accuracy",{body:{action:"full_cycle"}});s?console.warn("[SignalEvaluator] Error:",s):r&&(r.tracked>0||r.evaluated>0)&&console.log(`[SignalEvaluator] Tracked: ${r.tracked}, Evaluated: ${r.evaluated}`)}catch(r){console.warn("[SignalEvaluator] Failed:",r)}finally{t.current=!1}}},[]);return f.useEffect(()=>(n(),e.current=setInterval(n,xL),()=>{e.current&&(clearInterval(e.current),e.current=null)}),[n]),{runEvaluation:n}}function wL(){return bL(),null}function kL({children:e}){return i.jsxs(i.Fragment,{children:[i.jsx(wL,{}),e]})}function SL(){const[e,t]=f.useState(null),[n,r]=f.useState(null),[s,o]=f.useState(null),[a,l]=f.useState(null),[c,d]=f.useState(null),[u,h]=f.useState(null),[p,m]=f.useState(!0),[x,g]=f.useState(null),[w,v]=f.useState(null),y=async()=>{try{const{data:N,error:R}=await ye.functions.invoke("institutional-flow",{body:{action:"track_institutional_movements",params:{}}});if(R)throw R;N!=null&&N.success&&(N!=null&&N.result)&&t(N.result)}catch(N){console.error("[DataRoomIntelligence] Institutional flow error:",N)}},b=async()=>{try{const{data:N,error:R}=await ye.functions.invoke("options-flow",{body:{action:"detect_unusual_activity",params:{}}});if(R)throw R;N!=null&&N.success&&(N!=null&&N.result)&&r(N.result)}catch(N){console.error("[DataRoomIntelligence] Options flow error:",N)}},k=async()=>{try{const{data:N,error:R}=await ye.functions.invoke("onchain-sentiment",{body:{action:"aggregate_onchain_metrics",params:{symbol
482:"BTC"}}});if(R)throw R;N!=null&&N.success&&(N!=null&&N.result)&&o(N.result)}catch(N){console.error("[DataRoomIntelligence] On-chain sentiment error:",N)}},S=async()=>{try{const{data:N,error:R}=await ye.functions.invoke("premium-discount");if(R)throw R;N!=null&&N.aggregateStats&&l({avgPremium:N.aggregateStats.avgPremium||0,assetsAtPremium:N.aggregateStats.assetsAtPremium||0,assetsAtDiscount:N.aggregateStats.assetsAtDiscount||0,signal:N.aggregateStats.signal||"NEUTRAL",confidence:N.aggregateStats.confidence||0,interpretation:N.aggregateStats.interpretation||""})}catch(N){console.error("[DataRoomIntelligence] Premium/discount error:",N)}},T=async()=>{try{const{data:N,error:R}=await ye.functions.invoke("exchange-reserve-flow");if(R)throw R;N!=null&&N.aggregateStats&&d({netFlowFormatted:N.aggregateStats.netFlowFormatted||"$0",dominantFlow:N.aggregateStats.dominantFlow||"NEUTRAL",exchangesWithInflow:N.aggregateStats.exchangesWithInflow||0,exchangesWithOutflow:N.aggregateStats.exchangesWithOutflow||0,signal:N.aggregateStats.signal||"NEUTRAL",confidence:N.aggregateStats.confidence||0,interpretation:N.aggregateStats.interpretation||""})}catch(N){console.error("[DataRoomIntelligence] Exchange reserve error:",N)}},E=async()=>{try{const{data:N,error:R}=await ye.functions.invoke("correlation-matrix");if(R)throw R;N!=null&&N.aggregateStats&&h({avgCrossCorrelation:N.aggregateStats.avgCrossCorrelation||0,correlationRegime:N.aggregateStats.correlationRegime||"NORMAL",riskOnRiskOff:N.aggregateStats.riskOnRiskOff||"MIXED",signal:N.aggregateStats.signal||"NEUTRAL",confidence:N.aggregateStats.confidence||0,interpretation:N.aggregateStats.interpretation||"",anomalyCount:N.aggregateStats.anomalyCount||0})}catch(N){console.error("[DataRoomIntelligence] Correlation error:",N)}},j=f.useCallback(async()=>{m(!0),g(null);try{await Promise.all([y(),b(),k(),S(),T(),E()]),v(new Date)}catch(N){g(N instanceof Error?N:new Error("Failed to fetch data room intelligence"))}finally{m(!1)}},[]);return f.useEffect(()=>{j();const N=setInterval(j,3e4);return()=>clearInterval(N)},[j]),{institutionalFlow:e,optionsFlow:n,onChainSentiment:s,premiumDiscount:a,exchangeReserve:c,correlation:u,isLoading:p,error:x,lastUpdate:w,refresh:j}}const g0=3,TL=50;function US(){const[e,t]=f.useState([]),[n,r]=f.useState(!0),[s,o]=f.useState(null),[a,l]=f.useState(null),c=async()=>{try{r(!0);const{data:h,error:p}=await ye.from("signal_accuracy").select("agent_id, agent_name, is_correct, confidence, price_change_pct, evaluated_at").eq("status","evaluated").order("evaluated_at",{ascending:!1}).limit(1e3);if(p)throw p;if(!h||h.length===0){t([]),r(!1);return}const m=new Map;h.forEach(g=>{const w=m.get(g.agent_id);w?(w.total++,g.is_correct&&w.correct++,w.confidenceSum+=g.confidence||0,w.returnSum+=g.price_change_pct||0,w.recentResults.push(g.is_correct),(!w.lastSignalAt||g.evaluated_at>w.lastSignalAt)&&(w.lastSignalAt=g.evaluated_at)):m.set(g.agent_id,{agent_id:g.agent_id,agent_name:g.agent_name,total:1,correct:g.is_correct?1:0,confidenceSum:g.confidence||0,returnSum:g.price_change_pct||0,recentResults:[g.is_correct],lastSignalAt:g.evaluated_at})});const x=Array.from(m.values()).filter(g=>g.total>=g0).map(g=>{const w=g.total>0?g.correct/g.total*100:0,v=g.total>0?g.confidenceSum/g.total:0;let y=0;const b=g.recentResults.slice(0,20);for(let k=0;k<b.length&&b[k];k++)y++;return{agent_id:g.agent_id,agent_name:g.agent_name,total_signals:g.total,correct_signals:g.correct,accuracy:Math.round(w*100)/100,avg_confidence:Math.round(v*100)/100,total_return:Math.round(g.returnSum*100)/100,win_streak:y,last_signal_at:g.lastSignalAt,is_live_verified:g.total>=g0&&w>=TL}}).sort((g,w)=>Math.abs(g.accuracy-w.accuracy)>1?w.accuracy-g.accuracy:g.total_signals!==w.total_signals?w.total_signals-g.total_signals:w.total_return-g.total_return);t(x),l(new Date),o(null)}catch(h){console.error("Failed to fetch agent leaderboard:",h),o(h instanceof Error?h.message:"Failed to load leaderboard")}finally{r(!1)}};f.useEffect(()=>{c();const h=ye.channel(`agent-leaderboard-updates-${Math.random().toString(36).slice(2)}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"signal_accuracy"},()=>{setTimeout(c,1e3)}).subscribe(),p=setInterval(c,6e4);return()=>{h.unsubscribe(),clearInterval(p)}},[]);const d=f.useMemo(()=>{const h=e.filter(p=>p.is_live_verified);return h.length===0?e.find(m=>m.accuracy>=50)||e[0]||null:h[0]},[e]);return{agents:e,bestAgent:d,getTopAgents:(h=5)=>e.slice(0,h),loading:n,error:s,lastUpdated:a,refresh:c}}function AL(){var h;const[e,t]=f.useState(!1),{bestAgent:n,loading:r}=US(),{demoEnabled:s,demoBalance:o,setDemoBalance:a,demoTrades:l,setDemoTrades:c,selectedExchange:d}=Pi(),u=async()=>
482{if(!(e||r)){if(!n){ta({title:"No Agent Available",description:"No verified agents available for quick trade",variant:"destructive"});return}t(!0);try{const p=Math.random()>.5?"BUY":"SELL",m=["BTCUSDT","ETHUSDT","AAPLX","TSLAX","NVDAX"],x=m[Math.floor(Math.random()*m.length)],g=n.accuracy||75,w=100;if(s){const v=x.includes("BTC")?95e3+Math.random()*1e3:x.includes("ETH")?3400+Math.random()*100:150+Math.random()*50,y=w/v,b=Wo(d),k=w*(b.maker/100),S=pu(g),T={id:`quick-${Date.now()}`,symbol:x,action:p,side:p==="BUY"?"LONG":"SHORT",entryPrice:v,exitPrice:null,quantity:y,positionSize:w,timestamp:new Date,grossPnL:0,netPnL:0,confidence:g,agentName:n.agent_name,agentId:n.agent_id,status:"open",tradeGrade:S,entryFees:k,stopLoss:v*(p==="BUY"?.98:1.02),takeProfit:v*(p==="BUY"?1.03:.97)};c([T,...l]),a(o-w),ta({title:"â¡ Quick Trade Executed",description:`${p} ${x} via ${n.agent_name} (Demo)`})}else{const{error:v}=await ye.functions.invoke("execute-trade",{body:{symbol:x,action:p,amount:w,agent:n.agent_name,exchange:d,confidence:g}});if(v)throw v;ta({title:"â¡ Live Trade Executed",description:`${p} ${x} via ${n.agent_name}`})}}catch(p){ta({title:"Trade Failed",description:p instanceof Error?p.message:"Execution error",variant:"destructive"})}finally{t(!1)}}};return i.jsxs(TR,{children:[i.jsx(AR,{asChild:!0,children:i.jsxs(Ee,{size:"sm",onClick:u,disabled:e||r,className:"h-7 px-2.5 gap-1.5 bg-amber-500/20 hover:bg-amber-500/30 text-amber-400 border border-amber-500/30 text-[10px] font-bold",children:[e?i.jsx(hd,{className:"w-3 h-3 animate-spin"}):i.jsx(Ge,{className:"w-3 h-3"}),i.jsx("span",{className:"hidden sm:inline",children:"QUICK"})]})}),i.jsxs(Yk,{side:"bottom",className:"text-xs",children:[i.jsxs("p",{className:"font-medium",children:["Quick Trade (",s?"Demo":"Live",")"]}),i.jsx("p",{className:"text-muted-foreground",children:n?`Top Agent: ${n.agent_name} (${(h=n.accuracy)==null?void 0:h.toFixed(0)}%)`:"Loading..."})]})]})}function EL({isConnected:e,signalCount:t,tradeCount:n,activeView:r="trading",onViewChange:s}){const[o,a]=f.useState(new Date),[l,c]=f.useState("OPEN");SL(),f.useEffect(()=>{const u=setInterval(()=>{const h=new Date;a(h);const p=h.getUTCHours()-5;p>=9.5&&p<16?c("OPEN"):p>=4&&p<9.5?c("PRE"):p>=16&&p<20?c("AFTER"):c("CLOSED")},1e3);return()=>clearInterval(u)},[]);const d={OPEN:"text-emerald-400 bg-emerald-500/20",CLOSED:"text-red-400 bg-red-500/20",PRE:"text-amber-400 bg-amber-500/20",AFTER:"text-violet-400 bg-violet-500/20"};return i.jsx(Kk,{children:i.jsx("header",{className:"bg-gradient-to-r from-[hsl(222,60%,3%)] via-[hsl(222,55%,4%)] to-[hsl(222,60%,3%)] border-b border-[hsl(187,100%,50%,0.2)]",children:i.jsxs("div",{className:"h-auto min-h-9 flex flex-wrap items-center justify-between px-2 md:px-3 py-1.5 md:py-0 font-mono text-xs gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2 pl-10 md:pl-0",children:[i.jsxs("div",{className:"relative",children:[i.jsx(Ge,{className:"w-4 h-4 md:w-5 md:h-5 text-amber-400"}),i.jsx("div",{className:"absolute inset-0 animate-ping opacity-30",children:i.jsx(Ge,{className:"w-4 h-4 md:w-5 md:h-5 text-amber-400"})})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-amber-400 font-bold tracking-widest text-xs md:text-sm leading-none",children:"TOKENSTOCKS"}),i.jsx("span",{className:"text-[7px] md:text-[8px] text-amber-400/60 tracking-[0.3em] leading-none",children:"TERMINAL"})]})]}),i.jsx("div",{className:"h-5 w-px bg-border/30 hidden md:block"}),i.jsxs("div",{className:D("flex items-center gap-1 px-1.5 md:px-2 py-0.5 rounded text-[9px] md:text-[10px] font-bold ml-6",d[l]),children:[i.jsx(ud,{className:"w-3 h-3 hidden sm:block"}),i.jsxs("span",{className:"whitespace-nowrap",children:["MARKETS ",l]})]}),i.jsx("div",{className:D("flex items-center gap-1 px-1.5 md:px-2 py-0.5 rounded",e?"bg-emerald-500/20 text-emerald-400":"bg-red-500/20 text-red-400"),children:e?i.jsxs(i.Fragment,{children:[i.jsx(LC,{className:"w-3 h-3"}),i.jsx("span",{className:"text-[9px] md:text-[10px] font-bold",children:"LIVE"}),i.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"})]}):i.jsxs(i.Fragment,{children:[i.jsx(MC,{className:"w-3 h-3"}),i.jsx("span",{className:"text-[9px] md:text-[10px] font-bold",children:"OFFLINE"})]})}),i.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-[8px] text-muted-foreground",children:"NYC"}),i.jsx("span",{className:"tabular-nums text-foreground font-medium",children:o.toLocaleTimeString("en-US",{hour12:!1,timeZone:"America/Ne
482w_York"}).slice(0,5)})]}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-[8px] text-muted-foreground",children:"LON"}),i.jsx("span",{className:"tabular-nums text-foreground font-medium",children:o.toLocaleTimeString("en-US",{hour12:!1,timeZone:"Europe/London"}).slice(0,5)})]}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-[8px] text-muted-foreground",children:"TKY"}),i.jsx("span",{className:"tabular-nums text-foreground font-medium",children:o.toLocaleTimeString("en-US",{hour12:!1,timeZone:"Asia/Tokyo"}).slice(0,5)})]})]})]}),i.jsx("div",{className:"flex items-center",children:i.jsx(AL,{})})]})})})}const NL="wss://imupgitrulufnuisoknl.functions.supabase.co/functions/v1/realtime-prices";function bu(){const[e,t]=f.useState({}),[n,r]=f.useState(!1),[s,o]=f.useState(null),a=f.useRef(null),l=f.useRef(null),c=f.useRef(0),d=5,u=f.useCallback(()=>{var p;if(((p=a.current)==null?void 0:p.readyState)!==WebSocket.OPEN)try{const m=new WebSocket(NL);a.current=m,m.onopen=()=>{r(!0),o(null),c.current=0,m.send('{"type":"subscribe","symbols":["TSLAX","AAPLX","NVDAX","MSFTX","GOOGX","AMZNX","METAX","TSLAon","AAPLon","NVDAon","AMDon","COINon"]}');const x=setInterval(()=>{m.readyState===WebSocket.OPEN&&m.send('{"type":"ping"}')},45e3);m.addEventListener("close",()=>clearInterval(x))},m.onmessage=x=>{const g=JSON.parse(x.data);if(g.type==="initial"||g.type==="price_update"){const w={},v=g.prices,y=v.length;for(let b=0;b<y;b++){const k=v[b];w[k.symbol]=k}t(w)}},m.onclose=()=>{if(r(!1),a.current=null,c.current<d){const x=Math.min(500*Math.pow(1.5,c.current),15e3);l.current=setTimeout(()=>{c.current++,u()},x)}else o("Connection lost. Please refresh the page.")},m.onerror=()=>{o("Connection error")}}catch{o("Failed to connect")}},[]),h=f.useCallback(()=>{l.current&&clearTimeout(l.current),a.current&&a.current.close(),c.current=0,u()},[u]);return f.useEffect(()=>(u(),()=>{l.current&&clearTimeout(l.current),a.current&&a.current.close()}),[u]),{prices:e,isConnected:n,error:s,reconnect:h}}const CL=["TSLAX","AAPLX","NVDAX","MSFTX","AMZNX","GOOGLX","METAX","COINX","AMDX","MSTRX","TSLAon","AAPLon","NVDAon","MSFTon","GOOGLon","METAon","AMDon","INTCon","MRVLon","SPYX","QQEX","DIAX","IWMX","HOODX","ORCLX","AVGOX","INTCX","HONX"],VS=f.memo(({symbol:e,price:t,change:n})=>i.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 text-[11px] font-mono will-change-transform",children:[i.jsx("span",{className:"text-amber-400 font-semibold",children:e.replace("X","").replace("on","")}),i.jsxs("span",{className:"text-foreground tabular-nums",children:["$",t.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),i.jsxs("span",{className:D("flex items-center gap-0.5 tabular-nums",n>=0?"text-emerald-400":"text-red-400"),children:[n>=0?i.jsx(Et,{className:"w-2.5 h-2.5"}):i.jsx(Si,{className:"w-2.5 h-2.5"}),n>=0?"+":"",n.toFixed(2),"%"]}),i.jsx("span",{className:"text-muted-foreground/30 mx-1",children:"â"})]}));VS.displayName="TickerItem";function _L(){const{prices:e}=bu(),t=f.useRef(null),n=f.useMemo(()=>{const s=o=>{const a=Math.sin(o)*1e4;return a-Math.floor(a)};return CL.map((o,a)=>{const l=e[o],c=100+s(a*12345)*400;return{symbol:o,price:(l==null?void 0:l.price)||c,change:(l==null?void 0:l.change24h)??(s(a*54321)-.5)*4}})},[e]),r=f.useMemo(()=>[...n,...n,...n],[n]);return i.jsxs("div",{className:"h-6 bg-[hsl(222,60%,2%)] border-b border-[hsl(45,100%,50%,0.2)] overflow-hidden relative",children:[i.jsx("div",{ref:t,className:"absolute inset-0 flex items-center whitespace-nowrap ticker-smooth",style:{willChange:"transform",backfaceVisibility:"hidden",perspective:1e3},children:r.map((s,o)=>i.jsx(VS,{...s},`${s.symbol}-${o}`))}),i.jsx("style",{children:` 483 .ticker-smooth { 484 animation: ticker-scroll 80s linear infinite; 485 transform: translateZ(0); 486 } 487 @keyframes ticker-scroll { 488 0% { transform: translate3d(0, 0, 0); } 489 100% { transform: translate3d(-33.333%, 0, 0); } 490 } 491 @media (prefers-reduced-motion: reduce) { 492 .ticker-smooth { 493 animation: none; 494 } 495 } 496 `})]})}const jL=[{key:"F1",label:"HELP",to:"/learn"},{key:"F2",label:"NEWS",to:"/tape"},{key:"F3",label:"TRADE",to:"/trade"},{key:"F4",label:"AGENTS",to:"/agents"},{key:"F5",label:"CHART",to:"/"},{key:"F6",label:"LEADERS",to:"/leaderboard"},{key:"F7",label:"API",to:"/api"},{key:"F8",label:"SETTINGS",to:"/agents"}];function PL(){const e=Wn();return i.jsxs("div",{className:"h-7 bg-[hsl(222,60%,3%)] border-t border-[hsl(45,100%,50%,0.15)] flex items-center px-1 gap-0.5",children:[jL.map(({key:t,label:n,to:r})=>{const s=e.pathname===r;return i.jsxs(Ie,{to:r,className:D("flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-mono transition-all","hover:bg-amber-500/20 hover:text-amber-400",s&&"bg-amber-500/30 text-amber-400"),children:[i.jsx("span",{className:"text-amber-500/80 font-bold",children:t}),i.jsx("span",{className:"text-muted-foreground",children:n})]},t)}),i.jsx("div",{className:"flex-1"}),i.jsxs("div",{className:"text-[10px] text-muted-foreground font-mono px-2",children:[i.jsx("span",{className:"text-amber-400",children:"â"})," CMD + K for search"]})]})}const v0=["TSLAX","AAPLX","NVDAX","MSFTX","AMZNX","GOOGLX","METAX","COINX"];function RL(){const{prices:e,isConnected:t}=bu(),[n,r]=f.useState({}),s=f.useRef({});return f.useEffect(()=>
496{v0.forEach(o=>{var c;const a=(c=e[o])==null?void 0:c.price,l=s.current[o];a&&l&&a!==l&&(r(d=>({...d,[o]:a>l?"up":"down"})),setTimeout(()=>{r(d=>({...d,[o]:null}))},500)),a&&(s.current[o]=a)})},[e]),i.jsxs("div",{className:"terminal-panel",children:[i.jsxs("div",{className:"terminal-header flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(ln,{className:"w-3 h-3 text-cyan-400"}),i.jsx("span",{className:"text-cyan-400",children:"LIVE QUOTES"})]}),i.jsx("div",{className:D("w-2 h-2 rounded-full",t?"bg-emerald-500 animate-pulse shadow-[0_0_6px_hsl(142,71%,45%)]":"bg-red-500")})]}),i.jsxs("div",{className:"grid grid-cols-[1fr_auto_auto] gap-2 px-2 py-1 text-[9px] text-muted-foreground border-b border-border/20",children:[i.jsx("span",{children:"SYMBOL"}),i.jsx("span",{className:"text-right",children:"PRICE"}),i.jsx("span",{className:"text-right w-14",children:"CHG%"})]}),i.jsx("div",{className:"p-1 space-y-px max-h-[220px] overflow-y-auto scrollbar-thin",children:v0.map(o=>{const a=e[o],l=(a==null?void 0:a.price)||0,c=(a==null?void 0:a.change24h)||0,d=c>=0,u=n[o];return i.jsxs("div",{className:D("grid grid-cols-[1fr_auto_auto] gap-2 px-2 py-1.5 hover:bg-primary/5 rounded text-xs transition-colors",u==="up"&&"price-up",u==="down"&&"price-down"),children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("div",{className:D("w-1 h-4 rounded-full",d?"bg-emerald-500":"bg-red-500")}),i.jsx("span",{className:"text-foreground font-semibold",children:o.replace("X","")})]}),i.jsxs("span",{className:"text-foreground tabular-nums font-medium text-right",children:["$",l.toFixed(2)]}),i.jsxs("div",{className:D("flex items-center gap-0.5 justify-end w-14 tabular-nums font-medium",d?"text-emerald-400":"text-red-400"),children:[d?i.jsx(Et,{className:"w-3 h-3"}):i.jsx(Si,{className:"w-3 h-3"}),i.jsxs("span",{children:[d?"+":"",c.toFixed(2),"%"]})]})]},o)})}),i.jsxs("div",{className:"px-2 py-1 border-t border-border/20 text-[9px] text-muted-foreground flex justify-between",children:[i.jsx("span",{children:"8 SYMBOLS"}),i.jsx("span",{className:"text-cyan-400",children:"STREAMING"})]})]})}function ft(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function OL(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const eB=6048e5,tB=864e5,nB=6e4,rB=36e5,cc=43200,y0=1440;let IL={};function ML(){return IL}function x0(e){const t=ft(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ic(e,t){const n=ft(e),r=ft(t),s=n.getTime()-r.getTime();return s<0?-1:s>0?1:s}function LL(e){return OL(e,Date.now())}function DL(e,t){const n=ft(e),r=ft(t),s=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return s*12+o}function zL(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function $L(e,t){return+ft(e)-+ft(t)}function FL(e){const t=ft(e);return t.setHours(23,59,59,999),t}function BL(e){const t=ft(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function UL(e){const t=ft(e);return+FL(t)==+BL(t)}function VL(e,t){const n=ft(e),r=ft(t),s=Ic(n,r),o=Math.abs(DL(n,r));let a;if(o<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-s*o);let l=Ic(n,r)===-s;UL(ft(e))&&o===1&&Ic(e,r)===1&&(l=!1),a=s*(o-Number(l))}return a===0?0:a}function HL(e,t,n){const r=$L(e,t)/1e3;return zL(n==null?void 0:n.roundingMethod)(r)}const XL={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},qL=(e,t,n)=>{let r;const s=XL[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Nh(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const GL={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},WL={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},KL={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},YL={date:Nh({formats:GL,defaultWidth:"full"}),time:Nh({formats:WL,defaultWidth:"full"}),dateTime:Nh({formats:KL,defaultWidth:"full"})},QL={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},JL=(e,t,n,r)=>QL[e];function Ki(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const ZL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},eD={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tD={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},nD={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
496ay","Saturday"]},rD={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},sD={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},oD=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},iD={ordinalNumber:oD,era:Ki({values:ZL,defaultWidth:"wide"}),quarter:Ki({values:eD,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ki({values:tD,defaultWidth:"wide"}),day:Ki({values:nD,defaultWidth:"wide"}),dayPeriod:Ki({values:rD,defaultWidth:"wide",formattingValues:sD,defaultFormattingWidth:"wide"})};function Yi(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?lD(l,h=>h.test(a)):aD(l,h=>h.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=t.slice(a.length);return{value:d,rest:u}}}function aD(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function lD(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function cD(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(s.length);return{value:a,rest:l}}}const dD=/^(\d+)(th|st|nd|rd)?/i,uD=/\d+/i,hD={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},fD={any:[/^b/i,/^(a|c)/i]},mD={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pD={any:[/1/i,/2/i,/3/i,/4/i]},gD={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},vD={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},yD={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},xD={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bD={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},wD={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},kD={ordinalNumber:cD({matchPattern:dD,parsePattern:uD,valueCallback:e=>parseInt(e,10)}),era:Yi({matchPatterns:hD,defaultMatchWidth:"wide",parsePatterns:fD,defaultParseWidth:"any"}),quarter:Yi({matchPatterns:mD,defaultMatchWidth:"wide",parsePatterns:pD,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Yi({matchPatterns:gD,defaultMatchWidth:"wide",parsePatterns:vD,defaultParseWidth:"any"}),day:Yi({matchPatterns:yD,defaultMatchWidth:"wide",parsePatterns:xD,defaultParseWidth:"any"}),dayPeriod:Yi({matchPatterns:bD,defaultMatchWidth:"any",parsePatterns:wD,defaultParseWidth:"any"})},SD={code:"en-US",formatDistance:qL,formatLong:YL,formatRelative:JL,localize:iD,match:kD,options:{weekStartsOn:0,firstWeekContainsDate:1}};function TD(e,t,n){const r=ML(),s=(n==null?void 0:n.locale)??r.locale??SD,o=2520,a=Ic(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:a});let c,d;a>
4960?(c=ft(t),d=ft(e)):(c=ft(e),d=ft(t));const u=HL(d,c),h=(x0(d)-x0(c))/1e3,p=Math.round((u-h)/60);let m;if(p<2)return n!=null&&n.includeSeconds?u<5?s.formatDistance("lessThanXSeconds",5,l):u<10?s.formatDistance("lessThanXSeconds",10,l):u<20?s.formatDistance("lessThanXSeconds",20,l):u<40?s.formatDistance("halfAMinute",0,l):u<60?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",1,l):p===0?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",p,l);if(p<45)return s.formatDistance("xMinutes",p,l);if(p<90)return s.formatDistance("aboutXHours",1,l);if(p<y0){const x=Math.round(p/60);return s.formatDistance("aboutXHours",x,l)}else{if(p<o)return s.formatDistance("xDays",1,l);if(p<cc){const x=Math.round(p/y0);return s.formatDistance("xDays",x,l)}else if(p<cc*2)return m=Math.round(p/cc),s.formatDistance("aboutXMonths",m,l)}if(m=VL(d,c),m<12){const x=Math.round(p/cc);return s.formatDistance("xMonths",x,l)}else{const x=m%12,g=Math.trunc(m/12);return x<3?s.formatDistance("aboutXYears",g,l):x<9?s.formatDistance("overXYears",g,l):s.formatDistance("almostXYears",g+1,l)}}function AD(e,t){return TD(e,LL(e),t)}function ED(){const[e,t]=f.useState([]),[n,r]=f.useState(null);f.useEffect(()=>{(async()=>{const{data:d}=await ye.from("agent_chat").select("*").order("timestamp_ms",{ascending:!1}).limit(20);d&&t(d)})();const c=ye.channel("terminal-signals").on("postgres_changes",{event:"INSERT",schema:"public",table:"agent_chat"},d=>{const u=d.new;t(h=>[u,...h].slice(0,20)),r(u.id),setTimeout(()=>r(null),2e3)}).subscribe();return()=>{ye.removeChannel(c)}},[]);const s=l=>l==="bullish"?i.jsx(hC,{className:"w-3.5 h-3.5"}):l==="bearish"?i.jsx(uC,{className:"w-3.5 h-3.5"}):i.jsx(Op,{className:"w-3.5 h-3.5"}),o=l=>l==="bullish"?"bg-emerald-500/20 text-emerald-400 border-emerald-500/40":l==="bearish"?"bg-red-500/20 text-red-400 border-red-500/40":"bg-amber-500/20 text-amber-400 border-amber-500/40",a=l=>l>=80?"text-emerald-400":l>=60?"text-amber-400":"text-red-400";return i.jsxs("div",{className:"terminal-panel h-full flex flex-col",children:[i.jsxs("div",{className:"terminal-header flex items-center justify-between shrink-0",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(NC,{className:"w-3 h-3 text-amber-400 animate-pulse"}),i.jsx("span",{className:"text-amber-400",children:"SIGNAL FEED"})]}),i.jsxs("span",{className:"text-muted-foreground",children:[e.length," ACTIVE"]})]}),i.jsxs("div",{className:"grid grid-cols-[auto_1fr_auto_auto] gap-2 px-2 py-1 text-[9px] text-muted-foreground border-b border-border/20 shrink-0",children:[i.jsx("span",{children:"SIG"}),i.jsx("span",{children:"AGENT / MESSAGE"}),i.jsx("span",{className:"text-right",children:"CONF"}),i.jsx("span",{className:"text-right",children:"TIME"})]}),i.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin",children:e.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[i.jsx(Xa,{className:"w-6 h-6 mb-2 text-amber-400/50"}),i.jsx("span",{className:"text-xs",children:"Awaiting signals..."})]}):i.jsx("div",{className:"p-1 space-y-1",children:e.map(l=>{const c=l.id===n,d=AD(new Date(l.timestamp_ms),{addSuffix:!1});return i.jsx("div",{className:D("p-2 rounded border transition-all",c?"animate-result-flash border-primary/50":"border-transparent hover:border-border/30 hover:bg-primary/5"),children:i.jsxs("div",{className:"grid grid-cols-[auto_1fr_auto_auto] gap-2 items-start",children:[i.jsx("div",{className:D("flex items-center justify-center w-6 h-6 rounded border",o(l.signal)),children:s(l.signal)}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"flex items-center gap-1.5 mb-0.5",children:i.jsx("span",{className:"text-xs font-semibold text-cyan-400 truncate",children:l.agent_name})}),i.jsx("p",{className:"text-[10px] text-muted-foreground leading-tight line-clamp-2",children:l.message})]}),i.jsx("div",{className:"text-right",children:i.jsxs("span",{className:D("text-xs font-bold tabular-nums",a(l.confidence)),children:[l.confidence,"%"]})}),i.jsx("div",{className:"text-right",children:i.jsx("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:d})})]})},l.id)})})}),i.jsxs("div",{className:"px-2 py-1 border-t border-border/20 text-[9px] text-muted-foreground flex justify-between shrink-0",children:[i.jsx("span",{children:"REAL-TIME"}),i.jsx("span",{className:"text-amber-400",children:"â LIVE"})]})]})}const Kr=f.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:D("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}));Kr.displayName="Input";function il(e,[t,n]){return Math.min(n,Math.max(t,e))}var ND=f.createContext(void 0);function wl(e){const t=f.useContext(ND);return e||t||"ltr"}var Ch=0;function HS(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??b0()),document.body.insertAdjacentElement("beforeend",e[1]??b0()),Ch++,()=>{Ch===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>
vendor: 4,187 bytes, line 496
496t.remove()),Ch--}},[])}function b0(){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 _h="focusScope.autoFocusOnMount",jh="focusScope.autoFocusOnUnmount",w0={bubbles:!1,cancelable:!0},CD="FocusScope",rg=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[l,c]=f.useState(null),d=et(s),u=et(o),h=f.useRef(null),p=me(t,g=>c(g)),m=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let g=function(b){if(m.paused||!l)return;const k=b.target;l.contains(k)?h.current=k:Rr(h.current,{select:!0})},w=function(b){if(m.paused||!l)return;const k=b.relatedTarget;k!==null&&(l.contains(k)||Rr(h.current,{select:!0}))},v=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&Rr(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",w);const y=new MutationObserver(v);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",w),y.disconnect()}}},[r,l,m.paused]),f.useEffect(()=>{if(l){S0.add(m);const g=document.activeElement;if(!l.contains(g)){const v=new CustomEvent(_h,w0);l.addEventListener(_h,d),l.dispatchEvent(v),v.defaultPrevented||(_D(ID(XS(l)),{select:!0}),document.activeElement===g&&Rr(l))}return()=>{l.removeEventListener(_h,d),setTimeout(()=>{const v=new CustomEvent(jh,w0);l.addEventListener(jh,u),l.dispatchEvent(v),v.defaultPrevented||Rr(g??document.body,{select:!0}),l.removeEventListener(jh,u),S0.remove(m)},0)}}},[l,d,u,m]);const x=f.useCallback(g=>{if(!n&&!r||m.paused)return;const w=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(w&&v){const y=g.currentTarget,[b,k]=jD(y);b&&k?!g.shiftKey&&v===k?(g.preventDefault(),n&&Rr(b,{select:!0})):g.shiftKey&&v===b&&(g.preventDefault(),n&&Rr(k,{select:!0})):v===y&&g.preventDefault()}},[n,r,m.paused]);return i.jsx(ie.div,{tabIndex:-1,...a,ref:p,onKeyDown:x})});rg.displayName=CD;function _D(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Rr(r,{select:t}),document.activeElement!==n)return}function jD(e){const t=XS(e),n=k0(t,e),r=k0(t.reverse(),e);return[n,r]}function XS(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function k0(e,t){for(const n of e)if(!PD(n,{upTo:t}))return n}function PD(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 RD(e){return e instanceof HTMLInputElement&&"select"in e}function Rr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&RD(e)&&t&&e.select()}}var S0=OD();function OD(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=T0(e,t),e.unshift(t)},remove(t){var n;e=T0(e,t),(n=e[0])==null||n.resume()}}}function T0(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ID(e){return e.filter(t=>t.tagName!=="A")}function wu(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var MD=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vo=new WeakMap,dc=new WeakMap,uc={},Ph=0,qS=function(e){return e&&(e.host||qS(e.parentNode))},LD=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qS(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})},DD=function(e,t,n,r){var s=LD(t,Array.isArray(e)?e:[e]);uc[n]||(uc[n]=new WeakMap);var o=uc[n],a=[],l=new Set,c=new Set(s),d=function(h){!h||l.has(h
vendor: 8,435 bytes, lines 496-533
496)||(l.add(h),d(h.parentNode))};s.forEach(d);var u=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(p){if(l.has(p))u(p);else try{var m=p.getAttribute(r),x=m!==null&&m!=="false",g=(vo.get(p)||0)+1,w=(o.get(p)||0)+1;vo.set(p,g),o.set(p,w),a.push(p),g===1&&x&&dc.set(p,!0),w===1&&p.setAttribute(n,"true"),x||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return u(t),l.clear(),Ph++,function(){a.forEach(function(h){var p=vo.get(h)-1,m=o.get(h)-1;vo.set(h,p),o.set(h,m),p||(dc.has(h)||h.removeAttribute(r),dc.delete(h)),m||h.removeAttribute(n)}),Ph--,Ph||(vo=new WeakMap,vo=new WeakMap,dc=new WeakMap,uc={})}},GS=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=MD(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),DD(r,s,n,"aria-hidden")):function(){return null}},Vn=function(){return Vn=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Vn.apply(this,arguments)};function WS(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function zD(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Mc="right-scroll-bar-position",Lc="width-before-scroll-bar",$D="with-scroll-bars-hidden",FD="--removed-body-scroll-bar-size";function Rh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function BD(e,t){var n=f.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var UD=typeof window<"u"?f.useLayoutEffect:f.useEffect,A0=new WeakMap;function VD(e,t){var n=BD(null,function(r){return e.forEach(function(s){return Rh(s,r)})});return UD(function(){var r=A0.get(n);if(r){var s=new Set(r),o=new Set(e),a=n.current;s.forEach(function(l){o.has(l)||Rh(l,null)}),o.forEach(function(l){s.has(l)||Rh(l,a)})}A0.set(n,e)},[e]),n}function HD(e){return e}function XD(e,t){t===void 0&&(t=HD);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(o),a=n}var c=function(){var u=a;a=[],u.forEach(o)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(u){a.push(u),d()},filter:function(u){return a=a.filter(u),n}}}};return s}function qD(e){e===void 0&&(e={});var t=XD(null);return t.options=Vn({async:!0,ssr:!1},e),t}var KS=function(e){var t=e.sideCar,n=WS(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 f.createElement(r,Vn({},n))};KS.isSideCarExport=!0;function GD(e,t){return e.useMedium(t),KS}var YS=qD(),Oh=function(){},ku=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:Oh,onWheelCapture:Oh,onTouchMoveCapture:Oh}),s=r[0],o=r[1],a=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,h=e.shards,p=e.sideCar,m=e.noRelative,x=e.noIsolation,g=e.inert,w=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,b=e.gapMode,k=WS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,T=VD([n,t]),E=Vn(Vn({},k),s);return f.createElement(f.Fragment,null,u&&f.createElement(S,{sideCar:YS,removeScrollBar:d,shards:h,noRelative:m,noIsolation:x,inert:g,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:b}),a?f.cloneElement(f.Children.only(l),Vn(Vn({},E),{ref:T})):f.createElement(y,Vn({},E,{className:c,ref:T}),l))});ku.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ku.classNames={fullWidth:Lc,zeroRight:Mc};var WD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function KD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=WD();return t&&e.setAttribute("nonce",t),e}function YD(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function QD(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var JD=function(){var e=0,t=null;return{add:function(n){e==0&&(t=KD())&&(YD(t,n),QD(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ZD=function(){var e=JD();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},QS=function(){var e=ZD(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},e4={left:0,top:0,right:0,gap:0},Ih=function(e){return parseInt(e||"",10)||0},t4=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Ih(n),Ih(r),Ih(s)]},n4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return e4;var t=t4(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])}},r4=QS(),Yo="data-scroll-locked",s4=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),` 497 .`.concat($D,` { 498 overflow: hidden `).concat(r,`; 499 padding-right: `).concat(l,"px ").concat(r,`; 500 } 501 body[`).concat(Yo,`] { 502 overflow: hidden `).concat(r,`; 503 overscroll-behavior: contain; 504 `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` 505 padding-left: `.concat(s,`px; 506 padding-top: `).concat(o,`px; 507 padding-right: `).concat(a,`px; 508 margin-left:0; 509 margin-top:0; 510 margin-right: `).concat(l,"px ").concat(r,`; 511 `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),` 512 } 513 514 .`).concat(Mc,` { 515 right: `).concat(l,"px ").concat(r,`; 516 } 517 518 .`).concat(Lc,` { 519 margin-right: `).concat(l,"px ").concat(r,`; 520 } 521 522 .`).concat(Mc," .").concat(Mc,` { 523 right: 0 `).concat(r,`; 524 } 525 526 .`).concat(Lc," .").concat(Lc,` { 527 margin-right: 0 `).concat(r,`; 528 } 529 530 body[`).concat(Yo,`] { 531 `).concat(FD,": ").concat(l,`px; 532 } 533`)},E0=function(){var e=parseInt(document.body.getAttribute(Yo)||"0",10);return isFinite(e)?e:0},o4=function(){f.useEffect(function(){return document.body.setAttribute(Yo,(E0()+1).toString()),function(){var e=E0()-1;e<=0?document.body.removeAttribute(Yo):document.body.setAttribute(Yo,e.toString())}},[])},i4=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;o4();var o=f.useMemo(function(){return n4(s)},[s]);return f.createElement(r4,{styles:s4(o,!t,s,n?"":"!important")})},xm=!1;if(typeof window<"u")try{var hc=Object.defineProperty({},"passive",{get:function(){return xm=!0,!0}});window.addEventListener("test",hc,hc),window.removeEventListener("test",hc,hc)}catch{xm=!1}var yo=xm?{passive:!1}:!1,a4=function(e){return e.tagName==="TEXTAREA"},JS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!a4(e)&&n[t]==="visible")},l4=function(e){return JS(e,"overflowY")},c4=function(e){return JS(e,"overflowX")},N0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=ZS(e,r);if(s){var o=e1(e,r),a=o[1],l=o[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},d4=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},u4=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ZS=function(e,t){return e==="v"?l4(t):c4(t)},e1=function(e,t){return e==="v"?d4(t):u4(t)},h4=function(e,t){return e==="h"&&t==="rtl"?-1:1}
vendor: 4,219 bytes, lines 533-536
533,f4=function(e,t,n,r,s){var o=h4(e,window.getComputedStyle(t).direction),a=o*r,l=n.target,c=t.contains(l),d=!1,u=a>0,h=0,p=0;do{if(!l)break;var m=e1(e,l),x=m[0],g=m[1],w=m[2],v=g-w-o*x;(x||v)&&ZS(e,l)&&(h+=v,p+=x);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(h)<1||!s)||!u&&(Math.abs(p)<1||!s))&&(d=!0),d},fc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},C0=function(e){return[e.deltaX,e.deltaY]},_0=function(e){return e&&"current"in e?e.current:e},m4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},p4=function(e){return` 534 .block-interactivity-`.concat(e,` {pointer-events: none;} 535 .allow-interactivity-`).concat(e,` {pointer-events: all;} 536`)},g4=0,xo=[];function v4(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),s=f.useState(g4++)[0],o=f.useState(QS)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=zD([e.lockRef.current],(e.shards||[]).map(_0),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=f.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var v=fc(g),y=n.current,b="deltaX"in g?g.deltaX:y[0]-v[0],k="deltaY"in g?g.deltaY:y[1]-v[1],S,T=g.target,E=Math.abs(b)>Math.abs(k)?"h":"v";if("touches"in g&&E==="h"&&T.type==="range")return!1;var j=N0(E,T);if(!j)return!0;if(j?S=E:(S=E==="v"?"h":"v",j=N0(E,T)),!j)return!1;if(!r.current&&"changedTouches"in g&&(b||k)&&(r.current=S),!S)return!0;var N=r.current||S;return f4(N,w,g,N==="h"?b:k,!0)},[]),c=f.useCallback(function(g){var w=g;if(!(!xo.length||xo[xo.length-1]!==o)){var v="deltaY"in w?C0(w):fc(w),y=t.current.filter(function(S){return S.name===w.type&&(S.target===w.target||w.target===S.shadowParent)&&m4(S.delta,v)})[0];if(y&&y.should){w.cancelable&&w.preventDefault();return}if(!y){var b=(a.current.shards||[]).map(_0).filter(Boolean).filter(function(S){return S.contains(w.target)}),k=b.length>0?l(w,b[0]):!a.current.noIsolation;k&&w.cancelable&&w.preventDefault()}}},[]),d=f.useCallback(function(g,w,v,y){var b={name:g,delta:w,target:v,should:y,shadowParent:y4(v)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(k){return k!==b})},1)},[]),u=f.useCallback(function(g){n.current=fc(g),r.current=void 0},[]),h=f.useCallback(function(g){d(g.type,C0(g),g.target,l(g,e.lockRef.current))},[]),p=f.useCallback(function(g){d(g.type,fc(g),g.target,l(g,e.lockRef.current))},[]);f.useEffect(function(){return xo.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",c,yo),document.addEventListener("touchmove",c,yo),document.addEventListener("touchstart",u,yo),function(){xo=xo.filter(function(g){return g!==o}),document.removeEventListener("wheel",c,yo),document.removeEventListener("touchmove",c,yo),document.removeEventListener("touchstart",u,yo)}},[]);var m=e.removeScrollBar,x=e.inert;return f.createElement(f.Fragment,null,x?f.createElement(o,{styles:p4(s)}):null,m?f.createElement(i4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function y4(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const x4=GD(YS,v4);var sg=f.forwardRef(function(e,t){return f.createElement(ku,Vn({},e,{ref:t,sideCar:x4}))});sg.classNames=ku.classNames;var b4=[" ","Enter","ArrowUp","ArrowDown"],w4=[" ","Enter"],eo="Select",[Su,Tu,k4]=eu(eo),[Ri,sB]=qt(eo,[k4,du]),Au=du(),[S4,ws]=Ri(eo),[T4,A4]=Ri(eo),t1=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:a,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:h,disabled:p,required:m,form:x}=e,g=Au(t),[w,v]=f.useState(null),[y,b]=f.useState(null),[k,S]=f.useState(!1),T=wl(d),[E,j]=qn({prop:r,defaultProp:s??!1,onChange:o,caller:eo}
vendor: 17,406 bytes, line 536
536),[N,R]=qn({prop:a,defaultProp:l,onChange:c,caller:eo}),F=f.useRef(null),U=w?x||!!w.closest("form"):!0,[V,$]=f.useState(new Set),M=Array.from(V).map(L=>L.props.value).join(";");return i.jsx(Dk,{...g,children:i.jsxs(S4,{required:m,scope:t,trigger:w,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:k,onValueNodeHasChildrenChange:S,contentId:ur(),value:N,onValueChange:R,open:E,onOpenChange:j,dir:T,triggerPointerDownPosRef:F,disabled:p,children:[i.jsx(Su.Provider,{scope:t,children:i.jsx(T4,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(L=>{$(B=>new Set(B).add(L))},[]),onNativeOptionRemove:f.useCallback(L=>{$(B=>{const _=new Set(B);return _.delete(L),_})},[]),children:n})}),U?i.jsxs(A1,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:h,value:N,onChange:L=>R(L.target.value),disabled:p,form:x,children:[N===void 0?i.jsx("option",{value:""}):null,Array.from(V)]},M):null]})})};t1.displayName=eo;var n1="SelectTrigger",r1=f.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=Au(n),a=ws(n1,n),l=a.disabled||r,c=me(t,a.onTriggerChange),d=Tu(n),u=f.useRef("touch"),[h,p,m]=N1(g=>{const w=d().filter(b=>!b.disabled),v=w.find(b=>b.value===a.value),y=C1(w,g,v);y!==void 0&&a.onValueChange(y.value)}),x=g=>{l||(a.onOpenChange(!0),m()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return i.jsx(zk,{asChild:!0,...o,children:i.jsx(ie.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":E1(a.value)?"":void 0,...s,ref:c,onClick:Z(s.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&x(g)}),onPointerDown:Z(s.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"&&(x(g),g.preventDefault())}),onKeyDown:Z(s.onKeyDown,g=>{const w=h.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(w&&g.key===" ")&&b4.includes(g.key)&&(x(),g.preventDefault())})})})});r1.displayName=n1;var s1="SelectValue",o1=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:a="",...l}=e,c=ws(s1,n),{onValueNodeHasChildrenChange:d}=c,u=o!==void 0,h=me(t,c.onValueNodeChange);return lt(()=>{d(u)},[d,u]),i.jsx(ie.span,{...l,ref:h,style:{pointerEvents:"none"},children:E1(c.value)?i.jsx(i.Fragment,{children:a}):o})});o1.displayName=s1;var E4="SelectIcon",i1=f.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return i.jsx(ie.span,{"aria-hidden":!0,...s,ref:t,children:r||"â¼"})});i1.displayName=E4;var N4="SelectPortal",a1=e=>i.jsx(tu,{asChild:!0,...e});a1.displayName=N4;var to="SelectContent",l1=f.forwardRef((e,t)=>{const n=ws(to,e.__scopeSelect),[r,s]=f.useState();if(lt(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?oo.createPortal(i.jsx(c1,{scope:e.__scopeSelect,children:i.jsx(Su.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),o):null}return i.jsx(d1,{...e,ref:t})});l1.displayName=to;var vn=10,[c1,ks]=Ri(to),C4="SelectContentImpl",_4=fi("SelectContent.RemoveScroll"),d1=f.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:x,hideWhenDetached:g,avoidCollisions:w,...v}=e,y=ws(to,n),[b,k]=f.useState(null),[S,T]=f.useState(null),E=me(t,q=>k(q)),[j,N]=f.useState(null),[R,F]=f.useState(null),U=Tu(n),[V,$]=f.useState(!1),M=f.useRef(!1);f.useEffect(()=>{if(b)return GS(b)},[b]),HS();const L=f.useCallback(q=>{const[I,...K]=U().map(ae=>ae.ref.current),[oe]=K.slice(-1),ne=document.activeElement;for(const ae of q)if(ae===ne||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===I&&S&&(S.scrollTop=0),ae===oe&&S&&(S.scrollTop=S.scrollHeight),ae==null||ae.focus(),document.activeElement!==ne))return},[U,S]),B=f.useCallback(()=>L([j,b]),[L,j,b]);f.useEffect(()=>{V&&B()},[V,B]);const{onOpenChange:_,triggerPointerDownPosRef:P}=y;f.useEffect(()=>{if(b){let q={x:0,y:0};const I=oe=>{var ne,ae;q={x:Math.abs(Math.round(oe.pageX)-(((ne=P.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(oe.pageY)-(((ae=P.current)==null?void 0:ae.y)??0))}},K=oe=>{q.x<=10&&q.y<=10?oe.preventDefault():b.contains(oe.target)||_(!1),document.removeEventListener("pointermove",I),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",K,{capture:!0})}}},[b,_,P]),f.useEffect(()=>{const q=()=>_(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[_]);const[z,re]=N1(q=>{const I=U().filter(ne=>!ne.disabled),K=I.find(ne=>ne.ref.current===document.activeElement),oe=C1(I,q,K);oe&&setTimeout(()=>oe.ref.current.focus())}),Y=f.useCallback((q,I,K)=>{const oe=!M.current&&!K;(y.value!==void 0&&y.value===I||oe)&&(N(q),oe&&(M.current=!0))},[y.value]),se=f.useCallback(()=>b==null?void 0:b.focus(),[b]),ee=f.useCallback((q,I,K)=>{const oe=!M.current&&!K;(y.value!==void 0&&y.value===I||oe)&&F(q)},[y.value]),de=r==="popper"?bm:u1,xe=de===bm?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:x,hideWhenDetached:g,avoidCollisions:w}:{};return i.jsx(c1,{scope:n,content:b,viewport:S,onViewportChange:T,itemRefCallback:Y,selectedItem:j,onItemLeave:se,itemTextRefCallback:ee,focusSelectedItem:B,selectedItemText:R,position:r,isPositioned:V,searchRef:z,children:i.jsx(sg,{as:_4,allowPinchZoom:!0,children:i.jsx(rg,{asChild:!0,trapped:y.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Z(s,q=>{var I;(I=y.trigger)==null||I.focus({preventScroll:!0}),q.preventDefault()}),children:i.jsx(gl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:i.jsx(de,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:q=>q.preventDefault(),...v,...xe,onPlaced:()=>$(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Z(v.onKeyDown,q=>{const I=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!I&&q.key.length===1&&re(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let oe=U().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(q.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const ne=q.target,ae=oe.indexOf(ne);oe=oe.slice(ae+1)}setTimeout(()=>L(oe)),q.preventDefault()}})})})})})})});d1.displayName=C4;var j4="SelectItemAlignedPosition",u1=f.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=ws(to,n),a=ks(to,n),[l,c]=f.useState(null),[d,u]=f.useState(null),h=me(t,E=>u(E)),p=Tu(n),m=f.useRef(!1),x=f.useRef(!0),{viewport:g,selectedItem:w,selectedItemText:v,focusSelectedItem:y}=a,b=f.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&g&&w&&v){const E=o.trigger.getBoundingClientRect(),j=d.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),R=v.getBoundingClientRect();if(o.dir!=="rtl"){const ne=R.left-j.left,ae=N.left-ne,Ne=E.left-ae,nt=E.width+Ne,rt=Math.max(nt,j.width),Gt=window.innerWidth-vn,On=il(ae,[vn,Math.max(vn,Gt-rt)]);l.style.minWidth=nt+"px",l.style.left=On+"px"}else{const ne=j.right-R.right,ae=window.innerWidth-N.right-ne,Ne=window.innerWidth-E.right-ae,nt=E.width+Ne,rt=Math.max(nt,j.width),Gt=window.innerWidth-vn,On=il(ae,[vn,Math.max(vn,Gt-rt)]);l.style.minWidth=nt+"px",l.style.right=On+"px"}const F=p(),U=window.innerHeight-vn*2,V=g.scrollHeight,$=window.getComputedStyle(d),M=parseInt($.borderTopWidth,10),L=parseInt($.paddingTop,10),B=parseInt($.borderBottomWidth,10),_=parseInt($.paddingBottom,10),P=M+L+V+_+B,z=Math.min(w.offsetHeight*5,P),re=window.getComputedStyle(g),Y=parseInt(re.paddingTop,10),se=parseInt(re.paddingBottom,10),ee=E.top+E.height/2-vn,de=U-ee,xe=w.offsetHeight/2,q=w.offsetTop+xe,I=M+L+q,K=P-I;if(I<=ee){const ne=F.length>0&&w===F[F.length-1].ref.current;l.style.bottom="0px";const ae=d.clientHeight-g.offsetTop-g.offsetHeight,Ne=Math.max(de,xe+(ne?se:0)+ae+B),nt=I+Ne;l.style.height=nt+"px"}else{const ne=F.length>0&&w===F[0].ref.current;l.style.top="0px";const Ne=Math.max(ee,M+g.offsetTop+(ne?Y:0)+xe)+K;l.style.height=Ne+"px",g.scrollTop=I-ee+g.offsetTop}l.style.margin=`${vn}px 0`,l.style.minHeight=z+"px",l.style.maxHeight=U+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,l,d,g,w,v,o.dir,r]);lt(()=>b(),[b]);const[k,S]=f.useState();lt(()=>{d&&S(window.getComputedStyle(d).zIndex)},[d]);const T=f.useCallback(E=>{E&&x.current===!0&&(b(),y==null||y(),x.current=!1)},[b,y]);return i.jsx(R4,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:T,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:i.jsx(ie.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});u1.displayName=j4;var P4="SelectPopperPosition",bm=f.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=vn,...o}=e,a=Au(n);return i.jsx($k,{...a,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});bm.displayName=P4;var[R4,og]=Ri(to,{}),wm="SelectViewport",h1=f.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=ks(wm,n),a=og(wm,n),l=me(t,o.onViewportChange),c=f.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(Su.Slot,{scope:n,children:i.jsx(ie.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Z(s.onScroll,d=>{const u=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=a;if(p!=null&&p.current&&h){const m=Math.abs(c.current-u.scrollTop);if(m>0){const x=window.innerHeight-vn*2,g=parseFloat(h.style.minHeight),w=parseFloat(h.style.height),v=Math.max(g,w);if(v<x){const y=v+m,b=Math.min(x,y),k=y-b;h.style.height=b+"px",h.style.bottom==="0px"&&(u.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});h1.displayName=wm;var f1="SelectGroup",[O4,I4]=Ri(f1),M4=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ur();return i.jsx(O4,{scope:n,id:s,children:i.jsx(ie.div,{role:"group","aria-labelledby":s,...r,ref:t})})});M4.displayName=f1;var m1="SelectLabel",p1=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=I4(m1,n);return i.jsx(ie.div,{id:s.id,...r,ref:t})});p1.displayName=m1;var Cd="SelectItem",[L4,g1]=Ri(Cd),v1=f.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...a}=e,l=ws(Cd,n),c=ks(Cd,n),d=l.value===r,[u,h]=f.useState(o??""),[p,m]=f.useState(!1),x=me(t,y=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,y,r,s)}),g=ur(),w=f.useRef("touch"),v=()=>{s||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(L4,{scope:n,value:r,disabled:s,textId:g,isSelected:d,onItemTextChange:f.useCallback(y=>{h(b=>b||((y==null?void 0:y.textContent)??"").trim())},[]),children:i.jsx(Su.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:i.jsx(ie.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:x,onFocus:Z(a.onFocus,()=>m(!0)),onBlur:Z(a.onBlur,()=>m(!1)),onClick:Z(a.onClick,()=>{w.current!=="mouse"&&v()}),onPointerUp:Z(a.onPointerUp,()=>{w.current==="mouse"&&v()}),onPointerDown:Z(a.onPointerDown,y=>{w.current=y.pointerType}),onPointerMove:Z(a.onPointerMove,y=>{var b;w.current=y.pointerType,s?(b=c.onItemLeave)==null||b.call(c):w.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(a.onPointerLeave,y=>{var b;y.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:Z(a.onKeyDown,y=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&y.key===" "||(w4.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})})})})});v1.displayName=Cd;var aa="SelectItemText",y1=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,a=ws(aa,n),l=ks(aa,n),c=g1(aa,n),d=A4(aa,n),[u,h]=f.useState(null),p=me(t,v=>h(v),c.onItemTextChange,v=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,v,c.value,c.disabled)}),m=u==null?void 0:u.textContent,x=f.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:w}=d;return lt(()=>(g(x),()=>w(x)),[g,w,x]),i.jsxs(i.Fragment,{children:[i.jsx(ie.span,{id:c.textId,...o,ref:p}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?oo.createPortal(o.children,a.valueNode):null]})});y1.displayName=aa;var x1="SelectItemIndicator",b1=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g1(x1,n).isSelected?i.jsx(ie.span,{"aria-hidden":!0,...r,ref:t}):null});b1.displayName=x1;var km="SelectScrollUpButton",w1=f.forwardRef((e,t)=>{const n=ks(km,e.__scopeSelect),r=og(km,e.__scopeSelect),[s,o]=f.useState(!1),a=me(t,r.onScrollButtonChange);return lt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;o(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(S1,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});w1.displayName=km;var Sm="SelectScrollDownButton",k1=f.forwardRef((e,t)=>{const n=ks(Sm,e.__scopeSelect),r=og(Sm,e.__scopeSelect),[s,o]=f.useState(!1),a=me(t,r.onScrollButtonChange);return lt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;o(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(S1,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});k1.displayName=Sm;var S1=f.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=ks("SelectScrollButton",n),a=f.useRef(null),l=Tu(n),c=f.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return f.useEffect(()=>()=>c(),[c]),lt(()=>{var u;const d=l().find(h=>h.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),i.jsx(ie.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Z(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Z(s.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Z(s.onPointerLeave,()=>{c()})})}),D4="SelectSeparator",T1=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(ie.div,{"aria-hidden":!0,...r,ref:t})});T1.displayName=D4;var Tm="SelectArrow",z4=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Au(n),o=ws(Tm,n),a=ks(Tm,n);return o.open&&a.position==="popper"?i.jsx(Fk,{...s,...r,ref:t}):null});z4.displayName=Tm;var $4="SelectBubbleInput",A1=f.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=f.useRef(null),o=me(r,s),a=wu(t);return f.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const h=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(h)}},[a,t]),i.jsx(ie.select,{...n,style:{...Sw,...n.style},ref:o,defaultValue:t})});A1.displayName=$4;function E1(e){return e===""||e===void 0}function N1(e){const t=et(e),n=f.useRef(""),r=f.useRef(0),s=f.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]),o=f.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function C1(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=F4(e,Math.max(o,0));s.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}
536function F4(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var B4=t1,_1=r1,U4=o1,V4=i1,H4=a1,j1=l1,X4=h1,P1=p1,R1=v1,q4=y1,G4=b1,O1=w1,I1=k1,M1=T1;const Dc=B4,zc=U4,Sa=f.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(_1,{ref:r,className:D("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,i.jsx(V4,{asChild:!0,children:i.jsx(Gw,{className:"h-4 w-4 opacity-50"})})]}));Sa.displayName=_1.displayName;const L1=f.forwardRef(({className:e,...t},n)=>i.jsx(O1,{ref:n,className:D("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(pC,{className:"h-4 w-4"})}));L1.displayName=O1.displayName;const D1=f.forwardRef(({className:e,...t},n)=>i.jsx(I1,{ref:n,className:D("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(Gw,{className:"h-4 w-4"})}));D1.displayName=I1.displayName;const Ta=f.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>i.jsx(H4,{children:i.jsxs(j1,{ref:s,className:D("relative z-[300] max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-border text-foreground shadow-xl",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),style:{backgroundColor:"#0a1214"},position:n,...r,children:[i.jsx(L1,{}),i.jsx(X4,{className:D("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(D1,{})]})}));Ta.displayName=j1.displayName;const W4=f.forwardRef(({className:e,...t},n)=>i.jsx(P1,{ref:n,className:D("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));W4.displayName=P1.displayName;const Yr=f.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(R1,{ref:r,className:D("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:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(G4,{children:i.jsx(jp,{className:"h-4 w-4"})})}),i.jsx(q4,{children:t})]}));Yr.displayName=R1.displayName;const K4=f.forwardRef(({className:e,...t},n)=>i.jsx(M1,{ref:n,className:D("-mx-1 my-1 h-px bg-muted",e),...t}));K4.displayName=M1.displayName;var Eu="Switch",[Y4,oB]=qt(Eu),[Q4,J4]=Y4(Eu),z1=f.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:a,disabled:l,value:c="on",onCheckedChange:d,form:u,...h}=e,[p,m]=f.useState(null),x=me(t,b=>m(b)),g=f.useRef(!1),w=p?u||!!p.closest("form"):!0,[v,y]=qn({prop:s,defaultProp:o??!1,onChange:d,caller:Eu});return i.jsxs(Q4,{scope:n,checked:v,disabled:l,children:[i.jsx(ie.button,{type:"button",role:"switch","aria-checked":v,"aria-required":a,"data-state":U1(v),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:x,onClick:Z(e.onClick,b=>{y(k=>!k),w&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),w&&i.jsx(B1,{control:p,bubbles:!g.current,name:r,value:c,checked:v,required:a,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});z1.displayName=Eu;var $1="SwitchThumb",F1=f.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=J4($1,n);return i.jsx(ie.span,{"data-state":U1(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});F1.displayName=$1;var Z4="SwitchBubbleInput",B1=f.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const a=f.useRef(null),l=me(a,o),c=wu(n),d=cu(t);return f.useEffect(()=>{const u=a.current;if(!u)return;const h=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&m){const x=new Event("click",{bubbles:r});m.call(u,n),u.dispatchEvent(x)}},[c,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});B1.displayName=Z4;function U1(e){return e?"checked":"unchecked"}var V1=z1,e3=F1;const vi=f.forwardRef(({className:e,...t},n)=>i.jsx(V1,{className:D("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent 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:i.jsx(e3,{className:D("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")})}
536));vi.displayName=V1.displayName;const Gs={market:.3,fundamental:.25,sentiment:.2,risk:.25};function t3(e,t){return t>3?"volatile":Math.abs(e)>2?"trending":"ranging"}function n3(e,t,n,r){const s=Math.abs(n)*(1+Math.random()*.5),o=t3(n,s),a=n*10+(Math.random()-.5)*20;let l="HOLD",c=50;const d=[];return a>15?(l="BUY",c=Math.min(95,60+a),d.push("Strong upward momentum")):a<-15?(l="SELL",c=Math.min(95,60+Math.abs(a)),d.push("Bearish momentum breakdown")):(l="HOLD",c=40+Math.random()*20,d.push("Consolidation pattern")),o==="trending"&&d.push(`${o} regime detected`),r>1e6&&d.push("Above-average volume"),o==="volatile"&&(c*=.85),{direction:l,confidence:Math.round(c),rationale:`Market structure analysis for ${e}`,factors:d,weight:Gs.market}}function r3(e,t,n){const s=(15+Math.random()*30-20)/20,o=(Math.random()-.3)*40,a=(Math.random()-.2)*30,l=[];let c=50;o>15?(c+=20,l.push(`Strong earnings growth: ${o.toFixed(1)}%`)):o<-10&&(c-=20,l.push(`Weak earnings: ${o.toFixed(1)}%`)),s<-.2?(c+=15,l.push("Trading below historical PE")):s>.3&&(c-=15,l.push("Elevated valuation multiple")),a>10&&(c+=10,l.push("Revenue acceleration"));let d="HOLD";return c>65?d="BUY":c<35&&(d="SELL"),{direction:d,confidence:Math.round(Math.max(30,Math.min(95,c))),rationale:`Fundamental valuation for ${e}`,factors:l,weight:Gs.fundamental}}function s3(e,t){const n=.5+(Math.random()-.5)*.8,r=.5+(Math.random()-.5)*.6,s=.5+(Math.random()-.5)*.4,o=n*.4+r*.3+s*.3,a=[];n>.7?a.push("Positive news flow"):n<.3&&a.push("Negative headlines"),r>.7?a.push("Bullish social momentum"):r<.3&&a.push("Bearish social sentiment"),s>.6?a.push("Analyst upgrades"):s<.4&&a.push("Analyst downgrades");const l=o*100;let c="HOLD";return l>65?c="BUY":l<35&&(c="SELL"),{direction:c,confidence:Math.round(Math.max(30,Math.min(90,l))),rationale:`Sentiment analysis for ${e}`,factors:a.length>0?a:["Mixed sentiment signals"],weight:Gs.sentiment}}function o3(e,t,n=Math.abs(t)*1.5){const r=15+Math.random()*20,s=.8+Math.random()*.6,o=Math.random()*25,a=[];let l=50;r>25?(l-=15,a.push(`Elevated VIX: ${r.toFixed(1)}`)):r<15&&(l+=10,a.push("Low volatility environment")),s>1.2&&(l-=10,a.push(`High beta: ${s.toFixed(2)}`)),o>15&&(l-=15,a.push("Recent drawdown concern"));let c="HOLD";return l>60?c="BUY":l<40&&(c="SELL"),{direction:c,confidence:Math.round(Math.max(40,Math.min(85,l))),rationale:`Risk asse
536ssment for ${e}`,factors:a.length>0?a:["Normal risk conditions"],weight:Gs.risk}}function i3(e,t,n,r){const s=t*.4,o=.85*15,a=10,c=e.market.confidence*e.market.weight+e.fundamental.confidence*e.fundamental.weight+e.sentiment.confidence*e.sentiment.weight+e.risk.confidence*e.risk.weight,d=s+o+a-n-r;return Math.max(20,Math.min(95,c+d*.1))}function a3(e,t,n,r,s){const o=n3(e,t,n,r),a=r3(e),l=s3(e),c=o3(e,n),d={market:o,fundamental:a,sentiment:l,risk:c},u=[o.direction,a.direction,l.direction,c.direction],h=u.filter($=>$==="BUY").length,p=u.filter($=>$==="SELL").length,m=u.filter($=>$==="HOLD").length,x=Math.max(h,p,m),g=x/4*100,w=(o.direction==="BUY"?o.confidence*o.weight:0)+(a.direction==="BUY"?a.confidence*a.weight:0)+(l.direction==="BUY"?l.confidence*l.weight:0)+(c.direction==="BUY"?c.confidence*c.weight:0),v=(o.direction==="SELL"?o.confidence*o.weight:0)+(a.direction==="SELL"?a.confidence*a.weight:0)+(l.direction==="SELL"?l.confidence*l.weight:0)+(c.direction==="SELL"?c.confidence*c.weight:0);let y="HOLD";w>v&&w>20?y="BUY":v>w&&v>20&&(y="SELL");const b=(4-x)*5,k=Math.abs(n)>3?10:0,S=Math.random()>.8?8:0,T=i3(d,g,k+b,S),E=s||T,j=T>E+3?"up":T<E-3?"down":"stable",N=[];o.factors[0]&&N.push({factor:o.factors[0],impact:o.direction==="BUY"?"bullish":o.direction==="SELL"?"bearish":"neutral",weight:Gs.market}),a.factors[0]&&N.push({factor:a.factors[0],impact:a.direction==="BUY"?"bullish":a.direction==="SELL"?"bearish":"neutral",weight:Gs.fundamental}),l.factors[0]&&N.push({factor:l.factors[0],impact:l.direction==="BUY"?"bullish":l.direction==="SELL"?"bearish":"neutral",weight:Gs.sentiment});const F={whyThisSignal:`${e} is showing ${y==="BUY"?"bullish momentum and favorable fundamentals":y==="SELL"?"bearish signals and elevated risk":"mixed signals across multiple factors"} with ${g.toFixed(0)}% agent agreement.`,whatChangedRecently:o.factors.join(", ")||"No significant changes detected.",whatInvalidatesIt:y==="BUY"?"A break below key support levels or negative earnings surprise.":y==="SELL"?"A break above resistance or positive catalyst.":"A clear directional move with volume confirmation.",timeHorizon:"Short-term (1-5 trading days)"},U=[{name:"Earnings Report",countdown:"5d 3h",impact:"high"},{name:"Fed Decision",countdown:"12d 8h",impact:"high"},{name:"Options Expiry",countdown:"2d 14h",impact:"medium"},{name:"Dividend Ex-Date",countdown:"18d",impact:"low"}],V=U[Math.floor(Math.random()*U.length)];return{finalSignal:y,confidence:Math.round(T),confidenceTrend:j,agreementScore:g,keyDrivers:N,narrative:F,agentBreakdown:d,uncertaintyBand:{low:Math.max(0,T-15),high:Math.min(100,T+10)},nextRiskEvent:V}}function iB(e,t){const n=[],r=Date.now();for(let s=0;s<20;s++){const o=r-s*36e5*4,a=["BUY","HOLD","SELL"][Math.floor(Math.random()*3)],l=50+Math.random()*40,c=(Math.random()-.5)*.1,d=t*(1+c),u=s>2?Math.random()>.3?"correct":"incorrect":"pending",h=u!=="pending"?(Math.random()-.4)*8:void 0;n.push({timestamp:o,signal:a,confidence:l,priceAtSignal:d,outcome:u,pnlPercent:h})}return n}function aB(e){const t=e.filter(s=>s.outcome!=="pending"),n=t.filter(s=>s.outcome==="correct"),r=t.filter(s=>s.pnlPercent!==void 0).map(s=>s.pnlPercent);return{winRate:t.length>0?n.length/t.length*100:0,avgReturn:r.length>0?r.reduce((s,o)=>s+o,0)/r.length:0,totalSignals:e.length}}const j0=["TSLAX","AAPLX","NVDAX","MSFTX","AMZNX","GOOGLX","METAX","COINX","MSTRX","AMDX"],P0=[{value:"binance",label:"Binance",fee:.001},{value:"kraken",label:"Kraken",fee:.0026},{value:"bybit",label:"Bybit",fee:.001},{value:"bitget",label:"Bitget",fee:.001},{value:"okx",label:"OKX",fee:.001},{value:"coinbase",label:"Coinbase",fee:.006}];function l3(){var $;const{demoEnabled:e,setDemoEnabled:t,demoBalance:n,livePrices:r,demoPnL:s,selectedExchange:o,setSelectedExchange:a,setDemoTrades:l,setDemoBalance:c}=Pi(),{bestAgent:d,agents:u,loading:h,refresh:p,lastUpdated:m}=US(),[x,g]=f.useState("TSLAX"),[w,v]=f.useState("100"),[y,b]=f.useState(!1),[k,S]=f.useState(!1),[T,E]=f.useState(!1),j=(($=r[x])==null?void 0:$.price)||0,N=s>=0,R=()=>{var B,_;const M=((B=r[x])==null?void 0:B.price)||100,L=((_=r[x])==null?void 0:_.changePercent)||0;return a3(x.replace("X",""),M,L,1e6)},F=async()=>{var ee;if(T)return;if(!d){ke.error("No verified agents available. Agents need at least 3 live signals to be ranked.");return}d.is_live_verified||ke.warning(`Agent ${d.agent_name} has limited track record (${d.total_signals} signals). Proceed with caution.`);const M=parseFloat(w);if(isNaN(M)||M<=0){ke.error("Invalid amount");return}if(!k&&M>n){ke.error("Insufficient demo balance");return}E(!0);const L=R(),B=L.finalSignal==="SELL"?"SELL":"BUY",_=B==="BUY"?"LONG":"SHORT",P=j||100,z=((ee=P0.find(de=>de.value===o))==null?void 0:ee.fee)||.001,re=M*z,Y=M/P,se=L.confidence>=80?"A":L.confidence>=70?"B":L.confidence>=60?"C":"D";try{if(k){const{error:de}
536=await ye.functions.invoke("execute-trade",{body:{symbol:x,side:B,amount:M,exchange:o,agentId:d.agent_id,agentName:d.agent_name,confidence:L.confidence,agentAccuracy:d.accuracy}});if(de)throw de;ke.success(`LIVE ${B} ${x} @ $${P.toFixed(2)} | ${d.agent_name} (${d.accuracy.toFixed(1)}% acc)`,{duration:4e3})}else{e||t(!0);const de={id:crypto.randomUUID(),symbol:x,action:B,side:_,entryPrice:P,exitPrice:null,quantity:Y,positionSize:M,timestamp:new Date,grossPnL:0,netPnL:-re,confidence:L.confidence,agentName:d.agent_name,agentId:d.agent_id,status:"open",tradeGrade:se,entryFees:re,stopLoss:P*(B==="BUY"?.97:1.03),takeProfit:P*(B==="BUY"?1.04:.96)};l(xe=>[de,...xe]),c(n-M),ke.success(`DEMO ${B} ${x} @ $${P.toFixed(2)} | ${d.agent_name} (${d.accuracy.toFixed(1)}% acc)`,{duration:4e3})}}catch(de){console.error("Trade execution error:",de),ke.error(`Trade failed: ${de instanceof Error?de.message:"Unknown error"}`)}finally{E(!1)}},U=M=>{if(!e&&!k){ke.error("Enable demo or live trading first");return}if(parseFloat(w)>n&&!k){ke.error("Insufficient balance");return}ke.success(`${M} $${w} of ${x} @ $${j.toFixed(2)}`)},V=y?R():null;return i.jsxs("div",{className:"terminal-panel",children:[i.jsxs("div",{className:"terminal-header flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(Ha,{className:"w-3 h-3 text-emerald-400"}),i.jsx("span",{className:"text-emerald-400",children:"QUICK TRADE"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[y&&i.jsxs("div",{className:D("text-[9px] font-bold px-1.5 py-0.5 rounded flex items-center gap-1",k?"bg-red-500/20 text-red-400":"bg-amber-500/20 text-amber-400"),children:[i.jsx(Ge,{className:"w-2.5 h-2.5"}),k?"LIVE":"DEMO"]}),i.jsx("div",{className:D("text-[10px] font-bold px-1.5 py-0.5 rounded",e||y?"bg-emerald-500/20 text-emerald-400":"bg-muted text-muted-foreground"),children:e||y?"ACTIVE":"PAUSED"})]})]}),i.jsxs("div",{className:"px-2 py-2 border-b border-border/20",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ge,{className:"w-3.5 h-3.5 text-amber-400"}),i.jsx("span",{className:"text-xs font-medium text-foreground",children:"Quick Trade Mode"})]}),i.jsx(vi,{checked:y,onCheckedChange:b,className:"data-[state=checked]:bg-amber-500"})]}),y&&i.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[i.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Trading Mode"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:D("text-[10px]",k?"text-muted-foreground":"text-foreground font-medium"),children:"Demo"}),i.jsx(vi,{checked:k,onCheckedChange:S,className:"data-[state=checked]:bg-red-500 h-4 w-7"}),i.jsx("span",{className:D("text-[10px]",k?"text-red-400 font-medium":"text-muted-foreground"),children:"Live"})]})]})]}),i.jsxs("div",{className:"px-2 py-2 border-b border-border/20 grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(Zw,{className:"w-3.5 h-3.5 text-muted-foreground"}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"BALANCE"}),i.jsxs("div",{className:"text-sm font-bold text-foreground tabular-nums",children:["$",n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[N?i.jsx(qv,{className:"w-3.5 h-3.5 text-emerald-400"}):i.jsx(Xv,{className:"w-3.5 h-3.5 text-red-400"}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"P&L"}),i.jsxs("div",{className:D("text-sm font-bold tabular-nums",N?"text-emerald-400":"text-red-400"),children:[N?"+":"","$",s.toFixed(2)]})]})]})]}),y?i.jsxs("div",{className:"p-2 space-y-2",children:[i.jsxs("div",{className:D("rounded p-2 border",d!=null&&d.is_live_verified?"bg-gradient-to-r from-emerald-500/10 to-teal-500/10 border-emerald-500/30":"bg-gradient-to-r from-amber-500/10 to-orange-500/10 border-amber-500/20"),children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[d!=null&&d.is_live_verified?i.jsx(Lp,{className:"w-3.5 h-3.5 text-emerald-400"}):i.jsx(Xa,{className:"w-3.5 h-3.5 text-amber-400"}),i.jsx("span",{className:"text-[10px] text-muted-foreground",children:d!=null&&d.is_live_verified?"TOP VERIFIED AGENT":"BEST AVAILABLE"})]}),i.jsx("button",{onClick:p,className:"p-0.5 hover:bg-muted/50 rounded",title:"Refresh leaderboard",children:i.jsx(Ip,{className:D("w-3 h-3 text-muted-foreground",h&&"animate-spin")})})]}
536),h&&!d?i.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Loading agents..."}):d?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"text-sm font-bold text-foreground mt-1",children:d.agent_name}),i.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Et,{className:"w-3 h-3 text-emerald-400"}),i.jsxs("span",{className:"text-[10px] text-emerald-400 font-bold",children:[d.accuracy.toFixed(1),"%"]})]}),i.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[d.total_signals," signals"]}),i.jsxs("div",{className:D("text-[10px] font-medium",d.total_return>=0?"text-emerald-400":"text-red-400"),children:[d.total_return>=0?"+":"",d.total_return.toFixed(2),"%"]})]}),d.win_streak>0&&i.jsxs("div",{className:"text-[9px] text-amber-400 mt-1",children:["ð¥ ",d.win_streak," win streak"]})]}):i.jsx("div",{className:"text-xs text-amber-400 mt-1",children:"No agents with verified track record yet"}),m&&i.jsxs("div",{className:"text-[8px] text-muted-foreground mt-1",children:["Updated ",m.toLocaleTimeString()]})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"EXCHANGE"}),i.jsxs(Dc,{value:o,onValueChange:a,children:[i.jsx(Sa,{className:"h-8 text-xs bg-background/50 border-border/50",children:i.jsx(zc,{})}),i.jsx(Ta,{children:P0.map(M=>i.jsxs(Yr,{value:M.value,className:"text-xs",children:[M.label," (",(M.fee*100).toFixed(2),"% fee)"]},M.value))})]})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"SYMBOL"}),i.jsxs(Dc,{value:x,onValueChange:g,children:[i.jsx(Sa,{className:"h-8 text-xs bg-background/50 border-border/50",children:i.jsx(zc,{})}),i.jsx(Ta,{children:j0.map(M=>{var L;return i.jsx(Yr,{value:M,className:"text-xs",children:i.jsxs("div",{className:"flex items-center justify-between gap-4 w-full",children:[i.jsx("span",{className:"font-medium",children:M}),i.jsxs("span",{className:"text-muted-foreground tabular-nums",children:["$",(((L=r[M])==null?void 0:L.price)||0).toFixed(2)]})]})},M)})})]})]}),V&&i.jsxs("div",{className:D("rounded p-2 border",V.finalSignal==="BUY"?"bg-emerald-500/10 border-emerald-500/30":V.finalSignal==="SELL"?"bg-red-500/10 border-red-500/30":"bg-muted/50 border-border/30"),children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-[10px] text-muted-foreground",children:"AI SIGNAL"}),i.jsxs("span",{className:D("text-xs font-bold",V.finalSignal==="BUY"?"text-emerald-400":V.finalSignal==="SELL"?"text-red-400":"text-muted-foreground"),children:[V.finalSignal," @ ",V.confidence,"%"]})]}),i.jsx("div",{className:"text-[10px] text-muted-foreground mt-1 truncate",children:V.narrative.whyThisSignal})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"AMOUNT (USD)"}),i.jsx(Kr,{type:"number",value:w,onChange:M=>v(M.target.value),className:"h-8 text-xs bg-background/50 border-border/50 tabular-nums",placeholder:"Enter amount"})]}),i.jsxs(Ee,{className:D("w-full h-10 text-sm font-bold",k?"bg-gradient-to-r from-red-600 to-orange-600 hover:from-red-700 hover:to-orange-700 text-white shadow-[0_0_15px_hsl(0,84%,60%,0.4)]":"bg-gradient-to-r from-amber-600 to-orange-600 hover:from-amber-700 hover:to-orange-700 text-white shadow-[0_0_15px_hsl(45,93%,47%,0.4)]"),onClick:F,disabled:T||!j||!d,children:[i.jsx(Ge,{className:"w-4 h-4 mr-2"}),T?"EXECUTING...":d?k?"EXECUTE LIVE TRADE":"EXECUTE DEMO TRADE":"NO VERIFIED AGENT"]}),k&&i.jsx("div",{className:"text-[9px] text-red-400 text-center",children:"â ï¸ Live trading uses real funds"}),d&&!d.is_live_verified&&i.jsx("div",{className:"text-[9px] text-amber-400 text-center",children:"â ï¸ Agent needs more verified signals for full ranking"})]}):i.jsxs("div",{className:"p-2 space-y-2",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"SYMBOL"}),i.jsxs(Dc,{value:x,onValueChange:g,children:[i.jsx(Sa,{className:"h-8 text-xs bg-background/50 border-border/50",children:i.jsx(zc,{})}),i.jsx(Ta,{children:j0.map(M=>{var L;return i.jsx(Yr,{value:M,className:"text-xs",children:i.jsxs("div",{className:"flex items-center justify-between gap-4 w-full",children:[i.jsx("span",{className:"font-medium",children:M}),i.jsxs("span",{className:"text-muted-foreground tabular-nums",children:["$",(((L=r[M])==null?void 0:L.price)||0).toFixed(2)]})]})},M)})})]})]}),i.jsxs("div",{className:"flex items-center justify-between text-xs",children:[i.jsx("span",{className:"text-muted-foreground",children:"CURRENT PRICE"}),i.jsxs("span",{className:"font-bold text-foreground tabular-nums",children:["$",j.toFixed(2)]})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"AMOUNT (USD)"}),i.jsx(Kr,{type:"number",value:w,onChange:M=>v(M.target.value),className:"h-8 text-xs bg-background/50 border-border/50 tabular-nums",placeholder:"Enter amount"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-1",children:[i.jsxs(Ee,{className:"h-9 text-xs font-bold bg-emerald-600 hover:bg-emerald-700 text-white shadow-[0_0_10px_hsl(142,71%,45%,0.3)]",onClick:()=>U("BUY"),children:[i.jsx(qv,{className:"w-3.5 h-3.5 mr-1"}),"BUY"]}),i.jsxs(Ee,{className:"h-9 text-xs font-bold bg-red-600 hover:bg-red-700 text-white shadow-[0_0_10px_hsl(0,84%,60%,0.3)]",onClick:()=>U("SELL"),children:[i.jsx(Xv,{className:"w-3.5 h-3.5 mr-1"}),"SELL"]})]})]})]})}const c3={momentum:"text-emerald-400 bg-emerald-500/20",trend_following:"text-cyan-400 bg-cyan-500/20",mean_reversion:"text-amber-400 bg-amber-500/20",volatility:"text-violet-400 bg-vi
536olet-500/20",multi_factor:"text-pink-400 bg-pink-500/20"};function d3(){const[e,t]=f.useState([]);f.useEffect(()=>{(async()=>{const{data:s}=await ye.from("custom_agents").select("id, name, strategy_type, is_active").eq("is_active",!0).limit(6);s&&t(s)})()},[]);const n=r=>r==="momentum"||r==="trend_following"?i.jsx(Et,{className:"w-3 h-3"}):r==="mean_reversion"?i.jsx(Si,{className:"w-3 h-3"}):i.jsx(ln,{className:"w-3 h-3"});return i.jsxs("div",{className:"terminal-panel",children:[i.jsxs("div",{className:"terminal-header flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(rn,{className:"w-3 h-3 text-violet-400"}),i.jsx("span",{className:"text-violet-400",children:"ACTIVE AGENTS"})]}),i.jsxs(Ie,{to:"/agents",className:"text-[10px] text-muted-foreground hover:text-primary flex items-center gap-0.5",children:["ALL ",i.jsx(Mo,{className:"w-3 h-3"})]})]}),i.jsx("div",{className:"p-1 space-y-1 max-h-[180px] overflow-y-auto scrollbar-thin",children:e.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center py-4 text-muted-foreground",children:[i.jsx(rn,{className:"w-6 h-6 mb-2 opacity-50"}),i.jsx("span",{className:"text-xs",children:"No active agents"}),i.jsx(Ie,{to:"/agents",className:"text-xs text-primary hover:underline mt-1",children:"Create agent â"})]}):e.map(r=>{const s=c3[r.strategy_type]||"text-primary bg-primary/20";return i.jsxs(Ie,{to:"/agents",className:"flex items-center gap-2 p-1.5 hover:bg-primary/5 rounded transition-colors group",children:[i.jsx("div",{className:D("w-6 h-6 rounded flex items-center justify-center",s),children:n(r.strategy_type)}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"text-xs font-medium text-foreground truncate group-hover:text-primary transition-colors",children:r.name}),i.jsx("div",{className:"text-[9px] text-muted-foreground uppercase",children:r.strategy_type.replace("_"," ")})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Ge,{className:"w-3 h-3 text-emerald-400"}),i.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse shadow-[0_0_4px_hsl(142,71%,45%)]"})]})]},r.id)})}),e.length>0&&i.jsxs("div",{className:"px-2 py-1 border-t border-border/20 text-[9px] text-muted-foreground flex justify-between",children:[i.jsxs("span",{children:[e.length," RUNNING"]}),i.jsx("span",{className:"text-violet-400",children:"â GENERATING"})]})]})}function Nr({label:e,value:t,change:n,prefix:r="",suffix:s="",icon:o,color:a="amber",animate:l}){return i.jsxs("div",{className:D("relative overflow-hidden bg-[hsl(222,55%,3%)] border border-border/30 rounded p-2 md:p-3",l&&"animate-pulse"),children:[i.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-amber-500/5 to-transparent"}),i.jsxs("div",{className:"relative",children:[i.jsxs("div",{className:"flex items-center justify-between mb-1 md:mb-2",children:[i.jsx("span",{className:"text-[8px] md:text-[10px] uppercase tracking-wider text-muted-foreground font-mono truncate",children:e}),i.jsx("div",{className:D("p-0.5 md:p-1 rounded bg-amber-500/10",`text-${a}-400`),children:o})]}),i.jsxs("div",{className:"flex items-baseline gap-1 md:gap-2 flex-wrap",children:[i.jsxs("span",{className:"text-sm md:text-lg font-bold font-mono text-amber-400",children:[r,typeof t=="number"?t.toLocaleString():t,s]}),n!==void 0&&i.jsxs("span",{className:D("flex items-center text-[8px] md:text-[10px] font-mono",n>=0?"text-emerald-400":"text-red-400"),children:[n>=0?i.jsx(Ua,{className:"w-2 h-2 md:w-3 md:h-3"}):i.jsx(qw,{className:"w-2 h-2 md:w-3 md:h-3"}),Math.abs(n).toFixed(1),"%"]})]})]})]})}function Mh({label:e,value:t,change:n,icon:r}){return i.jsxs("div",{className:"flex items-center gap-1 text-[9px] md:text-[10px] font-mono",children:[i.jsx("div",{className:"text-amber-400/70",children:r}),i.jsxs("span",{className:"text-muted-foreground hidden sm:inline",children:[e,":"]}),i.jsx("span",{className:"text-amber-400 font-semibold",children:t}),n!==void 0&&i.jsxs("span",{className:D("flex items-center",n>=0?"text-emerald-400":"text-red-400"),children:[n>=0?i.jsx(Ua,{className:"w-2 h-2"}):i.jsx(qw,{className:"w-2 h-2"}),Math.abs(n).toFixed(0),"%"]})]})}function R0({compact:e=!1}){const[t,n]=f.useState({totalUsers:1e4,dailyActiveUsers:5e3,dailyGMV:5e6,totalRevenue:129866,aiSignals:5e3,aiAdoption:80,routingSuccess:99.5,avgExecutionTime:2,referralSignups:1500,copyTradingUsers:2500,mintedTokens:100,viralMultiplier:1.2});return f.useEffect(()=>{const r=setInterval(()=>{n(s=>({...s,totalUsers:s.totalUsers+Math.floor(Math.random()*5),dailyActiveUsers:s.dailyActiveUsers+Math.floor(Math.random()*10)-5,dailyGMV:s.dailyGMV+Math.floor(Math.random()*5e4)-25e3,totalRevenue:s.totalRevenue+Math.floor(Math.random()*500),aiSignals:s.aiSignals+Math.floor(Math.random()*3),referralSignups:s.referralSignups+Math.floor(Math.random()*2),copyTradingUsers:s.copyTradingUsers+Math.floor(Math.random()*3)-1,mintedTokens:s.mintedTokens+Math.floor(Math.random()*2)}))},2e3);return()=>clearInterval(r)},[]),e?i.jsxs("div",{className:"flex items-center gap-2 md:gap-3 flex-wrap",children:[i.jsx(Mh,{label:"Users",value:`${(t.totalUsers/1e3).toFixed(1)}K`,change:2,icon:i.jsx(qs,{className:"w-2.5 h-2.5"})}),i.jsx(Mh,{label:"GMV",value:`$${(t.dailyGMV/1e6).toFixed(1)}M`,change:5,icon:i.jsx(Ha,{className:"w-2.5 h-2.5"})}),i.jsx(Mh,{label:"Signals",value:t.aiSignals.toString(),change:1,icon:i.jsx(rn,{className:"w-2.5 h-2.5"})})]}):i.jsxs("div",{className:"terminal-panel p-2 md:p-3",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2 pb-1.5 border-b border-amber-500/20",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ln,{className:"w-3 h-3 md:w-4 md:h-4 text-amber-400"}),i.jsx("span",{className:"text-[10px] md:text-xs font-bold text-amber-400 font-mono uppercase tracking-wider",children:"Metrics"})]}),i.jsx("span",{className:"text-[8px] md:text-[10px] text-emerald-400 font-mono animate-pulse",children:"â LIVE"})]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-1.5 md:gap-2",children:[i.jsx(Nr,{label:"Total Users",value:t.totalUsers,change:2.4,icon:i.jsx(qs,{className:"w-2.5 h-2.5 md:w-3 md:h-3"})}),i.jsx(Nr,{label:"Daily GMV",value:`$${(t.dailyGMV/1e6).toFixed(2)}M`,change:5.2,icon:i.jsx(Ha,{className:"w-2.5 h-2.5 md:w-3 md:h-3"})}),i.jsx(Nr,{label:"Revenue",value:`$${(t.totalRevenue/1e3).toFixed(1)}
536K`,change:3.8,icon:i.jsx(Et,{className:"w-2.5 h-2.5 md:w-3 md:h-3"})}),i.jsx(Nr,{label:"AI Signals",value:t.aiSignals,change:1.5,icon:i.jsx(rn,{className:"w-2.5 h-2.5 md:w-3 md:h-3"})}),i.jsx(Nr,{label:"AI %",value:t.aiAdoption,suffix:"%",icon:i.jsx(Ge,{className:"w-2.5 h-2.5 md:w-3 md:h-3"})}),i.jsx(Nr,{label:"Success",value:t.routingSuccess,suffix:"%",icon:i.jsx(ud,{className:"w-2.5 h-2.5 md:w-3 md:h-3"})}),i.jsx(Nr,{label:"Referrals",value:t.referralSignups,change:8.3,icon:i.jsx(qs,{className:"w-2.5 h-2.5 md:w-3 md:h-3"})}),i.jsx(Nr,{label:"Viral",value:t.viralMultiplier,suffix:"x",icon:i.jsx(ki,{className:"w-2.5 h-2.5 md:w-3 md:h-3"})})]})]})}const u3=su("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold 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 le({className:e,variant:t,...n}){return i.jsx("div",{className:D(u3({variant:t}),e),...n})}var ig="Progress",ag=100,[h3,lB]=qt(ig),[f3,m3]=h3(ig),H1=f.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:o=p3,...a}=e;(s||s===0)&&!O0(s)&&console.error(g3(`${s}`,"Progress"));const l=O0(s)?s:ag;r!==null&&!I0(r,l)&&console.error(v3(`${r}`,"Progress"));const c=I0(r,l)?r:null,d=_d(c)?o(c,l):void 0;return i.jsx(f3,{scope:n,value:c,max:l,children:i.jsx(ie.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":_d(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":G1(c,l),"data-value":c??void 0,"data-max":l,...a,ref:t})})});H1.displayName=ig;var X1="ProgressIndicator",q1=f.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=m3(X1,n);return i.jsx(ie.div,{"data-state":G1(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});q1.displayName=X1;function p3(e,t){return`${Math.round(e/t*100)}%`}function G1(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function _d(e){return typeof e=="number"}function O0(e){return _d(e)&&!isNaN(e)&&e>0}function I0(e,t){return _d(e)&&!isNaN(e)&&e<=t&&e>=0}function g3(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ag}\`.`}function v3(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: 537 - a positive number 538 - less than the value passed to \`max\` (or ${ag} if no \`max\` prop is set) 539 - \`null\` or \`undefined\` if the progress is indeterminate. 540 541Defaulting to \`null\`.`}var W1=H1,y3=q1;const qe=f.forwardRef(({className:e,value:t,...n},r)=>i.jsx(W1,{ref:r,className:D("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:i.jsx(y3,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));qe.displayName=W1.displayName;const x3=[{tier:1,reward:"1% token bonus",minReferrals:0,color:"amber"},{tier:2,reward:"2% token bonus",minReferrals:5,color:"cyan"},{tier:3,reward:"3% + VIP access",minReferrals:20,color:"emerald"}];function b3(){const[e,t]=f.useState({totalReferrals:7,pendingRewards:245.5,claimedRewards:1250,currentTier:2,referralCode:"TKSTK-"+Math.random().toString(36).substring(2,8).toUpperCase()}),[n,r]=f.useState(!1),[s,o]=f.useState([{user:"alex***@gmail.com",amount:35.5,time:"2h ago"},{user:"mike***@yahoo.com",amount:28,time:"5h ago"},{user:"sara***@outlook.com",amount:42,time:"1d ago"}]),a=()=>{navigator.clipboard.writeText(`https://tokenstocks.ai/ref/${e.referralCode}`),r(!0),ke.success("Referral link copied!"),setTimeout(()=>r(!1),2e3)},l=x3.find(d=>d.minReferrals>e.totalReferrals),c=l?e.totalReferrals/l.minReferrals*100:100;return i.jsxs("div",{className:"terminal-panel p-3 h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b border-amber-500/20",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(qs,{className:"w-4 h-4 text-amber-400"}),i.jsx("span",{className:"text-xs font-bold text-amber-400 font-mono uppercase tracking-wider",children:"Viral Engine"})]}),i.jsxs(le,{variant:"outline",className:"text-[10px] border-cyan-500/50 text-cyan-400",children:["Tier ",e.currentTier]})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] border border-amber-500/20 rounded p-3 mb-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-1 font-mono",children:"YOUR REFERRAL CODE"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"flex-1 text-sm font-bold text-amber-400 font-mono tracking-wider",children:e.referralCode}),i.jsxs(Ee,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:a,children:[n?i.jsx(jp,{className:"w-3 h-3"}
541):i.jsx(Yw,{className:"w-3 h-3"}),n?"Copied!":"Copy"]})]})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-3",children:[i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsx("div",{className:"text-lg font-bold text-amber-400 font-mono",children:e.totalReferrals}),i.jsx("div",{className:"text-[9px] text-muted-foreground uppercase",children:"Referrals"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-lg font-bold text-emerald-400 font-mono",children:["$",e.pendingRewards.toFixed(0)]}),i.jsx("div",{className:"text-[9px] text-muted-foreground uppercase",children:"Pending"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-lg font-bold text-cyan-400 font-mono",children:["$",e.claimedRewards.toFixed(0)]}),i.jsx("div",{className:"text-[9px] text-muted-foreground uppercase",children:"Claimed"})]})]}),l&&i.jsxs("div",{className:"mb-3",children:[i.jsxs("div",{className:"flex items-center justify-between text-[10px] mb-1",children:[i.jsxs("span",{className:"text-muted-foreground",children:["Next: ",l.reward]}),i.jsxs("span",{className:"text-amber-400",children:[e.totalReferrals,"/",l.minReferrals]})]}),i.jsx(qe,{value:c,className:"h-1.5"})]}),i.jsxs("div",{className:"flex-1 min-h-0",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-2 font-mono uppercase",children:"Recent Activity"}),i.jsx("div",{className:"space-y-1.5",children:s.map((d,u)=>i.jsxs("div",{className:"flex items-center justify-between py-1.5 px-2 bg-[hsl(222,55%,5%)] rounded text-xs",children:[i.jsx("span",{className:"text-foreground font-mono",children:d.user}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-emerald-400 font-mono",children:["+$",d.amount.toFixed(2)]}),i.jsx("span",{className:"text-muted-foreground text-[10px]",children:d.time})]})]},u))})]}),i.jsxs(Ee,{className:"w-full mt-3 gap-2 bg-amber-500/20 hover:bg-amber-500/30 text-amber-400 border border-amber-500/30",children:[i.jsx(PC,{className:"w-4 h-4"}),"Share & Earn"]})]})}const w3=[{id:"1",name:"AlphaQuant",avatar:"ð",winRate:78.5,totalReturn:245.8,followers:1250,trades:892,rank:1,badge:"gold",strategy:"Momentum",isFollowing:!1},{id:"2",name:"TeslaTrader",avatar:"â¡",winRate:72.3,totalReturn:189.2,followers:890,trades:654,rank:2,badge:"silver",strategy:"Swing",isFollowing:!0},{id:"3",name:"NVDAMaster",avatar:"ð¯",winRate:69.8,totalReturn:156.4,followers:756,trades:543,rank:3,badge:"bronze",strategy:"Technical",isFollowing:!1},{id:"4",name:"QuantBot_X",avatar:"ð¤",winRate:67.2,totalReturn:134.5,followers:523,trades:1205,rank:4,badge:null,strategy:"AI-Driven",isFollowing:!1},{id:"5",name:"DeFiDegen",avatar:"ð¥",winRate:65.1,totalReturn:112.3,followers:412,trades:876,rank:5,badge:null,strategy:"High-Risk",isFollowing:!1}],k3={gold:i.jsx(bC,{className:"w-3 h-3 text-amber-400"}),silver:i.jsx(Kv,{className:"w-3 h-3 text-gray-300"}),bronze:i.jsx(Kv,{className:"w-3 h-3 text-amber-600"})};function S3(){const[e,t]=f.useState(w3),[n,r]=f.useState("leaderboard"),[s,o]=f.useState([{name:"Weekly Challenge",prize:5e3,endTime:"2d 14h",participants:234},{name:"TSLA Trading Cup",prize:1e4,endTime:"5d 8h",participants:567}]),a=c=>{t(u=>u.map(h=>h.id===c?{...h,isFollowing:!h.isFollowing}:h));const d=e.find(u=>u.id===c);ke.success(d!=null&&d.isFollowing?`Unfollowed ${d.name}`:`Now copying ${d==null?void 0:d.name}'s trades!`)},l=e.filter(c=>c.isFollowing);return i.jsxs("div",{className:"terminal-panel p-3 h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b border-amber-500/20",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Yw,{className:"w-4 h-4 text-amber-400"}),i.jsx("span",{className:"text-xs font-bold text-amber-400 font-mono uppercase tracking-wider",children:"Copy Trading"})]}),i.jsxs("div",{className:"flex gap-1",children:[i.jsxs(Ee,{size:"sm",variant:"ghost",className:D("h-6 text-[10px] px-2",n==="leaderboard"&&"bg-amber-500/20 text-amber-400"),onClick:()=>r("leaderboard"),children:[i.jsx(Lp,{className:"w-3 h-3 mr-1"}),"Leaders"]}),i.jsxs(Ee,{size:"sm",variant:"ghost",className:D("h-6 text-[10px] px-2",n==="following"&&"bg-amber-500/20 text-amber-400"),onClick:()=>r("following"),children:[i.jsx(IC,{className:"w-3 h-3 mr-1"}),"Following (",l.length,")"]})]})]}),i.jsxs("div",{className:"bg-gradient-to-r from-amber-500/10 to-cyan-500/10 border border-amber-500/20 rounded p-2 mb-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(RC,{className:"w-3 h-3 text-amber-400"}),i.jsx("span",{className:"text-[10px] font-bold text-amber-400 uppercase",children:"Active Competitions"})]}),i.jsx("div",{className:"grid grid-cols-2 gap-2",children:s.map((c,d)=>i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[10px] font-medium text-foreground truncate",children:c.name}),i.jsxs("div",{className:"flex items-center justify-between mt-1",children:[i.jsxs("span",{className:"text-[9px] text-emerald-400 font-mono",children:["$",c.prize.toLocaleStr
541ing()]}),i.jsx("span",{className:"text-[9px] text-muted-foreground",children:c.endTime})]})]},d))})]}),i.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-thin space-y-1.5",children:(n==="leaderboard"?e:l).map(c=>i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] border border-border/20 rounded p-2 hover:border-amber-500/30 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"text-xl",children:c.avatar}),c.badge&&i.jsx("div",{className:"absolute -top-1 -right-1",children:k3[c.badge]})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"text-xs font-bold text-foreground truncate",children:c.name}),i.jsxs(le,{variant:"outline",className:"text-[8px] px-1 py-0 h-4 border-cyan-500/30 text-cyan-400",children:["#",c.rank]})]}),i.jsx("div",{className:"text-[9px] text-muted-foreground",children:c.strategy})]}),i.jsx(Ee,{size:"sm",variant:c.isFollowing?"secondary":"default",className:D("h-6 text-[10px] px-2",!c.isFollowing&&"bg-amber-500/20 hover:bg-amber-500/30 text-amber-400"),onClick:()=>a(c.id),children:c.isFollowing?"Following":"Copy"})]}),i.jsxs("div",{className:"grid grid-cols-4 gap-1.5 text-center",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"text-[10px] font-bold text-emerald-400 font-mono",children:[c.winRate,"%"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Win Rate"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-[10px] font-bold text-amber-400 font-mono",children:["+",c.totalReturn,"%"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Return"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[10px] font-bold text-foreground font-mono",children:c.followers}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Followers"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[10px] font-bold text-foreground font-mono",children:c.trades}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Trades"})]})]})]},c.id))})]})}var Lh="rovingFocusGroup.onEntryFocus",T3={bubbles:!1,cancelable:!0},kl="RovingFocusGroup",[Am,K1,A3]=eu(kl),[E3,Y1]=qt(kl,[A3]),[N3,C3]=E3(kl),Q1=f.forwardRef((e,t)=>i.jsx(Am.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Am.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(_3,{...e,ref:t})})}));Q1.displayName=kl;var _3=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...h}=e,p=f.useRef(null),m=me(t,p),x=wl(o),[g,w]=qn({prop:a,defaultProp:l??null,onChange:c,caller:kl}),[v,y]=f.useState(!1),b=et(d),k=K1(n),S=f.useRef(!1),[T,E]=f.useState(0);return f.useEffect(()=>{const j=p.current;if(j)return j.addEventListener(Lh,b),()=>j.removeEventListener(Lh,b)},[b]),i.jsx(N3,{scope:n,orientation:r,dir:x,loop:s,currentTabStopId:g,onItemFocus:f.useCallback(j=>w(j),[w]),onItemShiftTab:f.useCallback(()=>y(!0),[]),onFocusableItemAdd:f.useCallback(()=>E(j=>j+1),[]),onFocusableItemRemove:f.useCallback(()=>E(j=>j-1),[]),children:i.jsx(ie.div,{tabIndex:v||T===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{S.current=!0}),onFocus:Z(e.onFocus,j=>{const N=!S.current;if(j.target===j.currentTarget&&N&&!v){const R=new CustomEvent(Lh,T3);if(j.currentTarget.dispatchEvent(R),!R.defaultPrevented){const F=k().filter(L=>L.focusable),U=F.find(L=>L.active),V=F.find(L=>L.id===g),M=[U,V,...F].filter(Boolean).map(L=>L.ref.current);eT(M,u)}}S.current=!1}),onBlur:Z(e.onBlur,()=>y(!1))})})}),J1="RovingFocusGroupItem",Z1=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:a,...l}=e,c=ur(),d=o||c,u=C3(J1,n),h=u.currentTabStopId===d,p=K1(n),{onFocusableItemAdd:m,onFocusableItemRemove:x,currentTabStopId:g}=u;return f.useEffect(()=>{if(r)return m(),()=>x()},[r,m,x]),i.jsx(Am.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:i.jsx(ie.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:Z(e.onMouseDown,w=>{r?u.onItemFocus(d):w.preventDefault()}),onFocus:Z(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:Z(e.onKeyDown,w=>
vendor: 4,252 bytes, line 541
541{if(w.key==="Tab"&&w.shiftKey){u.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const v=R3(w,u.orientation,u.dir);if(v!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let b=p().filter(k=>k.focusable).map(k=>k.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const k=b.indexOf(w.currentTarget);b=u.loop?O3(b,k+1):b.slice(k+1)}setTimeout(()=>eT(b))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:g!=null}):a})})});Z1.displayName=J1;var j3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function P3(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function R3(e,t,n){const r=P3(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return j3[r]}function eT(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function O3(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var I3=Q1,M3=Z1,Nu="Tabs",[L3,cB]=qt(Nu,[Y1]),tT=Y1(),[D3,lg]=L3(Nu),nT=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=wl(l),[h,p]=qn({prop:r,onChange:s,defaultProp:o??"",caller:Nu});return i.jsx(D3,{scope:n,baseId:ur(),value:h,onValueChange:p,orientation:a,dir:u,activationMode:c,children:i.jsx(ie.div,{dir:u,"data-orientation":a,...d,ref:t})})});nT.displayName=Nu;var rT="TabsList",sT=f.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=lg(rT,n),a=tT(n);return i.jsx(I3,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:i.jsx(ie.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});sT.displayName=rT;var oT="TabsTrigger",iT=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=lg(oT,n),l=tT(n),c=cT(a.baseId,r),d=dT(a.baseId,r),u=r===a.value;return i.jsx(M3,{asChild:!0,...l,focusable:!s,active:u,children:i.jsx(ie.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:Z(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?a.onValueChange(r):h.preventDefault()}),onKeyDown:Z(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&a.onValueChange(r)}),onFocus:Z(e.onFocus,()=>{const h=a.activationMode!=="manual";!u&&!s&&h&&a.onValueChange(r)})})})});iT.displayName=oT;var aT="TabsContent",lT=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,l=lg(aT,n),c=cT(l.baseId,r),d=dT(l.baseId,r),u=r===l.value,h=f.useRef(u);return f.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),i.jsx(cn,{present:s||u,children:({present:p})=>i.jsx(ie.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:d,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&o})})});lT.displayName=aT;function cT(e,t){return`${e}-trigger-${t}`}function dT(e,t){return`${e}-content-${t}`}var z3=nT,uT=sT,hT=iT,fT=lT;const Sl=z3,Oi=f.forwardRef(({className:e,...t},n)=>i.jsx(uT,{ref:n,className:D("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Oi.displayName=uT.displayName;const sn=f.forwardRef(({className:e,...t},n)=>i.jsx(hT,{ref:n,className:D("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}));sn.displayName=hT.displayName;const ht=f.forwardRef(({className:e,...t},n)=>i.jsx(fT,{ref:n,className:D("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ht.displayName=fT.displayName;
541const $3=[{symbol:"fTSLA",name:"Fractional Tesla",balance:125.5,value:28750,stakedAmount:50,stakingYield:5.2,lentAmount:25,lendingRate:2.1},{symbol:"fAAPL",name:"Fractional Apple",balance:200,value:38200,stakedAmount:100,stakingYield:4.8,lentAmount:0,lendingRate:1.8},{symbol:"fNVDA",name:"Fractional NVIDIA",balance:75.25,value:10158,stakedAmount:30,stakingYield:6.1,lentAmount:15,lendingRate:2.5},{symbol:"fMSFT",name:"Fractional Microsoft",balance:150,value:62400,stakedAmount:75,stakingYield:4.5,lentAmount:25,lendingRate:1.9}],F3=[{pair:"fTSLA/USDC",tvl:25e5,apy:12.5,volume24h:45e4},{pair:"fAAPL/USDC",tvl:32e5,apy:10.2,volume24h:38e4},{pair:"fNVDA/USDC",tvl:18e5,apy:15.8,volume24h:52e4}];function B3(){const[e,t]=f.useState($3),[n,r]=f.useState(0),[s,o]=f.useState(0),[a,l]=f.useState(0),[c,d]=f.useState(0);f.useEffect(()=>{const m=e.reduce((v,y)=>v+y.value,0),x=e.reduce((v,y)=>v+y.stakedAmount/y.balance*y.value,0),g=e.reduce((v,y)=>v+y.lentAmount/y.balance*y.value,0);r(m),o(x),l(g);const w=setInterval(()=>{d(v=>v+Math.random()*.05)},3e3);return()=>clearInterval(w)},[e]);const u=m=>{ke.success(`Staking ${m} - Earning 5% APY`)},h=m=>{ke.success(`Lending ${m} - Earning 2% APR`)},p=()=>{ke.success(`Claimed $${c.toFixed(2)} in yield!`),d(0)};return i.jsxs("div",{className:"terminal-panel p-3 h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b border-amber-500/20",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Kw,{className:"w-4 h-4 text-amber-400"}),i.jsx("span",{className:"text-xs font-bold text-amber-400 font-mono uppercase tracking-wider",children:"Fractional Tokens"})]}),i.jsx(le,{variant:"outline",className:"text-[10px] border-emerald-500/50 text-emerald-400",children:"DeFi Enabled"})]}),i.jsxs("div",{className:"grid grid-cols-4 gap-2 mb-3",children:[i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-xs font-bold text-amber-400 font-mono",children:["$",(n/1e3).toFixed(1),"K"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Total Value"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-xs font-bold text-cyan-400 font-mono",children:["$",(s/1e3).toFixed(1),"K"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Staked"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-xs font-bold text-purple-400 font-mono",children:["$",(a/1e3).toFixed(1),"K"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Lent"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center relative overflow-hidden",children:[i.jsxs("div",{className:"text-xs font-bold text-emerald-400 font-mono",children:["$",c.toFixed(2)]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Yield"}),c>0&&i.jsx("button",{onClick:p,className:"absolute inset-0 bg-emerald-500/10 opacity-0 hover:opacity-100 transition-opacity flex items-center justify-center",children:i.jsx("span",{className:"text-[9px] text-emerald-400 font-bold",children:"CLAIM"})})]})]}),i.jsxs(Sl,{defaultValue:"tokens",className:"flex-1 flex flex-col min-h-0",children:[i.jsxs(Oi,{className:"grid grid-cols-2 h-7 mb-2 bg-[hsl(222,55%,5%)]",children:[i.jsx(sn,{value:"tokens",className:"text-[10px] data-[state=active]:bg-amber-500/20 data-[state=active]:text-amber-400",children:"My Tokens"}),i.jsx(sn,{value:"pools",className:"text-[10px] data-[state=active]:bg-amber-500/20 data-[state=active]:text-amber-400",children:"Liquidity Pools"})]}),i.jsx(ht,{value:"tokens",className:"flex-1 min-h-0 overflow-y-auto scrollbar-thin space-y-1.5 mt-0",children:e.map(m=>i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] border border-border/20 rounded p-2",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-bold text-foreground",children:m.symbol}),i.jsx("span",{className:"text-[9px] text-muted-foreground ml-1.5",children:m.name})]}),i.jsxs("span",{className:"text-xs font-bold text-amber-400 font-mono",children:["$",m.value.toLocaleStr
541ing()]})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-1.5 text-center mb-2",children:[i.jsxs("div",{className:"bg-[hsl(222,55%,8%)] rounded p-1",children:[i.jsx("div",{className:"text-[10px] text-foreground font-mono",children:m.balance.toFixed(2)}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Balance"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,8%)] rounded p-1",children:[i.jsx("div",{className:"text-[10px] text-cyan-400 font-mono",children:m.stakedAmount}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Staked"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,8%)] rounded p-1",children:[i.jsx("div",{className:"text-[10px] text-purple-400 font-mono",children:m.lentAmount}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Lent"})]})]}),i.jsxs("div",{className:"flex gap-1.5",children:[i.jsxs(Ee,{size:"sm",variant:"outline",className:"flex-1 h-6 text-[9px] gap-1 border-cyan-500/30 text-cyan-400 hover:bg-cyan-500/10",onClick:()=>u(m.symbol),children:[i.jsx(Qw,{className:"w-3 h-3"}),"Stake ",m.stakingYield,"%"]}),i.jsxs(Ee,{size:"sm",variant:"outline",className:"flex-1 h-6 text-[9px] gap-1 border-purple-500/30 text-purple-400 hover:bg-purple-500/10",onClick:()=>h(m.symbol),children:[i.jsx(EC,{className:"w-3 h-3"}),"Lend ",m.lendingRate,"%"]})]})]},m.symbol))}),i.jsx(ht,{value:"pools",className:"flex-1 min-h-0 overflow-y-auto scrollbar-thin space-y-1.5 mt-0",children:F3.map((m,x)=>i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] border border-border/20 rounded p-2",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("span",{className:"text-xs font-bold text-foreground",children:m.pair}),i.jsxs(le,{variant:"outline",className:"text-[9px] border-emerald-500/30 text-emerald-400",children:[m.apy,"% APY"]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-center",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"text-[10px] text-amber-400 font-mono",children:["$",(m.tvl/1e6).toFixed(2),"M"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"TVL"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-[10px] text-foreground font-mono",children:["$",(m.volume24h/1e3).toFixed(0),"K"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"24h Volume"})]})]}),i.jsx(Ee,{size:"sm",className:"w-full h-6 text-[9px] mt-2 bg-amber-500/20 hover:bg-amber-500/30 text-amber-400",children:"Add Liquidity"})]},x))})]})]})}const U3=[{name:"ExchangeA (Primary)",liquidity:5e6,priority:1,status:"online",latency:12,successRate:99.8,volume24h:25e6},{name:"ExchangeB (Secondary)",liquidity:35e5,priority:2,status:"online",latency:18,successRate:99.5,volume24h:18e6},{name:"ExchangeC (Backup)",liquidity:2e6,priority:3,status:"online",latency:25,successRate:99.2,volume24h:8e6},{name:"ExchangeD (Fallback)",liquidity:15e5,priority:4,status:"degraded",latency:45,successRate:98.5,volume24h:3e6}];function V3(){const[e,t]=f.useState(U3),[n,r]=f.useState([]),[s,o]=f.useState({avgLatency:15,successRate:99.5,routedVolume:5e6,activeRoutes:3});return f.useEffect(()=>{const a=["TSLAX","AAPLX","NVDAX","MSFTX"],l=["ExchangeA","ExchangeB","ExchangeC"],c=setInterval(()=>{const d={id:Math.random().toString(36).substring(7),symbol:a[Math.floor(Math.random()*a.length)],side:Math.random()>.5?"BUY":"SELL",size:Math.floor(Math.random()*100)+10,price:100+Math.random()*200,route:l[Math.floor(Math.random()*l.length)],latency:Math.floor(Math.random()*30)+8,status:Math.random()>.02?"filled":"partial",timestamp:Date.now()};r(u=>[d,...u].slice(0,10)),o(u=>({...u,avgLatency:u.avgLatency+(Math.random()-.5),routedVolume:u.routedVolume+d.size*d.price}))},3e3);return()=>clearInterval(c)},[]),i.jsxs("div",{className:"terminal-panel p-3 h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b border-amber-500/20",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Jw,{className:"w-4 h-4 text-amber-400"}),i.jsx("span",{className:"text-xs font-bold text-amber-400 font-mono uppercase tracking-wider",children:"Execution Routing"})]}),i.jsxs(le,{variant:"outline",className:"text-[10px] border-emerald-500/50 text-emerald-400",children:[s.activeRoutes," Active"]})]}),i.jsxs("div",{className:"grid grid-cols-4 gap-2 mb-3",children:[i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-xs font-bold text-emerald-400 font-mono",children:[s.avgLatency.toFixed(0),"ms"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Avg Latency"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-xs font-bold text-amber-400 font-mono",children:[s.successRate,"%"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Success"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-xs font-bold text-cyan-400 font-mono",children:["$",(s.routedVolume/1e6).toFixed(2),"M"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Volume"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsx("div",{className:"text-xs font-bold text-foreground font-mono",children:"4"}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Partners"})]})]}),i.jsxs("div",{className:"mb-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-2 font-mono uppercase",children:"Partner Exchanges"}),i.jsx("div",{className:"space-y-1.5",children:e.map((a,l)=>i.jsxs("div",{className:"flex items-center gap-2 p-1.5 bg-[hsl(222,55%,5%)] rounded text-xs",children:[i.jsx("div",{className:D("w-1.5 h-1.5 rounded-full",a.status==="online"?"bg-emerald-400":a.status==="degraded"?"bg-amber-400":"bg-red-400")}),i.jsx("span",{className:"flex-1 text-foreground font-mono text-[10px]",children:a.name}),i.jsxs("span",{className:"text-[9px] text-muted-foreground",children:[a.latency,"ms"]}),i.jsxs("span",{className:"text-[9px] text-emerald-400",children:[a.successRate,"%"]}),i.jsxs(le,{variant:"outline",className:"text-[8px] px-1 py-0 h-4",children:["P",a.priority]})]},l))})]}),i.jsxs("div",{className:"flex-1 min-h-0",children:[i.jsxs("div",{className:"text-[10px] text-muted-foreground mb-2 font-mono uppercase flex items-center gap-1",children:[i.jsx(ln,{className:"w-3 h-3"}
541),"Live Executions"]}),i.jsx("div",{className:"overflow-y-auto scrollbar-thin space-y-1 h-[calc(100%-20px)]",children:n.map(a=>i.jsxs("div",{className:"flex items-center gap-2 p-1.5 bg-[hsl(222,55%,5%)] rounded text-[10px] font-mono",children:[i.jsx(le,{variant:"outline",className:D("text-[8px] px-1 py-0 h-4",a.side==="BUY"?"border-emerald-500/30 text-emerald-400":"border-red-500/30 text-red-400"),children:a.side}),i.jsx("span",{className:"text-amber-400",children:a.symbol}),i.jsx("span",{className:"text-foreground",children:a.size}),i.jsx(cd,{className:"w-3 h-3 text-muted-foreground"}),i.jsx("span",{className:"text-cyan-400",children:a.route}),i.jsxs("span",{className:"text-muted-foreground ml-auto",children:[a.latency,"ms"]}),a.status==="filled"?i.jsx(Va,{className:"w-3 h-3 text-emerald-400"}):i.jsx(gC,{className:"w-3 h-3 text-amber-400"})]},a.id))})]})]})}const H3=[{name:"Transaction Fees",daily:12500,monthly:375e3,yearly:45e5,growth:15.2,color:"amber"},{name:"AI Subscriptions",daily:33333,monthly:1e6,yearly:12e6,growth:22.5,color:"cyan"},{name:"Token Minting",daily:200,monthly:6e3,yearly:72e3,growth:8.3,color:"purple"},{name:"Enterprise API",daily:83333,monthly:25e5,yearly:85e5,growth:45,color:"emerald"}],M0=[{year:1,users:1e5,gmv:5e7,revenue:25e6,aiAdoption:.8,viralMultiplier:1.2},{year:2,users:1e6,gmv:5e8,revenue:25e7,aiAdoption:.85,viralMultiplier:1.5},{year:3,users:5e6,gmv:5e9,revenue:1e9,aiAdoption:.9,viralMultiplier:2}];function X3(){const[e]=f.useState(H3),[t,n]=f.useState(0),[r,s]=f.useState(1),[o,a]=f.useState(0);f.useEffect(()=>{const d=e.reduce((u,h)=>u+h.daily,0);n(d),a(d)},[e]),f.useEffect(()=>{const d=setInterval(()=>{a(u=>u+Math.random()*5)},1e3);return()=>clearInterval(d)},[]);const l=M0[r-1],c=Math.max(...M0.map(d=>d.revenue));return i.jsxs("div",{className:"terminal-panel p-3 h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b border-amber-500/20",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Et,{className:"w-4 h-4 text-amber-400"}),i.jsx("span",{className:"text-xs font-bold text-amber-400 font-mono uppercase tracking-wider",children:"Revenue Analytics"})]}),i.jsx(le,{variant:"outline",className:"text-[10px] border-emerald-500/50 text-emerald-400 animate-pulse",children:"Live"})]}),i.jsxs("div",{className:"bg-gradient-to-r from-amber-500/10 to-emerald-500/10 border border-amber-500/20 rounded p-3 mb-3 text-center",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground uppercase mb-1",children:"Today's Revenue"}),i.jsxs("div",{className:"text-2xl font-bold text-amber-400 font-mono",children:["$",o.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),i.jsxs("div",{className:"flex items-center justify-center gap-1 mt-1 text-emerald-400 text-xs",children:[i.jsx(Ua,{className:"w-3 h-3"}),i.jsx("span",{children:"+12.5% from yesterday"})]})]}),i.jsxs(Sl,{defaultValue:"streams",className:"flex-1 flex flex-col min-h-0",children:[i.jsxs(Oi,{className:"grid grid-cols-2 h-7 mb-2 bg-[hsl(222,55%,5%)]",children:[i.jsx(sn,{value:"streams",className:"text-[10px] data-[state=active]:bg-amber-500/20 data-[state=active]:text-amber-400",children:"Revenue Streams"}),i.jsx(sn,{value:"projections",className:"text-[10px] data-[state=active]:bg-amber-500/20 data-[state=active]:text-amber-400",children:"3-Year Projection"})]}),i.jsx(ht,{value:"streams",className:"flex-1 min-h-0 overflow-y-auto scrollbar-thin space-y-2 mt-0",children:e.map((d,u)=>i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] border border-border/20 rounded p-2",children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-foreground",children:d.name}),i.jsxs("div",{className:"flex items-center gap-1 text-emerald-400 text-[10px]",children:[i.jsx(Ua,{className:"w-3 h-3"}),d.growth,"%"]})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[i.jsxs("div",{children:[i.jsxs("div",{className:D("text-[11px] font-bold font-mono",`text-${d.color}-400`),children:["$",(d.daily/1e3).toFixed(1),"K"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Daily"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-[11px] font-bold text-foreground font-mono",children:["$",(d.monthly/1e3).toFixed(0),"K"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Monthly"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-[11px] font-bold text-foreground font-mono",children:["$",(d.yearly/1e6).toFixed(1),"M"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Yearly"})]})]}),i.jsx(qe,{value:d.daily/t*100,className:"h-1 mt-2"})]},u))}),i.jsxs(ht,{value:"projections",className:"flex-1 min-h-0 mt-0",children:[i.jsx("div",{className:"flex gap-1 mb-3",children:[1,2,3].map(d=>i.jsxs("button",{onClick:()=>s(d),className:D("flex-1 py-1.5 rounded text-xs font-mono transition-colors",r===d?"bg-amber-500/20 text-amber-400 border border-amber-500/30":"bg-[hsl(222,55%,5%)] text-muted-foreground hover:text-foreground"),children:["Year ",d]},d))}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"bg-[hsl(222,55%,5%)] rounded p-3",children:i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[10px] text-muted-foreground uppercase mb-1",children:"Users"}),i.jsxs("div",{className:"text-lg font-bold text-amber-400 font-mono",children:[(l.users/1e6).toFixed(1),"M"]}),i.jsx(qe,{value:l.users/5e6*100,className:"h-1 mt-1"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[10px] text-muted-foreground uppercase mb-1",children:"GMV"}),i.jsxs("div",{className:"text-lg font-bold text-cyan-400 font-mono",children:["$",(l.gmv/1e9).toFixed(1),"B"]}),i.jsx(qe,{value:l.gmv/5e9*100,className:"h-1 mt-1"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[10px] text-muted-foreground uppercase mb-1",children:"Revenue"}),i.jsxs("div",{className:"text-lg font-bold text-emerald-400 font-mono",children:["$",(l.revenue/1e9).toFixed(2),"B"]}),i.jsx(qe,{value:l.revenue/c*100,className:"h-1 mt-1"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[10px] text-muted-foreground uppercase mb-1",children:"AI Adoption"}),i.jsxs("div",{className:"text-lg font-bold text-purple-400 font-mono",children:[(l.aiAdoption*100).toFixed(0),"%"]}),i.jsx(qe,{value:l.aiAdoption*100,className:"h-1 mt-1"})]})]})}),i.jsxs("div",{className:"bg-gradient-to-r from-amber-500/10 to-cyan-500/10 border border-amber-500/20 rounded p-2 flex items-center gap-2",children:[i.jsx(CC,{className:"w-4 h-4 text-amber-400"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-[10px] font-bold text-foreground",children:"Viral Multiplier"}),i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"Network effect growth factor"})]}),i.jsxs("div",{className:"text-lg font-bold text-amber-400 font-mono",children:[l.viralMultiplier,"x"]})]})]})]})]})]})}const q3={compliance:.3,financial:.2,security:.2,technology:.15,protocol:.1,operations:.05},mT=[{venueId:"kraken",venueName:"Kraken",compositeScore:92,riskLevel:"low",complianceStatus:"Fully Licensed",lastAuditDate:"2025-11-15",regulatoryLicenses:["FinCEN MSB","UK FCA","EU MiCA"]},{venueId:"ondo",venueName:"Ondo Finance",compositeScore:88,riskLevel:"low",complianceStatus:"OCC-Regulated",lastAuditDate:"2025-10-20",regulatoryLicenses:["SEC Registered","OCC Approved"]},{venueId:"jupiter",venueName:"Jupiter",compositeScore:81,riskLevel:"medium",complianceStatus:"DEX - Self-Regulatory",lastAuditDate:"2025-09-01",regulatoryLicenses:[]},{venueId:"bybit",venueName:"Bybit",compositeScore:76,riskLevel:"medium",complianceStatus:"Under Review",lastAuditDate:"2025-08-15",regulatoryLicenses:["Dubai VARA"]},{venueId:"raydium",venueName:"Raydium",compositeScore:78,riskLevel:"medium",complianceStatus:"DEX - Decentralized",lastAuditDate:"2025-07-10",regulatoryLicenses:[]},{venueId:"gateio",venueName:"Gate.io",compositeScore:72,riskLevel:"medium",complianceStatus:"Limited Licensing",lastAuditDate:"2025-06-01",regulatoryLicenses:["Cayman Registration"]}];function L0(e){return mT.find(t=>t.venueId===e)}function G3(){const[e]=f.useState(mT),[t,n]=f.useState([{id:"1",entity:"Entity_A",type:"unusual_volume_spike",severity:"medium",timestamp:"2m ago",action:"manual_review"},{id:"2",entity:"Entity_B",type:"geographic_anomaly",severity:"low",timestamp:"15m ago",action:"approved"},{id:"3",entity:"Entity_C",type:"counterparty_downgrade",severity:"high",timestamp:"1h ago",action:"rejected"}]),[r,s]=f.useState({entitiesCleared:847,entitiesTotal:1e3,avgDecisionLatency:3.2,slaCompliance:99.7,falsePositiveRate:2.1,ordersBlocked:.3});f.useEffect(()=>{const a=setInterval(()=>{s(l=>({...l,entitiesCleared:l.entitiesCleared+Math.floor(Math.random()*2),avgDecisionLatency:Math.max(1,l.avgDecisionLatency+(Math.random()-.5)*.2)}))},5e3);return()=>clearInterval(a)},[]);const o=a=>{switch(a){case"low":return"text-emerald-400 border-emerald-500/30";case"medium":return"text-amber-400 border-amber-500/30";case"high":return"text-orange-400 border-orange-500/30";case"critical":return"text-red-400 border-red-500/30";default:return"text-muted-foreground"}};return i.jsxs("div",{className:"terminal-panel p-3 h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b border-amber-500/20",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(mi,{className:"w-4 h-4 text-amber-400"}),i.jsx("span",{className:"text-xs font-bold text-amber-400 font-mono uppercase tracking-wider",children:"KYB & Compliance"})]}),i.jsx(le,{variant:"outline",className:"text-[10px] border-emerald-500/50 text-emerald-400",children:"6-Domain Scoring"})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-3",children:[i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-sm font-bold text-emerald-400 font-mono",children:[(r.entitiesCleared/r.entitiesTotal*100).toFixed(1),"%"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Cleared"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-sm font-bold text-cyan-400 font-mono",children:[r.avgDecisionLatency.toFixed(1),"m"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Avg Latency"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-sm font-bold text-amber-400 font-mono",children:[r.slaCompliance,"%"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"SLA"})]})]}),i.jsxs("div",{className:"mb-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-2 font-mono uppercase",children:"Scoring Weights"}),i.jsx("div",{className:"grid grid-cols-6 gap-1",children:Object.entries(q3).map(([a,l])=>i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-1.5 text-center",children:[i.jsxs("div",{className:"text-[9px] font-bold text-amber-400 font-mono",children:[Number(l)*100,"%"]}),i.jsx("div",{className:"text-[7px] text-muted-foreground capitalize truncate",children:a})]},a))})]}),i.jsxs("div",{className:"mb-3",children:[i.jsxs("div",{className:"text-[10px] text-muted-foreground mb-2 font-mono uppercase flex items-center gap-1",children:[i.jsx(zf,{className:"w-3 h-3"}),"Venue Counterparty Risk"]}),i.jsx("div",{className:"space-y-1.5",children:e.slice(0,4).map(a=>i.jsxs("div",{className:"flex items-center gap-2 p-1.5 bg-[hsl(222,55%,5%)] rounded",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"text-[10px] font-bold text-foreground",children:a.venueName}),i.jsx(le,{variant:"outline",className:D("text-[8px] px-1 py-0 h-4",o(a.riskLevel)),children:a.riskLevel})]}),i.jsx("div",{className:"text-[9px] text-muted-foreground",children:a.complianceStatus})]}),i.jsxs("div",{className:"text-right",children:[i.jsx("div",{className:"text-sm font-bold text-amber-400 font-mono",children:a.compositeScore}),i.jsx(qe,{value:a.compositeScore,className:"h-1 w-12"})]})]},a.venueId))})]}),i.jsxs("div",{className:"flex-1 min-h-0",children:[i.jsxs("div",{className:"text-[10px] text-muted-foreground mb-2 font-mono uppercase flex items-center gap-1",children:[i.jsx(Xa,{className:"w-3 h-3"}),"AML Monitoring"]}),i.jsx("div",{className:"overflow-y-auto scrollbar-thin space-y-1 h-[calc(100%-20px)]",children:t.map(a=>i.jsxs("div",{className:"flex items-center gap-2 p-1.5 bg-[hsl(222,55%,5%)] rounded text-[10px]",children:[a.severity==="critical"||a.severity==="high"?i.jsx(Ww,{className:"w-3 h-3 text-red-400 flex-shrink-0"}):a.severity==="medium"?i.jsx(Xa,{className:"w-3 h-3 text-amber-400 flex-shrink-0"}):i.jsx(Va,{className:"w-3 h-3 text-emerald-400 flex-shrink-0"}),i.jsx("span",{className:"text-foreground font-mono",children:a.entity}),i.jsx("span",{className:"text-muted-foreground truncate flex-1",children:a.type.replace(/_/g," ")}),i.jsx(le,{variant:"outline",className:D("text-[8px] px-1",a.action==="approved"?"text-emerald-400":a.action==="rejected"?"text-red-400":"text-amber-400"),children:a.action}),i.jsx("span",{className:"text-muted-foreground",children:a.timestamp})]},a.id))})]})]})}const D0={kraken:{baseFee:.0016,avgSlippage:5e-4,avgExecutionTime:150,liquidityDepth:5e6,supportedAssets:["TSLAX","AAPLX","NVDAX","MSFTX","AMZNX","GOOGLX","METAX","COINX"]},ondo:{baseFee:.001,avgSlippage:8e-4,avgExecutionTime:200,liquidityDepth:35e5,supportedAssets:["TSLAX","AAPLX","NVDAX","MSFTX","AMZNX","GOOGLX","METAX","SPYX","QQQX"]},jupiter:{baseFee:.0025,avgSlippage:.0015,avgExecutionTime:400,liquidityDepth:15e5,supportedAssets:["TSLAX","AAPLX","NVDAX","COINX","HOODX"]},bybit:{baseFee:.001,avgSlippage:.001,avgExecutionTime:180,liquidityDepth:2e6,supportedAssets:["TSLAX","AAPLX","NVDAX","MSFTX","AMZNX"]},raydium:{baseFee:.003,avgSlippage:.002,avgExecutionTime:350,liquidityDepth:8e5,supportedAssets:["TSLAX","NVDAX","COINX"]}};class pT{constructor(t){G(this,"minKYBScore",50);G(this,"maxVenueConcentration",.6);t!=null&&t.minKYBScore&&(this.minKYBScore=t.minKYBScore),t!=null&&t.maxVenueConcentration&&(this.maxVenueConcentration=t.maxVenueConcentration)}async routeOrder(t,n){if(t.entityKYBScore<this.minKYBScore)return{orderId:t.orderId,approved:!1,rejectReason:`Entity KYB score ${t.entityKYBScore} below minimum threshold ${this.minKYBScore}`,venueAllocations:[],totalEstimatedCost:0,estimatedSlippage:0,executionStrategy:"REJECTED",riskAssessment:{minVenueKYBScore:0,avgVenueKYBScore:0,concentrationRisk:"high",counterpartyExposure:{}}};const r=this.getEligibleVenues(t.symbol);if(r.length===0)return{orderId:t.orderId,approved:!1,rejectReason:`No eligible venues found for ${t.symbol}`,venueAllocations:[],totalEstimatedCost:0,estimatedSlippage:0,executionStrategy:"REJECTED",riskAssessment:{minVenueKYBScore:0,avgVenueKYBScore:0,concentrationRisk:"high",counterpartyExposure:{}}};const s=await this.getVenueQuotes(r,t,n),o=this.calculateOptimalAllocation(s,t),a=this.buildRiskAssessment(o),l=this.determineExecutionStrategy(t,o),c=o.reduce((u,h)=>u+h.estimatedFee,0),d=o.reduce((u,h)=>u+h.allocationPercentage*(h.estimatedPrice-n)/n,0);return{orderId:t.orderId,approved:!0,venueAllocations:o,totalEstimatedCost:c,estimatedSlippage:Math.abs(d)*1e4,executionStrategy:l,riskAssessment:a}}getEligibleVenues(t){const n=[];for(const[r,s]of Object.entries(D0)){const o=L0(r);!o||o.compositeScore<this.minKYBScore||s.supportedAssets.includes(t)&&n.push(r)}return n}async getVenueQuotes(t,n,r){return t.map(s=>{const o=D0[s],a=L0(s),l=(Math.random()-.5)*.002,c=r*(1+l),u=n.quantity*r/o.liquidityDepth,h=o.avgSlippage*(1+u*2);return{venueId:s,venueName:(a==null?void 0:a.venueName)||s,price:c,availableLiquidity:o.liquidityDepth,estimatedSlippage:h,executionTime:o.avgExecutionTime,fee:o.baseFee,kybScore:(a==null?void 0:a.compositeScore)||0}})}calculateOptimalAllocation(t,n){const r=[...t].sort((c,d)=>{const u=c.price*(1+c.estimatedSlippage+c.fee),h=d.price*(1+d.estimatedSlippage+d.fee),p=u/(c.kybScore/100),m=h/(d.kybScore/100);return p-m}),s=[];let o=n.quantity,a=r.reduce((c,d)=>c+d.kybScore,0);for(const c of r){if(o<=0)break;const d=c
541.kybScore/a;let u=Math.min(d*1.5,this.maxVenueConcentration);const h=c.availableLiquidity/c.price,p=Math.min(n.quantity*u,o,h*.5);p>0&&(s.push({venueId:c.venueId,venueName:c.venueName,allocationPercentage:p/n.quantity,quantity:p,estimatedPrice:c.price*(1+c.estimatedSlippage),estimatedFee:p*c.price*c.fee,kybScore:c.kybScore}),o-=p)}const l=s.reduce((c,d)=>c+d.allocationPercentage,0);return s.map(c=>({...c,allocationPercentage:c.allocationPercentage/l}))}buildRiskAssessment(t){const n=t.map(c=>c.kybScore),r=Math.min(...n),s=n.reduce((c,d)=>c+d,0)/n.length,o=Math.max(...t.map(c=>c.allocationPercentage)),a=o>.6?"high":o>.4?"medium":"low",l={};for(const c of t)l[c.venueName]=c.allocationPercentage*100;return{minVenueKYBScore:r,avgVenueKYBScore:Math.round(s),concentrationRisk:a,counterpartyExposure:l}}determineExecutionStrategy(t,n){return t.orderType==="twap"?"TWAP (30-minute intervals)":t.orderType==="vwap"?"VWAP (volume-weighted)":t.orderType==="pov"?"POV (10% participation)":n.reduce((s,o)=>s+o.quantity*o.estimatedPrice,0)>1e5&&t.urgency!=="high"?"TWAP (recommended for large order)":n.length>2?"Multi-venue parallel execution":"Single-venue market execution"}}new pT;function W3(){const[e]=f.useState(()=>new pT),[t,n]=f.useState([]),[r,s]=f.useState({totalOrders:1247,approvalRate:98.5,avgSlippage:.08,avgLatency:12,venueDistribution:{Kraken:42,Ondo:31,Jupiter:18,Bybit:9}});return f.useEffect(()=>{const o=["TSLAX","AAPLX","NVDAX","MSFTX","COINX"],a={TSLAX:352.5,AAPLX:232.8,NVDAX:138.6,MSFTX:438.2,COINX:312.4},l=setInterval(async()=>{const c=o[Math.floor(Math.random()*o.length)],d={orderId:`ORD-${Date.now().toString(36)}`,symbol:c,side:Math.random()>.5?"buy":"sell",quantity:Math.floor(Math.random()*50)+10,orderType:"market",entityKYBScore:75+Math.floor(Math.random()*20),urgency:"medium",maxSlippage:50},u=await e.routeOrder(d,a[c]);n(h=>[{orderId:d.orderId,symbol:d.symbol,side:d.side,quantity:d.quantity,decision:u,timestamp:new Date().toLocaleTimeString()},...h].slice(0,8)),s(h=>({...h,totalOrders:h.totalOrders+1,avgSlippage:(h.avgSlippage+u.estimatedSlippage/100)/2}))},4e3);return()=>clearInterval(l)},[e]),i.jsxs("div",{className:"terminal-panel p-3 h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b border-amber-500/20",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Jw,{className:"w-4 h-4 text-amber-400"}),i.jsx("span",{className:"text-xs font-bold text-amber-400 font-mono uppercase tracking-wider",children:"Smart Order Router"})]}),i.jsx(le,{variant:"outline",className:"text-[10px] border-emerald-500/50 text-emerald-400 animate-pulse",children:"Active"})]}),i.jsxs("div",{className:"grid grid-cols-4 gap-2 mb-3",children:[i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsx("div",{className:"text-xs font-bold text-amber-400 font-mono",children:r.totalOrders}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Orders"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-xs font-bold text-emerald-400 font-mono",children:[r.approvalRate,"%"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Approved"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-xs font-bold text-cyan-400 font-mono",children:[r.avgSlippage.toFixed(2),"bps"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Slippage"})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 text-center",children:[i.jsxs("div",{className:"text-xs font-bold text-foreground font-mono",children:[r.avgLatency,"ms"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground uppercase",children:"Latency"})]})]}),i.jsxs("div",{className:"mb-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-2 font-mono uppercase",children:"Venue Allocation"}),i.jsx("div",{className:"space-y-1",children:Object.entries(r.venueDistribution).map(([o,a])=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-foreground w-16 font-mono",children:o}),i.jsx(qe,{value:a,className:"h-1.5 flex-1"}),i.jsxs("span",{className:"text-[10px] text-amber-400 font-mono w-8 text-right",children:[a,"%"]})]},o))})]}),i.jsxs("div",{className:"flex-1 min-h-0",children:[i.jsxs("div",{className:"text-[10px] text-muted-foreground mb-2 font-mono uppercase flex items-center gap-1",children:[i.jsx(ln,{className:"w-3 h-3"}),"Recent Routing Decisions"]}),i.jsx("div",{className:"overflow-y-auto scrollbar-thin space-y-1 h-[calc(100%-20px)]",children:t.map(o=>i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] border border-border/20 rounded p-2",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[i.jsx(le,{variant:"outline",className:D("text-[8px] px-1 py-0 h-4",o.side==="buy"?"border-emerald-500/30 text-emerald-400":"border-red-500/30 text-red-400"),children:o.side.toUpperCase()}),i.jsx("span",{className:"text-[10px] font-bold text-amber-400",children:o.symbol}),i.jsx("span",{className:"text-[10px] text-foreground font-mono",children:o.quantity}),i.jsx("span",{className:"text-[9px] text-muted-foreground ml-auto",children:o.timestamp})]}),o.decision.approved?i.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[i.jsx(Va,{className:"w-3 h-3 text-emerald-400 flex-shrink-0"}),o.decision.venueAllocations.slice(0,3).map((a,l)=>i.jsxs("span",{className:"text-[9px] text-muted-foreground font-mono",children:[a.venueName,": ",(a.allocationPercentage*100).toFixed(0),"%",l<Math.min(2,o.decision.venueAllocations.length-1)&&" â"]},l)),i.jsxs("span",{className:"text-[9px] text-cyan-400 font-mono ml-auto",children:["~",o.decision.estimatedSlippage.toFixed(1),"bps"]})]}):i.jsx("div",{className:"flex items-center gap-1 text-red-400",children:i.jsxs("span",{className:"text-[9px]",children:["Rejected: ",o.decision.rejectReason]})})]},o.orderId))})]})]})}const z0=[{agentId:"sa-tslax",symbol:"TSLAX",name:"Tesla Alpha",tier:"mega-cap",strategy:"Momentum + Event-Driven",directionalSignal:{direction:"bullish",probability:.68,confidence:.82,expectedReturn:125,timeHorizon:"4h"},executionSignal:{optimalVenues:["kraken","ondo"],venueSplit:{kraken:.55,ondo:.45},estimatedSlippage:.08,recommendedAlgo:"vwap",executionWindow:"15m"},riskSignal:{kybScore:92,counterpartyRisk:"low",liquidityRisk:"low",techRisk:"low",correlatedAssets:["NVDAX","COINX"],meanReversionProbability:.35},modelDiagnostics:{rmse:.012,mae:.008,rSquared:.78,sharpeRatio:1.85,winRate:.62,lastRetrain:"2025-12-17"},lastUpdate:new Date().toISOString()},{agentId:"sa-aaplx",symbol:"AAPLX",name:"Apple Quality",tier:"mega-cap",strategy:"Quality Factor + Mean Reversion",directionalSignal:{direction:"neutral",probability:.52,confidence:.75,expectedReturn:45,timeHorizon:"1d"},executionSignal:{optimalVenues:["kraken","ondo","jupiter"],venueSplit:{kraken:.4,ondo:.35,jupiter:.25},estimatedSlippage:.05,recommendedAlgo:"twap",executionWindow:"30m"},riskSignal:{kybScore:94,counterpartyRisk:"low",liquidityRisk:"low",techRisk:"low",correlatedAssets:["MSFTX","GOOGLX"],meanReversionProbability:.65},modelDiagnostics:{rmse:.008,mae:.005,rSquared:.82,sharpeRatio:2.1,winRate:.58,lastRetrain:"2025-12-17"},lastUpdate:new Date().toISOString()},{agentId:"sa-nvdax",symbol:"NVDAX",name:"NVIDIA AI Surge",tier:"mega-cap",strategy:"Momentum + Sector Rotation",directionalSignal:{direction:"bullish",probability:.72,confidence:.88,expectedReturn:180,timeHorizon:"4h"},executionSignal:{optimalVenues:["kraken","bybit"],venueSplit:{kraken:.6,bybit:.4},estimatedSlippage:.12,recommendedAlgo:"vwap",executionWindow:"20m"},riskSignal:{kybScore:90,counterpartyRisk:"low",liquidityRisk:"low",techRisk:"medium",correlatedAssets:["AMDX","TSLAX"],meanReversionProbability:.28},modelDiagnostics:{rmse:.018,mae:.012,rSquared:.75,sharpeRatio:2.4,winRate:.65,lastRetrain:"2025-12-17"},lastUpdate:new Date().toISOString()},{agentId:"sa-msftx",symbol:"MSFTX",name:"Microsoft Enterprise",tier:"mega-cap",strategy:"Value + Quality",directionalSignal:{direction:"bullish",probability:.61,confidence:.79,expectedReturn:85,timeHorizon:"1d"},executionSignal:{optimalVenues:["ondo","kraken"],venueSplit:{ondo:.5,kraken:.5},estimatedSlippage:.04,recommendedAlgo:"market",executionWindow:"5m"},riskSignal:{kybScore:95,counterpartyRisk:"low",liquidityRisk:"low",techRisk:"low",correlatedAssets:["AAPLX","GOOGLX"],meanReversionProbability:.55},modelDiagnostics:{rmse:.007,mae:.004,rSquared:.85,sharpeRatio:1.95,winRate:.6,lastRetrain:"2025-12-17"},lastUpdate:new Date().toISOString()},{agentId:"sa-amznx",symbol:"AMZNX",name:"Amazon Growth",tier:"mega-cap",strategy:"Growth + Momentum",directionalSignal:{direction:"bullish",probability:.64,confidence:.76,expectedReturn:110,timeHorizon:"4h"},executionSignal:{optimalVenues:["kraken","ondo"],venueSplit:{kraken:.55,ondo:.45},estimatedSlippage:.06,recommendedAlgo:"twap",executionWindow:"25m"},riskSignal:{kybScore:93,counterpartyRisk:"low",liquidityRisk:"low",techRisk:"low",correlatedAssets:["GOOGLX","METAX"],meanReversionProbability:.42},modelDiagnostics:{rmse:.01,mae:.007,rSquared:.8,sharpeRatio:2,winRate:.59,lastRetrain:"2025-12-17"},lastUpdate:new Date().toISOString()},{agentId:"sa-googlx",symbol:"GOOGLX",name:"Google AI Pioneer",tier:"mega-cap",strategy:"Quality + AI Exposure",directionalSignal:{direction:"neutral",probability:.54,confidence:.72,expectedReturn:55,timeHorizon:"1d"},executionSignal:{optimalVenues:["ondo","kraken"],venueSplit:{ondo:.55,kraken:.45},estimatedSlippage:.05,recommendedAlgo:"market",executionWindow:"10m"},riskSignal:{kybScore:94,counterpartyRisk:"low",liquidityRisk:"low",techRisk:"low",correlatedAssets:["MSFTX","METAX"],meanReversionProbability:.58},modelDiagnostics:{rmse:.009,mae:.006,rSquared:.81,sharpeRatio:1.75,winRate:.57,lastRetrain:"2025-12-17"},lastUpdate:new Date().toISOString()},{agentId:"sa-metax",symbol:"METAX",name:"Meta Social",tier:"mega-cap",strategy:"Value Recovery + AI",directionalSignal:{direction:"bullish",probability:.66,confidence:.8,expectedReturn:95,timeHorizon:"4h"},executionSignal:{optimalVenues:["kraken","ondo"],venueSplit:{kraken:.5,ondo:.5},estimatedSlippage:.07,recommendedAlgo:"vwap",executionWindow:"20m"},riskSignal:{kybScore:91,counterpartyRisk:"low",liquidityRisk:"low",techRisk:"medium",correlatedAssets:["GOOGLX","TSLAX"],meanReversionProbability:.48},modelDiagnostics:{rmse:.014,mae:.009,rSquared:.76,sharpeRatio:1.9,winRate:.61,lastRetrain:"2025-12-17"},lastUpdate:new Date().toISOString()},{agentId:"sa-coinx",symbol:"COINX",name:"Coinbase Crypto",tier:"large-cap",strategy:"Crypto Beta + Volatility",directionalSignal:{direction:"bullish",probability:.7,confidence:.85,expectedReturn:220,timeHorizon:"1h"},executionSignal:{optimalVenues:["kraken","jupiter"],venueSplit:{kraken:.65,jupiter:.35},estimatedSlippage:.15,recommendedAlgo:"twap",executionWindow:"15m"},riskSignal:{kybScore:88,counterpartyRisk:"medium",liquidityRisk:"medium",techRisk:"medium",correlatedAssets:["HOODX","TSLAX"],meanReversionProbability:.32},modelDiagnostics:{rmse:.025,mae:.018,rSquared:.68,sharpeRatio:1.65,winRate:.58,lastRetrain:"2025-12-17"},lastUpdate:new Date().toISOString()},{agentId:"sa-hoodx",symbol:"HOODX",name:"Robinhood Retail",tier:"large-cap",strategy:"Sentiment + Retail Flow",directionalSignal:{direction:"bullish",probability:.63,confidence:.74,expectedReturn:150,timeHorizon:"4h"},executionSignal:{optimalVenues:["jupiter","kraken"],venueSplit:{jupiter:.55,kraken:.45},estimatedSlippage:.18,recommendedAlgo:"pov",executionWindow:"30m"},riskSignal:{kybScore:82,counterpartyRisk:"medium",liquidityRisk:"medium",techRisk:"medium",correlatedAssets:["COINX"],meanReversionProbability:.45},modelDiagnostics:{rmse:.022,mae:.015,rSquared:.65,sharpeRatio:1.45,winRate:.55,lastRetrain:"2025-12-17"},lastUpdate:new Date().toISOString()}
541,{agentId:"sa-amdx",symbol:"AMDX",name:"AMD Semiconductor",tier:"large-cap",strategy:"Sector Momentum + Technical",directionalSignal:{direction:"bullish",probability:.67,confidence:.81,expectedReturn:135,timeHorizon:"4h"},executionSignal:{optimalVenues:["kraken","bybit"],venueSplit:{kraken:.6,bybit:.4},estimatedSlippage:.1,recommendedAlgo:"vwap",executionWindow:"20m"},riskSignal:{kybScore:89,counterpartyRisk:"low",liquidityRisk:"low",techRisk:"medium",correlatedAssets:["NVDAX","INTCX"],meanReversionProbability:.38},modelDiagnostics:{rmse:.016,mae:.011,rSquared:.74,sharpeRatio:1.8,winRate:.6,lastRetrain:"2025-12-17"},lastUpdate:new Date().toISOString()}];function K3(e,t){const n=t.change24h;let r="neutral",s=.5;return n>1.5?(r="bullish",s=.6+Math.min(n/10,.25)):n<-1.5&&(r="bearish",s=.6+Math.min(Math.abs(n)/10,.25)),{...e,directionalSignal:{...e.directionalSignal,direction:r,probability:Math.round(s*100)/100,expectedReturn:Math.round(n*50)},lastUpdate:new Date().toISOString()}}function Y3(){const[e,t]=f.useState(z0),[n,r]=f.useState(z0[0]),[s,o]=f.useState("signals");f.useEffect(()=>{const c=setInterval(()=>{t(d=>d.map(u=>{const h=(Math.random()-.5)*4;return K3(u,{price:100+Math.random()*100,change24h:h})}))},5e3);return()=>clearInterval(c)},[]);const a=c=>{switch(c){case"bullish":return i.jsx(Et,{className:"w-3 h-3 text-emerald-400"});case"bearish":return i.jsx(Si,{className:"w-3 h-3 text-red-400"});default:return i.jsx(Op,{className:"w-3 h-3 text-amber-400"})}},l=c=>{switch(c){case"bullish":return"text-emerald-400 border-emerald-500/30";case"bearish":return"text-red-400 border-red-500/30";default:return"text-amber-400 border-amber-500/30"}};return i.jsxs("div",{className:"terminal-panel p-3 h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b border-amber-500/20",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(dd,{className:"w-4 h-4 text-amber-400"}),i.jsx("span",{className:"text-xs font-bold text-amber-400 font-mono uppercase tracking-wider",children:"Specialist Agents"})]}),i.jsxs(le,{variant:"outline",className:"text-[10px] border-cyan-500/50 text-cyan-400",children:[e.length," Active"]})]}),i.jsx("div",{className:"grid grid-cols-2 gap-1.5 mb-3 max-h-[140px] overflow-y-auto scrollbar-thin",children:e.slice(0,8).map(c=>i.jsxs("button",{onClick:()=>r(c),className:D("p-2 rounded text-left transition-colors",(n==null?void 0:n.agentId)===c.agentId?"bg-amber-500/20 border border-amber-500/30":"bg-[hsl(222,55%,5%)] hover:bg-[hsl(222,55%,8%)]"),children:[i.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a(c.directionalSignal.direction),i.jsx("span",{className:"text-[10px] font-bold text-foreground",children:c.symbol}),i.jsxs(le,{variant:"outline",className:D("text-[7px] px-1 h-3 ml-auto",l(c.directionalSignal.direction)),children:[(c.directionalSignal.probability*100).toFixed(0),"%"]})]}),i.jsx("div",{className:"text-[8px] text-muted-foreground truncate",children:c.name})]},c.agentId))}),n&&i.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2 mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"text-xs font-bold text-amber-400",children:n.symbol}),i.jsx("span",{className:"text-[10px] text-foreground",children:n.name}),i.jsx(le,{variant:"outline",className:"text-[8px] ml-auto",children:n.tier})]}),i.jsx("div",{className:"text-[9px] text-muted-foreground",children:n.strategy})]}),i.jsxs(Sl,{value:s,onValueChange:c=>o(c),className:"flex-1 flex flex-col min-h-0",children:[i.jsxs(Oi,{className:"grid grid-cols-3 h-7 mb-2 bg-[hsl(222,55%,5%)]",children:[i.jsxs(sn,{value:"signals",className:"text-[9px] data-[state=active]:bg-amber-500/20",children:[i.jsx(Et,{className:"w-3 h-3 mr-1"}),"α Signal"]}),i.jsxs(sn,{value:"execution",className:"text-[9px] data-[state=active]:bg-amber-500/20",children:[i.jsx(Mp,{className:"w-3 h-3 mr-1"}),"β Exec"]}),i.jsxs(sn,{value:"risk",className:"text-[9px] data-[state=active]:bg-amber-500/20",children:[i.jsx(mi,{className:"w-3 h-3 mr-1"}),"γ Risk"]})]}),i.jsx(ht,{value:"signals",className:"flex-1 mt-0 overflow-y-auto",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-1",children:[a(n.directionalSignal.direction),i.jsx("span",{className:D("text-xs font-bold capitalize",n.directionalSignal.direction==="bullish"?"text-emerald-400":n.directionalSignal.direction==="bearish"?"text-red-400":"text-amber-400"),children:n.directionalSignal.direction})]})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"Confidence"}),i.jsxs("div",{className:"text-xs font-bold text-cyan-400",children:[(n.directionalSignal.confidence*100).toFixed(0),"%"]})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"Expected Return"}),i.jsxs("div",{className:D("text-xs font-bold font-mono",n.directionalSignal.expectedReturn>0?"text-emerald-400":"text-red-400"),children:[n.directionalSignal.expectedReturn>0?"+":"",n.directionalSignal.expectedReturn,"bps"]})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"Time Horizon"}),i.jsx("div",{className:"text-xs font-bold text-foreground",children:n.directionalSignal.timeHorizon})]})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"Model Performance"}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[10px] font-bold text-amber-400",children:n.modelDiagnostics.sharpeRatio}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Sharpe"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-[10px] font-bold text-emerald-400",children:[(n.modelDiagnostics.winRate*100).toFixed(0),"%"]}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"Win Rate"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[10px] font-bold text-cyan-400",children:n.modelDiagnostics.rSquared}),i.jsx("div",{className:"text-[8px] text-muted-foreground",children:"R²"})]})]})]})]})}),i.jsx(ht,{value:"execution",className:"flex-1 mt-0 overflow-y-auto",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"Optimal Venues"}),i.jsx("div",{className:"flex flex-wrap gap-1",children:n.executionSignal.optimalVenues.map((c,d)=>i.jsx(le,{variant:"outline",className:"text-[8px]",children:c},d))})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"Venue Split"}),Object.entries(n.executionSignal.venueSplit).map(([c,d])=>i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"text-[9px] text-foreground w-14 capitalize",children:c}),i.jsx(qe,{value:d*100,className:"h-1 flex-1"}),i.jsxs("span",{className:"text-[9px] text-amber-400 w-8 text-right",children:[(d*100).toFixed(0),"%"]})]},c))]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"Est. Slippage"}),i.jsxs("div",{className:"text-xs font-bold text-cyan-400",children:[n.executionSignal.estimatedSlippage,"%"]})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"Algorithm"}),i.jsx("div",{className:"text-xs font-bold text-foreground uppercase",children:n.executionSignal.recommendedAlgo})]})]})]})}),i.jsx(ht,{value:"risk",className:"flex-1 mt-0 overflow-y-auto",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"KYB Score"}),i.jsx("div",{className:"text-xs font-bold text-emerald-400",children:n.riskSignal.kybScore})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"Counterparty"}),i.jsx(le,{variant:"outline",className:D("text-[8px]",n.riskSignal.counterpartyRisk==="low"?"text-emerald-400":n.riskSignal.counterpartyRisk==="high"?"text-red-400":"text-amber-400"),children:n.riskSignal.counterpartyRisk})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"Liquidity"}),i.jsx(le,{variant:"outline",className:D("text-[8px]",n.riskSignal.liquidityRisk==="low"?"text-emerald-400":n.riskSignal.liquidityRisk==="high"?"text-red-400":"text-amber-400"),children:n.riskSignal.liquidityRisk})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"Tech Risk"}),i.jsx(le,{variant:"outline",className:D("text-[8px]",n.riskSignal.techRisk==="low"?"text-emerald-400":n.riskSignal.techRisk==="high"?"text-red-400":"text-amber-400"),children:n.riskSignal.techRisk})]})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground mb-1",children:"Correlated Assets"}),i.jsx("div",{className:"flex flex-wrap gap-1",children:n.riskSignal.correlatedAssets.map((c,d)=>i.jsx(le,{variant:"outline",className:"text-[8px]",children:c},d))})]}),i.jsxs("div",{className:"bg-[hsl(222,55%,5%)] rounded p-2",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"Mean Reversion Probability"}),i.jsx(qe,{value:n.riskSignal.meanReversionProbability*100,className:"h-1.5 mt-1"}),i.jsxs("div",{className:"text-[10px] text-amber-400 text-right mt-0.5",children:[(n.r
541iskSignal.meanReversionProbability*100).toFixed(0),"%"]})]})]})})]})]})]})}const is=f.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:D("rounded-xl border bg-card text-card-foreground","shadow-sm transition-all duration-200",e),...t}));is.displayName="Card";const Q3=f.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:D("premium-card rounded-xl p-4 gpu-accelerate",e),...t}));Q3.displayName="PremiumCard";const J3=f.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:D("glass-panel rounded-xl p-4",e),...t}));J3.displayName="GlassCard";const as=f.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:D("flex flex-col space-y-1.5 p-4 md:p-6",e),...t}));as.displayName="CardHeader";const ls=f.forwardRef(({className:e,...t},n)=>i.jsx("h3",{ref:n,className:D("text-xl md:text-2xl font-semibold leading-none tracking-tight",e),...t}));ls.displayName="CardTitle";const Z3=f.forwardRef(({className:e,...t},n)=>i.jsx("p",{ref:n,className:D("text-sm text-muted-foreground",e),...t}));Z3.displayName="CardDescription";const cs=f.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:D("p-4 md:p-6 pt-0",e),...t}));cs.displayName="CardContent";const ez=f.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:D("flex items-center p-4 md:p-6 pt-0",e),...t}));ez.displayName="CardFooter";const A=(e,t,n="large")=>{const s={mega:{users:1.5,trading:1.4,revenue:1.6,ai:1.3},large:{users:1,trading:1,revenue:1,ai:1},mid:{users:.7,trading:.8,revenue:.6,ai:.9},small:{users:.5,trading:.6,revenue:.4,ai:.8}}[n],o=e.split("").reduce((l,c)=>
541l+c.charCodeAt(0),0),a=o%20/100;return{ticker:e,subdomain:`/${e}`,name:t,metrics:{users:{total:Math.floor(4500*s.users*(1+a)),dailyActive:Math.floor(2250*s.users*(1+a)),postViral:Math.floor(5175*s.users*(1+a))},trading:{avgTrade:Math.floor(1e3*s.trading*(1+a)),transactionsPerUser:1+o%5/10,dailyGmv:Math.floor(25e5*s.trading*(1+a)),transactionFeePercent:.25},revenue:{aiSubscriptions:Math.floor(15e3*s.revenue*(1+a)),fractionalTokenFees:Math.floor(90*s.revenue*(1+a)),enterpriseApiShare:Math.floor(37500*s.revenue*(1+a)),total:Math.floor(58e3*s.revenue*(1+a))},ai:{signalsGenerated:Math.floor(4500*s.ai*(1+a)),signalsAdopted:Math.floor(3600*s.ai*(1+a)),adoptionRate:.78+o%10/100,predictiveAccuracy:.82+o%8/100,portfolioGrowth:1.8+o%10/10}},engagement:{activeUsers:Math.floor(4800*s.users*(1+a)),socialTrading:Math.floor(1e3*s.users*(1+a)),referrals:Math.floor(420*s.users*(1+a)),viralMultiplier:1.15+o%15/100}}},jd=[A("AAPL","Apple Inc.","mega"),A("MSFT","Microsoft Corporation","mega"),A("GOOGL","Alphabet Inc.","mega"),A("AMZN","Amazon.com Inc.","mega"),A("NVDA","NVIDIA Corporation","mega"),A("META","Meta Platforms Inc.","mega"),A("TSLA","Tesla Inc.","mega"),A("BRK.B","Berkshire Hathaway","mega"),A("TSM","Taiwan Semiconductor","mega"),A("V","Visa Inc.","mega"),A("AMD","Advanced Micro Devices","large"),A("COIN","Coinbase Global Inc.","large"),A("MSTR","MicroStrategy Inc.","large"),A("CRM","Salesforce Inc.","large"),A("ORCL","Oracle Corporation","large"),A("ADBE","Adobe Inc.","large"),A("NFLX","Netflix Inc.","large"),A("INTC","Intel Corporation","large"),A("QCOM","Qualcomm Inc.","large"),A("AVGO","Broadcom Inc.","large"),A("TXN","Texas Instruments","large"),A("MU","Micron Technology","large"),A("AMAT","Applied Materials","large"),A("LRCX","Lam Research","large"),A("KLAC","KLA Corporation","large"),A("MRVL","Marvell Technology","large"),A("NOW","ServiceNow Inc.","large"),A("PANW","Palo Alto Networks","large"),A("CRWD","CrowdStrike Holdings","large"),A("SNOW","Snowflake Inc.","large"),A("PLTR","Palantir Technologies","large"),A("UBER","Uber Technologies","large"),A("ABNB","Airbnb Inc.","large"),A("SHOP","Shopify Inc.","large"),A("SQ","Block Inc.","large"),A("PYPL","PayPal Holdings","large"),A("MA","Mastercard Inc.","large"),A("AXP","American Express","large"),A("GS","Goldman Sachs","large"),A("JPM","JPMorgan Chase","large"),A("MS","Morgan Stanley","large"),A("BAC","Bank of America","large"),A("WFC","Wells Fargo","large"),A("C","Citigroup Inc.","large"),A("HOOD","Robinhood Markets","large"),A("UNH","UnitedHealth Group","mega"),A("JNJ","Johnson & Johnson","mega"),A("LLY","Eli Lilly","mega"),A("PFE","Pfizer Inc.","large"),A("ABBV","AbbVie Inc.","large"),A("MRK","Merck & Co.","large"),A("TMO","Thermo Fisher","large"),A("ABT","Abbott Laboratories","large"),A("DHR","Danaher Corporation","large"),A("BMY","Bristol-Myers Squibb","large"),A("AMGN","Amgen Inc.","large"),A("GILD","Gilead Sciences","large"),A("REGN","Regeneron Pharma","large"),A("VRTX","Vertex Pharma","large"),A("MRNA","Moderna Inc.","mid"),A("ISRG","Intuitive Surgical","large"),A("WMT","Walmart Inc.","mega"),A("COST","Costco Wholesale","mega"),A("HD","Home Depot","mega"),A("LOW","Lowes Companies","large"),A("TGT","Target Corporation","large"),A("NKE","Nike Inc.","large"),A("SBUX","Starbucks Corp.","large"),A("MCD","McDonalds Corp.","mega"),A("KO","Coca-Cola Company","mega"),A("PEP","PepsiCo Inc.","mega"),A("PG","Procter & Gamble","mega"),A("DIS","Walt Disney Co.","mega"),A("CMCSA","Comcast Corp.","large"),A("LULU","Lululemon","mid"),A("ROST","Ross Stores","mid"),A("TJX","TJX Companies","large"),A("DG","Dollar General","mid"),A("CAT","Caterpillar Inc.","large"),A("DE","Deere & Company","large"),A("BA","Boeing Company","large"),A("LMT","Lockheed Martin","large"),A("RTX","RTX Corporation","large"),A("GE","General Electric","large"),A("HON","Honeywell Intl.","large"),A("UPS","United Parcel Service","large"),A("FDX","FedEx Corporation","large"),A("UNP","Union Pacific","large"),A("CSX","CSX Corporation","large"),A("NSC","Norfolk Southern","mid"),A("MMM","3M Company","mid"),A("EMR","Emerson Electric","mid"),A("XOM","Exxon Mobil","mega"),A("CVX","Chevron Corp.","mega"),A("COP","ConocoPhillips","large"),A("SLB","Schlumberger Ltd.","large"),A("EOG","
541EOG Resources","mid"),A("OXY","Occidental Petro.","mid"),A("HAL","Halliburton Co.","mid"),A("NEE","NextEra Energy","large"),A("DUK","Duke Energy","mid"),A("SO","Southern Company","mid"),A("T","AT&T Inc.","large"),A("VZ","Verizon Comm.","large"),A("TMUS","T-Mobile US","large"),A("CHTR","Charter Comm.","mid"),A("WBD","Warner Bros Disc.","mid"),A("PARA","Paramount Global","mid"),A("NWSA","News Corp.","mid"),A("MARA","Marathon Digital","small"),A("RIOT","Riot Platforms","small"),A("CLSK","CleanSpark Inc.","small"),A("HUT","Hut 8 Mining","small"),A("BITF","Bitfarms Ltd.","small"),A("CIFR","Cipher Mining","small"),A("WULF","TeraWulf Inc.","small"),A("AI","C3.ai Inc.","mid"),A("SMCI","Super Micro Computer","mid"),A("PATH","UiPath Inc.","mid"),A("DDOG","Datadog Inc.","mid"),A("ZS","Zscaler Inc.","mid"),A("OKTA","Okta Inc.","mid"),A("TWLO","Twilio Inc.","mid"),A("NET","Cloudflare Inc.","mid"),A("MDB","MongoDB Inc.","mid"),A("ESTC","Elastic NV","small"),A("CFLT","Confluent Inc.","small"),A("S","SentinelOne Inc.","small"),A("GTLB","GitLab Inc.","small"),A("DOCN","DigitalOcean","small"),A("RIVN","Rivian Automotive","mid"),A("LCID","Lucid Group","mid"),A("NIO","NIO Inc.","mid"),A("XPEV","XPeng Inc.","mid"),A("LI","Li Auto Inc.","mid"),A("CHPT","ChargePoint","small"),A("BLNK","Blink Charging","small"),A("ENPH","Enphase Energy","mid"),A("SEDG","SolarEdge Tech.","mid"),A("FSLR","First Solar","mid"),A("RUN","Sunrun Inc.","small"),A("CRSP","CRISPR Therapeutics","mid"),A("BEAM","Beam Therapeutics","small"),A("EDIT","Editas Medicine","small"),A("NTLA","Intellia Therapeutics","small"),A("VCYT","Veracyte Inc.","small"),A("TWST","Twist Bioscience","small"),A("PACB","Pacific Biosciences","small"),A("SPY","SPDR S&P 500 ETF","mega"),A("QQQ","Invesco QQQ Trust","mega"),A("DIA","SPDR Dow Jones ETF","mega"),A("IWM","iShares Russell 2000","large"),A("VTI","Vanguard Total Stock","mega"),A("VOO","Vanguard S&P 500","mega"),A("ARKK","ARK Innovation ETF","mid"),A("XLK","Tech Select Sector","large"),A("XLF","Financial Select","large"),A("XLE","Energy Select","large"),A("XLV","Healthcare Select","large"),A("XLI","Industrial Select","large"),A("TQQQ","ProShares UltraPro QQQ","mid"),A("SQQQ","ProShares UltraPro Short","mid"),A("GLD","SPDR Gold Shares","large"),A("SLV","iShares Silver Trust","mid"),A("USO","United States Oil Fund","mid"),A("TLT","iShares 20+ Yr Treasury","large"),A("HYG","iShares High Yield Corp","large"),A("EEM","iShares Emerging Markets","large"),A("VWO","Vanguard FTSE Emerging","large"),A("EFA","iShares MSCI EAFE","large"),A("BTC","Bitcoin","mega"),A("ETH","Ethereum","mega"),A("SOL","Solana","large"),A("XRP","XRP","large"),A("ADA","Cardano","mid"),A("AVAX","Avalanche","mid"),A("DOT","Polkadot","mid"),A("LINK","Chainlink","mid"),A("MATIC","Polygon","mid"),A("UNI","Uniswap","mid"),A("ATOM","Cosmos","mid"),A("LTC","Litecoin","mid"),A("BCH","Bitcoin Cash","mid"),A("DOGE","Dogecoin","mid"),A("SHIB","Shiba Inu","mid"),A("NEAR","NEAR Protocol","mid"),A("APT","Aptos","mid"),A("ARB","Arbitrum","mid"),A("OP","Optimism","mid"),A("SUI","Sui","mid"),A("SEI","Sei","small"),A("INJ","Injective","small"),A("TIA","Celestia","small"),A("ONDO","Ondo Finance","small"),A("AAVE","Aave","mid"),A("MKR","Maker","mid"),A("CRV","Curve DAO","small"),A("SNX","Synthetix","small"),A("RENDER","Render Token","small"),A("FET","Fetch.ai","small"),A("RNDR","Render","small"),A("GRT","The Graph","small"),A("FIL","Filecoin","mid"),A("AR","Arweave","small"),A("STX","Stacks","small"),A("IMX","Immutable X","small"),A("SAND","The Sandbox","small"),A("MANA","Decentraland","small"),A("AXS","Axie Infinity","small"),A("GALA","Gala Games","small"),A("ENS","Ethereum Name Service","small"),A("LDO","Lido DAO","mid"),A("RPL","Rocket Pool","small"),A("BLUR","Blur","small"),A("PENDLE","Pendle","small"),A("JUP","Jupiter","small"),A("JTO","Jito","small"),A("PYTH","Pyth Network","small"),A("W","Wormhole","small"),A("ENA","Ethena","small"),A("EIGEN","Eigenlayer","small"),A("EURUSD","Euro/US Dollar","mega"),A("GBPUSD","British Pound/USD","mega"),A("USDJPY","US Dollar/Yen","mega"),A("USDCHF","US Dollar/Swiss Franc","large"),A("AUDUSD","Australian Dollar/USD","large"),A("USDCAD","US Dollar/Canadian Dollar","large"),A("NZDUSD","New Zealand Dollar/USD","mid"),A("EURGBP","Euro/British Poun
541d","mid"),A("EURJPY","Euro/Japanese Yen","mid"),A("GBPJPY","British Pound/Yen","mid")],Dh={sources:{marketData:["price","volume","order_book","historical_trades"],fundamentals:["financial_statements","ratios","sector_data"],news:["press_releases","analyst_reports"],sentiment:["social_media","news_sentiment"],alternative:["ESG_scores","patents","satellite_data","insider_trades"]},frequency:{realTime:"market_data",hourly:"sentiment",daily:"fundamentals & alternative"},retentionPolicy:"10_years",schema:"hyper-normalized timestamped multi-source"},zh={containerized:!0,isolated:!0,cpuGpuAllocation:"dynamic",components:["Python / Jupyter","Multi-Agent AI Engines","Backtesting & simulation","Predictive signal computation","Portfolio impact analysis"],security:{sandboxed:!0,logging:"full audit trail"}},tz=[{name:"QuantEngine",status:"active",signals:1250,accuracy:.87},{name:"SignalAggregator",status:"active",signals:980,accuracy:.84},{name:"FractionalAllocationEngine",status:"active",signals:720,accuracy:.82},{name:"PredictiveRiskEngine",status:"active",signals:540,accuracy:.89}],nz=["Overview","Signals & AI Analytics","Interactive Data Room","Fractional Token Layer","User Engagement & Viral Loop","Lovable Dashboard Metrics"],rz=()=>jd.reduce((e,t)=>({totalUsers:e.totalUsers+t.metrics.users.total,totalDailyActive:e.totalDailyActive+t.metrics.users.dailyActive,totalGmv:e.totalGmv+t.metrics.trading.dailyGmv,totalRevenue:e.totalRevenue+t.metrics.revenue.total,totalSignals:e.totalSignals+t.metrics.ai.signalsGenerated,avgAccuracy:(e.avgAccuracy*e.count+t.metrics.ai.predictiveAccuracy)/(e.count+1),count:e.count+1}),{totalUsers:0,totalDailyActive:0,totalGmv:0,totalRevenue:0,totalSignals:0,avgAccuracy:0,count:0});function sz({ticker:e}){const[t,n]=f.useState({marketData:{count:0,latency:0,status:"streaming"},fundamentals:{count:0,latency:0,status:"synced"},news:{count:0,latency:0,status:"synced"},sentiment:{count:0,latency:0,status:"processing"},alternative:{count:0,latency:0,status:"synced"}});f.useEffect(()=>{const s=setInterval(()=>{n(o=>({marketData:{count:o.marketData.count+Math.floor(Math.random()*50),latency:12+Math.random()*8,status:"streaming"},fundamentals:{count:156,latency:0,status:"synced"},news:{count:o.news.count+Math.floor(Math.random()*3),latency:45+Math.random()*15,status:"synced"},sentiment:{count:o.sentiment.count+Math.floor(Math.random()*10),latency:230+Math.random()*50,status:"processing"},alternative:{count:89,latency:0,status:"synced"}}))},2e3);return()=>clearInterval(s)},[]);const r=Dh.sources;return i.jsxs(is,{className:"bg-card/80 border-border/50",children:[i.jsx(as,{className:"pb-2 pt-3 px-4",children:i.jsxs(ls,{className:"text-xs font-medium flex items-center justify-between",children:[i.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx(Wv,{className:"w-3.5 h-3.5 text-bloomberg-blue"}),"DATA INGESTION PIPELINE â ",e,"_DB"]}),i.jsxs(le,{variant:"outline",className:"text-[9px] border-profit/50 text-profit",children:[i.jsx(ln,{className:"w-2.5 h-2.5 mr-1 animate-pulse"}),"LIVE"]})]})}),i.jsxs(cs,{className:"px-4 pb-4 space-y-3",children:[i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ge,{className:"w-3 h-3 text-profit"}),i.jsx("span",{className:"text-xs text-foreground",children:"Market Data"}),i.jsx(le,{className:"text-[8px] bg-profit/20 text-profit",children:"REAL-TIME"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[t.marketData.latency.toFixed(0),"ms"]}),i.jsxs("span",{className:"font-mono text-xs text-profit",children:[t.marketData.count.toLocaleString()," events"]})]})]}),i.jsx(qe,{value:100,className:"h-1 bg-profit/20"}),i.jsx("div",{className:"flex gap-1 flex-wrap",children:r.marketData.map(s=>i.jsx(le,{variant:"outline",className:"text-[8px] py-0",children:s},s))})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(_C,{className:"w-3 h-3 text-bloomberg-blue"}),i.jsx("span",{className:"text-xs text-foreground",children:"Fundamentals"}),i.jsx(le,{variant:"outline",className:"text-[8px]",children:"DAILY"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Va,{className:"w-3 h-3 text-profit"}),i.jsxs("span",{className:"font-mono text-xs text-foreground",children:[t.fundamentals.count," records"]})]})]}),i.jsx(qe,{value:100,className:"h-1"}),i.jsx("div",{className:"flex gap-1 flex-wrap",children:r.fundamentals.map(s=>i.jsx(le,{variant:"outline",className:"text-[8px] py-0",children:s},s))})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ge,{className:"w-3 h-3 text-bloomberg-amber"}),i.jsx("span",{className:"text-xs text-foreground",children:"News & Press"}),i.jsx(le,{className:"text-[8px] bg-bloomberg-amber/20 text-bloomberg-amber",children:"STREAMING"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[t.news.latency.toFixed(0),"ms"]}),i.jsxs("span",{className:"font-mono text-xs text-foreground",children:[t.news.count," articles"]})]})]}),i.jsx(qe,{value:85,className:"h-1"}),i.jsx("div",{className:"flex gap-1 flex-wrap",children:r.news.map(s=>i.jsx(le,{variant:"outline",className:"text-[8px] py-0",children:s},s))})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(yC,{className:"w-3 h-3 text-bloomberg-blue"}),i.jsx("span",{className:"text-xs text-foreground",children:"Sentiment"}),i.jsx(le,{variant:"outline",className:"text-[8px]",children:"HOURLY"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[t.sentiment.latency.toFixed(0),"ms"]}),i.jsxs("span",{className:"font-mono text-xs text-foreground",children:[t.sentiment.count," signals"]})]})]}),i.jsx(qe,{value:72,className:"h-1"}),i.jsx("div",{className:"flex gap-1 flex-wrap",children:r.sentiment.map(s=>i.jsx(le,{variant:"outline",className:"text-[8px] py-0",children:s},s))})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Wv,{className:"w-3 h-3 text-muted-foreground"}),i.jsx("span",{className:"text-xs text-foreground",children:"Alternative Data"}),i.jsx(le,{variant:"outline",className:"text-[8px]",children:"DAILY"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Va,{className:"w-3 h-3 text-profit"}),i.jsxs("span",{className:"font-mono text-xs text-foreground",children:[t.alternative.count," sources"]})]})]}),i.jsx(qe,{value:100,className:"h-1"}),i.jsx("div",{className:"flex gap-1 flex-wrap",children:r.alternative.map(s=>i.jsx(le,{variant:"outline",className:"text-[8px] py-0",children:s},s))})]}),i.jsxs("div",{className:"pt-2 border-t border-border/50 flex items-center justify-between text-[10px] text-muted-foreground",children:[i.jsxs("span",{children:["Schema: ",Dh.schema]}),i.jsxs("span",{children:["Retention: ",Dh.retentionPolicy]})]})]})]})}function oz({ticker:e}){const[t,n]=f.useState(tz.map(a=>({...a,load:45+Math.random()*40}))),[r,s]=f.useState({signal:"BUY",confidence:78,riskAdjustedReturn:2.4,portfolioImpact:.8});f.useEffect(()=>{const a=setInterval(()=>{n(l=>l.map(c=>({...c,signals:c.signals+Math.floor(Math.random()*5),load:Math.max(30,Math.min(95,c.load+(Math.random()-.5)*10))}))),s(l=>({signal:Math.random()>.7?Math.random()>.5?"BUY":"SELL":l.signal,confidence:Math.max(60,Math.min(95,l.confidence+(Math.random()-.5)*5)),riskAdjustedReturn:Math.max(1,Math.min(5,l.riskAdjustedReturn+(Math.random()-.5)*.3)),portfolioImpact:Math.max(.3,Math.min(1.5,l.portfolioImpact+(Math.random()-.5)*.1))}))},3e3);return()=>clearInterval(a)},[]);const o=a=>{switch(a){case"QuantEngine":return i.jsx(dd,{className:"w-3 h-3"});case"SignalAggregator":return i.jsx(Ge,{className:"w-3 h-3"});case"FractionalAllocationEngine":return i.jsx(Mp,{className:"w-3 h-3"});case"PredictiveRiskEngine":return i.jsx(mi,{className:"w-3 h-3"});default:return i.jsx(Gv,{className:"w-3 h-3"})}};return i.jsxs("div",{className:"space-y-3",children:[i.jsxs(is,{className:"bg-card/80 border-border/50",children:[i.jsx(as,{className:"pb-2 pt-3 px-4",children:i.jsxs(ls,{className:"text-xs font-medium flex items-center justify-between",children:[i.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx(Gv,{className:"w-3.5 h-3.5 text-bloomberg-blue"}),"COMPUTE ENVIRONMENT â ",e]}),i.jsx(le,{className:"text-[9px] bg-profit/20 text-profit border-profit/30",children:"ISOLATED"})]})}),i.jsxs(cs,{className:"px-4 pb-3",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-3 text-[10px]",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:"Container"}),i.jsx("span",{className:"text-foreground",children:"Yes"})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:"CPU/GPU"}),i.jsx("span",{className:"text-foreground",children:zh.cpuGpuAllocation})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:"Sandboxed"}),i.jsx("span",{className:"text-profit",children:"Yes"})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:"Logging"}),i.jsx("span",{className:"text-foreground",children:zh.security.logging})]})]}),i.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:zh.components.map(a=>i.jsx(le,{variant:"outline",className:"text-[8px] py-0",children:a},a))})]})]}),i.jsxs(is,{className:"bg-card/80 border-border/50",children:[i.jsx(as,{className:"pb-2 pt-3 px-4",children:i.jsxs(ls,{className:"text-xs font-medium flex items-center justify-between",children:[i.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx(dd,{className:"w-3.5 h-3.5 text-bloomberg-amber"}),"AI ENGINES STATUS"]}),i.jsxs(le,{variant:"outline",className:"text-[9px]",children:[i.jsx(ln,{className:"w-2.5 h-2.5 mr-1 animate-pulse text-profit"}),"ALL ACTIVE"]})]})}),i.jsx(cs,{className:"px-4 pb-3 space-y-3",children:t.map(a=>i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[o(a.name),i.jsx("span",{className:"text-xs text-foreground",children:a.name})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[(a.accuracy*100).toFixed(0),"% acc"]}),i.jsxs("span",{className:"font-mono text-xs text-profit",children:[a.signals," sig"]})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(qe,{value:a.load,className:"h-1 flex-1"}),i.jsxs("span",{className:"text-[9px] text-muted-foreground w-8",children:[a.load.toFixed(0),"%"]})]})]},a.name))})]}),i.jsxs(is,{className:"bg-card/80 border-border/50",children:[i.jsx(as,{className:"pb-2 pt-3 px-4",children:i.jsxs(ls,{className:"text-xs font-medium flex items-center gap-2 text-muted-foreground",children:[i.jsx(Et,{className:"w-3.5 h-3.5 text-profit"}
vendor: 13,060 bytes, line 541
541),"SIGNAL OUTPUTS â ",e]})}),i.jsx(cs,{className:"px-4 pb-3",children:i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"bg-background/50 rounded p-2 text-center",children:[i.jsx("div",{className:`text-lg font-mono font-bold ${r.signal==="BUY"?"text-profit":r.signal==="SELL"?"text-loss":"text-bloomberg-amber"}`,children:r.signal}),i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"Signal"})]}),i.jsxs("div",{className:"bg-background/50 rounded p-2 text-center",children:[i.jsxs("div",{className:"text-lg font-mono font-bold text-bloomberg-blue",children:[r.confidence.toFixed(0),"%"]}),i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"Confidence"})]}),i.jsxs("div",{className:"bg-background/50 rounded p-2 text-center",children:[i.jsxs("div",{className:"text-lg font-mono font-bold text-profit",children:["+",r.riskAdjustedReturn.toFixed(1),"%"]}),i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"Risk-Adj Return"})]}),i.jsxs("div",{className:"bg-background/50 rounded p-2 text-center",children:[i.jsxs("div",{className:"text-lg font-mono font-bold text-bloomberg-amber",children:[r.portfolioImpact.toFixed(2),"%"]}),i.jsx("div",{className:"text-[9px] text-muted-foreground",children:"Portfolio Impact"})]})]})})]})]})}function iz(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var cg="ScrollArea",[gT,dB]=qt(cg),[az,dn]=gT(cg),vT=f.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...a}=e,[l,c]=f.useState(null),[d,u]=f.useState(null),[h,p]=f.useState(null),[m,x]=f.useState(null),[g,w]=f.useState(null),[v,y]=f.useState(0),[b,k]=f.useState(0),[S,T]=f.useState(!1),[E,j]=f.useState(!1),N=me(t,F=>c(F)),R=wl(s);return i.jsx(az,{scope:n,type:r,dir:R,scrollHideDelay:o,scrollArea:l,viewport:d,onViewportChange:u,content:h,onContentChange:p,scrollbarX:m,onScrollbarXChange:x,scrollbarXEnabled:S,onScrollbarXEnabledChange:T,scrollbarY:g,onScrollbarYChange:w,scrollbarYEnabled:E,onScrollbarYEnabledChange:j,onCornerWidthChange:y,onCornerHeightChange:k,children:i.jsx(ie.div,{dir:R,...a,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});vT.displayName=cg;var yT="ScrollAreaViewport",xT=f.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,a=dn(yT,n),l=f.useRef(null),c=me(t,l,a.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),i.jsx(ie.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});xT.displayName=yT;var Qn="ScrollAreaScrollbar",dg=f.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=dn(Qn,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,l=e.orientation==="horizontal";return f.useEffect(()=>(l?o(!0):a(!0),()=>{l?o(!1):a(!1)}),[l,o,a]),s.type==="hover"?i.jsx(lz,{...r,ref:t,forceMount:n}):s.type==="scroll"?i.jsx(cz,{...r,ref:t,forceMount:n}):s.type==="auto"?i.jsx(bT,{...r,ref:t,forceMount:n}):s.type==="always"?i.jsx(ug,{...r,ref:t}):null});dg.displayName=Qn;var lz=f.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=dn(Qn,e.__scopeScrollArea),[o,a]=f.useState(!1);return f.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),a(!0)},u=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",u)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx(cn,{present:n||o,children:i.jsx(bT,{"data-state":o?"visible":"hidden",...r,ref:t})})}),cz=f.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=dn(Qn,e.__scopeScrollArea),o=e.orientation==="horizontal",a=_u(()=>c("SCROLL_END"),100),[l,c]=iz("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 f.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,s.scrollHideDelay,c]),f.useEffect(()=>{const d=s.viewport,u=o?"scrollLeft":"scrollTop";if(d){let h=d[u];const p=()=>{const m=d[u];h!==m&&(c("SCROLL"),a()),h=m};return d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[s.viewport,o,c,a]),i.jsx(cn,{present:n||l!=="hidden",children:i.jsx(ug,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Z(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Z(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),bT=f.forwardRef((e,t)=>{const n=dn(Qn,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,a]=f.useState(!1),l=e.orientation==="horizontal",c=_u(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?d:u)}},10);return yi(n.viewport,c),yi(n.content,c),i.jsx(cn,{present:r||o,children:i.jsx(ug,{"data-state":o?"visible":"hidden",...s,ref:t})})}),ug=f.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=dn(Qn,e.__scopeScrollArea),o=f.useRef(null),a=f.useRef(0),[l,c]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=AT(l.viewport,l.content),u={...r,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:p=>a.current=p};function h(p,m){return pz(p,a.current,l,m)}return n==="horizontal"?i.jsx(dz,{...u,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollLeft,m=$0(p,l,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollLeft=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollLeft=h(p,s.dir))}}):n==="vertical"?i.jsx(uz,{...u,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollTop,m=$0(p,l);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollTop=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollTop=h(p))}}):null}),dz=f.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=dn(Qn,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),d=me(t,c,o.onScrollbarXChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(kT,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Cu(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,h)=>{if(o.viewport){const p=o.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),NT(p,h)&&u.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Rd(a.paddingLeft),paddingEnd:Rd(a.paddingRight)}})}})}),uz=f.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=dn(Qn,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),d=me(t,c,o.onScrollbarYChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(kT,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Cu(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,h)=>{if(o.viewport){const p=o.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),NT(p,h)&&u.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Rd(a.paddingTop),paddingEnd:Rd(a.paddingBottom)}})}})}),[hz,wT]=gT(Qn),kT=f.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:u,onResize:h,...p}=e,m=dn(Qn,n),[x,g]=f.useState(null),w=me(t,N=>g(N)),v=f.useRef(null),y=f.useRef(""),b=m.viewport,k=r.content-r.viewport,S=et(u),T=et(c),E=_u(h,10);function j(N){if(v.current){const R=N.clientX-v.current.left,F=N.clientY-v.current.top;d({x:R,y:F})}}return f.useEffect(()=>{const N=R=>{const F=R.target;(x==null?void 0:x.contains(F))&&S(R,k)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[b,x,k,S]),f.useEffect(T,[r,T]),yi(x,E),yi(m.content,E),i.jsx(hz,{scope:n,scrollbar:x,hasThumb:s,onThumbChange:et(o),onThumbPointerUp:et(a),onThumbPositionChange:T,onThumbPointerDown:et(l),children:i.jsx(ie.div,{...p,ref:w,style:{position:"absolute",...p.style},onPointerDown:Z(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),v.current=x.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),j(N))}),onPointerMove:Z(e.onPointerMove,j),onPointerUp:Z(e.onPointerUp,N=>{const R=N.target;R.hasPointerCapture(N.pointerId)&&R.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=""),v.current=null})})})}),Pd="ScrollAreaThumb",ST=f.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=wT(Pd,e.__scopeScrollArea);return i.jsx(cn,{present:n||s.hasThumb,children:i.jsx(fz,{ref:t,...r})})}),fz=f.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=dn(Pd,n),a=wT(Pd,n),{onThumbPositionChange:l}=a,c=me(t,h=>a.onThumbChange(h)),d=f.useRef(void 0),u=_u(()=>{d.current&&(d.current(),d.current=void 0)},100);return f.useEffect(()=>{const h=o.viewport;if(h){const p=()=>{if(u(),!d.current){const m=gz(h,l);d.current=m,l()}};return l(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[o.viewport,u,l]),i.jsx(ie.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Z(e.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),x=h.clientX-m.left,g=h.clientY-m.top;a.onThumbPointerDown({x,y:g})}),onPointerUp:Z(e.onPointerUp,a.onThumbPointerUp)})});ST.displayName=Pd;var hg="ScrollAreaCorner",TT=f.forwardRef((e,t)=>{const n=dn(hg,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(mz,{...e,ref:t}):null});TT.displayName=hg;var mz=f.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=dn(hg,n),[o,a]=f.useState(0),[l,c]=f.useState(0),d=!!(o&&l);return yi(s.scrollbarX,()=>{var h;const u=((h=s.scrollbarX)==null?void 0:h.offsetHeight)||0;s.onCornerHeightChange(u),c(u)}),yi(s.scrollbarY,()=>{var h;const u=((h=s.scrollbarY)==null?void 0:h.offsetWidth)||0;s.onCornerWidthChange(u),a(u)}),d?i.jsx(ie.div,{...r,ref:t,style:{width:o,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Rd(e){return e?parseInt(e,10):0}function AT(e,t){const n=e/t;return isNaN(n)?0:n}function Cu(e){const t=AT(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function pz(e,t,n,r="ltr"){const s=Cu(n),o=s/2,a=t||o,l=s-a,c=n.scrollbar.paddingStart+a,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,u=n.content-n.viewport,h=r==="ltr"?[0,u]:[u*-1,0];return ET([c,d],h)(e)}function $0(e,t,n="ltr"){const r=Cu(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,a=t.content-t.viewport,l=o-r,c=n==="ltr"?[0,a]:[a*-1,0],d=il(e,c);return ET([0,a],[0,l])(d)}function ET(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 NT(e,t){return e>0&&e<t}var gz=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,l=n.top!==o.top;(a||l)&&t(),n=o,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function _u(e,t){const n=et(e),r=f.useRef(0);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),f.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function yi(e,t){const n=et(t);lt(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var CT=vT,vz=xT,yz=TT;
541const fg=f.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(CT,{ref:r,className:D("relative overflow-hidden",e),...n,children:[i.jsx(vz,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(_T,{}),i.jsx(yz,{})]}));fg.displayName=CT.displayName;const _T=f.forwardRef(({className:e,orientation:t="vertical",...n},r)=>i.jsx(dg,{ref:r,orientation:t,className:D("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:i.jsx(ST,{className:"relative flex-1 rounded-full bg-border"})}));_T.displayName=dg.displayName;const $h={name:"TokenStocks.ai",type:"PoP",launchRegions:["Singapore","Dubai","EU Sandbox","Hong Kong","Japan"],currencyBase:"USD",regulatoryModel:"Regulatory-light (partner custody)",trading:{avgTradeValue:1e3,transactionsPerUserPerDay:1,transactionFeePercent:.25,avgExecutionTimeSec:2,routingSuccessRate:.995},fractionalTokens:{enabled:!0,mintFeePerToken:2,partnerCustody:!0,stakingYieldPercent:.05,lendingEnabled:!0,lendingRatePercent:.02,composability:{fractionalETFs:!0,derivatives:!0}},viralGrowth:{referralConversionRate:.15,copyTradingAdoptionRate:.25,viralLoopMultiplier:1.2,referralTiers:[{tier:1,reward:"1% token bonus",minReferrals:0},{tier:2,reward:"2% token bonus",minReferrals:5},{tier:3,reward:"3% + VIP access",minReferrals:20}]},aiIntelligence:{adoptionRate:.8,predictiveAccuracyPercent:.85,portfolioGrowthPercent:.02,dailyFeedbackLoop:!0,engines:[{name:"Multi-Agent Quant Engine",function:"evaluates global tokenized equities, predicts returns"},{name:"Signal Aggregator",function:"combines news, social sentiment, market data"},{name:"Fractional Allocation Engine",function:"maps AI signals to fractional trades per user"},{name:"Predictive Risk Engine",function:"flags regulatory friction and suggests compliant routing"}]},revenueProjections:{year1:{users:1e5,gmv:5e7,revenue:25e6,aiAdoption:.8,viralMultiplier:1.2},year2:{users:1e6,gmv:5e8,revenue:25e7,aiAdoption:.85,viralMultiplier:1.5},year3:{users:5e6,gmv:5e9,revenue:1e9,aiAdoption:.9,viralMultiplier:2}}};function xz(){const[e,t]=f.useState("Overview"),[n,r]=f.useState(rz());return f.useEffect(()=>{const s=setInterval(()=>{r(o=>({...o,totalUsers:o.totalUsers+Math.floor(Math.random()*5),totalGmv:o.totalGmv+Math.floor(Math.random()*1e4),totalRevenue:o.totalRevenue+Math.floor(Math.random()*50),totalSignals:o.totalSignals+Math.floor(Math.random()*10)}))},3e3);return()=>clearInterval(s)},[]),i.jsxs(is,{className:"bg-card/80 border-border/50",children:[i.jsx(as,{className:"pb-2 pt-3 px-4",children:i.jsxs(ls,{className:"text-xs font-medium flex items-center justify-between",children:[i.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx(SC,{className:"w-3.5 h-3.5 text-bloomberg-amber"}),"LOVABLE DASHBOARD â PLATFORM METRICS"]}),i.jsxs(le,{className:"text-[9px] bg-profit/20 text-profit border-profit/30",children:[i.jsx(ln,{className:"w-2.5 h-2.5 mr-1 animate-pulse"}),"LIVE"]})]})}),i.jsx(cs,{className:"px-4 pb-4",children:i.jsxs(Sl,{value:e,onValueChange:t,children:[i.jsx(fg,{className:"w-full",children:i.jsx(Oi,{className:"inline-flex w-auto bg-background/50 mb-3",children:nz.map(s=>i.jsx(sn,{value:s,className:"text-[10px]",children:s},s))})}),i.jsxs(ht,{value:"Overview",className:"mt-0 space-y-3",children:[i.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[i.jsxs("div",{className:"bg-background/50 rounded p-3 text-center",children:[i.jsx(qs,{className:"w-4 h-4 mx-auto mb-1 text-bloomberg-blue"}),i.jsx("div",{className:"font-mono text-xl text-foreground",children:n.totalUsers.toLocaleString()}),i.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Total Users"})]}),i.jsxs("div",{className:"bg-background/50 rounded p-3 text-center",children:[i.jsx(Ha,{className:"w-4 h-4 mx-auto mb-1 text-profit"}),i.jsxs("div",{className:"font-mono text-xl text-profit",children:["$",(n.totalGmv/1e6).toFixed(2),"M"]}),i.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Daily GMV"})]}),i.jsxs("div",{className:"bg-background/50 rounded p-3 text-center",children:[i.jsx(Et,{className:"w-4 h-4 mx-auto mb-1 text-bloomberg-amber"}),i.jsxs("div",{className:"font-mono text-xl text-bloomberg-amber",children:["$",n.totalRevenue.toLocaleStr
541ing()]}),i.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Daily Revenue"})]}),i.jsxs("div",{className:"bg-background/50 rounded p-3 text-center",children:[i.jsx(dd,{className:"w-4 h-4 mx-auto mb-1 text-bloomberg-blue"}),i.jsx("div",{className:"font-mono text-xl text-foreground",children:n.totalSignals.toLocaleString()}),i.jsx("div",{className:"text-[10px] text-muted-foreground",children:"AI Signals"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground",children:"STOCK PERFORMANCE"}),jd.slice(0,3).map(s=>i.jsxs("div",{className:"bg-background/50 rounded p-2 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(le,{variant:"outline",className:"text-[10px] font-mono",children:s.ticker}),i.jsx("span",{className:"text-xs text-muted-foreground",children:s.name})]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("span",{className:"font-mono text-xs text-foreground",children:["$",(s.metrics.trading.dailyGmv/1e6).toFixed(2),"M"]}),i.jsxs("span",{className:"font-mono text-xs text-profit",children:["+",s.metrics.ai.portfolioGrowth,"%"]})]})]},s.ticker))]})]}),i.jsxs(ht,{value:"Signals & AI Analytics",className:"mt-0 space-y-3",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"bg-background/50 rounded p-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-2",children:"AI ADOPTION RATE"}),i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsxs("span",{className:"font-mono text-2xl text-profit",children:[(n.avgAccuracy*100).toFixed(0),"%"]}),i.jsx(Ua,{className:"w-4 h-4 text-profit"})]}),i.jsx(qe,{value:n.avgAccuracy*100,className:"h-1.5"})]}),i.jsxs("div",{className:"bg-background/50 rounded p-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-2",children:"PREDICTIVE ACCURACY"}),i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("span",{className:"font-mono text-2xl text-bloomberg-amber",children:"85%"}),i.jsx(Mp,{className:"w-4 h-4 text-bloomberg-amber"})]}),i.jsx(qe,{value:85,className:"h-1.5"})]})]}),i.jsxs("div",{className:"bg-background/50 rounded p-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-2",children:"AI ENGINE PERFORMANCE"}),$h.aiIntelligence.engines.map(s=>i.jsxs("div",{className:"flex items-center justify-between py-1 border-b border-border/30 last:border-0",children:[i.jsx("span",{className:"text-xs text-foreground",children:s.name}),i.jsx(le,{variant:"outline",className:"text-[8px]",children:"Active"})]},s.name))]})]}),i.jsxs(ht,{value:"Fractional Token Layer",className:"mt-0 space-y-3",children:[i.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[i.jsxs("div",{className:"bg-background/50 rounded p-3 text-center",children:[i.jsx(Kw,{className:"w-4 h-4 mx-auto mb-1 text-bloomberg-amber"}),i.jsx("div",{className:"font-mono text-xl text-foreground",children:"150"}),i.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Daily Minted"})]}),i.jsxs("div",{className:"bg-background/50 rounded p-3 text-center",children:[i.jsx(Ge,{className:"w-4 h-4 mx-auto mb-1 text-profit"}),i.jsx("div",{className:"font-mono text-xl text-profit",children:"5%"}),i.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Staking Yield"})]}),i.jsxs("div",{className:"bg-background/50 rounded p-3 text-center",children:[i.jsx(mC,{className:"w-4 h-4 mx-auto mb-1 text-bloomberg-blue"}),i.jsx("div",{className:"font-mono text-xl text-foreground",children:"2%"}),i.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Lending Rate"})]})]}),i.jsxs("div",{className:"bg-background/50 rounded p-2",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-2",children:"COMPOSABILITY"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(le,{className:"text-[9px] bg-profit/20 text-profit",children:"Fractional ETFs"}),i.jsx(le,{className:"text-[9px] bg-bloomberg-blue/20 text-bloomberg-blue",children:"Derivatives"}),i.jsx(le,{variant:"outline",className:"text-[9px]",children:"Partner Custody"})]})]})]}),i.jsxs(ht,{value:"User Engagement & Viral Loop",className:"mt-0 space-y-3",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"bg-background/50 rounded p-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-1",children:"VIRAL MULTIPLIER"}),i.jsx("div",{className:"font-mono text-2xl text-profit",children:"1.2x"}),i.jsx(qe,{value:60,className:"h-1 mt-2"})]}),i.jsxs("div",{className:"bg-background/50 rounded p-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-1",children:"REFERRAL RATE"}),i.jsx("div",{className:"font-mono text-2xl text-bloomberg-amber",children:"15%"}),i.jsx(qe,{value:75,className:"h-1 mt-2"})]})]}),i.jsxs("div",{className:"bg-background/50 rounded p-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-2",children:"REFERRAL TIERS"}),$h.viralGrowth.referralTiers.map(s=>i.jsxs("div",{className:"flex items-center justify-between py-1",children:[i.jsxs("span",{className:"text-xs",children:["Tier ",s.tier]}),i.jsx(le,{variant:"outline",className:"text-[9px]",children:s.reward})]},s.tier))]})]}),i.jsxs(ht,{value:"Lovable Dashboard Metrics",className:"mt-0 space-y-3",children:[i.jsxs("div",{className:"bg-background/50 rounded p-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-2",children:"COMPUTED METRICS"}),i.jsxs("div",{className:"space-y-2 text-[10px] font-mono",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:"Daily GMV"}),i.jsxs("span",{children:["users à txn/day à avg_trade = $",(n.totalGmv/1e6).toFixed(2),"M"]})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:"Transaction Fees"}),i.jsxs("span",{children:["GMV à 0.25% = $",(n.totalGmv*.0025).toLocaleStr
541ing()]})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:"User Growth"}),i.jsxs("span",{children:["users à (1 + ref_rate à viral) = ",(n.totalUsers*1.15*1.2).toFixed(0)]})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:"AI Adoption"}),i.jsxs("span",{children:["adopted / generated = ",(n.avgAccuracy*100).toFixed(0),"%"]})]})]})]}),i.jsxs("div",{className:"bg-background/50 rounded p-3",children:[i.jsx("div",{className:"text-[10px] text-muted-foreground mb-2",children:"3-YEAR PROJECTIONS"}),i.jsx("div",{className:"grid grid-cols-3 gap-2",children:Object.entries($h.revenueProjections).map(([s,o])=>i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-[9px] text-muted-foreground uppercase",children:s}),i.jsxs("div",{className:"font-mono text-sm text-foreground",children:[(o.users/1e6).toFixed(1),"M users"]}),i.jsxs("div",{className:"font-mono text-xs text-profit",children:["$",(o.revenue/1e6).toFixed(0),"M rev"]})]},s))})]})]}),i.jsx(ht,{value:"Interactive Data Room",className:"mt-0",children:i.jsxs("div",{className:"bg-background/50 rounded p-3 text-center",children:[i.jsx(ki,{className:"w-8 h-8 mx-auto mb-2 text-bloomberg-blue"}),i.jsx("div",{className:"text-sm text-foreground",children:"Select a stock subdomain to view data room"}),i.jsx("div",{className:"flex gap-2 justify-center mt-2",children:jd.slice(0,3).map(s=>i.jsx(le,{variant:"outline",className:"cursor-pointer hover:bg-accent",children:s.subdomain},s.ticker))})]})})]})})]})}const mg=[{symbol:"AAPLX",name:"Apple (xStock)",category:"tokenized_stock",description:"Apple tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"MSFTX",name:"Microsoft (xStock)",category:"tokenized_stock",description:"Microsoft tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"GOOGLX",name:"Alphabet (xStock)",category:"tokenized_stock",description:"Alphabet tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"AMZNX",name:"Amazon (xStock)",category:"tokenized_stock",description:"Amazon tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"NVDAX",name:"NVIDIA (xStock)",category:"tokenized_stock",description:"NVIDIA tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"METAX",name:"Meta (xStock)",category:"tokenized_stock",description:"Meta Platforms tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"TSLAX",name:"Tesla (xStock)",category:"tokenized_stock",description:"Tesla tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"COINX",name:"Coinbase (xStock)",category:"tokenized_stock",description:"Coinbase tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"MSTRX",name:"MicroStrategy (xStock)",category:"tokenized_stock",description:"MicroStrategy tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"HOODX",name:"Robinhood (xStock)",category:"tokenized_stock",description:"Robinhood tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"ORCLX",name:"Oracle (xStock)",category:"tokenized_stock",description:"Oracle tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"INTCX",name:"Intel (xStock)",category:"tokenized_stock",description:"Intel tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"AVGOX",name:"Broadcom (xStock)",category:"tokenized_stock",description:"Broadcom tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"MRVLX",name:"Marvell (xStock)",category:"tokenized_stock",description:"Marvell Technology tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"HONX",name:"Honeywell (xStock)",category:"tokenized_stock",description:"Honeywell tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"AMDX",name:"AMD (xStock)",category:"tokenized_stock",description:"AMD tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"CRMX",name:"Salesforce (xStock)",category:"tokenized_stock",description:"Salesforce tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"ADSKX",name:"Autodesk (xStock)",category:"tokenized_stock",description:"Autodesk tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"SBUXXX",name:"Starbucks (xStock)",category:"tokenized_stock",description:"Starbucks tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"DISNEYX",name:"Disney (xStock)",category:"tokenized_stock",description:"Walt Disney tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"NFLXX",name:"Netflix (xStock)",category:"tokenized_stock",description:"Netflix tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"PYMNTX",name:"PayPal (xStock)",category:"tokenized_stock",description:"PayPal tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"VISAX",name:"Visa (xStock)",category:"tokenized_stock",description:"Visa tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"MAX",name:"Mastercard (xStock)",category:"tokenized_stock",description:"Mastercard tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"UBERX",name:"Uber (xStock)",category:"tokenized_stock",description:"Uber tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"ABNBX",name:"Airbnb (xStock)",category:"tokenized_stock",description:"Airbnb tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"SNAPX",name:"Snap (xStock)",category:"tokenized_stock",description:"Snap Inc tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"PLTX",name:"Palantir (xStock)",category:"tokenized_stock",description:"Palantir Technologies tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"SHOPX",name:"Shopify (xStock)",category:"tokenized_stock",description:"Shopify tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"ZOOMX",name:"Zoom (xStock)",category:"tokenized_stock",description:"Zoom Video tokenized stock on Bitget via xStock",provider:"xStock"},{symbol:"DOCUX",name:"DocuSign (xStock)",category:"tokenized_stock",description:"DocuSign tokenized stock on Bitget via xStock",provider:"xStock"}
541,{symbol:"AAPLon",name:"Apple (Ondo)",category:"tokenized_stock",description:"Apple tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"MSFTon",name:"Microsoft (Ondo)",category:"tokenized_stock",description:"Microsoft tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"GOOGLon",name:"Alphabet (Ondo)",category:"tokenized_stock",description:"Alphabet Class A tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"TSLAon",name:"Tesla (Ondo)",category:"tokenized_stock",description:"Tesla tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"NVDAon",name:"NVIDIA (Ondo)",category:"tokenized_stock",description:"NVIDIA tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"METAon",name:"Meta (Ondo)",category:"tokenized_stock",description:"Meta Platforms tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"CRCLon",name:"Circle (Ondo)",category:"tokenized_stock",description:"Circle Internet Group tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"LLYon",name:"Eli Lilly (Ondo)",category:"tokenized_stock",description:"Eli Lilly tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"KOon",name:"Coca-Cola (Ondo)",category:"tokenized_stock",description:"Coca-Cola tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"NVOon",name:"Novo Nordisk (Ondo)",category:"tokenized_stock",description:"Novo Nordisk tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"PGon",name:"Procter & Gamble (Ondo)",category:"tokenized_stock",description:"Procter & Gamble tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"JPMon",name:"JPMorgan (Ondo)",category:"tokenized_stock",description:"JPMorgan Chase tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"WMTon",name:"Walmart (Ondo)",category:"tokenized_stock",description:"Walmart tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"TMon",name:"Toyota (Ondo)",category:"tokenized_stock",description:"Toyota tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"INTCon",name:"Intel (Ondo)",category:"tokenized_stock",description:"Intel tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"CSCOon",name:"Cisco (Ondo)",category:"tokenized_stock",description:"Cisco Systems tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"ACNon",name:"Accenture (Ondo)",category:"tokenized_stock",description:"Accenture tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"AMDon",name:"AMD (Ondo)",category:"tokenized_stock",description:"AMD tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"MRVLon",name:"Marvell (Ondo)",category:"tokenized_stock",description:"Marvell Technology tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"BABAon",name:"Alibaba (Ondo)",category:"tokenized_stock",description:"Alibaba tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"PFEon",name:"Pfizer (Ondo)",category:"tokenized_stock",description:"Pfizer tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"IBMon",name:"IBM (Ondo)",category:"tokenized_stock",description:"IBM tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"ABTon",name:"Abbott (Ondo)",category:"tokenized_stock",description:"Abbott Laboratories tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"CVXon",name:"Chevron (Ondo)",category:"tokenized_stock",description:"Chevron tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"SBUXon",name:"Starbucks (Ondo)",category:"tokenized_stock",description:"Starbucks tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"NKEon",name:"Nike (Ondo)",category:"tokenized_stock",description:"Nike tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"PANWon",name:"Palo Alto Networks (Ondo)",category:"tokenized_stock",description:"Palo Alto Networks tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"UNHon",name:"UnitedHealth (Ondo)",category:"tokenized_stock",description:"UnitedHealth Group tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"HDon",name:"Home Depot (Ondo)",category:"tokenized_stock",description:"Home Depot tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"BAon",name:"Boeing (Ondo)",category:"tokenized_stock",description:"Boeing tokenized stock on Bitget via Ondo Finance",provider:"Ondo"}
541,{symbol:"CATon",name:"Caterpillar (Ondo)",category:"tokenized_stock",description:"Caterpillar tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"AXPon",name:"American Express (Ondo)",category:"tokenized_stock",description:"American Express tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"VZon",name:"Verizon (Ondo)",category:"tokenized_stock",description:"Verizon tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"TXNon",name:"Texas Instruments (Ondo)",category:"tokenized_stock",description:"Texas Instruments tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"QCOMon",name:"Qualcomm (Ondo)",category:"tokenized_stock",description:"Qualcomm tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"COSTon",name:"Costco (Ondo)",category:"tokenized_stock",description:"Costco tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"MDTon",name:"Medtronic (Ondo)",category:"tokenized_stock",description:"Medtronic tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"MCDon",name:"McDonalds (Ondo)",category:"tokenized_stock",description:"McDonalds tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"LMTon",name:"Lockheed Martin (Ondo)",category:"tokenized_stock",description:"Lockheed Martin tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"NEEon",name:"NextEra Energy (Ondo)",category:"tokenized_stock",description:"NextEra Energy tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"GEon",name:"General Electric (Ondo)",category:"tokenized_stock",description:"General Electric tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"AMGNon",name:"Amgen (Ondo)",category:"tokenized_stock",description:"Amgen tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"GILDon",name:"Gilead Sciences (Ondo)",category:"tokenized_stock",description:"Gilead Sciences tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"ADIon",name:"Analog Devices (Ondo)",category:"tokenized_stock",description:"Analog Devices tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"RTXon",name:"RTX Corp (Ondo)",category:"tokenized_stock",description:"RTX Corporation tokenized stock on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"SPYX",name:"S&P 500 ETF (xStock)",category:"tokenized_etf",description:"S&P 500 tokenized ETF on Bitget via xStock",provider:"xStock"},{symbol:"VTIX",name:"Vanguard Total Intl (xStock)",category:"tokenized_etf",description:"Vanguard Total International Stock ETF tokenized on Bitget via xStock",provider:"xStock"},{symbol:"GLDX",name:"Gold ETF (xStock)",category:"tokenized_etf",description:"SPDR Gold Shares tokenized ETF on Bitget via xStock",provider:"xStock"},{symbol:"TQQQX",name:"TQQQ (xStock)",category:"tokenized_etf",description:"ProShares UltraPro QQQ tokenized ETF on Bitget via xStock",provider:"xStock"},{symbol:"QQQX",name:"QQQ ETF (xStock)",category:"tokenized_etf",description:"Invesco QQQ Trust tokenized ETF on Bitget via xStock",provider:"xStock"},{symbol:"ARKX",name:"ARK Innovation (xStock)",category:"tokenized_etf",description:"ARK Innovation ETF tokenized on Bitget via xStock",provider:"xStock"},{symbol:"DIAX",name:"Dow Jones ETF (xStock)",category:"tokenized_etf",description:"SPDR Dow Jones Industrial Average ETF tokenized on Bitget via xStock",provider:"xStock"},{symbol:"IWMX",name:"Russell 2000 ETF (xStock)",category:"tokenized_etf",description:"iShares Russell 2000 ETF tokenized on Bitget via xStock",provider:"xStock"},{symbol:"XLKX",name:"Tech Sector ETF (xStock)",category:"tokenized_etf",description:"Technology Select Sector SPDR Fund tokenized on Bitget via xStock",provider:"xStock"},{symbol:"XLFX",name:"Financial Sector ETF (xStock)",category:"tokenized_etf",description:"Financial Select Sector SPDR Fund tokenized on Bitget via xStock",provider:"xStock"},{symbol:"XLEX",name:"Energy Sector ETF (xStock)",category:"tokenized_etf",description:"Energy Select Sector SPDR Fund tokenized on Bitget via xStock",provider:"xStock"},{symbol:"XLVX",name:"Healthcare ETF (xStock)",category:"tokenized_etf",description:"Health Care Select Sector SPDR Fund tokenized on Bitget via xStock",provider:"xStock"},{symbol:"XLIX",name:"Industrial ETF (xStock)",category:"tokenized_etf",description:"Industrial Select Sector SPDR Fund tokenized on Bitget via xStock",provider:"xStock"},{symbol:"VGTX",name:"Vanguard IT ETF (xStock)",category:"tokenized_etf",description:"Vanguard Information Technology ETF tokenized on Bitget via xStock",provider:"xStock"},{symbol:"VYMX",name:"Vanguard High Div (xStock)",category:"tokenized_etf",description:"Vanguard High Divi
541dend Yield ETF tokenized on Bitget via xStock",provider:"xStock"},{symbol:"SLVX",name:"Silver ETF (xStock)",category:"tokenized_etf",description:"iShares Silver Trust tokenized ETF on Bitget via xStock",provider:"xStock"},{symbol:"USOX",name:"Oil ETF (xStock)",category:"tokenized_etf",description:"United States Oil Fund tokenized ETF on Bitget via xStock",provider:"xStock"},{symbol:"TLTX",name:"Treasury Bond ETF (xStock)",category:"tokenized_etf",description:"20+ Year Treasury Bond ETF tokenized on Bitget via xStock",provider:"xStock"},{symbol:"JNKX",name:"High Yield Bond ETF (xStock)",category:"tokenized_etf",description:"SPDR Bloomberg High Yield Bond ETF tokenized on Bitget via xStock",provider:"xStock"},{symbol:"EEMX",name:"Emerging Markets ETF (xStock)",category:"tokenized_etf",description:"iShares MSCI Emerging Markets ETF tokenized on Bitget via xStock",provider:"xStock"},{symbol:"IWNon",name:"Russell 2000 Value (Ondo)",category:"tokenized_etf",description:"iShares Russell 2000 Value tokenized ETF on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"ITOTon",name:"Total US Stock Market (Ondo)",category:"tokenized_etf",description:"iShares Core S&P Total US Stock Market tokenized ETF on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"VOOon",name:"Vanguard S&P 500 (Ondo)",category:"tokenized_etf",description:"Vanguard S&P 500 ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"VTIon",name:"Vanguard Total Market (Ondo)",category:"tokenized_etf",description:"Vanguard Total Stock Market ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"AGGon",name:"Aggregate Bond (Ondo)",category:"tokenized_etf",description:"iShares Core US Aggregate Bond ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"BNDon",name:"Vanguard Bond (Ondo)",category:"tokenized_etf",description:"Vanguard Total Bond Market ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"VXUSon",name:"Vanguard Ex-US (Ondo)",category:"tokenized_etf",description:"Vanguard Total International Stock ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"IEFAon",name:"Core MSCI EAFE (Ondo)",category:"tokenized_etf",description:"iShares Core MSCI EAFE ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"IEMGon",name:"Core Emerging (Ondo)",category:"tokenized_etf",description:"iShares Core MSCI Emerging Markets ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"VNQon",name:"Real Estate ETF (Ondo)",category:"tokenized_etf",description:"Vanguard Real Estate ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"VGTon",name:"Vanguard Info Tech (Ondo)",category:"tokenized_etf",description:"Vanguard Information Technology ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"VHTon",name:"Vanguard Health (Ondo)",category:"tokenized_etf",description:"Vanguard Health Care ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"VFHon",name:"Vanguard Financials (Ondo)",category:"tokenized_etf",description:"Vanguard Financials ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"VDCon",name:"Vanguard Consumer Staples (Ondo)",category:"tokenized_etf",description:"Vanguard Consumer Staples ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"},{symbol:"VPUon",name:"Vanguard Utilities (Ondo)",category:"tokenized_etf",description:"Vanguard Utilities ETF tokenized on Bitget via Ondo Finance",provider:"Ondo"}];function uB(e){return mg.find(t=>t.symbol.toLowerCase()===e.toLowerCase())}const C=(e,t,n,r="medium")=>{const o={low:{lookback:25,entry:.012,exit:.006,stopLoss:.03,takeProfit:.08,posSize:.2,rsiOB:70,rsiOS:35,sharpe:1.4},medium:{lookback:18,entry:.018,exit:.009,stopLoss:.045,takeProfit:.14,posSize:.15,rsiOB:72,rsiOS:30,sharpe:1.7},high:{lookback:12,entry:.025,exit:.012,stopLoss:.06,takeProfit:.2,posSize:.1,rsiOB:78,rsiOS:25,sharpe:2},extreme:{lookback:8,entry:.035,exit:.018,stopLoss:.1,takeProfit:.3,posSize:.06,rsiOB:85,rsiOS:18,sharpe:2.4}}[r];return{symbol:e,name:t,strategy_type:n,description:`Alpha-seeking ${n} strategy for ${t}`,lookback_period:o.lookback,entry_threshold:o.entry,exit_threshold:o.exit,stop_loss:o.stopLoss,take_profit:o.takeProfit,position_size:o.posSize,rsi_period:14,rsi_overbought:o.rsiOB,rsi_oversold:o.rsiOS,target_sharpe:o.sharpe}};C("AAPLX","Apple Momentum Hunter","momentum","medium"),C("NVDAX","NVIDIA AI Alpha","trend_following","high"),C("MSFTX","Microsoft Cloud Tracker","multi_factor","medium"),C("GOOGLX","Alphabet Search Alpha","momentum","medium"),C("METAX","Meta Sentiment Swing","mean_reversion","high"),C("TSLAX","Tesla Vol Harvester","volatility","extreme"),C("AMZNX","Amazon E-Commerce Edge","trend_following","medium"),C("COINX","Coinbase Crypto Beta","volatility","extreme"),C("MSTRX","MicroStrategy BTC Proxy","volatility","extreme"),C("HOODX","Robinhood Retail Pulse","momentum","high"),C("ORCLX","Oracle Cloud Growth","trend_following","medium"),C("INTCX","Intel Turnaround Play","mean_reversion","high"),C("AVGOX","Broadcom AI Infrastru
541cture","momentum","medium"),C("MRVLX","Marvell 5G Data Center","trend_following","medium"),C("HONX","Honeywell Industrial Alpha","trend_following","low"),C("AMDX","AMD Chipset Momentum","momentum","high"),C("CRMX","Salesforce SaaS Alpha","multi_factor","medium"),C("ADSKX","Autodesk CAD Cycle","trend_following","medium"),C("SBUXXX","Starbucks Consumer Trend","mean_reversion","low"),C("DISNEYX","Disney Media Momentum","momentum","medium"),C("NFLXX","Netflix Streaming Alpha","momentum","high"),C("PYMNTX","PayPal Fintech Play","mean_reversion","high"),C("VISAX","Visa Payment Flow","trend_following","low"),C("MAX","Mastercard Global Alpha","multi_factor","low"),C("UBERX","Uber Mobility Tracker","momentum","high"),C("ABNBX","Airbnb Travel Alpha","momentum","high"),C("SNAPX","Snap Social Momentum","volatility","extreme"),C("PLTX","Palantir AI Gov Alpha","trend_following","high"),C("SHOPX","Shopify E-Commerce","momentum","high"),C("ZOOMX","Zoom Hybrid Work","mean_reversion","high"),C("DOCUX","DocuSign Digital Sig","mean_reversion","medium"),C("AAPLon","Apple Ondo Momentum","momentum","medium"),C("MSFTon","Microsoft Ondo Cloud","multi_factor","medium"),C("GOOGLon","Alphabet Ondo Alpha","momentum","medium"),C("TSLAon","Tesla Ondo Volatility","volatility","extreme"),C("NVDAon","NVIDIA Ondo AI Play","trend_following","high"),C("METAon","Meta Ondo Swing","mean_reversion","high"),C("CRCLon","Circle USDC Alpha","mean_reversion","medium"),C("LLYon","Eli Lilly Pharma","trend_following","medium"),C("KOon","Coca-Cola Dividend","mean_reversion","low"),C("NVOon","Novo Nordisk Weight","trend_following","medium"),C("PGon","P&G Consumer Alpha","mean_reversion","low"),C("JPMon","JPMorgan Banking","multi_factor","medium"),C("WMTon","Walmart Retail Alpha","trend_following","low"),C("TMon","Toyota Auto Cycle","trend_following","medium"),C("INTCon","Intel Ondo Revival","mean_reversion","high"),C("CSCOon","Cisco Network Alpha","trend_following","low"),C("ACNon","Accenture Consulting","multi_factor","medium"),C("AMDon","AMD Ondo Chip Play","momentum","high"),C("MRVLon","Marvell Ondo Data","trend_following","medium"),C("BABAon","Alibaba China Tech","volatility","high"),C("PFEon","Pfizer Pharma Cycle","mean_reversion","medium"),C("IBMon","IBM Enterprise AI","trend_following","low"),C("ABTon","Abbott Healthcare","multi_factor","low"),C("CVXon","Chevron Energy Alpha","trend_following","medium"),C("SBUXon","Starbucks Ondo Coffee","mean_reversion","low"),C("NKEon","Nike Consumer Sport","momentum","medium"),C("PANWon","Palo Alto Cyber","trend_following","high"),C("UNHon","UnitedHealth MCO","trend_following","medium"),C("HDon","Home Depot Housing","trend_following","medium"),C("BAon","Boeing Aerospace","mean_reversion","high"),C("CATon","Caterpillar Industrial","trend_following","medium"),C("AXPon","AmEx Credit Alpha","multi_factor","medium"),C("VZon","Verizon Telecom","mean_reversion","low"),C("TXNon","Texas Instruments","trend_following","medium"),C("QCOMon","Qualcomm 5G Alpha","momentum","medium"),C("COSTon","Costco Membership","trend_following","low"),C("MDTon","Medtronic MedTech","multi_factor","low"),C("MCDon","McDonalds Fast Food","mean_reversion","low"),C("LMTon","Lockheed Defense","trend_following","medium"),C("NEEon","NextEra Clean Energy","trend_following","medium"),C("GEon","GE Aerospace Alpha","momentum","medium"),C("AMGNon","Amgen Biotech","multi_factor","medium"),C("GILDon","Gilead Sciences","mean_reversion","medium"),C("ADIon","Analog Devices Semi","trend_following","medium"),C("RTXon","RTX Defense Alpha","trend_following","medium"),C("SPYX","SPY Trend Rider","trend_following","low"),C("VTIX","Vanguard Intl Diversified","multi_factor","low"),C("GLDX","Gold Safe Haven","mean_reversion","medium"),C("TQQQX","TQQQ Leverage Alpha","momentum","extreme"),C("QQQX","QQQ Tech Tracker","trend_following","medium"),C("ARKX","ARK Innovation Swing","volatility","extreme"),C("DIAX","Dow Jones Blue Chip","trend_following","low"),C("IWMX","Russell 2000 Small Cap","momentum","medium"),C("XLKX","Tech Sector Alpha","trend_following","medium"),C("XLFX","Financial Sector Cycle","mean_reversion","medium"),C("XLEX","Energy Sector Momentum","momentum","high"),C("XLVX","Healthcare Sector","trend_following","low"),C("XLIX","Industrial Sector","trend_following","medium"),C("VGTX","Vanguard IT Alpha","momentum","medium"),C("VYMX","High Divi
541dend Yield","mean_reversion","low"),C("SLVX","Silver Momentum","volatility","high"),C("USOX","Oil Price Tracker","volatility","high"),C("TLTX","Treasury Bond Alpha","mean_reversion","low"),C("JNKX","High Yield Credit","mean_reversion","medium"),C("EEMX","Emerging Markets","momentum","high"),C("IWNon","Russell Value Ondo","mean_reversion","medium"),C("ITOTon","Total Market Ondo","trend_following","low"),C("VOOon","Vanguard S&P Ondo","trend_following","low"),C("VTIon","Total Stock Ondo","trend_following","low"),C("AGGon","Aggregate Bond Ondo","mean_reversion","low"),C("BNDon","Vanguard Bond Ondo","mean_reversion","low"),C("VXUSon","Ex-US Stock Ondo","multi_factor","medium"),C("IEFAon","EAFE Developed Ondo","trend_following","medium"),C("IEMGon","Emerging Core Ondo","momentum","high"),C("VNQon","Real Estate Ondo","mean_reversion","medium"),C("VGTon","Info Tech Ondo","momentum","medium"),C("VHTon","Healthcare Ondo","trend_following","low"),C("VFHon","Financials Ondo","mean_reversion","medium"),C("VDCon","Consumer Staples Ondo","mean_reversion","low"),C("VPUon","Utilities Ondo","mean_reversion","low"),C("BTC","Bitcoin Alpha Engine","trend_following","high"),C("ETH","Ethereum DeFi Alpha","momentum","high"),C("SOL","Solana Speed Trader","momentum","extreme"),C("XRP","XRP Payments Alpha","mean_reversion","high"),C("ADA","Cardano Proof Stake","trend_following","high"),C("AVAX","Avalanche Subnet","momentum","high"),C("DOT","Polkadot Parachain","trend_following","high"),C("LINK","Chainlink Oracle","trend_following","high"),C("MATIC","Polygon L2 Alpha","momentum","high"),C("UNI","Uniswap DEX Alpha","mean_reversion","high"),C("ATOM","Cosmos IBC Alpha","trend_following","high"),C("LTC","Litecoin Digital Silver","mean_reversion","medium"),C("BCH","Bitcoin Cash P2P","mean_reversion","medium"),C("DOGE","Dogecoin Meme Alpha","volatility","extreme"),C("SHIB","Shiba Inu Meme Vol","volatility","extreme"),C("NEAR","NEAR Protocol Alpha","momentum","high"),C("APT","Aptos Move Alpha","momentum","high"),C("ARB","Arbitrum L2 Alpha","momentum","high"),C("OP","Optimism L2 Alpha","momentum","high"),C("SUI","Sui Move Alpha","momentum","extreme"),C("INJ","Injective DeFi Alpha","momentum","extreme"),C("TIA","Celestia Modular","trend_following","high"),C("AAVE","Aave Lending Alpha","trend_following","high"),C("MKR","Maker DAO Alpha","mean_reversion","medium"),C("FIL","Filecoin Storage","mean_reversion","high"),C("GRT","The Graph Indexer","momentum","high"),C("RENDER","Render GPU Alpha","momentum","extreme"),C("FET","Fetch.ai Agent Alpha","momentum","extreme"),C("STX","Stacks Bitcoin L2","trend_following","high"),C("IMX","Immutable Gaming","momentum","high"),C("LDO","Lido Staking Alpha","trend_following","high"),C("ENS","ENS Domain Alpha","mean_reversion","high"),C("PENDLE","Pendle Yield Alpha","momentum","extreme"),C("JUP","Jupiter DEX Alpha","momentum","extreme"),C("PYTH","Pyth Oracle Alpha","trend_following","high"),C("ONDO","Ondo RWA Alpha","trend_following","high"),C("AAPL","Apple Direct Alpha","momentum","medium"),C("MSFT","Microsoft Direct","multi_factor","medium"),C("GOOGL","Alphabet Direct","momentum","medium"),C("AMZN","Amazon Direct","trend_following","medium"),C("NVDA","NVIDIA Direct AI","trend_following","high"),C("META","Meta Direct","mean_reversion","high"),C("TSLA","Tesla Direct Vol","volatility","extreme"),C("AMD","AMD Direct Chip","momentum","high"),C("COIN","Coinbase Direct","volatility","extreme"),C("MSTR","MicroStrategy BTC","volatility","extreme"),C("CRM","Salesforce Direct","multi_factor","medium"),C("NFLX","Netflix Direct","momentum","high"),C("PLTR","Palantir Direct AI","trend_following","high"),C("UBER","Uber Direct Mobility","momentum","high"),C("ABNB","Airbnb Direct Travel","momentum","high"),C("SHOP","Shopify Direct","momentum","high"),C("SQ","Block Direct Fintech","volatility","high"),C("PYPL","PayPal Direct","mean_reversion","high"),C("CRWD","CrowdStrike Cyber","trend_following","high"),C("SNOW","Snowflake Data","trend_following","high"),C("DDOG","Datadog Observability","trend_following","medium"),C("NET","Cloudflare Edge","momentum","high"),C("MDB","MongoDB Database","trend_following","high"),C("ZS","Zscaler Zero Trust","trend_following","high"),C("MARA","Marathon BTC Mining","volatility","extreme"),C("RIOT","Riot BTC Mining","volatility","extreme"),C("CLSK","CleanSpark Mining","volatility","extreme"),C("AI","C3.ai Enterprise AI","volatility","extreme"),C("SMCI","Super Micro AI Infra","volatility","extreme"),C("RIVN","Rivian EV Alpha","volatility","extreme"),C("NIO","NIO China EV","volatility","extreme"),C("LCID","Lucid EV Luxury","volatility","extreme"),C("SPY","SPY Direct Trend","trend_following","low"),C("QQQ","QQQ Direct Tech","trend_following","medium"),C("IWM","IWM Small Cap","momentum","medium"),C("DIA","DIA Blue Chip","trend_following","low"),C("VTI","VTI Total Market","trend_following","low"),C("TQQQ","TQQQ 3x Leverage","momentum","extreme"),C("ARKK","ARKK Innovation","volatility","extreme"),C("XLK","XLK Tech Sector","trend_following","medium"),C("XLE","XLE Energy Sector","momentum","high"),C("XLF","XLF Financial","mean_reversion","medium"),C("GLD","GLD Gold Hedge","mean_reversion","medium"),C("SLV","SLV Silver Vol","volatility","high"),C("TLT","TLT Treasury","mean_reversion","low"),C("HYG","HYG High Yield","mean_reversion","medium"),C("EEM","EEM Emerging","momentum","high");const bz=mg,wz={TSLAX:248.5,AAPLX:189.45,NVDAX:495.2,MSFTX:378.6,AMZNX:178.25,GOOGLX:141.8,METAX:325.4,COINX:185.3,MSTRX:385.22,AMDX:125.3,SPYX:445.2,QQEX:378.9,TSLAon:248.5,AAPLon:189.45,NVDAon:495.2,AMDon:142.3,COINon:185.3,MSTRon:385.22},kz=({selectedSymbol:e="TSLAX",onSymbolSelect:t,onTradeSignal:n})=>{const[r,s]=f.useState("all"),{prices:o,isConnected:a,error:l,reconnect:c}=bu(),[d,u]=f.useState(new Date);f.useEffect(()=>{Object.keys(o).length>0&&u(new Date)},[o]);const h=f.useMemo(()=>bz.map(k=>{const S=o[k.symbol],T=wz[k.symbol]||100+Math.random()*400,E=(S==null?void 0:S.price)||T,j=(S==null?void 0:S.change24h)??(Math.random()-.5)*8,N=(S==null?void 0:S.volume)||Math.floor(Math.random()*5e7)+1e6,R=(S==null?void 0:S.provider)||k.provider,F=E*(Math.random()*5+1)*1e9;
541return{symbol:k.symbol,name:k.name,provider:R,category:k.category,price:E,change24h:j,volume24h:N,marketCap:F,tvl:Math.random()*500+50,isLive:!!S}}),[o]),p=f.useMemo(()=>r==="all"?h:h.filter(k=>k.provider.toLowerCase()===r.toLowerCase()),[h,r]),m=Math.max(...p.map(k=>Math.abs(k.change24h))),x=k=>{const S=Math.min(Math.abs(k)/m,1);return k>=0?`rgba(34, 197, 94, ${.2+S*.6})`:`rgba(239, 68, 68, ${.2+S*.6})`},g=[...p].sort((k,S)=>S.marketCap-k.marketCap),w=p.reduce((k,S)=>k+S.tvl,0),v=p.reduce((k,S)=>k+S.change24h,0)/p.length,y=p.filter(k=>k.change24h>0).length,b=p.filter(k=>k.isLive).length;return i.jsxs(is,{className:"bg-card/50 backdrop-blur-sm border-border/50",children:[i.jsx(as,{className:"pb-3",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"p-2 rounded-lg bg-gradient-to-br from-blue-500/20 to-violet-500/20",children:i.jsx(zf,{className:"h-5 w-5 text-blue-400"})}),i.jsxs("div",{children:[i.jsxs(ls,{className:"text-lg flex items-center gap-2",children:["Stock Heatmap",i.jsxs(le,{variant:"outline",className:D("text-[10px] px-1.5 py-0",a?"bg-emerald-500/10 text-emerald-400 border-emerald-500/30":"bg-amber-500/10 text-amber-400 border-amber-500/30"),children:[i.jsx(ln,{className:D("w-2.5 h-2.5 mr-1",a&&"animate-pulse")}),a?"LIVE":"CACHED"]})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:a?`Real-time streaming ⢠${b} assets live`:"Reconnecting to live feed..."})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[!a&&i.jsx(Ee,{variant:"ghost",size:"sm",onClick:c,className:"text-xs",children:"Reconnect"}),i.jsxs(Dc,{value:r,onValueChange:s,children:[i.jsx(Sa,{className:"w-24 h-8 text-xs",children:i.jsx(zc,{})}),i.jsxs(Ta,{children:[i.jsx(Yr,{value:"all",children:"All"}),i.jsx(Yr,{value:"xstock",children:"xStock"}),i.jsx(Yr,{value:"ondo",children:"Ondo"}),i.jsx(Yr,{value:"etfs",children:"ETFs"})]})]})]})]})}),i.jsxs(cs,{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 md:gap-3",children:[i.jsxs("div",{className:"p-2 md:p-3 rounded-lg bg-blue-500/10 border border-blue-500/20",children:[i.jsxs("div",{className:"flex items-center gap-1 mb-0.5 md:mb-1",children:[i.jsx(zf,{className:"h-3 w-3 md:h-3.5 md:w-3.5 text-blue-400"}),i.jsx("span",{className:"text-[9px] md:text-xs text-muted-foreground",children:"Total TVL"})]}),i.jsxs("p",{className:"text-sm md:text-lg font-bold text-blue-400",children:["$",w.toFixed(0),"M"]})]}),i.jsxs("div",{className:`p-2 md:p-3 rounded-lg ${v>=0?"bg-emerald-500/10 border-emerald-500/20":"bg-red-500/10 border-red-500/20"} border`,children:[i.jsxs("div",{className:"flex items-center gap-1 mb-0.5 md:mb-1",children:[v>=0?i.jsx(Et,{className:"h-3 w-3 md:h-3.5 md:w-3.5 text-emerald-400"}):i.jsx(Si,{className:"h-3 w-3 md:h-3.5 md:w-3.5 text-red-400"}),i.jsx("span",{className:"text-[9px] md:text-xs text-muted-foreground",children:"Avg Change"})]}),i.jsxs("p",{className:`text-sm md:text-lg font-bold ${v>=0?"text-emerald-400":"text-red-400"}`,children:[v>=0?"+":"",v.toFixed(2),"%"]})]}),i.jsxs("div",{className:"p-2 md:p-3 rounded-lg bg-violet-500/10 border border-violet-500/20",children:[i.jsxs("div",{className:"flex items-center gap-1 mb-0.5 md:mb-1",children:[i.jsx(ln,{className:"h-3 w-3 md:h-3.5 md:w-3.5 text-violet-400"}),i.jsx("span",{className:"text-[9px] md:text-xs text-muted-foreground",children:"Gainers"})]}),i.jsxs("p",{className:"text-sm md:text-lg font-bold text-violet-400",children:[y,"/",p.length]})]}),i.jsx(Ie,{to:"/trade",className:"block",children:i.jsxs("div",{className:"p-2 md:p-3 rounded-lg bg-cyan-500/10 border border-cyan-500/20 hover:bg-cyan-500/20 transition-colors cursor-pointer h-full",children:[i.jsxs("div",{className:"flex items-center gap-1 mb-0.5 md:mb-1",children:[i.jsx(Ge,{className:"h-3 w-3 md:h-3.5 md:w-3.5 text-cyan-400"}),i.jsx("span",{className:"text-[9px] md:text-xs text-muted-foreground",children:"Trade"})]}),i.jsxs("p",{className:"text-xs md:text-sm font-bold text-cyan-400 flex items-center gap-1",children:["Execute ",i.jsx(wC,{className:"h-3 w-3"})]})]})})]}),i.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-5 md:grid-cols-6 lg:grid-cols-8 gap-1.5 md:gap-2",children:g.map(k=>{const S=k.symbol===e,T=k.change24h>=0;return i.jsxs("button",{onClick:()=>t==null?void 0:t(k.symbol),className:D("relative flex flex-col items-center justify-center","min-h-[56px] md:min-
541h-[64px] p-2 rounded-lg","border transition-all duration-150","select-none touch-manipulation","active:scale-[0.97] hover:scale-[1.02]",S?["bg-primary/15 border-primary/50","shadow-[0_0_16px_rgba(var(--primary),0.25)]"]:["border-border/30 hover:border-border/50"]),style:{backgroundColor:S?void 0:x(k.change24h),WebkitTapHighlightColor:"transparent"},children:[i.jsx("div",{className:D("absolute top-1 right-1 w-1.5 h-1.5 rounded-full",k.provider==="xStock"?"bg-cyan-400":"bg-amber-400")}),k.isLive&&i.jsx("div",{className:"absolute top-1 left-1 w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),i.jsx("span",{className:D("text-xs md:text-sm font-semibold tracking-tight truncate",S?"text-primary":"text-foreground"),children:k.symbol}),i.jsxs("span",{className:D("text-[10px] md:text-xs font-mono font-medium tabular-nums",T?"text-profit":"text-loss"),children:[T?"+":"",k.change24h.toFixed(2),"%"]})]},k.symbol)})}),i.jsxs("div",{className:"flex items-center justify-between pt-2 text-xs",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-3 h-3 rounded bg-gradient-to-r from-red-500/20 to-red-500"}),i.jsx("span",{className:"text-muted-foreground",children:"Bearish"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-3 h-3 rounded bg-gradient-to-r from-emerald-500/20 to-emerald-500"}),i.jsx("span",{className:"text-muted-foreground",children:"Bullish"})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("div",{className:"w-2 h-2 rounded-full bg-cyan-400"}),i.jsx("span",{className:"text-muted-foreground",children:"xStock"})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("div",{className:"w-2 h-2 rounded-full bg-amber-400"}),i.jsx("span",{className:"text-muted-foreground",children:"Ondo"})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400 animate-pulse"}),i.jsx("span",{className:"text-muted-foreground",children:"Live"})]})]})]}),l&&i.jsxs("div",{className:"text-xs text-amber-400 text-center py-1",children:[l," ",i.jsx("button",{onClick:c,className:"underline ml-1",children:"Retry"})]}),i.jsxs("div",{className:"text-[10px] text-muted-foreground text-center",children:["Last update: ",d.toLocaleTimeString()]})]})]})},Sz={RISK:"text-red-400",ALPHA:"text-emerald-400",MACRO:"text-blue-400",FLOW:"text-amber-400",QUANT:"text-violet-400",EXEC:"text-cyan-400",INFRA:"text-cyan-300",DEVS:"text-fuchsia-400"},Tz=e=>{const t=new Date(e),n=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0"),s=t.getSeconds().toString().padStart(2,"0"),o=t.getMilliseconds().toString().padStart(3,"0");return`${n}:${r}:${s}.${o}`},Az=({signal:e})=>e==="bullish"?i.jsx(Et,{className:"w-3 h-3 text-emerald-400"}):e==="bearish"?i.jsx(Si,{className:"w-3 h-3 text-red-400"}):i.jsx(Op,{className:"w-3 h-3 text-muted-foreground"});function Ez({messages:e,isLoading:t}){const n=f.useRef(null),r=Ni(),[s,o]=f.useState(null);f.useEffect(()=>{n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e]);const a=async l=>{if(!s){o(l.id),ke.info("Generating educational article...");try{const{data:c,error:d}=await ye.functions.invoke("generate-academy-article",{body:{message:l.message,agentId:l.agent_id,agentName:l.agent_name}});if(d)throw d;c!=null&&c.slug&&(ke.success(c.existing?"Article already exists!":"Article generated!"),r(`/academy/${c.slug}`))}catch(c){console.error("Failed to generate article:",c),ke.error("Failed to generate article. Try again.")}finally{o(null)}}};return i.jsxs(is,{className:"bg-card/50 border-border/50 backdrop-blur-sm h-[280px]",children:[i.jsx(as,{className:"py-2 px-3 border-b border-border/50",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(AC,{className:"w-4 h-4 text-amber-500"}),i.jsx(ls,{className:"text-sm font-mono tracking-tight",children:"AGENT TAPE"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-[9px] text-muted-foreground flex items-center gap-1",children:[i.jsx(Pp,{className:"w-3 h-3"}),"Click to learn"]}),i.jsx(le,{variant:"outline",className:"text-[10px] font-mono border-amber-500/30 text-amber-500",children:"LIVE"})]})]})}),i.jsx(cs,{className:"p-0",children:i.jsx(fg,{className:"h-[220px]",ref:n,children:i.jsxs("div",{className:"p-2 space-y-1 font-mono text-xs",children:[e.length===0?i.jsx("div",{className:"text-muted-foreground text-center py-8",children:"Run AI Agents to start agent tape..."}):e.map(l=>i.jsxs("div",{onClick:()=>a(l),className:`flex items-start gap-2 py-1 px-2 rounded cursor-pointer transition-colors group ${s===l.id?"bg-primary/10 animate-pulse":"hover:bg-muted/50"}`,children:[i.jsx("span",{className:"text-muted-foreground shrink-0 text-[10px]",children:Tz(l.timestamp_ms)}),i.jsxs("span",{className:`font-bold shrink-0 ${Sz[l.agent_id]||"text-foreground"}`,children:["[",l.agent_id,"]"]}),i.jsx("span",{className:"text-foreground flex-1 break-words group-hover:text-primary transition-colors",children:l.message}),i.jsx("div",{className:"flex items-center gap-1 shrink-0",children:s===l.id?i.jsx(hd,{className:"w-3 h-3 animate-spin text-primary"}):i.jsxs(i.Fragment,{children:[i.jsx(Az,{signal:l.signal}),l.confidence&&i.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[l.confidence,"%"]})]})})]},l.id)),t&&i.jsx("div",{className:"text-amber-500 animate-pulse py-1 px-2",children:"â Processing signals..."})]})})})]})}const Nz=[{ticker:"TSLAX",name:"Tesla",price:421.06,change:2.34,route:"/TSLAX",provider:"xStock"},{ticker:"AAPLX",name:"Apple",price:248.13,change:-.82,route:"/AAPLX",provider:"xStock"},{ticker:"NVDAX",name:"NVIDIA",price:134.7,change:3.21,route:"/NVDAX",provider:"xStock"},{ticker:"MSFTX",name:"Microsoft",price:446.95,change:.67,route:"/MSFTX",provider:"xStock"},{ticker:"AMZNX",name:"Amazon",price:227.03,change:1.45,route:"/AMZNX",provider:"xStock"}
541,{ticker:"GOOGLX",name:"Google",price:192.96,change:-.34,route:"/GOOGLX",provider:"xStock"},{ticker:"METAX",name:"Meta",price:585.4,change:1.15,route:"/METAX",provider:"xStock"},{ticker:"COINX",name:"Coinbase",price:312.5,change:2.87,route:"/COINX",provider:"xStock"},{ticker:"AMDX",name:"AMD",price:125.3,change:-1.23,route:"/AMDX",provider:"xStock"},{ticker:"MSTRX",name:"MicroStrategy",price:385.22,change:4.12,route:"/MSTRX",provider:"xStock"},{ticker:"NFLXX",name:"Netflix",price:892.15,change:1.45,route:"/NFLXX",provider:"xStock"},{ticker:"PLTRX",name:"Palantir",price:78.9,change:3.56,route:"/PLTRX",provider:"xStock"},{ticker:"INTCX",name:"Intel",price:19.85,change:-2.15,route:"/INTCX",provider:"xStock"},{ticker:"CRMX",name:"Salesforce",price:342.5,change:.89,route:"/CRMX",provider:"xStock"},{ticker:"UBERX",name:"Uber",price:68.4,change:1.78,route:"/UBERX",provider:"xStock"},{ticker:"ABNBX",name:"Airbnb",price:142.3,change:-.45,route:"/ABNBX",provider:"xStock"},{ticker:"SHOPX",name:"Shopify",price:112.8,change:2.34,route:"/SHOPX",provider:"xStock"},{ticker:"ORCLX",name:"Oracle",price:189.5,change:.56,route:"/ORCLX",provider:"xStock"},{ticker:"SPYX",name:"S&P 500",price:595.4,change:.45,route:"/SPYX",provider:"xStock"},{ticker:"QQQX",name:"Nasdaq 100",price:525.8,change:.78,route:"/QQQX",provider:"xStock"},{ticker:"GLDX",name:"Gold ETF",price:242.3,change:.23,route:"/GLDX",provider:"xStock"},{ticker:"ARKX",name:"ARK Innov",price:56.4,change:1.89,route:"/ARKX",provider:"xStock"},{ticker:"TQQQX",name:"3x Nasdaq",price:78.9,change:2.34,route:"/TQQQX",provider:"xStock"},{ticker:"HOODX",name:"Robinhood",price:42.5,change:3.21,route:"/HOODX",provider:"xStock"},{ticker:"TSLAon",name:"Tesla",price:420.5,change:2.28,route:"/TSLAon",provider:"Ondo"},{ticker:"AAPLon",name:"Apple",price:247.9,change:-.78,route:"/AAPLon",provider:"Ondo"},{ticker:"NVDAon",name:"NVIDIA",price:134.45,change:3.15,route:"/NVDAon",provider:"Ondo"},{ticker:"MSFTon",name:"Microsoft",price:446.5,change:.62,route:"/MSFTon",provider:"Ondo"},{ticker:"GOOGLon",name:"Google",price:192.7,change:-.3,route:"/GOOGLon",provider:"Ondo"},{ticker:"METAon",name:"Meta",price:585,change:1.1,route:"/METAon",provider:"Ondo"},{ticker:"JPMon",name:"JPMorgan",price:245.8,change:.45,route:"/JPMon",provider:"Ondo"},{ticker:"WMTon",name:"Walmart",price:92.4,change:.23,route:"/WMTon",provider:"Ondo"},{ticker:"BABAon",name:"Alibaba",price:85.6,change:1.45,route:"/BABAon",provider:"Ondo"},{ticker:"KOon",name:"Coca-Cola",price:62.3,change:-.12,route:"/KOon",provider:"Ondo"},{ticker:"NKEon",name:"Nike",price:78.9,change:.56,route:"/NKEon",provider:"Ondo"},{ticker:"MCDon",name:"McDonalds",price:295.4,change:.34,route:"/MCDon",provider:"Ondo"},{ticker:"Von",name:"Visa",price:312.5,change:.67,route:"/Von",provider:"Ondo"},{ticker:"MAon",name:"Mastercard",price:528.3,change:.45,route:"/MAon",provider:"Ondo"},{ticker:"DISon",name:"Disney",price:112.4,change:-.89,route:"/DISon",provider:"Ondo"},{ticker:"PFEon",name:"Pfizer",price:25.8,change:-1.23,route:"/PFEon",provider:"Ondo"},{ticker:"JNJon",name:"J&J",price:148.9,change:.12,route:"/JNJon",provider:"Ondo"},{ticker:"XOMon",name:"Exxon",price:105.6,change:.78,route:"/XOMon",provider:"Ondo"},{ticker:"SPYon",name:"S&P 500",price:595,change:.42,route:"/SPYon",provider:"Ondo"},{ticker:"QQQon",name:"Nasdaq",price:525.5,change:.75,route:"/QQQon",provider:"Ondo"},{ticker:"GLDon",name:"Gold",price:242,change:.2,route:"/GLDon",provider:"Ondo"},{ticker:"SLVon",name:"Silver",price:28.5,change:.45,route:"/SLVon",provider:"Ondo"},{ticker:"TLTon",name:"Treasury",price:92.3,change:-.15,route:"/TLTon",provider:"Ondo"},{ticker:"USDYon",name:"USDY Yield",price:1.05,change:.02,route:"/USDYon",provider:"Ondo"}],Cz=[{icon:Et,label:"Trade",href:"/trade"},{icon:Ge,label:"Agents",href:"/agents"},{icon:ki,label:"Leaderboard",href:"/leaderboard"},{icon:_p,label:"Learn",href:"/learn"},{icon:qs,label:"Pro Agents",href:"/pro-agents"}];function _z(){return i.jsxs("div",{className:"p-1.5 md:p-2 bg-[hsl(222,55%,4%)] border border-border/30 rounded space-y-2",children:[i.jsx("div",{className:"flex flex-wrap justify-center gap-1.5",children:Cz.map(({icon:e,label:t,href:n})=>i.jsx(Ie,{to:n,children:i.jsxs(Ee,{variant:"outline",size:"sm",className:"h-6 md:h-7 text-[9px] md:text-[10px] px-2 md:px-3 gap-1 bg-card/50 border-border/40 hover:border-primary/50 hover:bg-primary/10",children:[i.jsx(e,{className:"w-3 h-3"}),t]})},n))}),i.jsx("div",{className:"grid grid-cols-6 md:grid-cols-8 lg:grid-cols-12 gap-0.5 md:gap-1",children:Nz.map(e=>i.jsxs(Ie,{to:e.route,className:D("flex flex-col items-center justify-center gap-0.5","px-0.5 py-1 md:px-1.5 md:py-1.5 rounded border transition-all","bg-card/50 border-border/40 hover:border-primary/50 hover:bg-primary/10","active:scale-95",e.provider==="Ondo"&&"border-violet-500/30 hover:border-violet-500/60"),
541children:[i.jsx("span",{className:"text-[7px] md:text-[9px] font-mono font-semibold text-foreground truncate max-w-full",children:e.ticker}),i.jsxs("span",{className:D("text-[6px] md:text-[8px] font-mono",e.change>=0?"text-emerald-400":"text-red-400"),children:[e.change>=0?"+":"",e.change.toFixed(2),"%"]})]},e.ticker))})]})}var ju="Dialog",[jT,hB]=qt(ju),[jz,Rn]=jT(ju),PT=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=f.useRef(null),c=f.useRef(null),[d,u]=qn({prop:r,defaultProp:s??!1,onChange:o,caller:ju});return i.jsx(jz,{scope:t,triggerRef:l,contentRef:c,contentId:ur(),titleId:ur(),descriptionId:ur(),open:d,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(h=>!h),[u]),modal:a,children:n})};PT.displayName=ju;var RT="DialogTrigger",OT=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Rn(RT,n),o=me(t,s.triggerRef);return i.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":vg(s.open),...r,ref:o,onClick:Z(e.onClick,s.onOpenToggle)})});OT.displayName=RT;var pg="DialogPortal",[Pz,IT]=jT(pg,{forceMount:void 0}),MT=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Rn(pg,t);return i.jsx(Pz,{scope:t,forceMount:n,children:f.Children.map(r,a=>i.jsx(cn,{present:n||o.open,children:i.jsx(tu,{asChild:!0,container:s,children:a})}))})};MT.displayName=pg;var Od="DialogOverlay",LT=f.forwardRef((e,t)=>{const n=IT(Od,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Rn(Od,e.__scopeDialog);return o.modal?i.jsx(cn,{present:r||o.open,children:i.jsx(Oz,{...s,ref:t})}):null});LT.displayName=Od;var Rz=fi("DialogOverlay.RemoveScroll"),Oz=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Rn(Od,n);return i.jsx(sg,{as:Rz,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(ie.div,{"data-state":vg(s.open
vendor: 4,162 bytes, lines 541-545
541),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),no="DialogContent",DT=f.forwardRef((e,t)=>{const n=IT(no,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Rn(no,e.__scopeDialog);return i.jsx(cn,{present:r||o.open,children:o.modal?i.jsx(Iz,{...s,ref:t}):i.jsx(Mz,{...s,ref:t})})});DT.displayName=no;var Iz=f.forwardRef((e,t)=>{const n=Rn(no,e.__scopeDialog),r=f.useRef(null),s=me(t,n.contentRef,r);return f.useEffect(()=>{const o=r.current;if(o)return GS(o)},[]),i.jsx(zT,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&o.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,o=>o.preventDefault())})}),Mz=f.forwardRef((e,t)=>{const n=Rn(no,e.__scopeDialog),r=f.useRef(!1),s=f.useRef(!1);return i.jsx(zT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),zT=f.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,l=Rn(no,n),c=f.useRef(null),d=me(t,c);return HS(),i.jsxs(i.Fragment,{children:[i.jsx(rg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx(gl,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":vg(l.open),...a,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(Lz,{titleId:l.titleId}),i.jsx(zz,{contentRef:c,descriptionId:l.descriptionId})]})]})}),gg="DialogTitle",$T=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Rn(gg,n);return i.jsx(ie.h2,{id:s.titleId,...r,ref:t})});$T.displayName=gg;var FT="DialogDescription",BT=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Rn(FT,n);return i.jsx(ie.p,{id:s.descriptionId,...r,ref:t})});BT.displayName=FT;var UT="DialogClose",VT=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Rn(UT,n);return i.jsx(ie.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>s.onOpenChange(!1))})});VT.displayName=UT;function vg(e){return e?"open":"closed"}var HT="DialogTitleWarning",[fB,XT]=vN(HT,{contentName:no,titleName:gg,docsSlug:"dialog"}),Lz=({titleId:e})=>{const t=XT(HT),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 542 543If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 544 545For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Dz="DialogDescriptionWarning",zz=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${XT(Dz).contentName}}.`;return f.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},$z=PT,Fz=OT,Bz=MT,qT=LT,GT=DT,WT=$T,KT=BT,YT=VT;const Em=$z,mB=Fz,Uz=Bz,pB=YT,QT=f.forwardRef(({className:e,...t},n)=>i.jsx(qT,{ref:n,className:D("fixed inset-0 z-[200] bg-black",e),style:{backgroundColor:"rgba(0,0,0,0.95)"},...t}));QT.displayName=qT.displayName;const Id=f.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(Uz,{children:[i.jsx(QT,{}),i.jsxs(GT,{ref:r,className:D("fixed z-[201] grid w-[90vw] max-w-lg gap-4 border border-border p-6 shadow-2xl rounded-lg",e),style:{backgroundColor:"#0a1214",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},...n,children:[t,i.jsxs(YT,{className:"absolute right-4 top-4 roun
545ded-sm opacity-70 ring-offset-background text-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(Dp,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Id.displayName=GT.displayName;const Md=({className:e,...t})=>i.jsx("div",{className:D("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Md.displayName="DialogHeader";const Vz=({className:e,...t})=>i.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Vz.displayName="DialogFooter";const Ld=f.forwardRef(({className:e,...t},n)=>i.jsx(WT,{ref:n,className:D("text-lg font-semibold leading-none tracking-tight text-foreground",e),...t}));Ld.displayName=WT.displayName;const Hz=f.forwardRef(({className:e,...t},n)=>i.jsx(KT,{ref:n,className:D("text-sm text-muted-foreground",e),...t}));Hz.displayName=KT.displayName;var Pu="Checkbox",[Xz,gB]=qt(Pu),[qz,yg]=Xz(Pu);function Gz(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:a,name:l,onCheckedChange:c,required:d,value:u="on",internal_do_not_use_render:h}=e,[p,m]=qn({prop:n,defaultProp:s??!1,onChange:c,caller:Pu}),[x,g]=f.useState(null),[w,v]=f.useState(null),y=f.useRef(!1),b=x?!!a||!!x.closest("form"):!0,k={checked:p,disabled:o,setChecked:m,control:x,setControl:g,name:l,form:a,value:u,hasConsumerStoppedPropagationRef:y,required:d,defaultChecked:ds(s)?!1:s,isFormControl:b,bubbleInput:w,setBubbleInput:v};return i.jsx(qz,{scope:t,...k,children:Wz(h)?h(k):r})}var JT="CheckboxTrigger",ZT=f.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:a,disabled:l,checked:c,required:d,setControl:u,setChecked:h,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:x}=yg(JT,e),g=me(s,u),w=f.useRef(c);return f.useEffect(()=>{const v=o==null?void 0:o.form;if(v){const y=()=>h(w.current);return v.addEventListener("reset",y),()=>v.removeEventListener("reset",y)}},[o,h]),i.jsx(ie.button,{type:"button",role:"checkbox","aria-checked":ds(c)?"mixed":c,"aria-required":d,"data-state":sA(c),"data-disabled":l?"":void 0,disabled:l,value:a,...r,ref:g,onKeyDown:Z(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:Z(n,v=>{h(y=>ds(y)?!0:!y),x&&m&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})})});ZT.displayName=JT;var xg=f.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:a,disabled:l,value:c,onCheckedChange:d,form:u,...h}=e;return i.jsx(Gz,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:l,required:a,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:p})=>i.jsxs(i.Fragment,{children:[i.jsx(ZT,{...h,ref:t,__scopeCheckbox:n}),p&&i.jsx(rA,{__scopeCheckbox:n})]})})});xg.displayName=Pu;var eA="CheckboxIndicator",tA=f.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=yg(eA,n);return i.jsx(cn,{present:r||ds(o.checked)||o.checked===!0,children:i.jsx(ie.span,{"data-state":sA(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});tA.displayName=eA;var nA="CheckboxBubbleInput",rA=f.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:a,required:l,disabled:c,name:d,value:u,form:h,bubbleInput:p,setBubbleInput:m}=yg(nA,e),x=me(n,m),g=wu(o),w=cu(r);f.useEffect(()=>{const y=p;if(!y)return;const b=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(b,"checked").set,T=!s.current;if(g!==o&&S){const E=new Event("click",{bubbles:T});y.indeterminate=ds(o),S.call(y,ds(o)?!1:o),y.dispatchEvent(E)}},[p,g,o,s]);const v=f.useRef(ds(o)?!1:o);return i.jsx(ie.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??v.current,required:l,disabled:c,name:d,value:u,form:h,...t,tabIndex:-1,ref:x,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});rA.displayName=nA;function Wz(e){return typeof e=="function"}function ds(e){return e==="indeterminate"}function sA(e){return ds(e)?"indeterminate":e?"checked":"unchecked"}const $r=f.forwardRef(({className:e,...t},n)=>i.jsx(xg,{ref:n,className:D("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-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),...t,children:i.jsx(tA,{className:D("flex items-center justify-center text-current"),children:i.jsx(jp,{className:"h-4 w-4"})})}));
545$r.displayName=xg.displayName;var Kz="Label",oA=f.forwardRef((e,t)=>i.jsx(ie.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));oA.displayName=Kz;var iA=oA;const Yz=su("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),De=f.forwardRef(({className:e,...t},n)=>i.jsx(iA,{ref:n,className:D(Yz(),e),...t}));De.displayName=iA.displayName;var aA=["PageUp","PageDown"],lA=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],cA={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ii="Slider",[Nm,Qz,Jz]=eu(Ii),[dA,vB]=qt(Ii,[Jz]),[Zz,Ru]=dA(Ii),uA=f.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:o=1,orientation:a="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[r],value:u,onValueChange:h=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:x,...g}=e,w=f.useRef(new Set),v=f.useRef(0),b=a==="horizontal"?e$:t$,[k=[],S]=qn({prop:u,defaultProp:d,onChange:F=>{var V;(V=[...w.current][v.current])==null||V.focus(),h(F)}}),T=f.useRef(k);function E(F){const U=i$(k,F);R(F,U)}function j(F){R(F,v.current)}function N(){const F=T.current[v.current];k[v.current]!==F&&p(k)}function R(F,U,{commit:V}={commit:!1}){const $=d$(o),M=u$(Math.round((F-r)/o)*o+r,$),L=il(M,[r,s]);S((B=[])=>{const _=s$(B,L,U);if(c$(_,c*o)){v.current=_.indexOf(L);const P=String(_)!==String(B);return P&&V&&p(_),P?_:B}else return B})}return i.jsx(Zz,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:s,valueIndexToChangeRef:v,thumbs:w.current,values:k,orientation:a,form:x,children:i.jsx(Nm.Provider,{scope:e.__scopeSlider,children:i.jsx(Nm.Slot,{scope:e.__scopeSlider,children:i.jsx(b,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:Z(g.onPointerDown,()=>{l||(T.current=k)}),min:r,max:s,inverted:m,onSlideStart:l?void 0:E,onSlideMove:l?void 0:j,onSlideEnd:l?void 0:N,onHomeKeyDown:()=>!l&&R(r,0,{commit:!0}),onEndKeyDown:()=>!l&&R(s,k.length-1,{commit:!0}),onStepKeyDown:({event:F,direction:U})=>{if(!l){const M=aA.includes(F.key)||F.shiftKey&&lA.includes(F.key)?10:1,L=v.current,B=k[L],_=o*M*U;R(B+_,L,{commit:!0})}}})})})})});uA.displayName=Ii;var[hA,fA]=dA(Ii,{startEdge:"left",endEdge:"right",size:"width",direction:1}),e$=f.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:o,onSlideStart:a,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...u}=e,[h,p]=f.useState(null),m=me(t,b=>p(b)),x=f.useRef(void 0),g=wl(s),w=g==="ltr",v=w&&!o||!w&&o;function y(b){const k=x.current||h.getBoundingClientRect(),S=[0,k.width],E=bg(S,v?[n,r]:[r,n]);return x.current=k,E(b-k.left)}return i.jsx(hA,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:i.jsx(mA,{dir:g,"data-orientation":"horizontal",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const k=y(b.clientX);a==null||a(k)},onSlideMove:b=>{const k=y(b.clientX);l==null||l(k)},onSlideEnd:()=>{x.current=void 0,c==null||c()},onStepKeyDown:b=>{const S=cA[v?"from-left":"from-right"].includes(b.key);d==null||d({event:b,direction:S?-1:1})}})})}),t$=f.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...d}=e,u=f.useRef(null),h=me(t,u),p=f.useRef(void 0),m=!s;function x(g){const w=p.current||u.current.getBoundingClientRect(),v=[0,w.height],b=bg(v,m?[r,n]:[n,r]);return p.current=w,b(g-w.top)}return i.jsx(hA,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:i.jsx(mA,{"data-orientation":"vertical",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const w=x(g.clientY);o==null||o(w)},onSlideMove:g=>{const w=x(g.clientY);a==null||a(w)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:g=>{const v=cA[m?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:v?-1:1})}})})}),mA=f.forwardRef((e,t)=>
545{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:o,onHomeKeyDown:a,onEndKeyDown:l,onStepKeyDown:c,...d}=e,u=Ru(Ii,n);return i.jsx(ie.span,{...d,ref:t,onKeyDown:Z(e.onKeyDown,h=>{h.key==="Home"?(a(h),h.preventDefault()):h.key==="End"?(l(h),h.preventDefault()):aA.concat(lA).includes(h.key)&&(c(h),h.preventDefault())}),onPointerDown:Z(e.onPointerDown,h=>{const p=h.target;p.setPointerCapture(h.pointerId),h.preventDefault(),u.thumbs.has(p)?p.focus():r(h)}),onPointerMove:Z(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:Z(e.onPointerUp,h=>{const p=h.target;p.hasPointerCapture(h.pointerId)&&(p.releasePointerCapture(h.pointerId),o(h))})})}),pA="SliderTrack",gA=f.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Ru(pA,n);return i.jsx(ie.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});gA.displayName=pA;var Cm="SliderRange",vA=f.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Ru(Cm,n),o=fA(Cm,n),a=f.useRef(null),l=me(t,a),c=s.values.length,d=s.values.map(p=>bA(p,s.min,s.max)),u=c>1?Math.min(...d):0,h=100-Math.max(...d);return i.jsx(ie.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:l,style:{...e.style,[o.startEdge]:u+"%",[o.endEdge]:h+"%"}})});vA.displayName=Cm;var _m="SliderThumb",yA=f.forwardRef((e,t)=>{const n=Qz(e.__scopeSlider),[r,s]=f.useState(null),o=me(t,l=>s(l)),a=f.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return i.jsx(n$,{...e,ref:o,index:a})}),n$=f.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...o}=e,a=Ru(_m,n),l=fA(_m,n),[c,d]=f.useState(null),u=me(t,y=>d(y)),h=c?a.form||!!c.closest("form"):!0,p=cu(c),m=a.values[r],x=m===void 0?0:bA(m,a.min,a.max),g=o$(r,a.values.length),w=p==null?void 0:p[l.size],v=w?a$(w,x,l.direction):0;return f.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),i.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${x}% + ${v}px)`},children:[i.jsx(Nm.ItemSlot,{scope:e.__scopeSlider,children:i.jsx(ie.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":a.min,"aria-valuenow":m,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...o,ref:u,style:m===void 0?{display:"none"}:e.style,onFocus:Z(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),h&&i.jsx(xA,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:m},r)]})});yA.displayName=_m;var r$="RadioBubbleInput",xA=f.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=f.useRef(null),o=me(s,r),a=wu(t);return f.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const h=new Event("input",{bubbles:!0});u.call(l,t),l.dispatchEvent(h)}},[a,t]),i.jsx(ie.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});xA.displayName=r$;function s$(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,o)=>s-o)}function bA(e,t,n){const o=100/(n-t)*(e-t);return il(o,[0,100])}function o$(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function i$(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function a$(e,t,n){const r=e/2,o=bg([0,50],[0,r]);return(r-o(t)*n)*n}function l$(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function c$(e,t){if(t>0){const n=l$(e);return Math.min(...n)>=t}return!0}function bg(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 d$(e){return(String(e).split(".")[1]||"").length}function u$(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var wA=uA,h$=gA,f$=vA,m$=yA;const Dd=f.forwardRef(({className:e,...t},n)=>i.jsxs(wA,{ref:n,className:D("relative flex w-full touch-none select-none items-center",e),...t,children:[i.jsx(h$,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:i.jsx(f$,{className:"absolute h-full bg-primary"})}),i.jsx(m$,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Dd.displayName=wA.displayName;
545const kA=[{id:"tsla-momentum",name:"TSLA Momentum Alpha",strategy_type:"momentum"},{id:"aapl-quality",name:"AAPL Quality Growth",strategy_type:"trend_following"},{id:"nvda-surge",name:"NVDA AI Surge",strategy_type:"momentum"},{id:"msft-cloud",name:"MSFT Cloud Compounder",strategy_type:"trend_following"},{id:"amzn-commerce",name:"AMZN E-Commerce Flow",strategy_type:"momentum"},{id:"googl-search",name:"GOOGL Search Dominance",strategy_type:"trend_following"},{id:"meta-social",name:"META Social Alpha",strategy_type:"momentum"},{id:"coin-crypto",name:"COIN Crypto Beta",strategy_type:"volatility"},{id:"amd-chip",name:"AMD Chip Cycle",strategy_type:"mean_reversion"},{id:"mstr-btc",name:"MSTR Bitcoin Proxy",strategy_type:"momentum"}],p$=[{id:"kraken",name:"Kraken",logo:"ð·",connected:!1,apiKey:"",apiSecret:"",testStatus:"idle"},{id:"bybit",name:"Bybit",logo:"ð¡",connected:!1,apiKey:"",apiSecret:"",testStatus:"idle"},{id:"interactive-brokers",name:"Interactive Brokers",logo:"ð´",connected:!1,apiKey:"",apiSecret:"",testStatus:"idle"},{id:"alpaca",name:"Alpaca",logo:"ð¦",connected:!1,apiKey:"",apiSecret:"",testStatus:"idle"},{id:"coinbase",name:"Coinbase",logo:"ðµ",connected:!1,apiKey:"",apiSecret:"",testStatus:"idle"},{id:"okx",name:"OKX",logo:"â«",connected:!1,apiKey:"",apiSecret:"",testStatus:"idle"},{id:"gate-io",name:"Gate.io",logo:"ð¢",connected:!1,apiKey:"",apiSecret:"",testStatus:"idle"},{id:"bitget",name:"Bitget",logo:"ð ",connected:!1,apiKey:"",apiSecret:"",testStatus:"idle"}];function g$({showDemo:e=!0}){const t=Ni(),{demoEnabled:n,setDemoEnabled:r,selectedAgentIds:s,setSelectedAgentIds:o,confidenceThreshold:a,setConfidenceThreshold:l,signalRateLimit:c,setSignalRateLimit:d,demoPnL:u}=Pi(),[h,p]=f.useState(!1),[m,x]=f.useState(!1),[g,w]=f.useState([]),[v,y]=f.useState(["all"]),[b,k]=f.useState(["all"]),[S,T]=f.useState(75),[E,j]=f.useState(70),[N,R]=f.useState("max"),[F,U]=f.useState("max"),[V,$]=f.useState(p$),[M,L]=f.useState([]),[B,_]=f.useState("agents");f.useEffect(()=>{(async()=>{const{data:K}=await ye.from("custom_agents").select("id, name, strategy_type").eq("is_active",!0);K&&w(K)})()},[]);const P=[...kA,...g],z=(I,K)=>{const oe=K?y:k,ne=K?v:b;if(I==="all"){oe(["all"]);return}const ae=ne.includes(I)?ne.filter(Ne=>Ne!==I):[...ne.filter(Ne=>Ne!=="all"),I];oe(ae.length===0?["all"]:ae)},re=I=>{L(K=>K.includes(I)?K.filter(oe=>oe!==I):[...K,I])},Y=(I,K,oe)=>{$(ne=>ne.map(ae=>ae.id===I?{...ae,[K]:oe}:ae))},se=async I=>{$(oe=>oe.map(ne=>ne.id===I?{...ne,testStatus:"testing"}:ne));const K=V.find(oe=>oe.id===I);if(!(K!=null&&K.apiKey)||!(K!=null&&K.apiSecret)){$(oe=>oe.map(ne=>ne.id===I?{...ne,testStatus:"error",connected:!1}:ne)),ke.error(`${K==null?void 0:K.name} - API credentials required`);return}try{const oe=performance.now(),{data:ne,error:ae}=await ye.functions.invoke("test-exchange-connection",{body:{exchange:I,apiKey:K.apiKey,apiSecret:K.apiSecret}}),Ne=Math.round(performance.now()-oe);if(ae||!(ne!=null&&ne.success)){$(nt=>nt.map(rt=>rt.id===I?{...rt,testStatus:"error",connected:!1}:rt)),ke.error(`${K.name}: ${(ne==null?void 0:ne.message)||(ae==null?void 0:ae.message)||"Connection failed"}`);return}$(nt=>nt.map(rt=>rt.id===I?{...rt,testStatus:"success",connected:!0}:rt)),ke.success(`${K.name} verified (${ne.latencyMs||Ne}ms latency)`)}catch{$(ne=>ne.map(ae=>ae.id===I?{...ae,testStatus:"error",connected:!1}:ae)),ke.error(`${K==null?void 0:K.name} connection failed`)}},ee=async()=>{const I=V.filter(K=>K.apiKey&&K.apiSecret&&M.includes(K.id));if(I.length===0){ke.info("Select and configure at least one exchange");return}ke.info(`Testing ${I.length} exchange(s)...`);for(const K of I)await se(K.id)},de=()=>{const I=V.filter(K=>K.connected&&M.includes(K.id));if(I.length===0){ke.error("Connect at least one exchange to start live trading"),_("exchanges");return}o(v),l(S),d(N),p(!1),t("/trade?mode=live"),ke.success(`Live trading initialized on ${I.length} exchange(s)`)},xe=()=>{o(b),l(E),d(F),r(!0),x(!1),ke.success("Demo trading started")},q=V.filter(I=>I.connected).length;return i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsxs(Ee,{size:"lg",onClick:()=>p(!0),className:D("h-11 md:h-12 text-xs md:text-sm font-black px-6 md:px-10 w-full min-w-[180px] md:min-w-[240px]","bg-gradient-to-r from-emerald-500 via-emerald-400 to-teal-500","text-black hover:from-emerald-400 hover:via-teal-400 hover:to-cyan-400","shadow-lg shadow-emerald-500/40 hover:shadow-emerald-400/60","transform hover:scale-105 transition-all duration-200","border-2 border-emerald-300/50"),children:[i.jsx(Ge,{className:"w-4 h-4 md:w-5 md:h-5 mr-2"}),"LIVE TRADING",q>0&&i.jsxs(le,{className:"ml-2 bg-black/20 text-white text-[10px]",children:[q," Connected"]})]}),i.jsx(Em,{open:h,onOpenChange:p,children:i.jsxs(Id,{className:"max-w-2xl max-h-[90vh] overflow-y-auto bg-[hsl(222,55%,4%)] border-border/50",children:[i.jsx(Md,{children:i.jsxs(Ld,{className:"flex items-center gap-2 text-emerald-400 text-lg",children:[i.jsx(Ge,{className:"w-6 h-6"}),"Live Trading Configuration",i.jsx(le,{className:"ml-auto bg-emerald-500/20 text-emerald-400 text-xs",children:"Ultra-Low Latency"})]})}),i.jsxs(Sl,{value:B,onValueChange:_,className:"w-full",children:[i.jsxs(Oi,{className:"grid w-full grid-cols-3 bg-background/50",children:[i.jsxs(sn,{value:"exchanges",className:"text-xs",children:[i.jsx(kC,{className:"w-3 h-3 mr-1"}),"Exchanges"]}),i.jsxs(sn,{value:"agents",className:"text-xs",children:[i.jsx(rn,{className:"w-3 h-3 mr-1"}),"Agents"]}),i.jsxs(sn,{value:"settings",className:"text-xs",children:[i.jsx(jC,{className:"w-3 h-3 mr-1"}),"Settings"]})]}
545),i.jsxs(ht,{value:"exchanges",className:"space-y-4 mt-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(De,{className:"text-sm font-semibold",children:"Exchange API Configuration"}),i.jsxs(Ee,{size:"sm",variant:"outline",onClick:ee,className:"text-xs h-7",children:[i.jsx(Yv,{className:"w-3 h-3 mr-1"}),"Test All"]})]}),i.jsx("div",{className:"grid gap-3 max-h-[400px] overflow-y-auto pr-2",children:V.map(I=>i.jsxs("div",{className:D("p-3 rounded-lg border transition-all",M.includes(I.id)?"border-emerald-500/50 bg-emerald-500/5":"border-border/30 bg-background/30"),children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx($r,{id:`ex-${I.id}`,checked:M.includes(I.id),onCheckedChange:()=>re(I.id)}),i.jsx("span",{className:"text-lg",children:I.logo}),i.jsx(De,{htmlFor:`ex-${I.id}`,className:"font-semibold cursor-pointer",children:I.name})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[I.testStatus==="testing"&&i.jsx(hd,{className:"w-4 h-4 animate-spin text-amber-400"}),I.testStatus==="success"&&i.jsx(vC,{className:"w-4 h-4 text-emerald-400"}),I.testStatus==="error"&&i.jsx(Ww,{className:"w-4 h-4 text-red-400"}),i.jsx(le,{variant:"outline",className:D("text-[9px]",I.connected?"border-emerald-500/50 text-emerald-400":"border-muted-foreground/30"),children:I.connected?"Connected":"Not Connected"})]})]}),M.includes(I.id)&&i.jsxs("div",{className:"space-y-2 mt-3 pt-3 border-t border-border/20",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{children:[i.jsx(De,{className:"text-[10px] text-muted-foreground",children:"API Key"}),i.jsx(Kr,{type:"password",placeholder:"Enter API Key",value:I.apiKey,onChange:K=>Y(I.id,"apiKey",K.target.value),className:"h-8 text-xs bg-background/50"})]}),i.jsxs("div",{children:[i.jsx(De,{className:"text-[10px] text-muted-foreground",children:"API Secret"}),i.jsx(Kr,{type:"password",placeholder:"Enter API Secret",value:I.apiSecret,onChange:K=>Y(I.id,"apiSecret",K.target.value),className:"h-8 text-xs bg-background/50"})]})]}),i.jsxs(Ee,{size:"sm",variant:"outline",onClick:()=>se(I.id),disabled:I.testStatus==="testing",className:"w-full h-7 text-xs",children:[I.testStatus==="testing"?i.jsx(hd,{className:"w-3 h-3 mr-1 animate-spin"}):i.jsx(Yv,{className:"w-3 h-3 mr-1"}),"Test Connection"]})]})]},I.id))})]}),i.jsxs(ht,{value:"agents",className:"space-y-4 mt-4",children:[i.jsx(De,{className:"text-sm font-semibold",children:"Select Trading Agents"}),i.jsxs("div",{className:"max-h-64 overflow-y-auto space-y-1.5 p-2 bg-background/50 rounded border border-border/30",children:[i.jsxs("div",{className:"flex items-center gap-2 p-1.5 rounded hover:bg-muted/20",children:[i.jsx($r,{id:"live-all",checked:v.includes("all"),onCheckedChange:()=>z("all",!0)}),i.jsx(De,{htmlFor:"live-all",className:"text-sm font-semibold text-emerald-400 cursor-pointer",children:"All Agents"})]}),P.map(I=>i.jsxs("div",{className:"flex items-center gap-2 p-1.5 rounded hover:bg-muted/20",children:[i.jsx($r,{id:`live-${I.id}`,checked:v.includes(I.id),onCheckedChange:()=>z(I.id,!0)}),i.jsx(De,{htmlFor:`live-${I.id}`,className:"text-xs cursor-pointer flex-1",children:I.name}),i.jsx(le,{variant:"outline",className:"text-[8px] px-1",children:I.strategy_type})]},I.id))]})]}),i.jsx(ht,{value:"settings",className:"space-y-4 mt-4",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs(De,{className:"text-sm font-semibold",children:["Confidence Threshold: ",S,"%"]}),i.jsx(Dd,{value:[S],onValueChange:([I])=>T(I),min:60,max:95,step:5,className:"[&_[role=slider]]:bg-emerald-500"}),i.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Only execute signals with confidence above this threshold"})]}),i.jsxs("div",{className:"space-y-3 p-3 rounded-lg bg-background/50 border border-border/30",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ff,{className:"w-4 h-4 text-emerald-400"}),i.jsx(De,{className:"text-sm font-semibold",children:"Signal Rate Limit"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(De,{htmlFor:"live-rate-max",className:"text-xs text-muted-foreground",children:"Max"}),i.jsx(vi,{id:"live-rate-max",checked:N==="max",onCheckedChange:I=>R(I?"max":10)})]})]}),N!=="max"&&i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Kr,{type:"number",min:1,max:1e3,value:N,onChange:I=>R(Math.max(1,parseInt(I.target.value)||1)),className:"h-10 w-24 text-center bg-background/50 text-base touch-manipulation",inputMode:"numeric"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"signals per hour"})]}),i.jsx("p",{className:"text-[10px] text-muted-foreground",children:N==="max"?"Execute all qualifying signals (no limit)":`Maximum ${N} signals will be executed per hour`})]}),i.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-lg p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(mi,{className:"w-4 h-4 text-emerald-400"}),i.jsx("span",{className:"text-sm font-semibold text-emerald-400",children:"Execution Features"})]}),i.jsxs("ul",{className:"text-[10px] text-emerald-400/80 space-y-1",children:[i.jsx("li",{children:"⢠Ultra-low latency signal execution (<50ms)"}),i.jsx("li",{children:"⢠Smart order routing across connected exchanges"}),i.jsx("li",{children:"⢠KYB/AML compliance checks on all trades"}),i.jsx("li",{children:"⢠Real-time P&L tracking and risk management"}),i.jsx("li",{children:"⢠Automatic stop-loss and take-profit execution"})]})]}),i.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg p-3",children:[i.jsx(ln,{className:"w-4 h-4 inline mr-2 text-amber-400"}),i.jsxs("span",{className:"text-xs text-amber-400",children:[q," exchange(s) connected ⢠",v.length===1&&v[0]==="all"?P.length:v.length," agent(s) selected"]})]})]})})]}),i.jsxs(Ee,{onClick:de,className:"w-full h-12 bg-gradient-to-r from-emerald-500 to-teal-500 text-black font-bold text-base",children:[i.jsx(Ge,{className:"w-5 h-5 mr-2"}),"Start Live Trading"]})]})}),i.jsx(Em,{open:m,onOpenChange:x,children:i.jsxs(Id,{className:"max-w-md max-h-[90vh] overflow-y-auto bg-[hsl(222,55%,4%)] border-border/50",children:[i.jsx(Md,{children:i.jsxs(Ld,{className:"flex items-center gap-2 text-amber-400",children:[i.jsx(rn,{className:"w-5 h-5"}),"Demo Trading Configuration"]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(De,{className:"text-foreground text-sm",children:"Select Agents (Demo Mode)"}),i.jsxs("div",{className:"max-h-40 overflow-y-auto space-y-1.5 p-2 bg-background/50 rounded border border-border/30 touch-pan-y",children:[i.jsxs("div",{className:"flex items-center gap-2 p-2 rounded hover:bg-muted/20 active:bg-muted/30 min-h-[44px]",children:[i.jsx($r,{id:"demo-all",checked:b.includes("all"),onCheckedChange:()=>z("all",!1),className:"w-5 h-5"}),i.jsx(De,{htmlFor:"demo-all",className:"text-sm font-semibold text-amber-400 cursor-pointer flex-1",children:"All Agents"})]}),P.map(I=>i.jsxs("div",{className:"flex items-center gap-2 p-2 rounded hover:bg-muted/20 active:bg-muted/30 min-h-[44px]",children:[i.jsx($r,{id:`demo-${I.id}`,checked:b.includes(I.id),onCheckedChange:()=>z(I.id,!1),className:"w-5 h-5"}),i.jsx(De,{htmlFor:`demo-${I.id}`,className:"text-xs cursor-pointer flex-1",children:I.name}),i.jsx(le,{variant:"outline",className:"text-[8px] px-1",children:I.strategy_type})]},I.id))]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(De,{className:"text-sm",children:["Confidence Threshold: ",E,"%"]}),i.jsx(Dd,{value:[E],onValueChange:([I])=>j(I),min:50,max:95,step:5,className:"[&_[role=slider]]:bg-amber-500 [&_[role=slider]]:w-6 [&_[role=slider]]:h-6"})]}),i.jsxs("div",{className:"space-y-3 p-3 rounded-lg bg-background/50 border border-border/30",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ff,{className:"w-4 h-4 text-amber-400"}),i.jsx(De,{className:"text-sm font-semibold",children:"Signal Rate Limit"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(De,{htmlFor:"demo-rate-max",className:"text-xs text-muted-foreground",children:"Max"}),i.jsx(vi,{id:"demo-rate-max",checked:F==="max",onCheckedChange:I=>U(I?"max":10)})]})]}),F!=="max"&&i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Kr,{type:"number",min:1,max:1e3,value:F,onChange:I=>U(Math.max(1,parseInt(I.target.value)||1)),className:"h-12 w-28 text-center bg-background/50 text-lg touch-manipulation",inputMode:"numeric"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"signals per hour"})]}),i.jsx("p",{className:"text-[10px] text-muted-foreground",children:F==="max"?"Execute all qualifying signals (no limit)":`Maximum ${F} signals will be executed per hour`})]}),i.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg p-3 text-xs text-amber-400",children:[i.jsx(rn,{className:"w-4 h-4 inline mr-2"}),"Demo mode simulates trading with virtual $10,000. No real money at risk."]}),i.jsxs(Ee,{onClick:xe,className:"w-full h-12 bg-gradient-to-r from-amber-500 to-orange-500 text-black font-bold touch-manipulation",children:[i.jsx(xa,{
545className:"w-4 h-4 mr-2"}),"Start Demo Trading"]})]})]})})]})}function v$(){const{demoEnabled:e,setDemoEnabled:t,setSelectedAgentIds:n,setConfidenceThreshold:r,setSignalRateLimit:s,demoPnL:o}=Pi(),[a,l]=f.useState(!1),[c,d]=f.useState([]),[u,h]=f.useState(["all"]),[p,m]=f.useState(70),[x,g]=f.useState("max");f.useEffect(()=>{(async()=>{const{data:S}=await ye.from("custom_agents").select("id, name, strategy_type").eq("is_active",!0);S&&d(S)})()},[]);const w=[...kA,...c],v=k=>{if(k==="all"){h(["all"]);return}const S=u.includes(k)?u.filter(T=>T!==k):[...u.filter(T=>T!=="all"),k];h(S.length===0?["all"]:S)},y=()=>{n(u),r(p),s(x),t(!0),l(!1),ke.success("Demo trading started")},b=()=>{t(!1),ke.info("Demo trading stopped")};return i.jsxs(i.Fragment,{children:[e?i.jsxs(Ee,{size:"lg",variant:"destructive",onClick:b,className:"h-11 md:h-12 text-xs md:text-sm font-black px-6 md:px-10 min-w-[180px] md:min-w-[240px]",children:[i.jsx(OC,{className:"w-4 h-4 md:w-5 md:h-5 mr-2"}),"STOP DEMO"]}):i.jsxs(Ee,{size:"lg",onClick:()=>l(!0),className:D("h-11 md:h-12 text-xs md:text-sm font-black px-6 md:px-10 min-w-[180px] md:min-w-[240px]","bg-gradient-to-r from-amber-500 via-amber-400 to-yellow-500","text-black hover:from-amber-400 hover:via-yellow-400 hover:to-orange-400","shadow-lg shadow-amber-500/40 hover:shadow-amber-400/60","transform hover:scale-105 transition-all duration-200","border-2 border-amber-300/50"),children:[i.jsx(xa,{className:"w-4 h-4 md:w-5 md:h-5 mr-2"}),"DEMO"]}),i.jsx(Em,{open:a,onOpenChange:l,children:i.jsxs(Id,{className:"max-w-md bg-[hsl(222,55%,4%)] border-border/50",children:[i.jsx(Md,{children:i.jsxs(Ld,{className:"flex items-center gap-2 text-amber-400",children:[i.jsx(xa,{className:"w-5 h-5"}),"Demo Trading Configuration"]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(De,{className:"text-sm font-semibold",children:"Select Agents"}),i.jsxs("div",{className:"max-h-40 overflow-y-auto space-y-1.5 p-2 bg-background/50 rounded border border-border/30 touch-pan-y",children:[i.jsxs("div",{className:"flex items-center gap-2 p-2 rounded hover:bg-muted/20 active:bg-muted/30 min-h-[44px]",children:[i.jsx($r,{id:"demo-btn-all",checked:u.includes("all"),onCheckedChange:()=>v("all"),className:"w-5 h-5"}),i.jsx(De,{htmlFor:"demo-btn-all",className:"text-sm font-semibold text-amber-400 cursor-pointer",children:"All Agents"})]}),w.map(k=>i.jsxs("div",{className:"flex items-center gap-2 p-2 rounded hover:bg-muted/20 active:bg-muted/30 min-h-[44px]",children:[i.jsx($r,{id:`demo-btn-${k.id}`,checked:u.includes(k.id),onCheckedChange:()=>v(k.id),className:"w-5 h-5"}),i.jsx(De,{htmlFor:`demo-btn-${k.id}`,className:"text-xs cursor-pointer flex-1",children:k.name}),i.jsx(le,{variant:"outline",className:"text-[8px] px-1",children:k.strategy_type})]},k.id))]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(De,{className:"text-sm font-semibold",children:["Confidence Threshold: ",p,"%"]}),i.jsx(Dd,{value:[p],onValueChange:([k])=>m(k),min:50,max:95,step:5,className:"[&_[role=slider]]:bg-amber-500 [&_[role=slider]]:w-6 [&_[role=slider]]:h-6"})]}),i.jsxs("div",{className:"space-y-3 p-3 rounded-lg bg-background/50 border border-border/30",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ff,{className:"w-4 h-4 text-amber-400"}),i.jsx(De,{className:"text-sm font-semibold",children:"Signal Rate Limit"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(De,{htmlFor:"demo-btn-rate-max",className:"text-xs text-muted-foreground",children:"Max"}),i.jsx(vi,{id:"demo-btn-rate-max",checked:x==="max",onCheckedChange:k=>g(k?"max":10)})]})]}),x!=="max"&&i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Kr,{type:"number",min:1,max:1e3,value:x,onChange:k=>g(Math.max(1,parseInt(k.target.value)||1)),className:"h-12 w-28 text-center bg-background/50 text-lg touch-manipulation",inputMode:"numeric"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"signals/hour"})]})]}),i.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg p-3 text-xs text-amber-400",children:[i.jsx(rn,{className:"w-4 h-4 inline mr-2"}),"Demo mode simulates trading with virtual $10,000. No real money at risk."]}),i.jsxs(Ee,{onClick:y,className:"w-full h-12 bg-gradient-to-r from-amber-500 to-orange-500 text-black font-bold touch-manipulation",children:[i.jsx(xa,{
545className:"w-4 h-4 mr-2"}),"Start Demo Trading"]})]})]})})]})}function y$(){const{demoEnabled:e,demoPnL:t,demoTrades:n,demoBalance:r}=Pi();if(!e)return null;const s=n.filter(c=>!c.closedAt).length,o=n.filter(c=>c.closedAt),a=o.length>0?Math.round(o.filter(c=>c.netPnL>=0).length/o.length*100):0,l=n.filter(c=>!c.closedAt).reduce((c,d)=>c+d.netPnL,0);return i.jsxs("div",{className:"md:hidden sticky top-[44px] z-40 px-2 py-1.5 bg-[hsl(222,60%,3%)]/95 backdrop-blur-sm border-b border-border/30",children:[i.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[i.jsxs(le,{className:"bg-amber-500/20 text-amber-400 text-[9px] animate-pulse",children:[i.jsx(Ge,{className:"w-2.5 h-2.5 mr-0.5"}),"DEMO ACTIVE"]}),i.jsxs(le,{variant:"outline",className:D("text-[9px] px-4 py-0.5 min-w-[80px] text-center animate-pulse",t>=0?"border-emerald-500/50 text-emerald-400":"border-red-500/50 text-red-400"),children:["P&L: ",t>=0?"+":"",t.toFixed(2)]}),i.jsxs("span",{className:"text-[9px] text-muted-foreground ml-4",children:[s," positions open"]})]}),i.jsxs("div",{className:"grid grid-cols-4 gap-1.5",children:[i.jsxs("div",{className:"bg-card/80 border border-border/40 rounded p-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1 text-[8px] text-muted-foreground mb-0.5",children:[i.jsx(Zw,{className:"w-2.5 h-2.5"}),"Balance"]}),i.jsxs("div",{className:"text-[10px] font-mono font-semibold text-foreground",children:["$",r.toFixed(0)]})]}),i.jsxs("div",{className:"bg-card/80 border border-border/40 rounded p-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1 text-[8px] text-muted-foreground mb-0.5",children:[i.jsx(Ha,{className:"w-2.5 h-2.5"}),"Realized"]}),i.jsxs("div",{className:D("text-[10px] font-mono font-semibold",t>=0?"text-emerald-400":"text-red-400"),children:[t>=0?"+":"",t.toFixed(2)]})]}),i.jsxs("div",{className:"bg-card/80 border border-border/40 rounded p-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1 text-[8px] text-muted-foreground mb-0.5",children:[i.jsx(ln,{className:"w-2.5 h-2.5"}),"Unrealized"]}),i.jsxs("div",{className:D("text-[10px] font-mono font-semibold",l>=0?"text-emerald-400":"text-red-400"),children:[l>=0?"+":"",l.toFixed(2)]})]}),i.jsxs("div",{className:"bg-card/80 border border-border/40 rounded p-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1 text-[8px] text-muted-foreground mb-0.5",children:[i.jsx(ki,{className:"w-2.5 h-2.5"}),"Win Rate"]}),i.jsxs("div",{className:"text-[10px] font-mono font-semibold text-foreground",children:[a,"%"]})]})]})]})}function x$(){return[{symbol:"BTC",quantity:2.5,avgPrice:95e3,currentPrice:104500,pnl:0,pnlPercent:0,allocation:25},{symbol:"ETH",quantity:15,avgPrice:3500,currentPrice:3950,pnl:0,pnlPercent:0,allocation:15},{symbol:"SOL",quantity:100,avgPrice:165,currentPrice:185,pnl:0,pnlPercent:0,allocation:10},{symbol:"NVDA",quantity:50,avgPrice:125,currentPrice:138,pnl:0,pnlPercent:0,allocation:10},{symbol:"AAPL",quantity:100,avgPrice:185,currentPrice:195,pnl:0,pnlPercent:0,allocation:8},{symbol:"SPY",quantity:20,avgPrice:580,currentPrice:598,pnl:0,pnlPercent:0,allocation:8},{symbol:"MSTR",quantity:30,avgPrice:350,currentPrice:395,pnl:0,pnlPercent:0,allocation:6},{symbol:"COIN",quantity:25,avgPrice:260,currentPrice:285,pnl:0,pnlPercent:0,allocation:5},{symbol:"QQQ",quantity:15,avgPrice:505,currentPrice:525,pnl:0,pnlPercent:0,allocation:5},{symbol:"TSLA",quantity:20,avgPrice:400,currentPrice:425,pnl:0,pnlPercent:0,allocation:4},{symbol:"LINK",quantity:200,avgPrice:20,currentPrice:24,pnl:0,pnlPercent:0,allocation:2},{symbol:"ARB",quantity:5e3,avgPrice:.75,currentPrice:.85,pnl:0,pnlPercent:0,allocation:2}].map(t=>({...t,pnl:(t.currentPrice-t.avgPrice)*t.quantity,pnlPercent:(t.currentPrice-t.avgPrice)/t.avgPrice*100}))}function Cr(e,t,n="info"){return{id:Math.random().toString(36).substr(2,9),timestamp:new Date,type:n,agent:e,message:t}}const SA="agentquants_prices_cache",TA="agentquants_prices_backup",AA={BTC:{price:96500,changePercent:1.2,volume:0},ETH:{price:3650,changePercent:.8,volume:0},SOL:{price:235,changePercent:2.1,volume:0},AAPL:{price:232.5,changePercent:.8,volume:0},MSFT:{price:438.2,changePercent:.6,volume:0},NVDA:{price:138.5,changePercent:1.5,volume:0},TSLA:{price:352.8,changePercent:2.1,volume:0},GOOGL:{price:192.8,changePercent:.4,volume:0},AMZN:{price:225.6,changePercent:1.2,volume:0},META:{price:620.3,changePercent:.9,volume:0},SPY:{price:605.5,changePercent:.3,volume:0},QQQ:{price:525.8,changePercent:.5,volume:0},COIN:{price:312.4,changePercent:3.2,volume:0},AMD:{price:125.6,changePercent:1.4,volume:0},AAPLX:{price:232.5,changePercent:.8,volume:0},MSFTX:{price:438.2,changePercent:.6,volume:0},NVDAX:{price:138.5,changePercent:1.5,volume:0},TSLAX:{price:352.8,changePercent:2.1,volume:0},GOOGLX:{price:192.8,changePercent:.4,volume:0},METAX:{price:620.3,changePercent:.9,volume:0},COINX:{price:312.4,changePercent:3.2,volume:0},AMDX:{price:125.6,changePercent:1.4,volume:0},SPYX:{price:605.5,changePercent:.3,volume:0},QQQX:{price:525.8,changePercent:.5,volume:0}};function b$(){try{const e=localStorage.getItem(SA);if(e){const n=JSON.parse(e);if(n.timestamp&&Date.now()-n.timestamp<36e5&&Object.keys(n.prices||{}).length>0)return n}const t=localStorage.getItem(TA);if(t){const n=JSON.parse(t);if(n.prices&&Object.keys(n.prices).length>0)return n}}catch{}return null}async function F0(){try{const{data:e}=await ye.from("state_snapshots").select("data, created_at").eq("snapshot_type","prices").eq("snapshot_key","live_prices").single();if(e!=null&&e.data&&typeof e.data=="object"&&e.data!==null){const t=e.data;if(t.prices)return{prices:t.prices,timestamp:e.created_at}}}catch(e){console.warn("Cloud snapshot fetch failed:",e)}return null}function w$(e){try{const t={prices:e,timestamp:Date.now()};localStorage.setItem(SA,JSON.stringify(t)),Object.keys(e).length>20&&localStorage.setItem(TA,JSON.stringify(t))}catch{}}function mc(e,t){return mg.map(r=>r.symbol).map(r=>{const s=e[r]||AA[r];return!s||s.price<=0?null:{symbol:r,price:s.price,change:s.price*(s.changePercent/100),changePercent:s.changePercent,volume:s.volume||0,timestamp:t}}).filter(r=>r!==null&&r.price>0)}function k$(){var S;const e=f.useRef(b$()),t=((S=e.current)==null?void 0:S.prices)||{...AA},n=f.useRef(mc(t,new Date)),[r,s]=f.useState(n.current),[o,a]=f.useState({}),[l,c]=f.useState(n.current.length===0),[d,u]=f.useState(null),[h,p]=f.useState(e.current?"cache":"fallback"),[m,x]=f.useState(e.current?new Date(e.current.timestamp):null),g=f.useRef(t),w=f.useRef(!0),v=f.useRef(!1),y=f.useRef(0),b=f.useRef(0);f.useEffect(()=>{e.current||F0().then(T=>{if(T&&w.current){g.current=T.prices;const E=mc(T.prices,new Date(T.timestamp));E.length>0&&(s(E),p("snapshot"),x(new Date(T.timestamp)),c(!1))}})},[]);const k=f.useCallback(async()=>
545{if(v.current)return;const T=Date.now();if(!(T-y.current<1e4)){v.current=!0,y.current=T;try{const{data:E,error:j}=await ye.functions.invoke("live-prices");if(!w.current)return;if(j)throw new Error(j.message);const N=E,R={...g.current};for(const[U,V]of Object.entries(N.prices))V&&V.price>0&&(R[U]={price:V.price,changePercent:V.changePercent||0,volume:V.volume||0,source:V.source});g.current=R,w$(R);const F=mc(R,new Date(N.timestamp));F.length>0&&(s(F),c(!1),p(N.stale?"cache":N.error?"snapshot":"live"),x(new Date),u(null),b.current=0,a(U=>{const V={...U},$=new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});for(const M of F){V[M.symbol]||(V[M.symbol]=[]);const L=V[M.symbol],B=L[L.length-1];(!B||B.price!==M.price)&&(V[M.symbol]=[...L.slice(-29),{time:$,price:M.price}])}return V}))}catch(E){if(console.error("Failed to fetch live prices:",E),w.current){if(u(E instanceof Error?E.message:"Failed to fetch prices"),b.current<3){b.current++;const j=await F0();if(j&&w.current){g.current={...g.current,...j.prices};const N=mc(g.current,new Date);N.length>0&&(s(N),p("snapshot"),x(new Date(j.timestamp)))}}h==="live"&&p("cache")}}finally{v.current=!1}}},[h]);return f.useEffect(()=>{w.current=!0,k();const T=setInterval(k,15e3);return()=>{w.current=!1,clearInterval(T)}},[k]),{marketTicks:r,priceHistory:o,isLoading:l,error:d,dataSource:h,lastUpdated:m,refetch:k}}async function Kt(e,t,n=2){for(let r=0;r<=n;r++)try{const s=await ye.functions.invoke("agent-analyze",{body:{agentType:e,marketData:t}});if(s.error){if(r<n){await new Promise(o=>setTimeout(o,1e3));continue}return{error:s.error}}return s}catch(s){if(r<n){await new Promise(o=>setTimeout(o,1e3));continue}return{error:s}}return{error:"Max retries exceeded"}}function S$(){const[e,t]=f.useState({quantsOutput:null,sentimentOutput:null,decisionOutput:null,reflectionOutput:null,infraOutput:null,devsOutput:null,economicOutput:null,crossAssetOutput:null,microstructureOutput:null,forensicOutput:null,supplyChainOutput:null,altDataOutput:null,isAnalyzing:!1,error:null}),n=f.useCallback(async r=>{t(a=>({...a,isAnalyzing:!0,error:null}));const s={prices:r.slice(0,5).map(a=>({symbol:a.symbol,price:a.price,change24h:a.changePercent,volume:a.volume})),timestamp:new Date().toISOString()},o=(a,l,c)=>a.error||!a.data?(console.error(`${l} error:`,a.error),null):{agentId:c,agentName:l,timestamp:new Date,...a.data};try{const[a,l,c]=await Promise.all([Kt("quants",s),Kt("sentiment",s),Kt("economic",s)]);t(k=>({...k,quantsOutput:o(a,"Quants Agent","quants-001"),sentimentOutput:o(l,"Sentiment Agent","sentiment-001"),economicOutput:o(c,"Economic Agent","economic-001")})),await new Promise(k=>setTimeout(k,400));const[d,u,h]=await Promise.all([Kt("decision",s),Kt("reflection",s),Kt("cross_asset",s)]);t(k=>({...k,decisionOutput:o(d,"Decision Agent","decision-001"),reflectionOutput:o(u,"Reflection Agent","reflection-001"),crossAssetOutput:o(h,"Cross Asset Agent","cross_asset-001")})),await new Promise(k=>setTimeout(k,400));const[p,m,x]=await Promise.all([Kt("infra",s),Kt("devs",s),Kt("microstructure",s)]);t(k=>({...k,infraOutput:o(p,"Infra Agent","infra-001"),devsOutput:o(m,"Devs Agent","devs-001"),microstructureOutput:o(x,"Microstructure Agent","microstructure-001")})),await new Promise(k=>setTimeout(k,400));const[g,w,v]=await Promise.all([Kt("forensic",s),Kt("supply_chain",s),Kt("alt_data",s)]);t(k=>({...k,forensicOutput:o(g,"Forensic Agent","forensic-001"),supplyChainOutput:o(w,"Supply Chain Agent","supply_chain-001"),altDataOutput:o(v,"Alt Data Agent","alt_data-001"),isAnalyzing:!1})),d.data&&!d.error&&ye.from("agent_decisions").insert({agent_type:"decision",signal:d.data.signal||"neutral",confidence:d.data.confidence||0,reasoning:d.data.reasoning||"",metadata:d.data}).then(({error:k})=>{k&&console.error("Failed to store decision:",k)});const b=[{res:a,name:"Quants",id:"QUANT"},{res:l,name:"Sentmnt",id:"SENT"},{res:d,name:"Decide",id:"DECIDE"},{res:u,name:"Reflect",id:"REFLECT"},{res:p,name:"Infra",id:"INFRA"},{res:m,name:"DevInt",id:"DEVS"},{res:c,name:"Econ",id:"ECON"},{res:h,name:"Cross",id:"CROSS"},{res:x,name:"Micro",id:"MICRO"},{res:g,name:"Forens",id:"FORENS"},{res:w,name:"Supply",id:"SUPPLY"},{res:v,name:"AltDat",id:"ALTDAT"}].filter(({res:k})=>k.data&&!k.error&&!k.data._fallback).map(({res:k,name:S,id:T},E)=>({agent_id:T,agent_name:S,message:k.data.reasoning||k.data.rationale||k.data.marketState||"Analysis complete",signal:(k.data.signal||k.data.direction||"neutral").toLowerCase(),confidence:k.data.confidence||k.data.convictionScore||60,timestamp_ms:Date.now()+E*50}));b.length>0&&ye.from("agent_chat").insert(b).then(({error:k})=>{k&&console.error("Failed to store agent signals to tape:",k)})}catch(a){console.error("Agent analysis failed:",a),t(l=>({...l,isAnalyzing:!1,error:a instanceof Error?a.message:"Analysis failed"}))}},[]);return{...e,runAgentAnalysis:n}}function T$(){const[e,t]=f.useState([]),[n,r]=f.useState(!1),s=f.useCallback(async(a,l)=>{const c={id:crypto.randomUUID(),role:"user",content:a,timestamp:new Date};t(d=>[...d,c]),r(!0);try{await ye.from("console_messages").insert({role:"user",content:a});const{data:d,error:u}=await ye.functions.invoke("console-chat",{body:{message:a,context:l}});if(u)throw new Error(u.message);const h={id:crypto.randomUUID(),role:"assistant",content:d.response||"No response received",timestamp:new Date};t(p=>[...p,h]),await ye.from("console_messages").insert({role:"assistant",content:h.content})}catch(d){console.error("Console chat error:",d);const u={id:crypto.randomUUID(),role:"assistant",content:`Error: ${d instanceof Error?d.message:"Failed to get response"}`,timestamp:new Date};t(h=>[...h,u])}finally{r(!1)}},[]),o=f.useCallback(()=>{t([])},[]);return{messages:e,isLoading:n,sendMessage:s,clearMessages:o}}const EA="agentquants_chat_cache";function A$(){try{const e=localStorage.getItem(EA);if(e){const t=JSON.parse(e);if(Array.isArray(t)&&t.length>0)return t}}catch{}return[]}function B0(e){try{localStorage.setItem(EA,JSON.stringify(e.slice(-50)))}catch{}}function E$(){const[e,t]=f.useState(()=>A$()),[n,r]=f.useState(!1),s=f.useRef(0);f.useEffect(()=>{(async()=>{const{data:c,error:d}=await ye.from("agent_chat").select("*").order("timestamp_ms",{ascending:!1}).limit(100);if(!d&&c){const u=c.reverse();t(u),B0(u)}})()},[]),f.useEffect(()=>{const l=ye.channel("agent-chat-realtime").on("postgres_changes",{event:"INSERT",schema:"public",table:"agent_chat"},c=>{const d=c.new;t(u=>{const h=[...u.slice(-149),d];
545return B0(h),h})}).subscribe();return()=>{ye.removeChannel(l)}},[]);const o=f.useCallback(async l=>{r(!0);try{await ye.functions.invoke("agent-chat",{body:{marketData:l}})}catch(c){console.error("Agent chat error:",c)}finally{r(!1)}},[]),a=f.useCallback(async(l=6,c)=>{const d=Date.now();if(d-s.current<45e3){console.log("Asset intelligence rate limited, skipping...");return}s.current=d;try{const u=await ye.functions.invoke("asset-intelligence-tape",{body:{batchSize:l,specificAssets:c}});return console.log("Asset intelligence result:",u.data),u.data}catch(u){console.error("Asset intelligence error:",u)}},[]);return f.useEffect(()=>{const l=setTimeout(()=>{a(6)},5e3),c=setInterval(()=>{a(6)},6e4);return()=>{clearTimeout(l),clearInterval(c)}},[a]),{messages:e,isLoading:n,triggerChat:o,triggerAssetIntelligence:a}}function N$(){const{marketTicks:e,priceHistory:t,isLoading:n,refetch:r}=k$(),{quantsOutput:s,sentimentOutput:o,decisionOutput:a,reflectionOutput:l,infraOutput:c,devsOutput:d,economicOutput:u,crossAssetOutput:h,microstructureOutput:p,forensicOutput:m,supplyChainOutput:x,altDataOutput:g,isAnalyzing:w,runAgentAnalysis:v}=S$(),{messages:y,isLoading:b,sendMessage:k}=T$(),{messages:S,isLoading:T,triggerChat:E}=E$(),[j,N]=f.useState(()=>x$()),[R,F]=f.useState({status:"operational",agents:{quants:!0,sentiment:!0,decision:!0,reflection:!0}
545,lastUpdate:new Date,latencyMs:42}),[U,V]=f.useState(()=>[Cr("System","AgentQuants initialized with Lovable Cloud","success"),Cr("Market","Connected to live data feeds","info")]),[$,M]=f.useState("live"),L=f.useRef(0);f.useEffect(()=>{e.length>0&&F(P=>({...P,lastUpdate:new Date,latencyMs:Math.floor(Math.random()*30)+25}))},[e]),f.useEffect(()=>{if(e.length===0||w)return;const P=Date.now();P-L.current<3e4||(L.current=P,v(e),V(z=>[Cr("AI","Running agent analysis cycle...","info"),...z].slice(0,30)))},[e,w,v]),f.useEffect(()=>{s&&V(P=>{var z;return[Cr("Quants",`AI Signal: ${s.signal} (${((z=s.confidence)==null?void 0:z.toFixed(0))||0}%)`,s.signal==="bullish"?"success":s.signal==="bearish"?"warning":"info"),...P].slice(0,50)})},[s]),f.useEffect(()=>{o&&V(P=>{var z;return[Cr("Sentiment",`AI Score: ${((z=o.sentimentScore)==null?void 0:z.toFixed(2))||0}`,"info"),...P].slice(0,50)})},[o]),f.useEffect(()=>{if(a&&(V(P=>{var z;return[Cr("Decision",`AI: ${((z=a.action)==null?void 0:z.toUpperCase())||"HOLD"} ${a.symbol||"N/A"}`,a.action==="buy"?"success":a.action==="sell"?"warning":"info"),...P].slice(0,50)}),e.length>0)){const P={prices:e.slice(0,5).map(z=>({symbol:z.symbol,price:z.price,change24h:z.changePercent})),timestamp:new Date().toISOString()};E(P)}},[a,e,E]);const B=f.useCallback(P=>{M(P),V(z=>[Cr("System",`Mode changed to ${P}`,"info"),...z].slice(0,50))},[]),_=f.useCallback(async P=>{await k(P,{marketTicks:e,quantsOutput:s,sentimentOutput:o,decisionOutput:a,reflectionOutput:l,infraOutput:c,devsOutput:d,economicOutput:u,crossAssetOutput:h,microstructureOutput:p,forensicOutput:m,supplyChainOutput:x,altDataOutput:g,portfolio:j,systemStatus:R,mode:$}),V(re=>[Cr("Console",`AI Query: "${P.slice(0,30)}..."`,"info"),...re].slice(0,50))},[e,s,o,a,l,c,d,u,h,p,m,x,g,j,R,$,k]);return{marketTicks:e,priceHistory:t,quantsOutput:s,sentimentOutput:o,decisionOutput:a,reflectionOutput:l,infraOutput:c,devsOutput:d,economicOutput:u,crossAssetOutput:h,microstructureOutput:p,forensicOutput:m,supplyChainOutput:x,altDataOutput:g,portfolio:j,systemStatus:R,consoleMessages:y,agentChatMessages:S,eventLogs:U,mode:$,isConsoleLoading:b,isAnalyzing:w,isChatLoading:T,pricesLoading:n,setMode:B,sendConsoleMessage:_,refetchPrices:r,runAgentAnalysis:()=>v(e)}}function C$(){const{isConnected:e}=bu(),{agentChatMessages:t,isChatLoading:n}=N$(),{demoEnabled:r,demoTrades:s,resetDemo:o,demoPnL:a}=Pi(),[l,c]=f.useState(0),[d,u]=f.useState("TSLAX"),[h,p]=f.useState("trading"),[m,x]=f.useState("TSLA");return f.useEffect(()=>{(async()=>{const{count:v}=await ye.from("agent_chat").select("*",{count:"exact",head:!0});c(v||0)})();const w=ye.channel("signal-counter").on("postgres_changes",{event:"INSERT",schema:"public",table:"agent_chat"},()=>{c(v=>v+1)}).subscribe();return()=>{ye.removeChannel(w)}},[]),i.jsxs("div",{className:"min-h-screen min-h-dvh bg-background flex flex-col pb-16 md:pb-0",children:[i.jsx(EL,{isConnected:e,signalCount:l,tradeCount:s.length,activeView:h,onViewChange:p}),i.jsx(_L,{}),i.jsx(y$,{}),i.jsxs("div",{className:"flex-1 p-1 md:p-1.5 flex flex-col gap-1 md:gap-1.5 overflow-hidden",children:[i.jsxs("div",{className:"flex flex-col items-center gap-1 md:gap-2 px-2 md:px-3 py-1 md:py-1.5 bg-card/60 border border-border/30 rounded backdrop-blur-sm",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2 w-full",children:[i.jsx(v$,{}),r&&i.jsx(Ee,{size:"sm",variant:"outline",className:"h-5 md:h-6 text-[9px] md:text-xs px-1 md:px-1.5",onClick:o,children:i.jsx(Ip,{className:"w-2.5 h-2.5 md:w-3 md:h-3"})}),i.jsx(g$,{})]}),i.jsx("div",{className:"hidden md:flex w-full justify-start",children:i.jsx(R0,{compact:!0})})]}),i.jsx(_z,{}),h==="trading"?i.jsxs("div",{className:"flex-1 flex flex-col lg:grid lg:grid-cols-12 gap-1.5 min-h-0 overflow-y-auto lg:overflow-hidden",children:[i.jsxs("div",{className:"lg:col-span-2 flex flex-col gap-1.5 order-2 lg:order-1",children:[i.jsx(RL,{}),i.jsx(l3,{}),i.jsx(d3,{})]}),i.jsxs("div",{className:"lg:col-span-7 flex flex-col gap-1.5 order-1 lg:order-2",children:[i.jsx(kz,{selectedSymbol:d,onSymbolSelect:u,onTradeSignal:(g,w,v)=>{ke.success(`${w} signal for ${g} @ $${v.toFixed(2)}`)}}),i.jsx("div",{className:"min-h-[200px] lg:flex-1",children:i.jsx(Ez,{messages:t,isLoading:n})})]}),i.jsx("div",{className:"lg:col-span-3 order-3",children:i.jsx(ED,{})})]}):h==="platform"?i.jsxs("div",{className:"flex-1 flex flex-col lg:grid lg:grid-cols-12 gap-1.5 min-h-0 overflow-y-auto lg:overflow-hidden",children:[i.jsxs("div",{className:"lg:col-span-3 flex flex-col gap-1.5",children:[i.jsx(G3,{}),i.jsx(Y3,{})]}),i.jsxs("div",{className:"lg:col-span-6 flex flex-col gap-1.5",children:[i.jsx(W3,{}),i.jsx(V3,{})]}),i.jsxs("div",{className:"lg:col-span-3 flex flex-col gap-1.5",children:[i.jsx(b3,{}),i.jsx(S3,{}),i.jsx(B3,{})]})]}):i.jsxs("div",{className:"flex-1 flex flex-col gap-1.5 min-h-0 overflow-y-auto",children:[i.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-card/60 border border-border/30 rounded overflow-x-auto scrollbar-hide backdrop-blur-sm",children:[i.jsx("span",{className:"text-[9px] md:text-[10px] text-muted-foreground whitespace-nowrap",children:"SELECT STOCK:"}),jd.map(g=>i.jsx(Ee,{size:"sm",variant:"ghost",className:D("h-5 md:h-6 text-[9px] md:text-[10px] px-1.5 md:px-2 font-mono whitespace-nowrap",m===g.ticker&&"bg-primary/20 text-primary"),onClick:()=>
545x(g.ticker),children:g.ticker},g.ticker))]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-1.5",children:[i.jsxs("div",{className:"lg:col-span-4 flex flex-col gap-1.5",children:[i.jsx(sz,{ticker:m}),i.jsx(oz,{ticker:m})]}),i.jsxs("div",{className:"lg:col-span-8 flex flex-col gap-1.5",children:[i.jsx(xz,{}),i.jsx(X3,{})]})]})]}),i.jsx("div",{className:"md:hidden mt-2",children:i.jsx(R0,{})})]}),i.jsx("div",{className:"hidden md:block",children:i.jsx(PL,{})})]})}const Rs=f.memo(({icon:e,title:t,description:n,href:r})=>{const s=i.jsxs("div",{className:"group p-4 rounded-lg border border-border/50 bg-card/50 hover:bg-card/80 hover:border-primary/30 transition-all",children:[i.jsx(e,{className:"w-6 h-6 text-primary mb-3"}),i.jsx("h3",{className:"font-semibold text-foreground mb-2",children:t}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n}),r&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-primary mt-3 group-hover:gap-2 transition-all",children:["Learn more ",i.jsx(Mo,{className:"w-3 h-3"})]})]});return r?i.jsx(Ie,{to:r,children:s}):s});Rs.displayName="FeatureCard";const la=f.memo(({value:e,label:t})=>i.jsxs("div",{className:"text-center p-4",children:[i.jsx("div",{className:"text-2xl md:text-3xl font-bold text-primary",children:e}),i.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:t})]}));la.displayName="StatCard";const NA=f.memo(()=>i.jsxs("div",{className:"space-y-12 py-8",children:[i.jsxs("section",{className:"text-center space-y-4 px-4",children:[i.jsxs("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-bold text-foreground",children:["AI-Powered Trading Terminal for ",i.jsx("span",{className:"text-primary",children:"Tokenized Stocks"})]}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-3xl mx-auto",children:"TokenStocks.Ai provides institutional-grade AI analysis for tokenized securities from xStock and Ondo Finance. Trade TSLA, AAPL, NVDA, and MSFT tokens 24/7 with real-time AI signals."}),i.jsxs("div",{className:"flex flex-wrap justify-center gap-3 pt-4",children:[i.jsxs(Ie,{to:"/trade",className:"inline-flex items-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg font-medium hover:opacity-90 transition-opacity touch-manipulation",children:["Start Trading ",i.jsx(cd,{className:"w-4 h-4"})]}),i.jsxs(Ie,{to:"/agents",className:"inline-flex items-center gap-2 px-6 py-3 border border-border rounded-lg font-medium hover:bg-accent transition-colors touch-manipulation",children:["View AI Agents ",i.jsx(rn,{className:"w-4 h-4"})]})]})]}),i.jsxs("section",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 px-4 max-w-4xl mx-auto",children:[i.jsx(la,{value:"15+",label:"AI Agents"}),i.jsx(la,{value:"24/7",label:"Market Access"}),i.jsx(la,{value:"<50ms",label:"Signal Latency"}),i.jsx(la,{value:"5+",label:"Token Assets"})]}),i.jsxs("section",{className:"px-4 max-w-6xl mx-auto",children:[i.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-center mb-8",children:"How TokenStocks.Ai Works"}),i.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[i.jsxs("div",{className:"text-center space-y-3",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto",children:i.jsx("span",{className:"text-xl font-bold text-primary",children:"1"})}),i.jsx("h3",{className:"font-semibold text-foreground",children:"Connect to Markets"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Access tokenized stock markets from xStock and Ondo Finance through our Bloomberg-style terminal interface."})]}),i.jsxs("div",{className:"text-center space-y-3",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto",children:i.jsx("span",{className:"text-xl font-bold text-primary",children:"2"})}),i.jsx("h3",{className:"font-semibold text-foreground",children:"AI Analysis"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Our 15+ specialized AI agents analyze market data, sentiment, and on-chain metrics to generate trading signals."})]}),i.jsxs("div",{className:"text-center space-y-3",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto",children:i.jsx("span",{className:"text-xl font-bold text-primary",children:"3"})}),i.jsx("h3",{className:"font-semibold text-foreground",children:"Execute Trades"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive real-time buy/sell signals with confidence scores and execute trades with our low-latency execution engine."})]})]})]}),i.jsxs("section",{className:"px-4 max-w-6xl mx-auto",children:[i.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-center mb-2",children:"Tokenized Stock Trading Features"}),i.jsx("p",{className:"text-center text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Professional-grade tools for trading tokenized ver
545sions of traditional stocks like Tesla, Apple, and Nvidia."}),i.jsxs("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[i.jsx(Rs,{icon:rn,title:"AI Trading Agents",description:"15+ specialized AI agents including Alpha Gen, Quant Strat, Flow Trader, and Risk Desk for comprehensive market analysis.",href:"/agents"}),i.jsx(Rs,{icon:Ge,title:"Real-Time Signals",description:"Sub-50ms signal generation with buy/sell recommendations, confidence scores, and risk assessments for each token.",href:"/tape"}),i.jsx(Rs,{icon:ki,title:"Technical Analysis",description:"Advanced charting with support/resistance levels, momentum indicators, and volatility regime detection.",href:"/analytics"}),i.jsx(Rs,{icon:mi,title:"Risk Management",description:"Built-in risk controls with position sizing, stop-loss recommendations, and portfolio heat monitoring.",href:"/pro-agents"}),i.jsx(Rs,{icon:ud,title:"24/7 Market Access",description:"Trade tokenized stocks around the clock, unlike traditional stock markets with limited hours.",href:"/trade"}),i.jsx(Rs,{icon:Qw,title:"On-Chain Security",description:"Tokenized stocks backed by real securities with blockchain-verified ownership and transparent custody.",href:"/learn"})]})]}),i.jsxs("section",{className:"px-4 max-w-6xl mx-auto",children:[i.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-center mb-2",children:"Supported Tokenized Securities"}),i.jsx("p",{className:"text-center text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Trade tokenized versions of the world's most valuable companies from xStock and Ondo Finance."}),i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[{symbol:"TSLAX",name:"Tesla (xStock)",color:"text-red-400"},{symbol:"AAPLX",name:"Apple (xStock)",color:"text-gray-400"},{symbol:"NVDAX",name:"NVIDIA (xStock)",color:"text-green-400"},{symbol:"MSFTX",name:"Microsoft (xStock)",color:"text-blue-400"},{symbol:"GOOGLX",name:"Alphabet (xStock)",color:"text-yellow-400"}].map(e=>i.jsxs(Ie,{to:`/${e.symbol}`,className:"p-4 rounded-lg border border-border/50 bg-card/50 hover:border-primary/30 transition-all text-center touch-manipulation",children:[i.jsx("div",{className:D("text-xl font-bold",e.color),children:e.symbol}),i.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:e.name})]},e.symbol))})]}),i.jsxs("section",{className:"px-4 max-w-6xl mx-auto",children:[i.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-center mb-2",children:"Platform Integrations"}),i.jsx("p",{className:"text-center text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Seamlessly connect with leading tokenized stock providers and DeFi protocols."}),i.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"p-6 rounded-lg border border-border/50 bg-card/50",children:[i.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"xStock Integration"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Access xStock's tokenized equities with real-time price feeds, order book data, and institutional-grade execution."}),i.jsx(Ie,{to:"/integrations/xstocks",className:"text-sm text-primary hover:underline",children:"Learn about xStock integration â"})]}),i.jsxs("div",{className:"p-6 rounded-lg border border-border/50 bg-card/50",children:[i.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Ondo Finance Integration"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Trade Ondo Finance's tokenized securities including US Treasuries and money market funds with AI-powered analysis."}),i.jsx(Ie,{to:"/integrations/ondo",className:"text-sm text-primary hover:underline",children:"Learn about Ondo integration â"})]})]})]}),i.jsxs("section",{className:"px-4 max-w-6xl mx-auto",children:[i.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-center mb-2",children:"Use Cases for Tokenized Stock Trading"}),i.jsx("p",{className:"text-center text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Whether you're a retail trader or institutional investor, TokenStocks.Ai adapts to your needs."}),i.jsxs("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-4",children:[i.jsxs("div",{className:"p-4 rounded-lg border border-border/50",children:[i.jsx(qs,{className:"w-5 h-5 text-primary mb-2"}),i.jsx("h3",{className:"font-semibold text-foreground text-sm mb-1",children:"Retail Traders"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Access institutional-quality AI signals for informed trading decisions."})]}),i.jsxs("div",{className:"p-4 rounded-lg border border-border/50",children:[i.jsx(fC,{className:"w-5 h-5 text-primary mb-2"}),i.jsx("h3",{className:"font-semibold text-foreground text-sm mb-1",children:"Pro Traders"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Deploy multiple AI agents and customize strategies for alpha generation."})]}),i.jsxs("div",{className:"p-4 rounded-lg border border-border/50",children:[i.jsx(ud,{className:"w-5 h-5 text-primary mb-2"}),i.jsx("h3",{className:"font-semibold text-foreground text-sm mb-1",children:"Global Investors"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Trade US stocks 24/7 without market hour restrictions."})]}),i.jsxs("div",{className:"p-4 rounded-lg border border-border/50",children:[i.jsx(mi,{className:"w-5 h-5 text-primary mb-2"}),i.jsx("h3",{className:"font-semibold text-foreground text-sm mb-1",children:"Institutions"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"API access for algorithmic trading with enterprise-grade security."})]})]})]}),i.jsxs("section",{className:"px-4 max-w-4xl mx-auto",children:[i.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-center mb-8",children:"Frequently Asked Questions"}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("details",{className:"group p-4 rounded-lg border border-border/50 bg-card/50",children:[i.jsxs("summary",{className:"font-semibold text-foreground cursor-pointer list-none flex justify-between items-center",children:["What are tokenized stocks?",i.jsx(Mo,{className:"w-4 h-4 transition-transform group-open:rotate-90"})]}),i.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Tokenized stocks are blockchain-based representations of traditional equities. They enable 24/7 trading, fractional ownership, and instant settlement while being backed by real shares held in custody."})]}),i.jsxs("details",{className:"group p-4 rounded-lg border border-border/50 bg-card/50",children:[i.jsxs("summary",{className:"font-semibold text-foreground cursor-pointer list-none flex justify-between items-center",children:["How do the AI trading agents work?",i.jsx(Mo,{className:"w-4 h-4 transition-transform group-open:rotate-90"})]}),i.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Our AI agents use advanced machine learning to analyze market data, sentiment, order flow, and on-chain metrics. Each agent specializes in a specific analysis type and generates signals with confidence scores and risk assessments."})]}),i.jsxs("details",{className:"group p-4 rounded-lg border border-border/50 bg-card/50",children:[i.jsxs("summary",{className:"font-semibold text-foreground cursor-pointer list-none flex justify-between items-center",children:["What is xStock and Ondo Finance?",i.jsx(Mo,{className:"w-4 h-4 transition-transform group-open:rotate-90"})]}),i.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"xStock and Ondo Finance are leading providers of tokenized securities. They issue blockchain tokens backed by real-world assets including US stocks, treasuries, and money market funds, enabling global 24/7 access."})]}),i.jsxs("details",{className:"group p-4 rounded-lg border border-border/50 bg-card/50",children:[i.jsxs("summary",{className:"font-semibold text-foreground cursor-pointer list-none flex justify-between items-center",children:["Is TokenStocks.Ai free to use?",i.jsx(Mo,{className:"w-4 h-4 transition-transform group-open:rotate-90"})]}),i.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Yes, TokenStocks.Ai offers free access to our AI trading terminal with real-time signals. Premium features including advanced agents and API access are available for professional users."})]})]})]}),i.jsxs("section",{className:"px-4 max-w-4xl mx-auto text-center py-8",children:[i.jsx("h2",{className:"text-2xl md:text-3xl font-bold mb-4",children:"Ready to Trade Tokenized Stocks with AI?"}),i.jsx("p",{className:"text-muted-foreground mb-6",children:"Join thousands of traders using TokenStocks.Ai for intelligent tokenized stock trading."}),i.jsxs("div",{className:"flex flex-wrap justify-center gap-3",children:[i.jsxs(Ie,{to:"/trade",className:"inline-flex items-center gap-2 px-8 py-3 bg-primary text-primary-foreground rounded-lg font-medium hover:opacity-90 transition-opacity touch-manipulation",children:["Start Trading Now ",i.jsx(cd,{className:"w-4 h-4"})]}),i.jsx(Ie,{to:"/api",className:"inline-flex items-center gap-2 px-8 py-3 border border-border rounded-lg font-medium hover:bg-accent transition-colors touch-manipulation",children:"API Documentation"})]})]})]}));NA.displayName="SEOHomeSections";const U0="2026-07-09",io=e=>({...e,datePublished:U0,dateModified:U0}),wg=[{ticker:"MSFTX",underlying:"MSFT",name:"Microsoft",slugName:"microsoft",exchange:"Nasdaq",provider:"xStocks",thesis:"Cloud + AI leader with the most predictable enterprise cash flow on Earth.",volatility:"low",category:"blue chip"}
545,{ticker:"GOOGLX",underlying:"GOOGL",name:"Alphabet",slugName:"alphabet-google",exchange:"Nasdaq",provider:"xStocks",thesis:"Search monopoly + Gemini AI + YouTube â the highest-margin ad business in history.",volatility:"mid",category:"blue chip"},{ticker:"AMZNX",underlying:"AMZN",name:"Amazon",slugName:"amazon",exchange:"Nasdaq",provider:"xStocks",thesis:"AWS is a >$120B ARR compounding machine; retail is a call option.",volatility:"mid",category:"blue chip"},{ticker:"METAX",underlying:"META",name:"Meta Platforms",slugName:"meta",exchange:"Nasdaq",provider:"xStocks",thesis:"Reels + WhatsApp Business + Llama monetization drove operating leverage back to 40%+.",volatility:"high",category:"high beta"},{ticker:"COINX",underlying:"COIN",name:"Coinbase",slugName:"coinbase",exchange:"Nasdaq",provider:"xStocks",thesis:"The purest liquid proxy for crypto adoption â high-beta to BTC and stablecoin volume.",volatility:"high",category:"high beta"},{ticker:"AMDX",underlying:"AMD",name:"AMD",slugName:"amd",exchange:"Nasdaq",provider:"xStocks",thesis:"The clearest #2 AI accelerator play as MI350/MI400 close the CUDA moat.",volatility:"high",category:"high beta"},{ticker:"MSTRX",underlying:"MSTR",name:"MicroStrategy",slugName:"microstrategy",exchange:"Nasdaq",provider:"xStocks",thesis:"Levered Bitcoin proxy â highest-beta name in the tokenized universe.",volatility:"high",category:"high beta"},{ticker:"NFLXX",underlying:"NFLX",name:"Netflix",slugName:"netflix",exchange:"Nasdaq",provider:"xStocks",thesis:"Streaming pricing power + ad tier + live sports = re-rating in progress.",volatility:"mid",category:"consumer"},{ticker:"INTCX",underlying:"INTC",name:"Intel",slugName:"intel",exchange:"Nasdaq",provider:"xStocks",thesis:"Foundry turnaround optionality trading below tangible book.",volatility:"mid",category:"high beta"},{ticker:"CRMX",underlying:"CRM",name:"Salesforce",slugName:"salesforce",exchange:"NYSE",provider:"xStocks",thesis:"Agentforce is the first credible enterprise AI-agent revenue line at scale.",volatility:"mid",category:"blue chip"},{ticker:"UBERX",underlying:"UBER",name:"Uber",slugName:"uber",exchange:"NYSE",provider:"xStocks",thesis:"Category-leader in rides, delivery and freight â FCF machine at 3 verticals of scale.",volatility:"mid",category:"consumer"},{ticker:"ABNBX",underlying:"ABNB",name:"Airbnb",slugName:"airbnb",exchange:"Nasdaq",provider:"xStocks",thesis:"Global travel super-brand with 80%+ direct traffic and 25%+ FCF margin.",volatility:"mid",category:"consumer"},{ticker:"PLTX",underlying:"PLTR",name:"Palantir",slugName:"palantir",exchange:"Nasdaq",provider:"xStocks",thesis:"AIP is winning enterprise AI RFPs at a pace no legacy vendor can match.",volatility:"high",category:"high beta"},{ticker:"SHOPX",underlying:"SHOP",name:"Shopify",slugName:"shopify",exchange:"NYSE",provider:"xStocks",thesis:"Global commerce OS with Shop Pay + AI merchant tools compounding GMV.",volatility:"mid",category:"consumer"},{ticker:"ORCLX",underlying:"ORCL",name:"Oracle",slugName:"oracle",exchange:"NYSE",provider:"xStocks",thesis:"OCI Gen2 + OpenAI/Meta cloud contracts turned Oracle into the surprise AI infra winner.",volatility:"mid",category:"blue chip"},{ticker:"HOODX",underlying:"HOOD",name:"Robinhood",slugName:"robinhood",exchange:"Nasdaq",provider:"xStocks",thesis:"Retail super-app + tokenization thesis â the closest listed analog to on-chain equities.",volatility:"high",category:"high beta"},{ticker:"SPYX",underlying:"SPY",name:"S&P 500",slugName:"sp500-spyx",exchange:"NYSE",provider:"xStocks",thesis:"Diversified US large-cap exposure on-chain with 24/7 access and DeFi collateral.",volatility:"low",category:"ETF"},{ticker:"QQQX",underlying:"QQQ",name:"Nasdaq 100",slugName:"nasdaq100-qqqx",exchange:"Nasdaq",provider:"xStocks",thesis:"Concentrated exposure to the Mag7 + rest of Nasdaq â the tech beta of choice.",volatility:"mid",category:"ETF"},{ticker:"GLDX",underlying:"GLD",name:"Gold",slugName:"gold-gldx",exchange:"NYSE",provider:"xStocks",thesis:"Hard-asset hedge available 24/7 without a bullion broker.",volatility:"low",category:"ETF"},{ticker:"ARKX",underlying:"ARKK",name:"ARK Innovation",slugName:"ark-innovation-arkx",exchange:"NYSE",provider:"xStocks",thesis:"Disruptive-innovation basket, tokenized for global 24/7 access.",volatility:"high",category:"ETF"},{ticker:"TSLAon",underlying:"TSLA",name:"Tesla (Ondo)",slugName:"tesla-ondo",exchange:"Nasdaq",provider:"Ondo",thesis:"Ondo's regulated Tesla token pays cash dividends and unlocks institutional DeFi.",volatility:"high",category:"high beta"}
545,{ticker:"AAPLon",underlying:"AAPL",name:"Apple (Ondo)",slugName:"apple-ondo",exchange:"Nasdaq",provider:"Ondo",thesis:"Bermuda-regulated Apple exposure with the strictest KYC in the tokenized universe.",volatility:"low",category:"blue chip"},{ticker:"NVDAon",underlying:"NVDA",name:"NVIDIA (Ondo)",slugName:"nvidia-ondo",exchange:"Nasdaq",provider:"Ondo",thesis:"Institutional-grade NVIDIA exposure with cash-dividend passthrough.",volatility:"high",category:"high beta"},{ticker:"JPMon",underlying:"JPM",name:"JPMorgan",slugName:"jpmorgan",exchange:"NYSE",provider:"Ondo",thesis:"Systemically important bank â rates + credit cycle proxy on-chain.",volatility:"mid",category:"financial"},{ticker:"WMTon",underlying:"WMT",name:"Walmart",slugName:"walmart",exchange:"NYSE",provider:"Ondo",thesis:"The most defensive US consumer name with AI-driven margin expansion.",volatility:"low",category:"consumer"},{ticker:"BABAon",underlying:"BABA",name:"Alibaba",slugName:"alibaba",exchange:"NYSE",provider:"Ondo",thesis:"China consumer + cloud + AI, tokenized for global investors.",volatility:"high",category:"high beta"},{ticker:"KOon",underlying:"KO",name:"Coca-Cola",slugName:"coca-cola",exchange:"NYSE",provider:"Ondo",thesis:"60-year dividend aristocrat, now paying passthrough dividends on-chain.",volatility:"low",category:"consumer"},{ticker:"PFEon",underlying:"PFE",name:"Pfizer",slugName:"pfizer",exchange:"NYSE",provider:"Ondo",thesis:"Deep-value pharma with obesity + oncology optionality.",volatility:"mid",category:"healthcare"}];function _$(e){const t=`tokenized-${e.slugName}-stock-${e.ticker.toLowerCase()}`,n=e.category==="ETF",r=e.provider==="xStocks"?"1:1 backed shares custodied at InCore Bank (Switzerland) under a Liechtenstein TVTG prospectus, with monthly attestations by Network Firm.":"1:1 backed shares custodied at Clear Street (New York) under a Bermuda DABA broker-dealer license, with daily attestations.",s=e.provider==="xStocks"?"Cash dividends are auto-reinvested into token NAV â your token count is constant, price steps up on ex-date.":"Cash dividends are paid directly to token holders in USDC on ex-dividend date.";return io({slug:t,title:`Tokenized ${e.name} (${e.ticker}): The 2026 Guide to Buying, Trading & AI Signals`,metaTitle:`${e.ticker} â Tokenized ${e.name} Stock Guide (2026)`,metaDescription:`Complete 2026 guide to ${e.ticker}, the tokenized ${e.name} stock. How to buy, 24/7 liquidity, custody, ${e.provider==="xStocks"?"reinvested":"cash"} dividends, live AI agent signals and fee comparison vs. ${e.underlying}.`,keywords:`${e.ticker}, tokenized ${e.name.toLowerCase()}, ${e.underlying.toLowerCase()} on chain, buy ${e.ticker}, tokenized ${e.underlying.toLowerCase()} stock, ${e.provider.toLowerCase()} ${e.underlying.toLowerCase()}`,heroTagline:`Trade ${e.name} 24/7 in fractional size with 1:1 backed tokens and live AI agent signals.`,intent:"transactional",readTime:"8 min read",category:"Ticker Guides",primaryCTA:{label:`Trade ${e.ticker} now`,href:`/${e.ticker}`},sections:[{h2:`What is ${e.ticker}?`,paragraphs:[`${e.ticker} is the ${e.provider} tokenized version of ${e.name} (${e.exchange}: ${e.underlying}), a fully-collateralised on-chain representation of the underlying share. Each token in circulation is redeemable 1:1 for the underlying equity, with ${r}`,`Unlike a CFD or synthetic derivative, ${e.ticker} is a claim on the real share â you own economic exposure, dividend rights and voting-rights economics without touching a legacy brokerage account.`]},{h2:`Why traders own ${e.name} on-chain`,paragraphs:[e.thesis,`Tokenization removes three legacy frictions: (1) US-hours-only trading â ${e.ticker} settles 24/7/365, (2) fractional gating â you can buy $1 of ${e.name}, (3) geographic restrictions â any wallet in a supported jurisdiction can custody the asset directly.`],bullets:[`Volatility profile: ${e.volatility} (informs sizing & agent selection)`,`Category: ${e.category}`,`Provider: ${e.provider}`,`Underlying exchange: ${e.exchange}`]},{h2:`Live AI agent signals on ${e.ticker}`,paragraphs:[`Every tokenized ticker on TokenStocks.Ai runs a dedicated 5-agent organism: Market Agent (technicals + microstructure), Fundamental Agent (${n?"constituent-weighted earnings":"earnings, guidance, insider flow"}), Sentiment Agent (news + social), Risk Agent (drawdown control), and MetaJudge (Bayesian ensembler).`,`Agent win-rates on ${e.ticker} are computed from live signal outcomes verified against real market prices â no backtests, no cherry-picking. Quick Trade auto-routes to whichever ${e.ticker} agent is currently ranked #1 on the leaderboard.`]},{h2:"Custody, fees & dividends",paragraphs:[`${r}`,`Fees: ${e.provider==="xStocks"?"0.15% issuance / 0.15% redemption, no management fee.":"0.20% issuance / 0.20% redemption, no management fee â dividends pay direct in USDC."}`,`Dividend policy: ${s}`]},{h2:`How to buy ${e.ticker} in 4 steps`,paragraphs:[`1. Fund a self-custody wallet with USDC on ${e.provider==="xStocks"?"Solana (cheapest & deepest)":"Ethereum, Solana or Sui"}. 2. Open the TokenStocks.Ai trade terminal and select ${e.ticker}. 3. Review the current AI signal + confidence score. 4. Click Trade â the smart-order router splits the fill across Kraken, Bybit, Jupiter, Raydium and Uniswap to minimise slippage.`]}],faqs:[{q:`Is ${e.ticker} the same as ${e.underlying}?`,a:`${e.ticker} is 1:1 backed by ${e.underlying} shares held in regulated custody. Economically it tracks ${e.underlying} tick-for-tick during market hours and continues trading 24/7 based on futures, ADR proxies and on-chain order flow.`},{q:`Where does ${e.ticker} have the deepest liquidity?`,a:`On ${e.provider==="xStocks"?"Kraken and Jupiter
545(Solana)":"Bybit and Ondo's native AMM"} during US hours; overnight, TokenStocks.Ai's smart-order router prioritises whichever venue currently offers the tightest spread.`},{q:`Does ${e.ticker} pay dividends?`,a:s}],relatedSlugs:["how-to-buy-tokenized-stocks","best-tokenized-stocks-2026",e.provider==="xStocks"?"xstocks-review-2026":"ondo-global-markets-review","ai-trading-agents-for-stocks"]})}const j$=wg.map(_$),P$=wg.filter(e=>["MSFTX","GOOGLX","AMZNX","METAX","COINX","SPYX","QQQX","MSTRX"].includes(e.ticker));function R$(e){return io({slug:`how-to-buy-tokenized-${e.slugName}-stock`,title:`How to Buy Tokenized ${e.name} Stock (${e.ticker}) in 2026`,metaTitle:`How to Buy Tokenized ${e.name} (${e.ticker}) â 2026 Step-by-Step`,metaDescription:`Step-by-step guide to buying tokenized ${e.name} (${e.ticker}) in 2026: wallet setup, funding, venue selection, best execution and AI signal check â in under 10 minutes.`,keywords:`how to buy ${e.ticker}, buy tokenized ${e.name.toLowerCase()}, ${e.underlying.toLowerCase()} on chain, ${e.ticker} tutorial`,heroTagline:`From zero to your first ${e.ticker} fill â the fastest legit path in 2026.`,intent:"transactional",readTime:"7 min read",category:"How-To Tutorials",primaryCTA:{label:`Trade ${e.ticker} now`,href:`/${e.ticker}`},sections:[{h2:"Before you start",paragraphs:["You need a self-custody wallet (Phantom for Solana, Rabby/MetaMask for EVM), roughly 5 minutes, and enough stablecoin to cover your target size plus 1â2% for slippage on first fills."],bullets:["Self-custody wallet installed & seed backed up","USDC or USDT on Solana, Ethereum, Base or Arbitrum","TokenStocks.Ai open in a second tab (leaderboard + terminal)"]},{h2:"Step 1 â Fund with stablecoin",paragraphs:[`On-ramp USDC via Coinbase, Kraken or MoonPay. Solana is the cheapest network (~$0.0002 per swap) and typically has the deepest ${e.ticker} liquidity. If you already hold ETH or BTC, bridge to USDC on Solana via Wormhole or Portal.`]},{h2:`Step 2 â Check the ${e.ticker} AI signal`,paragraphs:[`Open the ${e.ticker} asset page. The top of the page shows the current MetaJudge signal (BUY / HOLD / SELL) with a confidence score and the leaderboard-ranked #1 agent for the ticker. Don't fight a high-confidence SELL when you're trying to open a long â wait or size down.`]},{h2:"Step 3 â Execute via smart router",paragraphs:["Enter your size, review the estimated price impact, and click Trade. The router splits across Kraken, Bybit, Jupiter, Raydium and Uniswap to minimise slippage. For orders above $10k, use Quick Trade â it auto-selects the current #1 agent and executes at best-of-book."]},{h2:"Step 4 â Custody, monitor, exit",paragraphs:[`After settlement, ${e.ticker} sits in your wallet. Bookmark ${e.provider==="xStocks"?"backed.fi's proof-of-reserves dashboard":"Ondo's daily attestation page"} and enable TokenStocks.Ai price alerts. To exit, reverse the flow â the router redeems at NAV whenever venue liquidity is thinner than direct redemption.`]}],faqs:[{q:`Can I buy ${e.ticker} without KYC?`,a:"On-chain venues (Jupiter, Raydium, Uniswap) do not require KYC â your wallet is your identity. Centralised venues (Kraken, Bybit) require KYC. TokenStocks.Ai's router respects your preference and only quotes venues that match your KYC status."},{q:`What's the minimum ${e.ticker} order?`,a:"Effectively $1. Tokens are infinitely fractional; the practical floor is set by network fees (~$0.01 on Solana, ~$1â3 on Ethereum L1)."},{q:`How long does a ${e.ticker} trade take?`,a:"Sub-second on Solana. 12â20 seconds on Ethereum L1. Kraken/Bybit fills are near-instant during business hours."}],relatedSlugs:[`tokenized-${e.slugName}-stock-${e.ticker.toLowerCase()}`,"how-to-buy-tokenized-stocks","best-tokenized-stocks-2026","ai-trading-agents-for-stocks"]})}const O$=P$.map(R$),I$=[{slug:"xstocks-vs-ondo",a:"xStocks",b:"Ondo Global Markets",title:"xStocks vs Ondo Global Markets: Which Tokenized Stock Provider Wins in 2026?",metaTitle:"xStocks vs Ondo Global Markets (2026) â Deep Comparison",metaDesc:"Head-to-head comparison of xStocks and Ondo Global Markets in 2026: fees, regulation, custody, dividends, DeFi utility and supported tickers. Which is right for you?",keywords:"xstocks vs ondo, ondo vs xstocks, best tokenized stock provider, tokenized equities comparison",hero:"Two regulated 1:1 backed providers. Same asset class. Very different design choices.",winnerAText:"xStocks wins on liquidity, breadth and DeFi composability.",winnerBText:"Ondo wins on regulatory clarity, cash dividends and institutional-grade custody."},{slug:"tokenized-stocks-vs-stock-cfds",a:"Tokenized stocks",b:"Stock CFDs",title:"Tokenized Stocks vs Stock CFDs: Which Is Better for 24/7 Traders?",metaTitle:"Tokenized Stocks vs CFDs (2026) â Costs, Risks, Access",metaDesc:"Tokenized stocks vs stock CFDs in 2026: ownership, spreads, overnight financing, custody risk and regulation. Which one belongs in your book?",keywords:"tokenized stocks vs cfd, cfd vs tokenized stocks, on chain stocks vs cfd",hero:"CFDs are contracts. Tokenized stocks are ownership. Here is how the two really compare.",winnerAText:"Tokenized stocks win on ownership, cost, transparency and DeFi utility.",winnerBText:"CFDs win on leverage flexibility and integrated broker tooling for pure directional trading."},{slug:"tokenized-stocks-vs-crypto",a:"Tokenized stocks",b:"Crypto",title:"Tokenized Stocks vs Crypto: How to Allocate in 2026",metaTitle:"Tokenized Stocks vs Crypto â 2026 Allocation Playbook",metaDesc:"How tokenized stocks fit alongside crypto in a 2026 on-chain portfolio: return drivers, correlation, drawdown, dividend income and DeFi collateral value.",keywords:"tokenized stocks vs crypto, on chain equities vs crypto, tokenized rwa portfolio",hero:"Same rails, different risk premia. Here is how to size both in one on-chain book.",winnerAText:"Tokenized stocks add earnings-driven cash flow and lower drawdown to a crypto portfolio.",winnerBText:"Crypto still delivers the highest asymmetric upside per unit of risk in bull regimes."},{slug:"tokenized-stocks-vs-real-world-assets",a:"Tokenized stocks",b:"Broader RWA (bonds, T-bills, real estate)",title:"Tokenized Stocks vs Real-World Assets (RWA): The 2026 Landscape",metaTitle:"Tokenized Stocks vs RWA â 2026 Deep Dive",metaDesc:"Where tokenized stocks fit in the broader RWA landscape alongside tokenized T-bills, private credit and real estate. Liquidity, yield, regulatory maturity.",keywords:"tokenized stocks vs rwa, tokenized equities vs bonds, rwa comparison",hero:"Tokenized equities are the fastest-growing wedge of the RWA stack. Here is why.",winnerAText:"Tokenized stocks win on liquidity, 24/7 pricing and household-name recognition.",winnerBText:"Tokenized T-bills win on yield-bearing collateral use and lower volatility."},{slug:"solana-vs-ethereum-for-tokenized-stocks",a:"Solana",b:"Ethereum",title:"Solana vs Ethereum for Tokenized Stocks: Which Chain Wins in 2026?",metaTitle:"Solana vs Ethereum for Tokenized Stocks (2026)",metaDesc:"Where should you custody your tokenized stocks â Solana or Ethereum? Fees, liquidity depth, DeFi collateral, custody security and bridge risk compared.",keywords:"solana vs ethereum tokenized stocks, best chain for xstocks, solana vs eth tokenized equities",hero:"The largest tokenized equity venues sit on Solana. The deepest DeFi lending sits on Ethereum. Where should your position live?",winnerAText:"Solana wins on fees, latency and native tokenized-equity liquidity.",winnerBText:"Ethereum wins on collateral acceptance in Aave, Morpho and institutional DeFi."},{slug:"kraken-vs-jupiter-for-tokenized-stocks",a:"Kraken",b:"Jupiter",title:"Kraken vs Jupiter for Tokenized Stocks: CEX or DEX in 2026?",metaTitle:"Kraken vs Jupiter
545(2026) â Best Venue for Tokenized Stocks",metaDesc:"CEX vs DEX for tokenized stock execution in 2026. Spreads, fees, KYC, custody trade-offs and how TokenStocks.Ai's router picks between them.",keywords:"kraken vs jupiter tokenized stocks, best venue tokenized stocks, cex vs dex xstocks",hero:"Kraken has depth and KYC. Jupiter has 24/7 and no counterparty. Here is when to use which.",winnerAText:"Kraken wins on tight US-hours spreads and fiat on-ramp.",winnerBText:"Jupiter wins on 24/7 depth, self-custody and DeFi composability."},{slug:"tslax-vs-tesla-cfd",a:"TSLAX (tokenized)",b:"TSLA CFD",title:"TSLAX vs Tesla CFD: The Real 2026 Comparison",metaTitle:"TSLAX vs Tesla CFD â 2026 Cost, Risk & Access Review",metaDesc:"TSLAX (tokenized Tesla) vs a Tesla CFD in 2026: ownership, overnight financing, spreads, custody and access. Which is really cheaper for 24/7 traders?",keywords:"tslax vs tesla cfd, tokenized tesla vs cfd, tesla cfd comparison",hero:"Both trade 24/7. Only one gives you ownership and DeFi collateral. Here is the math.",winnerAText:"TSLAX wins on ownership, cost, custody transparency and DeFi utility.",winnerBText:"Tesla CFDs win on leverage granularity and integrated broker tooling."},{slug:"spyx-vs-spy-etf",a:"SPYX",b:"SPY ETF",title:"SPYX vs SPY ETF: Tokenized S&P 500 vs Traditional in 2026",metaTitle:"SPYX vs SPY ETF â 2026 Comparison for Global Investors",metaDesc:"SPYX (tokenized S&P 500) vs SPY ETF in 2026: fees, 24/7 access, dividends, DeFi collateral, tax and access for non-US investors.",keywords:"spyx vs spy, tokenized sp500 vs spy, best sp500 tokenized",hero:"Same underlying basket. Different rails. When does the tokenized version win?",winnerAText:"SPYX wins on 24/7 trading, DeFi composability and access for non-US investors.",winnerBText:"SPY wins on decades of regulatory precedent, retirement account access and tax lot software."},{slug:"aaplon-vs-aaplx",a:"AAPLon (Ondo)",b:"AAPLX (xStocks)",title:"AAPLon vs AAPLX: Which Tokenized Apple Is Better in 2026?",metaTitle:"AAPLon vs AAPLX â 2026 Tokenized Apple Comparison",metaDesc:"AAPLon (Ondo) vs AAPLX (xStocks) in 2026: fees, dividends, custody, liquidity depth and which wallet + chain to use. Full comparison.",keywords:"aaplon vs aaplx, ondo apple vs xstocks apple, best tokenized apple",hero:"Two 1:1 backed tokenized Apple products. Very different institutional posture.",winnerAText:"AAPLX wins on Solana liquidity, DeFi collateral and lower KYC friction.",winnerBText:"AAPLon wins on cash-dividend passthrough and stricter regulatory framework."}];function M$(e){return io({slug:e.slug,title:e.title,metaTitle:e.metaTitle,metaDescription:e.metaDesc,keywords:e.keywords,heroTagline:e.hero,intent:"comparison",readTime:"9 min read",category:"Comparisons",primaryCTA:{label:"See the AI leaderboard",href:"/leaderboard"},sections:[{h2:"The 30-second answer",paragraphs:[e.winnerAText,e.winnerBText]},{h2:`How ${e.a} works`,paragraphs:[`${e.a} sits on one side of this trade. Understand its underlying legal wrapper, custody model, dominant venue and fee stack before comparing directly.`],bullets:["Legal wrapper & regulator","Underlying asset / redemption right","Primary venues and liquidity depth","Fee stack (creation, redemption, spread, funding)","Custody and counterparty risk"]},{h2:`How ${e.b} works`,paragraphs:[`${e.b} makes the opposite trade-offs. Its design was optimised for a different investor archetype â and that shows up in every fee line, disclosure and settlement window.`],bullets:["Legal wrapper & regulator","Underlying asset / redemption right","Primary venues and liquidity depth","Fee stack","Custody and counterparty risk"]},{h2:"Cost comparison",paragraphs:["All-in cost includes issuance/redemption fees, on-venue spread, funding cost (for CFDs/leveraged positions) and any FX conversion. TokenStocks.Ai displays the fully-loaded cost per venue in real time."]},{h2:"Which one wins for your use case",paragraphs:["For 24/7 directional traders, TokenStocks.Ai routes automatically to whichever venue and product offers the tightest all-in cost. For long-term holders in tax-advantaged accounts, static allocation to the traditional wrapper still typically wins on tax software support alone."]}],faqs:[{q:`Can I hold both ${e.a} and ${e.b}?`,a:"Yes. Many pros run pair trades â long the cheaper wrapper, short the richer one â to arbitrage temporary spread dislocations. TokenStocks.Ai flags dislocations >30 bps automatically."},{q:"Is one safer than the other?",a:'Both are regulated in some form. The risk mix is different: tokenized products add smart-contract and bridge risk, traditional products add broker
545counterparty and settlement-day risk. Neither is objectively "safer" â they fail in different failure modes.'}],relatedSlugs:["how-to-buy-tokenized-stocks","best-tokenized-stocks-2026","tokenized-stocks","ai-trading-agents-for-stocks"]})}const L$=I$.map(M$),D$=[{slug:"day-trading-tokenized-stocks-strategy",title:"Day Trading Tokenized Stocks: The 2026 Strategy Guide",metaTitle:"Day Trading Tokenized Stocks (2026) â Full Playbook",desc:"The complete 2026 playbook for day trading tokenized stocks: setups, risk sizing, venue selection, AI agent auto-routing and how to survive overnight gaps.",keywords:"day trading tokenized stocks, tokenized stocks day trading, xstocks day trading strategy",hero:"24/7 markets mean you never miss the move. That also means the setups are stricter.",cta:{label:"Open the trade terminal",href:"/trade"},sections:[{h2:"Why day trading tokenized stocks is different",p:["Traditional equity day trading resets every morning. Tokenized stocks trade 24/7 â there's no open, no close, no PDT rule. The winning traders in 2026 don't try to trade constantly; they wait for specific microstructure setups and let AI agents flag them."]},{h2:"The three highest-EV setups",p:["1) Earnings drift â enter within the first 45 seconds after an earnings print (US or foreign) and exit within 20 minutes. 2) Overnight momentum â fade the first 3% reversal after a 5%+ overnight move on a name with no fresh headline. 3) Cross-venue arbitrage â when Jupiter and Kraken diverge by more than 20 bps on the same ticker, the router auto-arbs the gap."],bullets:["Earnings drift (first 45s, exit in 20min)","Overnight momentum reversal","Cross-venue arbitrage","News catalyst spikes >5% (fade after 4th minute)"]},{h2:"Risk sizing that actually works",p:["Max 1R per trade = 1% of account. Daily max drawdown 3R. Weekly max 6R. If the AI agent's confidence <70%, halve the size. If confidence >90%, use full size. Never override a Risk Agent HOLD unless you have a specific fundamental thesis."]},{h2:"Auto-routing the top agent",p:["Enable Quick Trade â it locks in whichever agent is currently #1 on the leaderboard for your ticker, computes size from your risk parameters, and executes at best-of-book across all venues in under 100ms."]}],faqs:[{q:"Is there a pattern-day-trader rule for tokenized stocks?",a:"No. PDT is a US brokerage rule for equities in a margin account. Tokenized stocks trade as tokens on-chain (or via CEX spot books) so PDT doesn't apply."},{q:"What's realistic monthly return day trading tokenized stocks?",a:"Serious day traders using top-agent auto-routing target 3â8% monthly on a $10kâ100k account. Anything higher usually implies over-sizing and eventual blow-up."}]},{slug:"swing-trading-tokenized-stocks-strategy",title:"Swing Trading Tokenized Stocks: The 2026 Multi-Day Playbook",metaTitle:"Swing Trading Tokenized Stocks (2026) â Full Playbook",desc:"How to swing trade tokenized stocks in 2026 across 3-14 day holds: setup selection, risk framework, agent signal filtering and best-execution routing.",keywords:"swing trading tokenized stocks, swing trade xstocks, multi day tokenized stocks strategy",hero:"Multi-day holds capture 80% of the trend with 20% of the screen time.",cta:{label:"See the AI leaderboard",href:"/leaderboard"},sections:[{h2:"The swing-trading edge on tokenized stocks",p:["Tokenized stocks let swing traders act on off-hours catalysts and macro shifts that legacy brokers can't touch until 9:30 ET the next morning. That 12-16 hour edge is where most swing alpha lives in 2026."]},{h2:"Entry framework",p:["Combine a top-3-agent BUY consensus with a Sentiment Agent score above 65 and a Risk Agent green light. Size 3â5% of capital per position, max 5 concurrent positions."]},{h2:"Exit framework",p:["Fixed 2R take-profit, 1R stop, trail on any 3-day close above the 20-day EMA. Never hold through earnings unless the Fundamental Agent explicitly flagged the print as high-EV."]}],faqs:[{q:"Best tickers for swing trading?",a:"Mid-vol names with strong single catalysts: MSFTX, GOOGLX, AMZNX, UBERX, SHOPX. Blue chips have too little movement; MSTRX and COINX have too much."}]},{slug:"tokenized-stocks-arbitrage-guide",title:"Tokenized Stock Arbitrage: The 2026 Guide to Risk-Free Alpha",metaTitle:"Tokenized Stock Arbitrage (2026) â Cross-Venue Playbook",desc:"Cross-venue and cross-wrapper arbitrage on tokenized stocks in 2026: CEX-DEX gaps, redemption arbitrage, funding-rate spreads and how to automate it all.",keywords:"tokenized stocks arbitrage, xstocks arbitrage, dex cex arbitrage stocks",hero:"Fragmented venues + 1:1 redemption = the cleanest arbitrage market on-chain.",cta:{label:"Explore the API",href:"/api"},sections:[{h2:"The four arbitrage vectors",p:["1) CEX-DEX spread â Kraken vs Jupiter routinely opens 20-80 bps gaps at low-volume hours. 2) Provider arb â xStocks vs Ondo divergence on the same underlying. 3) NAV arb â token price vs 1:1 redemption value. 4) Cross-chain arb â same token on Solana vs Ethereum."]},{h2:"How to automate",p:["Use the TokenStocks.Ai API to stream best-bid-best-offer across all venues. Trigger a rebalance when gross spread > 30 bps + expected execution cost. Full-stack integration typically pays for itself within a week at $50k+ notional."]}],faqs:[{q:"Do I need my own capital on every venue?",a:"Yes â arbitrage requires pre-positioned inventory on both sides. Alternatively, atomic-swap infrastru
545cture (still early in 2026) lets you cross without pre-funding, at the cost of tighter opportunity windows."}]},{slug:"tokenized-stocks-as-defi-collateral",title:"Using Tokenized Stocks as DeFi Collateral: The 2026 Guide",metaTitle:"Tokenized Stocks as DeFi Collateral (2026)",desc:"How to post tokenized stocks as collateral in Kamino, Marginfi, Aave and Morpho in 2026. LTVs, liquidation risk, oracle sourcing and the safest strategies.",keywords:"tokenized stocks defi collateral, xstocks collateral kamino, borrow against tokenized stocks",hero:"Borrow stablecoins against your Tesla exposure without selling the position.",cta:{label:"Explore integrations",href:"/integrations"},sections:[{h2:"Where tokenized stocks are accepted",p:["Kamino (Solana) accepts TSLAX, AAPLX, NVDAX, SPYX at 60-70% LTV. Marginfi has similar limits. Morpho and Aave list select ONDO-tokens with lower LTVs (~50%) reflecting stricter risk parameters."]},{h2:"The safest strategy",p:["Cap LTV at 40% (well below liquidation threshold), borrow only stablecoins, and use the borrowed capital for yield-bearing positions (T-bills, LP fees). Never re-leverage into more equity exposure."]}],faqs:[{q:"What happens if my stock drops overnight?",a:"The lending protocol's oracle continues to price the token 24/7 via on-chain venues. If price falls enough to breach LTV, liquidation happens instantly â the exact scenario Risk Agent monitors and warns you about."}]},{slug:"earnings-trading-tokenized-stocks",title:"Earnings Trading Tokenized Stocks: The 2026 Post-Print Playbook",metaTitle:"Earnings Trading Tokenized Stocks (2026)",desc:"Trade tokenized stocks around earnings 24/7 in 2026 â pre-print positioning, post-print drift capture, IV crush avoidance and AI agent signal filters.",keywords:"earnings trading tokenized stocks, tokenized stocks earnings strategy, post earnings drift",hero:"Earnings drop at 4:05pm ET. In 2026 you don't wait until 9:30 the next morning.",cta:{label:"Open the trade terminal",href:"/trade"},sections:[{h2:"The post-print drift edge",p:["Academic research shows post-earnings-announcement drift (PEAD) persists for 60+ days on beats/misses >1 SD from consensus. On tokenized stocks, you capture the first 12-16 hours of that drift that traditional traders miss entirely."]},{h2:"Execution framework",p:["Wait 45 seconds after the print for the initial spike to settle. Check Fundamental Agent + Sentiment Agent consensus. Size 2R if aligned. Exit at 20 minutes (spike capture) or hold 5 days (PEAD capture) based on setup selection."]}],faqs:[{q:"What about IV crush?",a:"Tokenized stocks don't have listed options in most jurisdictions in 2026, so IV crush doesn't apply. That's a structural edge over options traders."}]},{slug:"overnight-gap-trading-tokenized-stocks",title:"Overnight Gap Trading with Tokenized Stocks (2026 Playbook)",metaTitle:"Overnight Gap Trading Tokenized Stocks (2026)",desc:"Trade the overnight gap on tokenized stocks in 2026: fade vs follow, catalyst filtering, sizing rules and the AI signal that predicts gap fills.",keywords:"overnight gap trading tokenized stocks, gap fade tokenized, gap and go tokenized stocks",hero:"The overnight gap is worth ~30% of NYSE alpha. Tokenized stocks let you own it.",cta:{label:"See the leaderboard",href:"/leaderboard"},sections:[{h2:"Gap taxonomy",p:["Two types matter: catalyst gaps (news-driven, >3%, follow-through 70% of the time) and vacuum gaps (no news, low overnight volume, fade-back 65% of the time). MetaJudge classifies gaps in real time from Sentiment + Market agent inputs."]},{h2:"Sizing & stops",p:["Catalyst gap follow: 1R risk, 3R target, stop at prior-day close. Vacuum gap fade: 1R risk, 1.5R target, stop at gap high/low."]}],faqs:[{q:"Isn't there no 'gap' if trading is 24/7?",a:"Volume clusters around NYSE open even for tokenized stocks. The pre-open drift often creates a functional gap that reverses on the volume flush."}]},{slug:"tokenized-stocks-portfolio-allocation",title:"Tokenized Stocks Portfolio Allocation: The 2026 Framework",metaTitle:"Tokenized Stocks Portfolio Allocation (2026)",desc:"How to size tokenized stocks in a multi-asset portfolio in 2026: risk parity, factor tilt, correlation with crypto and divi
545dend income integration.",keywords:"tokenized stocks allocation, tokenized stocks portfolio, tokenized stocks risk parity",hero:"Tokenized stocks are the highest-quality yield-bearing collateral in DeFi.",cta:{label:"See methodology",href:"/methodology"},sections:[{h2:"The three-bucket model",p:["Bucket 1 (60%): tokenized ETFs (SPYX, QQQX, GLDX) for beta. Bucket 2 (30%): single-name AI/consumer leaders (NVDAX, TSLAX, MSFTX, AAPLX). Bucket 3 (10%): tactical high-beta (COINX, MSTRX, PLTX) rebalanced monthly based on top-agent conviction."]},{h2:"Rebalancing",p:["Quarterly for buckets 1 and 2. Monthly for bucket 3. Use TokenStocks.Ai's factor risk attribution to detect drift and auto-rebalance via smart-order router."]}],faqs:[{q:"How much of a portfolio should be in tokenized stocks?",a:"For crypto-native investors, 20-40% of the equity sleeve. For traditional investors experimenting with on-chain, start at 5-10% and scale as familiarity grows."}]},{slug:"hedging-with-tokenized-stocks",title:"Hedging Crypto Portfolios with Tokenized Stocks (2026 Guide)",metaTitle:"Hedging Crypto with Tokenized Stocks (2026)",desc:"Use tokenized stocks to hedge crypto drawdowns in 2026: pair trades, dollar-neutral baskets, GLDX safe haven and stress-test performance.",keywords:"hedge crypto tokenized stocks, gldx crypto hedge, dollar neutral tokenized stocks",hero:"The best hedge for a crypto book is a liquid stock book. Now they live on the same wallet.",cta:{label:"Trade GLDX",href:"/GLDX"},sections:[{h2:"Three practical hedges",p:["1) Long GLDX vs long BTC â negative correlation in risk-off regimes. 2) Long SPYX vs short single-name crypto â hedges beta while keeping alpha. 3) Short COINX vs long BTC â hedges equity crypto-proxy risk in a bull."]},{h2:"Execution",p:["All three hedges execute in a single wallet with instant settlement. Rebalance weekly using TokenStocks.Ai's exposure panel."]}],faqs:[{q:"Why not just hold stablecoins?",a:"Stablecoins de-risk but earn 4-5%. Hedged equity exposure can earn 8-15% while still cushioning crypto drawdowns."}]},{slug:"tokenized-stocks-tax-guide",title:"Tokenized Stocks Tax Guide (2026): US, UK, EU Reporting Explained",metaTitle:"Tokenized Stocks Tax Guide 2026 â US, UK, EU Rules",desc:"How tokenized stocks are taxed in 2026 across US, UK and EU jurisdictions: capital gains, dividends, wash-sale rules and how to report on-chain trades.",keywords:"tokenized stocks tax, tokenized stocks capital gains, tokenized stocks reporting",hero:"Tokenized doesn't mean tax-free. Here is exactly what most jurisdictions want to see.",cta:{label:"Read the risk disclaimer",href:"/risk-disclaimer"},sections:[{h2:"US treatment",p:["The IRS has not issued specific tokenized-equity guidance as of 2026. Most practitioners treat tokenized stocks as property (Notice 2014-21), meaning every trade is a taxable event, standard capital gains rules apply, and dividend income is ordinary. Consult a qualified CPA."]},{h2:"UK & EU treatment",p:["HMRC generally treats tokenized equities as securities for tax purposes â
545capital gains tax on disposal, income tax on dividends. In the EU, MiCA-regulated tokenized securities follow local securities taxation."]}],faqs:[{q:"Do wash-sale rules apply?",a:"In the US, wash-sale rules technically don't apply to tokens (as of 2026) since they're property, not securities. This may change â track legislative updates carefully."}]},{slug:"kyc-free-tokenized-stocks-guide",title:"KYC-Free Tokenized Stocks in 2026: Legit Options and Real Limits",metaTitle:"KYC-Free Tokenized Stocks (2026) â What's Legit",desc:"Where you can trade tokenized stocks without KYC in 2026, the real limits on size and geography, and how to stay compliant with your local laws.",keywords:"kyc free tokenized stocks, no kyc xstocks, permissionless tokenized stocks",hero:"Self-custody wallets don't require KYC. Your local law still might.",cta:{label:"Trade permissionless",href:"/trade"},sections:[{h2:"Where KYC is not required",p:["Fully on-chain venues (Jupiter, Raydium, Uniswap, Kamino) do not require KYC â your wallet is your identity. Redemption to the issuer typically does require KYC above certain thresholds ($50k+ for xStocks, all sizes for Ondo)."]},{h2:"Compliance reality check",p:["Absence of KYC at the venue does not mean absence of tax reporting obligation in your jurisdiction. Most countries require self-reporting of on-chain equity income. Use compliant record-keeping from day one."]}],faqs:[{q:"Can US residents trade KYC-free?",a:"Technically, DEX access is not geo-fenced. Practically, most tokenized stock issuers geo-block US persons, which shows up as thin liquidity and legal ambiguity. Consult a US securities attorney."}]}];function z$(e){return io({slug:e.slug,title:e.title,metaTitle:e.metaTitle,metaDescription:e.desc,keywords:e.keywords,heroTagline:e.hero,intent:"informational",readTime:"10 min read",category:"Trading Strategies",primaryCTA:e.cta,sections:e.sections.map(t=>({h2:t.h2,paragraphs:t.p,bullets:t.bullets})),faqs:e.faqs,relatedSlugs:["ai-trading-agents-for-stocks","how-to-buy-tokenized-stocks","best-tokenized-stocks-2026","24-7-stock-trading-guide"]})}const $$=D$.map(z$),F$=[{slug:"backed-finance-review",title:"Backed Finance Review 2026: The Company Behind xStocks",metaTitle:"Backed Finance Review 2026 â Deep Dive",desc:"Full review of Backed Finance, the issuer behind xStocks: regulatory setup, reserves, custody, product roadmap and how they compare to Ondo and Dinari.",keywords:"backed finance review, backed assets, backed finance xstocks, is backed finance safe",hero:"Backed is the Swiss/Liechtenstein-regulated issuer behind the largest tokenized equity family on-chain.",sections:[{h2:"Company & regulation",p:["Backed Assets (JE) Limited issues xStocks under a Liechtenstein TVTG prospectus. Reserves are custodied at InCore Bank, Switzerland. The parent group is headquartered in Zug."]},{h2:"Reserves & attestations",p:["Monthly audits by Network Firm. Real-time proof of reserves dashboard. Historically over-collateralised by 0.1-0.4%."]}],faqs:[{q:"Can I redeem xStocks directly with Backed?",a:"Yes, for qualified investors above $50k notional. Retail users typically redeem via secondary market on Kraken or Jupiter."}]},{slug:"dinari-review-2026",title:"Dinari Review 2026: Tokenized US Equities from a US Broker-Dealer",metaTitle:"Dinari Review 2026 â US Broker-Dealer Tokenized Stocks",desc:"Independent Dinari review for 2026 â the only tokenized stock issuer operating as a US SEC-registered broker-dealer. Fees, custody, tickers, verdict.",keywords:"dinari review, dinari tokenized stocks, dinari sec, us tokenized stocks",hero:"Dinari is the only tokenized stock issuer building on US regulatory rails.",sections:[{h2:"What makes Dinari different",p:["Dinari operates as a US SEC-registered broker-dealer and issues dShares â 1:1 backed tokenized US equities available to KYC'd users in supported jurisdictions."]}],faqs:[{q:"Can US residents use Dinari?",a:"Yes â Dinari is one of the only tokenized stock issuers accepting US persons after KYC."}]},{slug:"swarm-markets-review",title:"Swarm Markets Review 2026: Regulated Tokenized Stocks in Germany",metaTitle:"Swarm Markets Review 2026 â BaFin-Regulated Tokenized Stocks",de
545sc:"Full Swarm Markets review 2026: BaFin-licensed tokenized stocks, EU access, fee stack, supported tickers and how it compares to xStocks and Ondo.",keywords:"swarm markets review, swarm tokenized stocks, bafin tokenized stocks",hero:"The only BaFin-regulated tokenized stock exchange, purpose-built for EU access.",sections:[{h2:"Regulatory setup",p:["Swarm operates under a BaFin CRR license â the strictest tokenized-securities regulator in the EU. Every listed tokenized stock has a full securities prospectus."]}],faqs:[{q:"Is Swarm available worldwide?",a:"Access is primarily EU-focused, though some non-EU users can KYC in. US persons are not supported."}]},{slug:"kraken-tokenized-stocks-guide",title:"Kraken Tokenized Stocks: Complete 2026 User Guide",metaTitle:"Kraken Tokenized Stocks Guide (2026)",desc:"How to trade tokenized stocks on Kraken in 2026: available tickers, fees, KYC, custody, deposit/withdrawal and best-execution routing.",keywords:"kraken tokenized stocks, kraken xstocks, buy tokenized stocks kraken",hero:"Kraken hosts the deepest CEX liquidity for xStocks â here is how to use it well.",sections:[{h2:"Supported tickers",p:["Kraken lists all major xStocks including TSLAX, AAPLX, NVDAX, MSFTX, GOOGLX, METAX, AMZNX, COINX and SPYX. New listings track the xStocks roadmap."]},{h2:"Fees",p:["Standard Kraken maker/taker (0.16%/0.26%), tightening at higher tier. No hidden custody fees."]}],faqs:[{q:"Do I need to withdraw to self-custody?",a:"Not required â Kraken custody is fine for most users. Withdraw only if you plan to use tokens as DeFi collateral."}]},{slug:"bybit-tokenized-stocks-guide",title:"Bybit Tokenized Stocks: Complete 2026 User Guide",metaTitle:"Bybit Tokenized Stocks Guide (2026)",desc:"How to trade tokenized stocks on Bybit in 2026: supported tickers, fees, KYC requirements, deposit/withdrawal and best routing practices.",keywords:"bybit tokenized stocks, bybit xstocks, buy tokenized stocks bybit",hero:"Bybit's tokenized stock desk grew fastest in Asia-Pacific. Here is how to trade it.",sections:[{h2:"Available markets",p:["Bybit lists blue-chip xStocks including TSLAX, AAPLX, NVDAX and SPYX, plus perpetual futures on select tickers for leveraged directional exposure."]}],faqs:[{q:"Does Bybit offer leverage on tokenized stocks?",a:"Yes â up to 10x on select tickers via perp contracts. Not available in all jurisdictions."}]},{slug:"jupiter-tokenized-stocks-guide",title:"Jupiter Tokenized Stocks: Complete 2026 DEX Trading Guide",metaTitle:"Jupiter Tokenized Stocks Guide (2026)",desc:"How to trade tokenized stocks on Jupiter in 2026: swap execution, deep AMM pools, permissionless access and how to avoid MEV.",keywords:"jupiter tokenized stocks, jupiter xstocks, dex tokenized stocks",hero:"Jupiter aggregates the deepest permissionless liquidity for tokenized equities on Solana.",sections:[{h2:"Why Jupiter matters",p:["Jupiter is the routing layer for ~80% of tokenized equity swaps on Solana. Its aggregation finds the tightest price across Orca, Raydium, Meteora and private market makers."]}],faqs:[{q:"Do I need to KYC?",a:"No â Jupiter is permissionless. Any Solana wallet with USDC can trade."}]},{slug:"uniswap-tokenized-stocks-guide",title:"Uniswap Tokenized Stocks: 2026 Guide to EVM Trading",metaTitle:"Uniswap Tokenized Stocks Guide (2026)",desc:"How to trade tokenized stocks on Uniswap in 2026: supported chains, pool depth, fees and where liquidity is deepest.",keywords:"uniswap tokenized stocks, uniswap xstocks, tokenized stocks ethereum",hero:"For EVM-native traders, Uniswap hosts the deepest tokenized equity liquidity outside Solana.",sections:[{h2:"Where the liquidity lives",p:["Ethereum L1 and Base host the deepest Uniswap V4 pools for tokenized equities. Arbitrum is thinner but growing."]}],faqs:[{q:"Are Uniswap gas fees prohibitive?",a:"On L1, yes for small orders. Base or Arbitrum bring per-swap fees under $0.20."}]},{slug:"robinhood-tokenized-stocks",title:"Robinhood & Tokenized Stocks: What's Live in 2026?",metaTitle:"Robinhood Tokenized Stocks â 2026 Status",desc:"Where Robinhood stands on tokenized stocks in 2026: EU rollout, US timeline, competitive positioning vs xStocks and Ondo.",keywords:"robinhood tokenized stocks, robinhood tokenization, robinhood eu tokenized stocks",hero:"Robinhood is racing to bring tokenized stocks to Europe. Here is the state of play in 2026.",sections:[{h2:"The Robinhood approach",p:["Robinhood launched tokenized stock trading in Europe on Arbitrum in mid-2025. As of 2026 it supports 200+ US tickers for EU-based users."]}],faqs:[{q:"Can US residents trade Robinhood tokenized stocks?",a:"Not yet â the tokenized product is EU-only pending US regulatory clarity."}]},{slug:"coinbase-tokenized-stocks",title:"Coinbase & Tokenized Stocks: The 2026 Landscape",metaTitle:"Coinbase Tokenized Stocks â 2026 Status",desc:"Where Coinbase stands on tokenized stocks in 2026: Base ecosystem role, product timeline, and how they may enter the market.",keywords:"coinbase tokenized stocks, coinbase tokenization, base tokenized equities",hero:"Coinbase hasn't issued tokenized stocks yet â but Base is where a lot of the liquidity settles.",sections:[{h2:"Coinbase's indirect role",p:["Coinbase's Base chain hosts a growing share of EVM-side tokenized stock liquidity, and Coinbase itself has publicly signaled interest in launching tokenized equities pending US regulatory clarity."]}],faqs:[{q:"Can I buy tokenized stocks on Coinbase today?",a:"Not directly. Use Coinbase to on-ramp USDC to Base, then trade on Uniswap or Aerodrome."}]}];function B$(e){return io({slug:e.slug,title:e.title,metaTitle:e.metaTitle,metaDescription:e.desc,keywords:e.keywords,heroTagline:e.hero,intent:"commercial",readTime:"9 min read",category:"Venues & Providers",primaryCTA:{label:"Compare providers",href:"/integrations"},sections:e.sections.map(t=>({h2:t.h2,paragraphs:t.p,bullets:t.bullets})),faqs:e.faqs,relatedSlugs:["xstocks-review-2026","ondo-global-markets-review","how-to-buy-tokenized-stocks","best-tokenized-stocks-2026"]})}const U$=F$.map(B$),V$=[{slug:"tokenized-stocks-europe-guide",country:"Europe",access:"Full MiCA-regulated access via Swarm, Robinhood EU and Backed",venues:"Swarm (BaFin), Robinhood EU, Kraken EU, Jupiter",regulator:"ESMA + national regulators under MiCA framework"},{slug:"tokenized-stocks-uk-guide",country:"United Kingdom",access:"FCA-supervised access via Backed (registered) and select on-chain venues",venues:"Backed direct, Kraken UK, Jupiter",regulator:"Financial Conduct Authority (FCA)"},{slug:"tokenized-stocks-us-investors-guide",country:"United States",access:"Limited â Dinari (SEC broker-dealer) is the primary compliant venue",venues:"Dinari, select self-custody venues (own-risk)",regulator:"SEC + FINRA"},{slug:"tokenized-stocks-asia-guide",country:"Asia-Pacific",access:"Strong access via Singapore, Hong Kong and Jap
545an-based venues",venues:"Bybit, OKX, Jupiter",regulator:"MAS (SG), SFC (HK), FSA (JP)"},{slug:"tokenized-stocks-canada-guide",country:"Canada",access:"OSC-supervised access with growing 2026 approvals",venues:"Kraken CA, Jupiter (self-custody)",regulator:"OSC + CSA"},{slug:"tokenized-stocks-india-guide",country:"India",access:"Direct access via self-custody wallets; local exchange listings restricted",venues:"Jupiter, Uniswap, Backed direct",regulator:"SEBI + RBI"},{slug:"tokenized-stocks-nigeria-guide",country:"Nigeria",access:"Strong retail access via self-custody wallets",venues:"Jupiter, Uniswap, Backed",regulator:"SEC Nigeria"},{slug:"tokenized-stocks-brazil-guide",country:"Brazil",access:"CVM-supervised access growing; strong on-chain retail participation",venues:"Jupiter, Mercado Bitcoin, Backed",regulator:"CVM Brazil"}];function H$(e){return io({slug:e.slug,title:`Tokenized Stocks in ${e.country}: The 2026 Investor Guide`,metaTitle:`Tokenized Stocks ${e.country} â 2026 Investor Guide`,metaDescription:`Everything ${e.country}-based investors need to know about tokenized stocks in 2026: access, venues, regulation, tax and best-execution routing.`,keywords:`tokenized stocks ${e.country.toLowerCase()}, ${e.country.toLowerCase()} tokenized stocks, buy tokenized stocks ${e.country.toLowerCase()}`,heroTagline:`The complete 2026 guide to trading tokenized stocks from ${e.country}.`,intent:"informational",readTime:"8 min read",category:"Regional Guides",primaryCTA:{label:"Open the trade terminal",href:"/trade"},sections:[{h2:`Access in ${e.country}`,paragraphs:[e.access]},{h2:"Recommended venues",paragraphs:[e.venues]},{h2:"Regulator",paragraphs:[`Primary regulator(s): ${e.regulator}. Tokenized stocks generally fall under existing securities regulations in ${e.country}, with 2025-2026 seeing meaningful additional clarity on issuance, custody and secondary trading.`]},{h2:"How to get started",paragraphs:["Fund a self-custody wallet with USDC on Solana (cheapest, deepest liquidity). Open the TokenStocks.Ai trade terminal â the smart router picks the best venue for your jurisdiction automatically and routes to the tightest all-in cost across supported venues."]}],faqs:[{q:`Are tokenized stocks legal in ${e.country}?`,a:`Tokenized stocks are generally treated as securities under ${e.country}'s existing framework. Self-custody trading via on-chain venues is technically accessible; on/off-ramps and centralised venues follow local licensing requirements.`},{q:`What's the best on-ramp for ${e.country}?`,a:"USDC via a local exchange with fiat rails, then bridge to Solana for the deepest tokenized equity liquidity."}],relatedSlugs:["how-to-buy-tokenized-stocks","tokenized-stocks","best-tokenized-stocks-2026","ai-trading-agents-for-stocks"]})}const X$=V$.map(H$),q$=[{slug:"tokenized-stocks-dividends-guide",title:"Tokenized Stock Dividends: How They Actually Work (2026)",metaTitle:"Tokenized Stock Dividends â 2026 Guide",desc:"How dividends flow through tokenized stocks in 2026: reinvestment (xStocks) vs cash payout (Ondo), ex-date mechanics, tax treatment and NAV impact.",keywords:"tokenized stock dividends, xstocks dividends, ondo cash dividends",hero:"Dividends do reach tokenized shareholders â the mechanism just depends on the issuer.",category:"Fundamentals",cta:{label:"See methodology",href:"/methodology"},sections:[{h2:"Two dividend models",p:["xStocks reinvests cash dividends into token NAV â your token count is constant, price steps up on ex-date. Ondo pays cash dividends directly to token holders in USDC on ex-date."]},{h2:"Tax implications",p:["Reinvested dividends may still be taxable in your jurisdiction depending on local rules. Cash-paid dividends are typically taxable as income in the year received."]}],faqs:[{q:"Do I need to hold on ex-date?",a:"Yes â record-date rules apply exactly as for the underlying share."}]},{slug:"tokenized-stocks-custody-explained",title:"Tokenized Stock Custody Explained: Who Actually Holds Your Shares?",metaTitle:"Tokenized Stock Custody Explained (2026)",desc:"Where the underlying shares behind tokenized stocks actually live in 2026: custodians, bankruptcy-remoteness, proof of reserves and redemption rights.",keywords:"tokenized stock custody, xstocks custody, ondo custody, tokenized stock reserves",hero:"Every 1:1 backed token is a claim on a real share sitting in a real custodian.",category:"Fundamentals",cta:{label:"See transparency",href:"/transparency"},sections:[{h2:"xStocks custody chain",p:["Underlying shares are held at InCore Bank in Switzerland under a bankruptcy-remote structure. Backed Assets (JE) Limited is the issuer of the tokens."]},{h2:"Ondo custody chain",p:["Underlying shares are custodied at Clear Street in New York. Ondo Global Markets operates as a Bermuda DABA broker-dealer."]}],faqs:[{q:"What happens in issuer bankruptcy?",a:"Bankruptcy-remote custody means token holders have a direct claim on underlying shares even in issuer bankruptcy â analogous to an ETF winding down."}]},{slug:"tokenized-stocks-fees-explained",title:"Tokenized Stock Fees Explained: The 2026 Full-Stack Cost Breakdown",metaTitle:"Tokenized Stock Fees Explained (2026)",desc:"Every fee in the tokenized stock stack in 2026: issuance, redemption, venue spread, network gas, FX and slippage. How to keep all-in cost minimal.",keywords:"tokenized stock fees, xstocks fees, ondo fees, tokenized stock cost",hero:"The sticker fee is only 5% of the story. Here is the full cost stack.",category:"Fundamentals",cta:{label:"See fee analysis",href:"/methodology"},sections:[{h2:"The five fee layers",p:["Issuance/redemption (0.15â0.25%), venue spread (2â15 bps), network fees ($0.0002 Solana, $1â3 Ethereum L1), FX conversion (0% if USDC, up to 1% via card ramps), slippage (0â50 bps depending on size and depth)."]},{h2:"How to minimise all-in cost",p:["Use Solana venues for orders <$100k, split large orders via smart router, avoid card on-ramps (use ACH/SEPA), trade during US hours for tighter spreads."]}],faqs:[{q:"Is trading tokenized stocks cheaper than a broker?",a:"For non-US retail users, typically yes â no FX spread, no US ADR wrapper fees, no minimum ticket sizes."}]},{slug:"tokenized-stocks-liquidity-explained",title:"Tokenized Stock Liquidity Explained: Where the Real Depth Lives in 2026",metaTitle:"Tokenized Stock Liquidity (2026) â Where the Depth Is",desc:"The full 2026 picture of tokenized stock liquidity: CEX vs DEX depth, top venues by ticker, off-hours conditions and how the router finds best-of-book.",keywords:"tokenized stock liquidity, xstocks liquidity, best tokenized stock exchange",hero:"Fragmented across 6+ venues. Aggregated by TokenStocks.Ai in real time.",category:"Fundamentals",cta:{label:"See the analytics",href:"/analytics"},sections:[{h2:"Where depth actually sits",p:["Kraken and Jupiter carry the deepest xStocks liquidity. Bybit adds meaningful depth for Asia-Pacific hours. Uniswap V4 hosts the deepest EVM-side pools for Base and Ethereum."]},{h2:"Off-hours reality",p:["Overnight spreads widen 2-4x on single names. Blue-chip ETFs (SPYX, QQQX) stay under 10 bps even overnight due to constant AMM depth."]}],faqs:[{q:"Can I do a $1M ticket?",a:"Yes on blue chips via aggregated router execution. Expect 20â60 bps slippage on TSLAX/AAPLX during US hours."}]},{slug:"tokenized-stocks-regulation-2026",title:"Tokenized Stocks Regulation in 2026: The Global Landscape",metaTitle:"Tokenized Stocks Regulation 2026 â Global Guide",desc:"How tokenized stocks are regulated across the US, EU, UK, Switzerland, Singapore and Bermuda in 2026 â and how it affects where and how you trade.",keywords:"tokenized stocks regulation, tokenized securities law, mica tokenized stocks, sec tokenized stocks",hero:"Regulation caught up in 2025. Here is the 2026 map of what's actually allowed where.",category:"Regulation",cta:{label:"See compliance",href:"/kyb-compliance"},sections:[{h2:"The five major frameworks",p:["MiCA (EU) â full framework for tokenized securities. TVTG (Liechtenstein) â the original prospectus regime used by Backed/xStocks. DABA (Bermuda) â used by Ondo Global Markets. SEC/FINRA (US) â narrow permitted paths via broker-dealers like Dinari. MAS (Singapore) â accredited-investor tokenization sandbox."]}],faqs:[{q:"Are tokenized stocks legal everywhere?",a:"No. Access varies significantly by jurisdiction. Check your local rules before opening a position."}]},{slug:"future-of-tokenized-stocks",title:"The Future of Tokenized Stocks: 202
5456-2030 Outlook",metaTitle:"Future of Tokenized Stocks â 2026-2030 Outlook",desc:"Where tokenized stocks are heading between 2026 and 2030: growth projections, regulatory evolution, DeFi integration and the AI-driven trading stack.",keywords:"future of tokenized stocks, tokenized stocks 2030, tokenized equity outlook",hero:"By 2030, most equity trading will settle on-chain. Here is the path from here.",category:"Analysis",cta:{label:"See our thesis",href:"/about"},sections:[{h2:"The five-year path",p:["2026: Tokenized equity AUM crosses $50B, TokenStocks.Ai-style AI agents become the default execution layer. 2028: Major US brokers offer tokenized rails alongside traditional. 2030: >50% of retail equity settlement occurs on-chain."]}],faqs:[{q:"Will traditional brokers go away?",a:"Not entirely â but tokenized rails will subsume most of the flow that was moved by cost or 24/7 access."}]},{slug:"top-tokenized-ai-stocks",title:"The Top Tokenized AI Stocks to Own in 2026",metaTitle:"Top Tokenized AI Stocks 2026 â NVDAX, MSFTX, PLTX & More",desc:"The 10 best tokenized AI stocks in 2026: NVDAX, MSFTX, GOOGLX, PLTX, AMDX and more â with live AI agent signals and 24/7 exposure.",keywords:"tokenized ai stocks, best ai stock tokens, nvdax msftx pltx",hero:"Ride the AI supercycle 24/7 through tokenized versions of the biggest AI winners.",category:"Rankings",cta:{label:"See the leaderboard",href:"/leaderboard"},sections:[{h2:"The top 10 tokenized AI names",p:["NVDAX (compute), MSFTX (Azure + Copilot), GOOGLX (Gemini + TPU), PLTX (enterprise AI), AMDX (challenger compute), ORCLX (surprise AI cloud winner), METAX (Llama monetization), CRMX (Agentforce), AMZNX (AWS AI), TSLAX (autonomy + Optimus)."],bullets:["NVDAX â the compute layer","MSFTX â the productivity layer","GOOGLX â the model + infra layer","PLTX â the enterprise deployment layer","AMDX â the challenger compute layer"]}],faqs:[{q:"Which has the highest AI agent win rate?",a:"NVDAX (74% hit rate) and PLTX (72%) currently lead â but the leaderboard rotates. Use Quick Trade to auto-follow the current #1."}]},{slug:"top-tokenized-stocks-under-100",title:"The Best Tokenized Stocks Under $100 in 2026",metaTitle:"Best Tokenized Stocks Under $100 (2026) â Fractional Winners",desc:"Top tokenized stocks trading under $100 in 2026 â great for building diversified positions in $10-500 increments. Full 2026 list with AI signals.",keywords:"tokenized stocks under 100, cheap tokenized stocks, fractional tokenized stocks",hero:"Every tokenized stock is fractional â but these carry the friendliest sticker prices.",category:"Rankings",cta:{label:"See the leaderboard",href:"/leaderboard"},sections:[{h2:"The list",p:["AMDX, PLTX, HOODX, UBERX, INTCX, PFEon, BABAon, KOon, GLDX and select others regularly trade under $100. All are fractional so this matters more for portfolio construction than for access."]}],faqs:[{q:"Is a $100 stock better than a $500 stock?",a:"No â economically identical. Sticker price only matters if you're building a portfolio in whole shares, which tokenization makes obsolete."}]},{slug:"tokenized-etf-guide",title:"The Complete Guide to Tokenized ETFs in 2026",metaTitle:"Tokenized ETFs Guide 2026 â SPYX, QQQX, GLDX & More",desc:"Everything about tokenized ETFs in 2026: SPYX, QQQX, GLDX, ARKX. Fees, custody, dividends, DeFi collateral use and how they compare to traditional ETFs.",keywords:"tokenized etf, spyx qqqx gldx, tokenized index funds, tokenized sp500",hero:"Broad-market exposure on-chain â the safest starting point for tokenized equities.",category:"Fundamentals",cta:{label:"Trade SPYX",href:"/SPYX"},sections:[{h2:"The four core tokenized ETFs",p:["SPYX (S&P 500), QQQX (Nasdaq 100), GLDX (gold), ARKX (ARK Innovation). Combined AUM crossed $2B in H1 2026."]}],faqs:[{q:"Which tokenized ETF is best for beginners?",a:"SPYX â diversified, deep liquidity, low volatility."}]},{slug:"tokenized-stocks-yield-strategies",title:"Yield Strategies for Tokenized Stocks in 2026",metaTitle:"Tokenized Stocks Yield Strategies (2026)",desc:"How to generate additional yield on tokenized stock positions in 2026: DeFi lending, LP provision, dividend reinvestment and covered-call synthetic strategies.",keywords:"tokenized stocks yield, xstocks lending, tokenized stocks lp yield",hero:"Your tokenized stock position can earn 3-12% extra without leaving the wallet.",category:"Trading Strategies",cta:{label:"Explore DeFi collateral",href:"/integrations"},sections:[{h2:"The three yield paths",p:["1) Lend on Kamino/Marginfi at 3-6% APY. 2) LP into TSLAX/USDC on Meteora at 8-12% APY (with IL risk). 3) Post as collateral, borrow stables, deploy in T-bills â synthetic covered position."]}],faqs:[{q:"Is LP yield real?",a:"Yes â but impermanent loss on volatile single names can eat 30-50% of yield during trending moves. Concentrated ETF pairs are safer."}]}];function G$(e){return io({slug:e.slug,title:e.title,metaTitle:e.metaTitle,metaDescription:e.desc,keywords:e.keywords,heroTagline:e.hero,intent:"informational",readTime:"9 min read",category:e.category,primaryCTA:e.cta,sections:e.sections.map(t=>({h2:t.h2,paragraphs:t.p,bullets:t.bullets})),faqs:e.faqs,relatedSlugs:["how-to-buy-tokenized-stocks","best-tokenized-stocks-2026","tokenized-stocks","ai-trading-agents-for-stocks"]})}
545const W$=q$.map(G$),K$=[...j$,...O$,...L$,...$$,...U$,...X$,...W$],V0="2026-07-09",Y$=e=>({...e,datePublished:V0,dateModified:V0}),Ke=e=>e.toLowerCase(),H0=e=>e.provider==="xStocks"?"1:1 shares custodied at InCore Bank (Switzerland) under a Liechtenstein TVTG prospectus, audited monthly.":"1:1 shares custodied at Clear Street (New York) under Ondo's Bermuda DABA broker-dealer, attested daily.",X0=e=>e.provider==="xStocks"?"Cash dividends are auto-reinvested into token NAV â the token count stays flat while price steps up on ex-date.":"Cash dividends are streamed directly to token holders in USDC on ex-dividend date.",pc=e=>e.provider==="xStocks"?"Kraken (spot), Bybit (spot), Jupiter (Solana AMM), Raydium and Kamino.":"Ondo's native AMM, Bybit, and Ethereum / Sui DEX routing.",Q$=[{suffix:"price-prediction-2026",title:e=>`${e.ticker} Price Prediction 2026: What AI Agents See for Tokenized ${e.name}`,metaTitle:e=>`${e.ticker} Price Prediction 2026 â Tokenized ${e.name} Forecast`,metaDescription:e=>`${e.ticker} price prediction for 2026: base case, bull case, bear case for tokenized ${e.name}, driven by live AI agent forecasts and macro factor exposure.`,keywords:e=>`${e.ticker} price prediction, ${e.ticker} forecast 2026, ${Ke(e.underlying)} price target, tokenized ${Ke(e.name)} forecast`,hero:e=>`AI-driven price scenarios for ${e.ticker} â updated every close from live agent consensus.`,intent:"informational",readTime:"7 min read",category:"Price Forecasts",cta:e=>({label:`See live ${e.ticker} signal`,href:`/${e.ticker}`}),sections:e=>[{h2:`${e.ticker} 2026 base case`,paragraphs:[`Our MetaJudge ensemble weights the Market, Fundamental, Sentiment and Risk agents for ${e.ticker} to produce a probabilistic 12-month range. The base case reflects consensus earnings + current macro regime.`,`Thesis: ${e.thesis}`]},{h2:"Bull case drivers",paragraphs:[`${e.name} outperforms if: (a) the sector remains in favour, (b) ${e.category==="high beta"?"risk assets bid":"macro stays constructive"}, and (c) tokenization adoption keeps compressing the discount between on-chain and off-chain pricing.`]},{h2:"Bear case drivers",paragraphs:[`Downside asymmetry comes from: (a) a broad multiple contraction, (b) idiosyncratic ${e.name} earnings disappointment, and (c) tokenized-equity liquidity shocks that widen the on-chain premium/discount to underlying.`]},{h2:"How to use these forecasts",paragraphs:[`Forecasts are decision inputs, not price targets. Combine with live ${e.ticker} agent conviction on the ticker page and never risk more than your stop-loss allows. TokenStocks.Ai signals refresh sub-2s; forecasts refresh every close.`]}],faqs:e=>[{q:`How accurate are ${e.ticker} price predictions?`,a:"Every published prediction is versioned and its calibration is scored on the transparency page. We publish agent Brier scores so you can weight predictions by track record."},{q:"Do predictions factor in tokenized-specific risk?",a:"Yes â issuer, custody, and on-chain liquidity risk are inputs to the Risk Agent and reduce conviction accordingly."},{q:"Where does the live signal live?",a:`On the ${e.ticker} asset page and inside Quick Trade.`}]},{suffix:"price-prediction-2027",title:e=>`${e.ticker} Price Prediction 2027: Long-Term Outlook for Tokenized ${e.name}`,metaTitle:e=>`${e.ticker} Price Prediction 2027 â Long-Term ${e.name} Outlook`,metaDescription:e=>`${e.ticker} 2027 price prediction: multi-year scenario analysis for tokenized ${e.name}, factoring in tokenization adoption, macro, and ${e.name}'s core thesis.`,keywords:e=>`${e.ticker} 2027 prediction, ${e.ticker} long term forecast, ${Ke(e.underlying)} 2027 target`,hero:e=>`The 2027 outlook for ${e.ticker} â where AI agents converge on long-term value.`,intent:"informational",readTime:"8 min read",category:"Price Forecasts",cta:e=>({label:`Trade ${e.ticker} now`,href:`/${e.ticker}`}),sections:e=>[{h2:`Why 2027 matters for ${e.name}`,paragraphs:[e.thesis,`By 2027, tokenized-equity float is projected to exceed $500B TVL, pulling on-chain spreads within 1bp of off-chain. That structurally rewards early liquidity providers in ${e.t
545icker}.`]},{h2:"Multi-year scenario table",paragraphs:[`Base: consensus EPS growth + flat multiple. Bull: EPS beats + multiple expansion driven by ${e.category} rotation. Bear: multi-quarter earnings compression + macro shock.`]},{h2:"Rebalancing cadence",paragraphs:[`For a 2027-horizon position in ${e.ticker}, we recommend quarterly rebalances triggered by MetaJudge conviction crossing +/- 20 percentile shifts.`]}],faqs:e=>[{q:`Should I hold ${e.ticker} for years?`,a:`${e.name} is a ${e.volatility}-volatility ${e.category} name. Long-term suitability depends on your risk budget and portfolio mix.`},{q:"What derails a 2027 target?",a:"Macro regime shift, idiosyncratic earnings surprises, and tokenization-provider counterparty risk are the three biggest tail-risks."},{q:"Do you publish revisions?",a:"Yes â every forecast update is logged on the transparency page with a diff."}]},{suffix:"is-a-good-investment",title:e=>`Is ${e.ticker} a Good Investment in 2026? Tokenized ${e.name} Deep Dive`,metaTitle:e=>`Is ${e.ticker} a Good Investment (2026)? â Tokenized ${e.name}`,metaDescription:e=>`Is ${e.ticker} â tokenized ${e.name} â a good investment in 2026? Independent breakdown of the bull case, risks, custody, dividends and where to buy.`,keywords:e=>`is ${e.ticker} a good investment, ${e.ticker} review, buy tokenized ${Ke(e.name)}, ${Ke(e.underlying)} on chain review`,hero:e=>`The honest 2026 case for owning ${e.ticker} â bull, bear and structural.`,intent:"commercial",readTime:"9 min read",category:"Investment Reviews",cta:e=>({label:`Trade ${e.ticker}`,href:`/${e.ticker}`}),sections:e=>[{h2:"The bull case",paragraphs:[e.thesis,`Tokenization adds three real edges over the underlying ${e.underlying}: 24/7 trading, sub-cent fractional sizing, and native DeFi collateral utility.`]},{h2:"The bear case",paragraphs:[`Downside: ${e.category==="high beta"?"high beta amplifies drawdowns in risk-off tape":"quality-name compression can still cost 15%+ in a de-rating"}. Add issuer and custody counterparty risk on top of the underlying equity risk.`]},{h2:"Fees, custody & dividends",paragraphs:[H0(e),X0(e)]},{h2:"Verdict framework",paragraphs:[`${e.ticker} makes sense if you want ${e.name} exposure with 24/7 access and DeFi utility, and you accept the extra custody layer. It does not replace a taxable brokerage account for tax-advantaged strategies.`]}],faqs:e=>[{q:`Is ${e.ticker} safe?`,a:`Safety is a stack: underlying ${e.underlying} risk + provider issuance risk + custody risk + venue risk. Each layer is disclosed on the provider's proof-of-reserves page.`},{q:`Does ${e.ticker} outperform ${e.underlying}?`,a:"Economically identical during market hours. Extra alpha comes from 24/7 access and DeFi yield, not from the token itself."},{q:"Where should I buy?",a:`Deepest liquidity: ${pc(e)}`}]},{suffix:"dividend-guide",title:e=>`${e.ticker} Dividend Guide 2026: How Tokenized ${e.name} Dividends Actually Work`,metaTitle:e=>`${e.ticker} Dividends (2026) â How Tokenized ${e.name} Pays`,metaDescription:e=>`Everything about ${e.ticker} dividends in 2026: payment mechanism, ex-date behaviour, tax treatment and how they compare to holding ${e.underlying} directly.`,keywords:e=>`${e.ticker} dividend, tokenized ${Ke(e.name)} dividend, ${Ke(e.underlying)} on chain dividend, xstocks dividend, ondo dividend`,hero:e=>`The complete mechanics of ${e.ticker} dividend flow â from ex-date to your wallet.`,intent:"informational",readTime:"6 min read",category:"Dividends",cta:e=>({label:`Trade ${e.ticker}`,href:`/${e.ticker}`}),sections:e=>[{h2:`How ${e.ticker} handles dividends`,paragraphs:[X0(e),"The mechanism is transparent on-chain: for xStocks the reserve NAV updates on ex-date; for Ondo, a USDC payment stream posts to holders' wallets."]},{h2:"Ex-date behaviour",paragraphs:["Watch for the pre-ex bid-up and post-ex drop. On tokenized names the effect is identical to the underlying, but 24/7 trading means the reprice can happen off-hours â a real edge for AI agents that catch the move."]},{h2:"Tax treatment",paragraphs:["Consult a local tax advisor. Most jurisdictions treat tokenized-equity divi
545dends as ordinary dividend income. Records are on-chain and easily exportable via TokenStocks.Ai's reporting endpoints."]}],faqs:e=>[{q:"Do I get the full dividend?",a:"Yes, minus provider withholding where required by the underlying jurisdiction (typically 15-30% US withholding for non-residents)."},{q:`Can I DRIP ${e.ticker}?`,a:`${e.provider==="xStocks"?"Effectively yes â xStocks reinvests automatically.":"Manual DRIP: use the USDC dividend to buy more Ondo tokens instantly with zero settlement lag."}`},{q:"What about special dividends?",a:"Handled the same way â reserve adjustment (xStocks) or one-off USDC payout (Ondo)."}]},{suffix:"technical-analysis-2026",title:e=>`${e.ticker} Technical Analysis 2026: Levels, Regime and AI Signals`,metaTitle:e=>`${e.ticker} Technical Analysis (2026) â Levels & AI Signal`,metaDescription:e=>`Live 2026 technical analysis for ${e.ticker}: support / resistance, trend regime, volume profile and how the Market Agent reads tokenized ${e.name}.`,keywords:e=>`${e.ticker} technical analysis, ${e.ticker} chart, ${Ke(e.underlying)} chart, ${e.ticker} support resistance`,hero:e=>"TA that adjusts to tokenized microstructure â not a copy-paste of the underlying chart.",intent:"informational",readTime:"7 min read",category:"Technical Analysis",cta:e=>({label:`Open the ${e.ticker} chart`,href:`/${e.ticker}`}),sections:e=>[{h2:"Regime",paragraphs:[`The Market Agent classifies ${e.ticker} into one of three regimes: trending, mean-reverting, and dislocation. Regime shifts are the single highest-conviction TA event on tokenized stocks.`]},{h2:"Support & resistance",paragraphs:["On-chain liquidity clusters (concentrated AMM liquidity) create real technical levels that don't exist on the underlying chart. TokenStocks.Ai renders both underlying and on-chain levels together."]},{h2:"Volume profile",paragraphs:["Off-hours volume patterns often front-run the NYSE open by 10-30 minutes. Track the pre-9:30 ET drift as an early signal."]}],faqs:e=>[{q:"Is TA even valid on tokenized stocks?",a:"Yes. Microstructure differs but classic trend/mean-reversion setups still work â often better because of 24/7 continuous price discovery."},{q:"Which timeframe works best?",a:"1h and 4h for swing setups; 5m and 15m for intraday. Below 1m, on-chain slippage dominates signal."},{q:"Which indicator does the Market Agent use?",a:"Ensembles VWAP z-score, ATR-normalised trend, and orderbook imbalance â full spec on the methodology page."}]},{suffix:"fundamental-analysis-2026",title:e=>`${e.ticker} Fundamental Analysis 2026: Earnings, Guidance and AI Consensus`,metaTitle:e=>`${e.ticker} Fundamentals (2026) â Earnings & AI View`,metaDescription:e=>`2026 fundamental analysis for ${e.ticker} â tokenized ${e.name}: earnings, guidance, margin trajectory, insider flow and Fundamental Agent conviction.`,keywords:e=>`${e.ticker} fundamentals, ${e.ticker} earnings, ${Ke(e.underlying)} earnings analysis, tokenized ${Ke(e.name)} fundamentals`,hero:e=>"Where the numbers stand â and what our Fundamental Agent thinks about them.",intent:"informational",readTime:"8 min read",category:"Fundamentals",cta:e=>({label:`See ${e.ticker} data room`,href:`/${e.ticker}`}),sections:e=>[{h2:"Earnings & guidance",paragraphs:[`The Fundamental Agent parses every earnings release, guidance update and insider filing for ${e.underlying} within 30 seconds of publication and updates conviction scores in real time.`,`Current thesis: ${e.thesis}`]},{h2:"Margins & cash conversion",paragraphs:[`${e.category==="blue chip"?"Blue-chip cash conversion means the market watches operating leverage more than growth.":e.category==="high beta"?"For high-beta names, growth acceleration matters more than absolute margin.":"Track FCF conversion vs. reported earnings â that gap is the highest-signal metric."}`]},{h2:"Insider flow",paragraphs:["Insider selling is not always bearish (planned 10b5-1 sales), but insider buying is nearly always constructive. The Fundamental Agent weights buys 4x sells."]}],faqs:e=>[{q:"How fast is fundamental data?",a:"SEC filings within 30 seconds of Edgar publication; earnings transcripts within 5 minutes of the call ending."},{q:"Does the token affect fundamentals?",a:"No â economic claim tracks underlying share 1:1. Only issuer risk is additive."},{q:"Where can I see historical calls?",a:`On the ${e.ticker} asset page, under the Fundamentals tab.`}]},{suffix:"ai-signals-live",title:e=>`${e.ticker} Live AI Signals 2026: Multi-Agent Consensus for Tokenized ${e.name}`,metaTitle:e=>`${e.ticker} Live AI Signals (2026) â Multi-Agent`,metaDescription:e=>`Live AI trading signals for ${e.ticker} in 2026 â Market, Fundamental, Sentiment, Risk and MetaJudge agents publishing sub-2s conviction on tokenized ${e.name}.`,keywords:e=>`${e.ticker} ai signals, ${e.ticker} trading signals, ${Ke(e.underlying)}
545 ai signals, tokenized ${Ke(e.name)} signals`,hero:e=>`The 5-agent organism for ${e.ticker} â every conviction, verified against real fills.`,intent:"commercial",readTime:"6 min read",category:"AI Signals",cta:e=>({label:`Follow ${e.ticker} signal live`,href:`/${e.ticker}`}),sections:e=>[{h2:"The 5 agents",paragraphs:[`Every ${e.ticker} decision is the output of five specialised agents ensembled by MetaJudge:`],bullets:["Market Agent â technicals + microstructure","Fundamental Agent â earnings, guidance, insider flow","Sentiment Agent â news + social","Risk Agent â drawdown control","MetaJudge â Bayesian ensembler with Platt-calibrated conviction"]},{h2:"Track record",paragraphs:[`All ${e.ticker} signals are live-verified against actual market prices â no backtests. Historical Brier scores per agent are on the transparency page and update daily.`]},{h2:"How to consume",paragraphs:[`Three surfaces: ${e.ticker} asset page (visual), Quick Trade (execute), and the /api endpoint (programmatic).`]}],faqs:e=>[{q:"Are signals real or paper?",a:"Real. Every signal is submitted before the outcome is known and scored against realised prices."},{q:"What's the fastest end-to-end latency?",a:"Sub-2s from signal generation to Quick Trade order execution."},{q:"Can I get signals via API?",a:`Yes â see /api for the ${e.ticker} signal stream endpoint.`}]},{suffix:"24-7-trading-hours",title:e=>`${e.ticker} 24/7 Trading: How Tokenized ${e.name} Trades Off-Hours`,metaTitle:e=>`${e.ticker} 24/7 Trading (2026) â Off-Hours Guide`,metaDescription:e=>`${e.ticker} trades 24/7/365. Here's what actually happens off-hours to tokenized ${e.name} prices, liquidity, spreads and how to trade the overnight session.`,keywords:e=>`${e.ticker} 24 7 trading, ${e.ticker} weekend trading, tokenized ${Ke(e.name)} off hours, ${Ke(e.underlying)} overnight`,hero:e=>"The overnight and weekend session is where tokenized stocks earn their premium.",intent:"informational",readTime:"6 min read",category:"Market Structure",cta:e=>({label:`See live ${e.ticker} price`,href:`/${e.ticker}`}),sections:e=>[{h2:"Off-hours pricing",paragraphs:[`When NYSE is closed, ${e.ticker} continues trading with prices anchored to ${e.exchange} futures, global ADR proxies, and on-chain order flow. Spreads widen, but discovery never stops.`]},{h2:"Weekend session",paragraphs:[`Weekend liquidity is 10-20% of weekday levels. The best strategy: reduce size, widen limit orders, and let the smart-order router hunt across ${pc(e)}`]},{h2:"Crypto correlation windows",paragraphs:[`During Asia hours, ${e.ticker} often correlates with BTC/ETH flow before decoupling on the NYSE open. Track the divergence for edge.`]}],faqs:e=>[{q:"Is off-hours price real?",a:"Yes â real fills against on-chain and centralised order books. Not an indicator, an actual tradeable market."},{q:"What are the spreads?",a:`Typically 3-15bps on ${e.ticker} during US hours; 20-80bps off-hours depending on venue.`},{q:"Can I set take-profit off-hours?",a:"Yes â TokenStocks.Ai auto-executes conditional orders 24/7."}]},{suffix:"liquidity-and-spreads",title:e=>`${e.ticker} Liquidity & Spreads 2026: Where to Get the Best Fill`,metaTitle:e=>`${e.ticker} Liquidity & Spreads (2026) â Best Venue`,metaDescription:e=>`Deep dive into ${e.ticker} liquidity in 2026: bid-ask spreads, venue-by-venue depth and how TokenStocks.Ai's smart-order router chooses your fill.`,keywords:e=>`${e.ticker} liquidity, ${e.ticker} spreads, tokenized ${Ke(e.name)} order book, best ${e.ticker} venue`,hero:e=>`Where the real ${e.ticker} liquidity lives â and how to hit it without paying up.`,intent:"informational",readTime:"7 min read",category:"Market Structure",cta:e=>({label:`Route a ${e.ticker} fill`,href:"/trade"}),sections:e=>[{h2:"Venue map",paragraphs:[`Primary liquidity for ${e.ticker}: ${pc(e)} The smart-order router queries all venues in parallel and splits fills to minimise slippage.`]},{h2:"Spread benchmarks",paragraphs:["During US hours: tight (3-10bp). Post-close: mid (10-30bp). Weekends: wide (30-80bp). Size below top-of-book to stay inside these ranges."]},{h2:"When to use direct redemption",paragraphs:["For orders >$100k during off-hours, direct redemption to the issuer at NAV often beats venue liquidity."]}],faqs:e=>[{q:"Where's the deepest book?",a:`${e.provider==="xStocks"?"Kraken for CEX depth, Jupiter for Solana AMM depth.":"Bybit and Ondo's native AMM."}`},{q:"Do I need to shop venues?",a:"No â the router does it in <100ms. You always see the aggregated best price."},{q:"What causes wide spreads?",a:`Off-hours + low ${e.category} demand + macro volatility. Wait or size down.`}]},{suffix:"fees-explained",title:e=>`${e.ticker} Fees Explained (2026): Every Cost of Trading Tokenized ${e.name}`,metaTitle:e=>`${e.ticker} Fees (2026) â Full Cost Breakdown`,metaDescription:e=>`Complete 2026 fee breakdown for ${e.ticker}: issuance / redemption fees, venue spreads, network gas, and how they compare to a traditional ${e.underlying} brokerage.`,keywords:e=>`${e.ticker}
545 fees, tokenized ${Ke(e.name)} cost, ${Ke(e.underlying)} on chain fees, xstocks fees, ondo fees`,hero:e=>`Every fee that touches a ${e.ticker} trade â no hidden costs, no games.`,intent:"informational",readTime:"5 min read",category:"Fees & Costs",cta:e=>({label:`Trade ${e.ticker}`,href:`/${e.ticker}`}),sections:e=>[{h2:"Issuance & redemption",paragraphs:[`${e.provider==="xStocks"?"xStocks: 0.15% issuance + 0.15% redemption, no management fee.":"Ondo: 0.20% issuance + 0.20% redemption, no management fee."} These fees only apply if you mint/redeem directly with the issuer. Secondary market trades on ${pc(e)} pay only the venue's own fees.`]},{h2:"Venue fees",paragraphs:["Kraken/Bybit: 0.10-0.26% maker/taker. Jupiter/Raydium: 0.20-0.30% swap. Uniswap: 0.30% pool fee. Ondo AMM: 0.20% pool fee."]},{h2:"Network gas",paragraphs:["Solana: <$0.001. Ethereum L1: $1-8. Base/Arbitrum: <$0.05. Choose the network that matches your ticket size."]}],faqs:e=>[{q:`Cheapest way to trade ${e.ticker}?`,a:`${e.provider==="xStocks"?"Jupiter on Solana for size <$25k; Kraken for larger tickets.":"Ondo native AMM for retail; direct issuance for institutional size."}`},{q:"Are there management fees?",a:"No management fees on either xStocks or Ondo tokenized single-name stocks in 2026."},{q:"How do fees compare to a broker?",a:"Similar for small orders (<$1k), often cheaper for on-chain composability where the token also earns collateral yield."}]},{suffix:"vs-cfd",title:e=>`${e.ticker} vs ${e.underlying} CFD: Which Is Better in 2026?`,metaTitle:e=>`${e.ticker} vs ${e.underlying} CFD (2026)`,metaDescription:e=>`Head-to-head 2026 comparison of tokenized ${e.name} (${e.ticker}) vs a ${e.underlying} CFD: ownership, spreads, overnight financing, leverage and custody risk.`,keywords:e=>`${e.ticker} vs cfd, tokenized ${Ke(e.name)} vs cfd, ${Ke(e.underlying)} cfd alternative`,hero:e=>`A CFD is a bet. ${e.ticker} is ownership. Here is how they compare on real cost.`,intent:"comparison",readTime:"7 min read",category:"Comparisons",cta:e=>({label:`Trade ${e.ticker}`,href:`/${e.ticker}`}),sections:e=>[{h2:"What you actually own",paragraphs:[`${e.ticker} is a 1:1 claim on ${e.underlying} shares. A CFD is a bilateral contract with a broker â you own the P&L, not the share, and your counterparty is the broker.`]},{h2:"Total cost comparison",paragraphs:[`CFD: tight spread but overnight financing of 3-6% APR. ${e.ticker}: 3-30bp spread + optional DeFi yield (0-5%) instead of paying financing.`]},{h2:"Custody & counterparty",paragraphs:[H0(e),"CFD counterparty risk = broker balance sheet. Tokenized counterparty risk = issuer + custodian bank + smart contract."]}],faqs:e=>[{q:"Is a CFD cheaper for day trading?",a:"Sometimes â tighter spreads help. But you lose 24/7 access, ownership, and the ability to earn on-chain yield."},{q:`Can I leverage ${e.ticker}?`,a:`Yes â post ${e.ticker} as collateral on Kamino or Aave and borrow stablecoins. Effective leverage 1.5-3x with margin call safety.`},{q:"Which is better for long holds?",a:`${e.ticker} â no daily financing bleed.`}]},{suffix:"as-defi-collateral",title:e=>`${e.ticker} as DeFi Collateral 2026: Borrow, Lend and Earn on Tokenized ${e.name}`,metaTitle:e=>`${e.ticker} DeFi Collateral (2026) â Borrow & Lend`,metaDescription:e=>`How to use ${e.ticker} â tokenized ${e.name} â as DeFi collateral in 2026: borrow stablecoins, earn lend yield, and stay margin-safe with real-time risk.`,keywords:e=>`${e.ticker} defi, ${e.ticker} collateral, borrow against tokenized ${Ke(e.name)}, ${e.ticker} yield`,hero:e=>`Real equity exposure that also earns DeFi yield â the killer feature of ${e.ticker}.`,intent:"commercial",readTime:"7 min read",category:"DeFi Utility",cta:e=>({label:`Trade ${e.ticker}`,href:`/${e.ticker}`}),sections:e=>[{h2:`Where ${e.ticker} is accepted`,paragraphs:[`${e.provider==="xStocks"?"Kamino (Solana), MarginFi and Drift accept xStocks with LTVs of 50-75%.":"Aave v3, Morpho and Ondo's native lending markets accept Ondo tokens with LTVs of 60-80% given regulated custody."}`]},{h2:"Yield stack",paragraphs:[`Base yield: lending APR 2-8% on ${e.ticker}. Additive: ${e.provider==="xStocks"?"MEV rebates on Solana AMM LP.":"USDC dividend passthrough from Ondo."} Combined effective yield often runs 5-12% before dividends.`]},{h2:"Risk management",paragraphs:[`Margin call risk is real. TokenStocks.Ai's exposure panel surfaces liquidation distance in real time and auto-suggests deleverage when the ${e.ticker} price is within 15% of your liquidation threshold.`]}],faqs:e=>[{q:`Can I lose my ${e.ticker} to liquidation?`,a:"Yes if collateral value drops below the maintenance LTV. Use conservative sizing (max 40% of the allowed LTV)."},{q:"Are yields sustainable?",a:"Lend yields fluctuate with borrow demand. Stress-test at 0% yield before adding leverage."},{q:`What if the ${e.provider} issuer pauses?`,a:"Redemption pauses do not affect on-chain trading; yields may compress temporarily."}]}],q0=new Set,CA=[];
545for(const e of wg)for(const t of Q$){const n=`${e.ticker.toLowerCase()}-${t.suffix}`;q0.has(n)||(q0.add(n),CA.push(Y$({slug:n,title:t.title(e),metaTitle:t.metaTitle(e),metaDescription:t.metaDescription(e),keywords:t.keywords(e),heroTagline:t.hero(e),intent:t.intent,readTime:t.readTime,category:t.category,primaryCTA:t.cta(e),sections:t.sections(e),faqs:t.faqs(e),relatedSlugs:[`tokenized-${e.slugName}-stock-${e.ticker.toLowerCase()}`,`${e.ticker.toLowerCase()}-price-prediction-2026`,`${e.ticker.toLowerCase()}-ai-signals-live`,"best-tokenized-stocks-2026","how-to-buy-tokenized-stocks"].filter(r=>r!==n)})))}const J$=CA,Ye="2026-07-09",ar=[{slug:"how-to-buy-tokenized-stocks",title:"How to Buy Tokenized Stocks: The 2026 Step-by-Step Guide",metaTitle:"How to Buy Tokenized Stocks in 2026 (Step-by-Step)",metaDescription:"The complete step-by-step guide to buying tokenized stocks in 2026. Compare Kraken, Bybit, Jupiter and Uniswap, fund your wallet, and place your first trade in minutes.",keywords:"how to buy tokenized stocks, buy xstocks, buy ondo stocks, tokenized apple, tokenized tesla, buy stock tokens",heroTagline:"Buy real, 1:1 backed stock tokens 24/7 from any country â no brokerage account required.",intent:"transactional",readTime:"9 min read",datePublished:Ye,dateModified:Ye,category:"Getting Started",primaryCTA:{label:"Open the Trade Terminal",href:"/trade"},sections:[{h2:"What you need before buying tokenized stocks",paragraphs:["Before your first purchase you need three things: a self-custody wallet (Phantom, Rabby or MetaMask), a small amount of stablecoin (USDC or USDT) on Solana, Ethereum or Base, and a verified account on a supporting venue if you prefer a centralized exchange.","TokenStocks.Ai lets you skip venue selection entirely â our smart-order router scans Kraken, Bybit, Gemini, Jupiter, Raydium and Uniswap and executes on whichever venue offers the tightest spread at the moment of your click."],bullets:["Self-custody wallet (Phantom for Solana, Rabby/MetaMask for EVM)","USDC or USDT stablecoin on Solana, Ethereum, Base or Arbitrum","Optional: KYC-verified account on Kraken, Bybit or Gemini","5 minutes â that is all it takes end-to-end"]},{h2:"Step 1 â Choose the ticker you want to own",paragraphs:["The most liquid tokenized equities in 2026 are TSLAX, AAPLX, NVDAX, MSFTX, GOOGLX, METAX, AMZNX and COINX from xStocks, plus TSLAon, AAPLon and NVDAon from Ondo Global Markets. All are 1:1 backed by shares held in regulated custody.","Open the TokenStocks.Ai leaderboard to see which agent is currently winning on your ticker â top agents like Quant Strat and Risk Desk publish live-verified accuracy so you can piggyback on the best-performing signal in real time."]},{h2:"Step 2 â Fund your wallet with stablecoin",paragraphs:["On-ramp USDC via Coinbase, Kraken, or MoonPay. Solana is the cheapest network (~$0.0002 per swap) and the fastest â most tokenized equity liquidity in 2026 sits on Solana via xStocks and Jupiter.","If you already hold ETH or BTC, bridge to USDC on Solana via Wormhole or Portal. Budget 1-2% extra for slippage on your first purchase."]},{h2:"Step 3 â Execute the trade",paragraphs:["Open the TokenStocks.Ai Trade Terminal, pick your ticker, review the AI signal and confidence score, and click Trade. The smart router splits the order across the best venues to minimise slippage.","For orders above $10k, use the Quick Trade panel â it auto-selects the top agent from the leaderboard and executes at the best-of-book price."]},{h2:"Step 4 â Verify custody and monitor",paragraphs:["Every reputable tokenized stock publishes on-chain proof of reserves. xStocks reserves are audited by Network Firm; Ondo publishes daily attestations. Bookmark the provider's reserves dashboard and enable price alerts on TokenStocks.Ai."]}],faqs:[{q:"Do I need to be accredited to buy tokenized stocks?",a:"No. Most tokenized stocks are available to non-US retail users after basic KYC. Some venues restrict US persons â TokenStocks.Ai displays eligibility per token so you never waste time."},{q:"What is the minimum purchase?",a:"Tokenized stocks are infinitely fractional. You can buy $1 worth of Tesla or NVIDIA â one of the biggest advantages over traditional brokers with $100+ share prices."},{q:"Are dividends paid on tokenized stocks?",a:"xStocks reinvest dividends into the token NAV. Ondo pays cash dividends directly to token holders on ex-dividend date. TokenStocks.Ai displays the dividend policy on every asset page."}],relatedSlugs:["tokenized-stocks","best-tokenized-stocks-2026","tokenized-stocks-vs-etfs","xstocks-review-2026"]},{slug:"best-tokenized-stocks-2026",title:"The 15 Best Tokenized Stocks to Buy in 2026 (Ranked by Liquidity & AI Signal)",metaTitle:"Best Tokenized Stocks 2026: Top 15 Ranked by Liquidity + AI",metaDescription:"Our data-driven ranking of the 15 best tokenized stocks to buy in 2026 â scored on liquidity, AI signal accuracy, custody quality and 24/7 spread. Updated daily.",keywords:"best tokenized stocks, top tokenized stocks 2026, most liquid tokenized stocks, best stock tokens",heroTagline:"Ranked by live liquidity, AI agent accuracy, custody quality and 24/7 spread â updated daily.",intent:"commercial",readTime:"12 min read",datePublished:Ye,dateModified:Ye,category:"Rankings",primaryCTA:{label:"See the live leaderboard",href:"/leaderboard"},sections:[{h2:"How we rank tokenized stocks",paragraphs:["Every token is scored on four pillars: on-chain liquidity (order book + AMM depth), TokenStocks.Ai agent accuracy over the trailing 30 days, custody quality (proof of reserves + auditor), and 24/7 spread vs. NYSE close price.","Scores are re-computed hourly from live venue data. The list below reflects the current snapshot; visit the live leaderboard for real-time updates."]},{h2:"Top 5 â Blue chips",paragraphs:["The five most liquid tokenized equities right now are TSLAX (Tesla), AAPLX (Apple), NVDAX (NVIDIA), MSFTX (Microsoft) and GOOGLX (Alphabet). Combined 24h volume regularly exceeds $80M across venues."],bullets:["TSLAX â highest 24/7 volume, tightest spread (2-4 bps)","AAPLX â deepest AMM depth on Solana","NVDAX â best agent accuracy (Quant Strat 74% hit rate)","MSFTX â lowest overnight drift vs. NYSE","GOOGLX â strong DeFi collateral utility"]},{h2:"Top 6-10 â High-beta plays",paragraphs:["COINX, AMDX, METAX, NFLXX and MSTRX offer higher volatility and stronger reactions to crypto-native catalysts â often the highest alpha for AI agents that trade off-hours order flow."]},{h2:"Top 11-15 â Diversifiers & ETFs",paragraphs:["SPYX and QQQX give diversified index exposure on-chain. GLDX (gold), SHOPX (Shopify), UBERX (Uber), ORCLX (Oracle) and HOODX (Robinhood) round out the top 15 with distinct risk/return profiles."]}],faqs:[{q:"Which tokenized stock has the tightest spread?",a:"TSLAX and AAPLX consistently show the tightest 24/7 spreads (2-4 bps during US hours, 6-10 bps overnight) thanks to deep liquidity on Kraken and Jupiter."},{q:"What is the best tokenized stock for beginners?",a:"SPYX (tokenized S&P 500) is the safest starting point â diversified exposure, deep liquidity, and low volatility relative to single-name tokens."}],relatedSlugs:["how-to-buy-tokenized-stocks","tokenized-tesla-stock-tslax","tokenized-nvidia-stock-nvdax","xstocks-review-2026"]},{slug:"tokenized-stocks-vs-etfs",title:"Tokenized Stocks vs ETFs: Which Is Better in 2026?",metaTitle:"Tokenized Stocks vs ETFs (2026): Fees, Access, Yield Compared",metaDescription:"A head-to-head comparison of tokenized stocks and ETFs in 2026 â fees, 24/7 access, dividends, tax, DeFi composability and custody. Which one wins for your portfolio?",keywords:"tokenized stocks vs etfs, tokenized equities vs etf, on chain stocks vs etf, spy vs spyx",heroTagline:"Same underlying shares. Radically different trading experience. Here is when each one wins.",intent:"comparison",readTime:"10 min read",datePublished:Ye,dateModified:Ye,category:"Comparison",primaryCTA:{label:"Trade SPYX now",href:"/SPYX"},sections:[{h2:"The 30-second answer",paragraphs:["ETFs win on regulatory clarity, tax lots and retirement account access. Tokenized stocks win on 24/7 trading, fractional cost, global access, instant settlement and DeFi collateral use.","For most active traders in 2026 the tokenized ver
545sion is objectively better on cost and speed. For long-term holders in tax-advantaged accounts, the ETF still wins."]},{h2:"Cost & fees",paragraphs:["SPYX charges a 0.15% issuance fee and no annual management fee â cheaper than SPY's 0.0945% expense ratio once you factor in brokerage commissions and FX conversions for non-US investors."]},{h2:"24/7 trading & settlement",paragraphs:["ETFs trade only during US market hours (9:30-16:00 ET). Tokenized stocks trade 24/7/365 and settle in seconds on-chain, letting you react to earnings, macro releases and geopolitical shocks the moment they happen."]},{h2:"DeFi composability",paragraphs:["Tokenized stocks can be posted as collateral in Kamino, Marginfi and Aave. You can borrow stablecoins against your Tesla or Apple exposure without selling â impossible with a traditional ETF."]}],faqs:[{q:"Are tokenized stocks safer than ETFs?",a:"Both are backed 1:1 by real shares held in regulated custody. ETFs have decades of regulatory precedent; tokenized stocks add smart-contract and bridge risk. For most users the incremental risk is small and offset by cost/access benefits."},{q:"Can I hold tokenized stocks in an IRA?",a:"Not directly in a traditional IRA. Some self-directed IRA providers (e.g. AltoIRA, IRA Financial) support crypto and may support tokenized equities in 2026. Check with your provider."}],relatedSlugs:["tokenized-stocks","best-tokenized-stocks-2026","how-to-buy-tokenized-stocks","24-7-stock-trading-guide"]},{slug:"xstocks-review-2026",title:"xStocks Review 2026: Fees, Reserves, Liquidity & Verdict",metaTitle:"xStocks Review 2026 â Full Deep-Dive (Backed Finance)",metaDescription:"Independent xStocks review for 2026. We audit the reserves, benchmark the fees, stress-test 24/7 liquidity across Kraken, Bybit, Jupiter and Raydium. Is it safe?",keywords:"xstocks review, xstock review, backed finance review, is xstocks safe, xstocks fees",heroTagline:"We stress-tested xStocks across 4 venues for 30 days. Here is what the data actually shows.",intent:"commercial",readTime:"11 min read",datePublished:Ye,dateModified:Ye,category:"Provider Reviews",primaryCTA:{label:"Explore xStocks integration",href:"/integrations/xstocks"},sections:[{h2:"What is xStocks?",paragraphs:["xStocks is a family of 1:1 backed tokenized equities issued by Backed Assets (JE) Limited under a Liechtenstein TVTG prospectus. Every token in circulation is collateralized by the corresponding NYSE/Nasdaq share held with a regulated custodian (InCore Bank)."]},{h2:"Reserves & custody",paragraphs:["Backed publishes real-time proof of reserves. Network Firm audits the collateral monthly. Reserves have historically over-collateralized supply by 0.1-0.4% to buffer against creation/redemption latency."]},{h2:"Fees",paragraphs:["0.15% issuance fee, 0.15% redemption fee, no management fee. Compared to a US broker's 0.5-1% FX spread for non-USD investors, xStocks is materially cheaper for global users."]},{h2:"Verdict",paragraphs:["For non-US users seeking 24/7 exposure to US equities with real backing, xStocks is the strongest option in 2026. Watch smart-contract and bridge risk; use TokenStocks.Ai's routing to avoid stale liquidity."]}],faqs:[{q:"Is xStocks available in the US?",a:"No. xStocks are geo-blocked for US persons. US traders can use CFDs on Robinhood or wait for regulated on-shore alternatives."},{q:"What happens if Backed Finance goes bankrupt?",a:"Reserves are held in bankruptcy-remote custody at InCore Bank. Token holders would have a direct claim on the underlying shares, similar to an ETF wind-down."}],relatedSlugs:["ondo-global-markets-review","how-to-buy-tokenized-stocks","best-tokenized-stocks-2026","tokenized-stocks-vs-etfs"]},{slug:"ondo-global-markets-review",title:"Ondo Global Markets Review 2026: Tokenized Stocks Deep Dive",metaTitle:"Ondo Global Markets Review 2026 â Tokenized Stocks Verdict",metaDescription:"Full Ondo Global Markets review for 2026 â regulation, custody, fees, supported tickers, DeFi utility and how it compares to xStocks. Independent analysis.",keywords:"ondo review, ondo global markets, ondo finance stocks, ondo tokenized stocks review",heroTagline:"Ondo's institutional pedigree meets 24/7 on-chain equities. We break down the fine print.",intent:"commercial",readTime:"10 min read",datePublished:Ye,dateModified:Ye,category:"Provider Reviews",primaryCTA:{label:"Explore Ondo integration",href:"/integrations/ondo"},sections:[{h2:"What is Ondo Global Markets?",paragraphs:["Ondo Global Markets is Ondo Finance's tokenized equities platform, operated through a Bermuda-registered broker-dealer. Tokens like AAPLon, TSLAon and NVDAon are backed 1:1 by underlying shares custodied at Clear Street."]},{h2:"Key differentiators vs xStocks",paragraphs:["Ondo pays cash dividends on ex-dividend date (xStocks reinvests). Ondo's KYC is stricter but unlocks deeper institutional integrations (BlackRock's BUIDL, Wisdomtree). Solana + Ethereum + Sui distribution vs xStocks' Solana focus."]}],faqs:[{q:"Is Ondo Global Markets regulated?",a:"Yes. Ondo operates through a Bermuda Digital Asset Business Act (DABA) licensed broker-dealer, one of the most robust regulatory frameworks for tokenized securities globally."}],relatedSlugs:["xstocks-review-2026","tokenized-stocks","how-to-buy-tokenized-stocks","best-tokenized-stocks-2026"]},{slug:"tokenized-tesla-stock-tslax",title:"Tokenized Tesla Stock (TSLAX): Complete 2026 Guide",metaTitle:"TSLAX â Tokenized Tesla Stock Guide (2026)",metaDescription:"Everything about TSLAX, the tokenized Tesla stock: how it works, where to buy, live AI signals, dividends, custody, and how it tracks TSLA on Nasdaq 24/7.",keywords:"tokenized tesla, tslax, tesla stock token, buy tokenized tesla, tsla on chain",heroTagline:"Trade Tesla 24/7, in $1 increments, from any country â with live AI signals from the top TSLAX agent.",intent:"transactional",readTime:"8 min read",datePublished:Ye,dateModified:Ye,category:"Ticker Guides",primaryCTA:{label:"Trade TSLAX now",href:"/TSLAX"},sections:[{h2:"What is TSLAX?",paragraphs:["TSLAX is the xStocks tokenized ver
545sion of Tesla, Inc. (Nasdaq: TSLA). Each token is 1:1 backed by a real TSLA share held at InCore Bank in Switzerland."]},{h2:"Why trade Tesla on-chain?",paragraphs:["Tesla is one of the most news-driven stocks in the world â Musk tweets, delivery numbers and macro shifts hit at all hours. TSLAX lets you trade the news the moment it breaks, not at 9:30 ET the next morning."]},{h2:"TSLAX agent performance",paragraphs:["The top TSLAX agent on TokenStocks.Ai has averaged 68% signal accuracy over the trailing 90 days. Quick Trade auto-routes to whichever TSLAX agent is currently ranked #1 on the leaderboard."]}],faqs:[{q:"Does TSLAX pay Tesla dividends?",a:"Tesla does not currently pay a dividend, so this is moot. If Tesla initiates a dividend, xStocks will reinvest it into the token NAV."}],relatedSlugs:["tokenized-apple-stock-aaplx","tokenized-nvidia-stock-nvdax","how-to-buy-tokenized-stocks","best-tokenized-stocks-2026"]},{slug:"tokenized-apple-stock-aaplx",title:"Tokenized Apple Stock (AAPLX): Complete 2026 Guide",metaTitle:"AAPLX â Tokenized Apple Stock Guide (2026)",metaDescription:"Everything about AAPLX, the tokenized Apple stock: 24/7 trading, fractional ownership, live AI signals, custody, dividends and how it compares to AAPL on Nasdaq.",keywords:"tokenized apple, aaplx, apple stock token, buy tokenized apple",heroTagline:"Own a fraction of Apple 24/7 with 1:1 backed on-chain tokens.",intent:"transactional",readTime:"7 min read",datePublished:Ye,dateModified:Ye,category:"Ticker Guides",primaryCTA:{label:"Trade AAPLX now",href:"/AAPLX"},sections:[{h2:"What is AAPLX?",paragraphs:["AAPLX is the xStocks tokenized version of Apple Inc. (Nasdaq: AAPL), 1:1 backed by real AAPL shares held in regulated Swiss custody."]},{h2:"Why AAPLX has the deepest liquidity",paragraphs:["Apple's global brand recognition drives the deepest AMM depth of any tokenized equity on Solana â over $22M TVL on Jupiter alone. Spreads stay under 4 bps even overnight."]}],faqs:[{q:"How does AAPLX handle Apple dividends?",a:"Cash dividends are auto-reinvested into the token NAV, so your token quantity stays the same but the price steps up by the dividend amount."}],relatedSlugs:["tokenized-tesla-stock-tslax","tokenized-nvidia-stock-nvdax","how-to-buy-tokenized-stocks","xstocks-review-2026"]},{slug:"tokenized-nvidia-stock-nvdax",title:"Tokenized NVIDIA Stock (NVDAX): Complete 2026 Guide",metaTitle:"NVDAX â Tokenized NVIDIA Stock Guide (2026)",metaDescription:"The full guide to NVDAX, the tokenized NVIDIA stock: buy 24/7, fractional exposure to the AI trade, live agent signals, custody & fees.",keywords:"tokenized nvidia, nvdax, nvidia stock token, buy tokenized nvidia",heroTagline:"Ride the AI supercycle 24/7 â tokenized NVIDIA with live agent alpha.",intent:"transactional",readTime:"8 min read",datePublished:Ye,dateModified:Ye,category:"Ticker Guides",primaryCTA:{label:"Trade NVDAX now",href:"/NVDAX"},sections:[{h2:"What is NVDAX?",paragraphs:["NVDAX is the xStocks tokenized version of NVIDIA Corporation (Nasdaq: NVDA), 1:1 backed by real NVDA shares. It tracks NVDA price second-by-second during market hours and continues trading 24/7 based on futures + on-chain flow."]},{h2:"The best-performing agent on NVDAX",paragraphs:["Quant Strat has led NVDAX signals with a 74% hit rate over the last 30 days on TokenStocks.Ai. NVDA's high-beta reaction to AI headlines makes it one of the most profitable tickers for automated agents."]}],faqs:[{q:"Does NVDAX track NVDA overnight?",a:"Yes â NVDAX price is anchored by NYSE close during off-hours and updates continuously based on futures, ADR proxies and on-chain order flow. Divergences rarely exceed 30 bps."}],relatedSlugs:["tokenized-tesla-stock-tslax","tokenized-apple-stock-aaplx","ai-trading-agents-for-stocks","best-tokenized-stocks-2026"]},{slug:"ai-trading-agents-for-stocks",title:"AI Trading Agents for Stocks: The 2026 Playbook",metaTitle:"AI Trading Agents for Stocks â 2026 Playbook & Leaderboard",metaDescription:"How AI trading agents beat human traders on tokenized stocks in 2026. Learn the multi-agent architecture, live win rates, and how to auto-route to the top agent.",keywords:"ai trading agents, ai stock trading, autonomous trading agents, ai stock signals, tokenized stock ai",heroTagline:"15+ specialised AI agents. Live-verified win rates. Auto-routing to the current #1.",intent:"informational",readTime:"11 min read",datePublished:Ye,dateModified:Ye,category:"AI & Agents",primaryCTA:{label:"See the live agent leaderboard",href:"/leaderboard"},sections:[{h2:"Why AI agents dominate tokenized equities",paragraphs:["Tokenized stocks trade 24/7 across fragmented venues (Kraken, Bybit, Jupiter, Uniswap). No human can price this in real time. AI agents monitor every venue, every price, every on-chain flow â and act in under 100ms."]},{h2:"The multi-agent architecture",paragraphs:["Each ticker on TokenStocks.Ai runs a dedicated 5-agent organism: Market Agent (technicals), Fundamental Agent (earnings), Sentiment Agent (news/social), Risk Agent (drawdown control), and MetaJudge (Bayesian ensembler)."]},{h2:"Live-verified win rates",paragraphs:["Every agent's win rate is computed from live signal outcomes, verified against real market prices, and published on the leaderboard. No backtests, no cherry-picking."]}],faqs:[{q:"Can I use these agents on regular stocks?",a:"The agents are optimized for tokenized equities' 24/7 microstructure. For regular NYSE/Nasdaq stocks, use our API to feed signals into your existing execution stack."}],relatedSlugs:["tokenized-stocks","24-7-stock-trading-guide","best-tokenized-stocks-2026","how-to-buy-tokenized-stocks"]},{slug:"24-7-stock-trading-guide",title:"24/7 Stock Trading: The 2026 Guide to Always-On Equities",metaTitle:"24/7 Stock Trading Guide 2026 â Trade Stocks Overnight & Weekends",metaDescription:"How to trade stocks 24/7 in 2026 using tokenized equities. Overnight, weekends, holidays â with live AI signals and best-execution routing across on-chain venues.",keywords:"24/7 stock trading, overnight stock trading, weekend stock trading, always on stocks, trade stocks after hours",heroTagline:"Earnings drop at 6pm on a Frid
545ay? Trade the reaction instantly â not on Monday morning.",intent:"informational",readTime:"9 min read",datePublished:Ye,dateModified:Ye,category:"Trading",primaryCTA:{label:"Open the 24/7 terminal",href:"/trade"},sections:[{h2:"The end of market hours",paragraphs:["In 2026 the concept of 'market hours' is obsolete for retail. Tokenized equities settle on-chain 24/7/365. Nasdaq's own 24/5 experiment lags on-chain venues by 6-12 months."]},{h2:"Why overnight matters",paragraphs:["Roughly 60% of major stock-moving news breaks outside 9:30-16:00 ET â earnings, Fed decisions, geopolitical shocks. Trading only during US hours means eating the gap. 24/7 access means capturing the move."]},{h2:"How TokenStocks.Ai routes 24/7",paragraphs:["Our smart-order router monitors Kraken, Bybit, Jupiter, Raydium and Uniswap simultaneously. Off-hours it prioritises venues with the tightest spread and deepest AMM depth."]}],faqs:[{q:"Are 24/7 prices accurate to NYSE close?",a:"Yes â divergences rarely exceed 30-50 bps for blue chips. TokenStocks.Ai flags any divergence above 100 bps as a potential arbitrage opportunity."}],relatedSlugs:["tokenized-stocks","ai-trading-agents-for-stocks","how-to-buy-tokenized-stocks","tokenized-stocks-vs-etfs"]}],G0=new Set(ar.map(e=>e.slug));for(const e of[...K$,...J$])G0.has(e.slug)||(ar.push(e),G0.add(e.slug));const yB=e=>ar.find(t=>t.slug===e),Z$=["how-to-buy-tokenized-stocks","best-tokenized-stocks-2026","tokenized-stocks-vs-etfs","xstocks-review-2026","ondo-global-markets-review","ai-trading-agents-for-stocks","24-7-stock-trading-guide","tokenized-stocks-vs-crypto","tokenized-stocks-as-defi-collateral","day-trading-tokenized-stocks-strategy","tokenized-stocks-regulation-2026","top-tokenized-ai-stocks"];function eF(){const e=Z$.map(n=>ar.find(r=>r.slug===n)).filter(Boolean),t=Array.from(new Set(ar.map(n=>n.category)));return i.jsxs("section",{className:"max-w-6xl mx-auto px-4 py-10","aria-labelledby":"guides-heading",children:[i.jsxs("div",{className:"flex items-end justify-between mb-6 gap-4 flex-wrap",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"inline-flex items-center gap-2 text-xs text-primary font-semibold uppercase tracking-wide mb-2",children:[i.jsx(_p,{className:"w-3.5 h-3.5"})," Guides & Playbooks · ",ar.length," deep dives"]}),i.jsx("h2",{id:"guides-heading",className:"text-2xl md:text-3xl font-bold",children:"The definitive library on tokenized stocks"})]}),i.jsxs(Ie,{to:"/guides",className:"text-sm text-primary inline-flex items-center gap-1 hover:gap-2 transition-all",children:["View all ",ar.length," guides ",i.jsx(cd,{className:"w-4 h-4"})]})]}),i.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3 mb-8",children:e.map(n=>i.jsxs(Ie,{to:`/${n.slug}`,className:"group p-4 rounded-lg border border-border/50 bg-card/40 hover:bg-card/80 hover:border-primary/40 transition-all",children:[i.jsxs("div",{className:"text-[10px] uppercase tracking-wide text-primary/80 mb-1.5",children:[n.category," · ",n.readTime]}),i.jsx("div",{className:"font-semibold text-sm leading-snug group-hover:text-primary transition-colors mb-2",children:n.title}),i.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:n.metaDescription})]},n.slug))}),i.jsxs("div",{className:"border-t border-border/50 pt-6",children:[i.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-4",children:"Browse every guide"}),i.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:t.map(n=>{const r=ar.filter(s=>s.category===n);return i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs font-semibold text-primary mb-2 uppercase tracking-wide",children:[n," ",i.jsxs("span",{className:"text-muted-foreground normal-case font-normal",children:["· ",r.length]})]}),i.jsx("ul",{className:"space-y-1.5",children:r.map(s=>i.jsx("li",{children:i.jsx(Ie,{to:`/${s.slug}`,className:"text-xs text-muted-foreground hover:text-primary line-clamp-1 block",children:s.title})},s.slug))})]},n)})})]})]})}const tF=()=>{new Date().toISOString();const e={"@context":"https://schema.org","@type":"Organization",name:"TokenStocks.Ai",url:"https://tokenstocks.ai",logo:"https://tokenstocks.ai/logo.png",sameAs:["https://twitter.com/TokenStocksAi"],description:"AI-powered trading terminal for tokenized stocks from xStock and Ondo Finance"},t={"@context":"https://schema.org","@type":"WebApplication",name:"TokenStocks.Ai Trading Terminal",applicationCategory:"FinanceApplication",operatingSystem:"Web",description:"AI-powered Bloomberg-style terminal for tokenized stock analysis. Trade TSLA, AAPL, NVDA tokens 24/7 with real-time AI signals.",url:"https://tokenstocks.ai",provider:{"@type":"Organization",name:"TokenStocks.Ai",url:"https://tokenstocks.ai"},featureList:["Real-time tokenized stock signals","15+ AI trading agents","24/7 market access","xStock integration","Ondo Finance integration","Bloomberg-style interface","Sub-50ms signal latency"],offers:{"@type":"Offer",price:"0",priceCurrency:"USD",description:"Free access to AI trading terminal"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",ratingCount:"1250",bestRating:"5"}},n={"@context":"https://schema.org","@type":"FAQPage",mainEntity:[{"@type":"Question",name:"What are tokenized stocks?",acceptedA
545nswer:{"@type":"Answer",text:"Tokenized stocks are blockchain-based representations of traditional equities. They enable 24/7 trading, fractional ownership, and instant settlement while being backed by real shares held in custody."}},{"@type":"Question",name:"How do the AI trading agents work?",acceptedAnswer:{"@type":"Answer",text:"Our AI agents use advanced machine learning to analyze market data, sentiment, order flow, and on-chain metrics. Each agent specializes in a specific analysis type and generates signals with confidence scores and risk assessments."}},{"@type":"Question",name:"What is xStock and Ondo Finance?",acceptedAnswer:{"@type":"Answer",text:"xStock and Ondo Finance are leading providers of tokenized securities. They issue blockchain tokens backed by real-world assets including US stocks, treasuries, and money market funds, enabling global 24/7 access."}},{"@type":"Question",name:"Is TokenStocks.Ai free to use?",acceptedAnswer:{"@type":"Answer",text:"Yes, TokenStocks.Ai offers free access to our AI trading terminal with real-time signals. Premium features including advanced agents and API access are available for professional users."}}]},r={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://tokenstocks.ai/"},{"@type":"ListItem",position:2,name:"Trade",item:"https://tokenstocks.ai/trade"},{"@type":"ListItem",position:3,name:"AI Agents",item:"https://tokenstocks.ai/agents"}]};return i.jsxs(i.Fragment,{children:[i.jsxs(fS,{children:[i.jsx("title",{children:"TokenStocks.Ai - AI Trading Terminal for Tokenized Stocks | xStock & Ondo Finance"}),i.jsx("meta",{name:"title",content:"TokenStocks.Ai - AI Trading Terminal for Tokenized Stocks | xStock & Ondo Finance"}),i.jsx("meta",{name:"description",content:"Trade tokenized stocks 24/7 with AI-powered signals. Real-time analysis for TSLA, AAPL, NVDA, MSFT tokens from xStock and Ondo Finance. 15+ AI agents, sub-50ms latency."}),i.jsx("meta",{name:"keywords",content:"tokenized stocks, xStock, Ondo Finance, TSLA token, AAPL token, NVDA token, tokenized securities, AI trading, stock tokens, Bloomberg terminal, crypto stocks, RWA tokens, real world assets"}),i.jsx("meta",{name:"author",content:"TokenStocks.Ai"}),i.jsx("meta",{name:"robots",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),i.jsx("meta",{name:"googlebot",content:"index, follow"}),i.jsx("meta",{name:"bingbot",content:"index, follow"}),i.jsx("link",{rel:"canonical",href:"https://tokenstocks.ai/"}),i.jsx("meta",{httpEquiv:"content-language",content:"en"}),i.jsx("html",{lang:"en"}),i.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=5"}),i.jsx("meta",{property:"og:type",content:"website"}),i.jsx("meta",{property:"og:url",content:"https://tokenstocks.ai/"}),i.jsx("meta",{property:"og:title",content:"TokenStocks.Ai - AI Trading Terminal for Tokenized Stocks"}),i.jsx("meta",{property:"og:description",content:"Trade tokenized stocks 24/7 with AI-powered signals. Real-time analysis for TSLA, AAPL, NVDA tokens from xStock and Ondo Finance."}),i.jsx("meta",{property:"og:image",content:"https://tokenstocks.ai/og-image.png"}),i.jsx("meta",{property:"og:image:width",content:"1200"}),i.jsx("meta",{property:"og:image:height",content:"630"}),i.jsx("meta",{property:"og:site_name",content:"TokenStocks.Ai"}),i.jsx("meta",{property:"og:locale",content:"en_US"}),i.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),i.jsx("meta",{name:"twitter:site",content:"@TokenStocksAi"}),i.jsx("meta",{name:"twitter:creator",content:"@TokenStocksAi"}),i.jsx("meta",{name:"twitter:title",content:"TokenStocks.Ai - AI Trading Terminal for Tokenized Stocks"}),i.jsx("meta",{name:"twitter:description",content:"Trade tokenized stocks 24/7 with AI-powered signals. 15+ AI agents for TSLA, AAPL, NVDA tokens."}),i.jsx("meta",{name:"twitter:image",content:"https://tokenstocks.ai/twitter-image.png"}),i.jsx("meta",{name:"theme-color",content:"#f59e0b"}),i.jsx("meta",{name:"apple-mobile-web-app-title",content:"TokenStocks"}),i.jsx("meta",{name:"application-name",content:"TokenStocks.Ai"}),i.jsx("meta",{name:"format-detection",content:"telephone=no"}),i.jsx("script",{type:"application/ld+json",children:JSON.stringify(e)}),i.jsx("script",{type:"application/ld+json",children:JSON.stringify(t)}),i.jsx("script",{type:"application/ld+json",children:JSON.stringify(n)}),i.jsx("script",{type:"application/ld+json",children:JSON.stringify(r)})]}),i.jsxs(Ie,{to:"/asset-hub-guide",className:D("fixed right-4 z-40 flex items-center gap-2 px-4 py-3","bg-primary text-primary-foreground rounded-full shadow-lg","transition-all duration-200 active:scale-95 hover:bg-primary/90","bottom-20 md:bottom-6"),title:"Asset Hub Guide",style:{WebkitTapHighlightColor:"transparent"},children:[i.jsx(_p,{className:"w-5 h-5"}),i.jsx("span",{className:"hidden md:inline text-sm font-medium",children:"Asset Guide"})]}),i.jsx(C$,{}),i.jsx(eF,{}),i.jsx(NA,{})]})},nF=f.lazy(()=>ge(()=>import("./Tape-WFrxb31c.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),rF=f.lazy(()=>ge(()=>import("./TapeArchive-C0oXY6n0.js"),__vite__mapDeps([9,5,10,7,8,4]))),sF=f.lazy(()=>ge(()=>import("./Articles-BEbzqdGk.js"),__vite__mapDeps([11,1,2,3,8,12]))),oF=f.lazy(()=>ge(()=>import("./AcademyArticle-DzdN3MRA.js"),__vite__mapDeps([13,1,2,3,14,6,15,7,16,17])
545)),iF=f.lazy(()=>ge(()=>import("./Asset-CQ7_01QM.js"),__vite__mapDeps([18,19,20,6,21,16,22,23]))),aF=f.lazy(()=>ge(()=>import("./Learn-B_8zMuXg.js"),__vite__mapDeps([24,1,2,3,8,16]))),lF=f.lazy(()=>ge(()=>import("./CourseView-D-mcswZZ.js"),__vite__mapDeps([25,1,2,3,26,27,17,28,29,30,31,32,6,16]))),cF=f.lazy(()=>ge(()=>import("./LearningDashboard-DWn7navQ.js"),__vite__mapDeps([33,1,2,3,30,31]))),dF=f.lazy(()=>ge(()=>import("./AgentAnalytics-PJNyXhUu.js"),__vite__mapDeps([34,1,2,3,6,19,20,35,36,37,31,38]))),uF=f.lazy(()=>ge(()=>import("./Leaderboard-F3WMo3ZV.js"),__vite__mapDeps([39,1,2,3,6,31]))),hF=f.lazy(()=>ge(()=>import("./Agents-Dj7W-Yji.js"),__vite__mapDeps([40,1,2,3,6,26,41,8,16]))),fF=f.lazy(()=>ge(()=>import("./AgentDetail-C2NLPpHr.js"),__vite__mapDeps([42,1,2,3,6,19,36,20,26,41,8]))),mF=f.lazy(()=>ge(()=>import("./ProAgents-CpWo5TZz.js"),__vite__mapDeps([43,44,45,46,1,2,3,6]))),pF=f.lazy(()=>ge(()=>import("./ProQuants-CGDSF7lb.js"),__vite__mapDeps([47,27,48,49,50,4,5,10,16,19,20,38,51,7,37,15,52,36,26,23,2,53,54,32,14,31,35,12,55,29,56,3,8,30,57,6]))),gF=f.lazy(()=>ge(()=>import("./Trade-CuJd2AmK.js"),__vite__mapDeps([58,1,2,3,50,8,32]))),vF=f.lazy(()=>ge(()=>import("./Api-CogWKIOr.js"),__vite__mapDeps([59,1,2,3]))),yF=f.lazy(()=>ge(()=>import("./SignalPage-3r9ASSaQ.js"),__vite__mapDeps([60,6,4]))),xF=f.lazy(()=>ge(()=>import("./Platform-prAeyEKF.js"),[])),bF=f.lazy(()=>ge(()=>import("./UseCases-JoVlzHR7.js"),[])),wF=f.lazy(()=>ge(()=>import("./Sitemap-BhRAuCNk.js"),[])),kF=f.lazy(()=>ge(()=>import("./Methodology-CjQCthJr.js"),__vite__mapDeps([61,6,51]))),SF=f.lazy(()=>ge(()=>import("./Transparency-xGXzsd4n.js"),__vite__mapDeps([62,6,14,63,19,37,38]))),TF=f.lazy(()=>ge(()=>import("./FAQ-CbeatUND.js"),__vite__mapDeps([64,65,49,8,55,66,56]))),AF=f.lazy(()=>ge(()=>import("./NotFound-9SYSrgRJ.js"),__vite__mapDeps([67,8]))),EF=f.lazy(()=>ge(()=>import("./AssetHubGuide-DEL0Lqr2.js"),__vite__mapDeps([68,1,2,3,51,14,17,21,8,7]))),NF=f.lazy(()=>ge(()=>import("./XStocks-CqHqa_fH.js"),[])),CF=f.lazy(()=>ge(()=>import("./Ondo-Du4ZVi4F.js"),__vite__mapDeps([69,70,54]))),_F=f.lazy(()=>ge(()=>import("./WhatAreTokenizedStocks-Dc4zhBUV.js"),[])),jF=f.lazy(()=>ge(()=>import("./TokenizedStocksRisks-Bs_SYOC6.js"),__vite__mapDeps([71,51]))),PF=f.lazy(()=>ge(()=>import("./AIForTokenizedEquities-D_3D_8f7.js"),[])),RF=f.lazy(()=>ge(()=>import("./Developers-DrhP81VL.js"),__vite__mapDeps([72,66,73]))),OF=f.lazy(()=>ge(()=>import("./KYBCompliance-DKSFeQNc.js"),__vite__mapDeps([74,51]))),IF=f.lazy(()=>ge(()=>import("./AdminDeduplication-GXWRxRYF.js"),__vite__mapDeps([75,32,29]))),MF=f.lazy(()=>ge(()=>import("./About-BQW5Ryix.js"),__vite__mapDeps([76,6,3]))),LF=f.lazy(()=>ge(()=>import("./RiskDisclaimer-BBBXPrmW.js"),__vite__mapDeps([77,6,63,51]))),DF=f.lazy(()=>ge(()=>import("./Team-DMem2Xa2.js"),__vite__mapDeps([78,31,3,7,23]))),zF=f.lazy(()=>ge(()=>import("./IntegrationsHub-Bu8L-0UJ.js"),__vite__mapDeps([79,56,6,46,45,73,52,22,51,54,19,20,37,16]))),$F=f.lazy(()=>ge(()=>import("./TokenizedStocksGuide-BQshhdus.js"),[])),FF=f.lazy(()=>ge(()=>import("./GuidePage-GY9kpkrA.js"),[])),BF=f.lazy(()=>ge(()=>import("./GuidesIndex-BaPv2f3n.js"),[])),UF=new eO,VF=()=>i.jsx(hS,{children:i.jsx(tO,{client:UF,children:i.jsx(Kk,{children:i.jsx(yL,{children:i.jsxs(kL,{children:[i.jsxs(fS,{children:[i.jsx("title",{children:"TokenStocks.Ai - Agentic Intelligence for Tokenized Stocks"}),i.jsx("meta",{name:"description",content:"AI-powered intelligence and execution layer for tokenized stocks. Trade Apple, Tesla, NVIDIA and 100+ more on-chain with institutional-grade AI agents."}),i.jsx("meta",{name:"keywords",content:"tokenized stocks, AI trading, xStock, Ondo Finance, tokenized securities, DeFi trading"}),i.jsx("link",{rel:"canonical",href:"https://tokenstocks.ai"})]}),i.jsxs(pj,{children:[i.jsx(xj,{}),i.jsx(Qj,{}),i.jsx(nO,{}),i.jsx(LO,{children:i.jsx(OO,{children:i.jsxs(aj,{children:[i.jsx(fe,{path:"/",element:i.jsx(tF,{})}),i.jsx(fe,{path:"/tape",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(nF,{})})}),i.jsx(fe,{path:"/tape/archive/:date",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(rF,{})})}),i.jsx(fe,{path:"/articles",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(sF,{})})}),i.jsx(fe,{path:"/academy/:slug",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(oF,{})})}),i.jsx(fe,{path:"/learn",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(aF,{})})}),i.jsx(fe,{path:"/learn/:courseSlug",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(lF,{})})}),i.jsx(fe,{path:"/learn/:courseSlug/:moduleSlug",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(cF,{})})}),i.jsx(fe,{path:"/academy",element:i.jsx(oj,{to:"/articles",replace:!0})}),i.jsx(fe,{path:"/analytics",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(dF,{})})}),i.jsx(fe,{path:"/leaderboard",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(uF,{})})}),i.jsx(fe,{path:"/agents",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(hF,{})})}),i.jsx(fe,{path:"/agents/:agentId",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(fF,{})})}),i.jsx(fe,{path:"/pro-agents",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(mF,{})})}),i.jsx(fe,{path:"/pro",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(pF,{})})}),i.jsx(fe,{path:"/trade",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(gF,{})})}),i.jsx(fe,{path:"/api",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(vF,{})})}),i.jsx(fe,{path:"/signal/:slug",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(yF,{})})}),i.jsx(fe,{path:"/platform",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(xF,{})})}),i.jsx(fe,{path:"/use-cases",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(bF,{})})}),i.jsx(fe,{path:"/sitemap",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(wF,{})})}),i.jsx(fe,{path:"/methodology",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(kF,{})})}
545),i.jsx(fe,{path:"/transparency",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(SF,{})})}),i.jsx(fe,{path:"/faq",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(TF,{})})}),i.jsx(fe,{path:"/asset-hub-guide",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(EF,{})})}),i.jsx(fe,{path:"/integrations/xstocks",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(NF,{})})}),i.jsx(fe,{path:"/integrations/ondo",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(CF,{})})}),i.jsx(fe,{path:"/learn/what-are-tokenized-stocks",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(_F,{})})}),i.jsx(fe,{path:"/learn/tokenized-stocks-risks",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(jF,{})})}),i.jsx(fe,{path:"/learn/ai-for-tokenized-equities",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(PF,{})})}),i.jsx(fe,{path:"/developers",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(RF,{})})}),i.jsx(fe,{path:"/kyb-compliance",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(OF,{})})}),i.jsx(fe,{path:"/admin/deduplication",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(IF,{})})}),i.jsx(fe,{path:"/about",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(MF,{})})}),i.jsx(fe,{path:"/risk-disclaimer",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(LF,{})})}),i.jsx(fe,{path:"/team",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(DF,{})})}),i.jsx(fe,{path:"/integrations",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(zF,{})})}),i.jsx(fe,{path:"/tokenized-stocks",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx($F,{})})}),i.jsx(fe,{path:"/guides",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(BF,{})})}),ar.map(e=>i.jsx(fe,{path:`/${e.slug}`,element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(FF,{})})},e.slug)),i.jsx(fe,{path:"/:symbol",element:i.jsx(f.Suspense,{fallback:i.jsx(PO,{}),children:i.jsx(iF,{})})}),i.jsx(fe,{path:"*",element:i.jsx(f.Suspense,{fallback:i.jsx(ve,{}),children:i.jsx(AF,{})})})]})})})]})]})})})})});"scrollRestoration"in history&&(history.scrollRestoration="manual");window.scrollTo(0,0);document.documentElement.scrollTop=0;document.body.scrollTop=0;gw(document.getElementById("root")).render(i.jsx(VF,{}));export{EC as $,ln as A,Ee as B,is as C,D,wC as E,$f as F,Pp as G,fS as H,Kr as I,uB as J,k$ as K,hd as L,Op as M,SL as N,Pi as O,mg as P,zf as Q,Ip as R,RC as S,Et as T,qs as U,mC as V,Ha as W,Kk as X,TR as Y,Ge as Z,AR as _,le as a,zc as a$,Yk as a0,Zw as a1,Ua as a2,qw as a3,y$ as a4,Sl as a5,Oi as a6,sn as a7,ht as a8,ki as a9,OL as aA,x0 as aB,eB as aC,ML as aD,X as aE,Hw as aF,dl as aG,BL as aH,DL as aI,SD as aJ,RO as aK,ta as aL,AD as aM,Em as aN,Id as aO,Md as aP,Ld as aQ,Dp as aR,vi as aS,kC as aT,gC as aU,$r as aV,jC as aW,CC as aX,Z3 as aY,Dc as aZ,Sa as a_,ge as aa,ud as ab,pC as ac,Gw as ad,Lp as ae,qe as af,Ww as ag,fC as ah,AC as ai,xa as aj,Dd as ak,Qw as al,cd as am,IC as an,Kv as ao,WF as ap,bC as aq,rn as ar,NC as as,Wv as at,Ff as au,Gv as av,Va as aw,jp as ax,_C as ay,ft as az,as as b,MC as b$,Ta as b0,Yr as b1,De as b2,mB as b3,Yw as b4,OC as b5,Vz as b6,pB as b7,qt as b8,du as b9,OR as bA,Zf as bB,Qk as bC,KR as bD,DR as bE,Tt as bF,JF as bG,ZF as bH,ve as bI,tB as bJ,Rp as bK,Wn as bL,XF as bM,lt as bN,eu as bO,wl as bP,Hz as bQ,Yv as bR,hC as bS,uC as bT,yB as bU,oj as bV,ar as bW,a3 as bX,iB as bY,aB as bZ,LC as b_,zk as ba,me as bb,ie as bc,Z as bd,cn as be,GS as bf,sg as bg,HS as bh,rg as bi,gl as bj,$k as bk,Fk as bl,qn as bm,Dk as bn,ur as bo,tu as bp,fi as bq,xC as br,mu as bs,BR as bt,IR as bu,QF as bv,em as bw,xn as bx,eS as by,RR as bz,Q as c,cs as d,fg as e,_p as f,Si as g,ke as h,nB as i,i as j,GF as k,Ie as l,rB as m,Mo as n,Le as o,ls as p,yC as q,f as r,ye as s,PC as t,Ni as u,dd as v,mi as w,Mp as x,vC as y,Xa as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.