admesh-ui-sdk 1.0.49 → 1.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (()=>{var K0=Object.defineProperty,X0=(Br,dr,zo)=>dr in Br?K0(Br,dr,{enumerable:!0,configurable:!0,writable:!0,value:zo}):Br[dr]=zo,Hr=(Br,dr,zo)=>X0(Br,typeof dr!="symbol"?dr+"":dr,zo);(function(){"use strict";var Br;function dr(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var zo={exports:{}},Ae={};/**
1
+ (()=>{var G0=Object.defineProperty,Z0=(Br,dr,zo)=>dr in Br?G0(Br,dr,{enumerable:!0,configurable:!0,writable:!0,value:zo}):Br[dr]=zo,Hr=(Br,dr,zo)=>Z0(Br,typeof dr!="symbol"?dr+"":dr,zo);(function(){"use strict";var Br;function dr(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var zo={exports:{}},Ae={};/**
2
2
  * @license React
3
3
  * react.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var fd;function Nf(){if(fd)return Ae;fd=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),D=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),W=Symbol.iterator;function M(f){return f===null||typeof f!="object"?null:(f=W&&f[W]||f["@@iterator"],typeof f=="function"?f:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H=Object.assign,U={};function ee(f,P,G){this.props=f,this.context=P,this.refs=U,this.updater=G||A}ee.prototype.isReactComponent={},ee.prototype.setState=function(f,P){if(typeof f!="object"&&typeof f!="function"&&f!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,f,P,"setState")},ee.prototype.forceUpdate=function(f){this.updater.enqueueForceUpdate(this,f,"forceUpdate")};function te(){}te.prototype=ee.prototype;function re(f,P,G){this.props=f,this.context=P,this.refs=U,this.updater=G||A}var ne=re.prototype=new te;ne.constructor=re,H(ne,ee.prototype),ne.isPureReactComponent=!0;var ie=Array.isArray;function Q(){}var O={H:null,A:null,T:null,S:null},fe=Object.prototype.hasOwnProperty;function le(f,P,G){var Y=G.ref;return{$$typeof:s,type:f,key:P,ref:Y!==void 0?Y:null,props:G}}function ge(f,P){return le(f.type,P,f.props)}function $e(f){return typeof f=="object"&&f!==null&&f.$$typeof===s}function oe(f){var P={"=":"=0",":":"=2"};return"$"+f.replace(/[=:]/g,function(G){return P[G]})}var ue=/\/+/g;function xe(f,P){return typeof f=="object"&&f!==null&&f.key!=null?oe(""+f.key):P.toString(36)}function Pe(f){switch(f.status){case"fulfilled":return f.value;case"rejected":throw f.reason;default:switch(typeof f.status=="string"?f.then(Q,Q):(f.status="pending",f.then(function(P){f.status==="pending"&&(f.status="fulfilled",f.value=P)},function(P){f.status==="pending"&&(f.status="rejected",f.reason=P)})),f.status){case"fulfilled":return f.value;case"rejected":throw f.reason}}throw f}function E(f,P,G,Y,_e){var ye=typeof f;(ye==="undefined"||ye==="boolean")&&(f=null);var ze=!1;if(f===null)ze=!0;else switch(ye){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(f.$$typeof){case s:case l:ze=!0;break;case B:return ze=f._init,E(ze(f._payload),P,G,Y,_e)}}if(ze)return _e=_e(f),ze=Y===""?"."+xe(f,0):Y,ie(_e)?(G="",ze!=null&&(G=ze.replace(ue,"$&/")+"/"),E(_e,P,G,"",function(De){return De})):_e!=null&&($e(_e)&&(_e=ge(_e,G+(_e.key==null||f&&f.key===_e.key?"":(""+_e.key).replace(ue,"$&/")+"/")+ze)),P.push(_e)),1;ze=0;var Le=Y===""?".":Y+":";if(ie(f))for(var Re=0;Re<f.length;Re++)Y=f[Re],ye=Le+xe(Y,Re),ze+=E(Y,P,G,ye,_e);else if(Re=M(f),typeof Re=="function")for(f=Re.call(f),Re=0;!(Y=f.next()).done;)Y=Y.value,ye=Le+xe(Y,Re++),ze+=E(Y,P,G,ye,_e);else if(ye==="object"){if(typeof f.then=="function")return E(Pe(f),P,G,Y,_e);throw P=String(f),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return ze}function V(f,P,G){if(f==null)return f;var Y=[],_e=0;return E(f,Y,"","",function(ye){return P.call(G,ye,_e++)}),Y}function se(f){if(f._status===-1){var P=f._result;P=P(),P.then(function(G){(f._status===0||f._status===-1)&&(f._status=1,f._result=G)},function(G){(f._status===0||f._status===-1)&&(f._status=2,f._result=G)}),f._status===-1&&(f._status=0,f._result=P)}if(f._status===1)return f._result.default;throw f._result}var ke=typeof reportError=="function"?reportError:function(f){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof f=="object"&&f!==null&&typeof f.message=="string"?String(f.message):String(f),error:f});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",f);return}console.error(f)},Ee={map:V,forEach:function(f,P,G){V(f,function(){P.apply(this,arguments)},G)},count:function(f){var P=0;return V(f,function(){P++}),P},toArray:function(f){return V(f,function(P){return P})||[]},only:function(f){if(!$e(f))throw Error("React.Children.only expected to receive a single React element child.");return f}};return Ae.Activity=C,Ae.Children=Ee,Ae.Component=ee,Ae.Fragment=d,Ae.Profiler=v,Ae.PureComponent=re,Ae.StrictMode=c,Ae.Suspense=_,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(f){return O.H.useMemoCache(f)}},Ae.cache=function(f){return function(){return f.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(f,P,G){if(f==null)throw Error("The argument must be a React element, but you passed "+f+".");var Y=H({},f.props),_e=f.key;if(P!=null)for(ye in P.key!==void 0&&(_e=""+P.key),P)!fe.call(P,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&P.ref===void 0||(Y[ye]=P[ye]);var ye=arguments.length-2;if(ye===1)Y.children=G;else if(1<ye){for(var ze=Array(ye),Le=0;Le<ye;Le++)ze[Le]=arguments[Le+2];Y.children=ze}return le(f.type,_e,Y)},Ae.createContext=function(f){return f={$$typeof:D,_currentValue:f,_currentValue2:f,_threadCount:0,Provider:null,Consumer:null},f.Provider=f,f.Consumer={$$typeof:I,_context:f},f},Ae.createElement=function(f,P,G){var Y,_e={},ye=null;if(P!=null)for(Y in P.key!==void 0&&(ye=""+P.key),P)fe.call(P,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(_e[Y]=P[Y]);var ze=arguments.length-2;if(ze===1)_e.children=G;else if(1<ze){for(var Le=Array(ze),Re=0;Re<ze;Re++)Le[Re]=arguments[Re+2];_e.children=Le}if(f&&f.defaultProps)for(Y in ze=f.defaultProps,ze)_e[Y]===void 0&&(_e[Y]=ze[Y]);return le(f,ye,_e)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(f){return{$$typeof:q,render:f}},Ae.isValidElement=$e,Ae.lazy=function(f){return{$$typeof:B,_payload:{_status:-1,_result:f},_init:se}},Ae.memo=function(f,P){return{$$typeof:y,type:f,compare:P===void 0?null:P}},Ae.startTransition=function(f){var P=O.T,G={};O.T=G;try{var Y=f(),_e=O.S;_e!==null&&_e(G,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(Q,ke)}catch(ye){ke(ye)}finally{P!==null&&G.types!==null&&(P.types=G.types),O.T=P}},Ae.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Ae.use=function(f){return O.H.use(f)},Ae.useActionState=function(f,P,G){return O.H.useActionState(f,P,G)},Ae.useCallback=function(f,P){return O.H.useCallback(f,P)},Ae.useContext=function(f){return O.H.useContext(f)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(f,P){return O.H.useDeferredValue(f,P)},Ae.useEffect=function(f,P){return O.H.useEffect(f,P)},Ae.useEffectEvent=function(f){return O.H.useEffectEvent(f)},Ae.useId=function(){return O.H.useId()},Ae.useImperativeHandle=function(f,P,G){return O.H.useImperativeHandle(f,P,G)},Ae.useInsertionEffect=function(f,P){return O.H.useInsertionEffect(f,P)},Ae.useLayoutEffect=function(f,P){return O.H.useLayoutEffect(f,P)},Ae.useMemo=function(f,P){return O.H.useMemo(f,P)},Ae.useOptimistic=function(f,P){return O.H.useOptimistic(f,P)},Ae.useReducer=function(f,P,G){return O.H.useReducer(f,P,G)},Ae.useRef=function(f){return O.H.useRef(f)},Ae.useState=function(f){return O.H.useState(f)},Ae.useSyncExternalStore=function(f,P,G){return O.H.useSyncExternalStore(f,P,G)},Ae.useTransition=function(){return O.H.useTransition()},Ae.version="19.2.1",Ae}var hd;function Zs(){return hd||(hd=1,zo.exports=Nf()),zo.exports}var x=Zs();const gd=dr(x);var Js={exports:{}},Ha={},bd={exports:{}},yd={};/**
9
+ */var fd;function Rf(){if(fd)return Ae;fd=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),N=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),W=Symbol.iterator;function I(f){return f===null||typeof f!="object"?null:(f=W&&f[W]||f["@@iterator"],typeof f=="function"?f:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H=Object.assign,U={};function ee(f,P,G){this.props=f,this.context=P,this.refs=U,this.updater=G||A}ee.prototype.isReactComponent={},ee.prototype.setState=function(f,P){if(typeof f!="object"&&typeof f!="function"&&f!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,f,P,"setState")},ee.prototype.forceUpdate=function(f){this.updater.enqueueForceUpdate(this,f,"forceUpdate")};function te(){}te.prototype=ee.prototype;function re(f,P,G){this.props=f,this.context=P,this.refs=U,this.updater=G||A}var ne=re.prototype=new te;ne.constructor=re,H(ne,ee.prototype),ne.isPureReactComponent=!0;var ie=Array.isArray;function Q(){}var O={H:null,A:null,T:null,S:null},fe=Object.prototype.hasOwnProperty;function le(f,P,G){var Y=G.ref;return{$$typeof:s,type:f,key:P,ref:Y!==void 0?Y:null,props:G}}function ge(f,P){return le(f.type,P,f.props)}function $e(f){return typeof f=="object"&&f!==null&&f.$$typeof===s}function oe(f){var P={"=":"=0",":":"=2"};return"$"+f.replace(/[=:]/g,function(G){return P[G]})}var ue=/\/+/g;function xe(f,P){return typeof f=="object"&&f!==null&&f.key!=null?oe(""+f.key):P.toString(36)}function Pe(f){switch(f.status){case"fulfilled":return f.value;case"rejected":throw f.reason;default:switch(typeof f.status=="string"?f.then(Q,Q):(f.status="pending",f.then(function(P){f.status==="pending"&&(f.status="fulfilled",f.value=P)},function(P){f.status==="pending"&&(f.status="rejected",f.reason=P)})),f.status){case"fulfilled":return f.value;case"rejected":throw f.reason}}throw f}function E(f,P,G,Y,_e){var ye=typeof f;(ye==="undefined"||ye==="boolean")&&(f=null);var ze=!1;if(f===null)ze=!0;else switch(ye){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(f.$$typeof){case s:case l:ze=!0;break;case B:return ze=f._init,E(ze(f._payload),P,G,Y,_e)}}if(ze)return _e=_e(f),ze=Y===""?"."+xe(f,0):Y,ie(_e)?(G="",ze!=null&&(G=ze.replace(ue,"$&/")+"/"),E(_e,P,G,"",function(Ne){return Ne})):_e!=null&&($e(_e)&&(_e=ge(_e,G+(_e.key==null||f&&f.key===_e.key?"":(""+_e.key).replace(ue,"$&/")+"/")+ze)),P.push(_e)),1;ze=0;var Le=Y===""?".":Y+":";if(ie(f))for(var De=0;De<f.length;De++)Y=f[De],ye=Le+xe(Y,De),ze+=E(Y,P,G,ye,_e);else if(De=I(f),typeof De=="function")for(f=De.call(f),De=0;!(Y=f.next()).done;)Y=Y.value,ye=Le+xe(Y,De++),ze+=E(Y,P,G,ye,_e);else if(ye==="object"){if(typeof f.then=="function")return E(Pe(f),P,G,Y,_e);throw P=String(f),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return ze}function V(f,P,G){if(f==null)return f;var Y=[],_e=0;return E(f,Y,"","",function(ye){return P.call(G,ye,_e++)}),Y}function se(f){if(f._status===-1){var P=f._result;P=P(),P.then(function(G){(f._status===0||f._status===-1)&&(f._status=1,f._result=G)},function(G){(f._status===0||f._status===-1)&&(f._status=2,f._result=G)}),f._status===-1&&(f._status=0,f._result=P)}if(f._status===1)return f._result.default;throw f._result}var ke=typeof reportError=="function"?reportError:function(f){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof f=="object"&&f!==null&&typeof f.message=="string"?String(f.message):String(f),error:f});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",f);return}console.error(f)},Ee={map:V,forEach:function(f,P,G){V(f,function(){P.apply(this,arguments)},G)},count:function(f){var P=0;return V(f,function(){P++}),P},toArray:function(f){return V(f,function(P){return P})||[]},only:function(f){if(!$e(f))throw Error("React.Children.only expected to receive a single React element child.");return f}};return Ae.Activity=C,Ae.Children=Ee,Ae.Component=ee,Ae.Fragment=d,Ae.Profiler=v,Ae.PureComponent=re,Ae.StrictMode=c,Ae.Suspense=_,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(f){return O.H.useMemoCache(f)}},Ae.cache=function(f){return function(){return f.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(f,P,G){if(f==null)throw Error("The argument must be a React element, but you passed "+f+".");var Y=H({},f.props),_e=f.key;if(P!=null)for(ye in P.key!==void 0&&(_e=""+P.key),P)!fe.call(P,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&P.ref===void 0||(Y[ye]=P[ye]);var ye=arguments.length-2;if(ye===1)Y.children=G;else if(1<ye){for(var ze=Array(ye),Le=0;Le<ye;Le++)ze[Le]=arguments[Le+2];Y.children=ze}return le(f.type,_e,Y)},Ae.createContext=function(f){return f={$$typeof:N,_currentValue:f,_currentValue2:f,_threadCount:0,Provider:null,Consumer:null},f.Provider=f,f.Consumer={$$typeof:M,_context:f},f},Ae.createElement=function(f,P,G){var Y,_e={},ye=null;if(P!=null)for(Y in P.key!==void 0&&(ye=""+P.key),P)fe.call(P,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(_e[Y]=P[Y]);var ze=arguments.length-2;if(ze===1)_e.children=G;else if(1<ze){for(var Le=Array(ze),De=0;De<ze;De++)Le[De]=arguments[De+2];_e.children=Le}if(f&&f.defaultProps)for(Y in ze=f.defaultProps,ze)_e[Y]===void 0&&(_e[Y]=ze[Y]);return le(f,ye,_e)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(f){return{$$typeof:q,render:f}},Ae.isValidElement=$e,Ae.lazy=function(f){return{$$typeof:B,_payload:{_status:-1,_result:f},_init:se}},Ae.memo=function(f,P){return{$$typeof:y,type:f,compare:P===void 0?null:P}},Ae.startTransition=function(f){var P=O.T,G={};O.T=G;try{var Y=f(),_e=O.S;_e!==null&&_e(G,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(Q,ke)}catch(ye){ke(ye)}finally{P!==null&&G.types!==null&&(P.types=G.types),O.T=P}},Ae.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Ae.use=function(f){return O.H.use(f)},Ae.useActionState=function(f,P,G){return O.H.useActionState(f,P,G)},Ae.useCallback=function(f,P){return O.H.useCallback(f,P)},Ae.useContext=function(f){return O.H.useContext(f)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(f,P){return O.H.useDeferredValue(f,P)},Ae.useEffect=function(f,P){return O.H.useEffect(f,P)},Ae.useEffectEvent=function(f){return O.H.useEffectEvent(f)},Ae.useId=function(){return O.H.useId()},Ae.useImperativeHandle=function(f,P,G){return O.H.useImperativeHandle(f,P,G)},Ae.useInsertionEffect=function(f,P){return O.H.useInsertionEffect(f,P)},Ae.useLayoutEffect=function(f,P){return O.H.useLayoutEffect(f,P)},Ae.useMemo=function(f,P){return O.H.useMemo(f,P)},Ae.useOptimistic=function(f,P){return O.H.useOptimistic(f,P)},Ae.useReducer=function(f,P,G){return O.H.useReducer(f,P,G)},Ae.useRef=function(f){return O.H.useRef(f)},Ae.useState=function(f){return O.H.useState(f)},Ae.useSyncExternalStore=function(f,P,G){return O.H.useSyncExternalStore(f,P,G)},Ae.useTransition=function(){return O.H.useTransition()},Ae.version="19.2.1",Ae}var hd;function Zs(){return hd||(hd=1,zo.exports=Rf()),zo.exports}var x=Zs();const gd=dr(x);var Js={exports:{}},Ha={},bd={exports:{}},yd={};/**
10
10
  * @license React
11
11
  * scheduler.production.js
12
12
  *
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var vd;function Rf(){return vd||(vd=1,(function(s){function l(E,V){var se=E.length;E.push(V);e:for(;0<se;){var ke=se-1>>>1,Ee=E[ke];if(0<v(Ee,V))E[ke]=V,E[se]=Ee,se=ke;else break e}}function d(E){return E.length===0?null:E[0]}function c(E){if(E.length===0)return null;var V=E[0],se=E.pop();if(se!==V){E[0]=se;e:for(var ke=0,Ee=E.length,f=Ee>>>1;ke<f;){var P=2*(ke+1)-1,G=E[P],Y=P+1,_e=E[Y];if(0>v(G,se))Y<Ee&&0>v(_e,G)?(E[ke]=_e,E[Y]=se,ke=Y):(E[ke]=G,E[P]=se,ke=P);else if(Y<Ee&&0>v(_e,se))E[ke]=_e,E[Y]=se,ke=Y;else break e}}return V}function v(E,V){var se=E.sortIndex-V.sortIndex;return se!==0?se:E.id-V.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var I=performance;s.unstable_now=function(){return I.now()}}else{var D=Date,q=D.now();s.unstable_now=function(){return D.now()-q}}var _=[],y=[],B=1,C=null,W=3,M=!1,A=!1,H=!1,U=!1,ee=typeof setTimeout=="function"?setTimeout:null,te=typeof clearTimeout=="function"?clearTimeout:null,re=typeof setImmediate<"u"?setImmediate:null;function ne(E){for(var V=d(y);V!==null;){if(V.callback===null)c(y);else if(V.startTime<=E)c(y),V.sortIndex=V.expirationTime,l(_,V);else break;V=d(y)}}function ie(E){if(H=!1,ne(E),!A)if(d(_)!==null)A=!0,Q||(Q=!0,oe());else{var V=d(y);V!==null&&Pe(ie,V.startTime-E)}}var Q=!1,O=-1,fe=5,le=-1;function ge(){return U?!0:!(s.unstable_now()-le<fe)}function $e(){if(U=!1,Q){var E=s.unstable_now();le=E;var V=!0;try{e:{A=!1,H&&(H=!1,te(O),O=-1),M=!0;var se=W;try{t:{for(ne(E),C=d(_);C!==null&&!(C.expirationTime>E&&ge());){var ke=C.callback;if(typeof ke=="function"){C.callback=null,W=C.priorityLevel;var Ee=ke(C.expirationTime<=E);if(E=s.unstable_now(),typeof Ee=="function"){C.callback=Ee,ne(E),V=!0;break t}C===d(_)&&c(_),ne(E)}else c(_);C=d(_)}if(C!==null)V=!0;else{var f=d(y);f!==null&&Pe(ie,f.startTime-E),V=!1}}break e}finally{C=null,W=se,M=!1}V=void 0}}finally{V?oe():Q=!1}}}var oe;if(typeof re=="function")oe=function(){re($e)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,xe=ue.port2;ue.port1.onmessage=$e,oe=function(){xe.postMessage(null)}}else oe=function(){ee($e,0)};function Pe(E,V){O=ee(function(){E(s.unstable_now())},V)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(E){E.callback=null},s.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):fe=0<E?Math.floor(1e3/E):5},s.unstable_getCurrentPriorityLevel=function(){return W},s.unstable_next=function(E){switch(W){case 1:case 2:case 3:var V=3;break;default:V=W}var se=W;W=V;try{return E()}finally{W=se}},s.unstable_requestPaint=function(){U=!0},s.unstable_runWithPriority=function(E,V){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var se=W;W=E;try{return V()}finally{W=se}},s.unstable_scheduleCallback=function(E,V,se){var ke=s.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?ke+se:ke):se=ke,E){case 1:var Ee=-1;break;case 2:Ee=250;break;case 5:Ee=1073741823;break;case 4:Ee=1e4;break;default:Ee=5e3}return Ee=se+Ee,E={id:B++,callback:V,priorityLevel:E,startTime:se,expirationTime:Ee,sortIndex:-1},se>ke?(E.sortIndex=se,l(y,E),d(_)===null&&E===d(y)&&(H?(te(O),O=-1):H=!0,Pe(ie,se-ke))):(E.sortIndex=Ee,l(_,E),A||M||(A=!0,Q||(Q=!0,oe()))),E},s.unstable_shouldYield=ge,s.unstable_wrapCallback=function(E){var V=W;return function(){var se=W;W=V;try{return E.apply(this,arguments)}finally{W=se}}}})(yd)),yd}var xd;function Df(){return xd||(xd=1,bd.exports=Rf()),bd.exports}var Ys={exports:{}},ln={};/**
17
+ */var vd;function Df(){return vd||(vd=1,(function(s){function l(E,V){var se=E.length;E.push(V);e:for(;0<se;){var ke=se-1>>>1,Ee=E[ke];if(0<v(Ee,V))E[ke]=V,E[se]=Ee,se=ke;else break e}}function d(E){return E.length===0?null:E[0]}function c(E){if(E.length===0)return null;var V=E[0],se=E.pop();if(se!==V){E[0]=se;e:for(var ke=0,Ee=E.length,f=Ee>>>1;ke<f;){var P=2*(ke+1)-1,G=E[P],Y=P+1,_e=E[Y];if(0>v(G,se))Y<Ee&&0>v(_e,G)?(E[ke]=_e,E[Y]=se,ke=Y):(E[ke]=G,E[P]=se,ke=P);else if(Y<Ee&&0>v(_e,se))E[ke]=_e,E[Y]=se,ke=Y;else break e}}return V}function v(E,V){var se=E.sortIndex-V.sortIndex;return se!==0?se:E.id-V.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var M=performance;s.unstable_now=function(){return M.now()}}else{var N=Date,q=N.now();s.unstable_now=function(){return N.now()-q}}var _=[],y=[],B=1,C=null,W=3,I=!1,A=!1,H=!1,U=!1,ee=typeof setTimeout=="function"?setTimeout:null,te=typeof clearTimeout=="function"?clearTimeout:null,re=typeof setImmediate<"u"?setImmediate:null;function ne(E){for(var V=d(y);V!==null;){if(V.callback===null)c(y);else if(V.startTime<=E)c(y),V.sortIndex=V.expirationTime,l(_,V);else break;V=d(y)}}function ie(E){if(H=!1,ne(E),!A)if(d(_)!==null)A=!0,Q||(Q=!0,oe());else{var V=d(y);V!==null&&Pe(ie,V.startTime-E)}}var Q=!1,O=-1,fe=5,le=-1;function ge(){return U?!0:!(s.unstable_now()-le<fe)}function $e(){if(U=!1,Q){var E=s.unstable_now();le=E;var V=!0;try{e:{A=!1,H&&(H=!1,te(O),O=-1),I=!0;var se=W;try{t:{for(ne(E),C=d(_);C!==null&&!(C.expirationTime>E&&ge());){var ke=C.callback;if(typeof ke=="function"){C.callback=null,W=C.priorityLevel;var Ee=ke(C.expirationTime<=E);if(E=s.unstable_now(),typeof Ee=="function"){C.callback=Ee,ne(E),V=!0;break t}C===d(_)&&c(_),ne(E)}else c(_);C=d(_)}if(C!==null)V=!0;else{var f=d(y);f!==null&&Pe(ie,f.startTime-E),V=!1}}break e}finally{C=null,W=se,I=!1}V=void 0}}finally{V?oe():Q=!1}}}var oe;if(typeof re=="function")oe=function(){re($e)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,xe=ue.port2;ue.port1.onmessage=$e,oe=function(){xe.postMessage(null)}}else oe=function(){ee($e,0)};function Pe(E,V){O=ee(function(){E(s.unstable_now())},V)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(E){E.callback=null},s.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):fe=0<E?Math.floor(1e3/E):5},s.unstable_getCurrentPriorityLevel=function(){return W},s.unstable_next=function(E){switch(W){case 1:case 2:case 3:var V=3;break;default:V=W}var se=W;W=V;try{return E()}finally{W=se}},s.unstable_requestPaint=function(){U=!0},s.unstable_runWithPriority=function(E,V){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var se=W;W=E;try{return V()}finally{W=se}},s.unstable_scheduleCallback=function(E,V,se){var ke=s.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?ke+se:ke):se=ke,E){case 1:var Ee=-1;break;case 2:Ee=250;break;case 5:Ee=1073741823;break;case 4:Ee=1e4;break;default:Ee=5e3}return Ee=se+Ee,E={id:B++,callback:V,priorityLevel:E,startTime:se,expirationTime:Ee,sortIndex:-1},se>ke?(E.sortIndex=se,l(y,E),d(_)===null&&E===d(y)&&(H?(te(O),O=-1):H=!0,Pe(ie,se-ke))):(E.sortIndex=Ee,l(_,E),A||I||(A=!0,Q||(Q=!0,oe()))),E},s.unstable_shouldYield=ge,s.unstable_wrapCallback=function(E){var V=W;return function(){var se=W;W=V;try{return E.apply(this,arguments)}finally{W=se}}}})(yd)),yd}var xd;function Nf(){return xd||(xd=1,bd.exports=Df()),bd.exports}var Ys={exports:{}},ln={};/**
18
18
  * @license React
19
19
  * react-dom.production.js
20
20
  *
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var wd;function Tf(){if(wd)return ln;wd=1;var s=Zs();function l(_){var y="https://react.dev/errors/"+_;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var B=2;B<arguments.length;B++)y+="&args[]="+encodeURIComponent(arguments[B])}return"Minified React error #"+_+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var c={d:{f:d,r:function(){throw Error(l(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},v=Symbol.for("react.portal");function I(_,y,B){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:v,key:C==null?null:""+C,children:_,containerInfo:y,implementation:B}}var D=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function q(_,y){if(_==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,ln.createPortal=function(_,y){var B=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(l(299));return I(_,y,null,B)},ln.flushSync=function(_){var y=D.T,B=c.p;try{if(D.T=null,c.p=2,_)return _()}finally{D.T=y,c.p=B,c.d.f()}},ln.preconnect=function(_,y){typeof _=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,c.d.C(_,y))},ln.prefetchDNS=function(_){typeof _=="string"&&c.d.D(_)},ln.preinit=function(_,y){if(typeof _=="string"&&y&&typeof y.as=="string"){var B=y.as,C=q(B,y.crossOrigin),W=typeof y.integrity=="string"?y.integrity:void 0,M=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;B==="style"?c.d.S(_,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:C,integrity:W,fetchPriority:M}):B==="script"&&c.d.X(_,{crossOrigin:C,integrity:W,fetchPriority:M,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},ln.preinitModule=function(_,y){if(typeof _=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var B=q(y.as,y.crossOrigin);c.d.M(_,{crossOrigin:B,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&c.d.M(_)},ln.preload=function(_,y){if(typeof _=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var B=y.as,C=q(B,y.crossOrigin);c.d.L(_,B,{crossOrigin:C,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},ln.preloadModule=function(_,y){if(typeof _=="string")if(y){var B=q(y.as,y.crossOrigin);c.d.m(_,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:B,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else c.d.m(_)},ln.requestFormReset=function(_){c.d.r(_)},ln.unstable_batchedUpdates=function(_,y){return _(y)},ln.useFormState=function(_,y,B){return D.H.useFormState(_,y,B)},ln.useFormStatus=function(){return D.H.useHostTransitionStatus()},ln.version="19.2.1",ln}var kd;function _d(){if(kd)return Ys.exports;kd=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),Ys.exports=Tf(),Ys.exports}/**
25
+ */var wd;function Tf(){if(wd)return ln;wd=1;var s=Zs();function l(_){var y="https://react.dev/errors/"+_;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var B=2;B<arguments.length;B++)y+="&args[]="+encodeURIComponent(arguments[B])}return"Minified React error #"+_+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var c={d:{f:d,r:function(){throw Error(l(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},v=Symbol.for("react.portal");function M(_,y,B){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:v,key:C==null?null:""+C,children:_,containerInfo:y,implementation:B}}var N=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function q(_,y){if(_==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,ln.createPortal=function(_,y){var B=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(l(299));return M(_,y,null,B)},ln.flushSync=function(_){var y=N.T,B=c.p;try{if(N.T=null,c.p=2,_)return _()}finally{N.T=y,c.p=B,c.d.f()}},ln.preconnect=function(_,y){typeof _=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,c.d.C(_,y))},ln.prefetchDNS=function(_){typeof _=="string"&&c.d.D(_)},ln.preinit=function(_,y){if(typeof _=="string"&&y&&typeof y.as=="string"){var B=y.as,C=q(B,y.crossOrigin),W=typeof y.integrity=="string"?y.integrity:void 0,I=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;B==="style"?c.d.S(_,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:C,integrity:W,fetchPriority:I}):B==="script"&&c.d.X(_,{crossOrigin:C,integrity:W,fetchPriority:I,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},ln.preinitModule=function(_,y){if(typeof _=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var B=q(y.as,y.crossOrigin);c.d.M(_,{crossOrigin:B,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&c.d.M(_)},ln.preload=function(_,y){if(typeof _=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var B=y.as,C=q(B,y.crossOrigin);c.d.L(_,B,{crossOrigin:C,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},ln.preloadModule=function(_,y){if(typeof _=="string")if(y){var B=q(y.as,y.crossOrigin);c.d.m(_,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:B,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else c.d.m(_)},ln.requestFormReset=function(_){c.d.r(_)},ln.unstable_batchedUpdates=function(_,y){return _(y)},ln.useFormState=function(_,y,B){return N.H.useFormState(_,y,B)},ln.useFormStatus=function(){return N.H.useHostTransitionStatus()},ln.version="19.2.1",ln}var kd;function _d(){if(kd)return Ys.exports;kd=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),Ys.exports=Tf(),Ys.exports}/**
26
26
  * @license React
27
27
  * react-dom-client.production.js
28
28
  *
@@ -30,15 +30,15 @@
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Sd;function Lf(){if(Sd)return Ha;Sd=1;var s=Df(),l=Zs(),d=_d();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function v(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function I(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function D(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 q(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function _(e){if(I(e)!==e)throw Error(c(188))}function y(e){var t=e.alternate;if(!t){if(t=I(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var a=o.alternate;if(a===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return _(o),e;if(a===r)return _(o),t;a=a.sibling}throw Error(c(188))}if(n.return!==r.return)n=o,r=a;else{for(var i=!1,u=o.child;u;){if(u===n){i=!0,n=o,r=a;break}if(u===r){i=!0,r=o,n=a;break}u=u.sibling}if(!i){for(u=a.child;u;){if(u===n){i=!0,n=a,r=o;break}if(u===r){i=!0,r=a,n=o;break}u=u.sibling}if(!i)throw Error(c(189))}}if(n.alternate!==r)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function B(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=B(e),t!==null)return t;e=e.sibling}return null}var C=Object.assign,W=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),te=Symbol.for("react.consumer"),re=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),ge=Symbol.for("react.memo_cache_sentinel"),$e=Symbol.iterator;function oe(e){return e===null||typeof e!="object"?null:(e=$e&&e[$e]||e["@@iterator"],typeof e=="function"?e:null)}var ue=Symbol.for("react.client.reference");function xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case H:return"Fragment";case ee:return"Profiler";case U:return"StrictMode";case ie:return"Suspense";case Q:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case re:return e.displayName||"Context";case te:return(e._context.displayName||"Context")+".Consumer";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case O:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case fe:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var Pe=Array.isArray,E=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ke=[],Ee=-1;function f(e){return{current:e}}function P(e){0>Ee||(e.current=ke[Ee],ke[Ee]=null,Ee--)}function G(e,t){Ee++,ke[Ee]=e.current,e.current=t}var Y=f(null),_e=f(null),ye=f(null),ze=f(null);function Le(e,t){switch(G(ye,t),G(_e,e),G(Y,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?tf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=tf(t),e=nf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(Y),G(Y,e)}function Re(){P(Y),P(_e),P(ye)}function De(e){e.memoizedState!==null&&G(ze,e);var t=Y.current,n=nf(t,e.type);t!==n&&(G(_e,e),G(Y,n))}function Be(e){_e.current===e&&(P(Y),P(_e)),ze.current===e&&(P(ze),Ri._currentValue=se)}var qt,ae;function ce(e){if(qt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);qt=t&&t[1]||"",ae=-1<n.stack.indexOf(`
33
+ */var Sd;function Lf(){if(Sd)return Ha;Sd=1;var s=Nf(),l=Zs(),d=_d();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function v(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function M(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function N(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 q(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function _(e){if(M(e)!==e)throw Error(c(188))}function y(e){var t=e.alternate;if(!t){if(t=M(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var a=o.alternate;if(a===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return _(o),e;if(a===r)return _(o),t;a=a.sibling}throw Error(c(188))}if(n.return!==r.return)n=o,r=a;else{for(var i=!1,u=o.child;u;){if(u===n){i=!0,n=o,r=a;break}if(u===r){i=!0,r=o,n=a;break}u=u.sibling}if(!i){for(u=a.child;u;){if(u===n){i=!0,n=a,r=o;break}if(u===r){i=!0,r=a,n=o;break}u=u.sibling}if(!i)throw Error(c(189))}}if(n.alternate!==r)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function B(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=B(e),t!==null)return t;e=e.sibling}return null}var C=Object.assign,W=Symbol.for("react.element"),I=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),te=Symbol.for("react.consumer"),re=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),ge=Symbol.for("react.memo_cache_sentinel"),$e=Symbol.iterator;function oe(e){return e===null||typeof e!="object"?null:(e=$e&&e[$e]||e["@@iterator"],typeof e=="function"?e:null)}var ue=Symbol.for("react.client.reference");function xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case H:return"Fragment";case ee:return"Profiler";case U:return"StrictMode";case ie:return"Suspense";case Q:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case re:return e.displayName||"Context";case te:return(e._context.displayName||"Context")+".Consumer";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case O:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case fe:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var Pe=Array.isArray,E=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ke=[],Ee=-1;function f(e){return{current:e}}function P(e){0>Ee||(e.current=ke[Ee],ke[Ee]=null,Ee--)}function G(e,t){Ee++,ke[Ee]=e.current,e.current=t}var Y=f(null),_e=f(null),ye=f(null),ze=f(null);function Le(e,t){switch(G(ye,t),G(_e,e),G(Y,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?tf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=tf(t),e=nf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(Y),G(Y,e)}function De(){P(Y),P(_e),P(ye)}function Ne(e){e.memoizedState!==null&&G(ze,e);var t=Y.current,n=nf(t,e.type);t!==n&&(G(_e,e),G(Y,n))}function Be(e){_e.current===e&&(P(Y),P(_e)),ze.current===e&&(P(ze),Di._currentValue=se)}var qt,ae;function ce(e){if(qt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);qt=t&&t[1]||"",ae=-1<n.stack.indexOf(`
34
34
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
35
- `+qt+e+ae}var be=!1;function Ie(e,t){if(!e||be)return"";be=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(z){var S=z}Reflect.construct(e,[],$)}else{try{$.call()}catch(z){S=z}e.call($.prototype)}}else{try{throw Error()}catch(z){S=z}($=e())&&typeof $.catch=="function"&&$.catch(function(){})}}catch(z){if(z&&S&&typeof z.stack=="string")return[z.stack,S.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),i=a[0],u=a[1];if(i&&u){var h=i.split(`
35
+ `+qt+e+ae}var be=!1;function Me(e,t){if(!e||be)return"";be=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(z){var S=z}Reflect.construct(e,[],$)}else{try{$.call()}catch(z){S=z}e.call($.prototype)}}else{try{throw Error()}catch(z){S=z}($=e())&&typeof $.catch=="function"&&$.catch(function(){})}}catch(z){if(z&&S&&typeof z.stack=="string")return[z.stack,S.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),i=a[0],u=a[1];if(i&&u){var h=i.split(`
36
36
  `),k=u.split(`
37
37
  `);for(o=r=0;r<h.length&&!h[r].includes("DetermineComponentFrameRoot");)r++;for(;o<k.length&&!k[o].includes("DetermineComponentFrameRoot");)o++;if(r===h.length||o===k.length)for(r=h.length-1,o=k.length-1;1<=r&&0<=o&&h[r]!==k[o];)o--;for(;1<=r&&0<=o;r--,o--)if(h[r]!==k[o]){if(r!==1||o!==1)do if(r--,o--,0>o||h[r]!==k[o]){var j=`
38
- `+h[r].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),j}while(1<=r&&0<=o);break}}}finally{be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ce(n):""}function je(e,t){switch(e.tag){case 26:case 27:case 5:return ce(e.type);case 16:return ce("Lazy");case 13:return e.child!==t&&t!==null?ce("Suspense Fallback"):ce("Suspense");case 19:return ce("SuspenseList");case 0:case 15:return Ie(e.type,!1);case 11:return Ie(e.type.render,!1);case 1:return Ie(e.type,!0);case 31:return ce("Activity");default:return""}}function J(e){try{var t="",n=null;do t+=je(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
38
+ `+h[r].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),j}while(1<=r&&0<=o);break}}}finally{be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ce(n):""}function je(e,t){switch(e.tag){case 26:case 27:case 5:return ce(e.type);case 16:return ce("Lazy");case 13:return e.child!==t&&t!==null?ce("Suspense Fallback"):ce("Suspense");case 19:return ce("SuspenseList");case 0:case 15:return Me(e.type,!1);case 11:return Me(e.type.render,!1);case 1:return Me(e.type,!0);case 31:return ce("Activity");default:return""}}function J(e){try{var t="",n=null;do t+=je(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
39
39
  Error generating stack: `+r.message+`
40
- `+r.stack}}var Oe=Object.prototype.hasOwnProperty,X=s.unstable_scheduleCallback,Ve=s.unstable_cancelCallback,Ge=s.unstable_shouldYield,K=s.unstable_requestPaint,Je=s.unstable_now,Fe=s.unstable_getCurrentPriorityLevel,un=s.unstable_ImmediatePriority,it=s.unstable_UserBlockingPriority,Kt=s.unstable_NormalPriority,Mn=s.unstable_LowPriority,Mo=s.unstable_IdlePriority,yn=s.log,Vr=s.unstable_setDisableYieldValue,Xt=null,Rt=null;function ot(e){if(typeof yn=="function"&&Vr(e),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(Xt,e)}catch{}}var mt=Math.clz32?Math.clz32:Ur,qe=Math.log,dn=Math.LN2;function Ur(e){return e>>>=0,e===0?32:31-(qe(e)/dn|0)|0}var pn=256,me=262144,mn=4194304;function vn(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ve(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var o=0,a=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var u=r&134217727;return u!==0?(r=u&~a,r!==0?o=vn(r):(i&=u,i!==0?o=vn(i):n||(n=u&~e,n!==0&&(o=vn(n))))):(u=r&~a,u!==0?o=vn(u):i!==0?o=vn(i):n||(n=r&~e,n!==0&&(o=vn(n)))),o===0?0:t!==0&&t!==o&&(t&a)===0&&(a=o&-o,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:o}function tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Jt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Io(){var e=mn;return mn<<=1,(mn&62914560)===0&&(mn=4194304),e}function Yn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function cr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function jo(e,t,n,r,o,a){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var u=e.entanglements,h=e.expirationTimes,k=e.hiddenUpdates;for(n=i&~n;0<n;){var j=31-mt(n),$=1<<j;u[j]=0,h[j]=-1;var S=k[j];if(S!==null)for(k[j]=null,j=0;j<S.length;j++){var z=S[j];z!==null&&(z.lane&=-536870913)}n&=~$}r!==0&&Qr(e,r,0),a!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=a&~(i&~t))}function Qr(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-mt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $i(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-mt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}function No(e,t){var n=t&-t;return n=(n&42)!==0?1:er(n),(n&(e.suspendedLanes|t))!==0?0:n}function er(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function fn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ra(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:Ef(e.type))}function qr(e,t){var n=V.p;try{return V.p=e,t()}finally{V.p=n}}var In=Math.random().toString(36).slice(2),Ct="__reactFiber$"+In,Ht="__reactProps$"+In,pr="__reactContainer$"+In,oa="__reactEvents$"+In,Oi="__reactListeners$"+In,aa="__reactHandles$"+In,ia="__reactResources$"+In,kr="__reactMarker$"+In;function qa(e){delete e[Ct],delete e[Ht],delete e[oa],delete e[Oi],delete e[aa]}function mr(e){var t=e[Ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pr]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[Ct])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function Kr(e){if(e=e[Ct]||e[pr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function cn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Mt(e){var t=e[ia];return t||(t=e[ia]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Dt(e){e[kr]=!0}var Yt=new Set,sa={};function fr(e,t){_r(e,t),_r(e+"Capture",t)}function _r(e,t){for(sa[e]=t,e=0;e<t.length;e++)Yt.add(t[e])}var Xr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ro={},Wi={};function Ka(e){return Oe.call(Wi,e)?!0:Oe.call(Ro,e)?!1:Xr.test(e)?Wi[e]=!0:(Ro[e]=!0,!1)}function xn(e,t,n){if(Ka(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function tr(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function nr(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function hn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){n=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sr(e){if(!e._valueTracker){var t=Xa(e)?"checked":"value";e._valueTracker=wn(e,t,""+e[t])}}function bt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Xa(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function hr(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}}var Ga=/[\n"\\]/g;function en(e){return e.replace(Ga,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function la(e,t,n,r,o,a,i,u){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+hn(t)):e.value!==""+hn(t)&&(e.value=""+hn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?ua(e,i,hn(t)):n!=null?ua(e,i,hn(n)):r!=null&&e.removeAttribute("value"),o==null&&a!=null&&(e.defaultChecked=!!a),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.name=""+hn(u):e.removeAttribute("name")}function rr(e,t,n,r,o,a,i,u){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){Sr(e);return}n=n!=null?""+hn(n):"",t=t!=null?""+hn(t):n,u||t===e.value||(e.value=t),e.defaultValue=t}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=u?e.checked:!!r,e.defaultChecked=!!r,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),Sr(e)}function ua(e,t,n){t==="number"&&hr(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Gr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+hn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Hi(e,t,n){if(t!=null&&(t=""+hn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+hn(n):""}function Za(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(c(92));if(Pe(r)){if(1<r.length)throw Error(c(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=hn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Sr(e)}function gr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cr=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function or(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Cr.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Do(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var o in t)r=t[o],t.hasOwnProperty(o)&&n[o]!==r&&or(e,o,r)}else for(var a in t)t.hasOwnProperty(a)&&or(e,a,t[a])}function Zr(e){if(e.indexOf("-")===-1)return!1;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 Bt=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Jr=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function br(e){return Jr.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function kn(){}var da=null;function et(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Er=null,Yr=null;function eo(e){var t=Kr(e);if(t&&(e=t.stateNode)){var n=e[Ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(la(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+en(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=r[Ht]||null;if(!o)throw Error(c(90));la(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&bt(r)}break e;case"textarea":Hi(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Gr(e,!!n.multiple,t,!1)}}}var ca=!1;function pa(e,t,n){if(ca)return e(t,n);ca=!0;try{var r=e(t);return r}finally{if(ca=!1,(Er!==null||Yr!==null)&&(Ps(),Er&&(t=Er,e=Yr,Yr=Er=null,eo(t),e)))for(t=0;t<e.length;t++)eo(e[t])}}function ar(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ht]||null;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(c(231,t,typeof n));return n}var On=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wt=!1;if(On)try{var Et={};Object.defineProperty(Et,"passive",{get:function(){wt=!0}}),window.addEventListener("test",Et,Et),window.removeEventListener("test",Et,Et)}catch{wt=!1}var It=null,Ja=null,tn=null;function Tt(){if(tn)return tn;var e,t=Ja,n=t.length,r,o="value"in It?It.value:It.textContent,a=o.length;for(e=0;e<n&&t[e]===o[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===o[a-r];r++);return tn=o.slice(e,1<r?1-r:void 0)}function Wn(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 To(){return!0}function Bi(){return!1}function yt(e){function t(n,r,o,a,i){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(n=e[u],this[u]=n?n(a):a[u]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?To:Bi,this.isPropagationStopped=Bi,this}return C(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=To)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=To)},persist:function(){},isPersistent:To}),t}var Hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lo=yt(Hn),to=C({},Hn,{view:0,detail:0}),no=yt(to),Fo,$o,jn,Oo=C({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:p,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!==jn&&(jn&&e.type==="mousemove"?(Fo=e.screenX-jn.screenX,$o=e.screenY-jn.screenY):$o=Fo=0,jn=e),Fo)},movementY:function(e){return"movementY"in e?e.movementY:$o}}),Ya=yt(Oo),ei=C({},Oo,{dataTransfer:0}),ml=yt(ei),fl=C({},to,{relatedTarget:0}),ma=yt(fl),hl=C({},Hn,{animationName:0,elapsedTime:0,pseudoElement:0}),gl=yt(hl),Vi=C({},Hn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ui=yt(Vi),ti=C({},Hn,{data:0}),Qi=yt(ti),bl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yl={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"},vl={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xl(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vl[e])?!!t[e]:!1}function p(){return xl}var N=C({},to,{key:function(e){if(e.key){var t=bl[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yl[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:p,charCode:function(e){return e.type==="keypress"?Wn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),R=yt(N),L=C({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Z=yt(L),pe=C({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:p}),Ye=yt(pe),zt=C({},Hn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lt=yt(zt),Te=C({},Oo,{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}),We=yt(Te),kt=C({},Hn,{newState:0,oldState:0}),Gt=yt(kt),Vt=[9,13,27,32],Ut=On&&"CompositionEvent"in window,_n=null;On&&"documentMode"in document&&(_n=document.documentMode);var Bn=On&&"TextEvent"in window&&!_n,Ce=On&&(!Ut||_n&&8<_n&&11>=_n),He=" ",ht=!1;function st(e,t){switch(e){case"keyup":return Vt.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sn(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var St=!1;function nn(e,t){switch(e){case"compositionend":return Sn(t);case"keypress":return t.which!==32?null:(ht=!0,He);case"textInput":return e=t.data,e===He&&ht?null:e;default:return null}}function gt(e,t){if(St)return e==="compositionend"||!Ut&&st(e,t)?(e=Tt(),tn=Ja=It=null,St=!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 Ce&&t.locale!=="ko"?null:t.data;default:return null}}var qi={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 pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!qi[e.type]:t==="textarea"}function mc(e,t,n,r){Er?Yr?Yr.push(r):Yr=[r]:Er=r,t=Ts(t,"onChange"),0<t.length&&(n=new Lo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ni=null,ri=null;function wg(e){Xm(e,0)}function Ki(e){var t=cn(e);if(bt(t))return e}function fc(e,t){if(e==="change")return t}var hc=!1;if(On){var wl;if(On){var kl="oninput"in document;if(!kl){var gc=document.createElement("div");gc.setAttribute("oninput","return;"),kl=typeof gc.oninput=="function"}wl=kl}else wl=!1;hc=wl&&(!document.documentMode||9<document.documentMode)}function bc(){ni&&(ni.detachEvent("onpropertychange",yc),ri=ni=null)}function yc(e){if(e.propertyName==="value"&&Ki(ri)){var t=[];mc(t,ri,e,et(e)),pa(wg,t)}}function kg(e,t,n){e==="focusin"?(bc(),ni=t,ri=n,ni.attachEvent("onpropertychange",yc)):e==="focusout"&&bc()}function _g(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ki(ri)}function Sg(e,t){if(e==="click")return Ki(t)}function Cg(e,t){if(e==="input"||e==="change")return Ki(t)}function Eg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nn=typeof Object.is=="function"?Object.is:Eg;function oi(e,t){if(Nn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Oe.call(t,o)||!Nn(e[o],t[o]))return!1}return!0}function vc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xc(e,t){var n=vc(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=vc(n)}}function wc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=hr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=hr(e.document)}return t}function _l(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")}var zg=On&&"documentMode"in document&&11>=document.documentMode,fa=null,Sl=null,ai=null,Cl=!1;function _c(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Cl||fa==null||fa!==hr(r)||(r=fa,"selectionStart"in r&&_l(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ai&&oi(ai,r)||(ai=r,r=Ts(Sl,"onSelect"),0<r.length&&(t=new Lo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=fa)))}function Wo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ha={animationend:Wo("Animation","AnimationEnd"),animationiteration:Wo("Animation","AnimationIteration"),animationstart:Wo("Animation","AnimationStart"),transitionrun:Wo("Transition","TransitionRun"),transitionstart:Wo("Transition","TransitionStart"),transitioncancel:Wo("Transition","TransitionCancel"),transitionend:Wo("Transition","TransitionEnd")},El={},Sc={};On&&(Sc=document.createElement("div").style,"AnimationEvent"in window||(delete ha.animationend.animation,delete ha.animationiteration.animation,delete ha.animationstart.animation),"TransitionEvent"in window||delete ha.transitionend.transition);function Ho(e){if(El[e])return El[e];if(!ha[e])return e;var t=ha[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Sc)return El[e]=t[n];return e}var Cc=Ho("animationend"),Ec=Ho("animationiteration"),zc=Ho("animationstart"),Ag=Ho("transitionrun"),Pg=Ho("transitionstart"),Mg=Ho("transitioncancel"),Ac=Ho("transitionend"),Pc=new Map,zl="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");zl.push("scrollEnd");function ir(e,t){Pc.set(e,t),fr(t,[e])}var Xi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Vn=[],ga=0,Al=0;function Gi(){for(var e=ga,t=Al=ga=0;t<e;){var n=Vn[t];Vn[t++]=null;var r=Vn[t];Vn[t++]=null;var o=Vn[t];Vn[t++]=null;var a=Vn[t];if(Vn[t++]=null,r!==null&&o!==null){var i=r.pending;i===null?o.next=o:(o.next=i.next,i.next=o),r.pending=o}a!==0&&Mc(n,o,a)}}function Zi(e,t,n,r){Vn[ga++]=e,Vn[ga++]=t,Vn[ga++]=n,Vn[ga++]=r,Al|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Pl(e,t,n,r){return Zi(e,t,n,r),Ji(e)}function Bo(e,t){return Zi(e,null,null,t),Ji(e)}function Mc(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var o=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(o=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,o&&t!==null&&(o=31-mt(n),e=a.hiddenUpdates,r=e[o],r===null?e[o]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ji(e){if(50<zi)throw zi=0,Fu=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ba={};function Ig(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.refCleanup=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 Rn(e,t,n,r){return new Ig(e,t,n,r)}function Ml(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zr(e,t){var n=e.alternate;return n===null?(n=Rn(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&65011712,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.refCleanup=e.refCleanup,n}function Ic(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Yi(e,t,n,r,o,a){var i=0;if(r=e,typeof e=="function")Ml(e)&&(i=1);else if(typeof e=="string")i=T0(e,n,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=Rn(31,n,t,o),e.elementType=le,e.lanes=a,e;case H:return Vo(n.children,o,a,t);case U:i=8,o|=24;break;case ee:return e=Rn(12,n,t,o|2),e.elementType=ee,e.lanes=a,e;case ie:return e=Rn(13,n,t,o),e.elementType=ie,e.lanes=a,e;case Q:return e=Rn(19,n,t,o),e.elementType=Q,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case re:i=10;break e;case te:i=9;break e;case ne:i=11;break e;case O:i=14;break e;case fe:i=16,r=null;break e}i=29,n=Error(c(130,e===null?"null":typeof e,"")),r=null}return t=Rn(i,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Vo(e,t,n,r){return e=Rn(7,e,r,t),e.lanes=n,e}function Il(e,t,n){return e=Rn(6,e,null,t),e.lanes=n,e}function jc(e){var t=Rn(18,null,null,0);return t.stateNode=e,t}function jl(e,t,n){return t=Rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Nc=new WeakMap;function Un(e,t){if(typeof e=="object"&&e!==null){var n=Nc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:J(t)},Nc.set(e,t),t)}return{value:e,source:t,stack:J(t)}}var ya=[],va=0,es=null,ii=0,Qn=[],qn=0,ro=null,yr=1,vr="";function Ar(e,t){ya[va++]=ii,ya[va++]=es,es=e,ii=t}function Rc(e,t,n){Qn[qn++]=yr,Qn[qn++]=vr,Qn[qn++]=ro,ro=e;var r=yr;e=vr;var o=32-mt(r)-1;r&=~(1<<o),n+=1;var a=32-mt(t)+o;if(30<a){var i=o-o%5;a=(r&(1<<i)-1).toString(32),r>>=i,o-=i,yr=1<<32-mt(t)+o|n<<o|r,vr=a+e}else yr=1<<a|n<<o|r,vr=e}function Nl(e){e.return!==null&&(Ar(e,1),Rc(e,1,0))}function Rl(e){for(;e===es;)es=ya[--va],ya[va]=null,ii=ya[--va],ya[va]=null;for(;e===ro;)ro=Qn[--qn],Qn[qn]=null,vr=Qn[--qn],Qn[qn]=null,yr=Qn[--qn],Qn[qn]=null}function Dc(e,t){Qn[qn++]=yr,Qn[qn++]=vr,Qn[qn++]=ro,yr=t.id,vr=t.overflow,ro=e}var rn=null,vt=null,Ze=!1,oo=null,Kn=!1,Dl=Error(c(519));function ao(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw si(Un(t,e)),Dl}function Tc(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[Ht]=r,n){case"dialog":Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":case"embed":Qe("load",t);break;case"video":case"audio":for(n=0;n<Pi.length;n++)Qe(Pi[n],t);break;case"source":Qe("error",t);break;case"img":case"image":case"link":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"input":Qe("invalid",t),rr(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Qe("invalid",t);break;case"textarea":Qe("invalid",t),Za(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||Ym(t.textContent,n)?(r.popover!=null&&(Qe("beforetoggle",t),Qe("toggle",t)),r.onScroll!=null&&Qe("scroll",t),r.onScrollEnd!=null&&Qe("scrollend",t),r.onClick!=null&&(t.onclick=kn),t=!0):t=!1,t||ao(e,!0)}function Lc(e){for(rn=e.return;rn;)switch(rn.tag){case 5:case 31:case 13:Kn=!1;return;case 27:case 3:Kn=!0;return;default:rn=rn.return}}function xa(e){if(e!==rn)return!1;if(!Ze)return Lc(e),Ze=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Yu(e.type,e.memoizedProps)),n=!n),n&&vt&&ao(e),Lc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));vt=uf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));vt=uf(e)}else t===27?(t=vt,xo(e.type)?(e=od,od=null,vt=e):vt=t):vt=rn?Xn(e.stateNode.nextSibling):null;return!0}function Uo(){vt=rn=null,Ze=!1}function Tl(){var e=oo;return e!==null&&(An===null?An=e:An.push.apply(An,e),oo=null),e}function si(e){oo===null?oo=[e]:oo.push(e)}var Ll=f(null),Qo=null,Pr=null;function io(e,t,n){G(Ll,t._currentValue),t._currentValue=n}function Mr(e){e._currentValue=Ll.current,P(Ll)}function Fl(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 $l(e,t,n,r){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){var i=o.child;a=a.firstContext;e:for(;a!==null;){var u=a;a=o;for(var h=0;h<t.length;h++)if(u.context===t[h]){a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Fl(a.return,n,e),r||(i=null);break e}a=u.next}}else if(o.tag===18){if(i=o.return,i===null)throw Error(c(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Fl(i,n,e),i=null}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===e){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}}function wa(e,t,n,r){e=null;for(var o=t,a=!1;o!==null;){if(!a){if((o.flags&524288)!==0)a=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var i=o.alternate;if(i===null)throw Error(c(387));if(i=i.memoizedProps,i!==null){var u=o.type;Nn(o.pendingProps.value,i.value)||(e!==null?e.push(u):e=[u])}}else if(o===ze.current){if(i=o.alternate,i===null)throw Error(c(387));i.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Ri):e=[Ri])}o=o.return}e!==null&&$l(t,e,n,r),t.flags|=262144}function ts(e){for(e=e.firstContext;e!==null;){if(!Nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qo(e){Qo=e,Pr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function on(e){return Fc(Qo,e)}function ns(e,t){return Qo===null&&qo(e),Fc(e,t)}function Fc(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pr===null){if(e===null)throw Error(c(308));Pr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pr=Pr.next=t;return n}var jg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Ng=s.unstable_scheduleCallback,Rg=s.unstable_NormalPriority,Ft={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ol(){return{controller:new jg,data:new Map,refCount:0}}function li(e){e.refCount--,e.refCount===0&&Ng(Rg,function(){e.controller.abort()})}var ui=null,Wl=0,ka=0,_a=null;function Dg(e,t){if(ui===null){var n=ui=[];Wl=0,ka=Vu(),_a={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Wl++,t.then($c,$c),t}function $c(){if(--Wl===0&&ui!==null){_a!==null&&(_a.status="fulfilled");var e=ui;ui=null,ka=0,_a=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Tg(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var o=0;o<n.length;o++)(0,n[o])(t)},function(o){for(r.status="rejected",r.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),r}var Oc=E.S;E.S=function(e,t){_m=Je(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Dg(e,t),Oc!==null&&Oc(e,t)};var Ko=f(null);function Hl(){var e=Ko.current;return e!==null?e:ft.pooledCache}function rs(e,t){t===null?G(Ko,Ko.current):G(Ko,t.pool)}function Wc(){var e=Hl();return e===null?null:{parent:Ft._currentValue,pool:e}}var Sa=Error(c(460)),Bl=Error(c(474)),os=Error(c(542)),as={then:function(){}};function Hc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Bc(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(kn,kn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uc(e),e;default:if(typeof t.status=="string")t.then(kn,kn);else{if(e=ft,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=r}},function(r){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uc(e),e}throw Go=t,Sa}}function Xo(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Go=n,Sa):n}}var Go=null;function Vc(){if(Go===null)throw Error(c(459));var e=Go;return Go=null,e}function Uc(e){if(e===Sa||e===os)throw Error(c(483))}var Ca=null,di=0;function is(e){var t=di;return di+=1,Ca===null&&(Ca=[]),Bc(Ca,e,t)}function ci(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ss(e,t){throw t.$$typeof===W?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Qc(e){function t(b,g){if(e){var w=b.deletions;w===null?(b.deletions=[g],b.flags|=16):w.push(g)}}function n(b,g){if(!e)return null;for(;g!==null;)t(b,g),g=g.sibling;return null}function r(b){for(var g=new Map;b!==null;)b.key!==null?g.set(b.key,b):g.set(b.index,b),b=b.sibling;return g}function o(b,g){return b=zr(b,g),b.index=0,b.sibling=null,b}function a(b,g,w){return b.index=w,e?(w=b.alternate,w!==null?(w=w.index,w<g?(b.flags|=67108866,g):w):(b.flags|=67108866,g)):(b.flags|=1048576,g)}function i(b){return e&&b.alternate===null&&(b.flags|=67108866),b}function u(b,g,w,T){return g===null||g.tag!==6?(g=Il(w,b.mode,T),g.return=b,g):(g=o(g,w),g.return=b,g)}function h(b,g,w,T){var we=w.type;return we===H?j(b,g,w.props.children,T,w.key):g!==null&&(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===fe&&Xo(we)===g.type)?(g=o(g,w.props),ci(g,w),g.return=b,g):(g=Yi(w.type,w.key,w.props,null,b.mode,T),ci(g,w),g.return=b,g)}function k(b,g,w,T){return g===null||g.tag!==4||g.stateNode.containerInfo!==w.containerInfo||g.stateNode.implementation!==w.implementation?(g=jl(w,b.mode,T),g.return=b,g):(g=o(g,w.children||[]),g.return=b,g)}function j(b,g,w,T,we){return g===null||g.tag!==7?(g=Vo(w,b.mode,T,we),g.return=b,g):(g=o(g,w),g.return=b,g)}function $(b,g,w){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Il(""+g,b.mode,w),g.return=b,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case M:return w=Yi(g.type,g.key,g.props,null,b.mode,w),ci(w,g),w.return=b,w;case A:return g=jl(g,b.mode,w),g.return=b,g;case fe:return g=Xo(g),$(b,g,w)}if(Pe(g)||oe(g))return g=Vo(g,b.mode,w,null),g.return=b,g;if(typeof g.then=="function")return $(b,is(g),w);if(g.$$typeof===re)return $(b,ns(b,g),w);ss(b,g)}return null}function S(b,g,w,T){var we=g!==null?g.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return we!==null?null:u(b,g,""+w,T);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case M:return w.key===we?h(b,g,w,T):null;case A:return w.key===we?k(b,g,w,T):null;case fe:return w=Xo(w),S(b,g,w,T)}if(Pe(w)||oe(w))return we!==null?null:j(b,g,w,T,null);if(typeof w.then=="function")return S(b,g,is(w),T);if(w.$$typeof===re)return S(b,g,ns(b,w),T);ss(b,w)}return null}function z(b,g,w,T,we){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return b=b.get(w)||null,u(g,b,""+T,we);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case M:return b=b.get(T.key===null?w:T.key)||null,h(g,b,T,we);case A:return b=b.get(T.key===null?w:T.key)||null,k(g,b,T,we);case fe:return T=Xo(T),z(b,g,w,T,we)}if(Pe(T)||oe(T))return b=b.get(w)||null,j(g,b,T,we,null);if(typeof T.then=="function")return z(b,g,w,is(T),we);if(T.$$typeof===re)return z(b,g,w,ns(g,T),we);ss(g,T)}return null}function de(b,g,w,T){for(var we=null,nt=null,he=g,Ne=g=0,Xe=null;he!==null&&Ne<w.length;Ne++){he.index>Ne?(Xe=he,he=null):Xe=he.sibling;var rt=S(b,he,w[Ne],T);if(rt===null){he===null&&(he=Xe);break}e&&he&&rt.alternate===null&&t(b,he),g=a(rt,g,Ne),nt===null?we=rt:nt.sibling=rt,nt=rt,he=Xe}if(Ne===w.length)return n(b,he),Ze&&Ar(b,Ne),we;if(he===null){for(;Ne<w.length;Ne++)he=$(b,w[Ne],T),he!==null&&(g=a(he,g,Ne),nt===null?we=he:nt.sibling=he,nt=he);return Ze&&Ar(b,Ne),we}for(he=r(he);Ne<w.length;Ne++)Xe=z(he,b,Ne,w[Ne],T),Xe!==null&&(e&&Xe.alternate!==null&&he.delete(Xe.key===null?Ne:Xe.key),g=a(Xe,g,Ne),nt===null?we=Xe:nt.sibling=Xe,nt=Xe);return e&&he.forEach(function(Co){return t(b,Co)}),Ze&&Ar(b,Ne),we}function Se(b,g,w,T){if(w==null)throw Error(c(151));for(var we=null,nt=null,he=g,Ne=g=0,Xe=null,rt=w.next();he!==null&&!rt.done;Ne++,rt=w.next()){he.index>Ne?(Xe=he,he=null):Xe=he.sibling;var Co=S(b,he,rt.value,T);if(Co===null){he===null&&(he=Xe);break}e&&he&&Co.alternate===null&&t(b,he),g=a(Co,g,Ne),nt===null?we=Co:nt.sibling=Co,nt=Co,he=Xe}if(rt.done)return n(b,he),Ze&&Ar(b,Ne),we;if(he===null){for(;!rt.done;Ne++,rt=w.next())rt=$(b,rt.value,T),rt!==null&&(g=a(rt,g,Ne),nt===null?we=rt:nt.sibling=rt,nt=rt);return Ze&&Ar(b,Ne),we}for(he=r(he);!rt.done;Ne++,rt=w.next())rt=z(he,b,Ne,rt.value,T),rt!==null&&(e&&rt.alternate!==null&&he.delete(rt.key===null?Ne:rt.key),g=a(rt,g,Ne),nt===null?we=rt:nt.sibling=rt,nt=rt);return e&&he.forEach(function(q0){return t(b,q0)}),Ze&&Ar(b,Ne),we}function pt(b,g,w,T){if(typeof w=="object"&&w!==null&&w.type===H&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case M:e:{for(var we=w.key;g!==null;){if(g.key===we){if(we=w.type,we===H){if(g.tag===7){n(b,g.sibling),T=o(g,w.props.children),T.return=b,b=T;break e}}else if(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===fe&&Xo(we)===g.type){n(b,g.sibling),T=o(g,w.props),ci(T,w),T.return=b,b=T;break e}n(b,g);break}else t(b,g);g=g.sibling}w.type===H?(T=Vo(w.props.children,b.mode,T,w.key),T.return=b,b=T):(T=Yi(w.type,w.key,w.props,null,b.mode,T),ci(T,w),T.return=b,b=T)}return i(b);case A:e:{for(we=w.key;g!==null;){if(g.key===we)if(g.tag===4&&g.stateNode.containerInfo===w.containerInfo&&g.stateNode.implementation===w.implementation){n(b,g.sibling),T=o(g,w.children||[]),T.return=b,b=T;break e}else{n(b,g);break}else t(b,g);g=g.sibling}T=jl(w,b.mode,T),T.return=b,b=T}return i(b);case fe:return w=Xo(w),pt(b,g,w,T)}if(Pe(w))return de(b,g,w,T);if(oe(w)){if(we=oe(w),typeof we!="function")throw Error(c(150));return w=we.call(w),Se(b,g,w,T)}if(typeof w.then=="function")return pt(b,g,is(w),T);if(w.$$typeof===re)return pt(b,g,ns(b,w),T);ss(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,g!==null&&g.tag===6?(n(b,g.sibling),T=o(g,w),T.return=b,b=T):(n(b,g),T=Il(w,b.mode,T),T.return=b,b=T),i(b)):n(b,g)}return function(b,g,w,T){try{di=0;var we=pt(b,g,w,T);return Ca=null,we}catch(he){if(he===Sa||he===os)throw he;var nt=Rn(29,he,null,b.mode);return nt.lanes=T,nt.return=b,nt}finally{}}}var Zo=Qc(!0),qc=Qc(!1),so=!1;function Vl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ul(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function lo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(at&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=Ji(e),Mc(e,null,n),t}return Zi(e,r,t,n),Ji(e)}function pi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$i(e,n)}}function Ql(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?o=a=i:a=a.next=i,n=n.next}while(n!==null);a===null?o=a=t:a=a.next=t}else o=a=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ql=!1;function mi(){if(ql){var e=_a;if(e!==null)throw e}}function fi(e,t,n,r){ql=!1;var o=e.updateQueue;so=!1;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,u=o.shared.pending;if(u!==null){o.shared.pending=null;var h=u,k=h.next;h.next=null,i===null?a=k:i.next=k,i=h;var j=e.alternate;j!==null&&(j=j.updateQueue,u=j.lastBaseUpdate,u!==i&&(u===null?j.firstBaseUpdate=k:u.next=k,j.lastBaseUpdate=h))}if(a!==null){var $=o.baseState;i=0,j=k=h=null,u=a;do{var S=u.lane&-536870913,z=S!==u.lane;if(z?(Ke&S)===S:(r&S)===S){S!==0&&S===ka&&(ql=!0),j!==null&&(j=j.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var de=e,Se=u;S=t;var pt=n;switch(Se.tag){case 1:if(de=Se.payload,typeof de=="function"){$=de.call(pt,$,S);break e}$=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=Se.payload,S=typeof de=="function"?de.call(pt,$,S):de,S==null)break e;$=C({},$,S);break e;case 2:so=!0}}S=u.callback,S!==null&&(e.flags|=64,z&&(e.flags|=8192),z=o.callbacks,z===null?o.callbacks=[S]:z.push(S))}else z={lane:S,tag:u.tag,payload:u.payload,callback:u.callback,next:null},j===null?(k=j=z,h=$):j=j.next=z,i|=S;if(u=u.next,u===null){if(u=o.shared.pending,u===null)break;z=u,u=z.next,z.next=null,o.lastBaseUpdate=z,o.shared.pending=null}}while(!0);j===null&&(h=$),o.baseState=h,o.firstBaseUpdate=k,o.lastBaseUpdate=j,a===null&&(o.shared.lanes=0),ho|=i,e.lanes=i,e.memoizedState=$}}function Kc(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Xc(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Kc(n[e],t)}var Ea=f(null),ls=f(0);function Gc(e,t){e=$r,G(ls,e),G(Ea,t),$r=e|t.baseLanes}function Kl(){G(ls,$r),G(Ea,Ea.current)}function Xl(){$r=ls.current,P(Ea),P(ls)}var Dn=f(null),sr=null;function co(e){var t=e.alternate;G(jt,jt.current&1),G(Dn,e),sr===null&&(t===null||Ea.current!==null||t.memoizedState!==null)&&(sr=e)}function Gl(e){G(jt,jt.current),G(Dn,e),sr===null&&(sr=e)}function Zc(e){e.tag===22?(G(jt,jt.current),G(Dn,e),sr===null&&(sr=e)):po()}function po(){G(jt,jt.current),G(Dn,Dn.current)}function Tn(e){P(Dn),sr===e&&(sr=null),P(jt)}var jt=f(0);function us(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||nd(n)||rd(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 Ir=0,Me=null,dt=null,$t=null,ds=!1,za=!1,Jo=!1,cs=0,hi=0,Aa=null,Lg=0;function At(){throw Error(c(321))}function Zl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Nn(e[n],t[n]))return!1;return!0}function Jl(e,t,n,r,o,a){return Ir=a,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?Rp:mu,Jo=!1,a=n(r,o),Jo=!1,za&&(a=Yc(t,n,r,o)),Jc(e),a}function Jc(e){E.H=yi;var t=dt!==null&&dt.next!==null;if(Ir=0,$t=dt=Me=null,ds=!1,hi=0,Aa=null,t)throw Error(c(300));e===null||Ot||(e=e.dependencies,e!==null&&ts(e)&&(Ot=!0))}function Yc(e,t,n,r){Me=e;var o=0;do{if(za&&(Aa=null),hi=0,za=!1,25<=o)throw Error(c(301));if(o+=1,$t=dt=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}E.H=Dp,a=t(n,r)}while(za);return a}function Fg(){var e=E.H,t=e.useState()[0];return t=typeof t.then=="function"?gi(t):t,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(Me.flags|=1024),t}function Yl(){var e=cs!==0;return cs=0,e}function eu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function tu(e){if(ds){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ds=!1}Ir=0,$t=dt=Me=null,za=!1,hi=cs=0,Aa=null}function gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Me.memoizedState=$t=e:$t=$t.next=e,$t}function Nt(){if(dt===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=$t===null?Me.memoizedState:$t.next;if(t!==null)$t=t,dt=e;else{if(e===null)throw Me.alternate===null?Error(c(467)):Error(c(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},$t===null?Me.memoizedState=$t=e:$t=$t.next=e}return $t}function ps(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gi(e){var t=hi;return hi+=1,Aa===null&&(Aa=[]),e=Bc(Aa,e,t),t=Me,($t===null?t.memoizedState:$t.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?Rp:mu),e}function ms(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return gi(e);if(e.$$typeof===re)return on(e)}throw Error(c(438,String(e)))}function nu(e){var t=null,n=Me.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Me.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ps(),Me.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ge;return t.index++,n}function jr(e,t){return typeof t=="function"?t(e):t}function fs(e){var t=Nt();return ru(t,dt,e)}function ru(e,t,n){var r=e.queue;if(r===null)throw Error(c(311));r.lastRenderedReducer=n;var o=e.baseQueue,a=r.pending;if(a!==null){if(o!==null){var i=o.next;o.next=a.next,a.next=i}t.baseQueue=o=a,r.pending=null}if(a=e.baseState,o===null)e.memoizedState=a;else{t=o.next;var u=i=null,h=null,k=t,j=!1;do{var $=k.lane&-536870913;if($!==k.lane?(Ke&$)===$:(Ir&$)===$){var S=k.revertLane;if(S===0)h!==null&&(h=h.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),$===ka&&(j=!0);else if((Ir&S)===S){k=k.next,S===ka&&(j=!0);continue}else $={lane:0,revertLane:k.revertLane,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},h===null?(u=h=$,i=a):h=h.next=$,Me.lanes|=S,ho|=S;$=k.action,Jo&&n(a,$),a=k.hasEagerState?k.eagerState:n(a,$)}else S={lane:$,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},h===null?(u=h=S,i=a):h=h.next=S,Me.lanes|=$,ho|=$;k=k.next}while(k!==null&&k!==t);if(h===null?i=a:h.next=u,!Nn(a,e.memoizedState)&&(Ot=!0,j&&(n=_a,n!==null)))throw n;e.memoizedState=a,e.baseState=i,e.baseQueue=h,r.lastRenderedState=a}return o===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ou(e){var t=Nt(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(o!==null){n.pending=null;var i=o=o.next;do a=e(a,i.action),i=i.next;while(i!==o);Nn(a,t.memoizedState)||(Ot=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ep(e,t,n){var r=Me,o=Nt(),a=Ze;if(a){if(n===void 0)throw Error(c(407));n=n()}else n=t();var i=!Nn((dt||o).memoizedState,n);if(i&&(o.memoizedState=n,Ot=!0),o=o.queue,su(rp.bind(null,r,o,e),[e]),o.getSnapshot!==t||i||$t!==null&&$t.memoizedState.tag&1){if(r.flags|=2048,Pa(9,{destroy:void 0},np.bind(null,r,o,n,t),null),ft===null)throw Error(c(349));a||(Ir&127)!==0||tp(r,t,n)}return n}function tp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Me.updateQueue,t===null?(t=ps(),Me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function np(e,t,n,r){t.value=n,t.getSnapshot=r,op(t)&&ap(e)}function rp(e,t,n){return n(function(){op(t)&&ap(e)})}function op(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Nn(e,n)}catch{return!0}}function ap(e){var t=Bo(e,2);t!==null&&Pn(t,e,2)}function au(e){var t=gn();if(typeof e=="function"){var n=e;if(e=n(),Jo){ot(!0);try{n()}finally{ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:e},t}function ip(e,t,n,r){return e.baseState=n,ru(e,dt,typeof r=="function"?r:jr)}function $g(e,t,n,r,o){if(bs(e))throw Error(c(485));if(e=t.action,e!==null){var a={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){a.listeners.push(i)}};E.T!==null?n(!0):a.isTransition=!1,r(a),n=t.pending,n===null?(a.next=t.pending=a,sp(t,a)):(a.next=n.next,t.pending=n.next=a)}}function sp(e,t){var n=t.action,r=t.payload,o=e.state;if(t.isTransition){var a=E.T,i={};E.T=i;try{var u=n(o,r),h=E.S;h!==null&&h(i,u),lp(e,t,u)}catch(k){iu(e,t,k)}finally{a!==null&&i.types!==null&&(a.types=i.types),E.T=a}}else try{a=n(o,r),lp(e,t,a)}catch(k){iu(e,t,k)}}function lp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){up(e,t,r)},function(r){return iu(e,t,r)}):up(e,t,n)}function up(e,t,n){t.status="fulfilled",t.value=n,dp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,sp(e,n)))}function iu(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,dp(t),t=t.next;while(t!==r)}e.action=null}function dp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function cp(e,t){return t}function pp(e,t){if(Ze){var n=ft.formState;if(n!==null){e:{var r=Me;if(Ze){if(vt){t:{for(var o=vt,a=Kn;o.nodeType!==8;){if(!a){o=null;break t}if(o=Xn(o.nextSibling),o===null){o=null;break t}}a=o.data,o=a==="F!"||a==="F"?o:null}if(o){vt=Xn(o.nextSibling),r=o.data==="F!";break e}}ao(r)}r=!1}r&&(t=n[0])}}return n=gn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cp,lastRenderedState:t},n.queue=r,n=Ip.bind(null,Me,r),r.dispatch=n,r=au(!1),a=pu.bind(null,Me,!1,r.queue),r=gn(),o={state:t,dispatch:null,action:e,pending:null},r.queue=o,n=$g.bind(null,Me,o,a,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function mp(e){var t=Nt();return fp(t,dt,e)}function fp(e,t,n){if(t=ru(e,t,cp)[0],e=fs(jr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=gi(t)}catch(i){throw i===Sa?os:i}else r=t;t=Nt();var o=t.queue,a=o.dispatch;return n!==t.memoizedState&&(Me.flags|=2048,Pa(9,{destroy:void 0},Og.bind(null,o,n),null)),[r,a,e]}function Og(e,t){e.action=t}function hp(e){var t=Nt(),n=dt;if(n!==null)return fp(t,n,e);Nt(),t=t.memoizedState,n=Nt();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Pa(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Me.updateQueue,t===null&&(t=ps(),Me.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function gp(){return Nt().memoizedState}function hs(e,t,n,r){var o=gn();Me.flags|=e,o.memoizedState=Pa(1|t,{destroy:void 0},n,r===void 0?null:r)}function gs(e,t,n,r){var o=Nt();r=r===void 0?null:r;var a=o.memoizedState.inst;dt!==null&&r!==null&&Zl(r,dt.memoizedState.deps)?o.memoizedState=Pa(t,a,n,r):(Me.flags|=e,o.memoizedState=Pa(1|t,a,n,r))}function bp(e,t){hs(8390656,8,e,t)}function su(e,t){gs(2048,8,e,t)}function Wg(e){Me.flags|=4;var t=Me.updateQueue;if(t===null)t=ps(),Me.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function yp(e){var t=Nt().memoizedState;return Wg({ref:t,nextImpl:e}),function(){if((at&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function vp(e,t){return gs(4,2,e,t)}function xp(e,t){return gs(4,4,e,t)}function wp(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function kp(e,t,n){n=n!=null?n.concat([e]):null,gs(4,4,wp.bind(null,t,e),n)}function lu(){}function _p(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zl(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Sp(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zl(t,r[1]))return r[0];if(r=e(),Jo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r}function uu(e,t,n){return n===void 0||(Ir&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Cm(),Me.lanes|=e,ho|=e,n)}function Cp(e,t,n,r){return Nn(n,t)?n:Ea.current!==null?(e=uu(e,n,r),Nn(e,t)||(Ot=!0),e):(Ir&42)===0||(Ir&1073741824)!==0&&(Ke&261930)===0?(Ot=!0,e.memoizedState=n):(e=Cm(),Me.lanes|=e,ho|=e,t)}function Ep(e,t,n,r,o){var a=V.p;V.p=a!==0&&8>a?a:8;var i=E.T,u={};E.T=u,pu(e,!1,t,n);try{var h=o(),k=E.S;if(k!==null&&k(u,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var j=Tg(h,r);bi(e,t,j,$n(e))}else bi(e,t,r,$n(e))}catch($){bi(e,t,{then:function(){},status:"rejected",reason:$},$n())}finally{V.p=a,i!==null&&u.types!==null&&(i.types=u.types),E.T=i}}function Hg(){}function du(e,t,n,r){if(e.tag!==5)throw Error(c(476));var o=zp(e).queue;Ep(e,o,t,se,n===null?Hg:function(){return Ap(e),n(r)})}function zp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ap(e){var t=zp(e);t.next===null&&(t=e.alternate.memoizedState),bi(e,t.next.queue,{},$n())}function cu(){return on(Ri)}function Pp(){return Nt().memoizedState}function Mp(){return Nt().memoizedState}function Bg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=$n();e=lo(n);var r=uo(t,e,n);r!==null&&(Pn(r,t,n),pi(r,t,n)),t={cache:Ol()},e.payload=t;return}t=t.return}}function Vg(e,t,n){var r=$n();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bs(e)?jp(t,n):(n=Pl(e,t,n,r),n!==null&&(Pn(n,e,r),Np(n,t,r)))}function Ip(e,t,n){var r=$n();bi(e,t,n,r)}function bi(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bs(e))jp(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,u=a(i,n);if(o.hasEagerState=!0,o.eagerState=u,Nn(u,i))return Zi(e,t,o,0),ft===null&&Gi(),!1}catch{}finally{}if(n=Pl(e,t,o,r),n!==null)return Pn(n,e,r),Np(n,t,r),!0}return!1}function pu(e,t,n,r){if(r={lane:2,revertLane:Vu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bs(e)){if(t)throw Error(c(479))}else t=Pl(e,n,r,2),t!==null&&Pn(t,e,2)}function bs(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function jp(e,t){za=ds=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Np(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$i(e,n)}}var yi={readContext:on,use:ms,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};yi.useEffectEvent=At;var Rp={readContext:on,use:ms,useCallback:function(e,t){return gn().memoizedState=[e,t===void 0?null:t],e},useContext:on,useEffect:bp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,hs(4194308,4,wp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hs(4194308,4,e,t)},useInsertionEffect:function(e,t){hs(4,2,e,t)},useMemo:function(e,t){var n=gn();t=t===void 0?null:t;var r=e();if(Jo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=gn();if(n!==void 0){var o=n(t);if(Jo){ot(!0);try{n(t)}finally{ot(!1)}}}else o=t;return r.memoizedState=r.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},r.queue=e,e=e.dispatch=Vg.bind(null,Me,e),[r.memoizedState,e]},useRef:function(e){var t=gn();return e={current:e},t.memoizedState=e},useState:function(e){e=au(e);var t=e.queue,n=Ip.bind(null,Me,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:lu,useDeferredValue:function(e,t){var n=gn();return uu(n,e,t)},useTransition:function(){var e=au(!1);return e=Ep.bind(null,Me,e.queue,!0,!1),gn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Me,o=gn();if(Ze){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),ft===null)throw Error(c(349));(Ke&127)!==0||tp(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,bp(rp.bind(null,r,a,e),[e]),r.flags|=2048,Pa(9,{destroy:void 0},np.bind(null,r,a,n,t),null),n},useId:function(){var e=gn(),t=ft.identifierPrefix;if(Ze){var n=vr,r=yr;n=(r&~(1<<32-mt(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=cs++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Lg++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:cu,useFormState:pp,useActionState:pp,useOptimistic:function(e){var t=gn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=pu.bind(null,Me,!0,n),n.dispatch=t,[e,t]},useMemoCache:nu,useCacheRefresh:function(){return gn().memoizedState=Bg.bind(null,Me)},useEffectEvent:function(e){var t=gn(),n={impl:e};return t.memoizedState=n,function(){if((at&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},mu={readContext:on,use:ms,useCallback:_p,useContext:on,useEffect:su,useImperativeHandle:kp,useInsertionEffect:vp,useLayoutEffect:xp,useMemo:Sp,useReducer:fs,useRef:gp,useState:function(){return fs(jr)},useDebugValue:lu,useDeferredValue:function(e,t){var n=Nt();return Cp(n,dt.memoizedState,e,t)},useTransition:function(){var e=fs(jr)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:gi(e),t]},useSyncExternalStore:ep,useId:Pp,useHostTransitionStatus:cu,useFormState:mp,useActionState:mp,useOptimistic:function(e,t){var n=Nt();return ip(n,dt,e,t)},useMemoCache:nu,useCacheRefresh:Mp};mu.useEffectEvent=yp;var Dp={readContext:on,use:ms,useCallback:_p,useContext:on,useEffect:su,useImperativeHandle:kp,useInsertionEffect:vp,useLayoutEffect:xp,useMemo:Sp,useReducer:ou,useRef:gp,useState:function(){return ou(jr)},useDebugValue:lu,useDeferredValue:function(e,t){var n=Nt();return dt===null?uu(n,e,t):Cp(n,dt.memoizedState,e,t)},useTransition:function(){var e=ou(jr)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:gi(e),t]},useSyncExternalStore:ep,useId:Pp,useHostTransitionStatus:cu,useFormState:hp,useActionState:hp,useOptimistic:function(e,t){var n=Nt();return dt!==null?ip(n,dt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:nu,useCacheRefresh:Mp};Dp.useEffectEvent=yp;function fu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:C({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hu={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=$n(),o=lo(r);o.payload=t,n!=null&&(o.callback=n),t=uo(e,o,r),t!==null&&(Pn(t,e,r),pi(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=$n(),o=lo(r);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=uo(e,o,r),t!==null&&(Pn(t,e,r),pi(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$n(),r=lo(n);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,n),t!==null&&(Pn(t,e,n),pi(t,e,n))}};function Tp(e,t,n,r,o,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,i):t.prototype&&t.prototype.isPureReactComponent?!oi(n,r)||!oi(o,a):!0}function Lp(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&&hu.enqueueReplaceState(t,t.state,null)}function Yo(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=C({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function Fp(e){Xi(e)}function $p(e){console.error(e)}function Op(e){Xi(e)}function ys(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Wp(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function gu(e,t,n){return n=lo(n),n.tag=3,n.payload={element:null},n.callback=function(){ys(e,t)},n}function Hp(e){return e=lo(e),e.tag=3,e}function Bp(e,t,n,r){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var a=r.value;e.payload=function(){return o(a)},e.callback=function(){Wp(t,n,r)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Wp(t,n,r),typeof o!="function"&&(go===null?go=new Set([this]):go.add(this));var u=r.stack;this.componentDidCatch(r.value,{componentStack:u!==null?u:""})})}function Ug(e,t,n,r,o){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&wa(t,n,o,!0),n=Dn.current,n!==null){switch(n.tag){case 31:case 13:return sr===null?Ms():n.alternate===null&&Pt===0&&(Pt=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===as?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,o)),!1;case 22:return n.flags|=65536,r===as?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,o)),!1}throw Error(c(435,n.tag))}return Wu(e,r,o),Ms(),!1}if(Ze)return t=Dn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==Dl&&(e=Error(c(422),{cause:r}),si(Un(e,n)))):(r!==Dl&&(t=Error(c(423),{cause:r}),si(Un(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=Un(r,n),o=gu(e.stateNode,r,o),Ql(e,o),Pt!==4&&(Pt=2)),!1;var a=Error(c(520),{cause:r});if(a=Un(a,n),Ei===null?Ei=[a]:Ei.push(a),Pt!==4&&(Pt=2),t===null)return!0;r=Un(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=gu(n.stateNode,r,e),Ql(n,e),!1;case 1:if(t=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(go===null||!go.has(a))))return n.flags|=65536,o&=-o,n.lanes|=o,o=Hp(o),Bp(o,e,n,r),Ql(n,o),!1}n=n.return}while(n!==null);return!1}var bu=Error(c(461)),Ot=!1;function an(e,t,n,r){t.child=e===null?qc(t,null,n,r):Zo(t,e.child,n,r)}function Vp(e,t,n,r,o){n=n.render;var a=t.ref;if("ref"in r){var i={};for(var u in r)u!=="ref"&&(i[u]=r[u])}else i=r;return qo(t),r=Jl(e,t,n,i,a,o),u=Yl(),e!==null&&!Ot?(eu(e,t,o),Nr(e,t,o)):(Ze&&u&&Nl(t),t.flags|=1,an(e,t,r,o),t.child)}function Up(e,t,n,r,o){if(e===null){var a=n.type;return typeof a=="function"&&!Ml(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Qp(e,t,a,r,o)):(e=Yi(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cu(e,o)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:oi,n(i,r)&&e.ref===t.ref)return Nr(e,t,o)}return t.flags|=1,e=zr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Qp(e,t,n,r,o){if(e!==null){var a=e.memoizedProps;if(oi(a,r)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=r=a,Cu(e,o))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,Nr(e,t,o)}return yu(e,t,n,r,o)}function qp(e,t,n,r){var o=r.children,a=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(a=a!==null?a.baseLanes|n:n,e!==null){for(r=t.child=e.child,o=0;r!==null;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~a}else r=0,t.child=null;return Kp(e,t,a,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&rs(t,a!==null?a.cachePool:null),a!==null?Gc(t,a):Kl(),Zc(t);else return r=t.lanes=536870912,Kp(e,t,a!==null?a.baseLanes|n:n,n,r)}else a!==null?(rs(t,a.cachePool),Gc(t,a),po(),t.memoizedState=null):(e!==null&&rs(t,null),Kl(),po());return an(e,t,o,n),t.child}function vi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kp(e,t,n,r,o){var a=Hl();return a=a===null?null:{parent:Ft._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&rs(t,null),Kl(),Zc(t),e!==null&&wa(e,t,r,!0),t.childLanes=o,null}function vs(e,t){return t=ws({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xp(e,t,n){return Zo(t,e.child,null,n),e=vs(t,t.pendingProps),e.flags|=2,Tn(t),t.memoizedState=null,e}function Qg(e,t,n){var r=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ze){if(r.mode==="hidden")return e=vs(t,r),t.lanes=536870912,vi(null,e);if(Gl(t),(e=vt)?(e=lf(e,Kn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ro!==null?{id:yr,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},n=jc(e),n.return=t,t.child=n,rn=t,vt=null)):e=null,e===null)throw ao(t);return t.lanes=536870912,null}return vs(t,r)}var a=e.memoizedState;if(a!==null){var i=a.dehydrated;if(Gl(t),o)if(t.flags&256)t.flags&=-257,t=Xp(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Ot||wa(e,t,n,!1),o=(n&e.childLanes)!==0,Ot||o){if(r=ft,r!==null&&(i=No(r,n),i!==0&&i!==a.retryLane))throw a.retryLane=i,Bo(e,i),Pn(r,e,i),bu;Ms(),t=Xp(e,t,n)}else e=a.treeContext,vt=Xn(i.nextSibling),rn=t,Ze=!0,oo=null,Kn=!1,e!==null&&Dc(t,e),t=vs(t,r),t.flags|=4096;return t}return e=zr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function yu(e,t,n,r,o){return qo(t),n=Jl(e,t,n,r,void 0,o),r=Yl(),e!==null&&!Ot?(eu(e,t,o),Nr(e,t,o)):(Ze&&r&&Nl(t),t.flags|=1,an(e,t,n,o),t.child)}function Gp(e,t,n,r,o,a){return qo(t),t.updateQueue=null,n=Yc(t,r,n,o),Jc(e),r=Yl(),e!==null&&!Ot?(eu(e,t,a),Nr(e,t,a)):(Ze&&r&&Nl(t),t.flags|=1,an(e,t,n,a),t.child)}function Zp(e,t,n,r,o){if(qo(t),t.stateNode===null){var a=ba,i=n.contextType;typeof i=="object"&&i!==null&&(a=on(i)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=hu,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Vl(t),i=n.contextType,a.context=typeof i=="object"&&i!==null?on(i):ba,a.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(fu(t,n,i,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(i=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),i!==a.state&&hu.enqueueReplaceState(a,a.state,null),fi(t,r,a,o),mi(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var u=t.memoizedProps,h=Yo(n,u);a.props=h;var k=a.context,j=n.contextType;i=ba,typeof j=="object"&&j!==null&&(i=on(j));var $=n.getDerivedStateFromProps;j=typeof $=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,j||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||k!==i)&&Lp(t,a,r,i),so=!1;var S=t.memoizedState;a.state=S,fi(t,r,a,o),mi(),k=t.memoizedState,u||S!==k||so?(typeof $=="function"&&(fu(t,n,$,r),k=t.memoizedState),(h=so||Tp(t,n,h,r,S,k,i))?(j||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=k),a.props=r,a.state=k,a.context=i,r=h):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ul(e,t),i=t.memoizedProps,j=Yo(n,i),a.props=j,$=t.pendingProps,S=a.context,k=n.contextType,h=ba,typeof k=="object"&&k!==null&&(h=on(k)),u=n.getDerivedStateFromProps,(k=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==$||S!==h)&&Lp(t,a,r,h),so=!1,S=t.memoizedState,a.state=S,fi(t,r,a,o),mi();var z=t.memoizedState;i!==$||S!==z||so||e!==null&&e.dependencies!==null&&ts(e.dependencies)?(typeof u=="function"&&(fu(t,n,u,r),z=t.memoizedState),(j=so||Tp(t,n,j,r,S,z,h)||e!==null&&e.dependencies!==null&&ts(e.dependencies))?(k||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,z,h),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,z,h)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=z),a.props=r,a.state=z,a.context=h,r=j):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,xs(e,t),r=(t.flags&128)!==0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Zo(t,e.child,null,o),t.child=Zo(t,null,n,o)):an(e,t,n,o),t.memoizedState=a.state,e=t.child):e=Nr(e,t,o),e}function Jp(e,t,n,r){return Uo(),t.flags|=256,an(e,t,n,r),t.child}var vu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xu(e){return{baseLanes:e,cachePool:Wc()}}function wu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Fn),e}function Yp(e,t,n){var r=t.pendingProps,o=!1,a=(t.flags&128)!==0,i;if((i=a)||(i=e!==null&&e.memoizedState===null?!1:(jt.current&2)!==0),i&&(o=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ze){if(o?co(t):po(),(e=vt)?(e=lf(e,Kn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ro!==null?{id:yr,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},n=jc(e),n.return=t,t.child=n,rn=t,vt=null)):e=null,e===null)throw ao(t);return rd(e)?t.lanes=32:t.lanes=536870912,null}var u=r.children;return r=r.fallback,o?(po(),o=t.mode,u=ws({mode:"hidden",children:u},o),r=Vo(r,o,n,null),u.return=t,r.return=t,u.sibling=r,t.child=u,r=t.child,r.memoizedState=xu(n),r.childLanes=wu(e,i,n),t.memoizedState=vu,vi(null,r)):(co(t),ku(t,u))}var h=e.memoizedState;if(h!==null&&(u=h.dehydrated,u!==null)){if(a)t.flags&256?(co(t),t.flags&=-257,t=_u(e,t,n)):t.memoizedState!==null?(po(),t.child=e.child,t.flags|=128,t=null):(po(),u=r.fallback,o=t.mode,r=ws({mode:"visible",children:r.children},o),u=Vo(u,o,n,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,Zo(t,e.child,null,n),r=t.child,r.memoizedState=xu(n),r.childLanes=wu(e,i,n),t.memoizedState=vu,t=vi(null,r));else if(co(t),rd(u)){if(i=u.nextSibling&&u.nextSibling.dataset,i)var k=i.dgst;i=k,r=Error(c(419)),r.stack="",r.digest=i,si({value:r,source:null,stack:null}),t=_u(e,t,n)}else if(Ot||wa(e,t,n,!1),i=(n&e.childLanes)!==0,Ot||i){if(i=ft,i!==null&&(r=No(i,n),r!==0&&r!==h.retryLane))throw h.retryLane=r,Bo(e,r),Pn(i,e,r),bu;nd(u)||Ms(),t=_u(e,t,n)}else nd(u)?(t.flags|=192,t.child=e.child,t=null):(e=h.treeContext,vt=Xn(u.nextSibling),rn=t,Ze=!0,oo=null,Kn=!1,e!==null&&Dc(t,e),t=ku(t,r.children),t.flags|=4096);return t}return o?(po(),u=r.fallback,o=t.mode,h=e.child,k=h.sibling,r=zr(h,{mode:"hidden",children:r.children}),r.subtreeFlags=h.subtreeFlags&65011712,k!==null?u=zr(k,u):(u=Vo(u,o,n,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,vi(null,r),r=t.child,u=e.child.memoizedState,u===null?u=xu(n):(o=u.cachePool,o!==null?(h=Ft._currentValue,o=o.parent!==h?{parent:h,pool:h}:o):o=Wc(),u={baseLanes:u.baseLanes|n,cachePool:o}),r.memoizedState=u,r.childLanes=wu(e,i,n),t.memoizedState=vu,vi(e.child,r)):(co(t),n=e.child,e=n.sibling,n=zr(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function ku(e,t){return t=ws({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ws(e,t){return e=Rn(22,e,null,t),e.lanes=0,e}function _u(e,t,n){return Zo(t,e.child,null,n),e=ku(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function em(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Fl(e.return,t,n)}function Su(e,t,n,r,o,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o,i.treeForkCount=a)}function tm(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;r=r.children;var i=jt.current,u=(i&2)!==0;if(u?(i=i&1|2,t.flags|=128):i&=1,G(jt,i),an(e,t,r,n),r=Ze?ii:0,!u&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&em(e,n,t);else if(e.tag===19)em(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}switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&us(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Su(t,!1,o,n,a,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&us(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Su(t,!0,n,null,a,r);break;case"together":Su(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Nr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ho|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(wa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=zr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=zr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ts(e)))}function qg(e,t,n){switch(t.tag){case 3:Le(t,t.stateNode.containerInfo),io(t,Ft,e.memoizedState.cache),Uo();break;case 27:case 5:De(t);break;case 4:Le(t,t.stateNode.containerInfo);break;case 10:io(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Gl(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(co(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Yp(e,t,n):(co(t),e=Nr(e,t,n),e!==null?e.sibling:null);co(t);break;case 19:var o=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(wa(e,t,n,!1),r=(n&t.childLanes)!==0),o){if(r)return tm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(jt,jt.current),r)break;return null;case 22:return t.lanes=0,qp(e,t,n,t.pendingProps);case 24:io(t,Ft,e.memoizedState.cache)}return Nr(e,t,n)}function nm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!Cu(e,n)&&(t.flags&128)===0)return Ot=!1,qg(e,t,n);Ot=(e.flags&131072)!==0}else Ot=!1,Ze&&(t.flags&1048576)!==0&&Rc(t,ii,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Xo(t.elementType),t.type=e,typeof e=="function")Ml(e)?(r=Yo(e,r),t.tag=1,t=Zp(null,t,e,r,n)):(t.tag=0,t=yu(null,t,e,r,n));else{if(e!=null){var o=e.$$typeof;if(o===ne){t.tag=11,t=Vp(null,t,e,r,n);break e}else if(o===O){t.tag=14,t=Up(null,t,e,r,n);break e}}throw t=xe(e)||e,Error(c(306,t,""))}}return t;case 0:return yu(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,o=Yo(r,t.pendingProps),Zp(e,t,r,o,n);case 3:e:{if(Le(t,t.stateNode.containerInfo),e===null)throw Error(c(387));r=t.pendingProps;var a=t.memoizedState;o=a.element,Ul(e,t),fi(t,r,null,n);var i=t.memoizedState;if(r=i.cache,io(t,Ft,r),r!==a.cache&&$l(t,[Ft],n,!0),mi(),r=i.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Jp(e,t,r,n);break e}else if(r!==o){o=Un(Error(c(424)),t),si(o),t=Jp(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(vt=Xn(e.firstChild),rn=t,Ze=!0,oo=null,Kn=!0,n=qc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Uo(),r===o){t=Nr(e,t,n);break e}an(e,t,r,n)}t=t.child}return t;case 26:return xs(e,t),e===null?(n=ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ze||(n=t.type,e=t.pendingProps,r=Ls(ye.current).createElement(n),r[Ct]=t,r[Ht]=e,sn(r,n,e),Dt(r),t.stateNode=r):t.memoizedState=ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&Ze&&(r=t.stateNode=cf(t.type,t.pendingProps,ye.current),rn=t,Kn=!0,o=vt,xo(t.type)?(od=o,vt=Xn(r.firstChild)):vt=o),an(e,t,t.pendingProps.children,n),xs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ze&&((o=r=vt)&&(r=_0(r,t.type,t.pendingProps,Kn),r!==null?(t.stateNode=r,rn=t,vt=Xn(r.firstChild),Kn=!1,o=!0):o=!1),o||ao(t)),De(t),o=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,r=a.children,Yu(o,a)?r=null:i!==null&&Yu(o,i)&&(t.flags|=32),t.memoizedState!==null&&(o=Jl(e,t,Fg,null,null,n),Ri._currentValue=o),xs(e,t),an(e,t,r,n),t.child;case 6:return e===null&&Ze&&((e=n=vt)&&(n=S0(n,t.pendingProps,Kn),n!==null?(t.stateNode=n,rn=t,vt=null,e=!0):e=!1),e||ao(t)),null;case 13:return Yp(e,t,n);case 4:return Le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zo(t,null,r,n):an(e,t,r,n),t.child;case 11:return Vp(e,t,t.type,t.pendingProps,n);case 7:return an(e,t,t.pendingProps,n),t.child;case 8:return an(e,t,t.pendingProps.children,n),t.child;case 12:return an(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,io(t,t.type,r.value),an(e,t,r.children,n),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,qo(t),o=on(o),r=r(o),t.flags|=1,an(e,t,r,n),t.child;case 14:return Up(e,t,t.type,t.pendingProps,n);case 15:return Qp(e,t,t.type,t.pendingProps,n);case 19:return tm(e,t,n);case 31:return Qg(e,t,n);case 22:return qp(e,t,n,t.pendingProps);case 24:return qo(t),r=on(Ft),e===null?(o=Hl(),o===null&&(o=ft,a=Ol(),o.pooledCache=a,a.refCount++,a!==null&&(o.pooledCacheLanes|=n),o=a),t.memoizedState={parent:r,cache:o},Vl(t),io(t,Ft,o)):((e.lanes&n)!==0&&(Ul(e,t),fi(t,null,null,n),mi()),o=e.memoizedState,a=t.memoizedState,o.parent!==r?(o={parent:r,cache:r},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),io(t,Ft,r)):(r=a.cache,io(t,Ft,r),r!==o.cache&&$l(t,[Ft],n,!0))),an(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Rr(e){e.flags|=4}function Eu(e,t,n,r,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(Pm())e.flags|=8192;else throw Go=as,Bl}else e.flags&=-16777217}function rm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!vf(t))if(Pm())e.flags|=8192;else throw Go=as,Bl}function ks(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Io():536870912,e.lanes|=t,Na|=t)}function xi(e,t){if(!Ze)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 xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&65011712,r|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Kg(e,t,n){var r=t.pendingProps;switch(Rl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(t),null;case 1:return xt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Mr(Ft),Re(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(xa(t)?Rr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Tl())),xt(t),null;case 26:var o=t.type,a=t.memoizedState;return e===null?(Rr(t),a!==null?(xt(t),rm(t,a)):(xt(t),Eu(t,o,null,r,n))):a?a!==e.memoizedState?(Rr(t),xt(t),rm(t,a)):(xt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Rr(t),xt(t),Eu(t,o,e,r,n)),null;case 27:if(Be(t),n=ye.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return xt(t),null}e=Y.current,xa(t)?Tc(t):(e=cf(o,r,n),t.stateNode=e,Rr(t))}return xt(t),null;case 5:if(Be(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return xt(t),null}if(a=Y.current,xa(t))Tc(t);else{var i=Ls(ye.current);switch(a){case 1:a=i.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:a=i.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":a=i.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":a=i.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":a=i.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is=="string"?i.createElement(o,{is:r.is}):i.createElement(o)}}a[Ct]=t,a[Ht]=r;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)a.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=a;e:switch(sn(a,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Rr(t)}}return xt(t),Eu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Rr(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(c(166));if(e=ye.current,xa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,o=rn,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Ym(e.nodeValue,n)),e||ao(t,!0)}else e=Ls(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return xt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=xa(t),n!==null){if(e===null){if(!r)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Ct]=t}else Uo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else n=Tl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Tn(t),t):(Tn(t),null);if((t.flags&128)!==0)throw Error(c(558))}return xt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=xa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[Ct]=t}else Uo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),o=!1}else o=Tl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Tn(t),t):(Tn(t),null)}return Tn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==o&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ks(t,t.updateQueue),xt(t),null);case 4:return Re(),e===null&&Ku(t.stateNode.containerInfo),xt(t),null;case 10:return Mr(t.type),xt(t),null;case 19:if(P(jt),r=t.memoizedState,r===null)return xt(t),null;if(o=(t.flags&128)!==0,a=r.rendering,a===null)if(o)xi(r,!1);else{if(Pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=us(e),a!==null){for(t.flags|=128,xi(r,!1),e=a.updateQueue,t.updateQueue=e,ks(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ic(n,e),n=n.sibling;return G(jt,jt.current&1|2),Ze&&Ar(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Je()>zs&&(t.flags|=128,o=!0,xi(r,!1),t.lanes=4194304)}else{if(!o)if(e=us(a),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,ks(t,e),xi(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!Ze)return xt(t),null}else 2*Je()-r.renderingStartTime>zs&&n!==536870912&&(t.flags|=128,o=!0,xi(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e!==null?e.sibling=a:t.child=a,r.last=a)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Je(),e.sibling=null,n=jt.current,G(jt,o?n&1|2:n&1),Ze&&Ar(t,r.treeForkCount),e):(xt(t),null);case 22:case 23:return Tn(t),Xl(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),n=t.updateQueue,n!==null&&ks(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&P(Ko),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Mr(Ft),xt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Xg(e,t){switch(Rl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mr(Ft),Re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Be(t),null;case 31:if(t.memoizedState!==null){if(Tn(t),t.alternate===null)throw Error(c(340));Uo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Tn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Uo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(jt),null;case 4:return Re(),null;case 10:return Mr(t.type),null;case 22:case 23:return Tn(t),Xl(),e!==null&&P(Ko),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Mr(Ft),null;case 25:return null;default:return null}}function om(e,t){switch(Rl(t),t.tag){case 3:Mr(Ft),Re();break;case 26:case 27:case 5:Be(t);break;case 4:Re();break;case 31:t.memoizedState!==null&&Tn(t);break;case 13:Tn(t);break;case 19:P(jt);break;case 10:Mr(t.type);break;case 22:case 23:Tn(t),Xl(),e!==null&&P(Ko);break;case 24:Mr(Ft)}}function wi(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&e)===e){r=void 0;var a=n.create,i=n.inst;r=a(),i.destroy=r}n=n.next}while(n!==o)}}catch(u){ut(t,t.return,u)}}function mo(e,t,n){try{var r=t.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var a=o.next;r=a;do{if((r.tag&e)===e){var i=r.inst,u=i.destroy;if(u!==void 0){i.destroy=void 0,o=t;var h=n,k=u;try{k()}catch(j){ut(o,h,j)}}}r=r.next}while(r!==a)}}catch(j){ut(t,t.return,j)}}function am(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xc(t,n)}catch(r){ut(e,e.return,r)}}}function im(e,t,n){n.props=Yo(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){ut(e,t,r)}}function ki(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(o){ut(e,t,o)}}function xr(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(o){ut(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){ut(e,t,o)}else n.current=null}function sm(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(o){ut(e,e.return,o)}}function zu(e,t,n){try{var r=e.stateNode;b0(r,e.type,n,t),r[Ht]=t}catch(o){ut(e,e.return,o)}}function lm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xo(e.type)||e.tag===4}function Au(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lm(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.tag===27&&xo(e.type)||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 Pu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=kn));else if(r!==4&&(r===27&&xo(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Pu(e,t,n),e=e.sibling;e!==null;)Pu(e,t,n),e=e.sibling}function _s(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&&(r===27&&xo(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(_s(e,t,n),e=e.sibling;e!==null;)_s(e,t,n),e=e.sibling}function um(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);sn(t,r,n),t[Ct]=e,t[Ht]=n}catch(a){ut(e,e.return,a)}}var Dr=!1,Wt=!1,Mu=!1,dm=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function Gg(e,t){if(e=e.containerInfo,Zu=Vs,e=kc(e),_l(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var i=0,u=-1,h=-1,k=0,j=0,$=e,S=null;t:for(;;){for(var z;$!==n||o!==0&&$.nodeType!==3||(u=i+o),$!==a||r!==0&&$.nodeType!==3||(h=i+r),$.nodeType===3&&(i+=$.nodeValue.length),(z=$.firstChild)!==null;)S=$,$=z;for(;;){if($===e)break t;if(S===n&&++k===o&&(u=i),S===a&&++j===r&&(h=i),(z=$.nextSibling)!==null)break;$=S,S=$.parentNode}$=z}n=u===-1||h===-1?null:{start:u,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ju={focusedElem:e,selectionRange:n},Vs=!1,Zt=t;Zt!==null;)if(t=Zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Zt=e;else for(;Zt!==null;){switch(t=Zt,a=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)o=e[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&a!==null){e=void 0,n=t,o=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var de=Yo(n.type,o);e=r.getSnapshotBeforeUpdate(de,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(Se){ut(n,n.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)td(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":td(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Zt=e;break}Zt=t.return}}function cm(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lr(e,n),r&4&&wi(5,n);break;case 1:if(Lr(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){ut(n,n.return,i)}else{var o=Yo(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){ut(n,n.return,i)}}r&64&&am(n),r&512&&ki(n,n.return);break;case 3:if(Lr(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Xc(e,t)}catch(i){ut(n,n.return,i)}}break;case 27:t===null&&r&4&&um(n);case 26:case 5:Lr(e,n),t===null&&r&4&&sm(n),r&512&&ki(n,n.return);break;case 12:Lr(e,n);break;case 31:Lr(e,n),r&4&&fm(e,n);break;case 13:Lr(e,n),r&4&&hm(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=a0.bind(null,n),C0(e,n))));break;case 22:if(r=n.memoizedState!==null||Dr,!r){t=t!==null&&t.memoizedState!==null||Wt,o=Dr;var a=Wt;Dr=r,(Wt=t)&&!a?Fr(e,n,(n.subtreeFlags&8772)!==0):Lr(e,n),Dr=o,Wt=a}break;case 30:break;default:Lr(e,n)}}function pm(e){var t=e.alternate;t!==null&&(e.alternate=null,pm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&qa(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var _t=null,Cn=!1;function Tr(e,t,n){for(n=n.child;n!==null;)mm(e,t,n),n=n.sibling}function mm(e,t,n){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(Xt,n)}catch{}switch(n.tag){case 26:Wt||xr(n,t),Tr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Wt||xr(n,t);var r=_t,o=Cn;xo(n.type)&&(_t=n.stateNode,Cn=!1),Tr(e,t,n),Ii(n.stateNode),_t=r,Cn=o;break;case 5:Wt||xr(n,t);case 6:if(r=_t,o=Cn,_t=null,Tr(e,t,n),_t=r,Cn=o,_t!==null)if(Cn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(n.stateNode)}catch(a){ut(n,t,a)}else try{_t.removeChild(n.stateNode)}catch(a){ut(n,t,a)}break;case 18:_t!==null&&(Cn?(e=_t,af(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wa(e)):af(_t,n.stateNode));break;case 4:r=_t,o=Cn,_t=n.stateNode.containerInfo,Cn=!0,Tr(e,t,n),_t=r,Cn=o;break;case 0:case 11:case 14:case 15:mo(2,n,t),Wt||mo(4,n,t),Tr(e,t,n);break;case 1:Wt||(xr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&im(n,t,r)),Tr(e,t,n);break;case 21:Tr(e,t,n);break;case 22:Wt=(r=Wt)||n.memoizedState!==null,Tr(e,t,n),Wt=r;break;default:Tr(e,t,n)}}function fm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wa(e)}catch(n){ut(t,t.return,n)}}}function hm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wa(e)}catch(n){ut(t,t.return,n)}}function Zg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dm),t;default:throw Error(c(435,e.tag))}}function Ss(e,t){var n=Zg(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var o=i0.bind(null,e,r);r.then(o,o)}})}function En(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r],a=e,i=t,u=i;e:for(;u!==null;){switch(u.tag){case 27:if(xo(u.type)){_t=u.stateNode,Cn=!1;break e}break;case 5:_t=u.stateNode,Cn=!1;break e;case 3:case 4:_t=u.stateNode.containerInfo,Cn=!0;break e}u=u.return}if(_t===null)throw Error(c(160));mm(a,i,o),_t=null,Cn=!1,a=o.alternate,a!==null&&(a.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gm(t,e),t=t.sibling}var lr=null;function gm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:En(t,e),zn(e),r&4&&(mo(3,e,e.return),wi(3,e),mo(5,e,e.return));break;case 1:En(t,e),zn(e),r&512&&(Wt||n===null||xr(n,n.return)),r&64&&Dr&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var o=lr;if(En(t,e),zn(e),r&512&&(Wt||n===null||xr(n,n.return)),r&4){var a=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(r){case"title":a=o.getElementsByTagName("title")[0],(!a||a[kr]||a[Ct]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=o.createElement(r),o.head.insertBefore(a,o.querySelector("head > title"))),sn(a,r,n),a[Ct]=e,Dt(a),r=a;break e;case"link":var i=bf("link","href",o).get(r+(n.href||""));if(i){for(var u=0;u<i.length;u++)if(a=i[u],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(u,1);break t}}a=o.createElement(r),sn(a,r,n),o.head.appendChild(a);break;case"meta":if(i=bf("meta","content",o).get(r+(n.content||""))){for(u=0;u<i.length;u++)if(a=i[u],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(u,1);break t}}a=o.createElement(r),sn(a,r,n),o.head.appendChild(a);break;default:throw Error(c(468,r))}a[Ct]=e,Dt(a),r=a}e.stateNode=r}else yf(o,e.type,e.stateNode);else e.stateNode=gf(o,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?yf(o,e.type,e.stateNode):gf(o,r,e.memoizedProps)):r===null&&e.stateNode!==null&&zu(e,e.memoizedProps,n.memoizedProps)}break;case 27:En(t,e),zn(e),r&512&&(Wt||n===null||xr(n,n.return)),n!==null&&r&4&&zu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(En(t,e),zn(e),r&512&&(Wt||n===null||xr(n,n.return)),e.flags&32){o=e.stateNode;try{gr(o,"")}catch(de){ut(e,e.return,de)}}r&4&&e.stateNode!=null&&(o=e.memoizedProps,zu(e,o,n!==null?n.memoizedProps:o)),r&1024&&(Mu=!0);break;case 6:if(En(t,e),zn(e),r&4){if(e.stateNode===null)throw Error(c(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(de){ut(e,e.return,de)}}break;case 3:if(Os=null,o=lr,lr=Fs(t.containerInfo),En(t,e),lr=o,zn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Wa(t.containerInfo)}catch(de){ut(e,e.return,de)}Mu&&(Mu=!1,bm(e));break;case 4:r=lr,lr=Fs(e.stateNode.containerInfo),En(t,e),zn(e),lr=r;break;case 12:En(t,e),zn(e);break;case 31:En(t,e),zn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ss(e,r)));break;case 13:En(t,e),zn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Es=Je()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ss(e,r)));break;case 22:o=e.memoizedState!==null;var h=n!==null&&n.memoizedState!==null,k=Dr,j=Wt;if(Dr=k||o,Wt=j||h,En(t,e),Wt=j,Dr=k,zn(e),r&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||h||Dr||Wt||ea(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){h=n=t;try{if(a=h.stateNode,o)i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{u=h.stateNode;var $=h.memoizedProps.style,S=$!=null&&$.hasOwnProperty("display")?$.display:null;u.style.display=S==null||typeof S=="boolean"?"":(""+S).trim()}}catch(de){ut(h,h.return,de)}}}else if(t.tag===6){if(n===null){h=t;try{h.stateNode.nodeValue=o?"":h.memoizedProps}catch(de){ut(h,h.return,de)}}}else if(t.tag===18){if(n===null){h=t;try{var z=h.stateNode;o?sf(z,!0):sf(h.stateNode,!1)}catch(de){ut(h,h.return,de)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Ss(e,n))));break;case 19:En(t,e),zn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ss(e,r)));break;case 30:break;case 21:break;default:En(t,e),zn(e)}}function zn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(lm(r)){n=r;break}r=r.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var o=n.stateNode,a=Au(e);_s(e,a,o);break;case 5:var i=n.stateNode;n.flags&32&&(gr(i,""),n.flags&=-33);var u=Au(e);_s(e,u,i);break;case 3:case 4:var h=n.stateNode.containerInfo,k=Au(e);Pu(e,k,h);break;default:throw Error(c(161))}}catch(j){ut(e,e.return,j)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Lr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cm(e,t.alternate,t),t=t.sibling}function ea(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:mo(4,t,t.return),ea(t);break;case 1:xr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&im(t,t.return,n),ea(t);break;case 27:Ii(t.stateNode);case 26:case 5:xr(t,t.return),ea(t);break;case 22:t.memoizedState===null&&ea(t);break;case 30:ea(t);break;default:ea(t)}e=e.sibling}}function Fr(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,o=e,a=t,i=a.flags;switch(a.tag){case 0:case 11:case 15:Fr(o,a,n),wi(4,a);break;case 1:if(Fr(o,a,n),r=a,o=r.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(k){ut(r,r.return,k)}if(r=a,o=r.updateQueue,o!==null){var u=r.stateNode;try{var h=o.shared.hiddenCallbacks;if(h!==null)for(o.shared.hiddenCallbacks=null,o=0;o<h.length;o++)Kc(h[o],u)}catch(k){ut(r,r.return,k)}}n&&i&64&&am(a),ki(a,a.return);break;case 27:um(a);case 26:case 5:Fr(o,a,n),n&&r===null&&i&4&&sm(a),ki(a,a.return);break;case 12:Fr(o,a,n);break;case 31:Fr(o,a,n),n&&i&4&&fm(o,a);break;case 13:Fr(o,a,n),n&&i&4&&hm(o,a);break;case 22:a.memoizedState===null&&Fr(o,a,n),ki(a,a.return);break;case 30:break;default:Fr(o,a,n)}t=t.sibling}}function Iu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&li(n))}function ju(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&li(e))}function ur(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ym(e,t,n,r),t=t.sibling}function ym(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:ur(e,t,n,r),o&2048&&wi(9,t);break;case 1:ur(e,t,n,r);break;case 3:ur(e,t,n,r),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&li(e)));break;case 12:if(o&2048){ur(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,i=a.id,u=a.onPostCommit;typeof u=="function"&&u(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(h){ut(t,t.return,h)}}else ur(e,t,n,r);break;case 31:ur(e,t,n,r);break;case 13:ur(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,i=t.alternate,t.memoizedState!==null?a._visibility&2?ur(e,t,n,r):_i(e,t):a._visibility&2?ur(e,t,n,r):(a._visibility|=2,Ma(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Iu(i,t);break;case 24:ur(e,t,n,r),o&2048&&ju(t.alternate,t);break;default:ur(e,t,n,r)}}function Ma(e,t,n,r,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,i=t,u=n,h=r,k=i.flags;switch(i.tag){case 0:case 11:case 15:Ma(a,i,u,h,o),wi(8,i);break;case 23:break;case 22:var j=i.stateNode;i.memoizedState!==null?j._visibility&2?Ma(a,i,u,h,o):_i(a,i):(j._visibility|=2,Ma(a,i,u,h,o)),o&&k&2048&&Iu(i.alternate,i);break;case 24:Ma(a,i,u,h,o),o&&k&2048&&ju(i.alternate,i);break;default:Ma(a,i,u,h,o)}t=t.sibling}}function _i(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,o=r.flags;switch(r.tag){case 22:_i(n,r),o&2048&&Iu(r.alternate,r);break;case 24:_i(n,r),o&2048&&ju(r.alternate,r);break;default:_i(n,r)}t=t.sibling}}var Si=8192;function Ia(e,t,n){if(e.subtreeFlags&Si)for(e=e.child;e!==null;)vm(e,t,n),e=e.sibling}function vm(e,t,n){switch(e.tag){case 26:Ia(e,t,n),e.flags&Si&&e.memoizedState!==null&&L0(n,lr,e.memoizedState,e.memoizedProps);break;case 5:Ia(e,t,n);break;case 3:case 4:var r=lr;lr=Fs(e.stateNode.containerInfo),Ia(e,t,n),lr=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Si,Si=16777216,Ia(e,t,n),Si=r):Ia(e,t,n));break;default:Ia(e,t,n)}}function xm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ci(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zt=r,km(r,e)}xm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wm(e),e=e.sibling}function wm(e){switch(e.tag){case 0:case 11:case 15:Ci(e),e.flags&2048&&mo(9,e,e.return);break;case 3:Ci(e);break;case 12:Ci(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Cs(e)):Ci(e);break;default:Ci(e)}}function Cs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zt=r,km(r,e)}xm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:mo(8,t,t.return),Cs(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Cs(t));break;default:Cs(t)}e=e.sibling}}function km(e,t){for(;Zt!==null;){var n=Zt;switch(n.tag){case 0:case 11:case 15:mo(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:li(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Zt=r;else e:for(n=e;Zt!==null;){r=Zt;var o=r.sibling,a=r.return;if(pm(r),r===n){Zt=null;break e}if(o!==null){o.return=a,Zt=o;break e}Zt=a}}}var Jg={getCacheForType:function(e){var t=on(Ft),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return on(Ft).controller.signal}},Yg=typeof WeakMap=="function"?WeakMap:Map,at=0,ft=null,Ue=null,Ke=0,lt=0,Ln=null,fo=!1,ja=!1,Nu=!1,$r=0,Pt=0,ho=0,ta=0,Ru=0,Fn=0,Na=0,Ei=null,An=null,Du=!1,Es=0,_m=0,zs=1/0,As=null,go=null,Qt=0,bo=null,Ra=null,Or=0,Tu=0,Lu=null,Sm=null,zi=0,Fu=null;function $n(){return(at&2)!==0&&Ke!==0?Ke&-Ke:E.T!==null?Vu():ra()}function Cm(){if(Fn===0)if((Ke&536870912)===0||Ze){var e=me;me<<=1,(me&3932160)===0&&(me=262144),Fn=e}else Fn=536870912;return e=Dn.current,e!==null&&(e.flags|=32),Fn}function Pn(e,t,n){(e===ft&&(lt===2||lt===9)||e.cancelPendingCommit!==null)&&(Da(e,0),yo(e,Ke,Fn,!1)),cr(e,n),((at&2)===0||e!==ft)&&(e===ft&&((at&2)===0&&(ta|=n),Pt===4&&yo(e,Ke,Fn,!1)),wr(e))}function Em(e,t,n){if((at&6)!==0)throw Error(c(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||tt(e,t),o=r?n0(e,t):Ou(e,t,!0),a=r;do{if(o===0){ja&&!r&&yo(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!e0(n)){o=Ou(e,t,!1),a=!1;continue}if(o===2){if(a=t,e.errorRecoveryDisabledLanes&a)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var u=e;o=Ei;var h=u.current.memoizedState.isDehydrated;if(h&&(Da(u,i).flags|=256),i=Ou(u,i,!1),i!==2){if(Nu&&!h){u.errorRecoveryDisabledLanes|=a,ta|=a,o=4;break e}a=An,An=o,a!==null&&(An===null?An=a:An.push.apply(An,a))}o=i}if(a=!1,o!==2)continue}}if(o===1){Da(e,0),yo(e,t,0,!0);break}e:{switch(r=e,a=o,a){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:yo(r,t,Fn,!fo);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(o=Es+300-Je(),10<o)){if(yo(r,t,Fn,!fo),ve(r,0,!0)!==0)break e;Or=t,r.timeoutHandle=rf(zm.bind(null,r,n,An,As,Du,t,Fn,ta,Na,fo,a,"Throttled",-0,0),o);break e}zm(r,n,An,As,Du,t,Fn,ta,Na,fo,a,null,-0,0)}}break}while(!0);wr(e)}function zm(e,t,n,r,o,a,i,u,h,k,j,$,S,z){if(e.timeoutHandle=-1,$=t.subtreeFlags,$&8192||($&16785408)===16785408){$={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kn},vm(t,a,$);var de=(a&62914560)===a?Es-Je():(a&4194048)===a?_m-Je():0;if(de=F0($,de),de!==null){Or=a,e.cancelPendingCommit=de(Dm.bind(null,e,t,a,n,r,o,i,u,h,j,$,null,S,z)),yo(e,a,i,!k);return}}Dm(e,t,a,n,r,o,i,u,h)}function e0(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var o=n[r],a=o.getSnapshot;o=o.value;try{if(!Nn(a(),o))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yo(e,t,n,r){t&=~Ru,t&=~ta,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var a=31-mt(o),i=1<<a;r[a]=-1,o&=~i}n!==0&&Qr(e,n,t)}function Ps(){return(at&6)===0?(Ai(0),!1):!0}function $u(){if(Ue!==null){if(lt===0)var e=Ue.return;else e=Ue,Pr=Qo=null,tu(e),Ca=null,di=0,e=Ue;for(;e!==null;)om(e.alternate,e),e=e.return;Ue=null}}function Da(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,x0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Or=0,$u(),ft=e,Ue=n=zr(e.current,null),Ke=t,lt=0,Ln=null,fo=!1,ja=tt(e,t),Nu=!1,Na=Fn=Ru=ta=ho=Pt=0,An=Ei=null,Du=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var o=31-mt(r),a=1<<o;t|=e[o],r&=~a}return $r=t,Gi(),n}function Am(e,t){Me=null,E.H=yi,t===Sa||t===os?(t=Vc(),lt=3):t===Bl?(t=Vc(),lt=4):lt=t===bu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ln=t,Ue===null&&(Pt=1,ys(e,Un(t,e.current)))}function Pm(){var e=Dn.current;return e===null?!0:(Ke&4194048)===Ke?sr===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===sr:!1}function Mm(){var e=E.H;return E.H=yi,e===null?yi:e}function Im(){var e=E.A;return E.A=Jg,e}function Ms(){Pt=4,fo||(Ke&4194048)!==Ke&&Dn.current!==null||(ja=!0),(ho&134217727)===0&&(ta&134217727)===0||ft===null||yo(ft,Ke,Fn,!1)}function Ou(e,t,n){var r=at;at|=2;var o=Mm(),a=Im();(ft!==e||Ke!==t)&&(As=null,Da(e,t)),t=!1;var i=Pt;e:do try{if(lt!==0&&Ue!==null){var u=Ue,h=Ln;switch(lt){case 8:$u(),i=6;break e;case 3:case 2:case 9:case 6:Dn.current===null&&(t=!0);var k=lt;if(lt=0,Ln=null,Ta(e,u,h,k),n&&ja){i=0;break e}break;default:k=lt,lt=0,Ln=null,Ta(e,u,h,k)}}t0(),i=Pt;break}catch(j){Am(e,j)}while(!0);return t&&e.shellSuspendCounter++,Pr=Qo=null,at=r,E.H=o,E.A=a,Ue===null&&(ft=null,Ke=0,Gi()),i}function t0(){for(;Ue!==null;)jm(Ue)}function n0(e,t){var n=at;at|=2;var r=Mm(),o=Im();ft!==e||Ke!==t?(As=null,zs=Je()+500,Da(e,t)):ja=tt(e,t);e:do try{if(lt!==0&&Ue!==null){t=Ue;var a=Ln;t:switch(lt){case 1:lt=0,Ln=null,Ta(e,t,a,1);break;case 2:case 9:if(Hc(a)){lt=0,Ln=null,Nm(t);break}t=function(){lt!==2&&lt!==9||ft!==e||(lt=7),wr(e)},a.then(t,t);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:Hc(a)?(lt=0,Ln=null,Nm(t)):(lt=0,Ln=null,Ta(e,t,a,7));break;case 5:var i=null;switch(Ue.tag){case 26:i=Ue.memoizedState;case 5:case 27:var u=Ue;if(i?vf(i):u.stateNode.complete){lt=0,Ln=null;var h=u.sibling;if(h!==null)Ue=h;else{var k=u.return;k!==null?(Ue=k,Is(k)):Ue=null}break t}}lt=0,Ln=null,Ta(e,t,a,5);break;case 6:lt=0,Ln=null,Ta(e,t,a,6);break;case 8:$u(),Pt=6;break e;default:throw Error(c(462))}}r0();break}catch(j){Am(e,j)}while(!0);return Pr=Qo=null,E.H=r,E.A=o,at=n,Ue!==null?0:(ft=null,Ke=0,Gi(),Pt)}function r0(){for(;Ue!==null&&!Ge();)jm(Ue)}function jm(e){var t=nm(e.alternate,e,$r);e.memoizedProps=e.pendingProps,t===null?Is(e):Ue=t}function Nm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Gp(n,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=Gp(n,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:tu(t);default:om(n,t),t=Ue=Ic(t,$r),t=nm(n,t,$r)}e.memoizedProps=e.pendingProps,t===null?Is(e):Ue=t}function Ta(e,t,n,r){Pr=Qo=null,tu(t),Ca=null,di=0;var o=t.return;try{if(Ug(e,o,t,n,Ke)){Pt=1,ys(e,Un(n,e.current)),Ue=null;return}}catch(a){if(o!==null)throw Ue=o,a;Pt=1,ys(e,Un(n,e.current)),Ue=null;return}t.flags&32768?(Ze||r===1?e=!0:ja||(Ke&536870912)!==0?e=!1:(fo=e=!0,(r===2||r===9||r===3||r===6)&&(r=Dn.current,r!==null&&r.tag===13&&(r.flags|=16384))),Rm(t,e)):Is(t)}function Is(e){var t=e;do{if((t.flags&32768)!==0){Rm(t,fo);return}e=t.return;var n=Kg(t.alternate,t,$r);if(n!==null){Ue=n;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);Pt===0&&(Pt=5)}function Rm(e,t){do{var n=Xg(e.alternate,e);if(n!==null){n.flags&=32767,Ue=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ue=e;return}Ue=e=n}while(e!==null);Pt=6,Ue=null}function Dm(e,t,n,r,o,a,i,u,h){e.cancelPendingCommit=null;do js();while(Qt!==0);if((at&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(a=t.lanes|t.childLanes,a|=Al,jo(e,n,a,i,u,h),e===ft&&(Ue=ft=null,Ke=0),Ra=t,bo=e,Or=n,Tu=a,Lu=o,Sm=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,s0(Kt,function(){return Om(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=E.T,E.T=null,o=V.p,V.p=2,i=at,at|=4;try{Gg(e,t,n)}finally{at=i,V.p=o,E.T=r}}Qt=1,Tm(),Lm(),Fm()}}function Tm(){if(Qt===1){Qt=0;var e=bo,t=Ra,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=E.T,E.T=null;var r=V.p;V.p=2;var o=at;at|=4;try{gm(t,e);var a=Ju,i=kc(e.containerInfo),u=a.focusedElem,h=a.selectionRange;if(i!==u&&u&&u.ownerDocument&&wc(u.ownerDocument.documentElement,u)){if(h!==null&&_l(u)){var k=h.start,j=h.end;if(j===void 0&&(j=k),"selectionStart"in u)u.selectionStart=k,u.selectionEnd=Math.min(j,u.value.length);else{var $=u.ownerDocument||document,S=$&&$.defaultView||window;if(S.getSelection){var z=S.getSelection(),de=u.textContent.length,Se=Math.min(h.start,de),pt=h.end===void 0?Se:Math.min(h.end,de);!z.extend&&Se>pt&&(i=pt,pt=Se,Se=i);var b=xc(u,Se),g=xc(u,pt);if(b&&g&&(z.rangeCount!==1||z.anchorNode!==b.node||z.anchorOffset!==b.offset||z.focusNode!==g.node||z.focusOffset!==g.offset)){var w=$.createRange();w.setStart(b.node,b.offset),z.removeAllRanges(),Se>pt?(z.addRange(w),z.extend(g.node,g.offset)):(w.setEnd(g.node,g.offset),z.addRange(w))}}}}for($=[],z=u;z=z.parentNode;)z.nodeType===1&&$.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<$.length;u++){var T=$[u];T.element.scrollLeft=T.left,T.element.scrollTop=T.top}}Vs=!!Zu,Ju=Zu=null}finally{at=o,V.p=r,E.T=n}}e.current=t,Qt=2}}function Lm(){if(Qt===2){Qt=0;var e=bo,t=Ra,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=E.T,E.T=null;var r=V.p;V.p=2;var o=at;at|=4;try{cm(e,t.alternate,t)}finally{at=o,V.p=r,E.T=n}}Qt=3}}function Fm(){if(Qt===4||Qt===3){Qt=0,K();var e=bo,t=Ra,n=Or,r=Sm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Qt=5:(Qt=0,Ra=bo=null,$m(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(go=null),fn(n),t=t.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=E.T,o=V.p,V.p=2,E.T=null;try{for(var a=e.onRecoverableError,i=0;i<r.length;i++){var u=r[i];a(u.value,{componentStack:u.stack})}}finally{E.T=t,V.p=o}}(Or&3)!==0&&js(),wr(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===Fu?zi++:(zi=0,Fu=e):zi=0,Ai(0)}}function $m(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,li(t)))}function js(){return Tm(),Lm(),Fm(),Om()}function Om(){if(Qt!==5)return!1;var e=bo,t=Tu;Tu=0;var n=fn(Or),r=E.T,o=V.p;try{V.p=32>n?32:n,E.T=null,n=Lu,Lu=null;var a=bo,i=Or;if(Qt=0,Ra=bo=null,Or=0,(at&6)!==0)throw Error(c(331));var u=at;if(at|=4,wm(a.current),ym(a,a.current,i,n),at=u,Ai(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(Xt,a)}catch{}return!0}finally{V.p=o,E.T=r,$m(e,t)}}function Wm(e,t,n){t=Un(n,t),t=gu(e.stateNode,t,2),e=uo(e,t,2),e!==null&&(cr(e,2),wr(e))}function ut(e,t,n){if(e.tag===3)Wm(e,e,n);else for(;t!==null;){if(t.tag===3){Wm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(go===null||!go.has(r))){e=Un(n,e),n=Hp(2),r=uo(t,n,2),r!==null&&(Bp(n,r,t,e),cr(r,2),wr(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yg;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(Nu=!0,o.add(n),e=o0.bind(null,e,t,n),t.then(e,e))}function o0(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ft===e&&(Ke&n)===n&&(Pt===4||Pt===3&&(Ke&62914560)===Ke&&300>Je()-Es?(at&2)===0&&Da(e,0):Ru|=n,Na===Ke&&(Na=0)),wr(e)}function Hm(e,t){t===0&&(t=Io()),e=Bo(e,t),e!==null&&(cr(e,t),wr(e))}function a0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Hm(e,n)}function i0(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(c(314))}r!==null&&r.delete(t),Hm(e,n)}function s0(e,t){return X(e,t)}var Ns=null,La=null,Hu=!1,Rs=!1,Bu=!1,vo=0;function wr(e){e!==La&&e.next===null&&(La===null?Ns=La=e:La=La.next=e),Rs=!0,Hu||(Hu=!0,u0())}function Ai(e,t){if(!Bu&&Rs){Bu=!0;do for(var n=!1,r=Ns;r!==null;){if(e!==0){var o=r.pendingLanes;if(o===0)var a=0;else{var i=r.suspendedLanes,u=r.pingedLanes;a=(1<<31-mt(42|e)+1)-1,a&=o&~(i&~u),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Qm(r,a))}else a=Ke,a=ve(r,r===ft?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(a&3)===0||tt(r,a)||(n=!0,Qm(r,a));r=r.next}while(n);Bu=!1}}function l0(){Bm()}function Bm(){Rs=Hu=!1;var e=0;vo!==0&&v0()&&(e=vo);for(var t=Je(),n=null,r=Ns;r!==null;){var o=r.next,a=Vm(r,t);a===0?(r.next=null,n===null?Ns=o:n.next=o,o===null&&(La=n)):(n=r,(e!==0||(a&3)!==0)&&(Rs=!0)),r=o}Qt!==0&&Qt!==5||Ai(e),vo!==0&&(vo=0)}function Vm(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var i=31-mt(a),u=1<<i,h=o[i];h===-1?((u&n)===0||(u&r)!==0)&&(o[i]=Jt(u,t)):h<=t&&(e.expiredLanes|=u),a&=~u}if(t=ft,n=Ke,n=ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(lt===2||lt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ve(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||tt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ve(r),fn(n)){case 2:case 8:n=it;break;case 32:n=Kt;break;case 268435456:n=Mo;break;default:n=Kt}return r=Um.bind(null,e),n=X(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ve(r),e.callbackPriority=2,e.callbackNode=null,2}function Um(e,t){if(Qt!==0&&Qt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(js()&&e.callbackNode!==n)return null;var r=Ke;return r=ve(e,e===ft?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Em(e,r,t),Vm(e,Je()),e.callbackNode!=null&&e.callbackNode===n?Um.bind(null,e):null)}function Qm(e,t){if(js())return null;Em(e,t,!0)}function u0(){w0(function(){(at&6)!==0?X(un,l0):Bm()})}function Vu(){if(vo===0){var e=ka;e===0&&(e=pn,pn<<=1,(pn&261888)===0&&(pn=256)),vo=e}return vo}function qm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:br(""+e)}function Km(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function d0(e,t,n,r,o){if(t==="submit"&&n&&n.stateNode===o){var a=qm((o[Ht]||null).action),i=r.submitter;i&&(t=(t=i[Ht]||null)?qm(t.formAction):i.getAttribute("formAction"),t!==null&&(a=t,i=null));var u=new Lo("action","action",null,r,o);e.push({event:u,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(vo!==0){var h=i?Km(o,i):new FormData(o);du(n,{pending:!0,data:h,method:o.method,action:a},null,h)}}else typeof a=="function"&&(u.preventDefault(),h=i?Km(o,i):new FormData(o),du(n,{pending:!0,data:h,method:o.method,action:a},a,h))},currentTarget:o}]})}}for(var Uu=0;Uu<zl.length;Uu++){var Qu=zl[Uu],c0=Qu.toLowerCase(),p0=Qu[0].toUpperCase()+Qu.slice(1);ir(c0,"on"+p0)}ir(Cc,"onAnimationEnd"),ir(Ec,"onAnimationIteration"),ir(zc,"onAnimationStart"),ir("dblclick","onDoubleClick"),ir("focusin","onFocus"),ir("focusout","onBlur"),ir(Ag,"onTransitionRun"),ir(Pg,"onTransitionStart"),ir(Mg,"onTransitionCancel"),ir(Ac,"onTransitionEnd"),_r("onMouseEnter",["mouseout","mouseover"]),_r("onMouseLeave",["mouseout","mouseover"]),_r("onPointerEnter",["pointerout","pointerover"]),_r("onPointerLeave",["pointerout","pointerover"]),fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fr("onBeforeInput",["compositionend","keypress","textInput","paste"]),fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pi="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(" "),m0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pi));function Xm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var u=r[i],h=u.instance,k=u.currentTarget;if(u=u.listener,h!==a&&o.isPropagationStopped())break e;a=u,o.currentTarget=k;try{a(o)}catch(j){Xi(j)}o.currentTarget=null,a=h}else for(i=0;i<r.length;i++){if(u=r[i],h=u.instance,k=u.currentTarget,u=u.listener,h!==a&&o.isPropagationStopped())break e;a=u,o.currentTarget=k;try{a(o)}catch(j){Xi(j)}o.currentTarget=null,a=h}}}}function Qe(e,t){var n=t[oa];n===void 0&&(n=t[oa]=new Set);var r=e+"__bubble";n.has(r)||(Gm(t,e,2,!1),n.add(r))}function qu(e,t,n){var r=0;t&&(r|=4),Gm(n,e,r,t)}var Ds="_reactListening"+Math.random().toString(36).slice(2);function Ku(e){if(!e[Ds]){e[Ds]=!0,Yt.forEach(function(n){n!=="selectionchange"&&(m0.has(n)||qu(n,!1,e),qu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ds]||(t[Ds]=!0,qu("selectionchange",!1,t))}}function Gm(e,t,n,r){switch(Ef(t)){case 2:var o=W0;break;case 8:o=H0;break;default:o=ud}n=o.bind(null,t,n,e),o=void 0,!wt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Xu(e,t,n,r,o){var a=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var u=r.stateNode.containerInfo;if(u===o)break;if(i===4)for(i=r.return;i!==null;){var h=i.tag;if((h===3||h===4)&&i.stateNode.containerInfo===o)return;i=i.return}for(;u!==null;){if(i=mr(u),i===null)return;if(h=i.tag,h===5||h===6||h===26||h===27){r=a=i;continue e}u=u.parentNode}}r=r.return}pa(function(){var k=a,j=et(n),$=[];e:{var S=Pc.get(e);if(S!==void 0){var z=Lo,de=e;switch(e){case"keypress":if(Wn(n)===0)break e;case"keydown":case"keyup":z=R;break;case"focusin":de="focus",z=ma;break;case"focusout":de="blur",z=ma;break;case"beforeblur":case"afterblur":z=ma;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":z=Ya;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=ml;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=Ye;break;case Cc:case Ec:case zc:z=gl;break;case Ac:z=Lt;break;case"scroll":case"scrollend":z=no;break;case"wheel":z=We;break;case"copy":case"cut":case"paste":z=Ui;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=Z;break;case"toggle":case"beforetoggle":z=Gt}var Se=(t&4)!==0,pt=!Se&&(e==="scroll"||e==="scrollend"),b=Se?S!==null?S+"Capture":null:S;Se=[];for(var g=k,w;g!==null;){var T=g;if(w=T.stateNode,T=T.tag,T!==5&&T!==26&&T!==27||w===null||b===null||(T=ar(g,b),T!=null&&Se.push(Mi(g,T,w))),pt)break;g=g.return}0<Se.length&&(S=new z(S,de,null,n,j),$.push({event:S,listeners:Se}))}}if((t&7)===0){e:{if(S=e==="mouseover"||e==="pointerover",z=e==="mouseout"||e==="pointerout",S&&n!==da&&(de=n.relatedTarget||n.fromElement)&&(mr(de)||de[pr]))break e;if((z||S)&&(S=j.window===j?j:(S=j.ownerDocument)?S.defaultView||S.parentWindow:window,z?(de=n.relatedTarget||n.toElement,z=k,de=de?mr(de):null,de!==null&&(pt=I(de),Se=de.tag,de!==pt||Se!==5&&Se!==27&&Se!==6)&&(de=null)):(z=null,de=k),z!==de)){if(Se=Ya,T="onMouseLeave",b="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Z,T="onPointerLeave",b="onPointerEnter",g="pointer"),pt=z==null?S:cn(z),w=de==null?S:cn(de),S=new Se(T,g+"leave",z,n,j),S.target=pt,S.relatedTarget=w,T=null,mr(j)===k&&(Se=new Se(b,g+"enter",de,n,j),Se.target=w,Se.relatedTarget=pt,T=Se),pt=T,z&&de)t:{for(Se=f0,b=z,g=de,w=0,T=b;T;T=Se(T))w++;T=0;for(var we=g;we;we=Se(we))T++;for(;0<w-T;)b=Se(b),w--;for(;0<T-w;)g=Se(g),T--;for(;w--;){if(b===g||g!==null&&b===g.alternate){Se=b;break t}b=Se(b),g=Se(g)}Se=null}else Se=null;z!==null&&Zm($,S,z,Se,!1),de!==null&&pt!==null&&Zm($,pt,de,Se,!0)}}e:{if(S=k?cn(k):window,z=S.nodeName&&S.nodeName.toLowerCase(),z==="select"||z==="input"&&S.type==="file")var nt=fc;else if(pc(S))if(hc)nt=Cg;else{nt=_g;var he=kg}else z=S.nodeName,!z||z.toLowerCase()!=="input"||S.type!=="checkbox"&&S.type!=="radio"?k&&Zr(k.elementType)&&(nt=fc):nt=Sg;if(nt&&(nt=nt(e,k))){mc($,nt,n,j);break e}he&&he(e,S,k),e==="focusout"&&k&&S.type==="number"&&k.memoizedProps.value!=null&&ua(S,"number",S.value)}switch(he=k?cn(k):window,e){case"focusin":(pc(he)||he.contentEditable==="true")&&(fa=he,Sl=k,ai=null);break;case"focusout":ai=Sl=fa=null;break;case"mousedown":Cl=!0;break;case"contextmenu":case"mouseup":case"dragend":Cl=!1,_c($,n,j);break;case"selectionchange":if(zg)break;case"keydown":case"keyup":_c($,n,j)}var Ne;if(Ut)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else St?st(e,n)&&(Xe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Xe="onCompositionStart");Xe&&(Ce&&n.locale!=="ko"&&(St||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&St&&(Ne=Tt()):(It=j,Ja="value"in It?It.value:It.textContent,St=!0)),he=Ts(k,Xe),0<he.length&&(Xe=new Qi(Xe,e,null,n,j),$.push({event:Xe,listeners:he}),Ne?Xe.data=Ne:(Ne=Sn(n),Ne!==null&&(Xe.data=Ne)))),(Ne=Bn?nn(e,n):gt(e,n))&&(Xe=Ts(k,"onBeforeInput"),0<Xe.length&&(he=new Qi("onBeforeInput","beforeinput",null,n,j),$.push({event:he,listeners:Xe}),he.data=Ne)),d0($,e,k,n,j)}Xm($,t)})}function Mi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ts(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,a=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||a===null||(o=ar(e,n),o!=null&&r.unshift(Mi(e,o,a)),o=ar(e,t),o!=null&&r.push(Mi(e,o,a))),e.tag===3)return r;e=e.return}return[]}function f0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zm(e,t,n,r,o){for(var a=t._reactName,i=[];n!==null&&n!==r;){var u=n,h=u.alternate,k=u.stateNode;if(u=u.tag,h!==null&&h===r)break;u!==5&&u!==26&&u!==27||k===null||(h=k,o?(k=ar(n,a),k!=null&&i.unshift(Mi(n,k,h))):o||(k=ar(n,a),k!=null&&i.push(Mi(n,k,h)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var h0=/\r\n?/g,g0=/\u0000|\uFFFD/g;function Jm(e){return(typeof e=="string"?e:""+e).replace(h0,`
41
- `).replace(g0,"")}function Ym(e,t){return t=Jm(t),Jm(e)===t}function ct(e,t,n,r,o,a){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||gr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&gr(e,""+r);break;case"className":tr(e,"class",r);break;case"tabIndex":tr(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":tr(e,n,r);break;case"style":Do(e,r,a);break;case"data":if(t!=="object"){tr(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=br(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(t!=="input"&&ct(e,t,"name",o.name,o,null),ct(e,t,"formEncType",o.formEncType,o,null),ct(e,t,"formMethod",o.formMethod,o,null),ct(e,t,"formTarget",o.formTarget,o,null)):(ct(e,t,"encType",o.encType,o,null),ct(e,t,"method",o.method,o,null),ct(e,t,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=br(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=kn);break;case"onScroll":r!=null&&Qe("scroll",e);break;case"onScrollEnd":r!=null&&Qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(c(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=br(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Qe("beforetoggle",e),Qe("toggle",e),xn(e,"popover",r);break;case"xlinkActuate":nr(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":nr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":nr(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":nr(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":nr(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":nr(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":nr(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":nr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":nr(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":xn(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Bt.get(n)||n,xn(e,n,r))}}function Gu(e,t,n,r,o,a){switch(n){case"style":Do(e,r,a);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(c(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof r=="string"?gr(e,r):(typeof r=="number"||typeof r=="bigint")&&gr(e,""+r);break;case"onScroll":r!=null&&Qe("scroll",e);break;case"onScrollEnd":r!=null&&Qe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sa.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),a=e[Ht]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,o),typeof r=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,o);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):xn(e,n,r)}}}function sn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",e),Qe("load",e);var r=!1,o=!1,a;for(a in n)if(n.hasOwnProperty(a)){var i=n[a];if(i!=null)switch(a){case"src":r=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:ct(e,t,a,i,n,null)}}o&&ct(e,t,"srcSet",n.srcSet,n,null),r&&ct(e,t,"src",n.src,n,null);return;case"input":Qe("invalid",e);var u=a=i=o=null,h=null,k=null;for(r in n)if(n.hasOwnProperty(r)){var j=n[r];if(j!=null)switch(r){case"name":o=j;break;case"type":i=j;break;case"checked":h=j;break;case"defaultChecked":k=j;break;case"value":a=j;break;case"defaultValue":u=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(c(137,t));break;default:ct(e,t,r,j,n,null)}}rr(e,a,u,h,k,i,o,!1);return;case"select":Qe("invalid",e),r=i=a=null;for(o in n)if(n.hasOwnProperty(o)&&(u=n[o],u!=null))switch(o){case"value":a=u;break;case"defaultValue":i=u;break;case"multiple":r=u;default:ct(e,t,o,u,n,null)}t=a,n=i,e.multiple=!!r,t!=null?Gr(e,!!r,t,!1):n!=null&&Gr(e,!!r,n,!0);return;case"textarea":Qe("invalid",e),a=o=r=null;for(i in n)if(n.hasOwnProperty(i)&&(u=n[i],u!=null))switch(i){case"value":r=u;break;case"defaultValue":o=u;break;case"children":a=u;break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:ct(e,t,i,u,n,null)}Za(e,r,o,a);return;case"option":for(h in n)if(n.hasOwnProperty(h)&&(r=n[h],r!=null))switch(h){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:ct(e,t,h,r,n,null)}return;case"dialog":Qe("beforetoggle",e),Qe("toggle",e),Qe("cancel",e),Qe("close",e);break;case"iframe":case"object":Qe("load",e);break;case"video":case"audio":for(r=0;r<Pi.length;r++)Qe(Pi[r],e);break;case"image":Qe("error",e),Qe("load",e);break;case"details":Qe("toggle",e);break;case"embed":case"source":case"link":Qe("error",e),Qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(k in n)if(n.hasOwnProperty(k)&&(r=n[k],r!=null))switch(k){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:ct(e,t,k,r,n,null)}return;default:if(Zr(t)){for(j in n)n.hasOwnProperty(j)&&(r=n[j],r!==void 0&&Gu(e,t,j,r,n,void 0));return}}for(u in n)n.hasOwnProperty(u)&&(r=n[u],r!=null&&ct(e,t,u,r,n,null))}function b0(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,a=null,i=null,u=null,h=null,k=null,j=null;for(z in n){var $=n[z];if(n.hasOwnProperty(z)&&$!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":h=$;default:r.hasOwnProperty(z)||ct(e,t,z,null,r,$)}}for(var S in r){var z=r[S];if($=n[S],r.hasOwnProperty(S)&&(z!=null||$!=null))switch(S){case"type":a=z;break;case"name":o=z;break;case"checked":k=z;break;case"defaultChecked":j=z;break;case"value":i=z;break;case"defaultValue":u=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(c(137,t));break;default:z!==$&&ct(e,t,S,z,r,$)}}la(e,i,u,h,k,j,a,o);return;case"select":z=i=u=S=null;for(a in n)if(h=n[a],n.hasOwnProperty(a)&&h!=null)switch(a){case"value":break;case"multiple":z=h;default:r.hasOwnProperty(a)||ct(e,t,a,null,r,h)}for(o in r)if(a=r[o],h=n[o],r.hasOwnProperty(o)&&(a!=null||h!=null))switch(o){case"value":S=a;break;case"defaultValue":u=a;break;case"multiple":i=a;default:a!==h&&ct(e,t,o,a,r,h)}t=u,n=i,r=z,S!=null?Gr(e,!!n,S,!1):!!r!=!!n&&(t!=null?Gr(e,!!n,t,!0):Gr(e,!!n,n?[]:"",!1));return;case"textarea":z=S=null;for(u in n)if(o=n[u],n.hasOwnProperty(u)&&o!=null&&!r.hasOwnProperty(u))switch(u){case"value":break;case"children":break;default:ct(e,t,u,null,r,o)}for(i in r)if(o=r[i],a=n[i],r.hasOwnProperty(i)&&(o!=null||a!=null))switch(i){case"value":S=o;break;case"defaultValue":z=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(c(91));break;default:o!==a&&ct(e,t,i,o,r,a)}Hi(e,S,z);return;case"option":for(var de in n)if(S=n[de],n.hasOwnProperty(de)&&S!=null&&!r.hasOwnProperty(de))switch(de){case"selected":e.selected=!1;break;default:ct(e,t,de,null,r,S)}for(h in r)if(S=r[h],z=n[h],r.hasOwnProperty(h)&&S!==z&&(S!=null||z!=null))switch(h){case"selected":e.selected=S&&typeof S!="function"&&typeof S!="symbol";break;default:ct(e,t,h,S,r,z)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Se in n)S=n[Se],n.hasOwnProperty(Se)&&S!=null&&!r.hasOwnProperty(Se)&&ct(e,t,Se,null,r,S);for(k in r)if(S=r[k],z=n[k],r.hasOwnProperty(k)&&S!==z&&(S!=null||z!=null))switch(k){case"children":case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(137,t));break;default:ct(e,t,k,S,r,z)}return;default:if(Zr(t)){for(var pt in n)S=n[pt],n.hasOwnProperty(pt)&&S!==void 0&&!r.hasOwnProperty(pt)&&Gu(e,t,pt,void 0,r,S);for(j in r)S=r[j],z=n[j],!r.hasOwnProperty(j)||S===z||S===void 0&&z===void 0||Gu(e,t,j,S,r,z);return}}for(var b in n)S=n[b],n.hasOwnProperty(b)&&S!=null&&!r.hasOwnProperty(b)&&ct(e,t,b,null,r,S);for($ in r)S=r[$],z=n[$],!r.hasOwnProperty($)||S===z||S==null&&z==null||ct(e,t,$,S,r,z)}function ef(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function y0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var o=n[r],a=o.transferSize,i=o.initiatorType,u=o.duration;if(a&&u&&ef(i)){for(i=0,u=o.responseEnd,r+=1;r<n.length;r++){var h=n[r],k=h.startTime;if(k>u)break;var j=h.transferSize,$=h.initiatorType;j&&ef($)&&(h=h.responseEnd,i+=j*(h<u?1:(u-k)/(h-k)))}if(--r,t+=8*(a+i)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Zu=null,Ju=null;function Ls(e){return e.nodeType===9?e:e.ownerDocument}function tf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nf(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Yu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ed=null;function v0(){var e=window.event;return e&&e.type==="popstate"?e===ed?!1:(ed=e,!0):(ed=null,!1)}var rf=typeof setTimeout=="function"?setTimeout:void 0,x0=typeof clearTimeout=="function"?clearTimeout:void 0,of=typeof Promise=="function"?Promise:void 0,w0=typeof queueMicrotask=="function"?queueMicrotask:typeof of<"u"?function(e){return of.resolve(null).then(e).catch(k0)}:rf;function k0(e){setTimeout(function(){throw e})}function xo(e){return e==="head"}function af(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(o),Wa(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Ii(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ii(n);for(var a=n.firstChild;a;){var i=a.nextSibling,u=a.nodeName;a[kr]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=i}}else n==="body"&&Ii(e.ownerDocument.body);n=o}while(n);Wa(t)}function sf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function td(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":td(n),qa(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function _0(e,t,n,r){for(;e.nodeType===1;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[kr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence")||a!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=Xn(e.nextSibling),e===null)break}return null}function S0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Xn(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Xn(e.nextSibling),e===null))return null;return e}function nd(e){return e.data==="$?"||e.data==="$~"}function rd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function C0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Xn(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var od=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Xn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function cf(e,t,n){switch(t=Ls(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Ii(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);qa(e)}var Gn=new Map,pf=new Set;function Fs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Wr=V.d;V.d={f:E0,r:z0,D:A0,C:P0,L:M0,m:I0,X:N0,S:j0,M:R0};function E0(){var e=Wr.f(),t=Ps();return e||t}function z0(e){var t=Kr(e);t!==null&&t.tag===5&&t.type==="form"?Ap(t):Wr.r(e)}var Fa=typeof document>"u"?null:document;function mf(e,t,n){var r=Fa;if(r&&typeof t=="string"&&t){var o=en(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),pf.has(o)||(pf.add(o),e={rel:e,crossOrigin:n,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),sn(t,"link",e),Dt(t),r.head.appendChild(t)))}}function A0(e){Wr.D(e),mf("dns-prefetch",e,null)}function P0(e,t){Wr.C(e,t),mf("preconnect",e,t)}function M0(e,t,n){Wr.L(e,t,n);var r=Fa;if(r&&e&&t){var o='link[rel="preload"][as="'+en(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+en(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+en(n.imageSizes)+'"]')):o+='[href="'+en(e)+'"]';var a=o;switch(t){case"style":a=$a(e);break;case"script":a=Oa(e)}Gn.has(a)||(e=C({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Gn.set(a,e),r.querySelector(o)!==null||t==="style"&&r.querySelector(ji(a))||t==="script"&&r.querySelector(Ni(a))||(t=r.createElement("link"),sn(t,"link",e),Dt(t),r.head.appendChild(t)))}}function I0(e,t){Wr.m(e,t);var n=Fa;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+en(r)+'"][href="'+en(e)+'"]',a=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Oa(e)}if(!Gn.has(a)&&(e=C({rel:"modulepreload",href:e},t),Gn.set(a,e),n.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ni(a)))return}r=n.createElement("link"),sn(r,"link",e),Dt(r),n.head.appendChild(r)}}}function j0(e,t,n){Wr.S(e,t,n);var r=Fa;if(r&&e){var o=Mt(r).hoistableStyles,a=$a(e);t=t||"default";var i=o.get(a);if(!i){var u={loading:0,preload:null};if(i=r.querySelector(ji(a)))u.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Gn.get(a))&&ad(e,n);var h=i=r.createElement("link");Dt(h),sn(h,"link",e),h._p=new Promise(function(k,j){h.onload=k,h.onerror=j}),h.addEventListener("load",function(){u.loading|=1}),h.addEventListener("error",function(){u.loading|=2}),u.loading|=4,$s(i,t,r)}i={type:"stylesheet",instance:i,count:1,state:u},o.set(a,i)}}}function N0(e,t){Wr.X(e,t);var n=Fa;if(n&&e){var r=Mt(n).hoistableScripts,o=Oa(e),a=r.get(o);a||(a=n.querySelector(Ni(o)),a||(e=C({src:e,async:!0},t),(t=Gn.get(o))&&id(e,t),a=n.createElement("script"),Dt(a),sn(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function R0(e,t){Wr.M(e,t);var n=Fa;if(n&&e){var r=Mt(n).hoistableScripts,o=Oa(e),a=r.get(o);a||(a=n.querySelector(Ni(o)),a||(e=C({src:e,async:!0,type:"module"},t),(t=Gn.get(o))&&id(e,t),a=n.createElement("script"),Dt(a),sn(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function ff(e,t,n,r){var o=(o=ye.current)?Fs(o):null;if(!o)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=$a(n.href),n=Mt(o).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=$a(n.href);var a=Mt(o).hoistableStyles,i=a.get(e);if(i||(o=o.ownerDocument||o,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,i),(a=o.querySelector(ji(e)))&&!a._p&&(i.instance=a,i.state.loading=5),Gn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Gn.set(e,n),a||D0(o,e,n,i.state))),t&&r===null)throw Error(c(528,""));return i}if(t&&r!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Oa(n),n=Mt(o).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function $a(e){return'href="'+en(e)+'"'}function ji(e){return'link[rel="stylesheet"]['+e+"]"}function hf(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function D0(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),sn(t,"link",n),Dt(t),e.head.appendChild(t))}function Oa(e){return'[src="'+en(e)+'"]'}function Ni(e){return"script[async]"+e}function gf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+en(n.href)+'"]');if(r)return t.instance=r,Dt(r),r;var o=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Dt(r),sn(r,"style",o),$s(r,n.precedence,e),t.instance=r;case"stylesheet":o=$a(n.href);var a=e.querySelector(ji(o));if(a)return t.state.loading|=4,t.instance=a,Dt(a),a;r=hf(n),(o=Gn.get(o))&&ad(r,o),a=(e.ownerDocument||e).createElement("link"),Dt(a);var i=a;return i._p=new Promise(function(u,h){i.onload=u,i.onerror=h}),sn(a,"link",r),t.state.loading|=4,$s(a,n.precedence,e),t.instance=a;case"script":return a=Oa(n.src),(o=e.querySelector(Ni(a)))?(t.instance=o,Dt(o),o):(r=n,(o=Gn.get(a))&&(r=C({},n),id(r,o)),e=e.ownerDocument||e,o=e.createElement("script"),Dt(o),sn(o,"link",r),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,$s(r,n.precedence,e));return t.instance}function $s(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,a=o,i=0;i<r.length;i++){var u=r[i];if(u.dataset.precedence===t)a=u;else if(a!==o)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ad(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function id(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Os=null;function bf(e,t,n){if(Os===null){var r=new Map,o=Os=new Map;o.set(n,r)}else o=Os,r=o.get(n),r||(r=new Map,o.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var a=n[o];if(!(a[kr]||a[Ct]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var i=a.getAttribute(t)||"";i=e+i;var u=r.get(i);u?u.push(a):r.set(i,[a])}}return r}function yf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function T0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function vf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function L0(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=$a(r.href),a=t.querySelector(ji(o));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ws.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Dt(a);return}a=t.ownerDocument||t,r=hf(r),(o=Gn.get(o))&&ad(r,o),a=a.createElement("link"),Dt(a);var i=a;i._p=new Promise(function(u,h){i.onload=u,i.onerror=h}),sn(a,"link",r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ws.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var sd=0;function F0(e,t){return e.stylesheets&&e.count===0&&Bs(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&sd===0&&(sd=62500*y0());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>sd?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function Ws(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hs=null;function Bs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hs=new Map,t.forEach($0,e),Hs=null,Ws.call(e))}function $0(e,t){if(!(t.state.loading&4)){var n=Hs.get(e);if(n)var r=n.get(null);else{n=new Map,Hs.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<o.length;a++){var i=o[a];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),r=i)}r&&n.set(null,r)}o=t.instance,i=o.getAttribute("data-precedence"),a=n.get(i)||r,a===r&&n.set(null,o),n.set(i,o),this.count++,r=Ws.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),a?a.parentNode.insertBefore(o,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var Ri={$$typeof:re,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function O0(e,t,n,r,o,a,i,u,h){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Yn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yn(0),this.hiddenUpdates=Yn(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=a,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=h,this.incompleteTransitions=new Map}function xf(e,t,n,r,o,a,i,u,h,k,j,$){return e=new O0(e,t,n,i,h,k,j,$,u),t=1,a===!0&&(t|=24),a=Rn(3,null,null,t),e.current=a,a.stateNode=e,t=Ol(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Vl(a),e}function wf(e){return e?(e=ba,e):ba}function kf(e,t,n,r,o,a){o=wf(o),r.context===null?r.context=o:r.pendingContext=o,r=lo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=uo(e,r,t),n!==null&&(Pn(n,e,t),pi(n,e,t))}function _f(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ld(e,t){_f(e,t),(e=e.alternate)&&_f(e,t)}function Sf(e){if(e.tag===13||e.tag===31){var t=Bo(e,67108864);t!==null&&Pn(t,e,67108864),ld(e,67108864)}}function Cf(e){if(e.tag===13||e.tag===31){var t=$n();t=er(t);var n=Bo(e,t);n!==null&&Pn(n,e,t),ld(e,t)}}var Vs=!0;function W0(e,t,n,r){var o=E.T;E.T=null;var a=V.p;try{V.p=2,ud(e,t,n,r)}finally{V.p=a,E.T=o}}function H0(e,t,n,r){var o=E.T;E.T=null;var a=V.p;try{V.p=8,ud(e,t,n,r)}finally{V.p=a,E.T=o}}function ud(e,t,n,r){if(Vs){var o=dd(r);if(o===null)Xu(e,t,r,Us,n),zf(e,r);else if(V0(o,e,t,n,r))r.stopPropagation();else if(zf(e,r),t&4&&-1<B0.indexOf(e)){for(;o!==null;){var a=Kr(o);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var i=vn(a.pendingLanes);if(i!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;i;){var h=1<<31-mt(i);u.entanglements[1]|=h,i&=~h}wr(a),(at&6)===0&&(zs=Je()+500,Ai(0))}}break;case 31:case 13:u=Bo(a,2),u!==null&&Pn(u,a,2),Ps(),ld(a,2)}if(a=dd(r),a===null&&Xu(e,t,r,Us,n),a===o)break;o=a}o!==null&&r.stopPropagation()}else Xu(e,t,r,null,n)}}function dd(e){return e=et(e),cd(e)}var Us=null;function cd(e){if(Us=null,e=mr(e),e!==null){var t=I(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=D(t),e!==null)return e;e=null}else if(n===31){if(e=q(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 Us=e,null}function Ef(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Fe()){case un:return 2;case it:return 8;case Kt:case Mn:return 32;case Mo:return 268435456;default:return 32}default:return 32}}var pd=!1,wo=null,ko=null,_o=null,Di=new Map,Ti=new Map,So=[],B0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function zf(e,t){switch(e){case"focusin":case"focusout":wo=null;break;case"dragenter":case"dragleave":ko=null;break;case"mouseover":case"mouseout":_o=null;break;case"pointerover":case"pointerout":Di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ti.delete(t.pointerId)}}function Li(e,t,n,r,o,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[o]},t!==null&&(t=Kr(t),t!==null&&Sf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function V0(e,t,n,r,o){switch(t){case"focusin":return wo=Li(wo,e,t,n,r,o),!0;case"dragenter":return ko=Li(ko,e,t,n,r,o),!0;case"mouseover":return _o=Li(_o,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return Di.set(a,Li(Di.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,Ti.set(a,Li(Ti.get(a)||null,e,t,n,r,o)),!0}return!1}function Af(e){var t=mr(e.target);if(t!==null){var n=I(t);if(n!==null){if(t=n.tag,t===13){if(t=D(n),t!==null){e.blockedOn=t,qr(e.priority,function(){Cf(n)});return}}else if(t===31){if(t=q(n),t!==null){e.blockedOn=t,qr(e.priority,function(){Cf(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 Qs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dd(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);da=r,n.target.dispatchEvent(r),da=null}else return t=Kr(n),t!==null&&Sf(t),e.blockedOn=n,!1;t.shift()}return!0}function Pf(e,t,n){Qs(e)&&n.delete(t)}function U0(){pd=!1,wo!==null&&Qs(wo)&&(wo=null),ko!==null&&Qs(ko)&&(ko=null),_o!==null&&Qs(_o)&&(_o=null),Di.forEach(Pf),Ti.forEach(Pf)}function qs(e,t){e.blockedOn===t&&(e.blockedOn=null,pd||(pd=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,U0)))}var Ks=null;function Mf(e){Ks!==e&&(Ks=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Ks===e&&(Ks=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],o=e[t+2];if(typeof r!="function"){if(cd(r||n)===null)continue;break}var a=Kr(n);a!==null&&(e.splice(t,3),t-=3,du(a,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Wa(e){function t(h){return qs(h,e)}wo!==null&&qs(wo,e),ko!==null&&qs(ko,e),_o!==null&&qs(_o,e),Di.forEach(t),Ti.forEach(t);for(var n=0;n<So.length;n++){var r=So[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<So.length&&(n=So[0],n.blockedOn===null);)Af(n),n.blockedOn===null&&So.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var o=n[r],a=n[r+1],i=o[Ht]||null;if(typeof a=="function")i||Mf(n);else if(i){var u=null;if(a&&a.hasAttribute("formAction")){if(o=a,i=a[Ht]||null)u=i.formAction;else if(cd(o)!==null)continue}else u=i.action;typeof u=="function"?n[r+1]=u:(n.splice(r,3),r-=3),Mf(n)}}}function If(){function e(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(i){return o=i})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function md(e){this._internalRoot=e}Xs.prototype.render=md.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,r=$n();kf(n,r,e,t,null,null)},Xs.prototype.unmount=md.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;kf(e.current,2,null,e,null,null),Ps(),t[pr]=null}};function Xs(e){this._internalRoot=e}Xs.prototype.unstable_scheduleHydration=function(e){if(e){var t=ra();e={blockedOn:null,target:e,priority:t};for(var n=0;n<So.length&&t!==0&&t<So[n].priority;n++);So.splice(n,0,e),n===0&&Af(e)}};var jf=l.version;if(jf!=="19.2.1")throw Error(c(527,jf,"19.2.1"));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=y(t),e=e!==null?B(e):null,e=e===null?null:e.stateNode,e};var Q0={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gs.isDisabled&&Gs.supportsFiber)try{Xt=Gs.inject(Q0),Rt=Gs}catch{}}return Ha.createRoot=function(e,t){if(!v(e))throw Error(c(299));var n=!1,r="",o=Fp,a=$p,i=Op;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=xf(e,1,!1,null,null,n,r,null,o,a,i,If),e[pr]=t.current,Ku(e),new md(t)},Ha.hydrateRoot=function(e,t,n){if(!v(e))throw Error(c(299));var r=!1,o="",a=Fp,i=$p,u=Op,h=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(u=n.onRecoverableError),n.formState!==void 0&&(h=n.formState)),t=xf(e,1,!0,t,n??null,r,o,h,a,i,u,If),t.context=wf(null),n=t.current,r=$n(),r=er(r),o=lo(r),o.callback=null,uo(n,o,r),n=r,t.current.lanes=n,cr(t,n),wr(t),e[pr]=t.current,Ku(e),new Xs(t)},Ha.version="19.2.1",Ha}var Cd;function Ff(){if(Cd)return Js.exports;Cd=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),Js.exports=Lf(),Js.exports}var $f=Ff();const Ed=dr($f);var zd={exports:{}},Ba={};/**
40
+ `+r.stack}}var Oe=Object.prototype.hasOwnProperty,X=s.unstable_scheduleCallback,Ve=s.unstable_cancelCallback,Ge=s.unstable_shouldYield,K=s.unstable_requestPaint,Je=s.unstable_now,Fe=s.unstable_getCurrentPriorityLevel,un=s.unstable_ImmediatePriority,it=s.unstable_UserBlockingPriority,Kt=s.unstable_NormalPriority,Mn=s.unstable_LowPriority,Io=s.unstable_IdlePriority,vn=s.log,Vr=s.unstable_setDisableYieldValue,Xt=null,Dt=null;function ot(e){if(typeof vn=="function"&&Vr(e),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(Xt,e)}catch{}}var mt=Math.clz32?Math.clz32:Ur,qe=Math.log,dn=Math.LN2;function Ur(e){return e>>>=0,e===0?32:31-(qe(e)/dn|0)|0}var mn=256,me=262144,fn=4194304;function xn(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ve(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var o=0,a=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var u=r&134217727;return u!==0?(r=u&~a,r!==0?o=xn(r):(i&=u,i!==0?o=xn(i):n||(n=u&~e,n!==0&&(o=xn(n))))):(u=r&~a,u!==0?o=xn(u):i!==0?o=xn(i):n||(n=r&~e,n!==0&&(o=xn(n)))),o===0?0:t!==0&&t!==o&&(t&a)===0&&(a=o&-o,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:o}function tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Jt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Mo(){var e=fn;return fn<<=1,(fn&62914560)===0&&(fn=4194304),e}function Yn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function cr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function jo(e,t,n,r,o,a){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var u=e.entanglements,h=e.expirationTimes,k=e.hiddenUpdates;for(n=i&~n;0<n;){var j=31-mt(n),$=1<<j;u[j]=0,h[j]=-1;var S=k[j];if(S!==null)for(k[j]=null,j=0;j<S.length;j++){var z=S[j];z!==null&&(z.lane&=-536870913)}n&=~$}r!==0&&Qr(e,r,0),a!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=a&~(i&~t))}function Qr(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-mt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $i(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-mt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}function Ro(e,t){var n=t&-t;return n=(n&42)!==0?1:er(n),(n&(e.suspendedLanes|t))!==0?0:n}function er(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function hn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ra(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:Ef(e.type))}function qr(e,t){var n=V.p;try{return V.p=e,t()}finally{V.p=n}}var jn=Math.random().toString(36).slice(2),Ct="__reactFiber$"+jn,Ht="__reactProps$"+jn,pr="__reactContainer$"+jn,oa="__reactEvents$"+jn,Oi="__reactListeners$"+jn,aa="__reactHandles$"+jn,ia="__reactResources$"+jn,kr="__reactMarker$"+jn;function qa(e){delete e[Ct],delete e[Ht],delete e[oa],delete e[Oi],delete e[aa]}function mr(e){var t=e[Ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pr]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[Ct])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function Kr(e){if(e=e[Ct]||e[pr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function cn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function It(e){var t=e[ia];return t||(t=e[ia]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Nt(e){e[kr]=!0}var Yt=new Set,sa={};function fr(e,t){_r(e,t),_r(e+"Capture",t)}function _r(e,t){for(sa[e]=t,e=0;e<t.length;e++)Yt.add(t[e])}var Xr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Do={},Wi={};function Ka(e){return Oe.call(Wi,e)?!0:Oe.call(Do,e)?!1:Xr.test(e)?Wi[e]=!0:(Do[e]=!0,!1)}function wn(e,t,n){if(Ka(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function tr(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function nr(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function gn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){n=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sr(e){if(!e._valueTracker){var t=Xa(e)?"checked":"value";e._valueTracker=pn(e,t,""+e[t])}}function bt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Xa(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function hr(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}}var Ga=/[\n"\\]/g;function en(e){return e.replace(Ga,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function la(e,t,n,r,o,a,i,u){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+gn(t)):e.value!==""+gn(t)&&(e.value=""+gn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?ua(e,i,gn(t)):n!=null?ua(e,i,gn(n)):r!=null&&e.removeAttribute("value"),o==null&&a!=null&&(e.defaultChecked=!!a),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.name=""+gn(u):e.removeAttribute("name")}function rr(e,t,n,r,o,a,i,u){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){Sr(e);return}n=n!=null?""+gn(n):"",t=t!=null?""+gn(t):n,u||t===e.value||(e.value=t),e.defaultValue=t}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=u?e.checked:!!r,e.defaultChecked=!!r,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),Sr(e)}function ua(e,t,n){t==="number"&&hr(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Gr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Hi(e,t,n){if(t!=null&&(t=""+gn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+gn(n):""}function Za(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(c(92));if(Pe(r)){if(1<r.length)throw Error(c(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=gn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Sr(e)}function gr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cr=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function or(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Cr.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function No(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var o in t)r=t[o],t.hasOwnProperty(o)&&n[o]!==r&&or(e,o,r)}else for(var a in t)t.hasOwnProperty(a)&&or(e,a,t[a])}function Zr(e){if(e.indexOf("-")===-1)return!1;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 Bt=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Jr=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function br(e){return Jr.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function kn(){}var da=null;function et(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Er=null,Yr=null;function eo(e){var t=Kr(e);if(t&&(e=t.stateNode)){var n=e[Ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(la(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+en(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=r[Ht]||null;if(!o)throw Error(c(90));la(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&bt(r)}break e;case"textarea":Hi(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Gr(e,!!n.multiple,t,!1)}}}var ca=!1;function pa(e,t,n){if(ca)return e(t,n);ca=!0;try{var r=e(t);return r}finally{if(ca=!1,(Er!==null||Yr!==null)&&(Ps(),Er&&(t=Er,e=Yr,Yr=Er=null,eo(t),e)))for(t=0;t<e.length;t++)eo(e[t])}}function ar(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ht]||null;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(c(231,t,typeof n));return n}var Wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wt=!1;if(Wn)try{var Et={};Object.defineProperty(Et,"passive",{get:function(){wt=!0}}),window.addEventListener("test",Et,Et),window.removeEventListener("test",Et,Et)}catch{wt=!1}var Mt=null,Ja=null,tn=null;function Tt(){if(tn)return tn;var e,t=Ja,n=t.length,r,o="value"in Mt?Mt.value:Mt.textContent,a=o.length;for(e=0;e<n&&t[e]===o[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===o[a-r];r++);return tn=o.slice(e,1<r?1-r:void 0)}function Hn(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 To(){return!0}function Bi(){return!1}function yt(e){function t(n,r,o,a,i){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(n=e[u],this[u]=n?n(a):a[u]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?To:Bi,this.isPropagationStopped=Bi,this}return C(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=To)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=To)},persist:function(){},isPersistent:To}),t}var Bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lo=yt(Bn),to=C({},Bn,{view:0,detail:0}),no=yt(to),Fo,$o,Rn,Oo=C({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:p,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!==Rn&&(Rn&&e.type==="mousemove"?(Fo=e.screenX-Rn.screenX,$o=e.screenY-Rn.screenY):$o=Fo=0,Rn=e),Fo)},movementY:function(e){return"movementY"in e?e.movementY:$o}}),Ya=yt(Oo),ei=C({},Oo,{dataTransfer:0}),ml=yt(ei),fl=C({},to,{relatedTarget:0}),ma=yt(fl),hl=C({},Bn,{animationName:0,elapsedTime:0,pseudoElement:0}),gl=yt(hl),Vi=C({},Bn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ui=yt(Vi),ti=C({},Bn,{data:0}),Qi=yt(ti),bl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yl={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"},vl={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xl(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vl[e])?!!t[e]:!1}function p(){return xl}var R=C({},to,{key:function(e){if(e.key){var t=bl[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yl[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:p,charCode:function(e){return e.type==="keypress"?Hn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),D=yt(R),L=C({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Z=yt(L),pe=C({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:p}),Ye=yt(pe),zt=C({},Bn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lt=yt(zt),Te=C({},Oo,{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}),We=yt(Te),kt=C({},Bn,{newState:0,oldState:0}),Gt=yt(kt),Vt=[9,13,27,32],Ut=Wn&&"CompositionEvent"in window,_n=null;Wn&&"documentMode"in document&&(_n=document.documentMode);var Vn=Wn&&"TextEvent"in window&&!_n,Ce=Wn&&(!Ut||_n&&8<_n&&11>=_n),He=" ",ht=!1;function st(e,t){switch(e){case"keyup":return Vt.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sn(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var St=!1;function nn(e,t){switch(e){case"compositionend":return Sn(t);case"keypress":return t.which!==32?null:(ht=!0,He);case"textInput":return e=t.data,e===He&&ht?null:e;default:return null}}function gt(e,t){if(St)return e==="compositionend"||!Ut&&st(e,t)?(e=Tt(),tn=Ja=Mt=null,St=!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 Ce&&t.locale!=="ko"?null:t.data;default:return null}}var qi={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 pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!qi[e.type]:t==="textarea"}function mc(e,t,n,r){Er?Yr?Yr.push(r):Yr=[r]:Er=r,t=Ts(t,"onChange"),0<t.length&&(n=new Lo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ni=null,ri=null;function _g(e){Xm(e,0)}function Ki(e){var t=cn(e);if(bt(t))return e}function fc(e,t){if(e==="change")return t}var hc=!1;if(Wn){var wl;if(Wn){var kl="oninput"in document;if(!kl){var gc=document.createElement("div");gc.setAttribute("oninput","return;"),kl=typeof gc.oninput=="function"}wl=kl}else wl=!1;hc=wl&&(!document.documentMode||9<document.documentMode)}function bc(){ni&&(ni.detachEvent("onpropertychange",yc),ri=ni=null)}function yc(e){if(e.propertyName==="value"&&Ki(ri)){var t=[];mc(t,ri,e,et(e)),pa(_g,t)}}function Sg(e,t,n){e==="focusin"?(bc(),ni=t,ri=n,ni.attachEvent("onpropertychange",yc)):e==="focusout"&&bc()}function Cg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ki(ri)}function Eg(e,t){if(e==="click")return Ki(t)}function zg(e,t){if(e==="input"||e==="change")return Ki(t)}function Ag(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dn=typeof Object.is=="function"?Object.is:Ag;function oi(e,t){if(Dn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Oe.call(t,o)||!Dn(e[o],t[o]))return!1}return!0}function vc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xc(e,t){var n=vc(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=vc(n)}}function wc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=hr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=hr(e.document)}return t}function _l(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")}var Pg=Wn&&"documentMode"in document&&11>=document.documentMode,fa=null,Sl=null,ai=null,Cl=!1;function _c(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Cl||fa==null||fa!==hr(r)||(r=fa,"selectionStart"in r&&_l(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ai&&oi(ai,r)||(ai=r,r=Ts(Sl,"onSelect"),0<r.length&&(t=new Lo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=fa)))}function Wo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ha={animationend:Wo("Animation","AnimationEnd"),animationiteration:Wo("Animation","AnimationIteration"),animationstart:Wo("Animation","AnimationStart"),transitionrun:Wo("Transition","TransitionRun"),transitionstart:Wo("Transition","TransitionStart"),transitioncancel:Wo("Transition","TransitionCancel"),transitionend:Wo("Transition","TransitionEnd")},El={},Sc={};Wn&&(Sc=document.createElement("div").style,"AnimationEvent"in window||(delete ha.animationend.animation,delete ha.animationiteration.animation,delete ha.animationstart.animation),"TransitionEvent"in window||delete ha.transitionend.transition);function Ho(e){if(El[e])return El[e];if(!ha[e])return e;var t=ha[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Sc)return El[e]=t[n];return e}var Cc=Ho("animationend"),Ec=Ho("animationiteration"),zc=Ho("animationstart"),Ig=Ho("transitionrun"),Mg=Ho("transitionstart"),jg=Ho("transitioncancel"),Ac=Ho("transitionend"),Pc=new Map,zl="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");zl.push("scrollEnd");function ir(e,t){Pc.set(e,t),fr(t,[e])}var Xi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Un=[],ga=0,Al=0;function Gi(){for(var e=ga,t=Al=ga=0;t<e;){var n=Un[t];Un[t++]=null;var r=Un[t];Un[t++]=null;var o=Un[t];Un[t++]=null;var a=Un[t];if(Un[t++]=null,r!==null&&o!==null){var i=r.pending;i===null?o.next=o:(o.next=i.next,i.next=o),r.pending=o}a!==0&&Ic(n,o,a)}}function Zi(e,t,n,r){Un[ga++]=e,Un[ga++]=t,Un[ga++]=n,Un[ga++]=r,Al|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Pl(e,t,n,r){return Zi(e,t,n,r),Ji(e)}function Bo(e,t){return Zi(e,null,null,t),Ji(e)}function Ic(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var o=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(o=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,o&&t!==null&&(o=31-mt(n),e=a.hiddenUpdates,r=e[o],r===null?e[o]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ji(e){if(50<zi)throw zi=0,Fu=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ba={};function Rg(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.refCleanup=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 Nn(e,t,n,r){return new Rg(e,t,n,r)}function Il(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zr(e,t){var n=e.alternate;return n===null?(n=Nn(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&65011712,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.refCleanup=e.refCleanup,n}function Mc(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Yi(e,t,n,r,o,a){var i=0;if(r=e,typeof e=="function")Il(e)&&(i=1);else if(typeof e=="string")i=F0(e,n,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=Nn(31,n,t,o),e.elementType=le,e.lanes=a,e;case H:return Vo(n.children,o,a,t);case U:i=8,o|=24;break;case ee:return e=Nn(12,n,t,o|2),e.elementType=ee,e.lanes=a,e;case ie:return e=Nn(13,n,t,o),e.elementType=ie,e.lanes=a,e;case Q:return e=Nn(19,n,t,o),e.elementType=Q,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case re:i=10;break e;case te:i=9;break e;case ne:i=11;break e;case O:i=14;break e;case fe:i=16,r=null;break e}i=29,n=Error(c(130,e===null?"null":typeof e,"")),r=null}return t=Nn(i,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Vo(e,t,n,r){return e=Nn(7,e,r,t),e.lanes=n,e}function Ml(e,t,n){return e=Nn(6,e,null,t),e.lanes=n,e}function jc(e){var t=Nn(18,null,null,0);return t.stateNode=e,t}function jl(e,t,n){return t=Nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Rc=new WeakMap;function Qn(e,t){if(typeof e=="object"&&e!==null){var n=Rc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:J(t)},Rc.set(e,t),t)}return{value:e,source:t,stack:J(t)}}var ya=[],va=0,es=null,ii=0,qn=[],Kn=0,ro=null,yr=1,vr="";function Ar(e,t){ya[va++]=ii,ya[va++]=es,es=e,ii=t}function Dc(e,t,n){qn[Kn++]=yr,qn[Kn++]=vr,qn[Kn++]=ro,ro=e;var r=yr;e=vr;var o=32-mt(r)-1;r&=~(1<<o),n+=1;var a=32-mt(t)+o;if(30<a){var i=o-o%5;a=(r&(1<<i)-1).toString(32),r>>=i,o-=i,yr=1<<32-mt(t)+o|n<<o|r,vr=a+e}else yr=1<<a|n<<o|r,vr=e}function Rl(e){e.return!==null&&(Ar(e,1),Dc(e,1,0))}function Dl(e){for(;e===es;)es=ya[--va],ya[va]=null,ii=ya[--va],ya[va]=null;for(;e===ro;)ro=qn[--Kn],qn[Kn]=null,vr=qn[--Kn],qn[Kn]=null,yr=qn[--Kn],qn[Kn]=null}function Nc(e,t){qn[Kn++]=yr,qn[Kn++]=vr,qn[Kn++]=ro,yr=t.id,vr=t.overflow,ro=e}var rn=null,vt=null,Ze=!1,oo=null,Xn=!1,Nl=Error(c(519));function ao(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw si(Qn(t,e)),Nl}function Tc(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[Ht]=r,n){case"dialog":Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":case"embed":Qe("load",t);break;case"video":case"audio":for(n=0;n<Pi.length;n++)Qe(Pi[n],t);break;case"source":Qe("error",t);break;case"img":case"image":case"link":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"input":Qe("invalid",t),rr(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Qe("invalid",t);break;case"textarea":Qe("invalid",t),Za(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||Ym(t.textContent,n)?(r.popover!=null&&(Qe("beforetoggle",t),Qe("toggle",t)),r.onScroll!=null&&Qe("scroll",t),r.onScrollEnd!=null&&Qe("scrollend",t),r.onClick!=null&&(t.onclick=kn),t=!0):t=!1,t||ao(e,!0)}function Lc(e){for(rn=e.return;rn;)switch(rn.tag){case 5:case 31:case 13:Xn=!1;return;case 27:case 3:Xn=!0;return;default:rn=rn.return}}function xa(e){if(e!==rn)return!1;if(!Ze)return Lc(e),Ze=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Yu(e.type,e.memoizedProps)),n=!n),n&&vt&&ao(e),Lc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));vt=uf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));vt=uf(e)}else t===27?(t=vt,xo(e.type)?(e=od,od=null,vt=e):vt=t):vt=rn?Gn(e.stateNode.nextSibling):null;return!0}function Uo(){vt=rn=null,Ze=!1}function Tl(){var e=oo;return e!==null&&(An===null?An=e:An.push.apply(An,e),oo=null),e}function si(e){oo===null?oo=[e]:oo.push(e)}var Ll=f(null),Qo=null,Pr=null;function io(e,t,n){G(Ll,t._currentValue),t._currentValue=n}function Ir(e){e._currentValue=Ll.current,P(Ll)}function Fl(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 $l(e,t,n,r){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){var i=o.child;a=a.firstContext;e:for(;a!==null;){var u=a;a=o;for(var h=0;h<t.length;h++)if(u.context===t[h]){a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Fl(a.return,n,e),r||(i=null);break e}a=u.next}}else if(o.tag===18){if(i=o.return,i===null)throw Error(c(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Fl(i,n,e),i=null}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===e){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}}function wa(e,t,n,r){e=null;for(var o=t,a=!1;o!==null;){if(!a){if((o.flags&524288)!==0)a=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var i=o.alternate;if(i===null)throw Error(c(387));if(i=i.memoizedProps,i!==null){var u=o.type;Dn(o.pendingProps.value,i.value)||(e!==null?e.push(u):e=[u])}}else if(o===ze.current){if(i=o.alternate,i===null)throw Error(c(387));i.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Di):e=[Di])}o=o.return}e!==null&&$l(t,e,n,r),t.flags|=262144}function ts(e){for(e=e.firstContext;e!==null;){if(!Dn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qo(e){Qo=e,Pr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function on(e){return Fc(Qo,e)}function ns(e,t){return Qo===null&&qo(e),Fc(e,t)}function Fc(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pr===null){if(e===null)throw Error(c(308));Pr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pr=Pr.next=t;return n}var Dg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Ng=s.unstable_scheduleCallback,Tg=s.unstable_NormalPriority,Ft={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ol(){return{controller:new Dg,data:new Map,refCount:0}}function li(e){e.refCount--,e.refCount===0&&Ng(Tg,function(){e.controller.abort()})}var ui=null,Wl=0,ka=0,_a=null;function Lg(e,t){if(ui===null){var n=ui=[];Wl=0,ka=Vu(),_a={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Wl++,t.then($c,$c),t}function $c(){if(--Wl===0&&ui!==null){_a!==null&&(_a.status="fulfilled");var e=ui;ui=null,ka=0,_a=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fg(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var o=0;o<n.length;o++)(0,n[o])(t)},function(o){for(r.status="rejected",r.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),r}var Oc=E.S;E.S=function(e,t){_m=Je(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Lg(e,t),Oc!==null&&Oc(e,t)};var Ko=f(null);function Hl(){var e=Ko.current;return e!==null?e:ft.pooledCache}function rs(e,t){t===null?G(Ko,Ko.current):G(Ko,t.pool)}function Wc(){var e=Hl();return e===null?null:{parent:Ft._currentValue,pool:e}}var Sa=Error(c(460)),Bl=Error(c(474)),os=Error(c(542)),as={then:function(){}};function Hc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Bc(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(kn,kn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uc(e),e;default:if(typeof t.status=="string")t.then(kn,kn);else{if(e=ft,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=r}},function(r){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uc(e),e}throw Go=t,Sa}}function Xo(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Go=n,Sa):n}}var Go=null;function Vc(){if(Go===null)throw Error(c(459));var e=Go;return Go=null,e}function Uc(e){if(e===Sa||e===os)throw Error(c(483))}var Ca=null,di=0;function is(e){var t=di;return di+=1,Ca===null&&(Ca=[]),Bc(Ca,e,t)}function ci(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ss(e,t){throw t.$$typeof===W?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Qc(e){function t(b,g){if(e){var w=b.deletions;w===null?(b.deletions=[g],b.flags|=16):w.push(g)}}function n(b,g){if(!e)return null;for(;g!==null;)t(b,g),g=g.sibling;return null}function r(b){for(var g=new Map;b!==null;)b.key!==null?g.set(b.key,b):g.set(b.index,b),b=b.sibling;return g}function o(b,g){return b=zr(b,g),b.index=0,b.sibling=null,b}function a(b,g,w){return b.index=w,e?(w=b.alternate,w!==null?(w=w.index,w<g?(b.flags|=67108866,g):w):(b.flags|=67108866,g)):(b.flags|=1048576,g)}function i(b){return e&&b.alternate===null&&(b.flags|=67108866),b}function u(b,g,w,T){return g===null||g.tag!==6?(g=Ml(w,b.mode,T),g.return=b,g):(g=o(g,w),g.return=b,g)}function h(b,g,w,T){var we=w.type;return we===H?j(b,g,w.props.children,T,w.key):g!==null&&(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===fe&&Xo(we)===g.type)?(g=o(g,w.props),ci(g,w),g.return=b,g):(g=Yi(w.type,w.key,w.props,null,b.mode,T),ci(g,w),g.return=b,g)}function k(b,g,w,T){return g===null||g.tag!==4||g.stateNode.containerInfo!==w.containerInfo||g.stateNode.implementation!==w.implementation?(g=jl(w,b.mode,T),g.return=b,g):(g=o(g,w.children||[]),g.return=b,g)}function j(b,g,w,T,we){return g===null||g.tag!==7?(g=Vo(w,b.mode,T,we),g.return=b,g):(g=o(g,w),g.return=b,g)}function $(b,g,w){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Ml(""+g,b.mode,w),g.return=b,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case I:return w=Yi(g.type,g.key,g.props,null,b.mode,w),ci(w,g),w.return=b,w;case A:return g=jl(g,b.mode,w),g.return=b,g;case fe:return g=Xo(g),$(b,g,w)}if(Pe(g)||oe(g))return g=Vo(g,b.mode,w,null),g.return=b,g;if(typeof g.then=="function")return $(b,is(g),w);if(g.$$typeof===re)return $(b,ns(b,g),w);ss(b,g)}return null}function S(b,g,w,T){var we=g!==null?g.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return we!==null?null:u(b,g,""+w,T);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case I:return w.key===we?h(b,g,w,T):null;case A:return w.key===we?k(b,g,w,T):null;case fe:return w=Xo(w),S(b,g,w,T)}if(Pe(w)||oe(w))return we!==null?null:j(b,g,w,T,null);if(typeof w.then=="function")return S(b,g,is(w),T);if(w.$$typeof===re)return S(b,g,ns(b,w),T);ss(b,w)}return null}function z(b,g,w,T,we){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return b=b.get(w)||null,u(g,b,""+T,we);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case I:return b=b.get(T.key===null?w:T.key)||null,h(g,b,T,we);case A:return b=b.get(T.key===null?w:T.key)||null,k(g,b,T,we);case fe:return T=Xo(T),z(b,g,w,T,we)}if(Pe(T)||oe(T))return b=b.get(w)||null,j(g,b,T,we,null);if(typeof T.then=="function")return z(b,g,w,is(T),we);if(T.$$typeof===re)return z(b,g,w,ns(g,T),we);ss(g,T)}return null}function de(b,g,w,T){for(var we=null,nt=null,he=g,Re=g=0,Xe=null;he!==null&&Re<w.length;Re++){he.index>Re?(Xe=he,he=null):Xe=he.sibling;var rt=S(b,he,w[Re],T);if(rt===null){he===null&&(he=Xe);break}e&&he&&rt.alternate===null&&t(b,he),g=a(rt,g,Re),nt===null?we=rt:nt.sibling=rt,nt=rt,he=Xe}if(Re===w.length)return n(b,he),Ze&&Ar(b,Re),we;if(he===null){for(;Re<w.length;Re++)he=$(b,w[Re],T),he!==null&&(g=a(he,g,Re),nt===null?we=he:nt.sibling=he,nt=he);return Ze&&Ar(b,Re),we}for(he=r(he);Re<w.length;Re++)Xe=z(he,b,Re,w[Re],T),Xe!==null&&(e&&Xe.alternate!==null&&he.delete(Xe.key===null?Re:Xe.key),g=a(Xe,g,Re),nt===null?we=Xe:nt.sibling=Xe,nt=Xe);return e&&he.forEach(function(Co){return t(b,Co)}),Ze&&Ar(b,Re),we}function Se(b,g,w,T){if(w==null)throw Error(c(151));for(var we=null,nt=null,he=g,Re=g=0,Xe=null,rt=w.next();he!==null&&!rt.done;Re++,rt=w.next()){he.index>Re?(Xe=he,he=null):Xe=he.sibling;var Co=S(b,he,rt.value,T);if(Co===null){he===null&&(he=Xe);break}e&&he&&Co.alternate===null&&t(b,he),g=a(Co,g,Re),nt===null?we=Co:nt.sibling=Co,nt=Co,he=Xe}if(rt.done)return n(b,he),Ze&&Ar(b,Re),we;if(he===null){for(;!rt.done;Re++,rt=w.next())rt=$(b,rt.value,T),rt!==null&&(g=a(rt,g,Re),nt===null?we=rt:nt.sibling=rt,nt=rt);return Ze&&Ar(b,Re),we}for(he=r(he);!rt.done;Re++,rt=w.next())rt=z(he,b,Re,rt.value,T),rt!==null&&(e&&rt.alternate!==null&&he.delete(rt.key===null?Re:rt.key),g=a(rt,g,Re),nt===null?we=rt:nt.sibling=rt,nt=rt);return e&&he.forEach(function(X0){return t(b,X0)}),Ze&&Ar(b,Re),we}function pt(b,g,w,T){if(typeof w=="object"&&w!==null&&w.type===H&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case I:e:{for(var we=w.key;g!==null;){if(g.key===we){if(we=w.type,we===H){if(g.tag===7){n(b,g.sibling),T=o(g,w.props.children),T.return=b,b=T;break e}}else if(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===fe&&Xo(we)===g.type){n(b,g.sibling),T=o(g,w.props),ci(T,w),T.return=b,b=T;break e}n(b,g);break}else t(b,g);g=g.sibling}w.type===H?(T=Vo(w.props.children,b.mode,T,w.key),T.return=b,b=T):(T=Yi(w.type,w.key,w.props,null,b.mode,T),ci(T,w),T.return=b,b=T)}return i(b);case A:e:{for(we=w.key;g!==null;){if(g.key===we)if(g.tag===4&&g.stateNode.containerInfo===w.containerInfo&&g.stateNode.implementation===w.implementation){n(b,g.sibling),T=o(g,w.children||[]),T.return=b,b=T;break e}else{n(b,g);break}else t(b,g);g=g.sibling}T=jl(w,b.mode,T),T.return=b,b=T}return i(b);case fe:return w=Xo(w),pt(b,g,w,T)}if(Pe(w))return de(b,g,w,T);if(oe(w)){if(we=oe(w),typeof we!="function")throw Error(c(150));return w=we.call(w),Se(b,g,w,T)}if(typeof w.then=="function")return pt(b,g,is(w),T);if(w.$$typeof===re)return pt(b,g,ns(b,w),T);ss(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,g!==null&&g.tag===6?(n(b,g.sibling),T=o(g,w),T.return=b,b=T):(n(b,g),T=Ml(w,b.mode,T),T.return=b,b=T),i(b)):n(b,g)}return function(b,g,w,T){try{di=0;var we=pt(b,g,w,T);return Ca=null,we}catch(he){if(he===Sa||he===os)throw he;var nt=Nn(29,he,null,b.mode);return nt.lanes=T,nt.return=b,nt}finally{}}}var Zo=Qc(!0),qc=Qc(!1),so=!1;function Vl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ul(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function lo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(at&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=Ji(e),Ic(e,null,n),t}return Zi(e,r,t,n),Ji(e)}function pi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$i(e,n)}}function Ql(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?o=a=i:a=a.next=i,n=n.next}while(n!==null);a===null?o=a=t:a=a.next=t}else o=a=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ql=!1;function mi(){if(ql){var e=_a;if(e!==null)throw e}}function fi(e,t,n,r){ql=!1;var o=e.updateQueue;so=!1;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,u=o.shared.pending;if(u!==null){o.shared.pending=null;var h=u,k=h.next;h.next=null,i===null?a=k:i.next=k,i=h;var j=e.alternate;j!==null&&(j=j.updateQueue,u=j.lastBaseUpdate,u!==i&&(u===null?j.firstBaseUpdate=k:u.next=k,j.lastBaseUpdate=h))}if(a!==null){var $=o.baseState;i=0,j=k=h=null,u=a;do{var S=u.lane&-536870913,z=S!==u.lane;if(z?(Ke&S)===S:(r&S)===S){S!==0&&S===ka&&(ql=!0),j!==null&&(j=j.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var de=e,Se=u;S=t;var pt=n;switch(Se.tag){case 1:if(de=Se.payload,typeof de=="function"){$=de.call(pt,$,S);break e}$=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=Se.payload,S=typeof de=="function"?de.call(pt,$,S):de,S==null)break e;$=C({},$,S);break e;case 2:so=!0}}S=u.callback,S!==null&&(e.flags|=64,z&&(e.flags|=8192),z=o.callbacks,z===null?o.callbacks=[S]:z.push(S))}else z={lane:S,tag:u.tag,payload:u.payload,callback:u.callback,next:null},j===null?(k=j=z,h=$):j=j.next=z,i|=S;if(u=u.next,u===null){if(u=o.shared.pending,u===null)break;z=u,u=z.next,z.next=null,o.lastBaseUpdate=z,o.shared.pending=null}}while(!0);j===null&&(h=$),o.baseState=h,o.firstBaseUpdate=k,o.lastBaseUpdate=j,a===null&&(o.shared.lanes=0),ho|=i,e.lanes=i,e.memoizedState=$}}function Kc(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Xc(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Kc(n[e],t)}var Ea=f(null),ls=f(0);function Gc(e,t){e=$r,G(ls,e),G(Ea,t),$r=e|t.baseLanes}function Kl(){G(ls,$r),G(Ea,Ea.current)}function Xl(){$r=ls.current,P(Ea),P(ls)}var Tn=f(null),sr=null;function co(e){var t=e.alternate;G(jt,jt.current&1),G(Tn,e),sr===null&&(t===null||Ea.current!==null||t.memoizedState!==null)&&(sr=e)}function Gl(e){G(jt,jt.current),G(Tn,e),sr===null&&(sr=e)}function Zc(e){e.tag===22?(G(jt,jt.current),G(Tn,e),sr===null&&(sr=e)):po()}function po(){G(jt,jt.current),G(Tn,Tn.current)}function Ln(e){P(Tn),sr===e&&(sr=null),P(jt)}var jt=f(0);function us(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||nd(n)||rd(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 Mr=0,Ie=null,dt=null,$t=null,ds=!1,za=!1,Jo=!1,cs=0,hi=0,Aa=null,$g=0;function At(){throw Error(c(321))}function Zl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dn(e[n],t[n]))return!1;return!0}function Jl(e,t,n,r,o,a){return Mr=a,Ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?Dp:mu,Jo=!1,a=n(r,o),Jo=!1,za&&(a=Yc(t,n,r,o)),Jc(e),a}function Jc(e){E.H=yi;var t=dt!==null&&dt.next!==null;if(Mr=0,$t=dt=Ie=null,ds=!1,hi=0,Aa=null,t)throw Error(c(300));e===null||Ot||(e=e.dependencies,e!==null&&ts(e)&&(Ot=!0))}function Yc(e,t,n,r){Ie=e;var o=0;do{if(za&&(Aa=null),hi=0,za=!1,25<=o)throw Error(c(301));if(o+=1,$t=dt=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}E.H=Np,a=t(n,r)}while(za);return a}function Og(){var e=E.H,t=e.useState()[0];return t=typeof t.then=="function"?gi(t):t,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(Ie.flags|=1024),t}function Yl(){var e=cs!==0;return cs=0,e}function eu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function tu(e){if(ds){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ds=!1}Mr=0,$t=dt=Ie=null,za=!1,hi=cs=0,Aa=null}function bn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Ie.memoizedState=$t=e:$t=$t.next=e,$t}function Rt(){if(dt===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=$t===null?Ie.memoizedState:$t.next;if(t!==null)$t=t,dt=e;else{if(e===null)throw Ie.alternate===null?Error(c(467)):Error(c(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},$t===null?Ie.memoizedState=$t=e:$t=$t.next=e}return $t}function ps(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gi(e){var t=hi;return hi+=1,Aa===null&&(Aa=[]),e=Bc(Aa,e,t),t=Ie,($t===null?t.memoizedState:$t.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?Dp:mu),e}function ms(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return gi(e);if(e.$$typeof===re)return on(e)}throw Error(c(438,String(e)))}function nu(e){var t=null,n=Ie.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ie.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ps(),Ie.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ge;return t.index++,n}function jr(e,t){return typeof t=="function"?t(e):t}function fs(e){var t=Rt();return ru(t,dt,e)}function ru(e,t,n){var r=e.queue;if(r===null)throw Error(c(311));r.lastRenderedReducer=n;var o=e.baseQueue,a=r.pending;if(a!==null){if(o!==null){var i=o.next;o.next=a.next,a.next=i}t.baseQueue=o=a,r.pending=null}if(a=e.baseState,o===null)e.memoizedState=a;else{t=o.next;var u=i=null,h=null,k=t,j=!1;do{var $=k.lane&-536870913;if($!==k.lane?(Ke&$)===$:(Mr&$)===$){var S=k.revertLane;if(S===0)h!==null&&(h=h.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),$===ka&&(j=!0);else if((Mr&S)===S){k=k.next,S===ka&&(j=!0);continue}else $={lane:0,revertLane:k.revertLane,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},h===null?(u=h=$,i=a):h=h.next=$,Ie.lanes|=S,ho|=S;$=k.action,Jo&&n(a,$),a=k.hasEagerState?k.eagerState:n(a,$)}else S={lane:$,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},h===null?(u=h=S,i=a):h=h.next=S,Ie.lanes|=$,ho|=$;k=k.next}while(k!==null&&k!==t);if(h===null?i=a:h.next=u,!Dn(a,e.memoizedState)&&(Ot=!0,j&&(n=_a,n!==null)))throw n;e.memoizedState=a,e.baseState=i,e.baseQueue=h,r.lastRenderedState=a}return o===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ou(e){var t=Rt(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(o!==null){n.pending=null;var i=o=o.next;do a=e(a,i.action),i=i.next;while(i!==o);Dn(a,t.memoizedState)||(Ot=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ep(e,t,n){var r=Ie,o=Rt(),a=Ze;if(a){if(n===void 0)throw Error(c(407));n=n()}else n=t();var i=!Dn((dt||o).memoizedState,n);if(i&&(o.memoizedState=n,Ot=!0),o=o.queue,su(rp.bind(null,r,o,e),[e]),o.getSnapshot!==t||i||$t!==null&&$t.memoizedState.tag&1){if(r.flags|=2048,Pa(9,{destroy:void 0},np.bind(null,r,o,n,t),null),ft===null)throw Error(c(349));a||(Mr&127)!==0||tp(r,t,n)}return n}function tp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ie.updateQueue,t===null?(t=ps(),Ie.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function np(e,t,n,r){t.value=n,t.getSnapshot=r,op(t)&&ap(e)}function rp(e,t,n){return n(function(){op(t)&&ap(e)})}function op(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dn(e,n)}catch{return!0}}function ap(e){var t=Bo(e,2);t!==null&&Pn(t,e,2)}function au(e){var t=bn();if(typeof e=="function"){var n=e;if(e=n(),Jo){ot(!0);try{n()}finally{ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:e},t}function ip(e,t,n,r){return e.baseState=n,ru(e,dt,typeof r=="function"?r:jr)}function Wg(e,t,n,r,o){if(bs(e))throw Error(c(485));if(e=t.action,e!==null){var a={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){a.listeners.push(i)}};E.T!==null?n(!0):a.isTransition=!1,r(a),n=t.pending,n===null?(a.next=t.pending=a,sp(t,a)):(a.next=n.next,t.pending=n.next=a)}}function sp(e,t){var n=t.action,r=t.payload,o=e.state;if(t.isTransition){var a=E.T,i={};E.T=i;try{var u=n(o,r),h=E.S;h!==null&&h(i,u),lp(e,t,u)}catch(k){iu(e,t,k)}finally{a!==null&&i.types!==null&&(a.types=i.types),E.T=a}}else try{a=n(o,r),lp(e,t,a)}catch(k){iu(e,t,k)}}function lp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){up(e,t,r)},function(r){return iu(e,t,r)}):up(e,t,n)}function up(e,t,n){t.status="fulfilled",t.value=n,dp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,sp(e,n)))}function iu(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,dp(t),t=t.next;while(t!==r)}e.action=null}function dp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function cp(e,t){return t}function pp(e,t){if(Ze){var n=ft.formState;if(n!==null){e:{var r=Ie;if(Ze){if(vt){t:{for(var o=vt,a=Xn;o.nodeType!==8;){if(!a){o=null;break t}if(o=Gn(o.nextSibling),o===null){o=null;break t}}a=o.data,o=a==="F!"||a==="F"?o:null}if(o){vt=Gn(o.nextSibling),r=o.data==="F!";break e}}ao(r)}r=!1}r&&(t=n[0])}}return n=bn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cp,lastRenderedState:t},n.queue=r,n=Mp.bind(null,Ie,r),r.dispatch=n,r=au(!1),a=pu.bind(null,Ie,!1,r.queue),r=bn(),o={state:t,dispatch:null,action:e,pending:null},r.queue=o,n=Wg.bind(null,Ie,o,a,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function mp(e){var t=Rt();return fp(t,dt,e)}function fp(e,t,n){if(t=ru(e,t,cp)[0],e=fs(jr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=gi(t)}catch(i){throw i===Sa?os:i}else r=t;t=Rt();var o=t.queue,a=o.dispatch;return n!==t.memoizedState&&(Ie.flags|=2048,Pa(9,{destroy:void 0},Hg.bind(null,o,n),null)),[r,a,e]}function Hg(e,t){e.action=t}function hp(e){var t=Rt(),n=dt;if(n!==null)return fp(t,n,e);Rt(),t=t.memoizedState,n=Rt();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Pa(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ie.updateQueue,t===null&&(t=ps(),Ie.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function gp(){return Rt().memoizedState}function hs(e,t,n,r){var o=bn();Ie.flags|=e,o.memoizedState=Pa(1|t,{destroy:void 0},n,r===void 0?null:r)}function gs(e,t,n,r){var o=Rt();r=r===void 0?null:r;var a=o.memoizedState.inst;dt!==null&&r!==null&&Zl(r,dt.memoizedState.deps)?o.memoizedState=Pa(t,a,n,r):(Ie.flags|=e,o.memoizedState=Pa(1|t,a,n,r))}function bp(e,t){hs(8390656,8,e,t)}function su(e,t){gs(2048,8,e,t)}function Bg(e){Ie.flags|=4;var t=Ie.updateQueue;if(t===null)t=ps(),Ie.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function yp(e){var t=Rt().memoizedState;return Bg({ref:t,nextImpl:e}),function(){if((at&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function vp(e,t){return gs(4,2,e,t)}function xp(e,t){return gs(4,4,e,t)}function wp(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function kp(e,t,n){n=n!=null?n.concat([e]):null,gs(4,4,wp.bind(null,t,e),n)}function lu(){}function _p(e,t){var n=Rt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zl(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Sp(e,t){var n=Rt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zl(t,r[1]))return r[0];if(r=e(),Jo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r}function uu(e,t,n){return n===void 0||(Mr&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Cm(),Ie.lanes|=e,ho|=e,n)}function Cp(e,t,n,r){return Dn(n,t)?n:Ea.current!==null?(e=uu(e,n,r),Dn(e,t)||(Ot=!0),e):(Mr&42)===0||(Mr&1073741824)!==0&&(Ke&261930)===0?(Ot=!0,e.memoizedState=n):(e=Cm(),Ie.lanes|=e,ho|=e,t)}function Ep(e,t,n,r,o){var a=V.p;V.p=a!==0&&8>a?a:8;var i=E.T,u={};E.T=u,pu(e,!1,t,n);try{var h=o(),k=E.S;if(k!==null&&k(u,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var j=Fg(h,r);bi(e,t,j,On(e))}else bi(e,t,r,On(e))}catch($){bi(e,t,{then:function(){},status:"rejected",reason:$},On())}finally{V.p=a,i!==null&&u.types!==null&&(i.types=u.types),E.T=i}}function Vg(){}function du(e,t,n,r){if(e.tag!==5)throw Error(c(476));var o=zp(e).queue;Ep(e,o,t,se,n===null?Vg:function(){return Ap(e),n(r)})}function zp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ap(e){var t=zp(e);t.next===null&&(t=e.alternate.memoizedState),bi(e,t.next.queue,{},On())}function cu(){return on(Di)}function Pp(){return Rt().memoizedState}function Ip(){return Rt().memoizedState}function Ug(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=On();e=lo(n);var r=uo(t,e,n);r!==null&&(Pn(r,t,n),pi(r,t,n)),t={cache:Ol()},e.payload=t;return}t=t.return}}function Qg(e,t,n){var r=On();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bs(e)?jp(t,n):(n=Pl(e,t,n,r),n!==null&&(Pn(n,e,r),Rp(n,t,r)))}function Mp(e,t,n){var r=On();bi(e,t,n,r)}function bi(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bs(e))jp(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,u=a(i,n);if(o.hasEagerState=!0,o.eagerState=u,Dn(u,i))return Zi(e,t,o,0),ft===null&&Gi(),!1}catch{}finally{}if(n=Pl(e,t,o,r),n!==null)return Pn(n,e,r),Rp(n,t,r),!0}return!1}function pu(e,t,n,r){if(r={lane:2,revertLane:Vu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bs(e)){if(t)throw Error(c(479))}else t=Pl(e,n,r,2),t!==null&&Pn(t,e,2)}function bs(e){var t=e.alternate;return e===Ie||t!==null&&t===Ie}function jp(e,t){za=ds=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rp(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$i(e,n)}}var yi={readContext:on,use:ms,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};yi.useEffectEvent=At;var Dp={readContext:on,use:ms,useCallback:function(e,t){return bn().memoizedState=[e,t===void 0?null:t],e},useContext:on,useEffect:bp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,hs(4194308,4,wp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hs(4194308,4,e,t)},useInsertionEffect:function(e,t){hs(4,2,e,t)},useMemo:function(e,t){var n=bn();t=t===void 0?null:t;var r=e();if(Jo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=bn();if(n!==void 0){var o=n(t);if(Jo){ot(!0);try{n(t)}finally{ot(!1)}}}else o=t;return r.memoizedState=r.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},r.queue=e,e=e.dispatch=Qg.bind(null,Ie,e),[r.memoizedState,e]},useRef:function(e){var t=bn();return e={current:e},t.memoizedState=e},useState:function(e){e=au(e);var t=e.queue,n=Mp.bind(null,Ie,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:lu,useDeferredValue:function(e,t){var n=bn();return uu(n,e,t)},useTransition:function(){var e=au(!1);return e=Ep.bind(null,Ie,e.queue,!0,!1),bn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ie,o=bn();if(Ze){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),ft===null)throw Error(c(349));(Ke&127)!==0||tp(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,bp(rp.bind(null,r,a,e),[e]),r.flags|=2048,Pa(9,{destroy:void 0},np.bind(null,r,a,n,t),null),n},useId:function(){var e=bn(),t=ft.identifierPrefix;if(Ze){var n=vr,r=yr;n=(r&~(1<<32-mt(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=cs++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=$g++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:cu,useFormState:pp,useActionState:pp,useOptimistic:function(e){var t=bn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=pu.bind(null,Ie,!0,n),n.dispatch=t,[e,t]},useMemoCache:nu,useCacheRefresh:function(){return bn().memoizedState=Ug.bind(null,Ie)},useEffectEvent:function(e){var t=bn(),n={impl:e};return t.memoizedState=n,function(){if((at&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},mu={readContext:on,use:ms,useCallback:_p,useContext:on,useEffect:su,useImperativeHandle:kp,useInsertionEffect:vp,useLayoutEffect:xp,useMemo:Sp,useReducer:fs,useRef:gp,useState:function(){return fs(jr)},useDebugValue:lu,useDeferredValue:function(e,t){var n=Rt();return Cp(n,dt.memoizedState,e,t)},useTransition:function(){var e=fs(jr)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:gi(e),t]},useSyncExternalStore:ep,useId:Pp,useHostTransitionStatus:cu,useFormState:mp,useActionState:mp,useOptimistic:function(e,t){var n=Rt();return ip(n,dt,e,t)},useMemoCache:nu,useCacheRefresh:Ip};mu.useEffectEvent=yp;var Np={readContext:on,use:ms,useCallback:_p,useContext:on,useEffect:su,useImperativeHandle:kp,useInsertionEffect:vp,useLayoutEffect:xp,useMemo:Sp,useReducer:ou,useRef:gp,useState:function(){return ou(jr)},useDebugValue:lu,useDeferredValue:function(e,t){var n=Rt();return dt===null?uu(n,e,t):Cp(n,dt.memoizedState,e,t)},useTransition:function(){var e=ou(jr)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:gi(e),t]},useSyncExternalStore:ep,useId:Pp,useHostTransitionStatus:cu,useFormState:hp,useActionState:hp,useOptimistic:function(e,t){var n=Rt();return dt!==null?ip(n,dt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:nu,useCacheRefresh:Ip};Np.useEffectEvent=yp;function fu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:C({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hu={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=On(),o=lo(r);o.payload=t,n!=null&&(o.callback=n),t=uo(e,o,r),t!==null&&(Pn(t,e,r),pi(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=On(),o=lo(r);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=uo(e,o,r),t!==null&&(Pn(t,e,r),pi(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=On(),r=lo(n);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,n),t!==null&&(Pn(t,e,n),pi(t,e,n))}};function Tp(e,t,n,r,o,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,i):t.prototype&&t.prototype.isPureReactComponent?!oi(n,r)||!oi(o,a):!0}function Lp(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&&hu.enqueueReplaceState(t,t.state,null)}function Yo(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=C({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function Fp(e){Xi(e)}function $p(e){console.error(e)}function Op(e){Xi(e)}function ys(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Wp(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function gu(e,t,n){return n=lo(n),n.tag=3,n.payload={element:null},n.callback=function(){ys(e,t)},n}function Hp(e){return e=lo(e),e.tag=3,e}function Bp(e,t,n,r){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var a=r.value;e.payload=function(){return o(a)},e.callback=function(){Wp(t,n,r)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Wp(t,n,r),typeof o!="function"&&(go===null?go=new Set([this]):go.add(this));var u=r.stack;this.componentDidCatch(r.value,{componentStack:u!==null?u:""})})}function qg(e,t,n,r,o){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&wa(t,n,o,!0),n=Tn.current,n!==null){switch(n.tag){case 31:case 13:return sr===null?Is():n.alternate===null&&Pt===0&&(Pt=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===as?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,o)),!1;case 22:return n.flags|=65536,r===as?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,o)),!1}throw Error(c(435,n.tag))}return Wu(e,r,o),Is(),!1}if(Ze)return t=Tn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==Nl&&(e=Error(c(422),{cause:r}),si(Qn(e,n)))):(r!==Nl&&(t=Error(c(423),{cause:r}),si(Qn(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=Qn(r,n),o=gu(e.stateNode,r,o),Ql(e,o),Pt!==4&&(Pt=2)),!1;var a=Error(c(520),{cause:r});if(a=Qn(a,n),Ei===null?Ei=[a]:Ei.push(a),Pt!==4&&(Pt=2),t===null)return!0;r=Qn(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=gu(n.stateNode,r,e),Ql(n,e),!1;case 1:if(t=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(go===null||!go.has(a))))return n.flags|=65536,o&=-o,n.lanes|=o,o=Hp(o),Bp(o,e,n,r),Ql(n,o),!1}n=n.return}while(n!==null);return!1}var bu=Error(c(461)),Ot=!1;function an(e,t,n,r){t.child=e===null?qc(t,null,n,r):Zo(t,e.child,n,r)}function Vp(e,t,n,r,o){n=n.render;var a=t.ref;if("ref"in r){var i={};for(var u in r)u!=="ref"&&(i[u]=r[u])}else i=r;return qo(t),r=Jl(e,t,n,i,a,o),u=Yl(),e!==null&&!Ot?(eu(e,t,o),Rr(e,t,o)):(Ze&&u&&Rl(t),t.flags|=1,an(e,t,r,o),t.child)}function Up(e,t,n,r,o){if(e===null){var a=n.type;return typeof a=="function"&&!Il(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Qp(e,t,a,r,o)):(e=Yi(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cu(e,o)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:oi,n(i,r)&&e.ref===t.ref)return Rr(e,t,o)}return t.flags|=1,e=zr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Qp(e,t,n,r,o){if(e!==null){var a=e.memoizedProps;if(oi(a,r)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=r=a,Cu(e,o))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,Rr(e,t,o)}return yu(e,t,n,r,o)}function qp(e,t,n,r){var o=r.children,a=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(a=a!==null?a.baseLanes|n:n,e!==null){for(r=t.child=e.child,o=0;r!==null;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~a}else r=0,t.child=null;return Kp(e,t,a,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&rs(t,a!==null?a.cachePool:null),a!==null?Gc(t,a):Kl(),Zc(t);else return r=t.lanes=536870912,Kp(e,t,a!==null?a.baseLanes|n:n,n,r)}else a!==null?(rs(t,a.cachePool),Gc(t,a),po(),t.memoizedState=null):(e!==null&&rs(t,null),Kl(),po());return an(e,t,o,n),t.child}function vi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kp(e,t,n,r,o){var a=Hl();return a=a===null?null:{parent:Ft._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&rs(t,null),Kl(),Zc(t),e!==null&&wa(e,t,r,!0),t.childLanes=o,null}function vs(e,t){return t=ws({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xp(e,t,n){return Zo(t,e.child,null,n),e=vs(t,t.pendingProps),e.flags|=2,Ln(t),t.memoizedState=null,e}function Kg(e,t,n){var r=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ze){if(r.mode==="hidden")return e=vs(t,r),t.lanes=536870912,vi(null,e);if(Gl(t),(e=vt)?(e=lf(e,Xn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ro!==null?{id:yr,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},n=jc(e),n.return=t,t.child=n,rn=t,vt=null)):e=null,e===null)throw ao(t);return t.lanes=536870912,null}return vs(t,r)}var a=e.memoizedState;if(a!==null){var i=a.dehydrated;if(Gl(t),o)if(t.flags&256)t.flags&=-257,t=Xp(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Ot||wa(e,t,n,!1),o=(n&e.childLanes)!==0,Ot||o){if(r=ft,r!==null&&(i=Ro(r,n),i!==0&&i!==a.retryLane))throw a.retryLane=i,Bo(e,i),Pn(r,e,i),bu;Is(),t=Xp(e,t,n)}else e=a.treeContext,vt=Gn(i.nextSibling),rn=t,Ze=!0,oo=null,Xn=!1,e!==null&&Nc(t,e),t=vs(t,r),t.flags|=4096;return t}return e=zr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function yu(e,t,n,r,o){return qo(t),n=Jl(e,t,n,r,void 0,o),r=Yl(),e!==null&&!Ot?(eu(e,t,o),Rr(e,t,o)):(Ze&&r&&Rl(t),t.flags|=1,an(e,t,n,o),t.child)}function Gp(e,t,n,r,o,a){return qo(t),t.updateQueue=null,n=Yc(t,r,n,o),Jc(e),r=Yl(),e!==null&&!Ot?(eu(e,t,a),Rr(e,t,a)):(Ze&&r&&Rl(t),t.flags|=1,an(e,t,n,a),t.child)}function Zp(e,t,n,r,o){if(qo(t),t.stateNode===null){var a=ba,i=n.contextType;typeof i=="object"&&i!==null&&(a=on(i)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=hu,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Vl(t),i=n.contextType,a.context=typeof i=="object"&&i!==null?on(i):ba,a.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(fu(t,n,i,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(i=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),i!==a.state&&hu.enqueueReplaceState(a,a.state,null),fi(t,r,a,o),mi(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var u=t.memoizedProps,h=Yo(n,u);a.props=h;var k=a.context,j=n.contextType;i=ba,typeof j=="object"&&j!==null&&(i=on(j));var $=n.getDerivedStateFromProps;j=typeof $=="function"||typeof a.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,j||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u||k!==i)&&Lp(t,a,r,i),so=!1;var S=t.memoizedState;a.state=S,fi(t,r,a,o),mi(),k=t.memoizedState,u||S!==k||so?(typeof $=="function"&&(fu(t,n,$,r),k=t.memoizedState),(h=so||Tp(t,n,h,r,S,k,i))?(j||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=k),a.props=r,a.state=k,a.context=i,r=h):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ul(e,t),i=t.memoizedProps,j=Yo(n,i),a.props=j,$=t.pendingProps,S=a.context,k=n.contextType,h=ba,typeof k=="object"&&k!==null&&(h=on(k)),u=n.getDerivedStateFromProps,(k=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==$||S!==h)&&Lp(t,a,r,h),so=!1,S=t.memoizedState,a.state=S,fi(t,r,a,o),mi();var z=t.memoizedState;i!==$||S!==z||so||e!==null&&e.dependencies!==null&&ts(e.dependencies)?(typeof u=="function"&&(fu(t,n,u,r),z=t.memoizedState),(j=so||Tp(t,n,j,r,S,z,h)||e!==null&&e.dependencies!==null&&ts(e.dependencies))?(k||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,z,h),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,z,h)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=z),a.props=r,a.state=z,a.context=h,r=j):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&S===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,xs(e,t),r=(t.flags&128)!==0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Zo(t,e.child,null,o),t.child=Zo(t,null,n,o)):an(e,t,n,o),t.memoizedState=a.state,e=t.child):e=Rr(e,t,o),e}function Jp(e,t,n,r){return Uo(),t.flags|=256,an(e,t,n,r),t.child}var vu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xu(e){return{baseLanes:e,cachePool:Wc()}}function wu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=$n),e}function Yp(e,t,n){var r=t.pendingProps,o=!1,a=(t.flags&128)!==0,i;if((i=a)||(i=e!==null&&e.memoizedState===null?!1:(jt.current&2)!==0),i&&(o=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ze){if(o?co(t):po(),(e=vt)?(e=lf(e,Xn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ro!==null?{id:yr,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},n=jc(e),n.return=t,t.child=n,rn=t,vt=null)):e=null,e===null)throw ao(t);return rd(e)?t.lanes=32:t.lanes=536870912,null}var u=r.children;return r=r.fallback,o?(po(),o=t.mode,u=ws({mode:"hidden",children:u},o),r=Vo(r,o,n,null),u.return=t,r.return=t,u.sibling=r,t.child=u,r=t.child,r.memoizedState=xu(n),r.childLanes=wu(e,i,n),t.memoizedState=vu,vi(null,r)):(co(t),ku(t,u))}var h=e.memoizedState;if(h!==null&&(u=h.dehydrated,u!==null)){if(a)t.flags&256?(co(t),t.flags&=-257,t=_u(e,t,n)):t.memoizedState!==null?(po(),t.child=e.child,t.flags|=128,t=null):(po(),u=r.fallback,o=t.mode,r=ws({mode:"visible",children:r.children},o),u=Vo(u,o,n,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,Zo(t,e.child,null,n),r=t.child,r.memoizedState=xu(n),r.childLanes=wu(e,i,n),t.memoizedState=vu,t=vi(null,r));else if(co(t),rd(u)){if(i=u.nextSibling&&u.nextSibling.dataset,i)var k=i.dgst;i=k,r=Error(c(419)),r.stack="",r.digest=i,si({value:r,source:null,stack:null}),t=_u(e,t,n)}else if(Ot||wa(e,t,n,!1),i=(n&e.childLanes)!==0,Ot||i){if(i=ft,i!==null&&(r=Ro(i,n),r!==0&&r!==h.retryLane))throw h.retryLane=r,Bo(e,r),Pn(i,e,r),bu;nd(u)||Is(),t=_u(e,t,n)}else nd(u)?(t.flags|=192,t.child=e.child,t=null):(e=h.treeContext,vt=Gn(u.nextSibling),rn=t,Ze=!0,oo=null,Xn=!1,e!==null&&Nc(t,e),t=ku(t,r.children),t.flags|=4096);return t}return o?(po(),u=r.fallback,o=t.mode,h=e.child,k=h.sibling,r=zr(h,{mode:"hidden",children:r.children}),r.subtreeFlags=h.subtreeFlags&65011712,k!==null?u=zr(k,u):(u=Vo(u,o,n,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,vi(null,r),r=t.child,u=e.child.memoizedState,u===null?u=xu(n):(o=u.cachePool,o!==null?(h=Ft._currentValue,o=o.parent!==h?{parent:h,pool:h}:o):o=Wc(),u={baseLanes:u.baseLanes|n,cachePool:o}),r.memoizedState=u,r.childLanes=wu(e,i,n),t.memoizedState=vu,vi(e.child,r)):(co(t),n=e.child,e=n.sibling,n=zr(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function ku(e,t){return t=ws({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ws(e,t){return e=Nn(22,e,null,t),e.lanes=0,e}function _u(e,t,n){return Zo(t,e.child,null,n),e=ku(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function em(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Fl(e.return,t,n)}function Su(e,t,n,r,o,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o,i.treeForkCount=a)}function tm(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;r=r.children;var i=jt.current,u=(i&2)!==0;if(u?(i=i&1|2,t.flags|=128):i&=1,G(jt,i),an(e,t,r,n),r=Ze?ii:0,!u&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&em(e,n,t);else if(e.tag===19)em(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}switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&us(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Su(t,!1,o,n,a,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&us(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Su(t,!0,n,null,a,r);break;case"together":Su(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Rr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ho|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(wa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=zr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=zr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ts(e)))}function Xg(e,t,n){switch(t.tag){case 3:Le(t,t.stateNode.containerInfo),io(t,Ft,e.memoizedState.cache),Uo();break;case 27:case 5:Ne(t);break;case 4:Le(t,t.stateNode.containerInfo);break;case 10:io(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Gl(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(co(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Yp(e,t,n):(co(t),e=Rr(e,t,n),e!==null?e.sibling:null);co(t);break;case 19:var o=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(wa(e,t,n,!1),r=(n&t.childLanes)!==0),o){if(r)return tm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(jt,jt.current),r)break;return null;case 22:return t.lanes=0,qp(e,t,n,t.pendingProps);case 24:io(t,Ft,e.memoizedState.cache)}return Rr(e,t,n)}function nm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!Cu(e,n)&&(t.flags&128)===0)return Ot=!1,Xg(e,t,n);Ot=(e.flags&131072)!==0}else Ot=!1,Ze&&(t.flags&1048576)!==0&&Dc(t,ii,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Xo(t.elementType),t.type=e,typeof e=="function")Il(e)?(r=Yo(e,r),t.tag=1,t=Zp(null,t,e,r,n)):(t.tag=0,t=yu(null,t,e,r,n));else{if(e!=null){var o=e.$$typeof;if(o===ne){t.tag=11,t=Vp(null,t,e,r,n);break e}else if(o===O){t.tag=14,t=Up(null,t,e,r,n);break e}}throw t=xe(e)||e,Error(c(306,t,""))}}return t;case 0:return yu(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,o=Yo(r,t.pendingProps),Zp(e,t,r,o,n);case 3:e:{if(Le(t,t.stateNode.containerInfo),e===null)throw Error(c(387));r=t.pendingProps;var a=t.memoizedState;o=a.element,Ul(e,t),fi(t,r,null,n);var i=t.memoizedState;if(r=i.cache,io(t,Ft,r),r!==a.cache&&$l(t,[Ft],n,!0),mi(),r=i.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Jp(e,t,r,n);break e}else if(r!==o){o=Qn(Error(c(424)),t),si(o),t=Jp(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(vt=Gn(e.firstChild),rn=t,Ze=!0,oo=null,Xn=!0,n=qc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Uo(),r===o){t=Rr(e,t,n);break e}an(e,t,r,n)}t=t.child}return t;case 26:return xs(e,t),e===null?(n=ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ze||(n=t.type,e=t.pendingProps,r=Ls(ye.current).createElement(n),r[Ct]=t,r[Ht]=e,sn(r,n,e),Nt(r),t.stateNode=r):t.memoizedState=ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&Ze&&(r=t.stateNode=cf(t.type,t.pendingProps,ye.current),rn=t,Xn=!0,o=vt,xo(t.type)?(od=o,vt=Gn(r.firstChild)):vt=o),an(e,t,t.pendingProps.children,n),xs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ze&&((o=r=vt)&&(r=C0(r,t.type,t.pendingProps,Xn),r!==null?(t.stateNode=r,rn=t,vt=Gn(r.firstChild),Xn=!1,o=!0):o=!1),o||ao(t)),Ne(t),o=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,r=a.children,Yu(o,a)?r=null:i!==null&&Yu(o,i)&&(t.flags|=32),t.memoizedState!==null&&(o=Jl(e,t,Og,null,null,n),Di._currentValue=o),xs(e,t),an(e,t,r,n),t.child;case 6:return e===null&&Ze&&((e=n=vt)&&(n=E0(n,t.pendingProps,Xn),n!==null?(t.stateNode=n,rn=t,vt=null,e=!0):e=!1),e||ao(t)),null;case 13:return Yp(e,t,n);case 4:return Le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zo(t,null,r,n):an(e,t,r,n),t.child;case 11:return Vp(e,t,t.type,t.pendingProps,n);case 7:return an(e,t,t.pendingProps,n),t.child;case 8:return an(e,t,t.pendingProps.children,n),t.child;case 12:return an(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,io(t,t.type,r.value),an(e,t,r.children,n),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,qo(t),o=on(o),r=r(o),t.flags|=1,an(e,t,r,n),t.child;case 14:return Up(e,t,t.type,t.pendingProps,n);case 15:return Qp(e,t,t.type,t.pendingProps,n);case 19:return tm(e,t,n);case 31:return Kg(e,t,n);case 22:return qp(e,t,n,t.pendingProps);case 24:return qo(t),r=on(Ft),e===null?(o=Hl(),o===null&&(o=ft,a=Ol(),o.pooledCache=a,a.refCount++,a!==null&&(o.pooledCacheLanes|=n),o=a),t.memoizedState={parent:r,cache:o},Vl(t),io(t,Ft,o)):((e.lanes&n)!==0&&(Ul(e,t),fi(t,null,null,n),mi()),o=e.memoizedState,a=t.memoizedState,o.parent!==r?(o={parent:r,cache:r},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),io(t,Ft,r)):(r=a.cache,io(t,Ft,r),r!==o.cache&&$l(t,[Ft],n,!0))),an(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Dr(e){e.flags|=4}function Eu(e,t,n,r,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(Pm())e.flags|=8192;else throw Go=as,Bl}else e.flags&=-16777217}function rm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!vf(t))if(Pm())e.flags|=8192;else throw Go=as,Bl}function ks(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Mo():536870912,e.lanes|=t,Ra|=t)}function xi(e,t){if(!Ze)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 xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&65011712,r|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Gg(e,t,n){var r=t.pendingProps;switch(Dl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(t),null;case 1:return xt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ir(Ft),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(xa(t)?Dr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Tl())),xt(t),null;case 26:var o=t.type,a=t.memoizedState;return e===null?(Dr(t),a!==null?(xt(t),rm(t,a)):(xt(t),Eu(t,o,null,r,n))):a?a!==e.memoizedState?(Dr(t),xt(t),rm(t,a)):(xt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Dr(t),xt(t),Eu(t,o,e,r,n)),null;case 27:if(Be(t),n=ye.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return xt(t),null}e=Y.current,xa(t)?Tc(t):(e=cf(o,r,n),t.stateNode=e,Dr(t))}return xt(t),null;case 5:if(Be(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dr(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return xt(t),null}if(a=Y.current,xa(t))Tc(t);else{var i=Ls(ye.current);switch(a){case 1:a=i.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:a=i.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":a=i.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":a=i.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":a=i.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is=="string"?i.createElement(o,{is:r.is}):i.createElement(o)}}a[Ct]=t,a[Ht]=r;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)a.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=a;e:switch(sn(a,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Dr(t)}}return xt(t),Eu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dr(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(c(166));if(e=ye.current,xa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,o=rn,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Ym(e.nodeValue,n)),e||ao(t,!0)}else e=Ls(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return xt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=xa(t),n!==null){if(e===null){if(!r)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Ct]=t}else Uo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else n=Tl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ln(t),t):(Ln(t),null);if((t.flags&128)!==0)throw Error(c(558))}return xt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=xa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[Ct]=t}else Uo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),o=!1}else o=Tl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Ln(t),t):(Ln(t),null)}return Ln(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==o&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ks(t,t.updateQueue),xt(t),null);case 4:return De(),e===null&&Ku(t.stateNode.containerInfo),xt(t),null;case 10:return Ir(t.type),xt(t),null;case 19:if(P(jt),r=t.memoizedState,r===null)return xt(t),null;if(o=(t.flags&128)!==0,a=r.rendering,a===null)if(o)xi(r,!1);else{if(Pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=us(e),a!==null){for(t.flags|=128,xi(r,!1),e=a.updateQueue,t.updateQueue=e,ks(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Mc(n,e),n=n.sibling;return G(jt,jt.current&1|2),Ze&&Ar(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Je()>zs&&(t.flags|=128,o=!0,xi(r,!1),t.lanes=4194304)}else{if(!o)if(e=us(a),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,ks(t,e),xi(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!Ze)return xt(t),null}else 2*Je()-r.renderingStartTime>zs&&n!==536870912&&(t.flags|=128,o=!0,xi(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e!==null?e.sibling=a:t.child=a,r.last=a)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Je(),e.sibling=null,n=jt.current,G(jt,o?n&1|2:n&1),Ze&&Ar(t,r.treeForkCount),e):(xt(t),null);case 22:case 23:return Ln(t),Xl(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),n=t.updateQueue,n!==null&&ks(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&P(Ko),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ir(Ft),xt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Zg(e,t){switch(Dl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ir(Ft),De(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Be(t),null;case 31:if(t.memoizedState!==null){if(Ln(t),t.alternate===null)throw Error(c(340));Uo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ln(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Uo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(jt),null;case 4:return De(),null;case 10:return Ir(t.type),null;case 22:case 23:return Ln(t),Xl(),e!==null&&P(Ko),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ir(Ft),null;case 25:return null;default:return null}}function om(e,t){switch(Dl(t),t.tag){case 3:Ir(Ft),De();break;case 26:case 27:case 5:Be(t);break;case 4:De();break;case 31:t.memoizedState!==null&&Ln(t);break;case 13:Ln(t);break;case 19:P(jt);break;case 10:Ir(t.type);break;case 22:case 23:Ln(t),Xl(),e!==null&&P(Ko);break;case 24:Ir(Ft)}}function wi(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&e)===e){r=void 0;var a=n.create,i=n.inst;r=a(),i.destroy=r}n=n.next}while(n!==o)}}catch(u){ut(t,t.return,u)}}function mo(e,t,n){try{var r=t.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var a=o.next;r=a;do{if((r.tag&e)===e){var i=r.inst,u=i.destroy;if(u!==void 0){i.destroy=void 0,o=t;var h=n,k=u;try{k()}catch(j){ut(o,h,j)}}}r=r.next}while(r!==a)}}catch(j){ut(t,t.return,j)}}function am(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xc(t,n)}catch(r){ut(e,e.return,r)}}}function im(e,t,n){n.props=Yo(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){ut(e,t,r)}}function ki(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(o){ut(e,t,o)}}function xr(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(o){ut(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){ut(e,t,o)}else n.current=null}function sm(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(o){ut(e,e.return,o)}}function zu(e,t,n){try{var r=e.stateNode;v0(r,e.type,n,t),r[Ht]=t}catch(o){ut(e,e.return,o)}}function lm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xo(e.type)||e.tag===4}function Au(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lm(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.tag===27&&xo(e.type)||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 Pu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=kn));else if(r!==4&&(r===27&&xo(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Pu(e,t,n),e=e.sibling;e!==null;)Pu(e,t,n),e=e.sibling}function _s(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&&(r===27&&xo(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(_s(e,t,n),e=e.sibling;e!==null;)_s(e,t,n),e=e.sibling}function um(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);sn(t,r,n),t[Ct]=e,t[Ht]=n}catch(a){ut(e,e.return,a)}}var Nr=!1,Wt=!1,Iu=!1,dm=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function Jg(e,t){if(e=e.containerInfo,Zu=Vs,e=kc(e),_l(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var i=0,u=-1,h=-1,k=0,j=0,$=e,S=null;t:for(;;){for(var z;$!==n||o!==0&&$.nodeType!==3||(u=i+o),$!==a||r!==0&&$.nodeType!==3||(h=i+r),$.nodeType===3&&(i+=$.nodeValue.length),(z=$.firstChild)!==null;)S=$,$=z;for(;;){if($===e)break t;if(S===n&&++k===o&&(u=i),S===a&&++j===r&&(h=i),(z=$.nextSibling)!==null)break;$=S,S=$.parentNode}$=z}n=u===-1||h===-1?null:{start:u,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ju={focusedElem:e,selectionRange:n},Vs=!1,Zt=t;Zt!==null;)if(t=Zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Zt=e;else for(;Zt!==null;){switch(t=Zt,a=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)o=e[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&a!==null){e=void 0,n=t,o=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var de=Yo(n.type,o);e=r.getSnapshotBeforeUpdate(de,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(Se){ut(n,n.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)td(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":td(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Zt=e;break}Zt=t.return}}function cm(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lr(e,n),r&4&&wi(5,n);break;case 1:if(Lr(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){ut(n,n.return,i)}else{var o=Yo(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){ut(n,n.return,i)}}r&64&&am(n),r&512&&ki(n,n.return);break;case 3:if(Lr(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Xc(e,t)}catch(i){ut(n,n.return,i)}}break;case 27:t===null&&r&4&&um(n);case 26:case 5:Lr(e,n),t===null&&r&4&&sm(n),r&512&&ki(n,n.return);break;case 12:Lr(e,n);break;case 31:Lr(e,n),r&4&&fm(e,n);break;case 13:Lr(e,n),r&4&&hm(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=s0.bind(null,n),z0(e,n))));break;case 22:if(r=n.memoizedState!==null||Nr,!r){t=t!==null&&t.memoizedState!==null||Wt,o=Nr;var a=Wt;Nr=r,(Wt=t)&&!a?Fr(e,n,(n.subtreeFlags&8772)!==0):Lr(e,n),Nr=o,Wt=a}break;case 30:break;default:Lr(e,n)}}function pm(e){var t=e.alternate;t!==null&&(e.alternate=null,pm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&qa(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var _t=null,Cn=!1;function Tr(e,t,n){for(n=n.child;n!==null;)mm(e,t,n),n=n.sibling}function mm(e,t,n){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(Xt,n)}catch{}switch(n.tag){case 26:Wt||xr(n,t),Tr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Wt||xr(n,t);var r=_t,o=Cn;xo(n.type)&&(_t=n.stateNode,Cn=!1),Tr(e,t,n),Mi(n.stateNode),_t=r,Cn=o;break;case 5:Wt||xr(n,t);case 6:if(r=_t,o=Cn,_t=null,Tr(e,t,n),_t=r,Cn=o,_t!==null)if(Cn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(n.stateNode)}catch(a){ut(n,t,a)}else try{_t.removeChild(n.stateNode)}catch(a){ut(n,t,a)}break;case 18:_t!==null&&(Cn?(e=_t,af(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wa(e)):af(_t,n.stateNode));break;case 4:r=_t,o=Cn,_t=n.stateNode.containerInfo,Cn=!0,Tr(e,t,n),_t=r,Cn=o;break;case 0:case 11:case 14:case 15:mo(2,n,t),Wt||mo(4,n,t),Tr(e,t,n);break;case 1:Wt||(xr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&im(n,t,r)),Tr(e,t,n);break;case 21:Tr(e,t,n);break;case 22:Wt=(r=Wt)||n.memoizedState!==null,Tr(e,t,n),Wt=r;break;default:Tr(e,t,n)}}function fm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wa(e)}catch(n){ut(t,t.return,n)}}}function hm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wa(e)}catch(n){ut(t,t.return,n)}}function Yg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dm),t;default:throw Error(c(435,e.tag))}}function Ss(e,t){var n=Yg(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var o=l0.bind(null,e,r);r.then(o,o)}})}function En(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r],a=e,i=t,u=i;e:for(;u!==null;){switch(u.tag){case 27:if(xo(u.type)){_t=u.stateNode,Cn=!1;break e}break;case 5:_t=u.stateNode,Cn=!1;break e;case 3:case 4:_t=u.stateNode.containerInfo,Cn=!0;break e}u=u.return}if(_t===null)throw Error(c(160));mm(a,i,o),_t=null,Cn=!1,a=o.alternate,a!==null&&(a.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gm(t,e),t=t.sibling}var lr=null;function gm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:En(t,e),zn(e),r&4&&(mo(3,e,e.return),wi(3,e),mo(5,e,e.return));break;case 1:En(t,e),zn(e),r&512&&(Wt||n===null||xr(n,n.return)),r&64&&Nr&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var o=lr;if(En(t,e),zn(e),r&512&&(Wt||n===null||xr(n,n.return)),r&4){var a=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(r){case"title":a=o.getElementsByTagName("title")[0],(!a||a[kr]||a[Ct]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=o.createElement(r),o.head.insertBefore(a,o.querySelector("head > title"))),sn(a,r,n),a[Ct]=e,Nt(a),r=a;break e;case"link":var i=bf("link","href",o).get(r+(n.href||""));if(i){for(var u=0;u<i.length;u++)if(a=i[u],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(u,1);break t}}a=o.createElement(r),sn(a,r,n),o.head.appendChild(a);break;case"meta":if(i=bf("meta","content",o).get(r+(n.content||""))){for(u=0;u<i.length;u++)if(a=i[u],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(u,1);break t}}a=o.createElement(r),sn(a,r,n),o.head.appendChild(a);break;default:throw Error(c(468,r))}a[Ct]=e,Nt(a),r=a}e.stateNode=r}else yf(o,e.type,e.stateNode);else e.stateNode=gf(o,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?yf(o,e.type,e.stateNode):gf(o,r,e.memoizedProps)):r===null&&e.stateNode!==null&&zu(e,e.memoizedProps,n.memoizedProps)}break;case 27:En(t,e),zn(e),r&512&&(Wt||n===null||xr(n,n.return)),n!==null&&r&4&&zu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(En(t,e),zn(e),r&512&&(Wt||n===null||xr(n,n.return)),e.flags&32){o=e.stateNode;try{gr(o,"")}catch(de){ut(e,e.return,de)}}r&4&&e.stateNode!=null&&(o=e.memoizedProps,zu(e,o,n!==null?n.memoizedProps:o)),r&1024&&(Iu=!0);break;case 6:if(En(t,e),zn(e),r&4){if(e.stateNode===null)throw Error(c(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(de){ut(e,e.return,de)}}break;case 3:if(Os=null,o=lr,lr=Fs(t.containerInfo),En(t,e),lr=o,zn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Wa(t.containerInfo)}catch(de){ut(e,e.return,de)}Iu&&(Iu=!1,bm(e));break;case 4:r=lr,lr=Fs(e.stateNode.containerInfo),En(t,e),zn(e),lr=r;break;case 12:En(t,e),zn(e);break;case 31:En(t,e),zn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ss(e,r)));break;case 13:En(t,e),zn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Es=Je()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ss(e,r)));break;case 22:o=e.memoizedState!==null;var h=n!==null&&n.memoizedState!==null,k=Nr,j=Wt;if(Nr=k||o,Wt=j||h,En(t,e),Wt=j,Nr=k,zn(e),r&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||h||Nr||Wt||ea(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){h=n=t;try{if(a=h.stateNode,o)i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{u=h.stateNode;var $=h.memoizedProps.style,S=$!=null&&$.hasOwnProperty("display")?$.display:null;u.style.display=S==null||typeof S=="boolean"?"":(""+S).trim()}}catch(de){ut(h,h.return,de)}}}else if(t.tag===6){if(n===null){h=t;try{h.stateNode.nodeValue=o?"":h.memoizedProps}catch(de){ut(h,h.return,de)}}}else if(t.tag===18){if(n===null){h=t;try{var z=h.stateNode;o?sf(z,!0):sf(h.stateNode,!1)}catch(de){ut(h,h.return,de)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Ss(e,n))));break;case 19:En(t,e),zn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ss(e,r)));break;case 30:break;case 21:break;default:En(t,e),zn(e)}}function zn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(lm(r)){n=r;break}r=r.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var o=n.stateNode,a=Au(e);_s(e,a,o);break;case 5:var i=n.stateNode;n.flags&32&&(gr(i,""),n.flags&=-33);var u=Au(e);_s(e,u,i);break;case 3:case 4:var h=n.stateNode.containerInfo,k=Au(e);Pu(e,k,h);break;default:throw Error(c(161))}}catch(j){ut(e,e.return,j)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Lr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cm(e,t.alternate,t),t=t.sibling}function ea(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:mo(4,t,t.return),ea(t);break;case 1:xr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&im(t,t.return,n),ea(t);break;case 27:Mi(t.stateNode);case 26:case 5:xr(t,t.return),ea(t);break;case 22:t.memoizedState===null&&ea(t);break;case 30:ea(t);break;default:ea(t)}e=e.sibling}}function Fr(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,o=e,a=t,i=a.flags;switch(a.tag){case 0:case 11:case 15:Fr(o,a,n),wi(4,a);break;case 1:if(Fr(o,a,n),r=a,o=r.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(k){ut(r,r.return,k)}if(r=a,o=r.updateQueue,o!==null){var u=r.stateNode;try{var h=o.shared.hiddenCallbacks;if(h!==null)for(o.shared.hiddenCallbacks=null,o=0;o<h.length;o++)Kc(h[o],u)}catch(k){ut(r,r.return,k)}}n&&i&64&&am(a),ki(a,a.return);break;case 27:um(a);case 26:case 5:Fr(o,a,n),n&&r===null&&i&4&&sm(a),ki(a,a.return);break;case 12:Fr(o,a,n);break;case 31:Fr(o,a,n),n&&i&4&&fm(o,a);break;case 13:Fr(o,a,n),n&&i&4&&hm(o,a);break;case 22:a.memoizedState===null&&Fr(o,a,n),ki(a,a.return);break;case 30:break;default:Fr(o,a,n)}t=t.sibling}}function Mu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&li(n))}function ju(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&li(e))}function ur(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ym(e,t,n,r),t=t.sibling}function ym(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:ur(e,t,n,r),o&2048&&wi(9,t);break;case 1:ur(e,t,n,r);break;case 3:ur(e,t,n,r),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&li(e)));break;case 12:if(o&2048){ur(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,i=a.id,u=a.onPostCommit;typeof u=="function"&&u(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(h){ut(t,t.return,h)}}else ur(e,t,n,r);break;case 31:ur(e,t,n,r);break;case 13:ur(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,i=t.alternate,t.memoizedState!==null?a._visibility&2?ur(e,t,n,r):_i(e,t):a._visibility&2?ur(e,t,n,r):(a._visibility|=2,Ia(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Mu(i,t);break;case 24:ur(e,t,n,r),o&2048&&ju(t.alternate,t);break;default:ur(e,t,n,r)}}function Ia(e,t,n,r,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,i=t,u=n,h=r,k=i.flags;switch(i.tag){case 0:case 11:case 15:Ia(a,i,u,h,o),wi(8,i);break;case 23:break;case 22:var j=i.stateNode;i.memoizedState!==null?j._visibility&2?Ia(a,i,u,h,o):_i(a,i):(j._visibility|=2,Ia(a,i,u,h,o)),o&&k&2048&&Mu(i.alternate,i);break;case 24:Ia(a,i,u,h,o),o&&k&2048&&ju(i.alternate,i);break;default:Ia(a,i,u,h,o)}t=t.sibling}}function _i(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,o=r.flags;switch(r.tag){case 22:_i(n,r),o&2048&&Mu(r.alternate,r);break;case 24:_i(n,r),o&2048&&ju(r.alternate,r);break;default:_i(n,r)}t=t.sibling}}var Si=8192;function Ma(e,t,n){if(e.subtreeFlags&Si)for(e=e.child;e!==null;)vm(e,t,n),e=e.sibling}function vm(e,t,n){switch(e.tag){case 26:Ma(e,t,n),e.flags&Si&&e.memoizedState!==null&&$0(n,lr,e.memoizedState,e.memoizedProps);break;case 5:Ma(e,t,n);break;case 3:case 4:var r=lr;lr=Fs(e.stateNode.containerInfo),Ma(e,t,n),lr=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Si,Si=16777216,Ma(e,t,n),Si=r):Ma(e,t,n));break;default:Ma(e,t,n)}}function xm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ci(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zt=r,km(r,e)}xm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wm(e),e=e.sibling}function wm(e){switch(e.tag){case 0:case 11:case 15:Ci(e),e.flags&2048&&mo(9,e,e.return);break;case 3:Ci(e);break;case 12:Ci(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Cs(e)):Ci(e);break;default:Ci(e)}}function Cs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zt=r,km(r,e)}xm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:mo(8,t,t.return),Cs(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Cs(t));break;default:Cs(t)}e=e.sibling}}function km(e,t){for(;Zt!==null;){var n=Zt;switch(n.tag){case 0:case 11:case 15:mo(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:li(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Zt=r;else e:for(n=e;Zt!==null;){r=Zt;var o=r.sibling,a=r.return;if(pm(r),r===n){Zt=null;break e}if(o!==null){o.return=a,Zt=o;break e}Zt=a}}}var e0={getCacheForType:function(e){var t=on(Ft),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return on(Ft).controller.signal}},t0=typeof WeakMap=="function"?WeakMap:Map,at=0,ft=null,Ue=null,Ke=0,lt=0,Fn=null,fo=!1,ja=!1,Ru=!1,$r=0,Pt=0,ho=0,ta=0,Du=0,$n=0,Ra=0,Ei=null,An=null,Nu=!1,Es=0,_m=0,zs=1/0,As=null,go=null,Qt=0,bo=null,Da=null,Or=0,Tu=0,Lu=null,Sm=null,zi=0,Fu=null;function On(){return(at&2)!==0&&Ke!==0?Ke&-Ke:E.T!==null?Vu():ra()}function Cm(){if($n===0)if((Ke&536870912)===0||Ze){var e=me;me<<=1,(me&3932160)===0&&(me=262144),$n=e}else $n=536870912;return e=Tn.current,e!==null&&(e.flags|=32),$n}function Pn(e,t,n){(e===ft&&(lt===2||lt===9)||e.cancelPendingCommit!==null)&&(Na(e,0),yo(e,Ke,$n,!1)),cr(e,n),((at&2)===0||e!==ft)&&(e===ft&&((at&2)===0&&(ta|=n),Pt===4&&yo(e,Ke,$n,!1)),wr(e))}function Em(e,t,n){if((at&6)!==0)throw Error(c(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||tt(e,t),o=r?o0(e,t):Ou(e,t,!0),a=r;do{if(o===0){ja&&!r&&yo(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!n0(n)){o=Ou(e,t,!1),a=!1;continue}if(o===2){if(a=t,e.errorRecoveryDisabledLanes&a)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var u=e;o=Ei;var h=u.current.memoizedState.isDehydrated;if(h&&(Na(u,i).flags|=256),i=Ou(u,i,!1),i!==2){if(Ru&&!h){u.errorRecoveryDisabledLanes|=a,ta|=a,o=4;break e}a=An,An=o,a!==null&&(An===null?An=a:An.push.apply(An,a))}o=i}if(a=!1,o!==2)continue}}if(o===1){Na(e,0),yo(e,t,0,!0);break}e:{switch(r=e,a=o,a){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:yo(r,t,$n,!fo);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(o=Es+300-Je(),10<o)){if(yo(r,t,$n,!fo),ve(r,0,!0)!==0)break e;Or=t,r.timeoutHandle=rf(zm.bind(null,r,n,An,As,Nu,t,$n,ta,Ra,fo,a,"Throttled",-0,0),o);break e}zm(r,n,An,As,Nu,t,$n,ta,Ra,fo,a,null,-0,0)}}break}while(!0);wr(e)}function zm(e,t,n,r,o,a,i,u,h,k,j,$,S,z){if(e.timeoutHandle=-1,$=t.subtreeFlags,$&8192||($&16785408)===16785408){$={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kn},vm(t,a,$);var de=(a&62914560)===a?Es-Je():(a&4194048)===a?_m-Je():0;if(de=O0($,de),de!==null){Or=a,e.cancelPendingCommit=de(Nm.bind(null,e,t,a,n,r,o,i,u,h,j,$,null,S,z)),yo(e,a,i,!k);return}}Nm(e,t,a,n,r,o,i,u,h)}function n0(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var o=n[r],a=o.getSnapshot;o=o.value;try{if(!Dn(a(),o))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yo(e,t,n,r){t&=~Du,t&=~ta,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var a=31-mt(o),i=1<<a;r[a]=-1,o&=~i}n!==0&&Qr(e,n,t)}function Ps(){return(at&6)===0?(Ai(0),!1):!0}function $u(){if(Ue!==null){if(lt===0)var e=Ue.return;else e=Ue,Pr=Qo=null,tu(e),Ca=null,di=0,e=Ue;for(;e!==null;)om(e.alternate,e),e=e.return;Ue=null}}function Na(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,k0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Or=0,$u(),ft=e,Ue=n=zr(e.current,null),Ke=t,lt=0,Fn=null,fo=!1,ja=tt(e,t),Ru=!1,Ra=$n=Du=ta=ho=Pt=0,An=Ei=null,Nu=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var o=31-mt(r),a=1<<o;t|=e[o],r&=~a}return $r=t,Gi(),n}function Am(e,t){Ie=null,E.H=yi,t===Sa||t===os?(t=Vc(),lt=3):t===Bl?(t=Vc(),lt=4):lt=t===bu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Fn=t,Ue===null&&(Pt=1,ys(e,Qn(t,e.current)))}function Pm(){var e=Tn.current;return e===null?!0:(Ke&4194048)===Ke?sr===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===sr:!1}function Im(){var e=E.H;return E.H=yi,e===null?yi:e}function Mm(){var e=E.A;return E.A=e0,e}function Is(){Pt=4,fo||(Ke&4194048)!==Ke&&Tn.current!==null||(ja=!0),(ho&134217727)===0&&(ta&134217727)===0||ft===null||yo(ft,Ke,$n,!1)}function Ou(e,t,n){var r=at;at|=2;var o=Im(),a=Mm();(ft!==e||Ke!==t)&&(As=null,Na(e,t)),t=!1;var i=Pt;e:do try{if(lt!==0&&Ue!==null){var u=Ue,h=Fn;switch(lt){case 8:$u(),i=6;break e;case 3:case 2:case 9:case 6:Tn.current===null&&(t=!0);var k=lt;if(lt=0,Fn=null,Ta(e,u,h,k),n&&ja){i=0;break e}break;default:k=lt,lt=0,Fn=null,Ta(e,u,h,k)}}r0(),i=Pt;break}catch(j){Am(e,j)}while(!0);return t&&e.shellSuspendCounter++,Pr=Qo=null,at=r,E.H=o,E.A=a,Ue===null&&(ft=null,Ke=0,Gi()),i}function r0(){for(;Ue!==null;)jm(Ue)}function o0(e,t){var n=at;at|=2;var r=Im(),o=Mm();ft!==e||Ke!==t?(As=null,zs=Je()+500,Na(e,t)):ja=tt(e,t);e:do try{if(lt!==0&&Ue!==null){t=Ue;var a=Fn;t:switch(lt){case 1:lt=0,Fn=null,Ta(e,t,a,1);break;case 2:case 9:if(Hc(a)){lt=0,Fn=null,Rm(t);break}t=function(){lt!==2&&lt!==9||ft!==e||(lt=7),wr(e)},a.then(t,t);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:Hc(a)?(lt=0,Fn=null,Rm(t)):(lt=0,Fn=null,Ta(e,t,a,7));break;case 5:var i=null;switch(Ue.tag){case 26:i=Ue.memoizedState;case 5:case 27:var u=Ue;if(i?vf(i):u.stateNode.complete){lt=0,Fn=null;var h=u.sibling;if(h!==null)Ue=h;else{var k=u.return;k!==null?(Ue=k,Ms(k)):Ue=null}break t}}lt=0,Fn=null,Ta(e,t,a,5);break;case 6:lt=0,Fn=null,Ta(e,t,a,6);break;case 8:$u(),Pt=6;break e;default:throw Error(c(462))}}a0();break}catch(j){Am(e,j)}while(!0);return Pr=Qo=null,E.H=r,E.A=o,at=n,Ue!==null?0:(ft=null,Ke=0,Gi(),Pt)}function a0(){for(;Ue!==null&&!Ge();)jm(Ue)}function jm(e){var t=nm(e.alternate,e,$r);e.memoizedProps=e.pendingProps,t===null?Ms(e):Ue=t}function Rm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Gp(n,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=Gp(n,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:tu(t);default:om(n,t),t=Ue=Mc(t,$r),t=nm(n,t,$r)}e.memoizedProps=e.pendingProps,t===null?Ms(e):Ue=t}function Ta(e,t,n,r){Pr=Qo=null,tu(t),Ca=null,di=0;var o=t.return;try{if(qg(e,o,t,n,Ke)){Pt=1,ys(e,Qn(n,e.current)),Ue=null;return}}catch(a){if(o!==null)throw Ue=o,a;Pt=1,ys(e,Qn(n,e.current)),Ue=null;return}t.flags&32768?(Ze||r===1?e=!0:ja||(Ke&536870912)!==0?e=!1:(fo=e=!0,(r===2||r===9||r===3||r===6)&&(r=Tn.current,r!==null&&r.tag===13&&(r.flags|=16384))),Dm(t,e)):Ms(t)}function Ms(e){var t=e;do{if((t.flags&32768)!==0){Dm(t,fo);return}e=t.return;var n=Gg(t.alternate,t,$r);if(n!==null){Ue=n;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);Pt===0&&(Pt=5)}function Dm(e,t){do{var n=Zg(e.alternate,e);if(n!==null){n.flags&=32767,Ue=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ue=e;return}Ue=e=n}while(e!==null);Pt=6,Ue=null}function Nm(e,t,n,r,o,a,i,u,h){e.cancelPendingCommit=null;do js();while(Qt!==0);if((at&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(a=t.lanes|t.childLanes,a|=Al,jo(e,n,a,i,u,h),e===ft&&(Ue=ft=null,Ke=0),Da=t,bo=e,Or=n,Tu=a,Lu=o,Sm=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,u0(Kt,function(){return Om(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=E.T,E.T=null,o=V.p,V.p=2,i=at,at|=4;try{Jg(e,t,n)}finally{at=i,V.p=o,E.T=r}}Qt=1,Tm(),Lm(),Fm()}}function Tm(){if(Qt===1){Qt=0;var e=bo,t=Da,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=E.T,E.T=null;var r=V.p;V.p=2;var o=at;at|=4;try{gm(t,e);var a=Ju,i=kc(e.containerInfo),u=a.focusedElem,h=a.selectionRange;if(i!==u&&u&&u.ownerDocument&&wc(u.ownerDocument.documentElement,u)){if(h!==null&&_l(u)){var k=h.start,j=h.end;if(j===void 0&&(j=k),"selectionStart"in u)u.selectionStart=k,u.selectionEnd=Math.min(j,u.value.length);else{var $=u.ownerDocument||document,S=$&&$.defaultView||window;if(S.getSelection){var z=S.getSelection(),de=u.textContent.length,Se=Math.min(h.start,de),pt=h.end===void 0?Se:Math.min(h.end,de);!z.extend&&Se>pt&&(i=pt,pt=Se,Se=i);var b=xc(u,Se),g=xc(u,pt);if(b&&g&&(z.rangeCount!==1||z.anchorNode!==b.node||z.anchorOffset!==b.offset||z.focusNode!==g.node||z.focusOffset!==g.offset)){var w=$.createRange();w.setStart(b.node,b.offset),z.removeAllRanges(),Se>pt?(z.addRange(w),z.extend(g.node,g.offset)):(w.setEnd(g.node,g.offset),z.addRange(w))}}}}for($=[],z=u;z=z.parentNode;)z.nodeType===1&&$.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<$.length;u++){var T=$[u];T.element.scrollLeft=T.left,T.element.scrollTop=T.top}}Vs=!!Zu,Ju=Zu=null}finally{at=o,V.p=r,E.T=n}}e.current=t,Qt=2}}function Lm(){if(Qt===2){Qt=0;var e=bo,t=Da,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=E.T,E.T=null;var r=V.p;V.p=2;var o=at;at|=4;try{cm(e,t.alternate,t)}finally{at=o,V.p=r,E.T=n}}Qt=3}}function Fm(){if(Qt===4||Qt===3){Qt=0,K();var e=bo,t=Da,n=Or,r=Sm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Qt=5:(Qt=0,Da=bo=null,$m(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(go=null),hn(n),t=t.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=E.T,o=V.p,V.p=2,E.T=null;try{for(var a=e.onRecoverableError,i=0;i<r.length;i++){var u=r[i];a(u.value,{componentStack:u.stack})}}finally{E.T=t,V.p=o}}(Or&3)!==0&&js(),wr(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===Fu?zi++:(zi=0,Fu=e):zi=0,Ai(0)}}function $m(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,li(t)))}function js(){return Tm(),Lm(),Fm(),Om()}function Om(){if(Qt!==5)return!1;var e=bo,t=Tu;Tu=0;var n=hn(Or),r=E.T,o=V.p;try{V.p=32>n?32:n,E.T=null,n=Lu,Lu=null;var a=bo,i=Or;if(Qt=0,Da=bo=null,Or=0,(at&6)!==0)throw Error(c(331));var u=at;if(at|=4,wm(a.current),ym(a,a.current,i,n),at=u,Ai(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(Xt,a)}catch{}return!0}finally{V.p=o,E.T=r,$m(e,t)}}function Wm(e,t,n){t=Qn(n,t),t=gu(e.stateNode,t,2),e=uo(e,t,2),e!==null&&(cr(e,2),wr(e))}function ut(e,t,n){if(e.tag===3)Wm(e,e,n);else for(;t!==null;){if(t.tag===3){Wm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(go===null||!go.has(r))){e=Qn(n,e),n=Hp(2),r=uo(t,n,2),r!==null&&(Bp(n,r,t,e),cr(r,2),wr(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new t0;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(Ru=!0,o.add(n),e=i0.bind(null,e,t,n),t.then(e,e))}function i0(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ft===e&&(Ke&n)===n&&(Pt===4||Pt===3&&(Ke&62914560)===Ke&&300>Je()-Es?(at&2)===0&&Na(e,0):Du|=n,Ra===Ke&&(Ra=0)),wr(e)}function Hm(e,t){t===0&&(t=Mo()),e=Bo(e,t),e!==null&&(cr(e,t),wr(e))}function s0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Hm(e,n)}function l0(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(c(314))}r!==null&&r.delete(t),Hm(e,n)}function u0(e,t){return X(e,t)}var Rs=null,La=null,Hu=!1,Ds=!1,Bu=!1,vo=0;function wr(e){e!==La&&e.next===null&&(La===null?Rs=La=e:La=La.next=e),Ds=!0,Hu||(Hu=!0,c0())}function Ai(e,t){if(!Bu&&Ds){Bu=!0;do for(var n=!1,r=Rs;r!==null;){if(e!==0){var o=r.pendingLanes;if(o===0)var a=0;else{var i=r.suspendedLanes,u=r.pingedLanes;a=(1<<31-mt(42|e)+1)-1,a&=o&~(i&~u),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Qm(r,a))}else a=Ke,a=ve(r,r===ft?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(a&3)===0||tt(r,a)||(n=!0,Qm(r,a));r=r.next}while(n);Bu=!1}}function d0(){Bm()}function Bm(){Ds=Hu=!1;var e=0;vo!==0&&w0()&&(e=vo);for(var t=Je(),n=null,r=Rs;r!==null;){var o=r.next,a=Vm(r,t);a===0?(r.next=null,n===null?Rs=o:n.next=o,o===null&&(La=n)):(n=r,(e!==0||(a&3)!==0)&&(Ds=!0)),r=o}Qt!==0&&Qt!==5||Ai(e),vo!==0&&(vo=0)}function Vm(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var i=31-mt(a),u=1<<i,h=o[i];h===-1?((u&n)===0||(u&r)!==0)&&(o[i]=Jt(u,t)):h<=t&&(e.expiredLanes|=u),a&=~u}if(t=ft,n=Ke,n=ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(lt===2||lt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ve(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||tt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ve(r),hn(n)){case 2:case 8:n=it;break;case 32:n=Kt;break;case 268435456:n=Io;break;default:n=Kt}return r=Um.bind(null,e),n=X(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ve(r),e.callbackPriority=2,e.callbackNode=null,2}function Um(e,t){if(Qt!==0&&Qt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(js()&&e.callbackNode!==n)return null;var r=Ke;return r=ve(e,e===ft?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Em(e,r,t),Vm(e,Je()),e.callbackNode!=null&&e.callbackNode===n?Um.bind(null,e):null)}function Qm(e,t){if(js())return null;Em(e,t,!0)}function c0(){_0(function(){(at&6)!==0?X(un,d0):Bm()})}function Vu(){if(vo===0){var e=ka;e===0&&(e=mn,mn<<=1,(mn&261888)===0&&(mn=256)),vo=e}return vo}function qm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:br(""+e)}function Km(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function p0(e,t,n,r,o){if(t==="submit"&&n&&n.stateNode===o){var a=qm((o[Ht]||null).action),i=r.submitter;i&&(t=(t=i[Ht]||null)?qm(t.formAction):i.getAttribute("formAction"),t!==null&&(a=t,i=null));var u=new Lo("action","action",null,r,o);e.push({event:u,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(vo!==0){var h=i?Km(o,i):new FormData(o);du(n,{pending:!0,data:h,method:o.method,action:a},null,h)}}else typeof a=="function"&&(u.preventDefault(),h=i?Km(o,i):new FormData(o),du(n,{pending:!0,data:h,method:o.method,action:a},a,h))},currentTarget:o}]})}}for(var Uu=0;Uu<zl.length;Uu++){var Qu=zl[Uu],m0=Qu.toLowerCase(),f0=Qu[0].toUpperCase()+Qu.slice(1);ir(m0,"on"+f0)}ir(Cc,"onAnimationEnd"),ir(Ec,"onAnimationIteration"),ir(zc,"onAnimationStart"),ir("dblclick","onDoubleClick"),ir("focusin","onFocus"),ir("focusout","onBlur"),ir(Ig,"onTransitionRun"),ir(Mg,"onTransitionStart"),ir(jg,"onTransitionCancel"),ir(Ac,"onTransitionEnd"),_r("onMouseEnter",["mouseout","mouseover"]),_r("onMouseLeave",["mouseout","mouseover"]),_r("onPointerEnter",["pointerout","pointerover"]),_r("onPointerLeave",["pointerout","pointerover"]),fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fr("onBeforeInput",["compositionend","keypress","textInput","paste"]),fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pi="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(" "),h0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pi));function Xm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var u=r[i],h=u.instance,k=u.currentTarget;if(u=u.listener,h!==a&&o.isPropagationStopped())break e;a=u,o.currentTarget=k;try{a(o)}catch(j){Xi(j)}o.currentTarget=null,a=h}else for(i=0;i<r.length;i++){if(u=r[i],h=u.instance,k=u.currentTarget,u=u.listener,h!==a&&o.isPropagationStopped())break e;a=u,o.currentTarget=k;try{a(o)}catch(j){Xi(j)}o.currentTarget=null,a=h}}}}function Qe(e,t){var n=t[oa];n===void 0&&(n=t[oa]=new Set);var r=e+"__bubble";n.has(r)||(Gm(t,e,2,!1),n.add(r))}function qu(e,t,n){var r=0;t&&(r|=4),Gm(n,e,r,t)}var Ns="_reactListening"+Math.random().toString(36).slice(2);function Ku(e){if(!e[Ns]){e[Ns]=!0,Yt.forEach(function(n){n!=="selectionchange"&&(h0.has(n)||qu(n,!1,e),qu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ns]||(t[Ns]=!0,qu("selectionchange",!1,t))}}function Gm(e,t,n,r){switch(Ef(t)){case 2:var o=B0;break;case 8:o=V0;break;default:o=ud}n=o.bind(null,t,n,e),o=void 0,!wt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Xu(e,t,n,r,o){var a=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var u=r.stateNode.containerInfo;if(u===o)break;if(i===4)for(i=r.return;i!==null;){var h=i.tag;if((h===3||h===4)&&i.stateNode.containerInfo===o)return;i=i.return}for(;u!==null;){if(i=mr(u),i===null)return;if(h=i.tag,h===5||h===6||h===26||h===27){r=a=i;continue e}u=u.parentNode}}r=r.return}pa(function(){var k=a,j=et(n),$=[];e:{var S=Pc.get(e);if(S!==void 0){var z=Lo,de=e;switch(e){case"keypress":if(Hn(n)===0)break e;case"keydown":case"keyup":z=D;break;case"focusin":de="focus",z=ma;break;case"focusout":de="blur",z=ma;break;case"beforeblur":case"afterblur":z=ma;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":z=Ya;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=ml;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=Ye;break;case Cc:case Ec:case zc:z=gl;break;case Ac:z=Lt;break;case"scroll":case"scrollend":z=no;break;case"wheel":z=We;break;case"copy":case"cut":case"paste":z=Ui;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=Z;break;case"toggle":case"beforetoggle":z=Gt}var Se=(t&4)!==0,pt=!Se&&(e==="scroll"||e==="scrollend"),b=Se?S!==null?S+"Capture":null:S;Se=[];for(var g=k,w;g!==null;){var T=g;if(w=T.stateNode,T=T.tag,T!==5&&T!==26&&T!==27||w===null||b===null||(T=ar(g,b),T!=null&&Se.push(Ii(g,T,w))),pt)break;g=g.return}0<Se.length&&(S=new z(S,de,null,n,j),$.push({event:S,listeners:Se}))}}if((t&7)===0){e:{if(S=e==="mouseover"||e==="pointerover",z=e==="mouseout"||e==="pointerout",S&&n!==da&&(de=n.relatedTarget||n.fromElement)&&(mr(de)||de[pr]))break e;if((z||S)&&(S=j.window===j?j:(S=j.ownerDocument)?S.defaultView||S.parentWindow:window,z?(de=n.relatedTarget||n.toElement,z=k,de=de?mr(de):null,de!==null&&(pt=M(de),Se=de.tag,de!==pt||Se!==5&&Se!==27&&Se!==6)&&(de=null)):(z=null,de=k),z!==de)){if(Se=Ya,T="onMouseLeave",b="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Z,T="onPointerLeave",b="onPointerEnter",g="pointer"),pt=z==null?S:cn(z),w=de==null?S:cn(de),S=new Se(T,g+"leave",z,n,j),S.target=pt,S.relatedTarget=w,T=null,mr(j)===k&&(Se=new Se(b,g+"enter",de,n,j),Se.target=w,Se.relatedTarget=pt,T=Se),pt=T,z&&de)t:{for(Se=g0,b=z,g=de,w=0,T=b;T;T=Se(T))w++;T=0;for(var we=g;we;we=Se(we))T++;for(;0<w-T;)b=Se(b),w--;for(;0<T-w;)g=Se(g),T--;for(;w--;){if(b===g||g!==null&&b===g.alternate){Se=b;break t}b=Se(b),g=Se(g)}Se=null}else Se=null;z!==null&&Zm($,S,z,Se,!1),de!==null&&pt!==null&&Zm($,pt,de,Se,!0)}}e:{if(S=k?cn(k):window,z=S.nodeName&&S.nodeName.toLowerCase(),z==="select"||z==="input"&&S.type==="file")var nt=fc;else if(pc(S))if(hc)nt=zg;else{nt=Cg;var he=Sg}else z=S.nodeName,!z||z.toLowerCase()!=="input"||S.type!=="checkbox"&&S.type!=="radio"?k&&Zr(k.elementType)&&(nt=fc):nt=Eg;if(nt&&(nt=nt(e,k))){mc($,nt,n,j);break e}he&&he(e,S,k),e==="focusout"&&k&&S.type==="number"&&k.memoizedProps.value!=null&&ua(S,"number",S.value)}switch(he=k?cn(k):window,e){case"focusin":(pc(he)||he.contentEditable==="true")&&(fa=he,Sl=k,ai=null);break;case"focusout":ai=Sl=fa=null;break;case"mousedown":Cl=!0;break;case"contextmenu":case"mouseup":case"dragend":Cl=!1,_c($,n,j);break;case"selectionchange":if(Pg)break;case"keydown":case"keyup":_c($,n,j)}var Re;if(Ut)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else St?st(e,n)&&(Xe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Xe="onCompositionStart");Xe&&(Ce&&n.locale!=="ko"&&(St||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&St&&(Re=Tt()):(Mt=j,Ja="value"in Mt?Mt.value:Mt.textContent,St=!0)),he=Ts(k,Xe),0<he.length&&(Xe=new Qi(Xe,e,null,n,j),$.push({event:Xe,listeners:he}),Re?Xe.data=Re:(Re=Sn(n),Re!==null&&(Xe.data=Re)))),(Re=Vn?nn(e,n):gt(e,n))&&(Xe=Ts(k,"onBeforeInput"),0<Xe.length&&(he=new Qi("onBeforeInput","beforeinput",null,n,j),$.push({event:he,listeners:Xe}),he.data=Re)),p0($,e,k,n,j)}Xm($,t)})}function Ii(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ts(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,a=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||a===null||(o=ar(e,n),o!=null&&r.unshift(Ii(e,o,a)),o=ar(e,t),o!=null&&r.push(Ii(e,o,a))),e.tag===3)return r;e=e.return}return[]}function g0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zm(e,t,n,r,o){for(var a=t._reactName,i=[];n!==null&&n!==r;){var u=n,h=u.alternate,k=u.stateNode;if(u=u.tag,h!==null&&h===r)break;u!==5&&u!==26&&u!==27||k===null||(h=k,o?(k=ar(n,a),k!=null&&i.unshift(Ii(n,k,h))):o||(k=ar(n,a),k!=null&&i.push(Ii(n,k,h)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var b0=/\r\n?/g,y0=/\u0000|\uFFFD/g;function Jm(e){return(typeof e=="string"?e:""+e).replace(b0,`
41
+ `).replace(y0,"")}function Ym(e,t){return t=Jm(t),Jm(e)===t}function ct(e,t,n,r,o,a){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||gr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&gr(e,""+r);break;case"className":tr(e,"class",r);break;case"tabIndex":tr(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":tr(e,n,r);break;case"style":No(e,r,a);break;case"data":if(t!=="object"){tr(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=br(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(t!=="input"&&ct(e,t,"name",o.name,o,null),ct(e,t,"formEncType",o.formEncType,o,null),ct(e,t,"formMethod",o.formMethod,o,null),ct(e,t,"formTarget",o.formTarget,o,null)):(ct(e,t,"encType",o.encType,o,null),ct(e,t,"method",o.method,o,null),ct(e,t,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=br(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=kn);break;case"onScroll":r!=null&&Qe("scroll",e);break;case"onScrollEnd":r!=null&&Qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(c(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=br(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Qe("beforetoggle",e),Qe("toggle",e),wn(e,"popover",r);break;case"xlinkActuate":nr(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":nr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":nr(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":nr(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":nr(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":nr(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":nr(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":nr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":nr(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":wn(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Bt.get(n)||n,wn(e,n,r))}}function Gu(e,t,n,r,o,a){switch(n){case"style":No(e,r,a);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(c(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof r=="string"?gr(e,r):(typeof r=="number"||typeof r=="bigint")&&gr(e,""+r);break;case"onScroll":r!=null&&Qe("scroll",e);break;case"onScrollEnd":r!=null&&Qe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sa.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),a=e[Ht]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,o),typeof r=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,o);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):wn(e,n,r)}}}function sn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",e),Qe("load",e);var r=!1,o=!1,a;for(a in n)if(n.hasOwnProperty(a)){var i=n[a];if(i!=null)switch(a){case"src":r=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:ct(e,t,a,i,n,null)}}o&&ct(e,t,"srcSet",n.srcSet,n,null),r&&ct(e,t,"src",n.src,n,null);return;case"input":Qe("invalid",e);var u=a=i=o=null,h=null,k=null;for(r in n)if(n.hasOwnProperty(r)){var j=n[r];if(j!=null)switch(r){case"name":o=j;break;case"type":i=j;break;case"checked":h=j;break;case"defaultChecked":k=j;break;case"value":a=j;break;case"defaultValue":u=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(c(137,t));break;default:ct(e,t,r,j,n,null)}}rr(e,a,u,h,k,i,o,!1);return;case"select":Qe("invalid",e),r=i=a=null;for(o in n)if(n.hasOwnProperty(o)&&(u=n[o],u!=null))switch(o){case"value":a=u;break;case"defaultValue":i=u;break;case"multiple":r=u;default:ct(e,t,o,u,n,null)}t=a,n=i,e.multiple=!!r,t!=null?Gr(e,!!r,t,!1):n!=null&&Gr(e,!!r,n,!0);return;case"textarea":Qe("invalid",e),a=o=r=null;for(i in n)if(n.hasOwnProperty(i)&&(u=n[i],u!=null))switch(i){case"value":r=u;break;case"defaultValue":o=u;break;case"children":a=u;break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:ct(e,t,i,u,n,null)}Za(e,r,o,a);return;case"option":for(h in n)if(n.hasOwnProperty(h)&&(r=n[h],r!=null))switch(h){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:ct(e,t,h,r,n,null)}return;case"dialog":Qe("beforetoggle",e),Qe("toggle",e),Qe("cancel",e),Qe("close",e);break;case"iframe":case"object":Qe("load",e);break;case"video":case"audio":for(r=0;r<Pi.length;r++)Qe(Pi[r],e);break;case"image":Qe("error",e),Qe("load",e);break;case"details":Qe("toggle",e);break;case"embed":case"source":case"link":Qe("error",e),Qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(k in n)if(n.hasOwnProperty(k)&&(r=n[k],r!=null))switch(k){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:ct(e,t,k,r,n,null)}return;default:if(Zr(t)){for(j in n)n.hasOwnProperty(j)&&(r=n[j],r!==void 0&&Gu(e,t,j,r,n,void 0));return}}for(u in n)n.hasOwnProperty(u)&&(r=n[u],r!=null&&ct(e,t,u,r,n,null))}function v0(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,a=null,i=null,u=null,h=null,k=null,j=null;for(z in n){var $=n[z];if(n.hasOwnProperty(z)&&$!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":h=$;default:r.hasOwnProperty(z)||ct(e,t,z,null,r,$)}}for(var S in r){var z=r[S];if($=n[S],r.hasOwnProperty(S)&&(z!=null||$!=null))switch(S){case"type":a=z;break;case"name":o=z;break;case"checked":k=z;break;case"defaultChecked":j=z;break;case"value":i=z;break;case"defaultValue":u=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(c(137,t));break;default:z!==$&&ct(e,t,S,z,r,$)}}la(e,i,u,h,k,j,a,o);return;case"select":z=i=u=S=null;for(a in n)if(h=n[a],n.hasOwnProperty(a)&&h!=null)switch(a){case"value":break;case"multiple":z=h;default:r.hasOwnProperty(a)||ct(e,t,a,null,r,h)}for(o in r)if(a=r[o],h=n[o],r.hasOwnProperty(o)&&(a!=null||h!=null))switch(o){case"value":S=a;break;case"defaultValue":u=a;break;case"multiple":i=a;default:a!==h&&ct(e,t,o,a,r,h)}t=u,n=i,r=z,S!=null?Gr(e,!!n,S,!1):!!r!=!!n&&(t!=null?Gr(e,!!n,t,!0):Gr(e,!!n,n?[]:"",!1));return;case"textarea":z=S=null;for(u in n)if(o=n[u],n.hasOwnProperty(u)&&o!=null&&!r.hasOwnProperty(u))switch(u){case"value":break;case"children":break;default:ct(e,t,u,null,r,o)}for(i in r)if(o=r[i],a=n[i],r.hasOwnProperty(i)&&(o!=null||a!=null))switch(i){case"value":S=o;break;case"defaultValue":z=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(c(91));break;default:o!==a&&ct(e,t,i,o,r,a)}Hi(e,S,z);return;case"option":for(var de in n)if(S=n[de],n.hasOwnProperty(de)&&S!=null&&!r.hasOwnProperty(de))switch(de){case"selected":e.selected=!1;break;default:ct(e,t,de,null,r,S)}for(h in r)if(S=r[h],z=n[h],r.hasOwnProperty(h)&&S!==z&&(S!=null||z!=null))switch(h){case"selected":e.selected=S&&typeof S!="function"&&typeof S!="symbol";break;default:ct(e,t,h,S,r,z)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Se in n)S=n[Se],n.hasOwnProperty(Se)&&S!=null&&!r.hasOwnProperty(Se)&&ct(e,t,Se,null,r,S);for(k in r)if(S=r[k],z=n[k],r.hasOwnProperty(k)&&S!==z&&(S!=null||z!=null))switch(k){case"children":case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(137,t));break;default:ct(e,t,k,S,r,z)}return;default:if(Zr(t)){for(var pt in n)S=n[pt],n.hasOwnProperty(pt)&&S!==void 0&&!r.hasOwnProperty(pt)&&Gu(e,t,pt,void 0,r,S);for(j in r)S=r[j],z=n[j],!r.hasOwnProperty(j)||S===z||S===void 0&&z===void 0||Gu(e,t,j,S,r,z);return}}for(var b in n)S=n[b],n.hasOwnProperty(b)&&S!=null&&!r.hasOwnProperty(b)&&ct(e,t,b,null,r,S);for($ in r)S=r[$],z=n[$],!r.hasOwnProperty($)||S===z||S==null&&z==null||ct(e,t,$,S,r,z)}function ef(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function x0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var o=n[r],a=o.transferSize,i=o.initiatorType,u=o.duration;if(a&&u&&ef(i)){for(i=0,u=o.responseEnd,r+=1;r<n.length;r++){var h=n[r],k=h.startTime;if(k>u)break;var j=h.transferSize,$=h.initiatorType;j&&ef($)&&(h=h.responseEnd,i+=j*(h<u?1:(u-k)/(h-k)))}if(--r,t+=8*(a+i)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Zu=null,Ju=null;function Ls(e){return e.nodeType===9?e:e.ownerDocument}function tf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nf(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Yu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ed=null;function w0(){var e=window.event;return e&&e.type==="popstate"?e===ed?!1:(ed=e,!0):(ed=null,!1)}var rf=typeof setTimeout=="function"?setTimeout:void 0,k0=typeof clearTimeout=="function"?clearTimeout:void 0,of=typeof Promise=="function"?Promise:void 0,_0=typeof queueMicrotask=="function"?queueMicrotask:typeof of<"u"?function(e){return of.resolve(null).then(e).catch(S0)}:rf;function S0(e){setTimeout(function(){throw e})}function xo(e){return e==="head"}function af(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(o),Wa(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Mi(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Mi(n);for(var a=n.firstChild;a;){var i=a.nextSibling,u=a.nodeName;a[kr]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=i}}else n==="body"&&Mi(e.ownerDocument.body);n=o}while(n);Wa(t)}function sf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function td(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":td(n),qa(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function C0(e,t,n,r){for(;e.nodeType===1;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[kr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence")||a!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=Gn(e.nextSibling),e===null)break}return null}function E0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Gn(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Gn(e.nextSibling),e===null))return null;return e}function nd(e){return e.data==="$?"||e.data==="$~"}function rd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function z0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Gn(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var od=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Gn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function cf(e,t,n){switch(t=Ls(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Mi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);qa(e)}var Zn=new Map,pf=new Set;function Fs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Wr=V.d;V.d={f:A0,r:P0,D:I0,C:M0,L:j0,m:R0,X:N0,S:D0,M:T0};function A0(){var e=Wr.f(),t=Ps();return e||t}function P0(e){var t=Kr(e);t!==null&&t.tag===5&&t.type==="form"?Ap(t):Wr.r(e)}var Fa=typeof document>"u"?null:document;function mf(e,t,n){var r=Fa;if(r&&typeof t=="string"&&t){var o=en(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),pf.has(o)||(pf.add(o),e={rel:e,crossOrigin:n,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),sn(t,"link",e),Nt(t),r.head.appendChild(t)))}}function I0(e){Wr.D(e),mf("dns-prefetch",e,null)}function M0(e,t){Wr.C(e,t),mf("preconnect",e,t)}function j0(e,t,n){Wr.L(e,t,n);var r=Fa;if(r&&e&&t){var o='link[rel="preload"][as="'+en(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+en(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+en(n.imageSizes)+'"]')):o+='[href="'+en(e)+'"]';var a=o;switch(t){case"style":a=$a(e);break;case"script":a=Oa(e)}Zn.has(a)||(e=C({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Zn.set(a,e),r.querySelector(o)!==null||t==="style"&&r.querySelector(ji(a))||t==="script"&&r.querySelector(Ri(a))||(t=r.createElement("link"),sn(t,"link",e),Nt(t),r.head.appendChild(t)))}}function R0(e,t){Wr.m(e,t);var n=Fa;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+en(r)+'"][href="'+en(e)+'"]',a=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Oa(e)}if(!Zn.has(a)&&(e=C({rel:"modulepreload",href:e},t),Zn.set(a,e),n.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ri(a)))return}r=n.createElement("link"),sn(r,"link",e),Nt(r),n.head.appendChild(r)}}}function D0(e,t,n){Wr.S(e,t,n);var r=Fa;if(r&&e){var o=It(r).hoistableStyles,a=$a(e);t=t||"default";var i=o.get(a);if(!i){var u={loading:0,preload:null};if(i=r.querySelector(ji(a)))u.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Zn.get(a))&&ad(e,n);var h=i=r.createElement("link");Nt(h),sn(h,"link",e),h._p=new Promise(function(k,j){h.onload=k,h.onerror=j}),h.addEventListener("load",function(){u.loading|=1}),h.addEventListener("error",function(){u.loading|=2}),u.loading|=4,$s(i,t,r)}i={type:"stylesheet",instance:i,count:1,state:u},o.set(a,i)}}}function N0(e,t){Wr.X(e,t);var n=Fa;if(n&&e){var r=It(n).hoistableScripts,o=Oa(e),a=r.get(o);a||(a=n.querySelector(Ri(o)),a||(e=C({src:e,async:!0},t),(t=Zn.get(o))&&id(e,t),a=n.createElement("script"),Nt(a),sn(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function T0(e,t){Wr.M(e,t);var n=Fa;if(n&&e){var r=It(n).hoistableScripts,o=Oa(e),a=r.get(o);a||(a=n.querySelector(Ri(o)),a||(e=C({src:e,async:!0,type:"module"},t),(t=Zn.get(o))&&id(e,t),a=n.createElement("script"),Nt(a),sn(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function ff(e,t,n,r){var o=(o=ye.current)?Fs(o):null;if(!o)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=$a(n.href),n=It(o).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=$a(n.href);var a=It(o).hoistableStyles,i=a.get(e);if(i||(o=o.ownerDocument||o,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,i),(a=o.querySelector(ji(e)))&&!a._p&&(i.instance=a,i.state.loading=5),Zn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Zn.set(e,n),a||L0(o,e,n,i.state))),t&&r===null)throw Error(c(528,""));return i}if(t&&r!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Oa(n),n=It(o).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function $a(e){return'href="'+en(e)+'"'}function ji(e){return'link[rel="stylesheet"]['+e+"]"}function hf(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function L0(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),sn(t,"link",n),Nt(t),e.head.appendChild(t))}function Oa(e){return'[src="'+en(e)+'"]'}function Ri(e){return"script[async]"+e}function gf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+en(n.href)+'"]');if(r)return t.instance=r,Nt(r),r;var o=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Nt(r),sn(r,"style",o),$s(r,n.precedence,e),t.instance=r;case"stylesheet":o=$a(n.href);var a=e.querySelector(ji(o));if(a)return t.state.loading|=4,t.instance=a,Nt(a),a;r=hf(n),(o=Zn.get(o))&&ad(r,o),a=(e.ownerDocument||e).createElement("link"),Nt(a);var i=a;return i._p=new Promise(function(u,h){i.onload=u,i.onerror=h}),sn(a,"link",r),t.state.loading|=4,$s(a,n.precedence,e),t.instance=a;case"script":return a=Oa(n.src),(o=e.querySelector(Ri(a)))?(t.instance=o,Nt(o),o):(r=n,(o=Zn.get(a))&&(r=C({},n),id(r,o)),e=e.ownerDocument||e,o=e.createElement("script"),Nt(o),sn(o,"link",r),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,$s(r,n.precedence,e));return t.instance}function $s(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,a=o,i=0;i<r.length;i++){var u=r[i];if(u.dataset.precedence===t)a=u;else if(a!==o)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ad(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function id(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Os=null;function bf(e,t,n){if(Os===null){var r=new Map,o=Os=new Map;o.set(n,r)}else o=Os,r=o.get(n),r||(r=new Map,o.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var a=n[o];if(!(a[kr]||a[Ct]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var i=a.getAttribute(t)||"";i=e+i;var u=r.get(i);u?u.push(a):r.set(i,[a])}}return r}function yf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function F0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function vf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $0(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=$a(r.href),a=t.querySelector(ji(o));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ws.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Nt(a);return}a=t.ownerDocument||t,r=hf(r),(o=Zn.get(o))&&ad(r,o),a=a.createElement("link"),Nt(a);var i=a;i._p=new Promise(function(u,h){i.onload=u,i.onerror=h}),sn(a,"link",r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ws.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var sd=0;function O0(e,t){return e.stylesheets&&e.count===0&&Bs(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&sd===0&&(sd=62500*x0());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>sd?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function Ws(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hs=null;function Bs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hs=new Map,t.forEach(W0,e),Hs=null,Ws.call(e))}function W0(e,t){if(!(t.state.loading&4)){var n=Hs.get(e);if(n)var r=n.get(null);else{n=new Map,Hs.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<o.length;a++){var i=o[a];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),r=i)}r&&n.set(null,r)}o=t.instance,i=o.getAttribute("data-precedence"),a=n.get(i)||r,a===r&&n.set(null,o),n.set(i,o),this.count++,r=Ws.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),a?a.parentNode.insertBefore(o,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var Di={$$typeof:re,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function H0(e,t,n,r,o,a,i,u,h){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Yn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yn(0),this.hiddenUpdates=Yn(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=a,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=h,this.incompleteTransitions=new Map}function xf(e,t,n,r,o,a,i,u,h,k,j,$){return e=new H0(e,t,n,i,h,k,j,$,u),t=1,a===!0&&(t|=24),a=Nn(3,null,null,t),e.current=a,a.stateNode=e,t=Ol(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Vl(a),e}function wf(e){return e?(e=ba,e):ba}function kf(e,t,n,r,o,a){o=wf(o),r.context===null?r.context=o:r.pendingContext=o,r=lo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=uo(e,r,t),n!==null&&(Pn(n,e,t),pi(n,e,t))}function _f(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ld(e,t){_f(e,t),(e=e.alternate)&&_f(e,t)}function Sf(e){if(e.tag===13||e.tag===31){var t=Bo(e,67108864);t!==null&&Pn(t,e,67108864),ld(e,67108864)}}function Cf(e){if(e.tag===13||e.tag===31){var t=On();t=er(t);var n=Bo(e,t);n!==null&&Pn(n,e,t),ld(e,t)}}var Vs=!0;function B0(e,t,n,r){var o=E.T;E.T=null;var a=V.p;try{V.p=2,ud(e,t,n,r)}finally{V.p=a,E.T=o}}function V0(e,t,n,r){var o=E.T;E.T=null;var a=V.p;try{V.p=8,ud(e,t,n,r)}finally{V.p=a,E.T=o}}function ud(e,t,n,r){if(Vs){var o=dd(r);if(o===null)Xu(e,t,r,Us,n),zf(e,r);else if(Q0(o,e,t,n,r))r.stopPropagation();else if(zf(e,r),t&4&&-1<U0.indexOf(e)){for(;o!==null;){var a=Kr(o);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var i=xn(a.pendingLanes);if(i!==0){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;i;){var h=1<<31-mt(i);u.entanglements[1]|=h,i&=~h}wr(a),(at&6)===0&&(zs=Je()+500,Ai(0))}}break;case 31:case 13:u=Bo(a,2),u!==null&&Pn(u,a,2),Ps(),ld(a,2)}if(a=dd(r),a===null&&Xu(e,t,r,Us,n),a===o)break;o=a}o!==null&&r.stopPropagation()}else Xu(e,t,r,null,n)}}function dd(e){return e=et(e),cd(e)}var Us=null;function cd(e){if(Us=null,e=mr(e),e!==null){var t=M(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=N(t),e!==null)return e;e=null}else if(n===31){if(e=q(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 Us=e,null}function Ef(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Fe()){case un:return 2;case it:return 8;case Kt:case Mn:return 32;case Io:return 268435456;default:return 32}default:return 32}}var pd=!1,wo=null,ko=null,_o=null,Ni=new Map,Ti=new Map,So=[],U0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function zf(e,t){switch(e){case"focusin":case"focusout":wo=null;break;case"dragenter":case"dragleave":ko=null;break;case"mouseover":case"mouseout":_o=null;break;case"pointerover":case"pointerout":Ni.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ti.delete(t.pointerId)}}function Li(e,t,n,r,o,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[o]},t!==null&&(t=Kr(t),t!==null&&Sf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Q0(e,t,n,r,o){switch(t){case"focusin":return wo=Li(wo,e,t,n,r,o),!0;case"dragenter":return ko=Li(ko,e,t,n,r,o),!0;case"mouseover":return _o=Li(_o,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return Ni.set(a,Li(Ni.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,Ti.set(a,Li(Ti.get(a)||null,e,t,n,r,o)),!0}return!1}function Af(e){var t=mr(e.target);if(t!==null){var n=M(t);if(n!==null){if(t=n.tag,t===13){if(t=N(n),t!==null){e.blockedOn=t,qr(e.priority,function(){Cf(n)});return}}else if(t===31){if(t=q(n),t!==null){e.blockedOn=t,qr(e.priority,function(){Cf(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 Qs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dd(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);da=r,n.target.dispatchEvent(r),da=null}else return t=Kr(n),t!==null&&Sf(t),e.blockedOn=n,!1;t.shift()}return!0}function Pf(e,t,n){Qs(e)&&n.delete(t)}function q0(){pd=!1,wo!==null&&Qs(wo)&&(wo=null),ko!==null&&Qs(ko)&&(ko=null),_o!==null&&Qs(_o)&&(_o=null),Ni.forEach(Pf),Ti.forEach(Pf)}function qs(e,t){e.blockedOn===t&&(e.blockedOn=null,pd||(pd=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,q0)))}var Ks=null;function If(e){Ks!==e&&(Ks=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Ks===e&&(Ks=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],o=e[t+2];if(typeof r!="function"){if(cd(r||n)===null)continue;break}var a=Kr(n);a!==null&&(e.splice(t,3),t-=3,du(a,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Wa(e){function t(h){return qs(h,e)}wo!==null&&qs(wo,e),ko!==null&&qs(ko,e),_o!==null&&qs(_o,e),Ni.forEach(t),Ti.forEach(t);for(var n=0;n<So.length;n++){var r=So[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<So.length&&(n=So[0],n.blockedOn===null);)Af(n),n.blockedOn===null&&So.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var o=n[r],a=n[r+1],i=o[Ht]||null;if(typeof a=="function")i||If(n);else if(i){var u=null;if(a&&a.hasAttribute("formAction")){if(o=a,i=a[Ht]||null)u=i.formAction;else if(cd(o)!==null)continue}else u=i.action;typeof u=="function"?n[r+1]=u:(n.splice(r,3),r-=3),If(n)}}}function Mf(){function e(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(i){return o=i})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function md(e){this._internalRoot=e}Xs.prototype.render=md.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,r=On();kf(n,r,e,t,null,null)},Xs.prototype.unmount=md.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;kf(e.current,2,null,e,null,null),Ps(),t[pr]=null}};function Xs(e){this._internalRoot=e}Xs.prototype.unstable_scheduleHydration=function(e){if(e){var t=ra();e={blockedOn:null,target:e,priority:t};for(var n=0;n<So.length&&t!==0&&t<So[n].priority;n++);So.splice(n,0,e),n===0&&Af(e)}};var jf=l.version;if(jf!=="19.2.1")throw Error(c(527,jf,"19.2.1"));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=y(t),e=e!==null?B(e):null,e=e===null?null:e.stateNode,e};var K0={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gs.isDisabled&&Gs.supportsFiber)try{Xt=Gs.inject(K0),Dt=Gs}catch{}}return Ha.createRoot=function(e,t){if(!v(e))throw Error(c(299));var n=!1,r="",o=Fp,a=$p,i=Op;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=xf(e,1,!1,null,null,n,r,null,o,a,i,Mf),e[pr]=t.current,Ku(e),new md(t)},Ha.hydrateRoot=function(e,t,n){if(!v(e))throw Error(c(299));var r=!1,o="",a=Fp,i=$p,u=Op,h=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(u=n.onRecoverableError),n.formState!==void 0&&(h=n.formState)),t=xf(e,1,!0,t,n??null,r,o,h,a,i,u,Mf),t.context=wf(null),n=t.current,r=On(),r=er(r),o=lo(r),o.callback=null,uo(n,o,r),n=r,t.current.lanes=n,cr(t,n),wr(t),e[pr]=t.current,Ku(e),new Xs(t)},Ha.version="19.2.1",Ha}var Cd;function Ff(){if(Cd)return Js.exports;Cd=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),Js.exports=Lf(),Js.exports}var $f=Ff();const Ed=dr($f);var zd={exports:{}},Ba={};/**
42
42
  * @license React
43
43
  * react-jsx-runtime.production.js
44
44
  *
@@ -46,12 +46,12 @@ Error generating stack: `+r.message+`
46
46
  *
47
47
  * This source code is licensed under the MIT license found in the
48
48
  * LICENSE file in the root directory of this source tree.
49
- */var Ad;function Of(){if(Ad)return Ba;Ad=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function d(c,v,I){var D=null;if(I!==void 0&&(D=""+I),v.key!==void 0&&(D=""+v.key),"key"in v){I={};for(var q in v)q!=="key"&&(I[q]=v[q])}else I=v;return v=I.ref,{$$typeof:s,type:c,key:D,ref:v!==void 0?v:null,props:I}}return Ba.Fragment=l,Ba.jsx=d,Ba.jsxs=d,Ba}var Pd;function Wf(){return Pd||(Pd=1,zd.exports=Of()),zd.exports}var m=Wf(),el=_d();/**
49
+ */var Ad;function Of(){if(Ad)return Ba;Ad=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function d(c,v,M){var N=null;if(M!==void 0&&(N=""+M),v.key!==void 0&&(N=""+v.key),"key"in v){M={};for(var q in v)q!=="key"&&(M[q]=v[q])}else M=v;return v=M.ref,{$$typeof:s,type:c,key:N,ref:v!==void 0?v:null,props:M}}return Ba.Fragment=l,Ba.jsx=d,Ba.jsxs=d,Ba}var Pd;function Wf(){return Pd||(Pd=1,zd.exports=Of()),zd.exports}var m=Wf(),el=_d();/**
50
50
  * @license lucide-react v0.563.0 - ISC
51
51
  *
52
52
  * This source code is licensed under the ISC license.
53
53
  * See the LICENSE file in the root directory of this source tree.
54
- */const Md=(...s)=>s.filter((l,d,c)=>!!l&&l.trim()!==""&&c.indexOf(l)===d).join(" ").trim();/**
54
+ */const Id=(...s)=>s.filter((l,d,c)=>!!l&&l.trim()!==""&&c.indexOf(l)===d).join(" ").trim();/**
55
55
  * @license lucide-react v0.563.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
@@ -66,7 +66,7 @@ Error generating stack: `+r.message+`
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
- */const Id=s=>{const l=Bf(s);return l.charAt(0).toUpperCase()+l.slice(1)};/**
69
+ */const Md=s=>{const l=Bf(s);return l.charAt(0).toUpperCase()+l.slice(1)};/**
70
70
  * @license lucide-react v0.563.0 - ISC
71
71
  *
72
72
  * This source code is licensed under the ISC license.
@@ -81,79 +81,89 @@ Error generating stack: `+r.message+`
81
81
  *
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
- */const Qf=x.forwardRef(({color:s="currentColor",size:l=24,strokeWidth:d=2,absoluteStrokeWidth:c,className:v="",children:I,iconNode:D,...q},_)=>x.createElement("svg",{ref:_,...Vf,width:l,height:l,stroke:s,strokeWidth:c?Number(d)*24/Number(l):d,className:Md("lucide",v),...!I&&!Uf(q)&&{"aria-hidden":"true"},...q},[...D.map(([y,B])=>x.createElement(y,B)),...Array.isArray(I)?I:[I]]));/**
84
+ */const Qf=x.forwardRef(({color:s="currentColor",size:l=24,strokeWidth:d=2,absoluteStrokeWidth:c,className:v="",children:M,iconNode:N,...q},_)=>x.createElement("svg",{ref:_,...Vf,width:l,height:l,stroke:s,strokeWidth:c?Number(d)*24/Number(l):d,className:Id("lucide",v),...!M&&!Uf(q)&&{"aria-hidden":"true"},...q},[...N.map(([y,B])=>x.createElement(y,B)),...Array.isArray(M)?M:[M]]));/**
85
85
  * @license lucide-react v0.563.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
- */const Zn=(s,l)=>{const d=x.forwardRef(({className:c,...v},I)=>x.createElement(Qf,{ref:I,iconNode:l,className:Md(`lucide-${Hf(Id(s))}`,`lucide-${s}`,c),...v}));return d.displayName=Id(s),d};/**
89
+ */const In=(s,l)=>{const d=x.forwardRef(({className:c,...v},M)=>x.createElement(Qf,{ref:M,iconNode:l,className:Id(`lucide-${Hf(Md(s))}`,`lucide-${s}`,c),...v}));return d.displayName=Md(s),d};/**
90
90
  * @license lucide-react v0.563.0 - ISC
91
91
  *
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
- */const qf=Zn("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
94
+ */const qf=In("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
95
95
  * @license lucide-react v0.563.0 - ISC
96
96
  *
97
97
  * This source code is licensed under the ISC license.
98
98
  * See the LICENSE file in the root directory of this source tree.
99
- */const Kf=Zn("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
99
+ */const Kf=In("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
100
100
  * @license lucide-react v0.563.0 - ISC
101
101
  *
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
- */const Xf=Zn("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]);/**
104
+ */const Xf=In("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
105
105
  * @license lucide-react v0.563.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
- */const Gf=Zn("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);/**
109
+ */const Gf=In("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
110
110
  * @license lucide-react v0.563.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
- */const tl=Zn("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);/**
114
+ */const Zf=In("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]);/**
115
115
  * @license lucide-react v0.563.0 - ISC
116
116
  *
117
117
  * This source code is licensed under the ISC license.
118
118
  * See the LICENSE file in the root directory of this source tree.
119
- */const jd=Zn("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);/**
119
+ */const Jf=In("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);/**
120
120
  * @license lucide-react v0.563.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
- */const Nd=Zn("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
124
+ */const tl=In("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);/**
125
125
  * @license lucide-react v0.563.0 - ISC
126
126
  *
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
- */const Zf=Zn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
129
+ */const jd=In("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);/**
130
130
  * @license lucide-react v0.563.0 - ISC
131
131
  *
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
- */const Rd=Zn("thumbs-down",[["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}],["path",{d:"M17 14V2",key:"8ymqnk"}]]);/**
134
+ */const Rd=In("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
135
135
  * @license lucide-react v0.563.0 - ISC
136
136
  *
137
137
  * This source code is licensed under the ISC license.
138
138
  * See the LICENSE file in the root directory of this source tree.
139
- */const Dd=Zn("thumbs-up",[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]]);/**
139
+ */const Yf=In("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
140
140
  * @license lucide-react v0.563.0 - ISC
141
141
  *
142
142
  * This source code is licensed under the ISC license.
143
143
  * See the LICENSE file in the root directory of this source tree.
144
- */const nl=Zn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),bn=":not([data-admesh-ad-content], [data-admesh-ad-content] *)",Td=`
144
+ */const Dd=In("thumbs-down",[["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}],["path",{d:"M17 14V2",key:"8ymqnk"}]]);/**
145
+ * @license lucide-react v0.563.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const Nd=In("thumbs-up",[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]]);/**
150
+ * @license lucide-react v0.563.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const nl=In("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),yn=":not([data-admesh-ad-content], [data-admesh-ad-content] *)",Td=`
145
155
  .admesh-publisher-panel {
146
156
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
147
157
  text-align: left;
148
158
  line-height: 1.5;
149
159
  -webkit-font-smoothing: antialiased;
150
160
  }
151
- .admesh-publisher-panel *${bn}, .admesh-publisher-panel *${bn}::before, .admesh-publisher-panel *${bn}::after {
161
+ .admesh-publisher-panel *${yn}, .admesh-publisher-panel *${yn}::before, .admesh-publisher-panel *${yn}::after {
152
162
  box-sizing: border-box;
153
163
  }
154
- .admesh-publisher-panel button${bn}, .admesh-publisher-panel input${bn} { font-family: inherit; }
155
- .admesh-publisher-panel button${bn} { transition: border-color 150ms ease, background-color 150ms ease; }
156
- .admesh-publisher-panel button${bn}:focus-visible, .admesh-publisher-panel a${bn}:focus-visible {
164
+ .admesh-publisher-panel button${yn}, .admesh-publisher-panel input${yn} { font-family: inherit; }
165
+ .admesh-publisher-panel button${yn} { transition: border-color 150ms ease, background-color 150ms ease; }
166
+ .admesh-publisher-panel button${yn}:focus-visible, .admesh-publisher-panel a${yn}:focus-visible {
157
167
  outline: 2px solid var(--publisher-accent);
158
168
  outline-offset: 2px;
159
169
  }
@@ -167,19 +177,19 @@ Error generating stack: `+r.message+`
167
177
  }
168
178
  .admesh-publisher-panel .admesh-publisher-source { transition: border-color 150ms ease; }
169
179
  .admesh-publisher-panel .admesh-publisher-suggestion { overflow-wrap: anywhere; }
170
- .admesh-publisher-panel input${bn} { min-width: 0; }
171
- .admesh-publisher-panel a${bn} { text-underline-offset: 3px; }
180
+ .admesh-publisher-panel input${yn} { min-width: 0; }
181
+ .admesh-publisher-panel a${yn} { text-underline-offset: 3px; }
172
182
  @media (prefers-reduced-motion: reduce) {
173
- .admesh-publisher-panel *${bn}, .admesh-publisher-panel *${bn}::before, .admesh-publisher-panel *${bn}::after {
183
+ .admesh-publisher-panel *${yn}, .admesh-publisher-panel *${yn}::before, .admesh-publisher-panel *${yn}::after {
174
184
  animation: none !important;
175
185
  transition: none !important;
176
186
  scroll-behavior: auto !important;
177
187
  }
178
188
  }
179
189
  @media (max-width: 767px) {
180
- .admesh-publisher-panel:not([data-compact="true"]) input${bn} { font-size: 16px !important; }
190
+ .admesh-publisher-panel:not([data-compact="true"]) input${yn} { font-size: 16px !important; }
181
191
  }
182
- `;function Jf({value:s,onChange:l,onSend:d,onStop:c,onSuggestion:v,suggestions:I,registerSuggestion:D,open:q,onOpenChange:_,loading:y,analyzing:B,compact:C,expanded:W,suggestionPlacement:M="below",showLogo:A=!0,logoUrl:H,title:U,placeholder:ee,colors:te}){const re=x.useId(),ne=x.useRef(null),ie=x.useRef(null),Q=x.useRef(null),[O,fe]=x.useState({visibility:"hidden"}),le=q&&!y&&(B||I.length>0);x.useLayoutEffect(()=>{var oe;if(!le)return;const ue=()=>{var Pe,E;const V=(Pe=ne.current)==null?void 0:Pe.getBoundingClientRect();if(!V)return;const se=((E=window.visualViewport)==null?void 0:E.height)??window.innerHeight,ke=document.documentElement.clientWidth,Ee=se-V.bottom-16,f=V.top-16,P=M==="above"?!(f<96&&Ee>f):Ee<96&&f>Ee;fe({position:"fixed",left:Math.max(8,Math.min(V.left,ke-V.width-8)),width:Math.min(V.width,ke-16),maxHeight:Math.max(40,Math.min(300,P?f:Ee)),...P?{bottom:window.innerHeight-V.top+8}:{top:V.bottom+8},zIndex:2147483002})},xe=Pe=>{var E,V;const se=Pe.target;!((E=ne.current)!=null&&E.contains(se))&&!((V=Q.current)!=null&&V.contains(se))&&_(!1)};return ue(),window.addEventListener("resize",ue),window.addEventListener("scroll",ue,!0),(oe=window.visualViewport)==null||oe.addEventListener("resize",ue),document.addEventListener("pointerdown",xe),()=>{var Pe;window.removeEventListener("resize",ue),window.removeEventListener("scroll",ue,!0),(Pe=window.visualViewport)==null||Pe.removeEventListener("resize",ue),document.removeEventListener("pointerdown",xe)}},[le,M,_]);const ge=oe=>{var ue,xe;!((ue=ne.current)!=null&&ue.contains(oe))&&!((xe=Q.current)!=null&&xe.contains(oe))&&_(!1)},$e=()=>{!s.trim()||y||(_(!1),d())};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{ref:ne,className:"admesh-publisher-composer",onBlur:oe=>ge(oe.relatedTarget),onClick:oe=>{var ue;oe.target.closest("button, a")||((ue=ie.current)==null||ue.focus(),_(!0))},style:{display:"flex",alignItems:"center",gap:C?8:12,minWidth:0,width:"100%",flexShrink:0,border:`1px solid ${te.border}`,borderRadius:8,background:te.surface,cursor:"text",padding:C?"6px":"8px 8px 8px 12px"},children:[A&&!W&&m.jsx("div",{style:{width:C?24:32,height:C?24:32,display:"grid",placeItems:"center",flexShrink:0,color:te.accent},children:H?m.jsx("img",{src:H,alt:`${U} logo`,style:{width:"100%",height:"100%",objectFit:"contain"}}):m.jsx(tl,{size:C?18:21,strokeWidth:1.5,"aria-label":U})}),m.jsx("input",{ref:ie,type:"text",value:s,placeholder:ee,"aria-label":"Ask the publisher assistant","aria-expanded":le,"aria-controls":le?re:void 0,onFocus:()=>_(!0),onChange:oe=>{l(oe.target.value),_(!0)},onKeyDown:oe=>{var ue,xe;oe.nativeEvent.isComposing||(oe.key==="Escape"&&(oe.preventDefault(),_(!1)),oe.key==="ArrowDown"&&(oe.preventDefault(),le?(xe=(ue=Q.current)==null?void 0:ue.querySelector("button"))==null||xe.focus():_(!0)),oe.key==="Enter"&&(oe.preventDefault(),$e()))},style:{flex:1,minWidth:0,border:"none",outline:"none",padding:C?"6px 0":"10px 0",fontSize:C?13:15,color:te.text,background:"transparent"}}),m.jsxs("span",{style:{flexShrink:0,fontSize:C?8:9,lineHeight:1.3,color:te.muted,textAlign:"right",whiteSpace:"nowrap"},children:["powered by",m.jsx("br",{}),m.jsx("a",{href:"https://useadmesh.com",target:"_blank",rel:"noopener noreferrer",style:{fontWeight:600,color:"inherit",textDecoration:"underline",textUnderlineOffset:2,cursor:"pointer"},children:"AdMesh"})]}),m.jsx("button",{type:"button","aria-label":y?"Stop generating":"Send message",disabled:!y&&!s.trim(),onClick:y?c:$e,style:{display:"grid",placeItems:"center",flexShrink:0,width:C?32:40,height:C?32:40,border:"none",borderRadius:6,background:te.accent,color:te.accentText,cursor:"pointer",opacity:!y&&!s.trim()?.5:1},children:y?m.jsx(Zf,{size:14,fill:"currentColor","aria-hidden":"true"}):m.jsx(Kf,{size:18,"aria-hidden":"true"})})]}),le&&el.createPortal(m.jsxs("div",{ref:Q,id:re,role:"group","aria-label":"Suggested questions",className:"admesh-publisher-panel",onBlur:oe=>ge(oe.relatedTarget),onKeyDown:oe=>{var ue,xe,Pe,E;if(oe.key==="Escape"&&(oe.preventDefault(),(ue=ie.current)==null||ue.focus(),_(!1)),oe.key==="ArrowDown"||oe.key==="ArrowUp"){oe.preventDefault();const V=Array.from(((xe=Q.current)==null?void 0:xe.querySelectorAll("button"))??[]),se=V.indexOf(document.activeElement)+(oe.key==="ArrowDown"?1:-1);se<0?(Pe=ie.current)==null||Pe.focus():(E=V[Math.min(se,V.length-1)])==null||E.focus()}},style:{...O,"--publisher-accent":te.accent,padding:6,border:`1px solid ${te.border}`,borderRadius:10,background:te.surface,overflowY:"auto",overscrollBehavior:"contain",boxShadow:"0 8px 24px rgba(15,23,42,0.1)"},children:[m.jsx("style",{children:Td}),B&&!I.length?m.jsx("div",{role:"status",style:{padding:12,color:te.muted,fontSize:13},children:"Finding suggested questions\u2026"}):I.map(oe=>m.jsxs("button",{ref:D(oe.id),type:"button",className:"admesh-publisher-suggestion","data-admesh-sponsored":oe.is_sponsored?"true":void 0,onClick:()=>{_(!1),v(oe)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,width:"100%",minWidth:0,margin:"0 0 4px",padding:"10px 12px",border:`1px solid ${oe.is_sponsored?te.accent:te.border}`,borderRadius:6,textAlign:"left",fontSize:13,fontWeight:500,lineHeight:1.4,cursor:"pointer",background:oe.is_sponsored?te.accent:te.surface,color:oe.is_sponsored?te.accentText:te.text},children:[m.jsx("span",{children:oe.text}),oe.is_sponsored&&m.jsx("span",{style:{fontSize:10,flexShrink:0},children:"Ad"})]},oe.id))]}),document.body)]})}let Ao=!1;try{typeof globalThis.importMeta<"u"&&(Br=globalThis.importMeta.env)!=null&&Br.PROD&&(Ao=!0)}catch{}Ao||(Ao=typeof process<"u"&&!0||typeof process<"u"&&!0);const F={log:(...s)=>{Ao||console.log(...s)},warn:(...s)=>{Ao||console.warn(...s)},error:(...s)=>{console.error(...s)},info:(...s)=>{Ao||console.info(...s)},debug:(...s)=>{Ao||console.debug(...s)}};function Yf(s,l,d){const c=s*l>242500;return{visibilityThreshold:c?.3:.5,minimumDuration:1e3,isLargeAd:c,...d}}function eh(s){return s<768?"mobile":s<1024?"tablet":"desktop"}function th(s){const l=s.getBoundingClientRect(),d=window.innerHeight||document.documentElement.clientHeight,c=window.innerWidth||document.documentElement.clientWidth,v=l.height,I=l.width;if(v===0||I===0)return 0;const D=Math.max(0,l.top),q=Math.min(d,l.bottom),_=Math.max(0,l.left),y=Math.min(c,l.right),B=Math.max(0,q-D),C=Math.max(0,y-_),W=B*C,M=v*I;return M>0?W/M:0}function Ld(){const s=window.innerHeight,l=document.documentElement.scrollHeight,d=window.pageYOffset||document.documentElement.scrollTop,c=l-s;return c<=0?100:Math.min(100,d/c*100)}function nh(s){const l=s.getBoundingClientRect(),d=window.pageYOffset||document.documentElement.scrollTop,c=window.pageXOffset||document.documentElement.scrollLeft;return{top:l.top+d,left:l.left+c}}function rh(s){const l=s.getBoundingClientRect(),d=nh(s),c=window.innerWidth||document.documentElement.clientWidth,v=window.innerHeight||document.documentElement.clientHeight,I=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return{pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,deviceType:eh(c),viewportWidth:c,viewportHeight:v,adWidth:l.width,adHeight:l.height,adPositionTop:d.top,adPositionLeft:d.left,isDarkMode:I,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}function oh(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}function ah(s,l,d){return s>=d.visibilityThreshold&&l>=d.minimumDuration}function Fd(s=new Date){return s.toISOString()}function ih(s){return s.length===0?0:s.reduce((l,d)=>l+d,0)/s.length}function $d(s,l){let d;return function(...c){d||(s(...c),d=!0,setTimeout(()=>d=!1,l))}}let sh={enabled:!0,apiEndpoint:"",enableBatching:!1,batchSize:10,batchTimeout:5e3,debug:!1,enableRetry:!1,maxRetries:3,retryDelay:1e3},lh=!1;function uh({productId:s,offerId:l,agentId:d,recommendationId:c,elementRef:v,config:I}){const D={...sh,...I},q=x.useRef(oh()),[_,y]=x.useState({isVisible:!1,isViewable:!1,visibilityPercentage:0,timeMetrics:{loadedAt:Fd(),totalVisibleDuration:0,totalViewableDuration:0,totalHoverDuration:0,totalFocusDuration:0},engagementMetrics:{currentScrollDepth:0,viewportEnterCount:0,viewportExitCount:0,hoverCount:0,wasClicked:!1,maxVisibilityPercentage:0,averageVisibilityPercentage:0},isTracking:D.enabled}),B=x.useRef(null),C=x.useRef(null),W=x.useRef(null),M=x.useRef(null),A=x.useRef(null),H=x.useRef([]),U=x.useRef([]),ee=x.useRef(null),te=x.useCallback(Q=>{D.debug&&F.log(`[AdMesh Viewability] ${Q}`)},[D.debug]),re=x.useCallback(async(Q,O)=>{if(!(!D.enabled||lh||!v.current||!B.current)&&(te(`Analytics disabled - skipping event: ${Q}`),D.onEvent)){const fe=rh(v.current),le={eventType:Q,timestamp:Fd(),sessionId:q.current,productId:s,offerId:l,agentId:d,recommendationId:c,timeMetrics:_.timeMetrics,engagementMetrics:_.engagementMetrics,contextMetrics:fe,mrcStandards:B.current,isViewable:_.isViewable,metadata:O};D.onEvent(le)}},[D,s,l,d,c,v,_,te]),ne=x.useCallback(async()=>{U.current.length!==0&&(te("Analytics disabled - clearing batch without sending"),U.current=[],ee.current&&(clearTimeout(ee.current),ee.current=null))},[te]),ie=x.useCallback($d(()=>{if(!v.current)return;const Q=th(v.current),O=Date.now(),fe=new Date(_.timeMetrics.loadedAt).getTime();y(le=>{const ge={...le};Q>0&&H.current.push(Q);const $e=le.isVisible,oe=Q>0;if(oe&&!$e)C.current=O,ge.engagementMetrics.viewportEnterCount++,ge.timeMetrics.timeToFirstVisible||(ge.timeMetrics.timeToFirstVisible=O-fe,ge.engagementMetrics.scrollDepthAtFirstVisible=Ld(),re("ad_visible"));else if(!oe&&$e){if(C.current){const ue=O-C.current;ge.timeMetrics.totalVisibleDuration+=ue,C.current=null}ge.engagementMetrics.viewportExitCount++,re("ad_hidden")}else if(oe&&$e&&C.current){const ue=O-C.current;ge.timeMetrics.totalVisibleDuration+=ue,C.current=O}if(ge.isVisible=oe,ge.visibilityPercentage=Q,Q>ge.engagementMetrics.maxVisibilityPercentage&&(ge.engagementMetrics.maxVisibilityPercentage=Q),H.current.length>0&&(ge.engagementMetrics.averageVisibilityPercentage=ih(H.current)),B.current){const ue=le.isViewable,xe=ah(Q,ge.timeMetrics.totalVisibleDuration,B.current);if(xe&&!ue)ge.isViewable=!0,ge.timeMetrics.timeToViewable=O-fe,W.current=O,re("ad_viewable");else if(xe&&ue&&W.current){const Pe=O-W.current;ge.timeMetrics.totalViewableDuration+=Pe,W.current=O}}return ge.engagementMetrics.currentScrollDepth=Ld(),ge})},100),[v,_.timeMetrics.loadedAt,re]);return x.useEffect(()=>{if(!v.current)return;const Q=v.current.getBoundingClientRect();B.current=Yf(Q.width,Q.height,D.mrcStandards),te("Initialized MRC standards"),re("ad_loaded")},[v,D.mrcStandards,te,re]),x.useEffect(()=>{if(!D.enabled||!v.current)return;const Q=new IntersectionObserver(O=>{O.forEach(()=>{ie()})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});return Q.observe(v.current),()=>{Q.disconnect()}},[D.enabled,v,ie]),x.useEffect(()=>{if(!D.enabled)return;const Q=$d(()=>{ie()},100);return window.addEventListener("scroll",Q,{passive:!0}),()=>window.removeEventListener("scroll",Q)},[D.enabled,ie]),x.useEffect(()=>{if(!D.enabled||!v.current)return;const Q=v.current,O=()=>{M.current=Date.now(),y(le=>({...le,engagementMetrics:{...le.engagementMetrics,hoverCount:le.engagementMetrics.hoverCount+1}})),re("ad_hover_start")},fe=()=>{if(M.current){const le=Date.now()-M.current;y(ge=>({...ge,timeMetrics:{...ge.timeMetrics,totalHoverDuration:ge.timeMetrics.totalHoverDuration+le}})),M.current=null,re("ad_hover_end",{hoverDuration:le})}};return Q.addEventListener("mouseenter",O),Q.addEventListener("mouseleave",fe),()=>{Q.removeEventListener("mouseenter",O),Q.removeEventListener("mouseleave",fe)}},[D.enabled,v,re]),x.useEffect(()=>{if(!D.enabled||!v.current)return;const Q=v.current,O=()=>{A.current=Date.now(),re("ad_focus")},fe=()=>{if(A.current){const le=Date.now()-A.current;y(ge=>({...ge,timeMetrics:{...ge.timeMetrics,totalFocusDuration:ge.timeMetrics.totalFocusDuration+le}})),A.current=null,re("ad_blur",{focusDuration:le})}};return Q.addEventListener("focus",O),Q.addEventListener("blur",fe),()=>{Q.removeEventListener("focus",O),Q.removeEventListener("blur",fe)}},[D.enabled,v,re]),x.useEffect(()=>{if(!D.enabled||!v.current)return;const Q=v.current,O=()=>{y(fe=>({...fe,engagementMetrics:{...fe.engagementMetrics,wasClicked:!0}})),re("ad_click")};return Q.addEventListener("click",O),()=>{Q.removeEventListener("click",O)}},[D.enabled,v,re]),x.useEffect(()=>()=>{const Q=Date.now(),O=new Date(_.timeMetrics.loadedAt).getTime(),fe=Q-O;y(le=>({...le,timeMetrics:{...le.timeMetrics,sessionDuration:fe}})),re("ad_unloaded",{sessionDuration:fe}),ne()},[]),_}const rl=({productId:s,offerId:l,agentId:d,recommendationId:c,exposureUrl:v,sessionId:I,triggerExposureUrl:D=!0,children:q,config:_,className:y,style:B,onViewabilityChange:C,onVisible:W,onViewable:M,onClick:A})=>{const H=x.useRef(null),U=x.useRef(!1),ee=uh({productId:s,offerId:l,agentId:d,recommendationId:c,elementRef:H,config:_}),te=x.useRef(ee.isViewable);x.useEffect(()=>{U.current=!1,te.current=!1},[v,c,I]),x.useEffect(()=>{ee.isViewable!==te.current&&(te.current=ee.isViewable,C&&C(ee.isViewable),ee.isViewable&&M&&M(),ee.isViewable&&!U.current&&D&&(F.log("[AdMeshViewabilityTracker] \u{1F3AF} Ad is viewable, checking exposure pixel requirements:",{exposureUrl:v?"present":"MISSING",sessionId:I?"present":"MISSING",recommendationId:c}),v&&I?(U.current=!0,F.log("[AdMeshViewabilityTracker] \u{1F525} Firing exposure pixel:",v),fetch(v,{method:"GET",keepalive:!0}).then(()=>{F.log("[AdMesh] \u2705 Exposure pixel fired successfully")}).catch(ie=>{F.warn("[AdMesh] \u26A0\uFE0F Failed to fire exposure pixel:",ie),U.current=!1})):F.warn("[AdMeshViewabilityTracker] \u26A0\uFE0F Cannot fire exposure pixel - missing required data:",{hasExposureUrl:!!v,hasSessionId:!!I})))},[ee.isViewable,C,M,v,I,c,D]);const re=x.useRef(ee.isVisible);x.useEffect(()=>{ee.isVisible!==re.current&&(re.current=ee.isVisible,ee.isVisible&&W&&W())},[ee.isVisible,W]);const ne=()=>{A&&A()};return m.jsx("div",{ref:H,className:y,style:B,onClick:ne,"data-admesh-viewability-tracker":!0,"data-recommendation-id":c,"data-is-viewable":ee.isViewable,"data-is-visible":ee.isVisible,"data-visibility-percentage":ee.visibilityPercentage.toFixed(2),children:q})};rl.displayName="AdMeshViewabilityTracker";const Od=s=>{try{return new URL(s),!0}catch{return!1}},na=s=>typeof s=="string"?s.trim():typeof s=="number"?String(s):"",Jn=s=>na(s)||void 0,dh=s=>s&&s.trim()?s.trim():"",ch=(s,l)=>{if(s==null||s==="")return"";if(typeof s=="number")try{return new Intl.NumberFormat("en-US",{style:"currency",currency:l||"USD",maximumFractionDigits:2}).format(s)}catch{return String(s)}return na(s)},Wd=({recommendations:s,theme:l,className:d="",style:c={},sessionId:v,triggerExposureUrl:I=!0,onDelegationConsent:D,onDelegationActivated:q,onStartDelegation:_,onRecommendationReport:y})=>{var B,C,W,M,A,H,U,ee,te;if(!s||s.length===0)return F.log("[AdMesh Compact Tail Ad] No recommendations provided - not rendering"),null;const re=s[0],ne=re?.recommendation,ie=ne?.creative,Q=re?.tracking,O=re?.delegation,fe=re?.recommendation_id||"",le=ne?.offerId||"",ge=ie?.brand_name||"",$e=ie?.headline||"",oe=ie?.description||"",ue=ie?.logo_url||"",xe=Q?.click_url||ie?.landing_page_url||"",Pe=Q?.exposure_url||"",E=ne?.disclosure||"Sponsored",V=ie?.products||[],se=V.slice(0,4),ke=V.length>1,Ee=(ne?.format||"tail")==="bridge",f=O?.available===!0,P=Ee&&f,G=O?.brand_name||ge,Y="Talk to Agent",_e=dh(ie?.cta_text),ye=!ke&&!!_e&&!!xe;if(!ge&&!$e&&!oe)return F.log("[AdMesh Compact Tail Ad] No valid recommendation data provided - not rendering",{recommendationId:fe}),null;const ze=$e&&$e!==ge?$e:ge,Le=oe,Re=ge.trim().toLowerCase(),De=ze.trim().toLowerCase(),Be=!!ge&&Re!==De,[qt,ae]=x.useState(!1),[ce,be]=x.useState(!1),[Ie,je]=x.useState(!1),[J,Oe]=x.useState(null),X=x.useRef(null);x.useEffect(()=>()=>{X.current&&(X.current(!1),X.current=null)},[]);const Ve=ve=>{var tt;ve&&be(!0),(tt=X.current)==null||tt.call(X,ve),X.current=null,ve||(be(!1),ae(!1))},Ge=async()=>D?await D(re):await new Promise(ve=>{X.current=ve,ae(!0)}),K=(ve,tt)=>{tt&&tt.stopPropagation(),typeof window<"u"&&window.admeshTracker&&window.admeshTracker.trackClick({recommendationId:fe,productId:le,clickUrl:xe,source:ve}).catch(()=>{F.error(`[AdMesh] Failed to track ${ve} click`)})},Je=[{value:"irrelevant",label:"Not relevant"},{value:"misleading",label:"Misleading"},{value:"inappropriate",label:"Inappropriate"},{value:"broken_link",label:"Broken link"},{value:"other",label:"Other"}],Fe=ve=>{ve.preventDefault(),ve.stopPropagation(),!J&&je(tt=>!tt)},un=async(ve,tt)=>{if(ve.preventDefault(),ve.stopPropagation(),je(!1),Oe(tt),!!y)try{await y({recommendation:re,recommendation_id:fe,reason:tt,session_id:v})}catch(Jt){F.warn("[AdMesh Compact Tail Ad] Failed to submit recommendation report:",Jt)}},it=()=>{ke||!xe||(K("compact_tail_ad_card"),typeof window<"u"&&window.open(xe,"_blank","noopener,noreferrer"))},Kt=ve=>{ke||!xe||(ve.key==="Enter"||ve.key===" ")&&(ve.preventDefault(),it())},Mn=async()=>{if(fe&&v)try{const ve=typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com",tt=await fetch(`${ve}/click/bridge-engagement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({recommendation_id:fe,session_id:v,is_test:!1})});tt.ok||F.warn("[AdMesh Compact Tail Ad] Delegation engagement tracking failed:",tt.statusText)}catch(ve){F.error("[AdMesh Compact Tail Ad] Error tracking delegation engagement:",ve)}},Mo=async ve=>{if(ve.preventDefault(),ve.stopPropagation(),!re||!P||(K("compact_tail_ad_delegation_cta"),!await Ge()))return;Mn();const tt=O!=null&&O.available?{recommendation_id:re.recommendation_id,brand_id:Jn(O.brand_id),brand_name:Jn(O.brand_name||ie?.brand_name),mcp_endpoint:Jn(O.mcp_endpoint),eligibility_reason:Jn(O.eligibility_reason),delegate_reason:Jn(O.delegate_reason),session_goal:Jn(O.session_goal),desired_outcome_type:O.desired_outcome_type,required_user_inputs:Array.isArray(O.required_user_inputs)?O.required_user_inputs.filter(Jt=>typeof Jt=="string"):[],required_consent_types:Array.isArray(O.required_consent_types)?O.required_consent_types.filter(Jt=>typeof Jt=="string"):[],success_outcome:Jn(O.success_outcome),fallback_message:Jn(O.fallback_message),session_mode:Jn(O.session_mode),status:Jn(O.status),capabilities:O.capabilities||[],allowed_data_types:O.allowed_data_types||[],consent_requirements:O.consent_requirements||[],auth_model:Jn(O.auth_model),handoff_protocol:O.handoff_protocol&&typeof O.handoff_protocol=="object"?O.handoff_protocol:void 0,supported_actions:O.supported_actions||[],metadata:O.metadata&&typeof O.metadata=="object"?O.metadata:void 0,platform_response:re}:null;if(q&&tt){try{await q(tt)}finally{be(!1),ae(!1)}return}if(_){try{await _(re)}finally{be(!1),ae(!1)}return}be(!1),ae(!1)},[yn,Vr]=x.useState(!1),Xt=l?.mode==="dark"||typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Rt=l?.surfaceColor||((C=(B=l?.components)==null?void 0:B.card)==null?void 0:C.backgroundColor)||(Xt?"#111827":"#ffffff"),ot=l?.borderColor||((M=(W=l?.components)==null?void 0:W.card)==null?void 0:M.borderColor)||(Xt?"rgba(255, 255, 255, 0.10)":"rgba(15, 23, 42, 0.08)"),mt=((A=l?.shadows)==null?void 0:A.medium)||((U=(H=l?.components)==null?void 0:H.card)==null?void 0:U.boxShadow)||(Xt?"0 8px 18px rgba(0, 0, 0, 0.28)":"0 8px 18px rgba(15, 23, 42, 0.08)"),qe="#2563eb",dn=Xt?"#9ca3af":"#6b7280",Ur=Xt?"#e5e7eb":"#374151",pn=Xt?"#f9fafb":"#0f172a",me=Xt?"rgba(255, 255, 255, 0.04)":"#f8fafc",mn="50px",vn=P||ye?m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[P?m.jsx("button",{type:"button",onClick:Mo,style:{background:"none",border:"none",padding:0,color:qe,fontSize:"12px",fontWeight:500,cursor:"pointer",textDecoration:"none"},children:Y}):null,ye?m.jsx("a",{href:xe,target:"_blank",rel:"noopener noreferrer",onClick:ve=>K("compact_tail_ad_cta",ve),style:{color:qe,fontSize:"12px",fontWeight:600,textDecoration:"none"},children:_e}):null]}):null;return m.jsxs(rl,{productId:le,recommendationId:fe,exposureUrl:Pe,sessionId:v,triggerExposureUrl:I,className:`admesh-compact-tail-ad ${d}`,style:{all:"initial",boxSizing:"border-box",display:"block",fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",lineHeight:1.4,...c},children:[m.jsx("style",{children:`
192
+ `;function eh({value:s,onChange:l,onSend:d,onStop:c,onSuggestion:v,suggestions:M,registerSuggestion:N,open:q,onOpenChange:_,loading:y,analyzing:B,compact:C,expanded:W,suggestionPlacement:I="below",showLogo:A=!0,logoUrl:H,title:U,placeholder:ee,colors:te}){const re=x.useId(),ne=x.useRef(null),ie=x.useRef(null),Q=x.useRef(null),[O,fe]=x.useState({visibility:"hidden"}),le=q&&!y&&(B||M.length>0);x.useLayoutEffect(()=>{var oe;if(!le)return;const ue=()=>{var Pe,E;const V=(Pe=ne.current)==null?void 0:Pe.getBoundingClientRect();if(!V)return;const se=((E=window.visualViewport)==null?void 0:E.height)??window.innerHeight,ke=document.documentElement.clientWidth,Ee=se-V.bottom-16,f=V.top-16,P=I==="above"?!(f<96&&Ee>f):Ee<96&&f>Ee;fe({position:"fixed",left:Math.max(8,Math.min(V.left,ke-V.width-8)),width:Math.min(V.width,ke-16),maxHeight:Math.max(40,Math.min(300,P?f:Ee)),...P?{bottom:window.innerHeight-V.top+8}:{top:V.bottom+8},zIndex:2147483002})},xe=Pe=>{var E,V;const se=Pe.target;!((E=ne.current)!=null&&E.contains(se))&&!((V=Q.current)!=null&&V.contains(se))&&_(!1)};return ue(),window.addEventListener("resize",ue),window.addEventListener("scroll",ue,!0),(oe=window.visualViewport)==null||oe.addEventListener("resize",ue),document.addEventListener("pointerdown",xe),()=>{var Pe;window.removeEventListener("resize",ue),window.removeEventListener("scroll",ue,!0),(Pe=window.visualViewport)==null||Pe.removeEventListener("resize",ue),document.removeEventListener("pointerdown",xe)}},[le,I,_]);const ge=oe=>{var ue,xe;!((ue=ne.current)!=null&&ue.contains(oe))&&!((xe=Q.current)!=null&&xe.contains(oe))&&_(!1)},$e=()=>{!s.trim()||y||(_(!1),d())};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{ref:ne,className:"admesh-publisher-composer",onBlur:oe=>ge(oe.relatedTarget),onClick:oe=>{var ue;oe.target.closest("button, a")||((ue=ie.current)==null||ue.focus(),_(!0))},style:{display:"flex",alignItems:"center",gap:C?8:12,minWidth:0,width:"100%",flexShrink:0,border:`1px solid ${te.border}`,borderRadius:8,background:te.surface,cursor:"text",padding:C?"6px":"8px 8px 8px 12px"},children:[A&&!W&&m.jsx("div",{style:{width:C?24:32,height:C?24:32,display:"grid",placeItems:"center",flexShrink:0,color:te.accent},children:H?m.jsx("img",{src:H,alt:`${U} logo`,style:{width:"100%",height:"100%",objectFit:"contain"}}):m.jsx(tl,{size:C?18:21,strokeWidth:1.5,"aria-label":U})}),m.jsx("input",{ref:ie,type:"text",value:s,placeholder:ee,"aria-label":"Ask the publisher assistant","aria-expanded":le,"aria-controls":le?re:void 0,onFocus:()=>_(!0),onChange:oe=>{l(oe.target.value),_(!0)},onKeyDown:oe=>{var ue,xe;oe.nativeEvent.isComposing||(oe.key==="Escape"&&(oe.preventDefault(),_(!1)),oe.key==="ArrowDown"&&(oe.preventDefault(),le?(xe=(ue=Q.current)==null?void 0:ue.querySelector("button"))==null||xe.focus():_(!0)),oe.key==="Enter"&&(oe.preventDefault(),$e()))},style:{flex:1,minWidth:0,border:"none",outline:"none",padding:C?"6px 0":"10px 0",fontSize:C?13:15,color:te.text,background:"transparent"}}),m.jsxs("span",{style:{flexShrink:0,fontSize:C?8:9,lineHeight:1.3,color:te.muted,textAlign:"right",whiteSpace:"nowrap"},children:["powered by",m.jsx("br",{}),m.jsx("a",{href:"https://useadmesh.com",target:"_blank",rel:"noopener noreferrer",style:{fontWeight:600,color:"inherit",textDecoration:"underline",textUnderlineOffset:2,cursor:"pointer"},children:"AdMesh"})]}),m.jsx("button",{type:"button","aria-label":y?"Stop generating":"Send message",disabled:!y&&!s.trim(),onClick:y?c:$e,style:{display:"grid",placeItems:"center",flexShrink:0,width:C?32:40,height:C?32:40,border:"none",borderRadius:6,background:te.accent,color:te.accentText,cursor:"pointer",opacity:!y&&!s.trim()?.5:1},children:y?m.jsx(Yf,{size:14,fill:"currentColor","aria-hidden":"true"}):m.jsx(Kf,{size:18,"aria-hidden":"true"})})]}),le&&el.createPortal(m.jsxs("div",{ref:Q,id:re,role:"group","aria-label":"Suggested questions",className:"admesh-publisher-panel",onBlur:oe=>ge(oe.relatedTarget),onKeyDown:oe=>{var ue,xe,Pe,E;if(oe.key==="Escape"&&(oe.preventDefault(),(ue=ie.current)==null||ue.focus(),_(!1)),oe.key==="ArrowDown"||oe.key==="ArrowUp"){oe.preventDefault();const V=Array.from(((xe=Q.current)==null?void 0:xe.querySelectorAll("button"))??[]),se=V.indexOf(document.activeElement)+(oe.key==="ArrowDown"?1:-1);se<0?(Pe=ie.current)==null||Pe.focus():(E=V[Math.min(se,V.length-1)])==null||E.focus()}},style:{...O,"--publisher-accent":te.accent,padding:6,border:`1px solid ${te.border}`,borderRadius:10,background:te.surface,overflowY:"auto",overscrollBehavior:"contain",boxShadow:"0 8px 24px rgba(15,23,42,0.1)"},children:[m.jsx("style",{children:Td}),B&&!M.length?m.jsx("div",{role:"status",style:{padding:12,color:te.muted,fontSize:13},children:"Finding suggested questions\u2026"}):M.map(oe=>m.jsxs("button",{ref:N(oe.id),type:"button",className:"admesh-publisher-suggestion","data-admesh-sponsored":oe.is_sponsored?"true":void 0,onClick:()=>{_(!1),v(oe)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,width:"100%",minWidth:0,margin:"0 0 4px",padding:"10px 12px",border:`1px solid ${oe.is_sponsored?te.accent:te.border}`,borderRadius:6,textAlign:"left",fontSize:13,fontWeight:500,lineHeight:1.4,cursor:"pointer",background:oe.is_sponsored?te.accent:te.surface,color:oe.is_sponsored?te.accentText:te.text},children:[m.jsx("span",{children:oe.text}),oe.is_sponsored&&m.jsx("span",{style:{fontSize:10,flexShrink:0},children:"Ad"})]},oe.id))]}),document.body)]})}let Ao=!1;try{typeof globalThis.importMeta<"u"&&(Br=globalThis.importMeta.env)!=null&&Br.PROD&&(Ao=!0)}catch{}Ao||(Ao=typeof process<"u"&&!0||typeof process<"u"&&!0);const F={log:(...s)=>{Ao||console.log(...s)},warn:(...s)=>{Ao||console.warn(...s)},error:(...s)=>{console.error(...s)},info:(...s)=>{Ao||console.info(...s)},debug:(...s)=>{Ao||console.debug(...s)}};function th(s,l,d){const c=s*l>242500;return{visibilityThreshold:c?.3:.5,minimumDuration:1e3,isLargeAd:c,...d}}function nh(s){return s<768?"mobile":s<1024?"tablet":"desktop"}function rh(s){const l=s.getBoundingClientRect(),d=window.innerHeight||document.documentElement.clientHeight,c=window.innerWidth||document.documentElement.clientWidth,v=l.height,M=l.width;if(v===0||M===0)return 0;const N=Math.max(0,l.top),q=Math.min(d,l.bottom),_=Math.max(0,l.left),y=Math.min(c,l.right),B=Math.max(0,q-N),C=Math.max(0,y-_),W=B*C,I=v*M;return I>0?W/I:0}function Ld(){const s=window.innerHeight,l=document.documentElement.scrollHeight,d=window.pageYOffset||document.documentElement.scrollTop,c=l-s;return c<=0?100:Math.min(100,d/c*100)}function oh(s){const l=s.getBoundingClientRect(),d=window.pageYOffset||document.documentElement.scrollTop,c=window.pageXOffset||document.documentElement.scrollLeft;return{top:l.top+d,left:l.left+c}}function ah(s){const l=s.getBoundingClientRect(),d=oh(s),c=window.innerWidth||document.documentElement.clientWidth,v=window.innerHeight||document.documentElement.clientHeight,M=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return{pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,deviceType:nh(c),viewportWidth:c,viewportHeight:v,adWidth:l.width,adHeight:l.height,adPositionTop:d.top,adPositionLeft:d.left,isDarkMode:M,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}function ih(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}function sh(s,l,d){return s>=d.visibilityThreshold&&l>=d.minimumDuration}function Fd(s=new Date){return s.toISOString()}function lh(s){return s.length===0?0:s.reduce((l,d)=>l+d,0)/s.length}function $d(s,l){let d;return function(...c){d||(s(...c),d=!0,setTimeout(()=>d=!1,l))}}let uh={enabled:!0,apiEndpoint:"",enableBatching:!1,batchSize:10,batchTimeout:5e3,debug:!1,enableRetry:!1,maxRetries:3,retryDelay:1e3},dh=!1;function ch({productId:s,offerId:l,agentId:d,recommendationId:c,elementRef:v,config:M}){const N={...uh,...M},q=x.useRef(ih()),[_,y]=x.useState({isVisible:!1,isViewable:!1,visibilityPercentage:0,timeMetrics:{loadedAt:Fd(),totalVisibleDuration:0,totalViewableDuration:0,totalHoverDuration:0,totalFocusDuration:0},engagementMetrics:{currentScrollDepth:0,viewportEnterCount:0,viewportExitCount:0,hoverCount:0,wasClicked:!1,maxVisibilityPercentage:0,averageVisibilityPercentage:0},isTracking:N.enabled}),B=x.useRef(null),C=x.useRef(null),W=x.useRef(null),I=x.useRef(null),A=x.useRef(null),H=x.useRef([]),U=x.useRef([]),ee=x.useRef(null),te=x.useCallback(Q=>{N.debug&&F.log(`[AdMesh Viewability] ${Q}`)},[N.debug]),re=x.useCallback(async(Q,O)=>{if(!(!N.enabled||dh||!v.current||!B.current)&&(te(`Analytics disabled - skipping event: ${Q}`),N.onEvent)){const fe=ah(v.current),le={eventType:Q,timestamp:Fd(),sessionId:q.current,productId:s,offerId:l,agentId:d,recommendationId:c,timeMetrics:_.timeMetrics,engagementMetrics:_.engagementMetrics,contextMetrics:fe,mrcStandards:B.current,isViewable:_.isViewable,metadata:O};N.onEvent(le)}},[N,s,l,d,c,v,_,te]),ne=x.useCallback(async()=>{U.current.length!==0&&(te("Analytics disabled - clearing batch without sending"),U.current=[],ee.current&&(clearTimeout(ee.current),ee.current=null))},[te]),ie=x.useCallback($d(()=>{if(!v.current)return;const Q=rh(v.current),O=Date.now(),fe=new Date(_.timeMetrics.loadedAt).getTime();y(le=>{const ge={...le};Q>0&&H.current.push(Q);const $e=le.isVisible,oe=Q>0;if(oe&&!$e)C.current=O,ge.engagementMetrics.viewportEnterCount++,ge.timeMetrics.timeToFirstVisible||(ge.timeMetrics.timeToFirstVisible=O-fe,ge.engagementMetrics.scrollDepthAtFirstVisible=Ld(),re("ad_visible"));else if(!oe&&$e){if(C.current){const ue=O-C.current;ge.timeMetrics.totalVisibleDuration+=ue,C.current=null}ge.engagementMetrics.viewportExitCount++,re("ad_hidden")}else if(oe&&$e&&C.current){const ue=O-C.current;ge.timeMetrics.totalVisibleDuration+=ue,C.current=O}if(ge.isVisible=oe,ge.visibilityPercentage=Q,Q>ge.engagementMetrics.maxVisibilityPercentage&&(ge.engagementMetrics.maxVisibilityPercentage=Q),H.current.length>0&&(ge.engagementMetrics.averageVisibilityPercentage=lh(H.current)),B.current){const ue=le.isViewable,xe=sh(Q,ge.timeMetrics.totalVisibleDuration,B.current);if(xe&&!ue)ge.isViewable=!0,ge.timeMetrics.timeToViewable=O-fe,W.current=O,re("ad_viewable");else if(xe&&ue&&W.current){const Pe=O-W.current;ge.timeMetrics.totalViewableDuration+=Pe,W.current=O}}return ge.engagementMetrics.currentScrollDepth=Ld(),ge})},100),[v,_.timeMetrics.loadedAt,re]);return x.useEffect(()=>{if(!v.current)return;const Q=v.current.getBoundingClientRect();B.current=th(Q.width,Q.height,N.mrcStandards),te("Initialized MRC standards"),re("ad_loaded")},[v,N.mrcStandards,te,re]),x.useEffect(()=>{if(!N.enabled||!v.current)return;const Q=new IntersectionObserver(O=>{O.forEach(()=>{ie()})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});return Q.observe(v.current),()=>{Q.disconnect()}},[N.enabled,v,ie]),x.useEffect(()=>{if(!N.enabled)return;const Q=$d(()=>{ie()},100);return window.addEventListener("scroll",Q,{passive:!0}),()=>window.removeEventListener("scroll",Q)},[N.enabled,ie]),x.useEffect(()=>{if(!N.enabled||!v.current)return;const Q=v.current,O=()=>{I.current=Date.now(),y(le=>({...le,engagementMetrics:{...le.engagementMetrics,hoverCount:le.engagementMetrics.hoverCount+1}})),re("ad_hover_start")},fe=()=>{if(I.current){const le=Date.now()-I.current;y(ge=>({...ge,timeMetrics:{...ge.timeMetrics,totalHoverDuration:ge.timeMetrics.totalHoverDuration+le}})),I.current=null,re("ad_hover_end",{hoverDuration:le})}};return Q.addEventListener("mouseenter",O),Q.addEventListener("mouseleave",fe),()=>{Q.removeEventListener("mouseenter",O),Q.removeEventListener("mouseleave",fe)}},[N.enabled,v,re]),x.useEffect(()=>{if(!N.enabled||!v.current)return;const Q=v.current,O=()=>{A.current=Date.now(),re("ad_focus")},fe=()=>{if(A.current){const le=Date.now()-A.current;y(ge=>({...ge,timeMetrics:{...ge.timeMetrics,totalFocusDuration:ge.timeMetrics.totalFocusDuration+le}})),A.current=null,re("ad_blur",{focusDuration:le})}};return Q.addEventListener("focus",O),Q.addEventListener("blur",fe),()=>{Q.removeEventListener("focus",O),Q.removeEventListener("blur",fe)}},[N.enabled,v,re]),x.useEffect(()=>{if(!N.enabled||!v.current)return;const Q=v.current,O=()=>{y(fe=>({...fe,engagementMetrics:{...fe.engagementMetrics,wasClicked:!0}})),re("ad_click")};return Q.addEventListener("click",O),()=>{Q.removeEventListener("click",O)}},[N.enabled,v,re]),x.useEffect(()=>()=>{const Q=Date.now(),O=new Date(_.timeMetrics.loadedAt).getTime(),fe=Q-O;y(le=>({...le,timeMetrics:{...le.timeMetrics,sessionDuration:fe}})),re("ad_unloaded",{sessionDuration:fe}),ne()},[]),_}const rl=({productId:s,offerId:l,agentId:d,recommendationId:c,exposureUrl:v,sessionId:M,triggerExposureUrl:N=!0,children:q,config:_,className:y,style:B,onViewabilityChange:C,onVisible:W,onViewable:I,onClick:A})=>{const H=x.useRef(null),U=x.useRef(!1),ee=ch({productId:s,offerId:l,agentId:d,recommendationId:c,elementRef:H,config:_}),te=x.useRef(ee.isViewable);x.useEffect(()=>{U.current=!1,te.current=!1},[v,c,M]),x.useEffect(()=>{ee.isViewable!==te.current&&(te.current=ee.isViewable,C&&C(ee.isViewable),ee.isViewable&&I&&I(),ee.isViewable&&!U.current&&N&&(F.log("[AdMeshViewabilityTracker] \u{1F3AF} Ad is viewable, checking exposure pixel requirements:",{exposureUrl:v?"present":"MISSING",sessionId:M?"present":"MISSING",recommendationId:c}),v&&M?(U.current=!0,F.log("[AdMeshViewabilityTracker] \u{1F525} Firing exposure pixel:",v),fetch(v,{method:"GET",keepalive:!0}).then(()=>{F.log("[AdMesh] \u2705 Exposure pixel fired successfully")}).catch(ie=>{F.warn("[AdMesh] \u26A0\uFE0F Failed to fire exposure pixel:",ie),U.current=!1})):F.warn("[AdMeshViewabilityTracker] \u26A0\uFE0F Cannot fire exposure pixel - missing required data:",{hasExposureUrl:!!v,hasSessionId:!!M})))},[ee.isViewable,C,I,v,M,c,N]);const re=x.useRef(ee.isVisible);x.useEffect(()=>{ee.isVisible!==re.current&&(re.current=ee.isVisible,ee.isVisible&&W&&W())},[ee.isVisible,W]);const ne=()=>{A&&A()};return m.jsx("div",{ref:H,className:y,style:B,onClick:ne,"data-admesh-viewability-tracker":!0,"data-recommendation-id":c,"data-is-viewable":ee.isViewable,"data-is-visible":ee.isVisible,"data-visibility-percentage":ee.visibilityPercentage.toFixed(2),children:q})};rl.displayName="AdMeshViewabilityTracker";const Od=s=>{try{return new URL(s),!0}catch{return!1}},na=s=>typeof s=="string"?s.trim():typeof s=="number"?String(s):"",Jn=s=>na(s)||void 0,ph=s=>s&&s.trim()?s.trim():"",mh=(s,l)=>{if(s==null||s==="")return"";if(typeof s=="number")try{return new Intl.NumberFormat("en-US",{style:"currency",currency:l||"USD",maximumFractionDigits:2}).format(s)}catch{return String(s)}return na(s)},Wd=({recommendations:s,theme:l,className:d="",style:c={},sessionId:v,triggerExposureUrl:M=!0,onDelegationConsent:N,onDelegationActivated:q,onStartDelegation:_,onRecommendationReport:y})=>{var B,C,W,I,A,H,U,ee,te;if(!s||s.length===0)return F.log("[AdMesh Compact Tail Ad] No recommendations provided - not rendering"),null;const re=s[0],ne=re?.recommendation,ie=ne?.creative,Q=re?.tracking,O=re?.delegation,fe=re?.recommendation_id||"",le=ne?.offerId||"",ge=ie?.brand_name||"",$e=ie?.headline||"",oe=ie?.description||"",ue=ie?.logo_url||"",xe=Q?.click_url||ie?.landing_page_url||"",Pe=Q?.exposure_url||"",E=ne?.disclosure||"Sponsored",V=ie?.products||[],se=V.slice(0,4),ke=V.length>1,Ee=(ne?.format||"tail")==="bridge",f=O?.available===!0,P=Ee&&f,G=O?.brand_name||ge,Y="Talk to Agent",_e=ph(ie?.cta_text),ye=!ke&&!!_e&&!!xe;if(!ge&&!$e&&!oe)return F.log("[AdMesh Compact Tail Ad] No valid recommendation data provided - not rendering",{recommendationId:fe}),null;const ze=$e&&$e!==ge?$e:ge,Le=oe,De=ge.trim().toLowerCase(),Ne=ze.trim().toLowerCase(),Be=!!ge&&De!==Ne,[qt,ae]=x.useState(!1),[ce,be]=x.useState(!1),[Me,je]=x.useState(!1),[J,Oe]=x.useState(null),X=x.useRef(null);x.useEffect(()=>()=>{X.current&&(X.current(!1),X.current=null)},[]);const Ve=ve=>{var tt;ve&&be(!0),(tt=X.current)==null||tt.call(X,ve),X.current=null,ve||(be(!1),ae(!1))},Ge=async()=>N?await N(re):await new Promise(ve=>{X.current=ve,ae(!0)}),K=(ve,tt)=>{tt&&tt.stopPropagation(),typeof window<"u"&&window.admeshTracker&&window.admeshTracker.trackClick({recommendationId:fe,productId:le,clickUrl:xe,source:ve}).catch(()=>{F.error(`[AdMesh] Failed to track ${ve} click`)})},Je=[{value:"irrelevant",label:"Not relevant"},{value:"misleading",label:"Misleading"},{value:"inappropriate",label:"Inappropriate"},{value:"broken_link",label:"Broken link"},{value:"other",label:"Other"}],Fe=ve=>{ve.preventDefault(),ve.stopPropagation(),!J&&je(tt=>!tt)},un=async(ve,tt)=>{if(ve.preventDefault(),ve.stopPropagation(),je(!1),Oe(tt),!!y)try{await y({recommendation:re,recommendation_id:fe,reason:tt,session_id:v})}catch(Jt){F.warn("[AdMesh Compact Tail Ad] Failed to submit recommendation report:",Jt)}},it=()=>{ke||!xe||(K("compact_tail_ad_card"),typeof window<"u"&&window.open(xe,"_blank","noopener,noreferrer"))},Kt=ve=>{ke||!xe||(ve.key==="Enter"||ve.key===" ")&&(ve.preventDefault(),it())},Mn=async()=>{if(fe&&v)try{const ve=typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com",tt=await fetch(`${ve}/click/bridge-engagement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({recommendation_id:fe,session_id:v,is_test:!1})});tt.ok||F.warn("[AdMesh Compact Tail Ad] Delegation engagement tracking failed:",tt.statusText)}catch(ve){F.error("[AdMesh Compact Tail Ad] Error tracking delegation engagement:",ve)}},Io=async ve=>{if(ve.preventDefault(),ve.stopPropagation(),!re||!P||(K("compact_tail_ad_delegation_cta"),!await Ge()))return;Mn();const tt=O!=null&&O.available?{recommendation_id:re.recommendation_id,brand_id:Jn(O.brand_id),brand_name:Jn(O.brand_name||ie?.brand_name),mcp_endpoint:Jn(O.mcp_endpoint),eligibility_reason:Jn(O.eligibility_reason),delegate_reason:Jn(O.delegate_reason),session_goal:Jn(O.session_goal),desired_outcome_type:O.desired_outcome_type,required_user_inputs:Array.isArray(O.required_user_inputs)?O.required_user_inputs.filter(Jt=>typeof Jt=="string"):[],required_consent_types:Array.isArray(O.required_consent_types)?O.required_consent_types.filter(Jt=>typeof Jt=="string"):[],success_outcome:Jn(O.success_outcome),fallback_message:Jn(O.fallback_message),session_mode:Jn(O.session_mode),status:Jn(O.status),capabilities:O.capabilities||[],allowed_data_types:O.allowed_data_types||[],consent_requirements:O.consent_requirements||[],auth_model:Jn(O.auth_model),handoff_protocol:O.handoff_protocol&&typeof O.handoff_protocol=="object"?O.handoff_protocol:void 0,supported_actions:O.supported_actions||[],metadata:O.metadata&&typeof O.metadata=="object"?O.metadata:void 0,platform_response:re}:null;if(q&&tt){try{await q(tt)}finally{be(!1),ae(!1)}return}if(_){try{await _(re)}finally{be(!1),ae(!1)}return}be(!1),ae(!1)},[vn,Vr]=x.useState(!1),Xt=l?.mode==="dark"||typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Dt=l?.surfaceColor||((C=(B=l?.components)==null?void 0:B.card)==null?void 0:C.backgroundColor)||(Xt?"#111827":"#ffffff"),ot=l?.borderColor||((I=(W=l?.components)==null?void 0:W.card)==null?void 0:I.borderColor)||(Xt?"rgba(255, 255, 255, 0.10)":"rgba(15, 23, 42, 0.08)"),mt=((A=l?.shadows)==null?void 0:A.medium)||((U=(H=l?.components)==null?void 0:H.card)==null?void 0:U.boxShadow)||(Xt?"0 8px 18px rgba(0, 0, 0, 0.28)":"0 8px 18px rgba(15, 23, 42, 0.08)"),qe="#2563eb",dn=Xt?"#9ca3af":"#6b7280",Ur=Xt?"#e5e7eb":"#374151",mn=Xt?"#f9fafb":"#0f172a",me=Xt?"rgba(255, 255, 255, 0.04)":"#f8fafc",fn="50px",xn=P||ye?m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[P?m.jsx("button",{type:"button",onClick:Io,style:{background:"none",border:"none",padding:0,color:qe,fontSize:"12px",fontWeight:500,cursor:"pointer",textDecoration:"none"},children:Y}):null,ye?m.jsx("a",{href:xe,target:"_blank",rel:"noopener noreferrer",onClick:ve=>K("compact_tail_ad_cta",ve),style:{color:qe,fontSize:"12px",fontWeight:600,textDecoration:"none"},children:_e}):null]}):null;return m.jsxs(rl,{productId:le,recommendationId:fe,exposureUrl:Pe,sessionId:v,triggerExposureUrl:M,className:`admesh-compact-tail-ad ${d}`,style:{all:"initial",boxSizing:"border-box",display:"block",fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",lineHeight:1.4,...c},children:[m.jsx("style",{children:`
183
193
  .admesh-compact-tail-ad,
184
194
  .admesh-compact-tail-ad * {
185
195
  box-sizing: border-box;
@@ -232,9 +242,9 @@ Error generating stack: `+r.message+`
232
242
  min-height: 34px;
233
243
  }
234
244
  }
235
- `}),m.jsxs("div",{role:!ke&&xe?"link":void 0,tabIndex:!ke&&xe?0:void 0,style:{display:"flex",flexDirection:"column",gap:"10px",padding:"12px",borderRadius:l?.borderRadius||((te=(ee=l?.components)==null?void 0:ee.card)==null?void 0:te.borderRadius)||"14px",border:`1px solid ${ot}`,background:Rt,boxShadow:mt,minWidth:0,cursor:!ke&&xe?"pointer":void 0},onClick:it,onKeyDown:Kt,children:[m.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"flex-start",minWidth:0},children:[m.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"10px",flexShrink:0,overflow:"hidden",background:Xt?"#1f2937":"#eff6ff",display:"flex",alignItems:"center",justifyContent:"center"},children:!yn&&ue&&Od(ue)?m.jsx("img",{src:ue,alt:`${ge} logo`,style:{width:"100%",height:"100%",objectFit:"contain",padding:"6px",background:"#ffffff"},onError:()=>Vr(!0)}):m.jsx("span",{style:{fontSize:"14px",fontWeight:700,color:dn},children:(ge||"A").charAt(0).toUpperCase()})}),m.jsxs("div",{style:{flex:1,minWidth:0},children:[m.jsxs("div",{className:"admesh-compact-meta-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"4px"},children:[m.jsx("div",{className:"admesh-compact-line-clamp-1",style:{fontSize:"11px",color:dn},children:Be?ge:""}),m.jsx("span",{style:{flexShrink:0,fontSize:"10px",color:dn,textTransform:"uppercase",letterSpacing:"0.08em"},children:E})]}),!ke&&m.jsx("div",{className:"admesh-compact-line-clamp-2",style:{fontSize:"14px",lineHeight:1.3,fontWeight:700,color:pn,marginBottom:"4px"},title:ze,children:ze}),Le&&m.jsx("p",{className:"admesh-compact-line-clamp-2",style:{margin:0,fontSize:"12px",lineHeight:1.35,color:Ur},title:Le,children:Le})]})]}),ke&&m.jsx("div",{className:"admesh-compact-tail-scroll",style:{display:"flex",gap:"8px",overflowX:"auto",paddingBottom:"2px"},children:se.map(ve=>{const tt=na(ve.product_name)||"Product",Jt=na(ve.product_link)||na(ve.product_url)||xe||"#",Io=ch(ve.product_price,ve.product_currency),Yn=na(ve.product_image_url),cr=Yn&&Od(Yn)?Yn:"",jo=Jt!=="#";return m.jsx("a",{href:Jt,target:jo?"_blank":void 0,rel:jo?"noopener noreferrer":void 0,onClick:Qr=>K(`compact_tail_ad_product_${ve.product_id||"item"}`,Qr),style:{minWidth:"220px",maxWidth:"220px",display:"block",textDecoration:"none",color:"inherit",border:`1px solid ${ot}`,borderRadius:"12px",background:me,padding:"8px",flexShrink:0},children:m.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start"},children:[m.jsx("div",{style:{width:"34px",height:"34px",borderRadius:"8px",overflow:"hidden",flexShrink:0,background:Xt?"#374151":"#e5e7eb",display:"flex",alignItems:"center",justifyContent:"center",color:dn,fontSize:"12px",fontWeight:700},children:cr?m.jsx("img",{src:cr,alt:tt,style:{width:"100%",height:"100%",objectFit:"cover"}}):tt.charAt(0).toUpperCase()}),m.jsxs("div",{style:{minWidth:0,flex:1},children:[m.jsx("div",{style:{fontSize:"12px",lineHeight:1.25,fontWeight:600,color:pn,marginBottom:"4px",whiteSpace:"normal",wordBreak:"break-word"},title:tt,children:tt}),m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:Io&&m.jsx("span",{style:{fontSize:"12px",fontWeight:700,color:pn},children:Io})})]})]})},ve.product_id||`${fe}-${tt}`)})}),m.jsxs("div",{className:"admesh-compact-footer-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",flexWrap:"wrap",marginLeft:ke?0:mn},children:[m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0,flexWrap:"wrap"},children:vn}),m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",gap:"8px",marginLeft:"auto",flexShrink:0},children:[ke&&V.length>se.length?m.jsxs("span",{style:{fontSize:"10px",color:dn},children:["+",V.length-se.length," more"]}):null,m.jsx("button",{type:"button","aria-label":J?"Recommendation reported":"Report recommendation",title:J?"Reported":"Report recommendation",disabled:!!J,onClick:Fe,style:{width:"28px",height:"28px",borderRadius:"999px",border:`1px solid ${ot}`,background:J?me:Rt,color:J?qe:dn,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,cursor:J?"default":"pointer",flexShrink:0},children:m.jsx(Xf,{size:13})})]})]}),Ie?m.jsx("div",{className:"admesh-compact-report-panel",onClick:ve=>ve.stopPropagation(),style:{marginLeft:ke?0:mn,border:`1px solid ${ot}`,borderRadius:"12px",background:me,padding:"8px",display:"flex",flexWrap:"wrap",gap:"6px"},children:Je.map(ve=>m.jsx("button",{className:"admesh-compact-report-option",type:"button",onClick:tt=>un(tt,ve.value),style:{borderRadius:"999px",border:`1px solid ${ot}`,background:Rt,color:pn,fontSize:"11px",fontWeight:600,padding:"6px 9px",cursor:"pointer"},children:ve.label},ve.value))}):null,J?m.jsx("div",{className:"admesh-compact-report-status",style:{marginLeft:ke?0:mn,fontSize:"11px",color:dn},children:"Thanks for reporting this recommendation."}):null,qt?m.jsxs("div",{style:{marginTop:"2px",border:`1px solid ${ot}`,borderRadius:"12px",background:me,padding:"12px",display:"flex",flexDirection:"column",gap:"10px"},children:[m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:qe},children:"Confirm Agent Access"}),m.jsxs("div",{style:{fontSize:"13px",lineHeight:1.4,color:pn,fontWeight:600},children:["Allow ",G||"this brand"," to start a delegated session?"]}),m.jsx("div",{style:{fontSize:"12px",lineHeight:1.45,color:Ur},children:"The agent will only use the details you choose to share for this request."})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[m.jsx("button",{type:"button",disabled:ce,onClick:ve=>{ve.preventDefault(),ve.stopPropagation(),!ce&&Ve(!1)},style:{borderRadius:"10px",border:`1px solid ${ot}`,background:Rt,color:pn,fontSize:"12px",fontWeight:600,padding:"8px 12px",cursor:ce?"not-allowed":"pointer",opacity:ce?.65:1},children:"Not now"}),m.jsx("button",{type:"button",disabled:ce,onClick:ve=>{ve.preventDefault(),ve.stopPropagation(),!ce&&Ve(!0)},style:{borderRadius:"10px",border:"none",background:qe,color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 12px",cursor:ce?"wait":"pointer",opacity:ce?.86:1},children:ce?"Connecting...":"Allow agent"})]})]}):null]})]})},ph=({recommendations:s,theme:l,className:d,style:c,sessionId:v,onDelegationConsent:I,onDelegationActivated:D,onStartDelegation:q})=>{const _=s.filter(B=>B&&typeof B=="object"&&typeof B.recommendation_id=="string"&&B.recommendation_id.length>0);if(!_||_.length===0)return F.log("[AdMeshLayout] Empty or invalid recommendations array - not rendering anything"),null;F.log(`[AdMeshLayout] Rendering with ${_.length} valid recommendations`);const y=()=>{var B;if(_.length>0){const C=_[0],W=(B=C.recommendation)==null?void 0:B.format;F.log("[AdMeshLayout] \u{1F50D} Checking format:",{preferredFormat:W,recommendationKeys:Object.keys(C||{})}),(W==="product_card"||W==="weave"||W==="bridge")&&F.warn(`[AdMeshLayout] ${W} format requested, falling back to tail for canonical render payload`)}return m.jsx(Wd,{recommendations:_,theme:l,sessionId:v,onDelegationConsent:I,onDelegationActivated:D,onStartDelegation:q})};return m.jsx("div",{className:`admesh-layout ${d}`,style:{fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',...c},children:y()})};class mh{constructor(l){Hr(this,"firedExposures",new Set),Hr(this,"debug",!1),Hr(this,"mrcThreshold",{visibilityPercentage:50,minimumDurationMs:1e3}),this.debug=l.debug||!1}fireExposure(l,d,c){const v=`${c}_${d}`;if(this.firedExposures.has(v)){this.debug&&F.log("[Tracker] Exposure already fired");return}this.firedExposures.add(v);try{fetch(l,{method:"GET",keepalive:!0}).catch(()=>{this.debug&&F.warn("[Tracker] Failed to fire exposure")}),this.debug&&F.log("[Tracker] Fired MRC-compliant exposure")}catch{this.debug&&F.error("[Tracker] Error firing exposure")}}async fireExposureWithMRCCompliance(l,d,c,v){const I=`${c}_${d}`;if(this.firedExposures.has(I)){this.debug&&F.log("[Tracker] MRC exposure already fired");return}return new Promise(D=>{let q=null,_=null;const y=new IntersectionObserver(C=>{C.forEach(W=>{W.intersectionRatio*100>=this.mrcThreshold.visibilityPercentage?q===null&&(q=Date.now(),this.debug&&F.log("[Tracker] Ad reached MRC visibility threshold"),_=setTimeout(()=>{this.fireExposure(l,d,c),y.disconnect(),D()},this.mrcThreshold.minimumDurationMs)):q!==null&&(_&&(clearTimeout(_),_=null),q=null,this.debug&&F.log("[Tracker] Ad visibility dropped below MRC threshold"))})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});y.observe(v);const B=setTimeout(()=>{y.disconnect(),_&&clearTimeout(_),D()},3e4);v.__admeshTrackerCleanup=()=>{y.disconnect(),_&&clearTimeout(_),clearTimeout(B)}})}clearFiredExposures(){this.firedExposures.clear()}getMRCThreshold(){return{...this.mrcThreshold}}setMRCThreshold(l){this.mrcThreshold={...this.mrcThreshold,...l}}fireFollowupExposure(l,d,c){this.fireExposure(l,d,c)}fireFollowupEngagement(l,d,c){return fetch(l,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})}).catch(v=>{this.debug&&F.warn("[Tracker] Failed to fire followup engagement (non-critical):",v)}).then(()=>{})}}function fh(s){const l=s.split("/").filter(Boolean),d=(l[l.length-1]||l[l.length-2]||"").replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return d?d.replace(/\b\w/g,c=>c.toUpperCase()):"This page"}function hh(){var s;try{console.log("[AdMesh] Starting direct headings extraction...");const l=_=>_.replace(/\s+/g," ").trim(),d=()=>{var _;const y=["article","main article","main",'[role="main"]',"[data-admesh-article]",".article-content",".post-content",".entry-content",".content"],B=["script","style","noscript","svg","canvas","iframe","nav","header","footer","aside",'[aria-hidden="true"]',"[data-admesh-ignore]",".admesh-publisher-assistant-root",".admesh-publisher-assistant-reactMount",".admesh-publisher-assistant-floating",".admesh-publisher-assistant-inline"].join(","),C=(((_=y.map(M=>document.querySelector(M)).filter(M=>!!M).map(M=>{const A=M.cloneNode(!0);A.querySelectorAll(B).forEach(U=>U.remove());const H=l(A.textContent||"");return{element:M,text:H}}).filter(M=>M.text.length>=200).sort((M,A)=>A.text.length-M.text.length)[0])==null?void 0:_.element)||document.body).cloneNode(!0);C.querySelectorAll(B).forEach(M=>M.remove());const W=Array.from(C.querySelectorAll("h1, h2, h3, p, li, blockquote")).map(M=>l(M.textContent||"")).filter(M=>M.length>=24);return(W.length>0?W.join(`
236
- `):l(C.textContent||"")).slice(0,6e3)},c=fh(window.location.pathname||"/"),v=l(document.title||"")||c,I=(()=>{const _=[],y=document.querySelectorAll("h1, h2, h3, h4, h5, h6");return Array.from(y).forEach(B=>{const C=l(B.textContent||"");C.length>0&&_.push(C)}),_})(),D=I.length>0?I:[v||c],q={title:v,headings:D,article_text:d(),url:window.location.href,domain:window.location.hostname,extracted_at:new Date().toISOString()};return console.log("[AdMesh] Extracted headings:",{title:q.title,headingsCount:q.headings.length,articleTextLength:((s=q.article_text)==null?void 0:s.length)||0,domain:q.domain}),q}catch(l){return console.error("[AdMesh] Error in direct headings extraction:",l),null}}function gh(s){return!!(s&&typeof s=="object"&&"recommendation_id"in s&&"status"in s)}function bh(s){var l,d,c,v,I,D,q,_,y,B,C;if(!s||typeof s!="object")return;if(gh(s))return s;const W=s;if(!W.recommendation_id)return;const M=(W.products||[]).map(A=>{var H,U;return{product_id:A.product_id||"",product_link:A.product_link||A.product_click_url||W.click_url||W.url||"",product_name:A.product_name||W.title||((H=W.creative_input)==null?void 0:H.product_name)||"",product_description:A.product_description||"",product_price:A.product_price??void 0,product_discount:A.product_discount??void 0,product_currency:A.product_currency,product_discount_type:A.product_discount_type,product_cta_label:A.product_cta_label||((U=W.creative_input)==null?void 0:U.cta_label),product_image_url:A.product_image_url,product_features:A.product_features}});return{spec_version:"1.0",recommendation_id:W.recommendation_id,timestamp:new Date().toISOString(),status:"generated",ttl_ms:3e5,recommendation:{format:W.preferred_format||"tail",disclosure:"Sponsored",creative:{brand_name:((l=W.creative_input)==null?void 0:l.brand_name)||"",headline:W.title||((d=W.creative_input)==null?void 0:d.product_name)||"",description:((c=W.creative_input)==null?void 0:c.short_description)||((v=W.creative_input)==null?void 0:v.long_description)||"",cta_text:((I=W.creative_input)==null?void 0:I.cta_label)||((D=M[0])==null?void 0:D.product_cta_label)||"Learn more",follow_up_suggestion:W.follow_up_suggestion,logo_url:(_=(q=W.creative_input)==null?void 0:q.assets)==null?void 0:_.logo_url,image_urls:((B=(y=W.creative_input)==null?void 0:y.assets)==null?void 0:B.image_urls)||[],landing_page_url:W.url||W.click_url||((C=W.creative_input)==null?void 0:C.cta_url)||"",products:M}},tracking:{exposure_url:W.exposure_url,click_url:W.click_url,followup_exposure_url:W.followup_exposure_url,followup_engagement_url:W.followup_engagement_url}}}function yh(s){return{...s,suggestions:(s.suggestions||[]).map(l=>({...l,recommendation:bh(l.recommendation)}))}}function Hd(s){try{const l=new URL(s).pathname.split("/").filter(d=>d.length>0);return l[l.length-1]||void 0}catch{return}}async function vh(s,l){var d,c,v,I,D;try{console.log("[AdMesh SDK] Starting ACIE analyze-intent call...",{url:s.url});const q=Array.isArray(s.headings)?s.headings:[],_=(d=Hd(s.url))==null?void 0:d.replace(/[-_]+/g," ").replace(/\s+/g," ").trim(),y=_?_.replace(/\b\w/g,te=>te.toUpperCase()):void 0,B=l.apiKey.toLowerCase().startsWith("pub_")?Hd(s.url):void 0,C=l.extension?"extension":"admesh_ui_sdk",W=(s.domain||(typeof window<"u"?window.location.hostname:"")).trim().toLowerCase(),M={url:s.url,title:s.title||void 0,headings:q.length>0?q:y?[y]:void 0,article_text:((c=s.article_text)==null?void 0:c.trim())||void 0,domain:W,article_slug:B,agent_id:void 0,cpx_floor:void 0,source:C,api_key:l.apiKey,user_id:l.userId||void 0};console.log("[AdMesh SDK] Payload prepared:",{url:M.url,titleLength:((v=M.title)==null?void 0:v.length)||0,headingsCount:((I=M.headings)==null?void 0:I.length)||0,articleTextLength:((D=M.article_text)==null?void 0:D.length)||0,domain:M.domain,article_slug:M.article_slug,source:M.source,has_user_id:!!M.user_id});const A=`${l.apiBaseUrl}/acie/analyze-intent`;console.log("[AdMesh SDK] Calling ACIE API:",A);const H=await fetch(A,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l.apiKey}`},body:JSON.stringify(M)});if(console.log("[AdMesh SDK] ACIE API response received:",{status:H.status,statusText:H.statusText,ok:H.ok}),!H.ok){const te=await H.text();throw console.error("[AdMesh SDK] ACIE API error:",{status:H.status,statusText:H.statusText,errorText:te}),new Error(`ACIE API error: ${H.status} - ${te}`)}const U=await H.json(),ee=yh(U);return console.log("[AdMesh SDK] ACIE analysis completed:",{url:s.url,suggestionsCount:ee.suggestions.length}),ee}catch(q){return console.error("[AdMesh SDK] Error calling ACIE analyze-intent endpoint:",q),null}}async function xh(s,l){var d,c;const v=(l.apiBaseUrl||"https://api.useadmesh.com").replace(/\/$/,""),I=new URLSearchParams({url:s.trim()});(d=l.agentDisplayId)!=null&&d.trim()&&I.set("agent_display_id",l.agentDisplayId.trim()),(c=l.publisherId)!=null&&c.trim()&&I.set("publisher_id",l.publisherId.trim());const D=await fetch(`${v}/publisher-assistant/page-context?${I.toString()}`,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${l.apiKey}`}});if(!D.ok){const q=await D.text().catch(()=>"");throw new Error(`Page context request failed (${D.status}): ${q||D.statusText}`)}return await D.json()}function wh(){if(typeof window>"u")return!1;try{return window.self!==window.top}catch{return!0}}function kh(){var s;if(typeof window>"u")return null;try{const l=(s=window.location.href)==null?void 0:s.trim();if(Bd(l))return l}catch{return null}return null}function Bd(s){const l=s?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return d.protocol==="http:"||d.protocol==="https:"}catch{return!1}}function _h(s){try{const l=new URL(s),d=l.pathname.split("/").filter(Boolean),c=(d[d.length-1]||d[d.length-2]||l.hostname).replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return c?c.replace(/\b\w/g,v=>v.toUpperCase()):l.hostname}catch{return"This page"}}function Vd(s){const l=new URL(s),d=_h(s);return{title:d,headings:[d],article_text:`Article URL: ${s}
237
- Article topic inferred from URL path: ${d}`,url:s,domain:l.hostname,extracted_at:new Date().toISOString()}}const Sh=6e4,Ud=3;function Ch(s){const l=kh();if(l)return l;const d=s?.trim();return Bd(d)?d:null}const Qd=({apiKey:s,skipSdkInitialization:l=!1,sessionId:d,extension:c,theme:v,apiBaseUrl:I,language:D,location:q,userId:_,model:y,messages:B,pageContext:C,articleUrl:W,contextMode:M="auto",agentDisplayId:A,children:H})=>{const[U,ee]=x.useState(null),[te,re]=x.useState(new Set),[ne,ie]=x.useState(new Map),[Q,O]=x.useState(null),[fe,le]=x.useState([]),[ge,$e]=x.useState(!1),[oe,ue]=x.useState(null),[xe,Pe]=x.useState(!1),E=x.useRef(!1),V=x.useRef(0),se=x.useRef(null),ke=x.useRef(null);ke.current=Q;const Ee=!!C||M==="ad-slot"||M==="auto"&&(!!(W!=null&&W.trim())||wh()),f=x.useCallback(async()=>{if(C)return C;if(!Ee)return hh();const ae=Ch(W);if(!ae)return F.warn("[AdMeshProvider] Ad-slot context mode requires a real article URL"),ue("Article URL is required for ad-slot context"),null;if(!s)return F.warn("[AdMeshProvider] Cannot fetch page context: missing API key"),Vd(ae);try{Pe(!0);const ce=await xh(ae,{apiKey:s,apiBaseUrl:I||"https://api.useadmesh.com",agentDisplayId:A});return F.log("[AdMeshProvider] Page context resolved",{source:ce.source,cache_hit:ce.cache_hit,domain:ce.context.domain}),ce.context}catch(ce){return F.error("[AdMeshProvider] Failed to fetch page context:",ce),F.warn("[AdMeshProvider] Falling back to URL-path context for suggestions"),Vd(ae)}finally{Pe(!1)}},[A,I,s,W,C,Ee]),P=x.useCallback((ae,ce)=>{const be=ae.filter(Ie=>!Ie.is_sponsored).slice(0,3);return[ce,...be]},[]),G=x.useCallback((ae,ce)=>{const be=ae.find(je=>je.is_sponsored),Ie=ce.filter(je=>!je.is_sponsored).slice(0,3);return be?[be,...Ie]:Ie},[]);x.useEffect(()=>{if(!d||d.trim()===""){F.error("[AdMeshProvider] sessionId is required and must be provided by the platform. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}F.log("[AdMeshProvider] \u2705 Session ID available:",d)},[d]),x.useEffect(()=>{if(!l){if(!s){F.warn("[AdMeshProvider] \u26A0\uFE0F AdMesh API key not configured");return}if(!d||d.trim()===""){F.error("[AdMeshProvider] Cannot initialize SDK: sessionId is required. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}try{const ae=new Kd({apiKey:s,theme:v,apiBaseUrl:I,extension:c});ee(ae),F.log("[AdMeshProvider] \u2705 AdMesh SDK initialized with session:",d),I&&F.log("[AdMeshProvider] \u{1F4CD} Using custom API base URL")}catch(ae){F.error("[AdMeshProvider] Failed to initialize AdMesh SDK:",ae)}return()=>{F.log("[AdMeshProvider] \u{1F9F9} Provider unmounted")}}},[s,v,I,d,c,l]);const Y=x.useCallback(async ae=>{var ce;if(!s){F.warn("[AdMeshProvider] \u26A0\uFE0F Cannot perform intent analysis: missing API key");return}if(c)F.log("[AdMeshProvider] \u2139\uFE0F Extension mode: allowing intent analysis for any API key");else if(!s.toLowerCase().startsWith("pub_")){F.log('[AdMeshProvider] \u2139\uFE0F Skipping auto intent analysis: API key does not start with "pub_"');return}try{$e(!0),ue(null),F.log("[AdMeshProvider] \u{1F504} Starting automatic intent analysis...");const be=ae??await f();if(!be){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract headings for intent analysis"),ue("Failed to extract page content");return}F.log("[AdMeshProvider] \u{1F4C4} Extracted headings:",{title:be.title,headingsCount:be.headings.length,articleTextLength:((ce=be.article_text)==null?void 0:ce.length)||0,domain:be.domain});const Ie=await vh(be,{apiKey:s,apiBaseUrl:I||"https://api.useadmesh.com",extension:c,userId:_});Ie?(F.log("[AdMeshProvider] \u2705 Intent analysis completed:",{suggestionsCount:Ie.suggestions.length,suggestions:(Ie.suggestions||[]).map(je=>{var J;return{id:je.id,text:je.text,is_sponsored:je.is_sponsored,recommendationId:((J=je.recommendation)==null?void 0:J.recommendation_id)||null}})}),le(je=>G(je,Ie.suggestions||[]))):(F.warn("[AdMeshProvider] \u26A0\uFE0F Intent analysis returned null"),ue("Intent analysis failed"),le(je=>je.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after null intent analysis result"),je):[{id:"fallback-1",text:"What are your questions about this content?",type:"information",is_sponsored:!1,recommendation:void 0}]))}catch(be){F.error("[AdMeshProvider] Error in intent analysis:",be),ue("Intent analysis error"),le(Ie=>Ie.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after intent analysis error"),Ie):[{id:"error-fallback-1",text:"Ask me questions about this page",type:"information",is_sponsored:!1,recommendation:void 0}])}finally{$e(!1)}},[s,I,c,_,G,f]),_e=x.useCallback(async ae=>{var ce,be,Ie,je,J,Oe;if(!U||!s||!s.toLowerCase().startsWith("pub_"))return;const X=ae??await f();if(!X){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract page content for sponsored suggestion prefetch");return}const Ve=((be=(ce=X.headings)==null?void 0:ce[0])==null?void 0:be.trim())||((Ie=X.title)==null?void 0:Ie.trim());if(!Ve){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping sponsored suggestion prefetch: no usable page query");return}try{F.log("[AdMeshProvider] \u{1F504} Prefetching sponsored suggestion from /aip/context...");const Ge=await U.fetchPlatformResponse({query:Ve,sessionId:d,messageId:Kd.createMessageId(d),platformSurface:"conversation",model:y,messages:[],language:D,location:q,userId:_}),K=(Oe=(J=(je=Ge.recommendation)==null?void 0:je.creative)==null?void 0:J.follow_up_suggestion)==null?void 0:Oe.trim(),Je=Ge.recommendation_id;if(!K||!Je){F.log("[AdMeshProvider] \u2139\uFE0F No sponsored follow-up suggestion returned from /aip/context");return}const Fe={id:Je,text:K,type:"action",is_sponsored:!0,recommendation:Ge,metadata:{source:"aip_context_prefetch",recommendation_id:Je}};le(un=>P(un,Fe)),F.log("[AdMeshProvider] \u2705 Sponsored suggestion prefetched from /aip/context",{recommendationId:Je,suggestionText:K})}catch(Ge){F.warn("[AdMeshProvider] \u26A0\uFE0F Sponsored suggestion prefetch failed (non-blocking):",Ge)}},[s,D,q,y,U,d,_,P,f]),ye=x.useCallback(async()=>{F.log("[AdMeshProvider] \u{1F504} Manual retry of intent analysis"),await Y()},[Y]);x.useEffect(()=>{!U||E.current||(E.current=!0,(async()=>{const ae=await f();await Promise.allSettled([_e(ae),Y(ae)])})())},[U,Y,_e,f]);const ze=x.useCallback(ae=>{if(!ae||ae.status!=="active")return!1;const ce=Date.parse(ae.expires_at);return Number.isNaN(ce)?!1:ce>Date.now()},[]),Le=x.useCallback(async(ae,ce,be,Ie)=>{const je=Ie??Q;if(!je||!U){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping delegation event because session or SDK is missing",{endpoint:ae,eventType:ce,hasSession:!!je,hasSdk:!!U});return}const J=new Date().toISOString();F.log("[AdMeshProvider] \u{1F4E1} Sending delegation event",{endpoint:ae,eventType:ce,recommendationId:je.recommendation_id,delegationSessionId:je.delegation_session_id,sessionId:je.session_id});const Oe=await fetch(`${U.getApiBaseUrl()}${ae}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({delegation_session_id:je.delegation_session_id,recommendation_id:je.recommendation_id,session_id:je.session_id,event_type:ce,timestamp:J,metadata:be||{}})});if(!Oe.ok){const Ge=await Oe.text();throw F.error("[AdMeshProvider] Delegation event failed",{endpoint:ae,eventType:ce,status:Oe.status,errorBody:Ge,recommendationId:je.recommendation_id,delegationSessionId:je.delegation_session_id}),new Error(`Delegation event failed (${Oe.status}): ${Ge}`)}const X=await Oe.json(),Ve=X?.session;F.log("[AdMeshProvider] \u2705 Delegation event acknowledged",{endpoint:ae,eventType:ce,recommendationId:je.recommendation_id,delegationSessionId:je.delegation_session_id,returnedStatus:Ve?.status||X?.status}),Ve&&O(Ve)},[Q,s,U]),Re=x.useCallback(()=>{V.current=0},[]),De=x.useCallback(async(ae="user_stopped",ce)=>{const be=Q;if(!be){F.warn("[AdMeshProvider] \u26A0\uFE0F stopDelegationSession called without an active SDK delegation session");return}F.log("[AdMeshProvider] \u{1F6D1} Stopping delegation session",{reason:ae,recommendationId:be.recommendation_id,delegationSessionId:be.delegation_session_id}),await Le("/aip/delegation/stop","session_stopped",{reason:ae,...ce||{}},be),await U?.trackPublisherAssistantEvent({event_name:"delegation_stopped",timestamp:new Date().toISOString(),session_id:be.session_id,recommendation_id:be.recommendation_id,delegation_session_id:be.delegation_session_id,brand_name:be.brand_name,status:"stopped",metadata:{reason:ae,...ce||{}}}).catch(Ie=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to track delegation_stopped event:",Ie)}),V.current=0,se.current=null,O(null),F.log("[AdMeshProvider] \u2705 Delegation session cleared locally after stop")},[Q,Le,U]),Be=x.useCallback(async(ae="turn_completed",ce)=>{ae==="turn_started"&&Re(),await Le("/aip/delegation/activity",ae,ce)},[Le,Re]);x.useEffect(()=>{const ae=Q?.delegation_session_id??null;ae!==se.current&&(se.current=ae,V.current=0)},[Q?.delegation_session_id]),x.useEffect(()=>{if(!(Q?.delegation_session_id??null)||!U)return;const ae=ke.current;if(!ae||!ze(ae)){O(be=>be?{...be,status:"expired"}:null);return}const ce=window.setInterval(()=>{const be=ke.current;if(!(!be||!ze(be))){if(V.current+=1,V.current>=Ud){F.log("[AdMeshProvider] \u23F1\uFE0F Stopping delegation after idle heartbeats",{delegationSessionId:be.delegation_session_id,heartbeatsSinceLastUserTurn:V.current,idleHeartbeatLimit:Ud}),De("idle_timeout",{source:"heartbeat_idle",heartbeats_without_turn:V.current}).catch(Ie=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to stop idle delegation session:",Ie)});return}Le("/aip/delegation/heartbeat","heartbeat").catch(Ie=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to send delegation heartbeat:",Ie)})}},Sh);return()=>{window.clearInterval(ce)}},[Q?.delegation_session_id,ze,Le,U,De]);const qt={sdk:U,apiKey:s,sessionId:d,theme:v,language:D,location:q,userId:_,model:y,messages:B,processedMessageIds:te,recommendationResults:ne,activeDelegationSession:Q,suggestions:fe,isAnalyzingIntent:ge||xe,intentError:oe,markMessageAsProcessed:ae=>{re(ce=>{const be=new Set(ce);return be.add(ae),be})},isMessageProcessed:ae=>te.has(ae),setRecommendationResult:(ae,ce)=>{ie(be=>{const Ie=new Map(be);return Ie.set(ae,ce),Ie}),re(be=>{const Ie=new Set(be);return Ie.add(ae),Ie})},getRecommendationResult:ae=>ne.get(ae),hasRecommendationResult:ae=>ne.has(ae),setActiveDelegationSession:ae=>{O(ae)},getActiveDelegationSession:()=>ze(Q)?Q:null,hasActiveDelegationSession:()=>ze(Q),refreshDelegationActivity:Be,stopDelegationSession:De,retryIntentAnalysis:ye};return m.jsx(Xd.Provider,{value:qt,children:H})};class Eh{constructor(){Hr(this,"roots",new Map)}async render(l){try{F.log("[AdMeshRenderer] \u{1F3A8} Attempting to render recommendations");const d=l.response.recommendations||[];if(d.length===0){F.log("[AdMeshRenderer] \u26A0\uFE0F No recommendations to render - skipping render to avoid occupying space");return}const c=document.getElementById(l.containerId);if(!c)throw F.error("[AdMeshRenderer] Container not found"),new Error(`Container with ID "${l.containerId}" not found`);F.log("[AdMeshRenderer] \u2705 Container ready");const v=this.roots.get(l.containerId);v&&(F.log("[AdMeshRenderer] \u{1F9F9} Cleaning up existing root"),v.unmount(),this.roots.delete(l.containerId)),c.innerHTML="";const I=Ed.createRoot(c);F.log("[AdMeshRenderer] \u{1F4CA} Rendering recommendations"),I.render(m.jsx(Qd,{apiKey:l.apiKey,sessionId:l.sessionId,theme:l.theme,apiBaseUrl:l.apiBaseUrl,language:l.language,location:l.location,userId:l.userId,model:l.model,messages:l.messages,children:m.jsx(ph,{recommendations:d,theme:l.theme,sessionId:l.sessionId,onDelegationConsent:l.onDelegationConsent,onDelegationActivated:l.onDelegationActivated,onStartDelegation:l.onStartDelegation})})),c.style.display="block",F.log("[AdMeshRenderer] \u2705 Recommendations rendered successfully"),this.roots.set(l.containerId,I)}catch(d){throw F.error("[AdMeshRenderer] Error rendering recommendations"),d}}unmount(l){const d=this.roots.get(l);if(d){d.unmount(),this.roots.delete(l);const c=document.getElementById(l);c&&(c.style.display="none")}}unmountAll(){for(const[,l]of this.roots.entries())l.unmount();this.roots.clear()}}const zh=s=>{if(typeof s!="string")return;const l=s.trim().toUpperCase();return/^[A-Z]{2}$/.test(l)?l:void 0},qd=class Eo{constructor(l){if(Hr(this,"config"),Hr(this,"apiBaseUrl"),Hr(this,"renderer",null),Hr(this,"tracker",null),!l.apiKey)throw new Error("AdMeshSDK: apiKey is required");this.config={apiKey:l.apiKey,theme:l.theme,apiBaseUrl:l.apiBaseUrl,extension:l.extension,extensionSourceDomain:l.extensionSourceDomain,userId:l.userId},this.apiBaseUrl=l.apiBaseUrl||typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com"}getApiBaseUrl(){return this.apiBaseUrl}static buildPlatformResponseCacheKey(l,d){return`${l}::${d}`}getExtensionSourceDomain(){var l,d;const c=(l=this.config.extensionSourceDomain)==null?void 0:l.trim();if(c)return c.toLowerCase();if(typeof window<"u"&&(d=window.location)!=null&&d.hostname)return window.location.hostname.trim().toLowerCase()||void 0}static createSession(){const l=Date.now(),d=Math.random().toString(36).substring(2,15);return`session_${l}_${d}`}static generateSessionIdFromUrl(l){const d=l||(typeof window<"u"?window.location.href:"");if(!d)return Eo.createSession();try{const c=new URL(d).pathname.split("/").filter(I=>I.length>0),v=c[c.length-1];return v?`session_${Date.now()}_${v}`:Eo.createSession()}catch{return Eo.createSession()}}static createMessageId(l){const d=Date.now(),c=Math.random().toString(36).substring(2,9);return l?`msg_${l}_${d}_${c}`:`msg_${d}_${c}`}getRenderer(){return this.renderer||(this.renderer=new Eh),this.renderer}getTracker(){return this.tracker||(this.tracker=new mh({apiKey:this.config.apiKey})),this.tracker}async postDelegationEvent(l,d,c,v){const I=await fetch(`${this.apiBaseUrl}${l}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify({delegation_session_id:d.delegation_session_id,recommendation_id:d.recommendation_id,session_id:d.session_id,event_type:c,timestamp:new Date().toISOString(),metadata:v||{}})});if(!I.ok){const q=await I.text();throw new Error(`Delegation event failed (${I.status}): ${q}`)}const D=await I.json();return D?.session||null}async reportDelegationTurnStarted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_started",d)}async reportDelegationSessionStarted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"session_started",d)}async reportDelegationTurnCompleted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_completed",d)}async reportDelegationToolInvocation(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"tool_invoked",d)}async reportDelegationOutcome(l,d,c){return this.postDelegationEvent("/aip/delegation/complete",l,d,c)}async stopDelegationSession(l,d="user_stopped",c){return this.postDelegationEvent("/aip/delegation/stop",l,"session_stopped",{reason:d,...c||{}})}getActiveDelegationSession(l){if(!l||l.status!=="active")return null;const d=Date.parse(l.expires_at);return Number.isNaN(d)||d<=Date.now()?null:l}hasActiveDelegationSession(l){return!!this.getActiveDelegationSession(l)}async showRecommendations(l){try{if(!l.sessionId||l.sessionId.trim()==="")throw new Error("sessionId is required and must be provided by the platform. The SDK never generates sessionId automatically.");if(!l.messageId||l.messageId.trim()==="")throw new Error("messageId is required and must be provided by the platform. The SDK never generates messageId automatically.");const d=await this.fetchPlatformResponse({query:l.query,sessionId:l.sessionId,messageId:l.messageId,platformSurface:l.platformSurface,model:l.model,messages:l.messages,language:l.locale,location:l.location,userId:l.userId??this.config.userId}),c={sessionId:l.sessionId,messageId:l.messageId,recommendations:[d]},v=this.getRenderer(),I=this.getTracker();await v.render({containerId:l.containerId,followups_container_id:l.followups_container_id,response:c,theme:l.theme||this.config.theme,tracker:I,sessionId:l.sessionId,apiKey:this.config.apiKey,apiBaseUrl:this.apiBaseUrl,language:l.locale,location:l.location,userId:l.userId,model:l.model,messages:l.messages,onPasteToInput:l.onPasteToInput,onDelegationConsent:l.onDelegationConsent,onDelegationActivated:l.onDelegationActivated,onStartDelegation:l.onStartDelegation,onExecuteQuery:l.onExecuteQuery})}catch(d){throw F.error("[AdMeshSDK] Error showing recommendations"),d}}async fetchPlatformResponse(l){var d,c,v,I,D,q,_,y,B,C,W,M,A;const H=`${this.apiBaseUrl}/aip/context`;if(F.log("[AdMeshSDK] \u{1F4E5} fetchPlatformResponse called"),!l.sessionId||l.sessionId.trim()===""){const ue=new Error("sessionId is required and must be provided by the platform. The SDK never generates sessionId automatically.");throw F.error("[AdMeshSDK] sessionId not provided by platform - cannot process request"),ue}const U=l.messageId;if(!U||U.trim()===""){const ue=new Error("messageId is required and must be provided by the platform. The SDK never generates messageId automatically.");throw F.error("[AdMeshSDK] messageId not provided by platform - cannot process request"),ue}const ee=Eo.buildPlatformResponseCacheKey(l.sessionId,U),te=Eo.inFlightPlatformResponses.get(ee);if(te)return F.log("[AdMeshSDK] \u23F3 Reusing in-flight PlatformResponse request",{sessionId:l.sessionId,messageId:U}),te;const re=l.messages?l.messages.length:0,ne=(typeof window<"u"&&window.navigator,"web"),ie=typeof window<"u"&&window.innerWidth?window.innerWidth<768?"mobile":window.innerWidth<1024?"tablet":"desktop":"desktop",Q=zh((d=l.location)==null?void 0:d.countryCode)||"US",O=typeof window<"u"&&window.location?{url:window.location.href,origin:window.location.origin,referrer:document.referrer||void 0,host:window.location.hostname}:void 0,fe=l.userId??this.config.userId,le={spec_version:"1.0",message_id:U,timestamp:new Date().toISOString(),platform:{platform_id:"placeholder",role:"platform",software:{name:"admesh_ui_sdk",version:l.model||"1.0.0"}},identity:{namespace:"platform_user",value_hash:fe||"",confidence:fe?1:0},consent:{status:"granted",source:"admesh_ui_sdk",scope:{intent_based_monetization:!0,agent_participation:!0,measurement:!0},constraints:{allow_identity_downstream:!1}},classification_input:{type:"interaction",interaction:{session:{id:l.sessionId,turn_index:re},surface:{channel:l.platformSurface==="embedded_assistant"?"conversation":l.platformSurface||"conversation",interaction_mode:"text",platform:ne,form_factor:ie,locale:l.language||"en-US",country:Q,publisher:"placeholder"},input:{query_text:l.query,messages:l.messages||[]},context:{location:{city:((c=l.location)==null?void 0:c.city)||void 0,state:((v=l.location)==null?void 0:v.state)||void 0,state_code:((I=l.location)==null?void 0:I.stateCode)||void 0,country:((D=l.location)==null?void 0:D.country)||void 0,country_code:Q,zipcode:((q=l.location)==null?void 0:q.zipcode)||void 0,latitude:(_=l.location)==null?void 0:_.latitude,longitude:(y=l.location)==null?void 0:y.longitude},page:O}}},monetization:{enabled:!0,pricing_model:"CPX",auction:{enabled:!0,floor:{amount:0,currency:"USD"}}}};(C=(B=le.classification_input.interaction)==null?void 0:B.input.query_text)!=null&&C.trim()||F.warn("[AdMeshSDK] \u26A0\uFE0F Warning: Sending request with empty query_text");const ge=JSON.stringify(le);F.log("[AdMeshSDK] \u{1F4E4} Sending canonical request to /aip/context",{messageId:le.message_id,specVersion:le.spec_version,classificationType:le.classification_input.type,platformId:le.platform.platform_id,surfaceChannel:(W=le.classification_input.interaction)==null?void 0:W.surface.channel,sessionId:(A=(M=le.classification_input.interaction)==null?void 0:M.session)==null?void 0:A.id});const $e={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`};if(this.config.extension){$e["X-AdMesh-Source"]="extension";const ue=this.getExtensionSourceDomain();ue&&($e["X-AdMesh-Source-Domain"]=ue)}const oe=(async()=>{const ue=await fetch(H,{method:"POST",headers:$e,body:ge});if(!ue.ok){const Pe=(await ue.json().catch(()=>({}))).detail||`HTTP ${ue.status}`;throw new Error(`Failed to fetch recommendation from /aip/context: ${Pe}`)}const xe=await ue.json();return F.log("[AdMeshSDK] \u{1F4E5} Raw response from /aip/context:",{status:xe.status,recommendationId:xe.recommendation_id,hasRecommendation:!!xe.recommendation,hasTracking:!!xe.tracking,hasDelegation:!!xe.delegation,topLevelKeys:Object.keys(xe)}),F.log("[AdMeshSDK] \u{1F4E6} Full PlatformResponse received from /aip/context",xe),xe})();Eo.inFlightPlatformResponses.set(ee,oe);try{return await oe}finally{Eo.inFlightPlatformResponses.delete(ee)}}async trackPublisherAssistantEvent(l){const d=Array.isArray(l)?{events:l}:l,c=await fetch(`${this.apiBaseUrl}/analytics/publisher-assistant/events`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify(d),keepalive:!0});if(!c.ok){const v=await c.text().catch(()=>"");throw new Error(`Failed to track publisher assistant analytics (${c.status}): ${v}`)}}async reportSponsoredRecommendation(l){const d=await fetch(`${this.apiBaseUrl}/analytics/recommendation-reports`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify(l),keepalive:!0});if(!d.ok){const c=await d.text().catch(()=>"");throw new Error(`Failed to report sponsored recommendation (${d.status}): ${c}`)}}fireFollowupExposure(l,d,c){this.getTracker().fireFollowupExposure(l,d,c)}async fireFollowupEngagement(l,d,c){return this.getTracker().fireFollowupEngagement(l,d,c)}};Hr(qd,"inFlightPlatformResponses",new Map);let Kd=qd;const Xd=x.createContext(void 0);function Gd(){const s=x.useContext(Xd);if(!s)throw new Error("useAdMeshContext must be used within an <AdMeshProvider>. Make sure your component is wrapped with <AdMeshProvider>.");return s}function Zd(){const s=Gd();return{sdk:s.sdk,apiKey:s.apiKey,sessionId:s.sessionId,theme:s.theme,language:s.language,location:s.location,userId:s.userId,model:s.model,messages:s.messages,processedMessageIds:s.processedMessageIds,recommendationResults:s.recommendationResults,activeDelegationSession:s.activeDelegationSession,markMessageAsProcessed:s.markMessageAsProcessed,isMessageProcessed:s.isMessageProcessed,setRecommendationResult:s.setRecommendationResult,getRecommendationResult:s.getRecommendationResult,hasRecommendationResult:s.hasRecommendationResult,setActiveDelegationSession:s.setActiveDelegationSession,getActiveDelegationSession:s.getActiveDelegationSession,hasActiveDelegationSession:s.hasActiveDelegationSession,refreshDelegationActivity:s.refreshDelegationActivity,stopDelegationSession:s.stopDelegationSession}}const Ah=({className:s,size:l=20})=>m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[m.jsx("path",{d:"M5 12h14"}),m.jsx("path",{d:"M12 5v14"})]}),Ph=({recommendation:s,theme:l,sdk:d,sessionId:c,onExecuteQuery:v})=>{var I,D,q,_,y;const B=(D=(I=s.recommendation)==null?void 0:I.creative)!=null&&D.follow_up_suggestion&&(q=s.tracking)!=null&&q.followup_engagement_url&&(_=s.tracking)!=null&&_.followup_exposure_url?{query:s.recommendation.creative.follow_up_suggestion,engagement_url:s.tracking.followup_engagement_url,exposure_url:s.tracking.followup_exposure_url}:null,C=B?.query,W=B?.engagement_url,M=B?.exposure_url,A=s.recommendation_id,H=((y=s.recommendation)==null?void 0:y.offerId)||A;if(!C||!W||!M)return F.log("[AdMeshFollowup] Missing followup_suggestion.query, engagement_url, or exposure_url - not rendering"),null;const U=async()=>{try{W&&A&&(F.log("[AdMeshFollowup] \u{1F3AF} Firing follow-up engagement tracking"),await d.fireFollowupEngagement(W,A,c)),v&&C?(F.log(`[AdMeshFollowup] \u{1F50D} Executing query: ${C}`),await v(C)):F.warn("[AdMeshFollowup] \u26A0\uFE0F onExecuteQuery not provided - cannot execute query")}catch(ee){F.error("[AdMeshFollowup] Error handling follow-up click:",ee)}};return m.jsx(rl,{productId:H,recommendationId:A||"",exposureUrl:M,sessionId:c,className:"admesh-followup-container",style:{width:"100%"},children:m.jsxs("div",{className:"flex flex-col space-y-3 text-sm admesh-followup-wrapper",children:[m.jsx("div",{className:"h-px w-full bg-[#E5E5E5] dark:bg-[#262626] admesh-divider"}),m.jsxs("div",{onClick:U,className:"cursor-pointer flex flex-row justify-between font-medium space-x-2 items-center group",role:"button",tabIndex:0,onKeyDown:ee=>{(ee.key==="Enter"||ee.key===" ")&&U()},"aria-label":`Sponsored follow-up: ${C}`,children:[m.jsx("p",{className:"transition duration-200 text-[#000] dark:text-[#FFF] hover:text-[#24A0ED] admesh-followup-text",children:C}),m.jsxs("div",{className:"flex flex-row items-center space-x-2",children:[m.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 italic admesh-ad-label",children:"Ad"}),m.jsx(Ah,{size:20,className:"text-[#24A0ED] flex-shrink-0 admesh-plus-icon"})]})]})]})})},Va=({onRecommendationsShown:s,onError:l,messageId:d,query:c,userId:v,initialRecommendation:I,triggerExposureUrl:D=!0,followups_container_id:q,onPasteToInput:_,onDelegationConsent:y,onDelegationActivated:B,onStartDelegation:C,onRecommendationReport:W,onExecuteQuery:M,onFollowupDetected:A,isContainerReady:H})=>{var U,ee,te,re;const{sdk:ne,sessionId:ie,apiKey:Q,language:O,location:fe,userId:le,model:ge,messages:$e,theme:oe,getRecommendationResult:ue,hasRecommendationResult:xe,setRecommendationResult:Pe,activeDelegationSession:E,setActiveDelegationSession:V,hasActiveDelegationSession:se}=Zd(),ke=J=>!!J&&J.status==="generated"&&!!J.recommendation,Ee=v||le,[f,P]=x.useState(null),[G,Y]=x.useState(null),[_e,ye]=x.useState(!0),[ze,Le]=x.useState(null),Re=x.useRef(null),De=x.useRef(!1),Be=x.useRef(!1),qt=x.useRef(s),ae=x.useRef(l);x.useEffect(()=>{qt.current=s,ae.current=l},[s,l]),x.useEffect(()=>{Re.current!==d&&(Re.current=null,Be.current=!1,P(null),Y(null))},[d]);const ce=se()&&E?.session_id===ie;x.useEffect(()=>{var J,Oe,X;if(!d||!xe(d)||ce)return;const Ve=ue(d);if(!Ve){F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored no_match result from provider state"),P(null),Y(null),Le(null),ye(!1),Re.current=d,De.current=!1,Be.current=!0;return}let Ge=((J=Ve.recommendation)==null?void 0:J.format)||"tail";(Ge==="weave"||Ge==="product_card")&&(Ge="tail"),F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored recommendation result from provider state",{messageId:d,recommendationId:Ve.recommendation_id,format:(Oe=Ve.recommendation)==null?void 0:Oe.format}),P(Ve),Y(Ge),Le(null),ye(!1),Re.current=d,De.current=!1,Be.current=!0,(X=qt.current)==null||X.call(qt,d,Ve)},[ue,xe,ce,d]),x.useEffect(()=>{var J,Oe,X,Ve,Ge,K,Je;if(!(!I||!d)&&!ce)try{const Fe=I,un=I.status||"unknown";if(!ke(Fe)){if(un==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F Initial recommendation returned no_match - rendering nothing"),P(null),Y(null),Le(null),ye(!1),Re.current=d,De.current=!1,Be.current=!0,Pe(d,null);return}throw new Error(`Initial recommendation is not a filled auction response (status=${un})`)}let it=((J=Fe.recommendation)==null?void 0:J.format)||"tail";(it==="weave"||it==="product_card")&&(it="tail"),P(Fe),Y(it),Le(null),ye(!1),Re.current=d,De.current=!1,Be.current=!0,Pe(d,Fe),(Oe=qt.current)==null||Oe.call(qt,d,Fe),F.log("[AdMeshRecommendations] \u267B\uFE0F Using initial recommendation payload, skipping /aip/context fetch"),F.log("[AdMeshRecommendations] \u2705 Accepted initial generated recommendation payload",{messageId:d,recommendationId:Fe.recommendation_id,format:(X=Fe.recommendation)==null?void 0:X.format,brandName:(Ge=(Ve=Fe.recommendation)==null?void 0:Ve.creative)==null?void 0:Ge.brand_name,headline:(Je=(K=Fe.recommendation)==null?void 0:K.creative)==null?void 0:Je.headline,hasTracking:!!Fe.tracking})}catch(Fe){const un=Fe instanceof Error?Fe:new Error(String(Fe));Be.current=!1,F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Failed to reuse initial recommendation, will fall back to fetch: ${un.message}`)}},[ce,I,d,Pe]),x.useEffect(()=>{if(!d||!c||c.trim()===""){F.log("[AdMeshRecommendations] Validation failed - missing required parameters"),ye(!1);return}if(ce){F.log("[AdMeshRecommendations] \u23F8\uFE0F Delegated session active, skipping /aip/context fetch",{messageId:d,conversationSessionId:ie,delegationSessionId:E?.delegation_session_id}),P(null),Y(null),Le(null),ye(!1),De.current=!1;return}if(!(ne!=null&&ne.fetchPlatformResponse)){F.log("[AdMeshRecommendations] SDK fetchPlatformResponse not available"),ye(!1);return}if(Be.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Initial recommendation provided, skipping duplicate fetch");return}if(Re.current===d){F.log("[AdMeshRecommendations] \u23ED\uFE0F Already fetched for this messageId, skipping duplicate fetch");return}if(De.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Fetch already in progress, skipping duplicate fetch");return}F.log("[AdMeshRecommendations] \u{1F4E4} Fetching recommendation from /aip/context (single fetch)"),(async()=>{var J,Oe,X,Ve,Ge,K,Je,Fe,un;try{De.current=!0,ye(!0),Le(null);const it=await ne.fetchPlatformResponse({query:c.trim(),sessionId:ie,messageId:d,language:O,location:fe,userId:Ee,model:ge,...$e&&$e.length>0&&{messages:$e}}),Kt=it?.status||"unknown";if(!ke(it)){if(Kt==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F No recommendation returned from /aip/context"),P(null),Y(null),Le(null),ye(!1),De.current=!1,Re.current=d,Pe(d,null);return}throw new Error(`No filled recommendation returned from /aip/context (status=${Kt})`)}P(it),F.log("[AdMeshRecommendations] \u2705 Accepted fetched generated recommendation payload",{messageId:d,recommendationId:it.recommendation_id,format:(J=it.recommendation)==null?void 0:J.format,brandName:(X=(Oe=it.recommendation)==null?void 0:Oe.creative)==null?void 0:X.brand_name,headline:(Ge=(Ve=it.recommendation)==null?void 0:Ve.creative)==null?void 0:Ge.headline,hasTracking:!!it.tracking});let Mn=((K=it.recommendation)==null?void 0:K.format)||"tail";(Mn==="weave"||Mn==="product_card")&&(Mn="tail"),Y(Mn),Re.current=d,Pe(d,it),F.log("[AdMeshRecommendations] \u{1F4CA} Format detection:",{preferred_format:(Je=it.recommendation)==null?void 0:Je.format,selected_format:Mn}),ye(!1),De.current=!1,(Fe=qt.current)==null||Fe.call(qt,d,it)}catch(it){const Kt=it instanceof Error?it:new Error(String(it));Kt.message.includes("Failed to fetch")||Kt.message.includes("NetworkError")?F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Network error fetching recommendations(non - critical): ${Kt.message} `):F.error(`[AdMeshRecommendations] Error fetching recommendations: ${Kt.message} `),Le(Kt),ye(!1),De.current=!1,(un=ae.current)==null||un.call(ae,Kt)}})()},[E?.delegation_session_id,ce,ne,ie,d,c,O,fe,Ee,ge,I,Pe]),x.useEffect(()=>{var J,Oe,X,Ve;if(!f||!A)return;const Ge=(Oe=(J=f.recommendation)==null?void 0:J.creative)!=null&&Oe.follow_up_suggestion&&(X=f.tracking)!=null&&X.followup_engagement_url&&(Ve=f.tracking)!=null&&Ve.followup_exposure_url?{label:f.recommendation.creative.follow_up_suggestion,query:f.recommendation.creative.follow_up_suggestion,engagement_url:f.tracking.followup_engagement_url,exposure_url:f.tracking.followup_exposure_url}:null;Ge&&A(Ge,f.recommendation_id)},[f,A]);const be=x.useCallback(async J=>{if(!ne||!ie)throw new Error("AdMesh SDK activation requires an initialized session");const Oe=await fetch(`${ne.getApiBaseUrl()}/aip/delegation/activate`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${Q}`},body:JSON.stringify({session_id:ie,recommendation_id:J.recommendation_id,metadata:J.metadata})});if(!Oe.ok){const K=await Oe.text();throw new Error(`Failed to activate delegation session: ${Oe.status} ${K}`)}const X=await Oe.json(),Ve={...J,delegation_session_id:X.delegation_session_id||J.delegation_session_id,session_id:X.session_id||ie,brand_id:X.brand_id||J.brand_id,brand_name:X.brand_name||J.brand_name,mcp_endpoint:X.mcp_endpoint,eligibility_reason:X.eligibility_reason||J.eligibility_reason,delegate_reason:X.delegate_reason||J.delegate_reason,session_goal:X.session_goal||J.session_goal,desired_outcome_type:X.desired_outcome_type||J.desired_outcome_type,required_user_inputs:X.required_user_inputs||J.required_user_inputs||[],required_consent_types:X.required_consent_types||J.required_consent_types||[],success_outcome:X.success_outcome||J.success_outcome,fallback_message:X.fallback_message||J.fallback_message,session_mode:"inline",status:X.status||"active",capabilities:X.capabilities||J.capabilities||[],allowed_data_types:X.allowed_data_types||J.allowed_data_types||[],auth_model:X.auth_model||J.auth_model,handoff_protocol:X.handoff_protocol||J.handoff_protocol,supported_actions:X.supported_actions||J.supported_actions||[],metadata:X.metadata||J.metadata},Ge={delegation_session_id:X.delegation_session_id,recommendation_id:J.recommendation_id,session_id:X.session_id||ie,brand_agent_id:X.brand_agent_id,brand_id:X.brand_id||J.brand_id,brand_name:X.brand_name||J.brand_name||"Brand",mcp_endpoint:X.mcp_endpoint,status:X.status||"active",activated_at:X.created_at,last_activity_at:X.updated_at,expires_at:X.expires_at||X.updated_at,eligibility_reason:X.eligibility_reason||J.eligibility_reason,delegate_reason:X.delegate_reason||J.delegate_reason,session_goal:X.session_goal||J.session_goal,desired_outcome_type:X.desired_outcome_type||J.desired_outcome_type,required_user_inputs:X.required_user_inputs||J.required_user_inputs||[],required_consent_types:X.required_consent_types||J.required_consent_types||[],success_outcome:X.success_outcome||J.success_outcome,fallback_message:X.fallback_message||J.fallback_message,capabilities:X.capabilities||J.capabilities||[],allowed_data_types:X.allowed_data_types||J.allowed_data_types||[],consent_requirements:X.consent_requirements||J.consent_requirements||[],auth_model:X.auth_model||J.auth_model,handoff_protocol:X.handoff_protocol||J.handoff_protocol,supported_actions:X.supported_actions||J.supported_actions||[],metadata:X.metadata||J.metadata};if(V(Ge),await ne.trackPublisherAssistantEvent({event_name:"delegation_started",timestamp:new Date().toISOString(),session_id:ie,recommendation_id:J.recommendation_id,delegation_session_id:X.delegation_session_id,brand_name:Ge.brand_name,status:X.status||"active",metadata:{brand_agent_id:X.brand_agent_id,source:"recommendation_card"}}).catch(K=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to track delegation_started event:",K)}),await ne.reportDelegationSessionStarted(Ge,{brand_agent_id:X.brand_agent_id,brand_name:Ge.brand_name}).then(K=>{K&&V(K)}).catch(K=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report delegation session_started event:",K)}),B){try{await B(Ve)}catch(K){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onDelegationActivated callback failed after successful delegation activation:",K)}return}if(C)try{await C({...J.platform_response,delegation:{...J.platform_response.delegation,...Ve,delegation_session_id:X.delegation_session_id,available:!0,status:X.status||"active"}})}catch(K){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onStartDelegation callback failed after successful delegation activation:",K)}},[Q,B,C,ne,ie,V]),Ie=x.useCallback(async J=>{var Oe,X;if(W){await W(J);return}!ne||!ie||await ne.reportSponsoredRecommendation({session_id:ie,message_id:d,recommendation_id:J.recommendation_id,reason:J.reason,brand_name:(X=(Oe=J.recommendation.recommendation)==null?void 0:Oe.creative)==null?void 0:X.brand_name,metadata:{reason:J.reason,source:"recommendation_card"}}).catch(Ve=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report sponsored recommendation:",Ve)})},[d,W,ne,ie]);if(!d||!c||c.trim()===""||_e||ze)return null;if(!f||!G)return F.log("[AdMeshRecommendations] \u{1F6AB} Nothing to render",{messageId:d,hasPlatformResult:!!f,detectedFormat:G,isLoading:_e,hasError:!!ze}),null;F.log("[AdMeshRecommendations] \u{1F3A8} Rendering recommendation component",{messageId:d,recommendationId:f.recommendation_id,detectedFormat:G,brandName:(ee=(U=f.recommendation)==null?void 0:U.creative)==null?void 0:ee.brand_name,headline:(re=(te=f.recommendation)==null?void 0:te.creative)==null?void 0:re.headline});const je=typeof document<"u"&&q&&(H??!0)?document.getElementById(q):null;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"admesh-recommendations-container",style:{marginTop:"1rem"},children:m.jsx(Wd,{recommendations:[f],theme:oe,sessionId:ie,triggerExposureUrl:D,onPasteToInput:_,onDelegationConsent:y,onDelegationActivated:be,onStartDelegation:C,onRecommendationReport:Ie})}),je&&ne&&ie?el.createPortal(m.jsx(Ph,{recommendation:f,theme:oe,sdk:ne,sessionId:ie,onExecuteQuery:M}),je):null]})},ol="admesh-ui-sdk-styles",al="admesh-ui-sdk-reset",Mh=`
245
+ `}),m.jsxs("div",{role:!ke&&xe?"link":void 0,tabIndex:!ke&&xe?0:void 0,style:{display:"flex",flexDirection:"column",gap:"10px",padding:"12px",borderRadius:l?.borderRadius||((te=(ee=l?.components)==null?void 0:ee.card)==null?void 0:te.borderRadius)||"14px",border:`1px solid ${ot}`,background:Dt,boxShadow:mt,minWidth:0,cursor:!ke&&xe?"pointer":void 0},onClick:it,onKeyDown:Kt,children:[m.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"flex-start",minWidth:0},children:[m.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"10px",flexShrink:0,overflow:"hidden",background:Xt?"#1f2937":"#eff6ff",display:"flex",alignItems:"center",justifyContent:"center"},children:!vn&&ue&&Od(ue)?m.jsx("img",{src:ue,alt:`${ge} logo`,style:{width:"100%",height:"100%",objectFit:"contain",padding:"6px",background:"#ffffff"},onError:()=>Vr(!0)}):m.jsx("span",{style:{fontSize:"14px",fontWeight:700,color:dn},children:(ge||"A").charAt(0).toUpperCase()})}),m.jsxs("div",{style:{flex:1,minWidth:0},children:[m.jsxs("div",{className:"admesh-compact-meta-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"4px"},children:[m.jsx("div",{className:"admesh-compact-line-clamp-1",style:{fontSize:"11px",color:dn},children:Be?ge:""}),m.jsx("span",{style:{flexShrink:0,fontSize:"10px",color:dn,textTransform:"uppercase",letterSpacing:"0.08em"},children:E})]}),!ke&&m.jsx("div",{className:"admesh-compact-line-clamp-2",style:{fontSize:"14px",lineHeight:1.3,fontWeight:700,color:mn,marginBottom:"4px"},title:ze,children:ze}),Le&&m.jsx("p",{className:"admesh-compact-line-clamp-2",style:{margin:0,fontSize:"12px",lineHeight:1.35,color:Ur},title:Le,children:Le})]})]}),ke&&m.jsx("div",{className:"admesh-compact-tail-scroll",style:{display:"flex",gap:"8px",overflowX:"auto",paddingBottom:"2px"},children:se.map(ve=>{const tt=na(ve.product_name)||"Product",Jt=na(ve.product_link)||na(ve.product_url)||xe||"#",Mo=mh(ve.product_price,ve.product_currency),Yn=na(ve.product_image_url),cr=Yn&&Od(Yn)?Yn:"",jo=Jt!=="#";return m.jsx("a",{href:Jt,target:jo?"_blank":void 0,rel:jo?"noopener noreferrer":void 0,onClick:Qr=>K(`compact_tail_ad_product_${ve.product_id||"item"}`,Qr),style:{minWidth:"220px",maxWidth:"220px",display:"block",textDecoration:"none",color:"inherit",border:`1px solid ${ot}`,borderRadius:"12px",background:me,padding:"8px",flexShrink:0},children:m.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start"},children:[m.jsx("div",{style:{width:"34px",height:"34px",borderRadius:"8px",overflow:"hidden",flexShrink:0,background:Xt?"#374151":"#e5e7eb",display:"flex",alignItems:"center",justifyContent:"center",color:dn,fontSize:"12px",fontWeight:700},children:cr?m.jsx("img",{src:cr,alt:tt,style:{width:"100%",height:"100%",objectFit:"cover"}}):tt.charAt(0).toUpperCase()}),m.jsxs("div",{style:{minWidth:0,flex:1},children:[m.jsx("div",{style:{fontSize:"12px",lineHeight:1.25,fontWeight:600,color:mn,marginBottom:"4px",whiteSpace:"normal",wordBreak:"break-word"},title:tt,children:tt}),m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:Mo&&m.jsx("span",{style:{fontSize:"12px",fontWeight:700,color:mn},children:Mo})})]})]})},ve.product_id||`${fe}-${tt}`)})}),m.jsxs("div",{className:"admesh-compact-footer-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",flexWrap:"wrap",marginLeft:ke?0:fn},children:[m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0,flexWrap:"wrap"},children:xn}),m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",gap:"8px",marginLeft:"auto",flexShrink:0},children:[ke&&V.length>se.length?m.jsxs("span",{style:{fontSize:"10px",color:dn},children:["+",V.length-se.length," more"]}):null,m.jsx("button",{type:"button","aria-label":J?"Recommendation reported":"Report recommendation",title:J?"Reported":"Report recommendation",disabled:!!J,onClick:Fe,style:{width:"28px",height:"28px",borderRadius:"999px",border:`1px solid ${ot}`,background:J?me:Dt,color:J?qe:dn,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,cursor:J?"default":"pointer",flexShrink:0},children:m.jsx(Zf,{size:13})})]})]}),Me?m.jsx("div",{className:"admesh-compact-report-panel",onClick:ve=>ve.stopPropagation(),style:{marginLeft:ke?0:fn,border:`1px solid ${ot}`,borderRadius:"12px",background:me,padding:"8px",display:"flex",flexWrap:"wrap",gap:"6px"},children:Je.map(ve=>m.jsx("button",{className:"admesh-compact-report-option",type:"button",onClick:tt=>un(tt,ve.value),style:{borderRadius:"999px",border:`1px solid ${ot}`,background:Dt,color:mn,fontSize:"11px",fontWeight:600,padding:"6px 9px",cursor:"pointer"},children:ve.label},ve.value))}):null,J?m.jsx("div",{className:"admesh-compact-report-status",style:{marginLeft:ke?0:fn,fontSize:"11px",color:dn},children:"Thanks for reporting this recommendation."}):null,qt?m.jsxs("div",{style:{marginTop:"2px",border:`1px solid ${ot}`,borderRadius:"12px",background:me,padding:"12px",display:"flex",flexDirection:"column",gap:"10px"},children:[m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:qe},children:"Confirm Agent Access"}),m.jsxs("div",{style:{fontSize:"13px",lineHeight:1.4,color:mn,fontWeight:600},children:["Allow ",G||"this brand"," to start a delegated session?"]}),m.jsx("div",{style:{fontSize:"12px",lineHeight:1.45,color:Ur},children:"The agent will only use the details you choose to share for this request."})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[m.jsx("button",{type:"button",disabled:ce,onClick:ve=>{ve.preventDefault(),ve.stopPropagation(),!ce&&Ve(!1)},style:{borderRadius:"10px",border:`1px solid ${ot}`,background:Dt,color:mn,fontSize:"12px",fontWeight:600,padding:"8px 12px",cursor:ce?"not-allowed":"pointer",opacity:ce?.65:1},children:"Not now"}),m.jsx("button",{type:"button",disabled:ce,onClick:ve=>{ve.preventDefault(),ve.stopPropagation(),!ce&&Ve(!0)},style:{borderRadius:"10px",border:"none",background:qe,color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 12px",cursor:ce?"wait":"pointer",opacity:ce?.86:1},children:ce?"Connecting...":"Allow agent"})]})]}):null]})]})},fh=({recommendations:s,theme:l,className:d,style:c,sessionId:v,onDelegationConsent:M,onDelegationActivated:N,onStartDelegation:q})=>{const _=s.filter(B=>B&&typeof B=="object"&&typeof B.recommendation_id=="string"&&B.recommendation_id.length>0);if(!_||_.length===0)return F.log("[AdMeshLayout] Empty or invalid recommendations array - not rendering anything"),null;F.log(`[AdMeshLayout] Rendering with ${_.length} valid recommendations`);const y=()=>{var B;if(_.length>0){const C=_[0],W=(B=C.recommendation)==null?void 0:B.format;F.log("[AdMeshLayout] \u{1F50D} Checking format:",{preferredFormat:W,recommendationKeys:Object.keys(C||{})}),(W==="product_card"||W==="weave"||W==="bridge")&&F.warn(`[AdMeshLayout] ${W} format requested, falling back to tail for canonical render payload`)}return m.jsx(Wd,{recommendations:_,theme:l,sessionId:v,onDelegationConsent:M,onDelegationActivated:N,onStartDelegation:q})};return m.jsx("div",{className:`admesh-layout ${d}`,style:{fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',...c},children:y()})};class hh{constructor(l){Hr(this,"firedExposures",new Set),Hr(this,"debug",!1),Hr(this,"mrcThreshold",{visibilityPercentage:50,minimumDurationMs:1e3}),this.debug=l.debug||!1}fireExposure(l,d,c){const v=`${c}_${d}`;if(this.firedExposures.has(v)){this.debug&&F.log("[Tracker] Exposure already fired");return}this.firedExposures.add(v);try{fetch(l,{method:"GET",keepalive:!0}).catch(()=>{this.debug&&F.warn("[Tracker] Failed to fire exposure")}),this.debug&&F.log("[Tracker] Fired MRC-compliant exposure")}catch{this.debug&&F.error("[Tracker] Error firing exposure")}}async fireExposureWithMRCCompliance(l,d,c,v){const M=`${c}_${d}`;if(this.firedExposures.has(M)){this.debug&&F.log("[Tracker] MRC exposure already fired");return}return new Promise(N=>{let q=null,_=null;const y=new IntersectionObserver(C=>{C.forEach(W=>{W.intersectionRatio*100>=this.mrcThreshold.visibilityPercentage?q===null&&(q=Date.now(),this.debug&&F.log("[Tracker] Ad reached MRC visibility threshold"),_=setTimeout(()=>{this.fireExposure(l,d,c),y.disconnect(),N()},this.mrcThreshold.minimumDurationMs)):q!==null&&(_&&(clearTimeout(_),_=null),q=null,this.debug&&F.log("[Tracker] Ad visibility dropped below MRC threshold"))})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});y.observe(v);const B=setTimeout(()=>{y.disconnect(),_&&clearTimeout(_),N()},3e4);v.__admeshTrackerCleanup=()=>{y.disconnect(),_&&clearTimeout(_),clearTimeout(B)}})}clearFiredExposures(){this.firedExposures.clear()}getMRCThreshold(){return{...this.mrcThreshold}}setMRCThreshold(l){this.mrcThreshold={...this.mrcThreshold,...l}}fireFollowupExposure(l,d,c){this.fireExposure(l,d,c)}fireFollowupEngagement(l,d,c){return fetch(l,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})}).catch(v=>{this.debug&&F.warn("[Tracker] Failed to fire followup engagement (non-critical):",v)}).then(()=>{})}}function gh(s){const l=s.split("/").filter(Boolean),d=(l[l.length-1]||l[l.length-2]||"").replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return d?d.replace(/\b\w/g,c=>c.toUpperCase()):"This page"}function bh(){var s;try{console.log("[AdMesh] Starting direct headings extraction...");const l=_=>_.replace(/\s+/g," ").trim(),d=()=>{var _;const y=["article","main article","main",'[role="main"]',"[data-admesh-article]",".article-content",".post-content",".entry-content",".content"],B=["script","style","noscript","svg","canvas","iframe","nav","header","footer","aside",'[aria-hidden="true"]',"[data-admesh-ignore]",".admesh-publisher-assistant-root",".admesh-publisher-assistant-reactMount",".admesh-publisher-assistant-floating",".admesh-publisher-assistant-inline"].join(","),C=(((_=y.map(I=>document.querySelector(I)).filter(I=>!!I).map(I=>{const A=I.cloneNode(!0);A.querySelectorAll(B).forEach(U=>U.remove());const H=l(A.textContent||"");return{element:I,text:H}}).filter(I=>I.text.length>=200).sort((I,A)=>A.text.length-I.text.length)[0])==null?void 0:_.element)||document.body).cloneNode(!0);C.querySelectorAll(B).forEach(I=>I.remove());const W=Array.from(C.querySelectorAll("h1, h2, h3, p, li, blockquote")).map(I=>l(I.textContent||"")).filter(I=>I.length>=24);return(W.length>0?W.join(`
246
+ `):l(C.textContent||"")).slice(0,6e3)},c=gh(window.location.pathname||"/"),v=l(document.title||"")||c,M=(()=>{const _=[],y=document.querySelectorAll("h1, h2, h3, h4, h5, h6");return Array.from(y).forEach(B=>{const C=l(B.textContent||"");C.length>0&&_.push(C)}),_})(),N=M.length>0?M:[v||c],q={title:v,headings:N,article_text:d(),url:window.location.href,domain:window.location.hostname,extracted_at:new Date().toISOString()};return console.log("[AdMesh] Extracted headings:",{title:q.title,headingsCount:q.headings.length,articleTextLength:((s=q.article_text)==null?void 0:s.length)||0,domain:q.domain}),q}catch(l){return console.error("[AdMesh] Error in direct headings extraction:",l),null}}function yh(s){return!!(s&&typeof s=="object"&&"recommendation_id"in s&&"status"in s)}function vh(s){var l,d,c,v,M,N,q,_,y,B,C;if(!s||typeof s!="object")return;if(yh(s))return s;const W=s;if(!W.recommendation_id)return;const I=(W.products||[]).map(A=>{var H,U;return{product_id:A.product_id||"",product_link:A.product_link||A.product_click_url||W.click_url||W.url||"",product_name:A.product_name||W.title||((H=W.creative_input)==null?void 0:H.product_name)||"",product_description:A.product_description||"",product_price:A.product_price??void 0,product_discount:A.product_discount??void 0,product_currency:A.product_currency,product_discount_type:A.product_discount_type,product_cta_label:A.product_cta_label||((U=W.creative_input)==null?void 0:U.cta_label),product_image_url:A.product_image_url,product_features:A.product_features}});return{spec_version:"1.0",recommendation_id:W.recommendation_id,timestamp:new Date().toISOString(),status:"generated",ttl_ms:3e5,recommendation:{format:W.preferred_format||"tail",disclosure:"Sponsored",creative:{brand_name:((l=W.creative_input)==null?void 0:l.brand_name)||"",headline:W.title||((d=W.creative_input)==null?void 0:d.product_name)||"",description:((c=W.creative_input)==null?void 0:c.short_description)||((v=W.creative_input)==null?void 0:v.long_description)||"",cta_text:((M=W.creative_input)==null?void 0:M.cta_label)||((N=I[0])==null?void 0:N.product_cta_label)||"Learn more",follow_up_suggestion:W.follow_up_suggestion,logo_url:(_=(q=W.creative_input)==null?void 0:q.assets)==null?void 0:_.logo_url,image_urls:((B=(y=W.creative_input)==null?void 0:y.assets)==null?void 0:B.image_urls)||[],landing_page_url:W.url||W.click_url||((C=W.creative_input)==null?void 0:C.cta_url)||"",products:I}},tracking:{exposure_url:W.exposure_url,click_url:W.click_url,followup_exposure_url:W.followup_exposure_url,followup_engagement_url:W.followup_engagement_url}}}function xh(s){return{...s,suggestions:(s.suggestions||[]).map(l=>({...l,recommendation:vh(l.recommendation)}))}}function Hd(s){try{const l=new URL(s).pathname.split("/").filter(d=>d.length>0);return l[l.length-1]||void 0}catch{return}}async function wh(s,l){var d,c,v,M,N;try{console.log("[AdMesh SDK] Starting ACIE analyze-intent call...",{url:s.url});const q=Array.isArray(s.headings)?s.headings:[],_=(d=Hd(s.url))==null?void 0:d.replace(/[-_]+/g," ").replace(/\s+/g," ").trim(),y=_?_.replace(/\b\w/g,te=>te.toUpperCase()):void 0,B=l.apiKey.toLowerCase().startsWith("pub_")?Hd(s.url):void 0,C=l.extension?"extension":"admesh_ui_sdk",W=(s.domain||(typeof window<"u"?window.location.hostname:"")).trim().toLowerCase(),I={url:s.url,title:s.title||void 0,headings:q.length>0?q:y?[y]:void 0,article_text:((c=s.article_text)==null?void 0:c.trim())||void 0,domain:W,article_slug:B,agent_id:void 0,cpx_floor:void 0,source:C,api_key:l.apiKey,user_id:l.userId||void 0};console.log("[AdMesh SDK] Payload prepared:",{url:I.url,titleLength:((v=I.title)==null?void 0:v.length)||0,headingsCount:((M=I.headings)==null?void 0:M.length)||0,articleTextLength:((N=I.article_text)==null?void 0:N.length)||0,domain:I.domain,article_slug:I.article_slug,source:I.source,has_user_id:!!I.user_id});const A=`${l.apiBaseUrl}/acie/analyze-intent`;console.log("[AdMesh SDK] Calling ACIE API:",A);const H=await fetch(A,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l.apiKey}`},body:JSON.stringify(I)});if(console.log("[AdMesh SDK] ACIE API response received:",{status:H.status,statusText:H.statusText,ok:H.ok}),!H.ok){const te=await H.text();throw console.error("[AdMesh SDK] ACIE API error:",{status:H.status,statusText:H.statusText,errorText:te}),new Error(`ACIE API error: ${H.status} - ${te}`)}const U=await H.json(),ee=xh(U);return console.log("[AdMesh SDK] ACIE analysis completed:",{url:s.url,suggestionsCount:ee.suggestions.length}),ee}catch(q){return console.error("[AdMesh SDK] Error calling ACIE analyze-intent endpoint:",q),null}}async function kh(s,l){var d,c;const v=(l.apiBaseUrl||"https://api.useadmesh.com").replace(/\/$/,""),M=new URLSearchParams({url:s.trim()});(d=l.agentDisplayId)!=null&&d.trim()&&M.set("agent_display_id",l.agentDisplayId.trim()),(c=l.publisherId)!=null&&c.trim()&&M.set("publisher_id",l.publisherId.trim());const N=await fetch(`${v}/publisher-assistant/page-context?${M.toString()}`,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${l.apiKey}`}});if(!N.ok){const q=await N.text().catch(()=>"");throw new Error(`Page context request failed (${N.status}): ${q||N.statusText}`)}return await N.json()}function _h(){if(typeof window>"u")return!1;try{return window.self!==window.top}catch{return!0}}function Sh(){var s;if(typeof window>"u")return null;try{const l=(s=window.location.href)==null?void 0:s.trim();if(Bd(l))return l}catch{return null}return null}function Bd(s){const l=s?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return d.protocol==="http:"||d.protocol==="https:"}catch{return!1}}function Ch(s){try{const l=new URL(s),d=l.pathname.split("/").filter(Boolean),c=(d[d.length-1]||d[d.length-2]||l.hostname).replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return c?c.replace(/\b\w/g,v=>v.toUpperCase()):l.hostname}catch{return"This page"}}function Vd(s){const l=new URL(s),d=Ch(s);return{title:d,headings:[d],article_text:`Article URL: ${s}
247
+ Article topic inferred from URL path: ${d}`,url:s,domain:l.hostname,extracted_at:new Date().toISOString()}}const Eh=6e4,Ud=3;function zh(s){const l=Sh();if(l)return l;const d=s?.trim();return Bd(d)?d:null}const Qd=({apiKey:s,skipSdkInitialization:l=!1,sessionId:d,extension:c,theme:v,apiBaseUrl:M,language:N,location:q,userId:_,model:y,messages:B,pageContext:C,articleUrl:W,contextMode:I="auto",agentDisplayId:A,children:H})=>{const[U,ee]=x.useState(null),[te,re]=x.useState(new Set),[ne,ie]=x.useState(new Map),[Q,O]=x.useState(null),[fe,le]=x.useState([]),[ge,$e]=x.useState(!1),[oe,ue]=x.useState(null),[xe,Pe]=x.useState(!1),E=x.useRef(!1),V=x.useRef(0),se=x.useRef(null),ke=x.useRef(null);ke.current=Q;const Ee=!!C||I==="ad-slot"||I==="auto"&&(!!(W!=null&&W.trim())||_h()),f=x.useCallback(async()=>{if(C)return C;if(!Ee)return bh();const ae=zh(W);if(!ae)return F.warn("[AdMeshProvider] Ad-slot context mode requires a real article URL"),ue("Article URL is required for ad-slot context"),null;if(!s)return F.warn("[AdMeshProvider] Cannot fetch page context: missing API key"),Vd(ae);try{Pe(!0);const ce=await kh(ae,{apiKey:s,apiBaseUrl:M||"https://api.useadmesh.com",agentDisplayId:A});return F.log("[AdMeshProvider] Page context resolved",{source:ce.source,cache_hit:ce.cache_hit,domain:ce.context.domain}),ce.context}catch(ce){return F.error("[AdMeshProvider] Failed to fetch page context:",ce),F.warn("[AdMeshProvider] Falling back to URL-path context for suggestions"),Vd(ae)}finally{Pe(!1)}},[A,M,s,W,C,Ee]),P=x.useCallback((ae,ce)=>{const be=ae.filter(Me=>!Me.is_sponsored).slice(0,3);return[ce,...be]},[]),G=x.useCallback((ae,ce)=>{const be=ae.find(je=>je.is_sponsored),Me=ce.filter(je=>!je.is_sponsored).slice(0,3);return be?[be,...Me]:Me},[]);x.useEffect(()=>{if(!d||d.trim()===""){F.error("[AdMeshProvider] sessionId is required and must be provided by the platform. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}F.log("[AdMeshProvider] \u2705 Session ID available:",d)},[d]),x.useEffect(()=>{if(!l){if(!s){F.warn("[AdMeshProvider] \u26A0\uFE0F AdMesh API key not configured");return}if(!d||d.trim()===""){F.error("[AdMeshProvider] Cannot initialize SDK: sessionId is required. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}try{const ae=new Kd({apiKey:s,theme:v,apiBaseUrl:M,extension:c});ee(ae),F.log("[AdMeshProvider] \u2705 AdMesh SDK initialized with session:",d),M&&F.log("[AdMeshProvider] \u{1F4CD} Using custom API base URL")}catch(ae){F.error("[AdMeshProvider] Failed to initialize AdMesh SDK:",ae)}return()=>{F.log("[AdMeshProvider] \u{1F9F9} Provider unmounted")}}},[s,v,M,d,c,l]);const Y=x.useCallback(async ae=>{var ce;if(!s){F.warn("[AdMeshProvider] \u26A0\uFE0F Cannot perform intent analysis: missing API key");return}if(c)F.log("[AdMeshProvider] \u2139\uFE0F Extension mode: allowing intent analysis for any API key");else if(!s.toLowerCase().startsWith("pub_")){F.log('[AdMeshProvider] \u2139\uFE0F Skipping auto intent analysis: API key does not start with "pub_"');return}try{$e(!0),ue(null),F.log("[AdMeshProvider] \u{1F504} Starting automatic intent analysis...");const be=ae??await f();if(!be){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract headings for intent analysis"),ue("Failed to extract page content");return}F.log("[AdMeshProvider] \u{1F4C4} Extracted headings:",{title:be.title,headingsCount:be.headings.length,articleTextLength:((ce=be.article_text)==null?void 0:ce.length)||0,domain:be.domain});const Me=await wh(be,{apiKey:s,apiBaseUrl:M||"https://api.useadmesh.com",extension:c,userId:_});Me?(F.log("[AdMeshProvider] \u2705 Intent analysis completed:",{suggestionsCount:Me.suggestions.length,suggestions:(Me.suggestions||[]).map(je=>{var J;return{id:je.id,text:je.text,is_sponsored:je.is_sponsored,recommendationId:((J=je.recommendation)==null?void 0:J.recommendation_id)||null}})}),le(je=>G(je,Me.suggestions||[]))):(F.warn("[AdMeshProvider] \u26A0\uFE0F Intent analysis returned null"),ue("Intent analysis failed"),le(je=>je.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after null intent analysis result"),je):[{id:"fallback-1",text:"What are your questions about this content?",type:"information",is_sponsored:!1,recommendation:void 0}]))}catch(be){F.error("[AdMeshProvider] Error in intent analysis:",be),ue("Intent analysis error"),le(Me=>Me.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after intent analysis error"),Me):[{id:"error-fallback-1",text:"Ask me questions about this page",type:"information",is_sponsored:!1,recommendation:void 0}])}finally{$e(!1)}},[s,M,c,_,G,f]),_e=x.useCallback(async ae=>{var ce,be,Me,je,J,Oe;if(!U||!s||!s.toLowerCase().startsWith("pub_"))return;const X=ae??await f();if(!X){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract page content for sponsored suggestion prefetch");return}const Ve=((be=(ce=X.headings)==null?void 0:ce[0])==null?void 0:be.trim())||((Me=X.title)==null?void 0:Me.trim());if(!Ve){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping sponsored suggestion prefetch: no usable page query");return}try{F.log("[AdMeshProvider] \u{1F504} Prefetching sponsored suggestion from /aip/context...");const Ge=await U.fetchPlatformResponse({query:Ve,sessionId:d,messageId:Kd.createMessageId(d),platformSurface:"conversation",model:y,messages:[],language:N,location:q,userId:_}),K=(Oe=(J=(je=Ge.recommendation)==null?void 0:je.creative)==null?void 0:J.follow_up_suggestion)==null?void 0:Oe.trim(),Je=Ge.recommendation_id;if(!K||!Je){F.log("[AdMeshProvider] \u2139\uFE0F No sponsored follow-up suggestion returned from /aip/context");return}const Fe={id:Je,text:K,type:"action",is_sponsored:!0,recommendation:Ge,metadata:{source:"aip_context_prefetch",recommendation_id:Je}};le(un=>P(un,Fe)),F.log("[AdMeshProvider] \u2705 Sponsored suggestion prefetched from /aip/context",{recommendationId:Je,suggestionText:K})}catch(Ge){F.warn("[AdMeshProvider] \u26A0\uFE0F Sponsored suggestion prefetch failed (non-blocking):",Ge)}},[s,N,q,y,U,d,_,P,f]),ye=x.useCallback(async()=>{F.log("[AdMeshProvider] \u{1F504} Manual retry of intent analysis"),await Y()},[Y]);x.useEffect(()=>{!U||E.current||(E.current=!0,(async()=>{const ae=await f();await Promise.allSettled([_e(ae),Y(ae)])})())},[U,Y,_e,f]);const ze=x.useCallback(ae=>{if(!ae||ae.status!=="active")return!1;const ce=Date.parse(ae.expires_at);return Number.isNaN(ce)?!1:ce>Date.now()},[]),Le=x.useCallback(async(ae,ce,be,Me)=>{const je=Me??Q;if(!je||!U){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping delegation event because session or SDK is missing",{endpoint:ae,eventType:ce,hasSession:!!je,hasSdk:!!U});return}const J=new Date().toISOString();F.log("[AdMeshProvider] \u{1F4E1} Sending delegation event",{endpoint:ae,eventType:ce,recommendationId:je.recommendation_id,delegationSessionId:je.delegation_session_id,sessionId:je.session_id});const Oe=await fetch(`${U.getApiBaseUrl()}${ae}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({delegation_session_id:je.delegation_session_id,recommendation_id:je.recommendation_id,session_id:je.session_id,event_type:ce,timestamp:J,metadata:be||{}})});if(!Oe.ok){const Ge=await Oe.text();throw F.error("[AdMeshProvider] Delegation event failed",{endpoint:ae,eventType:ce,status:Oe.status,errorBody:Ge,recommendationId:je.recommendation_id,delegationSessionId:je.delegation_session_id}),new Error(`Delegation event failed (${Oe.status}): ${Ge}`)}const X=await Oe.json(),Ve=X?.session;F.log("[AdMeshProvider] \u2705 Delegation event acknowledged",{endpoint:ae,eventType:ce,recommendationId:je.recommendation_id,delegationSessionId:je.delegation_session_id,returnedStatus:Ve?.status||X?.status}),Ve&&O(Ve)},[Q,s,U]),De=x.useCallback(()=>{V.current=0},[]),Ne=x.useCallback(async(ae="user_stopped",ce)=>{const be=Q;if(!be){F.warn("[AdMeshProvider] \u26A0\uFE0F stopDelegationSession called without an active SDK delegation session");return}F.log("[AdMeshProvider] \u{1F6D1} Stopping delegation session",{reason:ae,recommendationId:be.recommendation_id,delegationSessionId:be.delegation_session_id}),await Le("/aip/delegation/stop","session_stopped",{reason:ae,...ce||{}},be),await U?.trackPublisherAssistantEvent({event_name:"delegation_stopped",timestamp:new Date().toISOString(),session_id:be.session_id,recommendation_id:be.recommendation_id,delegation_session_id:be.delegation_session_id,brand_name:be.brand_name,status:"stopped",metadata:{reason:ae,...ce||{}}}).catch(Me=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to track delegation_stopped event:",Me)}),V.current=0,se.current=null,O(null),F.log("[AdMeshProvider] \u2705 Delegation session cleared locally after stop")},[Q,Le,U]),Be=x.useCallback(async(ae="turn_completed",ce)=>{ae==="turn_started"&&De(),await Le("/aip/delegation/activity",ae,ce)},[Le,De]);x.useEffect(()=>{const ae=Q?.delegation_session_id??null;ae!==se.current&&(se.current=ae,V.current=0)},[Q?.delegation_session_id]),x.useEffect(()=>{if(!(Q?.delegation_session_id??null)||!U)return;const ae=ke.current;if(!ae||!ze(ae)){O(be=>be?{...be,status:"expired"}:null);return}const ce=window.setInterval(()=>{const be=ke.current;if(!(!be||!ze(be))){if(V.current+=1,V.current>=Ud){F.log("[AdMeshProvider] \u23F1\uFE0F Stopping delegation after idle heartbeats",{delegationSessionId:be.delegation_session_id,heartbeatsSinceLastUserTurn:V.current,idleHeartbeatLimit:Ud}),Ne("idle_timeout",{source:"heartbeat_idle",heartbeats_without_turn:V.current}).catch(Me=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to stop idle delegation session:",Me)});return}Le("/aip/delegation/heartbeat","heartbeat").catch(Me=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to send delegation heartbeat:",Me)})}},Eh);return()=>{window.clearInterval(ce)}},[Q?.delegation_session_id,ze,Le,U,Ne]);const qt={sdk:U,apiKey:s,sessionId:d,theme:v,language:N,location:q,userId:_,model:y,messages:B,processedMessageIds:te,recommendationResults:ne,activeDelegationSession:Q,suggestions:fe,isAnalyzingIntent:ge||xe,intentError:oe,markMessageAsProcessed:ae=>{re(ce=>{const be=new Set(ce);return be.add(ae),be})},isMessageProcessed:ae=>te.has(ae),setRecommendationResult:(ae,ce)=>{ie(be=>{const Me=new Map(be);return Me.set(ae,ce),Me}),re(be=>{const Me=new Set(be);return Me.add(ae),Me})},getRecommendationResult:ae=>ne.get(ae),hasRecommendationResult:ae=>ne.has(ae),setActiveDelegationSession:ae=>{O(ae)},getActiveDelegationSession:()=>ze(Q)?Q:null,hasActiveDelegationSession:()=>ze(Q),refreshDelegationActivity:Be,stopDelegationSession:Ne,retryIntentAnalysis:ye};return m.jsx(Xd.Provider,{value:qt,children:H})};class Ah{constructor(){Hr(this,"roots",new Map)}async render(l){try{F.log("[AdMeshRenderer] \u{1F3A8} Attempting to render recommendations");const d=l.response.recommendations||[];if(d.length===0){F.log("[AdMeshRenderer] \u26A0\uFE0F No recommendations to render - skipping render to avoid occupying space");return}const c=document.getElementById(l.containerId);if(!c)throw F.error("[AdMeshRenderer] Container not found"),new Error(`Container with ID "${l.containerId}" not found`);F.log("[AdMeshRenderer] \u2705 Container ready");const v=this.roots.get(l.containerId);v&&(F.log("[AdMeshRenderer] \u{1F9F9} Cleaning up existing root"),v.unmount(),this.roots.delete(l.containerId)),c.innerHTML="";const M=Ed.createRoot(c);F.log("[AdMeshRenderer] \u{1F4CA} Rendering recommendations"),M.render(m.jsx(Qd,{apiKey:l.apiKey,sessionId:l.sessionId,theme:l.theme,apiBaseUrl:l.apiBaseUrl,language:l.language,location:l.location,userId:l.userId,model:l.model,messages:l.messages,children:m.jsx(fh,{recommendations:d,theme:l.theme,sessionId:l.sessionId,onDelegationConsent:l.onDelegationConsent,onDelegationActivated:l.onDelegationActivated,onStartDelegation:l.onStartDelegation})})),c.style.display="block",F.log("[AdMeshRenderer] \u2705 Recommendations rendered successfully"),this.roots.set(l.containerId,M)}catch(d){throw F.error("[AdMeshRenderer] Error rendering recommendations"),d}}unmount(l){const d=this.roots.get(l);if(d){d.unmount(),this.roots.delete(l);const c=document.getElementById(l);c&&(c.style.display="none")}}unmountAll(){for(const[,l]of this.roots.entries())l.unmount();this.roots.clear()}}const Ph=s=>{if(typeof s!="string")return;const l=s.trim().toUpperCase();return/^[A-Z]{2}$/.test(l)?l:void 0},qd=class Eo{constructor(l){if(Hr(this,"config"),Hr(this,"apiBaseUrl"),Hr(this,"renderer",null),Hr(this,"tracker",null),!l.apiKey)throw new Error("AdMeshSDK: apiKey is required");this.config={apiKey:l.apiKey,theme:l.theme,apiBaseUrl:l.apiBaseUrl,extension:l.extension,extensionSourceDomain:l.extensionSourceDomain,userId:l.userId},this.apiBaseUrl=l.apiBaseUrl||typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com"}getApiBaseUrl(){return this.apiBaseUrl}static buildPlatformResponseCacheKey(l,d){return`${l}::${d}`}getExtensionSourceDomain(){var l,d;const c=(l=this.config.extensionSourceDomain)==null?void 0:l.trim();if(c)return c.toLowerCase();if(typeof window<"u"&&(d=window.location)!=null&&d.hostname)return window.location.hostname.trim().toLowerCase()||void 0}static createSession(){const l=Date.now(),d=Math.random().toString(36).substring(2,15);return`session_${l}_${d}`}static generateSessionIdFromUrl(l){const d=l||(typeof window<"u"?window.location.href:"");if(!d)return Eo.createSession();try{const c=new URL(d).pathname.split("/").filter(M=>M.length>0),v=c[c.length-1];return v?`session_${Date.now()}_${v}`:Eo.createSession()}catch{return Eo.createSession()}}static createMessageId(l){const d=Date.now(),c=Math.random().toString(36).substring(2,9);return l?`msg_${l}_${d}_${c}`:`msg_${d}_${c}`}getRenderer(){return this.renderer||(this.renderer=new Ah),this.renderer}getTracker(){return this.tracker||(this.tracker=new hh({apiKey:this.config.apiKey})),this.tracker}async postDelegationEvent(l,d,c,v){const M=await fetch(`${this.apiBaseUrl}${l}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify({delegation_session_id:d.delegation_session_id,recommendation_id:d.recommendation_id,session_id:d.session_id,event_type:c,timestamp:new Date().toISOString(),metadata:v||{}})});if(!M.ok){const q=await M.text();throw new Error(`Delegation event failed (${M.status}): ${q}`)}const N=await M.json();return N?.session||null}async reportDelegationTurnStarted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_started",d)}async reportDelegationSessionStarted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"session_started",d)}async reportDelegationTurnCompleted(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_completed",d)}async reportDelegationToolInvocation(l,d){return this.postDelegationEvent("/aip/delegation/activity",l,"tool_invoked",d)}async reportDelegationOutcome(l,d,c){return this.postDelegationEvent("/aip/delegation/complete",l,d,c)}async stopDelegationSession(l,d="user_stopped",c){return this.postDelegationEvent("/aip/delegation/stop",l,"session_stopped",{reason:d,...c||{}})}getActiveDelegationSession(l){if(!l||l.status!=="active")return null;const d=Date.parse(l.expires_at);return Number.isNaN(d)||d<=Date.now()?null:l}hasActiveDelegationSession(l){return!!this.getActiveDelegationSession(l)}async showRecommendations(l){try{if(!l.sessionId||l.sessionId.trim()==="")throw new Error("sessionId is required and must be provided by the platform. The SDK never generates sessionId automatically.");if(!l.messageId||l.messageId.trim()==="")throw new Error("messageId is required and must be provided by the platform. The SDK never generates messageId automatically.");const d=await this.fetchPlatformResponse({query:l.query,sessionId:l.sessionId,messageId:l.messageId,platformSurface:l.platformSurface,model:l.model,messages:l.messages,language:l.locale,location:l.location,userId:l.userId??this.config.userId}),c={sessionId:l.sessionId,messageId:l.messageId,recommendations:[d]},v=this.getRenderer(),M=this.getTracker();await v.render({containerId:l.containerId,followups_container_id:l.followups_container_id,response:c,theme:l.theme||this.config.theme,tracker:M,sessionId:l.sessionId,apiKey:this.config.apiKey,apiBaseUrl:this.apiBaseUrl,language:l.locale,location:l.location,userId:l.userId,model:l.model,messages:l.messages,onPasteToInput:l.onPasteToInput,onDelegationConsent:l.onDelegationConsent,onDelegationActivated:l.onDelegationActivated,onStartDelegation:l.onStartDelegation,onExecuteQuery:l.onExecuteQuery})}catch(d){throw F.error("[AdMeshSDK] Error showing recommendations"),d}}async fetchPlatformResponse(l){var d,c,v,M,N,q,_,y,B,C,W,I,A;const H=`${this.apiBaseUrl}/aip/context`;if(F.log("[AdMeshSDK] \u{1F4E5} fetchPlatformResponse called"),!l.sessionId||l.sessionId.trim()===""){const ue=new Error("sessionId is required and must be provided by the platform. The SDK never generates sessionId automatically.");throw F.error("[AdMeshSDK] sessionId not provided by platform - cannot process request"),ue}const U=l.messageId;if(!U||U.trim()===""){const ue=new Error("messageId is required and must be provided by the platform. The SDK never generates messageId automatically.");throw F.error("[AdMeshSDK] messageId not provided by platform - cannot process request"),ue}const ee=Eo.buildPlatformResponseCacheKey(l.sessionId,U),te=Eo.inFlightPlatformResponses.get(ee);if(te)return F.log("[AdMeshSDK] \u23F3 Reusing in-flight PlatformResponse request",{sessionId:l.sessionId,messageId:U}),te;const re=l.messages?l.messages.length:0,ne=(typeof window<"u"&&window.navigator,"web"),ie=typeof window<"u"&&window.innerWidth?window.innerWidth<768?"mobile":window.innerWidth<1024?"tablet":"desktop":"desktop",Q=Ph((d=l.location)==null?void 0:d.countryCode)||"US",O=typeof window<"u"&&window.location?{url:window.location.href,origin:window.location.origin,referrer:document.referrer||void 0,host:window.location.hostname}:void 0,fe=l.userId??this.config.userId,le={spec_version:"1.0",message_id:U,timestamp:new Date().toISOString(),platform:{platform_id:"placeholder",role:"platform",software:{name:"admesh_ui_sdk",version:l.model||"1.0.0"}},identity:{namespace:"platform_user",value_hash:fe||"",confidence:fe?1:0},consent:{status:"granted",source:"admesh_ui_sdk",scope:{intent_based_monetization:!0,agent_participation:!0,measurement:!0},constraints:{allow_identity_downstream:!1}},classification_input:{type:"interaction",interaction:{session:{id:l.sessionId,turn_index:re},surface:{channel:l.platformSurface==="embedded_assistant"?"conversation":l.platformSurface||"conversation",interaction_mode:"text",platform:ne,form_factor:ie,locale:l.language||"en-US",country:Q,publisher:"placeholder"},input:{query_text:l.query,messages:l.messages||[]},context:{location:{city:((c=l.location)==null?void 0:c.city)||void 0,state:((v=l.location)==null?void 0:v.state)||void 0,state_code:((M=l.location)==null?void 0:M.stateCode)||void 0,country:((N=l.location)==null?void 0:N.country)||void 0,country_code:Q,zipcode:((q=l.location)==null?void 0:q.zipcode)||void 0,latitude:(_=l.location)==null?void 0:_.latitude,longitude:(y=l.location)==null?void 0:y.longitude},page:O}}},monetization:{enabled:!0,pricing_model:"CPX",auction:{enabled:!0,floor:{amount:0,currency:"USD"}}}};(C=(B=le.classification_input.interaction)==null?void 0:B.input.query_text)!=null&&C.trim()||F.warn("[AdMeshSDK] \u26A0\uFE0F Warning: Sending request with empty query_text");const ge=JSON.stringify(le);F.log("[AdMeshSDK] \u{1F4E4} Sending canonical request to /aip/context",{messageId:le.message_id,specVersion:le.spec_version,classificationType:le.classification_input.type,platformId:le.platform.platform_id,surfaceChannel:(W=le.classification_input.interaction)==null?void 0:W.surface.channel,sessionId:(A=(I=le.classification_input.interaction)==null?void 0:I.session)==null?void 0:A.id});const $e={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`};if(this.config.extension){$e["X-AdMesh-Source"]="extension";const ue=this.getExtensionSourceDomain();ue&&($e["X-AdMesh-Source-Domain"]=ue)}const oe=(async()=>{const ue=await fetch(H,{method:"POST",headers:$e,body:ge});if(!ue.ok){const Pe=(await ue.json().catch(()=>({}))).detail||`HTTP ${ue.status}`;throw new Error(`Failed to fetch recommendation from /aip/context: ${Pe}`)}const xe=await ue.json();return F.log("[AdMeshSDK] \u{1F4E5} Raw response from /aip/context:",{status:xe.status,recommendationId:xe.recommendation_id,hasRecommendation:!!xe.recommendation,hasTracking:!!xe.tracking,hasDelegation:!!xe.delegation,topLevelKeys:Object.keys(xe)}),F.log("[AdMeshSDK] \u{1F4E6} Full PlatformResponse received from /aip/context",xe),xe})();Eo.inFlightPlatformResponses.set(ee,oe);try{return await oe}finally{Eo.inFlightPlatformResponses.delete(ee)}}async trackPublisherAssistantEvent(l){const d=Array.isArray(l)?{events:l}:l,c=await fetch(`${this.apiBaseUrl}/analytics/publisher-assistant/events`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify(d),keepalive:!0});if(!c.ok){const v=await c.text().catch(()=>"");throw new Error(`Failed to track publisher assistant analytics (${c.status}): ${v}`)}}async reportSponsoredRecommendation(l){const d=await fetch(`${this.apiBaseUrl}/analytics/recommendation-reports`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify(l),keepalive:!0});if(!d.ok){const c=await d.text().catch(()=>"");throw new Error(`Failed to report sponsored recommendation (${d.status}): ${c}`)}}fireFollowupExposure(l,d,c){this.getTracker().fireFollowupExposure(l,d,c)}async fireFollowupEngagement(l,d,c){return this.getTracker().fireFollowupEngagement(l,d,c)}};Hr(qd,"inFlightPlatformResponses",new Map);let Kd=qd;const Xd=x.createContext(void 0);function Gd(){const s=x.useContext(Xd);if(!s)throw new Error("useAdMeshContext must be used within an <AdMeshProvider>. Make sure your component is wrapped with <AdMeshProvider>.");return s}function Zd(){const s=Gd();return{sdk:s.sdk,apiKey:s.apiKey,sessionId:s.sessionId,theme:s.theme,language:s.language,location:s.location,userId:s.userId,model:s.model,messages:s.messages,processedMessageIds:s.processedMessageIds,recommendationResults:s.recommendationResults,activeDelegationSession:s.activeDelegationSession,markMessageAsProcessed:s.markMessageAsProcessed,isMessageProcessed:s.isMessageProcessed,setRecommendationResult:s.setRecommendationResult,getRecommendationResult:s.getRecommendationResult,hasRecommendationResult:s.hasRecommendationResult,setActiveDelegationSession:s.setActiveDelegationSession,getActiveDelegationSession:s.getActiveDelegationSession,hasActiveDelegationSession:s.hasActiveDelegationSession,refreshDelegationActivity:s.refreshDelegationActivity,stopDelegationSession:s.stopDelegationSession}}const Ih=({className:s,size:l=20})=>m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:[m.jsx("path",{d:"M5 12h14"}),m.jsx("path",{d:"M12 5v14"})]}),Mh=({recommendation:s,theme:l,sdk:d,sessionId:c,onExecuteQuery:v})=>{var M,N,q,_,y;const B=(N=(M=s.recommendation)==null?void 0:M.creative)!=null&&N.follow_up_suggestion&&(q=s.tracking)!=null&&q.followup_engagement_url&&(_=s.tracking)!=null&&_.followup_exposure_url?{query:s.recommendation.creative.follow_up_suggestion,engagement_url:s.tracking.followup_engagement_url,exposure_url:s.tracking.followup_exposure_url}:null,C=B?.query,W=B?.engagement_url,I=B?.exposure_url,A=s.recommendation_id,H=((y=s.recommendation)==null?void 0:y.offerId)||A;if(!C||!W||!I)return F.log("[AdMeshFollowup] Missing followup_suggestion.query, engagement_url, or exposure_url - not rendering"),null;const U=async()=>{try{W&&A&&(F.log("[AdMeshFollowup] \u{1F3AF} Firing follow-up engagement tracking"),await d.fireFollowupEngagement(W,A,c)),v&&C?(F.log(`[AdMeshFollowup] \u{1F50D} Executing query: ${C}`),await v(C)):F.warn("[AdMeshFollowup] \u26A0\uFE0F onExecuteQuery not provided - cannot execute query")}catch(ee){F.error("[AdMeshFollowup] Error handling follow-up click:",ee)}};return m.jsx(rl,{productId:H,recommendationId:A||"",exposureUrl:I,sessionId:c,className:"admesh-followup-container",style:{width:"100%"},children:m.jsxs("div",{className:"flex flex-col space-y-3 text-sm admesh-followup-wrapper",children:[m.jsx("div",{className:"h-px w-full bg-[#E5E5E5] dark:bg-[#262626] admesh-divider"}),m.jsxs("div",{onClick:U,className:"cursor-pointer flex flex-row justify-between font-medium space-x-2 items-center group",role:"button",tabIndex:0,onKeyDown:ee=>{(ee.key==="Enter"||ee.key===" ")&&U()},"aria-label":`Sponsored follow-up: ${C}`,children:[m.jsx("p",{className:"transition duration-200 text-[#000] dark:text-[#FFF] hover:text-[#24A0ED] admesh-followup-text",children:C}),m.jsxs("div",{className:"flex flex-row items-center space-x-2",children:[m.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 italic admesh-ad-label",children:"Ad"}),m.jsx(Ih,{size:20,className:"text-[#24A0ED] flex-shrink-0 admesh-plus-icon"})]})]})]})})},Va=({onRecommendationsShown:s,onError:l,messageId:d,query:c,userId:v,initialRecommendation:M,triggerExposureUrl:N=!0,followups_container_id:q,onPasteToInput:_,onDelegationConsent:y,onDelegationActivated:B,onStartDelegation:C,onRecommendationReport:W,onExecuteQuery:I,onFollowupDetected:A,isContainerReady:H})=>{var U,ee,te,re;const{sdk:ne,sessionId:ie,apiKey:Q,language:O,location:fe,userId:le,model:ge,messages:$e,theme:oe,getRecommendationResult:ue,hasRecommendationResult:xe,setRecommendationResult:Pe,activeDelegationSession:E,setActiveDelegationSession:V,hasActiveDelegationSession:se}=Zd(),ke=J=>!!J&&J.status==="generated"&&!!J.recommendation,Ee=v||le,[f,P]=x.useState(null),[G,Y]=x.useState(null),[_e,ye]=x.useState(!0),[ze,Le]=x.useState(null),De=x.useRef(null),Ne=x.useRef(!1),Be=x.useRef(!1),qt=x.useRef(s),ae=x.useRef(l);x.useEffect(()=>{qt.current=s,ae.current=l},[s,l]),x.useEffect(()=>{De.current!==d&&(De.current=null,Be.current=!1,P(null),Y(null))},[d]);const ce=se()&&E?.session_id===ie;x.useEffect(()=>{var J,Oe,X;if(!d||!xe(d)||ce)return;const Ve=ue(d);if(!Ve){F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored no_match result from provider state"),P(null),Y(null),Le(null),ye(!1),De.current=d,Ne.current=!1,Be.current=!0;return}let Ge=((J=Ve.recommendation)==null?void 0:J.format)||"tail";(Ge==="weave"||Ge==="product_card")&&(Ge="tail"),F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored recommendation result from provider state",{messageId:d,recommendationId:Ve.recommendation_id,format:(Oe=Ve.recommendation)==null?void 0:Oe.format}),P(Ve),Y(Ge),Le(null),ye(!1),De.current=d,Ne.current=!1,Be.current=!0,(X=qt.current)==null||X.call(qt,d,Ve)},[ue,xe,ce,d]),x.useEffect(()=>{var J,Oe,X,Ve,Ge,K,Je;if(!(!M||!d)&&!ce)try{const Fe=M,un=M.status||"unknown";if(!ke(Fe)){if(un==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F Initial recommendation returned no_match - rendering nothing"),P(null),Y(null),Le(null),ye(!1),De.current=d,Ne.current=!1,Be.current=!0,Pe(d,null);return}throw new Error(`Initial recommendation is not a filled auction response (status=${un})`)}let it=((J=Fe.recommendation)==null?void 0:J.format)||"tail";(it==="weave"||it==="product_card")&&(it="tail"),P(Fe),Y(it),Le(null),ye(!1),De.current=d,Ne.current=!1,Be.current=!0,Pe(d,Fe),(Oe=qt.current)==null||Oe.call(qt,d,Fe),F.log("[AdMeshRecommendations] \u267B\uFE0F Using initial recommendation payload, skipping /aip/context fetch"),F.log("[AdMeshRecommendations] \u2705 Accepted initial generated recommendation payload",{messageId:d,recommendationId:Fe.recommendation_id,format:(X=Fe.recommendation)==null?void 0:X.format,brandName:(Ge=(Ve=Fe.recommendation)==null?void 0:Ve.creative)==null?void 0:Ge.brand_name,headline:(Je=(K=Fe.recommendation)==null?void 0:K.creative)==null?void 0:Je.headline,hasTracking:!!Fe.tracking})}catch(Fe){const un=Fe instanceof Error?Fe:new Error(String(Fe));Be.current=!1,F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Failed to reuse initial recommendation, will fall back to fetch: ${un.message}`)}},[ce,M,d,Pe]),x.useEffect(()=>{if(!d||!c||c.trim()===""){F.log("[AdMeshRecommendations] Validation failed - missing required parameters"),ye(!1);return}if(ce){F.log("[AdMeshRecommendations] \u23F8\uFE0F Delegated session active, skipping /aip/context fetch",{messageId:d,conversationSessionId:ie,delegationSessionId:E?.delegation_session_id}),P(null),Y(null),Le(null),ye(!1),Ne.current=!1;return}if(!(ne!=null&&ne.fetchPlatformResponse)){F.log("[AdMeshRecommendations] SDK fetchPlatformResponse not available"),ye(!1);return}if(Be.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Initial recommendation provided, skipping duplicate fetch");return}if(De.current===d){F.log("[AdMeshRecommendations] \u23ED\uFE0F Already fetched for this messageId, skipping duplicate fetch");return}if(Ne.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Fetch already in progress, skipping duplicate fetch");return}F.log("[AdMeshRecommendations] \u{1F4E4} Fetching recommendation from /aip/context (single fetch)"),(async()=>{var J,Oe,X,Ve,Ge,K,Je,Fe,un;try{Ne.current=!0,ye(!0),Le(null);const it=await ne.fetchPlatformResponse({query:c.trim(),sessionId:ie,messageId:d,language:O,location:fe,userId:Ee,model:ge,...$e&&$e.length>0&&{messages:$e}}),Kt=it?.status||"unknown";if(!ke(it)){if(Kt==="no_match"){F.log("[AdMeshRecommendations] \u2139\uFE0F No recommendation returned from /aip/context"),P(null),Y(null),Le(null),ye(!1),Ne.current=!1,De.current=d,Pe(d,null);return}throw new Error(`No filled recommendation returned from /aip/context (status=${Kt})`)}P(it),F.log("[AdMeshRecommendations] \u2705 Accepted fetched generated recommendation payload",{messageId:d,recommendationId:it.recommendation_id,format:(J=it.recommendation)==null?void 0:J.format,brandName:(X=(Oe=it.recommendation)==null?void 0:Oe.creative)==null?void 0:X.brand_name,headline:(Ge=(Ve=it.recommendation)==null?void 0:Ve.creative)==null?void 0:Ge.headline,hasTracking:!!it.tracking});let Mn=((K=it.recommendation)==null?void 0:K.format)||"tail";(Mn==="weave"||Mn==="product_card")&&(Mn="tail"),Y(Mn),De.current=d,Pe(d,it),F.log("[AdMeshRecommendations] \u{1F4CA} Format detection:",{preferred_format:(Je=it.recommendation)==null?void 0:Je.format,selected_format:Mn}),ye(!1),Ne.current=!1,(Fe=qt.current)==null||Fe.call(qt,d,it)}catch(it){const Kt=it instanceof Error?it:new Error(String(it));Kt.message.includes("Failed to fetch")||Kt.message.includes("NetworkError")?F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Network error fetching recommendations(non - critical): ${Kt.message} `):F.error(`[AdMeshRecommendations] Error fetching recommendations: ${Kt.message} `),Le(Kt),ye(!1),Ne.current=!1,(un=ae.current)==null||un.call(ae,Kt)}})()},[E?.delegation_session_id,ce,ne,ie,d,c,O,fe,Ee,ge,M,Pe]),x.useEffect(()=>{var J,Oe,X,Ve;if(!f||!A)return;const Ge=(Oe=(J=f.recommendation)==null?void 0:J.creative)!=null&&Oe.follow_up_suggestion&&(X=f.tracking)!=null&&X.followup_engagement_url&&(Ve=f.tracking)!=null&&Ve.followup_exposure_url?{label:f.recommendation.creative.follow_up_suggestion,query:f.recommendation.creative.follow_up_suggestion,engagement_url:f.tracking.followup_engagement_url,exposure_url:f.tracking.followup_exposure_url}:null;Ge&&A(Ge,f.recommendation_id)},[f,A]);const be=x.useCallback(async J=>{if(!ne||!ie)throw new Error("AdMesh SDK activation requires an initialized session");const Oe=await fetch(`${ne.getApiBaseUrl()}/aip/delegation/activate`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${Q}`},body:JSON.stringify({session_id:ie,recommendation_id:J.recommendation_id,metadata:J.metadata})});if(!Oe.ok){const K=await Oe.text();throw new Error(`Failed to activate delegation session: ${Oe.status} ${K}`)}const X=await Oe.json(),Ve={...J,delegation_session_id:X.delegation_session_id||J.delegation_session_id,session_id:X.session_id||ie,brand_id:X.brand_id||J.brand_id,brand_name:X.brand_name||J.brand_name,mcp_endpoint:X.mcp_endpoint,eligibility_reason:X.eligibility_reason||J.eligibility_reason,delegate_reason:X.delegate_reason||J.delegate_reason,session_goal:X.session_goal||J.session_goal,desired_outcome_type:X.desired_outcome_type||J.desired_outcome_type,required_user_inputs:X.required_user_inputs||J.required_user_inputs||[],required_consent_types:X.required_consent_types||J.required_consent_types||[],success_outcome:X.success_outcome||J.success_outcome,fallback_message:X.fallback_message||J.fallback_message,session_mode:"inline",status:X.status||"active",capabilities:X.capabilities||J.capabilities||[],allowed_data_types:X.allowed_data_types||J.allowed_data_types||[],auth_model:X.auth_model||J.auth_model,handoff_protocol:X.handoff_protocol||J.handoff_protocol,supported_actions:X.supported_actions||J.supported_actions||[],metadata:X.metadata||J.metadata},Ge={delegation_session_id:X.delegation_session_id,recommendation_id:J.recommendation_id,session_id:X.session_id||ie,brand_agent_id:X.brand_agent_id,brand_id:X.brand_id||J.brand_id,brand_name:X.brand_name||J.brand_name||"Brand",mcp_endpoint:X.mcp_endpoint,status:X.status||"active",activated_at:X.created_at,last_activity_at:X.updated_at,expires_at:X.expires_at||X.updated_at,eligibility_reason:X.eligibility_reason||J.eligibility_reason,delegate_reason:X.delegate_reason||J.delegate_reason,session_goal:X.session_goal||J.session_goal,desired_outcome_type:X.desired_outcome_type||J.desired_outcome_type,required_user_inputs:X.required_user_inputs||J.required_user_inputs||[],required_consent_types:X.required_consent_types||J.required_consent_types||[],success_outcome:X.success_outcome||J.success_outcome,fallback_message:X.fallback_message||J.fallback_message,capabilities:X.capabilities||J.capabilities||[],allowed_data_types:X.allowed_data_types||J.allowed_data_types||[],consent_requirements:X.consent_requirements||J.consent_requirements||[],auth_model:X.auth_model||J.auth_model,handoff_protocol:X.handoff_protocol||J.handoff_protocol,supported_actions:X.supported_actions||J.supported_actions||[],metadata:X.metadata||J.metadata};if(V(Ge),await ne.trackPublisherAssistantEvent({event_name:"delegation_started",timestamp:new Date().toISOString(),session_id:ie,recommendation_id:J.recommendation_id,delegation_session_id:X.delegation_session_id,brand_name:Ge.brand_name,status:X.status||"active",metadata:{brand_agent_id:X.brand_agent_id,source:"recommendation_card"}}).catch(K=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to track delegation_started event:",K)}),await ne.reportDelegationSessionStarted(Ge,{brand_agent_id:X.brand_agent_id,brand_name:Ge.brand_name}).then(K=>{K&&V(K)}).catch(K=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report delegation session_started event:",K)}),B){try{await B(Ve)}catch(K){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onDelegationActivated callback failed after successful delegation activation:",K)}return}if(C)try{await C({...J.platform_response,delegation:{...J.platform_response.delegation,...Ve,delegation_session_id:X.delegation_session_id,available:!0,status:X.status||"active"}})}catch(K){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onStartDelegation callback failed after successful delegation activation:",K)}},[Q,B,C,ne,ie,V]),Me=x.useCallback(async J=>{var Oe,X;if(W){await W(J);return}!ne||!ie||await ne.reportSponsoredRecommendation({session_id:ie,message_id:d,recommendation_id:J.recommendation_id,reason:J.reason,brand_name:(X=(Oe=J.recommendation.recommendation)==null?void 0:Oe.creative)==null?void 0:X.brand_name,metadata:{reason:J.reason,source:"recommendation_card"}}).catch(Ve=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report sponsored recommendation:",Ve)})},[d,W,ne,ie]);if(!d||!c||c.trim()===""||_e||ze)return null;if(!f||!G)return F.log("[AdMeshRecommendations] \u{1F6AB} Nothing to render",{messageId:d,hasPlatformResult:!!f,detectedFormat:G,isLoading:_e,hasError:!!ze}),null;F.log("[AdMeshRecommendations] \u{1F3A8} Rendering recommendation component",{messageId:d,recommendationId:f.recommendation_id,detectedFormat:G,brandName:(ee=(U=f.recommendation)==null?void 0:U.creative)==null?void 0:ee.brand_name,headline:(re=(te=f.recommendation)==null?void 0:te.creative)==null?void 0:re.headline});const je=typeof document<"u"&&q&&(H??!0)?document.getElementById(q):null;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"admesh-recommendations-container",style:{marginTop:"1rem"},children:m.jsx(Wd,{recommendations:[f],theme:oe,sessionId:ie,triggerExposureUrl:N,onPasteToInput:_,onDelegationConsent:y,onDelegationActivated:be,onStartDelegation:C,onRecommendationReport:Me})}),je&&ne&&ie?el.createPortal(m.jsx(Mh,{recommendation:f,theme:oe,sdk:ne,sessionId:ie,onExecuteQuery:I}),je):null]})},ol="admesh-ui-sdk-styles",al="admesh-ui-sdk-reset",jh=`
238
248
  /* AdMesh UI SDK - CSS Reset & Normalization */
239
249
  .admesh-component,
240
250
  .admesh-component * {
@@ -323,7 +333,7 @@ Article topic inferred from URL path: ${d}`,url:s,domain:l.hostname,extracted_at
323
333
  .admesh-component[data-admesh-theme="light"] {
324
334
  color-scheme: light;
325
335
  }
326
- `,Ih=`
336
+ `,Rh=`
327
337
  /* AdMesh Core Component Styles */
328
338
 
329
339
  .admesh-component {
@@ -534,7 +544,7 @@ Article topic inferred from URL path: ${d}`,url:s,domain:l.hostname,extracted_at
534
544
  font-size: 0.875rem;
535
545
  }
536
546
  }
537
- `,jh=()=>{if(!(typeof document>"u")&&!(document.getElementById(al)&&document.getElementById(ol))){if(!document.getElementById(al)){const s=document.createElement("style");s.id=al,s.textContent=Mh,document.head.appendChild(s)}if(!document.getElementById(ol)){const s=document.createElement("style");s.id=ol,s.textContent=Ih,document.head.appendChild(s)}}},Nh=`
547
+ `,Dh=()=>{if(!(typeof document>"u")&&!(document.getElementById(al)&&document.getElementById(ol))){if(!document.getElementById(al)){const s=document.createElement("style");s.id=al,s.textContent=jh,document.head.appendChild(s)}if(!document.getElementById(ol)){const s=document.createElement("style");s.id=ol,s.textContent=Rh,document.head.appendChild(s)}}},Nh=`
538
548
  /* AdMesh UI SDK - Complete Self-Contained Styles */
539
549
 
540
550
  /* CSS Reset for AdMesh components */
@@ -1202,17 +1212,17 @@ Article topic inferred from URL path: ${d}`,url:s,domain:l.hostname,extracted_at
1202
1212
  .admesh-component .lg\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
1203
1213
  .admesh-component .lg\\:col-span-1 { grid-column: span 1 / span 1; }
1204
1214
  }
1205
- `;let Jd=!1;const Rh=()=>{x.useEffect(()=>{if(!Jd){try{jh();const s=document.createElement("style");s.id="admesh-ui-sdk-styles-legacy",s.textContent=Nh,document.getElementById("admesh-ui-sdk-styles-legacy")||document.head.appendChild(s),Jd=!0}catch{F.error("[AdMesh] Failed to inject styles")}return()=>{}}},[])},Dh=()=>{};function Th(s){const l=Math.max(1,Math.round(s));if(l<60)return`${l}s`;const d=Math.floor(l/60),c=l%60;return c>0?`${d}m ${c}s`:`${d}m`}function Lh(s){return Th(s/1e3)}const il=({content:s,theme:l,fontSize:d})=>{const c=M=>M.split(/(\*\*[^*]+\*\*|\[[^\]]+\]\(https?:\/\/[^)\s]+\))/g).map((A,H)=>{if(A.startsWith("**")&&A.endsWith("**")&&A.length>4)return m.jsx("strong",{style:{fontWeight:"600",color:l.textColor},children:A.slice(2,-2)},H);const U=A.match(/^\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)$/);return U?m.jsx("a",{href:U[2],target:"_blank",rel:"noopener noreferrer",style:{color:l.primaryColor,textDecoration:"underline",textUnderlineOffset:"2px"},children:U[1]},H):m.jsx(x.Fragment,{children:A},H)}),v=M=>M.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(A=>A.trim()).filter((A,H,U)=>A.length>0||H<U.length-1),I=M=>{const A=v(M);return A.length>1&&A.every(H=>/^:?-{3,}:?$/.test(H))},D=M=>{const A=M.indexOf("|");if(A<=0)return{heading:null,headerLine:M};const H=M.slice(0,A).trim();return!H||/^[-|:\s]+$/.test(H)?{heading:null,headerLine:M}:{heading:H,headerLine:M.slice(A).trim()}},q=(M,A)=>{const H=v(M).length,U=v(A).length;return H<=1||H===U?A:`| ${Array.from({length:H},()=>"---").join(" | ")} |`},_=M=>{if(M.length<2||!M[0].includes("|"))return{heading:null,lines:M};const{heading:A,headerLine:H}=D(M[0]),U=H.startsWith("|")?H:`| ${H}`,ee=q(U,M[1]);return{heading:A,lines:[U,ee,...M.slice(2)]}},y=M=>{if(M.length<2||!M[0].includes("|"))return!1;const{lines:A}=_(M);return I(A[1])&&v(A[0]).length>=2},B=M=>{if(!M.includes("|"))return[M];let A=M.trim();const H=[],U=A.indexOf("|");if(U>0){const ee=A.slice(0,U).trim();ee&&!/^[-|:\s]+$/.test(ee)&&(H.push(ee),A=A.slice(U).trim())}return A=A.replace(/\|\s*(\|(?:\s*:?-{3,}:?\s*\|)+)/g,(ee,te)=>`
1215
+ `;let Jd=!1;const Th=()=>{x.useEffect(()=>{if(!Jd){try{Dh();const s=document.createElement("style");s.id="admesh-ui-sdk-styles-legacy",s.textContent=Nh,document.getElementById("admesh-ui-sdk-styles-legacy")||document.head.appendChild(s),Jd=!0}catch{F.error("[AdMesh] Failed to inject styles")}return()=>{}}},[])},Lh=()=>{};function Fh(s){const l=Math.max(1,Math.round(s));if(l<60)return`${l}s`;const d=Math.floor(l/60),c=l%60;return c>0?`${d}m ${c}s`:`${d}m`}function $h(s){return Fh(s/1e3)}const il=({content:s,theme:l,fontSize:d})=>{const c=I=>I.split(/(\*\*[^*]+\*\*|\[[^\]]+\]\(https?:\/\/[^)\s]+\))/g).map((A,H)=>{if(A.startsWith("**")&&A.endsWith("**")&&A.length>4)return m.jsx("strong",{style:{fontWeight:"600",color:l.textColor},children:A.slice(2,-2)},H);const U=A.match(/^\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)$/);return U?m.jsx("a",{href:U[2],target:"_blank",rel:"noopener noreferrer",style:{color:l.primaryColor,textDecoration:"underline",textUnderlineOffset:"2px"},children:U[1]},H):m.jsx(x.Fragment,{children:A},H)}),v=I=>I.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(A=>A.trim()).filter((A,H,U)=>A.length>0||H<U.length-1),M=I=>{const A=v(I);return A.length>1&&A.every(H=>/^:?-{3,}:?$/.test(H))},N=I=>{const A=I.indexOf("|");if(A<=0)return{heading:null,headerLine:I};const H=I.slice(0,A).trim();return!H||/^[-|:\s]+$/.test(H)?{heading:null,headerLine:I}:{heading:H,headerLine:I.slice(A).trim()}},q=(I,A)=>{const H=v(I).length,U=v(A).length;return H<=1||H===U?A:`| ${Array.from({length:H},()=>"---").join(" | ")} |`},_=I=>{if(I.length<2||!I[0].includes("|"))return{heading:null,lines:I};const{heading:A,headerLine:H}=N(I[0]),U=H.startsWith("|")?H:`| ${H}`,ee=q(U,I[1]);return{heading:A,lines:[U,ee,...I.slice(2)]}},y=I=>{if(I.length<2||!I[0].includes("|"))return!1;const{lines:A}=_(I);return M(A[1])&&v(A[0]).length>=2},B=I=>{if(!I.includes("|"))return[I];let A=I.trim();const H=[],U=A.indexOf("|");if(U>0){const ee=A.slice(0,U).trim();ee&&!/^[-|:\s]+$/.test(ee)&&(H.push(ee),A=A.slice(U).trim())}return A=A.replace(/\|\s*(\|(?:\s*:?-{3,}:?\s*\|)+)/g,(ee,te)=>`
1206
1216
  ${te}`),A=A.replace(/\|\s*\|\s*(?=[A-Za-z0-9*])/g,`|
1207
1217
  | `),A=A.replace(/\|\s+(?=\|(?!\s*:?-{3,}:?\s*\|)[^|\n])/g,`|
1208
1218
  `),H.push(...A.split(`
1209
- `).map(ee=>ee.trim()).filter(Boolean)),H},C=M=>{const A=M.split(`
1219
+ `).map(ee=>ee.trim()).filter(Boolean)),H},C=I=>{const A=I.split(`
1210
1220
  `),H=[];for(const U of A){if(!U.includes("|")){H.push(U);continue}H.push(...B(U))}return H.join(`
1211
- `)},W=(M=>{const A=C(M).split(`
1212
- `),H=[];let U=0;for(;U<A.length;){const ee=A[U],te=A[U+1]||"";if(ee.includes("|")&&I(te)){H.length>0&&H[H.length-1].trim()&&H.push("");const{heading:re,headerLine:ne}=D(ee);for(re&&H.push(re),H.push(ne,q(ne,te)),U+=2;U<A.length&&A[U].includes("|")&&A[U].trim();)H.push(A[U]),U+=1;U<A.length&&A[U].trim()&&H.push("");continue}H.push(ee),U+=1}return H.join(`
1213
- `)})(s).split(/\n\s*\n/).map(M=>M.trim()).filter(Boolean);return m.jsx("div",{style:{margin:0,color:l.textColor,fontSize:d},children:W.map((M,A)=>{const H=M.split(`
1214
- `).map(ne=>ne.trim()).filter(Boolean),U=H.every(ne=>/^[-*]\s+/.test(ne)),ee=H.every(ne=>/^\d+\.\s+/.test(ne)),te=H.length===1&&/^#{1,3}\s+/.test(H[0]),re=y(H);if(te){const ne=H[0].replace(/^#{1,3}\s+/,"");return m.jsx("h3",{style:{marginTop:A===0?0:"1rem",marginBottom:"0.75rem",fontWeight:"600",fontSize:"1.05em",color:l.textColor},children:c(ne)},A)}if(re){const{heading:ne,lines:ie}=_(H),Q=v(ie[0]),O=ie.slice(2).map(v).filter(fe=>fe.length===Q.length);return m.jsxs("div",{style:{width:"100%",overflowX:"auto",marginBottom:"1rem"},children:[ne?m.jsx("p",{style:{marginTop:A===0?0:"1rem",marginBottom:"0.75rem",fontWeight:600,color:l.textColor,fontSize:d},children:c(ne)}):null,m.jsx("div",{style:{border:`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.28)"}`,borderRadius:8,overflowX:"auto"},children:m.jsxs("table",{style:{width:"100%",minWidth:Q.length>3?520:void 0,borderCollapse:"collapse",color:l.textColor,fontSize:d,lineHeight:1.45},children:[m.jsx("thead",{children:m.jsx("tr",{children:Q.map((fe,le)=>m.jsx("th",{style:{textAlign:"left",padding:"9px 10px",fontWeight:600,background:l.surfaceColor||"rgba(148, 163, 184, 0.12)",borderBottom:`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.28)"}`,whiteSpace:"normal"},children:c(fe)},le))})}),m.jsx("tbody",{children:O.map((fe,le)=>m.jsx("tr",{children:fe.map((ge,$e)=>m.jsx("td",{style:{padding:"9px 10px",verticalAlign:"top",borderBottom:le===O.length-1?"none":`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.18)"}`,whiteSpace:"normal"},children:c(ge)},$e))},le))})]})})]},A)}if(U||ee){const ne=ee?"ol":"ul";return m.jsx(ne,{style:{marginBottom:"1rem",paddingLeft:"1.25rem",color:l.textColor,fontSize:d},children:H.map((ie,Q)=>m.jsx("li",{style:{marginBottom:"0.45rem"},children:c(ie.replace(/^([-*]|\d+\.)\s+/,""))},Q))},A)}return m.jsx("p",{style:{marginBottom:"1rem",lineHeight:"1.6",color:l.textColor,fontSize:d,whiteSpace:"pre-wrap"},children:H.map((ne,ie)=>m.jsxs(x.Fragment,{children:[ie>0&&m.jsx("br",{}),c(ne)]},ie))},A)})})};function Ua(s){return s===void 0?void 0:typeof s=="number"?`${s}px`:s}function Yd(s){if(typeof s=="number")return s;if(typeof s!="string")return;const l=Number(s.trim().replace(/px$/i,""));return Number.isFinite(l)&&l>0?l:void 0}function Po(s){return s.replace(/\s+/g," ").trim()}function Fh(s,l){const d=s.filter(D=>!(D!=null&&D.is_sponsored)).slice(0,3),c=l.filter(D=>!(D!=null&&D.is_sponsored)).slice(0,3),v=l.find(D=>D?.is_sponsored);if(!v)return c.length?c:d;const I=c.length?c:d;return[v,...I].slice(0,4)}function $h(s,l,d,c){const v=new Set,I=[],D=(C,W="information")=>{const M=Po(C);if(!M)return;const A=M.toLowerCase();v.has(A)||(v.add(A),I.push({id:`followup_${I.length}_${A.replace(/[^a-z0-9]+/g,"_")}`,text:M,type:W,is_sponsored:!1}))},q=new Set,_=C=>{const W=Po(C||"");if(!W)return;const M=W.replace(/^(how|why|what|when|where|which|who)\s+/i,"").replace(/\?+$/g,"").trim();M&&q.add(M)};(c||[]).forEach(C=>_(C?.title)),(d||[]).forEach(C=>_(C?.title)),l.split(/\n+/).map(C=>Po(C.replace(/^[-*]\s+/,""))).filter(Boolean).filter(C=>C.length>=24&&C.length<=90).forEach(C=>{q.size>=6||_(C)});const y=Po(s.replace(/[?.!]+$/g,"")),B=Array.from(q).slice(0,3);return[B[0]?`Tell me more about ${B[0]}`:"",B[1]?`Show me examples related to ${B[1]}`:"",B[2]?`Compare the main options for ${B[2]}`:"","Break this down more simply",`What should I look at next about ${y}`,"Give me the practical takeaway here"].forEach((C,W)=>{I.length>=3||D(C,W===0?"comparison":"information")}),I.slice(0,3)}function Oh(){if(typeof window>"u")return"unknown";const s=window.innerWidth;return s<768?"mobile":s<1024?"tablet":"desktop"}function ec(s){return s?{shell:{position:"fixed",left:0,right:0,bottom:0,width:"100%",maxWidth:"100%",height:"calc(100dvh - env(safe-area-inset-bottom, 0px))",maxHeight:"calc(100dvh - env(safe-area-inset-bottom, 0px))",padding:0,margin:0,zIndex:2147483001,boxSizing:"border-box"},panelWidth:"100%",panelMaxWidth:"100%",panelHeight:"100%",panelMaxHeight:"100%",panelBorderRadius:"0"}:{shell:{position:"fixed",left:"50%",bottom:"12px",transform:"translateX(-50%)",width:"min(960px, calc(100vw - 24px))",maxWidth:"100%",maxHeight:"calc(100vh - 24px)",zIndex:2147483001,boxSizing:"border-box"},panelWidth:"min(960px, calc(100vw - 24px))",panelMaxWidth:"100%",panelHeight:"min(78vh, 760px)",panelMaxHeight:void 0,panelBorderRadius:"12px"}}function tc(s){const l=s?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return!!(d.protocol&&d.hostname)}catch{return!1}}function nc(){var s;try{const l=(s=window.location.href)==null?void 0:s.trim();if(tc(l))return l}catch{return}}function rc(s){if(typeof window>"u")return{page_url:void 0,page_path:void 0,article_slug:void 0,page_title:void 0,referrer:void 0,device_type:"unknown"};const l=nc()||(tc(s)?s.trim():void 0);let d=l?window.location.pathname||"/":void 0;try{d=l?new URL(l).pathname||"/":void 0}catch{d=nc()?window.location.pathname||"/":void 0}const c=(d||"").split("/").filter(Boolean);return{page_url:l,page_path:d,article_slug:c[c.length-1],page_title:document.title||void 0,referrer:document.referrer||void 0,device_type:Oh()}}function Wh(s){var l,d;const c=(d=(l=s?.recommendation)==null?void 0:l.creative)==null?void 0:d.follow_up_suggestion,v=s?.recommendation_id;return!c||!v?null:{id:v,text:Po(c),type:"action",is_sponsored:!0,recommendation:s,metadata:{source:"assistant_query_recommendation",recommendation_id:v}}}function sl(s){return[...s].sort((l,d)=>{const c=!!l.is_sponsored,v=!!d.is_sponsored;return c===v?0:c?-1:1})}const Hh={mode:"light",primaryColor:"#3b82f6",secondaryColor:"#64748b",backgroundColor:"#ffffff",surfaceColor:"#f8fafc",borderColor:"#e2e8f0",textColor:"#1e293b",textSecondaryColor:"#64748b",borderRadius:"0.5rem",spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},shadows:{small:"0 1px 2px 0 rgb(0 0 0 / 0.05)",medium:"0 4px 6px -1px rgb(0 0 0 / 0.1)",large:"0 10px 15px -3px rgb(0 0 0 / 0.1)"}},Bh={sm:{width:"320px",height:"400px"},md:{width:"400px",height:"500px"},lg:{width:"480px",height:"600px"},xl:{width:"560px",height:"700px"}},Vh={"bottom-right":{bottom:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"top-left":{top:"20px",left:"20px"}},Uh=({theme:s,className:l,style:d,triggerLabel:c="Ask Ava",headerTitle:v="Ask Ava",headerLogoUrl:I,showHeader:D=!0,showHeaderTitle:q=!0,showSubtitle:_=!0,layout:y="floating",surface:B="page",adSlotBehavior:C="expand",showCompactSlotHeader:W=!0,showCompactWelcomeMessage:M=!0,showCompactSlotInput:A=!0,showCompactSlotDisclaimer:H=!0,panelWidth:U,panelHeight:ee,analyticsPageUrl:te,fontScale:re=1,position:ne="bottom-right",size:ie="md",defaultOpen:Q,open:O,onOpenChange:fe,autoOpen:le=!1,showWelcomeMessage:ge=!1,welcomeMessage:$e="Hi, I\u2019m Ava. I\u2019ll help you find the best options.",placeholder:oe="Ask me anything about products...",adsEnabled:ue=!0,suggestions:xe,maxSuggestions:Pe=6,suggestionStyle:E="carousel",suggestionTrigger:V="always",suggestionPlacement:se="below",sponsoredCreativePlacement:ke="none",onlyShowWhenSponsored:Ee=!1,variant:f="default",queryHandler:P,suggestionsLoader:G,disclaimerText:Y,poweredByLabel:_e="Powered by AdMesh",subtitle:ye="Publisher Assistant",relatedItemsHeading:ze="Related reading",onOpen:Le,onClose:Re})=>{const{sdk:De,sessionId:Be,theme:qt,apiKey:ae,userId:ce}=Zd(),{suggestions:be,isAnalyzingIntent:Ie,intentError:je,retryIntentAnalysis:J,activeDelegationSession:Oe,hasActiveDelegationSession:X,stopDelegationSession:Ve,refreshDelegationActivity:Ge}=Gd();Rh(),console.log("[AdMeshIntentAssistant] Context:",{sdk:De,sessionId:Be,hasContextTheme:!!qt});const K=s||qt||Hh,Je=K?.mode||"light",Fe=B==="ad-slot",un=(p=!1)=>Fe&&!(p&&C==="expand"),[it,Kt]=x.useState(Q||le),Mn=O!==void 0,Mo=Mn?O:it,[yn,Vr]=x.useState(""),[Xt,Rt]=x.useState(!1),[ot,mt]=x.useState([]),[qe,dn]=x.useState(!1),[Ur,pn]=x.useState(null),[me,mn]=x.useState(!1),[vn,ve]=x.useState(new Set),[tt,Jt]=x.useState(xe||be||[]),[Io,Yn]=x.useState(0),[cr,jo]=x.useState(0),[Qr,$i]=x.useState({}),No=x.useRef(null),er=x.useRef(!1),fn=x.useRef(null),ra=x.useRef(new Map),qr=x.useRef([]),In=x.useRef(null),Ct=x.useRef(null),Ht=x.useRef(null),pr=x.useRef(!1),oa=x.useRef(!1),Oi=x.useRef(null),aa=x.useRef(null),ia=x.useRef(null),[kr,qa]=x.useState(!1),[mr,Kr]=x.useState(!1),cn=x.useRef(null),Mt=x.useRef(null),Dt=!!(ae!=null&&ae.toLowerCase().startsWith("pub_")),Yt=X()&&Oe?.session_id===Be?Oe:null,sa=x.useRef(new Set),fr=x.useRef(new Set),_r=x.useRef(!1),Xr=Fe&&C==="expand"&&(me||qe),[Ro,Wi]=x.useState(!1);x.useEffect(()=>{if(typeof window>"u")return;const p=window.matchMedia("(max-width: 767px)"),N=()=>Wi(p.matches);return N(),p.addEventListener("change",N),()=>p.removeEventListener("change",N)},[]),x.useEffect(()=>{if(!Xr||typeof document>"u")return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[Xr]);const Ka=Fe&&C==="sticky"&&(me||ot.length>0||qe),xn=Ua(U)??"100%",tr=Ua(ee)??"100%",nr=Yd(U),hn=Yd(ee),Xa=Fe&&(hn??Number.POSITIVE_INFINITY)<=60,wn=Fe&&(nr??Number.POSITIVE_INFINITY)<=360&&(hn??Number.POSITIVE_INFINITY)<=120,Sr=x.useCallback(p=>N=>{N?ra.current.set(p,N):ra.current.delete(p)},[]),bt=x.useCallback(async(p,N={})=>{if(!(!De||!Be))try{await De.trackPublisherAssistantEvent({event_name:p,timestamp:new Date().toISOString(),session_id:Be,...rc(te),...N})}catch(R){console.warn(`[AdMeshIntentAssistant] Failed to track ${p}`,R)}},[te,De,Be]),hr=x.useCallback((p,N,R)=>{var L,Z;const pe=N?.recommendation_id;if(!pe)return;const Ye=`${p}:${pe}`;fr.current.has(Ye)||(fr.current.add(Ye),bt("recommendation_shown",{message_id:p,query:R,recommendation_id:pe,brand_name:(Z=(L=N.recommendation)==null?void 0:L.creative)==null?void 0:Z.brand_name,is_sponsored:!0}))},[bt]),Ga=x.useCallback((p,N,R,L,Z,pe)=>{const Ye=Array.isArray(pe)&&pe.length?pe.map((Te,We)=>{const kt=Po(Te.text||"");return kt?{id:`followup_llm_${We}_${kt.toLowerCase().replace(/[^a-z0-9]+/g,"_")}`,text:kt,type:Te.type||"information",is_sponsored:!1}:null}).filter(Te=>!!Te).slice(0,3):$h(p,N,R,L),zt=Wh(Z),Lt=zt?[zt,...Ye.slice(0,2)]:Ye.slice(0,3);Lt.length&&Jt(sl(Lt))},[]),en=x.useCallback((p,N)=>{const R=Po(p.query||p.label||"");if(!R||!N)return;const L={id:N,text:R,type:"action",is_sponsored:!0,recommendation:{recommendation_id:N,recommendation:{creative:{follow_up_suggestion:R}},tracking:{followup_engagement_url:p.engagement_url,followup_exposure_url:p.exposure_url}}};Jt(Z=>{const pe=Z.filter(Ye=>!Ye.is_sponsored).slice(0,3);return sl([L,...pe].slice(0,4))})},[]),la=x.useCallback(()=>{const p=In.current,N=Ct.current;if(!p||!N)return!1;const R=p.getBoundingClientRect(),L=N.getBoundingClientRect(),Z=Math.max(0,p.scrollTop+L.top-R.top);return p.scrollTop=Z,!0},[]);x.useLayoutEffect(()=>{var p;if(pr.current){la()&&(pr.current=!1);return}oa.current||(p=aa.current)==null||p.scrollIntoView({behavior:"smooth"})},[ot,la]),x.useLayoutEffect(()=>{if(!Fe||Xr)return;const p=Oi.current;if(!p)return;const N=p.closest(".admesh-publisher-assistant-reactMount"),R=tr;[p,N].forEach(Z=>{Z&&(Z.style.width=xn,Z.style.maxWidth=xn,Z.style.height=R,Z.style.maxHeight=R,Z.style.overflow="hidden",Z.style.boxSizing="border-box",Z.dataset.admeshAdSlotExpanded=Ka?"true":"false")});const L=N?.parentElement;L&&L!==document.body&&L!==document.documentElement&&(L.style.width=xn,L.style.maxWidth=xn,L.style.height=R,L.style.maxHeight=R,L.style.overflow="hidden",L.style.boxSizing="border-box")},[tr,xn,Xr,Fe,Ka]),x.useEffect(()=>{if(xe&&xe.length){Jt(xe);return}be&&be.length&&Jt(p=>Fh(p,be))},[xe,be]),x.useEffect(()=>{if(f!=="default"||!G)return;let p=!1;return G().then(N=>{!p&&Array.isArray(N)&&N.length&&Jt(N)}).catch(N=>{console.warn("[AdMeshIntentAssistant] Failed to load suggestions",N)}),()=>{p=!0}},[G,f]),x.useEffect(()=>{if(!qe){jo(0),No.current=null;return}No.current==null&&(No.current=typeof performance<"u"?performance.now():Date.now());const p=()=>{const R=No.current;if(R==null)return;const L=typeof performance<"u"?performance.now():Date.now();jo(Math.floor((L-R)/1e3))};p();const N=window.setInterval(p,1e3);return()=>window.clearInterval(N)},[qe]),x.useEffect(()=>{if(!qe||f!=="default"){Yn(0);return}const p=window.setInterval(()=>{Yn(N=>Math.min(N+1,7))},3e3);return()=>window.clearInterval(p)},[qe,f]),x.useEffect(()=>{_r.current||!De||!Be||(_r.current=!0,bt("assistant_loaded",{metadata:{layout:y,surface:B,variant:f,default_open:Q||le}}))},[le,Q,y,De,Be,B,bt,f]);const rr=x.useCallback(p=>{Mn?fe?.(p):Kt(p),p?(bt("assistant_opened",{metadata:{layout:y,surface:B,ad_slot_behavior:C,variant:f,expanded:me}}),Le?.()):Re?.()},[Mn,me,y,fe,Le,Re,B,bt,f]),ua=x.useCallback(()=>{rr(!0)},[rr]),Gr=x.useCallback(()=>{rr(!1)},[rr]),Hi=x.useCallback(()=>{mn(p=>!p)},[]),Za=x.useCallback(async(p,N,R,L,Z,pe,Ye)=>{var zt,Lt,Te;if(!De)return console.warn("[AdMeshIntentAssistant] SDK not available - using fallback response"),{text:"I'm a demo assistant. The SDK is not properly configured, but I can still help with suggestions! Try clicking on one of the suggested questions above."};try{Yt&&await Ge("turn_started",{source:"publisher_assistant",recommendation_id:Yt.recommendation_id}).catch(ht=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_started",ht)});const We=await fetch(`${De.getApiBaseUrl()}/api/chat/assistant`,{method:"POST",signal:pe,headers:{"Content-Type":"application/json",Accept:"text/plain","Cache-Control":"no-cache",Authorization:`Bearer ${ae}`},body:JSON.stringify({message:p,session_id:Be||"default-session",message_id:N,user_id:ce,context:{timestamp:new Date().toISOString(),source:"admesh-ui-sdk",page_context:rc(te),conversation_history:Ye,sponsored_recommendation:Z!=null&&Z.recommendation_id?{recommendation_id:Z.recommendation_id,brand_name:(Lt=(zt=Z.recommendation)==null?void 0:zt.creative)==null?void 0:Lt.brand_name}:void 0,active_delegation_session:Yt?{delegation_session_id:Yt.delegation_session_id,recommendation_id:Yt.recommendation_id,session_id:Yt.session_id,brand_name:Yt.brand_name,mcp_endpoint:Yt.mcp_endpoint,status:Yt.status}:void 0}})});if(!We.ok)throw new Error(`API request failed: ${We.status} ${We.statusText}`);const kt=(Te=We.body)==null?void 0:Te.getReader(),Gt=new TextDecoder;if(!kt)throw new Error("Response body is not readable");let Vt="",Ut,_n,Bn,Ce,He;return await(async()=>{try{for(;;){const{done:ht,value:st}=await kt.read();if(ht)break;const Sn=Gt.decode(st,{stream:!0}).split(`
1215
- `);for(const St of Sn)if(St.startsWith("data: ")){const nn=St.slice(6);if(nn.trim()==="[DONE]")return Yt&&Ge("turn_completed",{source:"publisher_assistant",recommendation_id:Yt.recommendation_id}).catch(gt=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_completed",gt)}),{text:Vt,source_links:Ut,related_items:_n,followup_suggestions:Bn,used_capability:Ce,response_time_ms:He};try{const gt=JSON.parse(nn);switch(gt.type){case"content":{const qi=gt.content||"";Vt+=qi,R?.(qi);break}case"final":{Vt=gt.reply||Vt,Ut=Array.isArray(gt.source_links)?gt.source_links:void 0,_n=Array.isArray(gt.related_items)?gt.related_items:void 0,Bn=Array.isArray(gt.followup_suggestions)?gt.followup_suggestions:void 0,Ce=typeof gt.used_capability=="string"?gt.used_capability:Ce,He=typeof gt.response_time_ms=="number"?gt.response_time_ms:He;break}case"followup_suggestions":{Bn=Array.isArray(gt.followup_suggestions)?gt.followup_suggestions:Bn;break}case"error":throw new Error(gt.message||"Unknown streaming error");case"session_start":L?.(),console.log("Session started:",gt.session_id);break}}catch{console.warn("Failed to parse streaming chunk:",nn);continue}}}}catch(ht){if(pe!=null&&pe.aborted)return{text:Vt,source_links:Ut,related_items:_n,followup_suggestions:Bn,used_capability:Ce,response_time_ms:He,error:"aborted"};throw console.error("Stream processing error:",ht),ht}finally{kt.releaseLock()}return{text:Vt,source_links:Ut,related_items:_n,followup_suggestions:Bn,used_capability:Ce,response_time_ms:He}})()}catch(We){return pe!=null&&pe.aborted?{text:"",error:"aborted"}:(console.error("Error calling assistant API:",We),{text:"I'm having trouble connecting to my services right now. Please try again in a moment.",error:We instanceof Error?We.message:"request_failed"})}},[De,Be,ae,ce,Yt,Ge]),gr=x.useCallback(()=>{const p=cn.current;if(!p||p.signal.aborted)return;p.abort(),dn(!1),fn.current=null,er.current=!1;const N=Mt.current;N&&mt(R=>R.map(L=>L.id===N&&!L.content.trim()?{...L,content:"Generation stopped."}:L))},[]),Cr=x.useCallback(async p=>{var N,R,L,Z,pe,Ye,zt,Lt;if(!p.trim()||qe)return;const Te=typeof performance<"u"?performance.now():Date.now(),We=p.trim(),kt=Date.now().toString(),Gt=new AbortController,Vt=fn.current,Ut=Vt?.recommendation||null,_n=ot.filter(Ce=>(Ce.role==="user"||Ce.role==="assistant")&&Ce.content.trim()).slice(-6).map(Ce=>({role:Ce.role,content:Ce.content.trim().slice(0,1200)}));cn.current=Gt,Mt.current=null,Ht.current=kt,pr.current=!0,oa.current=!0,fn.current=null,Jt(Ce=>Ce.some(He=>He.is_sponsored)?Ce.filter(He=>!He.is_sponsored):Ce),pn(null);const Bn={id:kt,role:"user",content:We,timestamp:new Date};if(bt("query_submitted",{message_id:kt,query:We}),mt(Ce=>[...Ce,Bn]),Vr(""),dn(!0),f==="default"&&P){try{const Ce=(Date.now()+1).toString(),He={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:p,initialRecommendation:null};er.current&&(ve(Sn=>new Set([...Sn,Ce])),er.current=!1),mt(Sn=>[...Sn,He]),Mt.current=Ce;const ht=await P(We,{sponsoredSuggestion:Vt});if(Gt.signal.aborted){fn.current=null;return}const st=ht.recommendation||Ut||null;console.log("[AdMeshIntentAssistant] Query handler completed:",{query:p,hasResponseRecommendation:!!ht.recommendation,hasSponsoredSuggestionRecommendation:!!Ut,finalRecommendationId:st?.recommendation_id}),mt(Sn=>Sn.map(St=>St.id===Ce?{...St,content:ht.answer,sourceLinks:ht.source_links,relatedItems:ht.related_items,initialRecommendation:st,responseTimeMs:(typeof performance<"u"?performance.now():Date.now())-Te}:St)),Ga(We,ht.answer,ht.source_links,ht.related_items,ht.recommendation||null,ht.followup_suggestions),bt("answer_completed",{message_id:Ce,query:We,recommendation_id:st?.recommendation_id,brand_name:(R=(N=st?.recommendation)==null?void 0:N.creative)==null?void 0:R.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:"completed",metadata:{variant:f,source:"query_handler"}}),fn.current=null}catch(Ce){console.error("Error sending message:",Ce);const He=Ce instanceof Error?Ce.message:"Unknown error occurred";pn(He);const ht={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};mt(st=>[...st,ht]),bt("answer_failed",{query:We,status:He,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,metadata:{variant:f,source:"query_handler"}}),fn.current=null}finally{cn.current===Gt&&(cn.current=null,Mt.current=null,dn(!1))}return}if(!De){setTimeout(()=>{if(Gt.signal.aborted){cn.current===Gt&&(cn.current=null,Mt.current=null);return}const Ce={id:(Date.now()+1).toString(),role:"assistant",content:"I'm a demo assistant. The SDK is not properly configured, but I can still help! Try clicking on the suggested questions above, or check your AdMesh API key configuration.",timestamp:new Date,recommendations:[],userQuery:p};mt(He=>[...He,Ce]),cn.current===Gt&&(cn.current=null,Mt.current=null,dn(!1))},1e3);return}try{const Ce=(Date.now()+1).toString(),He=Ut,ht={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:p,initialRecommendation:He};er.current&&(ve(St=>new Set([...St,Ce])),er.current=!1),mt(St=>[...St,ht]),Mt.current=Ce;const st=await Za(We,kt,St=>{mt(nn=>nn.map(gt=>gt.id===Ce?{...gt,content:gt.content+St}:gt))},()=>{dn(!0),Yn(0)},He,Gt.signal,_n);if(Gt.signal.aborted){st.text.trim()||mt(St=>St.map(nn=>nn.id===Ce&&!nn.content.trim()?{...nn,content:"Generation stopped."}:nn)),bt("answer_failed",{message_id:Ce,query:We,recommendation_id:He?.recommendation_id,brand_name:(Z=(L=He?.recommendation)==null?void 0:L.creative)==null?void 0:Z.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:"aborted",metadata:{variant:f,source:"api_chat_assistant"}}),fn.current=null;return}const Sn=typeof st.response_time_ms=="number"?st.response_time_ms:(typeof performance<"u"?performance.now():Date.now())-Te;mt(St=>St.map(nn=>nn.id===Ce?{...nn,content:st.text,sourceLinks:st.source_links,relatedItems:st.related_items,initialRecommendation:nn.initialRecommendation||He,responseTimeMs:Sn}:nn)),Ga(We,st.text,st.source_links,st.related_items,null,st.followup_suggestions),st.error?bt("answer_failed",{message_id:Ce,query:We,recommendation_id:He?.recommendation_id,brand_name:(Ye=(pe=He?.recommendation)==null?void 0:pe.creative)==null?void 0:Ye.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:st.error,metadata:{variant:f,source:"api_chat_assistant"}}):bt("answer_completed",{message_id:Ce,query:We,recommendation_id:He?.recommendation_id,brand_name:(Lt=(zt=He?.recommendation)==null?void 0:zt.creative)==null?void 0:Lt.brand_name,used_capability:st.used_capability,latency_ms:Sn,status:"completed",metadata:{variant:f,source:"api_chat_assistant",response_time_ms:Sn}}),fn.current=null}catch(Ce){console.error("Error sending message:",Ce);const He=Ce instanceof Error?Ce.message:"Unknown error occurred";pn(He);const ht={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};mt(st=>[...st,ht]),bt("answer_failed",{query:We,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:He,metadata:{variant:f,source:"api_chat_assistant"}}),fn.current=null}finally{cn.current===Gt&&(cn.current=null,Mt.current=null,dn(!1))}},[qe,Za,P,Ga,De,bt,f]),or=tt,Do=x.useMemo(()=>or.some(p=>p?.is_sponsored),[or]),Zr=x.useMemo(()=>or.filter(p=>p&&typeof p.id=="string"?Ee?Do:!0:!1),[Do,Ee,or]),Bt=x.useMemo(()=>sl(Zr),[Zr]),Jr=x.useMemo(()=>ke==="below-input-container"&&ue?Bt.find(p=>p.is_sponsored&&p.recommendation)??null:null,[ue,Bt,ke]),br=x.useCallback(async p=>{var N,R,L,Z,pe,Ye,zt;console.log("[AdMeshIntentAssistant] \u{1F5B1}\uFE0F Suggestion clicked:",{text:p.text,is_sponsored:p.is_sponsored,hasRecommendation:!!p.recommendation,recommendationId:((N=p.recommendation)==null?void 0:N.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((L=(R=p.recommendation)==null?void 0:R.tracking)!=null&&L.followup_engagement_url),sessionId:Be}),er.current=p.is_sponsored||!1,fn.current=p.is_sponsored?p:null;const Lt=Bt.findIndex(Te=>Te.id===p.id);bt("suggestion_clicked",{suggestion_id:p.id,suggestion_text:p.text,suggestion_type:p.type,suggestion_position:Lt>=0?Lt:void 0,is_sponsored:p.is_sponsored,recommendation_id:(Z=p.recommendation)==null?void 0:Z.recommendation_id,brand_name:(zt=(Ye=(pe=p.recommendation)==null?void 0:pe.recommendation)==null?void 0:Ye.creative)==null?void 0:zt.brand_name,query:p.text}),Cr(p.text),p.is_sponsored&&p.recommendation&&De?setTimeout(async()=>{var Te;try{const We=(Te=p.recommendation.tracking)==null?void 0:Te.followup_engagement_url,kt=p.recommendation.recommendation_id;console.log("[AdMeshIntentAssistant] \u{1F3AF} Preparing to fire sponsored suggestion engagement:",{followupEngagementUrl:We,recommendationId:kt,sessionId:Be}),We&&kt&&Be?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing sponsored suggestion engagement tracking"),await De.fireFollowupEngagement(We,kt,Be),console.log("[AdMeshIntentAssistant] \u2705 Engagement tracking fired successfully")):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing required data for engagement tracking:",{hasFollowupEngagementUrl:!!We,hasRecommendationId:!!kt,hasSessionId:!!Be})}catch(We){console.error("[AdMeshIntentAssistant] Error firing sponsored suggestion engagement:",We)}},0):console.log("[AdMeshIntentAssistant] \u2139\uFE0F Not a sponsored suggestion or missing data, skipping engagement tracking")},[Cr,Bt,De,Be,bt]),kn=Vh[ne],da=Bh[ie];x.useEffect(()=>{if(qr.current.forEach(p=>p()),qr.current=[],!(typeof window>"u"||typeof IntersectionObserver>"u"))return Bt.forEach((p,N)=>{const R=ra.current.get(p.id);if(!R)return;const L=`${Be||"anonymous"}:${p.id}:${p.is_sponsored?"s":"o"}`;if(sa.current.has(L))return;let Z=null,pe=null;const Ye=()=>{Z&&(clearTimeout(Z),Z=null),pe?.disconnect(),pe=null},zt=()=>{var Lt,Te,We,kt,Gt;if(sa.current.has(L)){Ye();return}if(sa.current.add(L),Ye(),bt("suggestion_exposure",{suggestion_id:p.id,suggestion_text:p.text,suggestion_type:p.type,suggestion_position:N,is_sponsored:p.is_sponsored,recommendation_id:(Lt=p.recommendation)==null?void 0:Lt.recommendation_id,brand_name:(kt=(We=(Te=p.recommendation)==null?void 0:Te.recommendation)==null?void 0:We.creative)==null?void 0:kt.brand_name}),De&&Be&&p.is_sponsored&&p.recommendation){const Vt=(Gt=p.recommendation.tracking)==null?void 0:Gt.followup_exposure_url,Ut=p.recommendation.recommendation_id;Vt&&Ut?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing viewable sponsored suggestion exposure:",{exposureUrl:Vt,recommendationId:Ut,suggestionText:p.text,sessionId:Be}),De.fireFollowupExposure(Vt,Ut,Be)):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing exposure URL or recommendation ID for sponsored suggestion:",{hasExposureUrl:!!Vt,hasRecommendationId:!!Ut,suggestionText:p.text})}};pe=new IntersectionObserver(Lt=>{const Te=Lt[0];if(Te){if(Te.intersectionRatio>=.5){Z||(Z=setTimeout(zt,1e3));return}Z&&(clearTimeout(Z),Z=null)}},{threshold:[0,.25,.5,.75,1],rootMargin:"0px"}),pe.observe(R),qr.current.push(Ye)}),()=>{qr.current.forEach(p=>p()),qr.current=[]}},[Bt,De,Be,bt,Xt]),console.log("[AdMeshIntentAssistant] \u{1F4E5} Received suggestions:",{totalSuggestions:or.length,safeSuggestions:Zr.length,isAnalyzingIntent:Ie,hasIntentError:!!je,onlyShowWhenSponsored:Ee,hasSponsoredSuggestions:Do,sponsoredCount:or.filter(p=>p?.is_sponsored).length,nonSponsoredCount:or.filter(p=>p&&!(p!=null&&p.is_sponsored)).length,modalShouldAppear:Ee?Do:!0,suggestions:or.map(p=>{var N,R,L;return{id:p?.id,text:p?.text,type:p?.type,is_sponsored:p?.is_sponsored,hasRecommendation:!!(p!=null&&p.recommendation),recommendationId:((N=p?.recommendation)==null?void 0:N.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((L=(R=p?.recommendation)==null?void 0:R.tracking)!=null&&L.followup_engagement_url)}}),renderedSuggestions:Bt.map(p=>{var N,R,L;return{id:p?.id,text:p?.text,type:p?.type,is_sponsored:p?.is_sponsored,hasRecommendation:!!(p!=null&&p.recommendation),recommendationId:((N=p?.recommendation)==null?void 0:N.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((L=(R=p?.recommendation)==null?void 0:R.tracking)!=null&&L.followup_engagement_url)}})});const et={base:`${16*re}px`,sm:`${14*re}px`,xs:`${12*re}px`},Er=Y||"AI-generated responses may contain errors. Please verify important information independently.",Yr=["Searching trusted sources...","Reviewing publisher coverage...","Checking relevant context...","Comparing supporting signals...","Identifying the strongest examples...","Organizing the most useful details...","Shaping the response for clarity...","Preparing the clearest answer...","Finishing the response..."],eo=p=>{const N=p?.accentColor||yt,R=p?.metaColor||Lo,L=p?.includeSteps??f==="default",Z=`${cr}s`,pe=L?`${Yr[Io]} (${Z})`:`Generating answer... ${Z}`;return m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:p!=null&&p.compact?"8px":"10px",color:R,fontSize:p!=null&&p.compact?et.xs:et.sm},children:[m.jsx("span",{style:{width:p!=null&&p.compact?8:9,height:p!=null&&p.compact?8:9,borderRadius:999,background:N,animation:"admeshPulse 1.4s ease-in-out infinite",boxShadow:`0 0 0 0 ${wt(Et,.28)}`,flexShrink:0}}),m.jsx("span",{children:pe})]})},ca=x.useCallback((p,N)=>{if(Qr[p.id])return;const R=N?"helpful":"not_helpful";$i(L=>({...L,[p.id]:R})),bt("answer_feedback",{message_id:p.id,query:p.userQuery,status:R,latency_ms:p.responseTimeMs,metadata:{helpful:N}})},[Qr,bt]);function pa(p,N){if(p.role!=="assistant"||!p.content.trim()||qe&&p.id===Mt.current)return null;const R=N?.accentColor||yt,L=N?.metaColor||Lo,Z=Qr[p.id],pe=typeof p.responseTimeMs=="number";return m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",marginTop:"10px",paddingTop:"10px",borderTop:`1px solid ${tn}`,flexWrap:"wrap"},children:[m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"8px",minWidth:0,flex:"1 1 auto",flexWrap:"wrap"},children:[m.jsx("span",{style:{fontSize:et.xs,color:L,whiteSpace:"nowrap"},children:Z?"Thanks for your feedback":"Is this helpful?"}),Z?m.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",background:wt(R,.12),color:R,flexShrink:0},children:Z==="helpful"?m.jsx(Dd,{size:14}):m.jsx(Rd,{size:14})}):m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px",flexShrink:0},children:[m.jsx("button",{type:"button","aria-label":"Mark answer as helpful",onClick:()=>ca(p,!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",border:`1px solid ${tn}`,background:It,color:L,cursor:"pointer"},children:m.jsx(Dd,{size:14})}),m.jsx("button",{type:"button","aria-label":"Mark answer as not helpful",onClick:()=>ca(p,!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",border:`1px solid ${tn}`,background:It,color:L,cursor:"pointer"},children:m.jsx(Rd,{size:14})})]})]}),pe?m.jsxs("span",{style:{fontSize:et.xs,color:L,whiteSpace:"nowrap",flex:"0 1 auto",marginLeft:"auto"},children:["Answer Completed in ",Lh(p.responseTimeMs)]}):null]})}const ar=x.useCallback(()=>{const p=ia.current;if(!p)return;const N=Math.max(0,p.scrollWidth-p.clientWidth);qa(p.scrollLeft>4),Kr(p.scrollLeft<N-4)},[]);x.useEffect(()=>(ar(),window.addEventListener("resize",ar),()=>window.removeEventListener("resize",ar)),[ar,Bt.length]);const On=x.useCallback(p=>{const N=ia.current;N&&N.scrollBy({left:p==="left"?-Math.max(160,Math.floor(N.clientWidth*.75)):Math.max(160,Math.floor(N.clientWidth*.75)),behavior:"smooth"})},[]),wt=(p,N)=>{if(!p||!p.startsWith("#"))return`rgba(15, 23, 42, ${N})`;const R=p.slice(1),L=R.length===3?R.split("").map(zt=>`${zt}${zt}`).join(""):R;if(L.length!==6)return p;const Z=parseInt(L.slice(0,2),16),pe=parseInt(L.slice(2,4),16),Ye=parseInt(L.slice(4,6),16);return`rgba(${Z}, ${pe}, ${Ye}, ${N})`},Et=K.primaryColor||"#3F037F",It=K.surfaceColor||"#ffffff",Ja=K.backgroundColor||"#eef2ff",tn=K.borderColor||"#e5e7eb",Tt=K.textColor||"#111827",Wn=K.textSecondaryColor||"#6b7280";wt(Et,.12);const To=wt(Et,.24);wt(Et,.38);const Bi=It,yt=Et,Hn=K.primaryTextColor||"#ffffff",Lo=Wn,to=ye||"Publisher Assistant",no=Ie&&Bt.length===0&&ot.length===0,Fo=It,$o=It,jn=tn,Oo=tn,Ya="0 16px 64px rgba(15, 23, 42, 0.14)",ei=Wn,ml=Wn,fl=yt,ma=Ja,hl="none",gl="rgba(15, 23, 42, 0.18)";function Vi(p){return Yt?m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:p==="default"?"10px 12px":"8px 10px",borderRadius:p==="default"?"14px":"12px",border:`1px solid ${To}`,background:wt("#ffffff",.9),marginBottom:"4px"},children:[m.jsxs("div",{style:{minWidth:0},children:[m.jsx("div",{style:{color:yt,fontSize:et.xs,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Agent Connected"}),m.jsxs("div",{style:{color:Tt,fontSize:et.sm,fontWeight:600,lineHeight:1.3},children:[Yt.brand_name," agent is active"]})]}),m.jsx("button",{type:"button",onClick:()=>{Ve("user_stopped",{source:"publisher_assistant"})},style:{border:`1px solid ${To}`,borderRadius:999,background:wt("#ffffff",.92),color:yt,padding:"7px 12px",fontSize:et.xs,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Stop"})]}):null}function Ui(p,N=Fe){const R=Ro&&!N,L=N||R?"9px":"11px";return m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:N||p==="default"?"2px":"8px",marginTop:N?"0":p==="default"?"4px":0,flexShrink:0,textAlign:"center",width:"100%"},children:m.jsx("div",{style:{color:ml,fontSize:L,lineHeight:R?1.3:1.45,maxWidth:"100%",textAlign:"center"},children:Er})})}function ti(p){const N=p==="publisher"?[180,220,196]:["100%","82%","68%"];return p==="publisher"?m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[m.jsx("div",{style:{width:28,height:28,borderRadius:"6px",background:wt(Tt,.06),flexShrink:0}}),m.jsx("div",{style:{display:"flex",gap:"10px",overflow:"hidden",flex:1},children:N.map((R,L)=>m.jsx("div",{style:{width:R,maxWidth:"100%",height:40,borderRadius:"6px",background:wt(Tt,.06),backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:"none",flexShrink:0}},`suggestion-skeleton-${L}`))}),m.jsx("div",{style:{width:28,height:28,borderRadius:"6px",background:wt(Tt,.06),flexShrink:0}})]}):m.jsx("div",{"aria-hidden":"true",style:{display:"flex",flexDirection:"column",gap:p==="publisher"?"10px":"12px"},children:N.map((R,L)=>m.jsx("div",{style:{width:R,maxWidth:"100%",height:p==="publisher"?40:52,borderRadius:999,background:`linear-gradient(90deg, ${wt(Et,.08)} 0%, ${wt(Et,.18)} 50%, ${wt(Et,.08)} 100%)`,backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:p==="publisher"?`0 8px 22px ${wt(Et,.08)}`:"none"}},`suggestion-skeleton-${L}`))})}function Qi(p=Fe){if(qe)return null;if(no)return ti("publisher");if(!Bt.length)return null;const N=p&&Xa,R=Bt.slice(0,Pe);return E==="stacked"?m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:p?"6px":"8px",flexShrink:0,overflowY:"auto",maxHeight:p?"240px":void 0,paddingRight:p?"2px":0,scrollbarWidth:"none",msOverflowStyle:"none"},children:R.map(L=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":L.is_sponsored?"true":void 0,ref:Sr(L.id),onClick:()=>{f==="default"&&(mn(!0),y==="floating"&&rr(!0)),br(L)},type:"button",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",width:"100%",minWidth:0,borderRadius:"8px",border:`1px solid ${L.is_sponsored?Et:tn}`,background:L.is_sponsored?Et:It,color:L.is_sponsored?Hn:Tt,padding:p?"8px 10px":"10px 14px",fontSize:p?"12px":"13px",fontWeight:500,lineHeight:1.25,textAlign:"left",boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{style:{minWidth:0},children:L.text}),ue&&L.is_sponsored&&m.jsx("span",{style:{flexShrink:0,borderRadius:"6px",background:wt("#ffffff",.18),padding:"2px 6px",fontSize:"10px",fontWeight:700},children:"Ad"})]},L.id))}):m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:N?"4px":wn?"5px":p?"6px":"10px",flexShrink:0},children:[!N&&m.jsx("button",{type:"button",onClick:()=>On("left"),disabled:!kr,"aria-label":"Scroll suggestions left",style:{width:wn?20:p?24:28,height:wn?20:p?24:28,borderRadius:"6px",border:`1px solid ${tn}`,background:It,color:"#6b7280",fontSize:wn?"13px":void 0,lineHeight:1,cursor:kr?"pointer":"default",opacity:kr?1:.55},children:"\u2039"}),m.jsx("div",{ref:ia,onScroll:ar,style:{display:"flex",gap:N?"4px":wn?"5px":p?"6px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",flex:1},children:R.map(L=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":L.is_sponsored?"true":void 0,ref:Sr(L.id),onClick:()=>{f==="default"&&(mn(!0),y==="floating"&&rr(!0)),br(L)},type:"button",style:{display:"inline-flex",alignItems:"center",gap:N?"4px":wn?"5px":"8px",whiteSpace:"nowrap",borderRadius:"6px",border:`1px solid ${L.is_sponsored?Et:tn}`,background:L.is_sponsored?Et:It,color:L.is_sponsored?Hn:Tt,padding:N?"4px 8px":wn?"5px 8px":p?"7px 10px":"8px 14px",fontSize:N?"10px":wn?"11px":p?"12px":"13px",fontWeight:500,lineHeight:N?1:wn?1.1:void 0,boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{children:L.text}),ue&&L.is_sponsored&&m.jsx("sup",{style:{fontSize:"10px",opacity:.9},children:"Ad"})]},L.id))}),!N&&m.jsx("button",{type:"button",onClick:()=>On("right"),disabled:!mr,"aria-label":"Scroll suggestions right",style:{width:wn?20:p?24:28,height:wn?20:p?24:28,borderRadius:"6px",border:`1px solid ${tn}`,background:It,color:"#6b7280",fontSize:wn?"13px":void 0,lineHeight:1,cursor:mr?"pointer":"default",opacity:mr?1:.55},children:"\u203A"})]})}function bl(p=Fe){if(p||!(Jr!=null&&Jr.recommendation))return null;const N=`publisher-sponsored-creative-${Jr.id}`;return m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"2px"},children:m.jsx(Va,{messageId:N,query:Jr.text,initialRecommendation:Jr.recommendation,onFollowupDetected:en,onRecommendationsShown:(R,L)=>{hr(R,L,Jr.text)},onError:R=>{console.error("[AdMeshIntentAssistant] Sponsored creative error:",R)}})})}function yl(p){var N,R;return(N=p.relatedItems)!=null&&N.length||!((R=p.sourceLinks)!=null&&R.length)?null:m.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"16px"},children:[m.jsx("div",{style:{width:"100%",fontSize:"11px",fontWeight:600,color:Wn},children:"Sources"}),p.sourceLinks.map(L=>m.jsxs("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{bt("source_link_clicked",{message_id:p.id,query:p.userQuery,metadata:{source_title:L.title,source_url:L.url}})},style:{color:yt,fontSize:et.xs,textDecoration:"none",borderBottom:`1px solid ${wt(Et,.18)}`},children:[L.title||L.url," ",m.jsx(qf,{size:12,style:{display:"inline",verticalAlign:"middle"},"aria-hidden":"true"})]},`${p.id}-${L.url}`))]})}function vl(p,N=Fe){var R;return(R=p.relatedItems)!=null&&R.length?m.jsxs("div",{style:{marginTop:"14px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:Wn,marginBottom:"8px"},children:ze}),m.jsx("div",{style:{display:"flex",gap:N?"8px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",padding:"2px 2px 6px",maxWidth:"100%",scrollSnapType:"x proximity"},children:p.relatedItems.slice(0,4).map(L=>m.jsxs("a",{className:"admesh-publisher-source",href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{bt("source_link_clicked",{message_id:p.id,query:p.userQuery,metadata:{source_title:L.title,source_url:L.url,source_publisher:L.publisher,source_type:"related_item"}})},style:{display:"flex",flexDirection:"column",gap:N?"6px":"10px",padding:N?"10px":"14px",borderRadius:"8px",textDecoration:"none",color:Tt,border:`1px solid ${tn}`,background:It,boxShadow:"none",flex:N?"0 0 min(220px, calc(100% - 8px))":"0 0 min(250px, calc(100% - 16px))",minWidth:0,maxWidth:N?"220px":"250px",flexShrink:0,scrollSnapAlign:"start",boxSizing:"border-box"},children:[m.jsx("div",{style:{fontSize:N?"12px":"14px",fontWeight:650,lineHeight:1.35,color:Tt,overflowWrap:"anywhere"},children:L.title||L.url}),L.publisher&&m.jsx("div",{style:{fontSize:N?"11px":"12px",color:Wn,lineHeight:1.4,overflowWrap:"anywhere"},children:L.publisher})]},`${p.id}-${L.url}`))})]}):null}function xl(p=Fe){const N=p?"13px":"15px";return m.jsxs("div",{ref:In,style:{flex:p?"1 1 0":1,minHeight:0,maxHeight:"100%",overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",scrollbarWidth:"thin",padding:p?"0 2px 4px":me?"16px 16px 8px":0},children:[ot.map(R=>{const L=R.role==="user"&&R.id===Ht.current;return m.jsx("div",{ref:L?Ct:void 0,style:{marginBottom:p?"16px":"28px",textAlign:R.role==="user"?"right":"left"},children:(()=>{const Z=!!R.content.trim()||!qe;return m.jsx(m.Fragment,{children:m.jsxs("div",{style:{display:R.role==="assistant"?"block":"inline-block",width:R.role==="assistant"?"100%":void 0,maxWidth:R.role==="assistant"?"100%":"76%",padding:R.role==="assistant"?"4px 6px 4px 2px":"10px 14px",borderRadius:R.role==="assistant"?0:"8px",background:R.role==="user"?wt(Tt,.05):"transparent",color:Tt,boxShadow:"none",border:"none",fontSize:R.role==="assistant"?N:p?"12px":"13px",lineHeight:R.role==="assistant"?1.62:1.4},children:[R.role==="assistant"?R.content.trim()?m.jsx(il,{content:R.content,theme:{...K,textColor:Tt},fontSize:N}):qe&&R.id===Mt.current?eo({includeSteps:!0}):null:m.jsx("p",{style:{margin:0,color:Tt},children:R.content}),R.role==="assistant"&&yl(R),R.role==="assistant"&&vl(R,p),R.role==="assistant"&&pa(R),R.role==="assistant"&&Z&&vn.has(R.id)&&R.initialRecommendation&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Va,{messageId:R.id,query:R.userQuery,initialRecommendation:R.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(pe,Ye)=>{hr(pe,Ye,R.userQuery)},onError:pe=>{console.error("[AdMeshIntentAssistant] Recommendation error:",pe)}})}),R.role==="assistant"&&Z&&!vn.has(R.id)&&(R.initialRecommendation||Dt)&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Va,{messageId:R.id,query:R.userQuery,initialRecommendation:R.initialRecommendation||void 0,onFollowupDetected:en,onRecommendationsShown:(pe,Ye)=>{hr(pe,Ye,R.userQuery)},onError:pe=>{console.error("[AdMeshIntentAssistant] Recommendation error:",pe)}})})]})})})()},R.id)}),Ur&&m.jsx("div",{role:"alert",style:{color:Tt,fontSize:et.sm,border:`1px solid ${tn}`,borderLeft:"3px solid #b45309",borderRadius:"6px",padding:"12px"},children:"Unable to complete the answer. Please try again."}),m.jsx("div",{ref:aa})]})}if(f==="default"){let p=function(L){const Z=ec(Ro);return el.createPortal(m.jsxs(m.Fragment,{children:[m.jsx("div",{style:R}),m.jsx("div",{style:Z.shell,children:L})]}),document.body)},N=function(L=!1){const Z=un(L),pe=L||Z&&me,Ye=!pe&&V==="input",zt=Z&&!pe&&Xa,Lt=pe&&!(Fe&&C==="expand"&&!L&&Xr),Te=pe?ec(Ro):null,We=!!(Te&&Ro&&!Z),kt=Z?xn:Te?Te.panelWidth:y==="inline"?"100%":"min(420px, calc(100vw - 32px))",Gt=Z?tr:Te?Te.panelHeight:"auto",Vt=Z?xn:Te?.panelMaxWidth??"100%",Ut=Z?tr:Te?.panelMaxHeight,_n=D&&!zt&&pe;return m.jsxs("div",{className:"admesh-publisher-panel","data-compact":Z?"true":"false",style:{"--publisher-accent":yt,color:Tt,width:kt,maxWidth:Vt,height:Gt,maxHeight:Ut,boxSizing:"border-box",display:"flex",flexDirection:"column",background:pe?Fo:Bi,borderRadius:!Z&&Te?Te.panelBorderRadius:"12px",padding:pe?0:Z?"6px":0,boxShadow:We?"none":pe?Ya:"none",border:We||Ye?"none":`1px solid ${Oo}`,overflow:"hidden",minHeight:Z?0:void 0},children:[m.jsx("style",{children:Td}),_n&&m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:Z?"8px 10px":"14px 20px",background:$o,color:Tt,borderBottom:`1px solid ${jn}`,flexShrink:0},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",minWidth:0},children:[m.jsx("div",{style:{width:Z?26:32,height:Z?26:32,flexShrink:0,borderRadius:"6px",background:wt(Tt,.04),display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,fontWeight:700,color:yt,overflow:"hidden"},children:I?m.jsx("img",{src:I,alt:`${v||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:It,padding:4}}):m.jsx(tl,{size:Z?14:17,strokeWidth:1.5,"aria-hidden":"true"})}),(q||_)&&m.jsxs("div",{style:{minWidth:0,overflowWrap:"anywhere"},children:[q&&m.jsx("div",{style:{fontSize:Z?"13px":"14px",fontWeight:600,lineHeight:1.1,letterSpacing:0},children:v}),_&&m.jsx("div",{style:{fontSize:Z?"10px":"12px",color:ei,marginTop:"2px"},children:to})]})]}),pe&&(!Z||L)&&m.jsx("button",{type:"button",onClick:()=>mn(!1),"aria-label":"Minimize assistant",style:{width:36,height:36,borderRadius:"8px",border:`1px solid ${jn}`,background:It,color:ei,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(jd,{size:16,strokeWidth:1.5,"aria-hidden":"true"})})]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:zt?"2px":Z?"6px":"16px",minHeight:0,flex:Z||pe?"1 1 0":void 0,overflow:Z||pe?"hidden":void 0,overscrollBehavior:"contain",padding:Ye?Z?"4px":"8px":Z?"8px":"20px",justifyContent:pe?void 0:"center",background:Fo},children:[Vi("default"),Lt&&xl(Z),!Ye&&m.jsxs(m.Fragment,{children:[Z&&!pe&&!zt&&m.jsx("div",{"aria-hidden":"true",style:{flex:"1 1 auto",minHeight:0}}),Z&&!pe&&ge&&M&&ot.length===0&&m.jsx("div",{style:{fontSize:15,fontWeight:600,textAlign:"center"},children:$e}),Qi(Z)]}),(Ye||!Z||pe||A)&&m.jsx(Jf,{value:yn,onChange:Vr,open:Ye&&Xt&&!me,onOpenChange:Ye?Rt:Dh,suggestions:Bt.slice(0,Pe),registerSuggestion:Sr,loading:qe,analyzing:no,compact:Z,expanded:pe,showLogo:!pe,suggestionPlacement:se,logoUrl:I,title:v,placeholder:oe,colors:{accent:yt,accentText:Hn,surface:ma,text:Tt,muted:Wn,border:tn},onStop:gr,onSend:()=>{fn.current=null,er.current=!1,mn(!0),y==="floating"&&rr(!0),Cr(yn)},onSuggestion:Bn=>{mn(!0),y==="floating"&&rr(!0),br(Bn)}}),pe&&Ui("default",Z),!pe&&V==="always"&&bl(Z)]})]})};const R={position:"fixed",inset:0,background:gl,backdropFilter:"blur(2px)",zIndex:2147483e3};return y==="inline"?Fe?m.jsxs("div",{ref:Oi,className:"admesh-component","data-admesh-theme":Je,"data-admesh-surface":"ad-slot","data-admesh-ad-slot-behavior":C,"data-admesh-ad-slot-expanded":Ka?"true":"false",style:{width:xn,height:tr,maxWidth:xn,maxHeight:tr,position:"relative",overflow:"hidden"},children:[N(!1),Xr&&typeof document<"u"&&p(N(!0))]}):m.jsxs("div",{className:"admesh-component","data-admesh-theme":Je,style:{width:"100%",position:"relative"},children:[N(!1),me&&typeof document<"u"&&p(N(!0))]}):Mo?m.jsxs("div",{className:"admesh-component","data-admesh-theme":Je,children:[!me&&m.jsx("div",{style:{position:"fixed",...kn,zIndex:2147483001},children:N(!1)}),me&&typeof document<"u"&&p(N(!0))]}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,children:m.jsxs("button",{type:"button",onClick:ua,style:{position:"fixed",...kn,zIndex:2147483e3,border:"none",borderRadius:"6px",background:K.primaryColor,color:Hn,display:"flex",alignItems:"center",gap:"8px",fontSize:"13px",fontWeight:600,padding:"12px 16px",boxShadow:"0 4px 16px rgba(15, 23, 42, 0.12)",cursor:"pointer"},children:[m.jsx(tl,{size:16,strokeWidth:1.5,"aria-hidden":"true"}),c]})})}return Bt.length===0&&!no?(console.log("[AdMeshIntentAssistant] No suggestions available - not rendering"),null):y==="inline"?m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,children:m.jsx("div",{className:`overflow-hidden rounded-[2rem] ${l||""}`,style:{width:Ua(U)??"100%",backgroundColor:"#eef2ff",fontSize:et.base,...d},children:m.jsxs("div",{className:"space-y-4 rounded-[1.75rem] p-4",style:{backgroundColor:"rgba(255, 255, 255, 0.35)"},children:[no?ti("legacy"):Bt.length>0&&m.jsx("div",{className:"flex flex-col gap-3",children:Bt.slice(0,Pe).map((p,N)=>m.jsxs("button",{ref:Sr(p.id),onClick:()=>br(p),className:"rounded-full px-5 py-4 text-left shadow-sm transition-transform duration-200 hover:scale-[1.01] active:scale-[0.99]",style:{width:N===0?"100%":N===1?"82%":"68%",backgroundColor:K.surfaceColor||"#ffffff",color:K.textColor||"#1e293b",border:`1px solid ${K.borderColor||"#e2e8f0"}`,fontSize:et.sm},children:[m.jsx("span",{className:"leading-tight",children:p.text}),ue&&p.is_sponsored&&m.jsx("sup",{className:"ml-1 rounded-full px-1.5 py-0.5",style:{backgroundColor:K.backgroundColor||"#ffffff",color:K.textSecondaryColor||"#64748b",fontSize:"9px",lineHeight:1},children:"Ad"})]},p.id))}),ot.length>0&&m.jsxs("div",{ref:In,className:"max-h-[280px] space-y-3 overflow-y-auto rounded-[1.5rem] bg-white/80 p-4",style:{color:K.textColor,overscrollBehavior:"contain",WebkitOverflowScrolling:"touch"},children:[ot.map(p=>{const N=p.role==="user"&&p.id===Ht.current;return m.jsx("div",{ref:N?Ct:void 0,className:p.role==="user"?"text-right":"text-left",children:m.jsx("div",{className:"inline-block max-w-[85%] rounded-2xl px-4 py-3",style:{backgroundColor:p.role==="user"?K.primaryColor:"#ffffff",color:p.role==="user"?K.primaryTextColor||"#ffffff":K.textColor,fontSize:et.sm},children:p.role==="assistant"?p.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx(il,{content:p.content,theme:K,fontSize:et.sm}),pa(p,{accentColor:K.primaryColor,metaColor:K.textSecondaryColor})]}):qe&&p.id===Mt.current?eo({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,lineHeight:"1.4"},children:p.content})})},p.id)}),qe&&!ot.some(p=>p.role==="assistant"&&p.id===Mt.current&&!p.content.trim())&&m.jsx("div",{className:"text-sm",style:{color:K.textSecondaryColor},children:eo({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1})}),Ur&&m.jsx("div",{className:"text-sm",style:{color:K.textSecondaryColor},children:"Connection issue. Please try again."}),m.jsx("div",{ref:aa})]}),m.jsx("div",{className:"rounded-[1.5rem] bg-white p-3 shadow-sm",children:m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("input",{type:"text",value:yn,onChange:p=>Vr(p.target.value),onKeyPress:p=>{if(p.key==="Enter"){if(qe){p.preventDefault();return}Cr(yn)}},placeholder:oe,className:"min-w-0 flex-1 rounded-full px-4 py-3 focus:outline-none",style:{backgroundColor:K.backgroundColor||"#ffffff",color:K.textColor,fontSize:et.sm}}),m.jsx("button",{onClick:()=>{if(qe){gr();return}Cr(yn)},disabled:!qe&&!yn.trim(),className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:qe?"#dc2626":K.primaryColor,color:"#ffffff"},children:qe?m.jsx(nl,{size:18}):m.jsx(Nd,{size:18})})]})}),m.jsxs("div",{className:"space-y-2 text-center",children:[m.jsxs("p",{style:{color:K.textSecondaryColor,fontSize:et.xs,fontWeight:600},children:["Powered by"," ",m.jsx("a",{href:"https://useadmesh.com",target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none",fontWeight:700},children:"AdMesh"})]}),m.jsx("p",{style:{color:K.textSecondaryColor,fontSize:et.xs,lineHeight:1.5},children:Er})]})]})})}):Mo?m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,children:m.jsxs("div",{className:`flex flex-col overflow-hidden ${l||""}`,style:{position:"fixed",display:"flex",flexDirection:"column",...me?{top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(1040px, calc(100vw - 40px))",height:"min(84vh, 820px)",maxWidth:"1040px",maxHeight:"820px"}:{...kn,width:Ua(U)??da.width,height:Ua(ee)??da.height},backgroundColor:me?Fo:K.backgroundColor,zIndex:9999,fontSize:et.base,borderRadius:me?"20px":"16px",border:me?`1px solid ${Oo}`:"1px solid transparent",boxShadow:me?Ya:"0 20px 40px rgba(15, 23, 42, 0.12)",...d},children:[D&&m.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between p-4 border-b",style:{position:"sticky",top:0,zIndex:10,borderColor:me?jn:"transparent",background:me?$o:K.backgroundColor,padding:me?"18px 20px":"16px"},children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("div",{style:{width:me?40:32,height:me?40:32,borderRadius:me?"14px":"10px",background:wt(Et,.08),color:yt,display:"flex",alignItems:"center",justifyContent:"center",fontSize:me?"15px":"13px",fontWeight:700,flexShrink:0,overflow:"hidden"},children:I?m.jsx("img",{src:I,alt:`${v||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:"#ffffff",padding:4}}):(v||"AA").slice(0,2).toUpperCase()}),(q||_&&me)&&m.jsxs("div",{children:[q&&m.jsx("div",{className:"font-medium",style:{color:K.textColor,fontSize:me?"20px":et.base,fontWeight:700,letterSpacing:me?"-0.02em":0},children:v}),_&&me&&m.jsx("div",{style:{color:ei,fontSize:"12px",marginTop:"2px"},children:to})]})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[!Fe&&m.jsx("button",{onClick:Hi,className:"transition-colors",title:me?"Minimize":"Expand",style:{width:me?36:28,height:me?36:28,borderRadius:me?"12px":"10px",border:`1px solid ${me?jn:"transparent"}`,background:me?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:me?m.jsx(jd,{size:16,style:{color:K.textSecondaryColor}}):m.jsx(Gf,{size:16,style:{color:K.textSecondaryColor}})}),m.jsx("button",{onClick:Gr,className:"transition-colors",style:{width:me?36:28,height:me?36:28,borderRadius:me?"12px":"10px",border:`1px solid ${me?jn:"transparent"}`,background:me?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(nl,{size:16,style:{color:K.textSecondaryColor}})})]})]}),m.jsxs("div",{ref:In,className:"flex-1 min-h-0 overflow-y-auto p-4",style:{flex:"1 1 0%",minHeight:0,overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",padding:me?"20px":"16px"},children:[Vi("legacy"),ge&&ot.length===0&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg",children:m.jsx("p",{style:{color:K.textColor,margin:0,fontSize:et.sm},children:$e})})}),ot.map(p=>{const N=p.role==="user"&&p.id===Ht.current;return m.jsxs("div",{ref:N?Ct:void 0,className:"mb-3",children:[m.jsx("div",{className:p.role==="user"?"inline-block max-w-[85%] ml-auto":"max-w-[92%]",style:{backgroundColor:p.role==="user"?fl:"transparent",color:p.role==="user"?K.primaryTextColor||"#ffffff":K.textColor,border:"none",borderRadius:p.role==="user"?me?"14px":"12px":0,padding:p.role==="user"?me?"12px 14px":void 0:"2px 6px 2px 2px",boxShadow:"none"},children:p.role==="assistant"?p.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{fontSize:`calc(${et.sm} * 1.3)`,lineHeight:1.65},children:m.jsx(il,{content:p.content,theme:K,fontSize:`calc(${et.sm} * 1.3)`})}),pa(p,{accentColor:K.primaryColor,metaColor:K.textSecondaryColor})]}):qe&&p.id===Mt.current?eo({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,fontSize:et.sm,lineHeight:"1.4"},children:p.content})}),p.role==="assistant"&&!vn.has(p.id)&&m.jsx(Va,{messageId:p.id,query:p.userQuery,onFollowupDetected:en,onRecommendationsShown:(R,L)=>{hr(R,L,p.userQuery)},onError:R=>{console.error("[AdMeshIntentAssistant] Recommendations error:",R)}}),p.role==="assistant"&&vn.has(p.id)&&p.initialRecommendation&&!qe&&m.jsxs("div",{className:"mb-4",children:[m.jsx("div",{className:"text-xs text-gray-500 mb-2 font-semibold",children:"Sponsored Recommendation"}),m.jsx(Va,{messageId:p.id,query:p.userQuery,initialRecommendation:p.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(R,L)=>{hr(R,L,p.userQuery)},onError:R=>{console.error("[AdMeshIntentAssistant] Recommendations error:",R)}})]})]},p.id)}),qe&&!ot.some(p=>p.role==="assistant"&&p.id===Mt.current&&!p.content.trim())&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg",style:{backgroundColor:"transparent"},children:eo({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1})})}),Ur&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg border",style:{backgroundColor:"transparent",borderColor:"transparent",color:K.textSecondaryColor},children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{style:{fontSize:et.xs},children:"\u26A0\uFE0F"}),m.jsx("span",{style:{fontSize:et.sm},children:"Connection issue. Please try again."})]})})}),m.jsx("div",{ref:aa})]}),ot.length===0&&no&&m.jsx("div",{className:"px-4 pb-2",children:ti("legacy")}),Bt.length>0&&ot.length===0&&!no&&m.jsx("div",{className:"px-4 pb-2",children:m.jsx("div",{className:"flex flex-col gap-2",children:Bt.slice(0,Pe).map(p=>m.jsxs("button",{ref:Sr(p.id),onClick:()=>br(p),className:"relative flex w-full items-center text-left transition-all duration-200",style:{backgroundColor:K.surfaceColor||"#f8fafc",color:K.textColor||"#1e293b",border:`1px solid ${K.borderColor||"#e2e8f0"}`,fontSize:et.sm,padding:"10px 12px",borderRadius:"999px",fontWeight:500},children:[m.jsx("span",{className:"leading-tight",children:p.text}),ue&&p.is_sponsored&&m.jsx("sup",{className:"absolute right-1 top-1 rounded-full px-1.5 py-0.5 tracking-wide",style:{fontSize:"9px",lineHeight:1,backgroundColor:K.backgroundColor||"#ffffff",color:K.textSecondaryColor||"#64748b"},children:"Ad"})]},p.id))})}),je&&!Ie&&Zr.length===0&&m.jsx("div",{className:"px-4 pb-2",children:m.jsx("div",{className:"flex flex-col gap-2",children:m.jsxs("div",{className:"p-3 rounded-lg border",style:{backgroundColor:K.surfaceColor,borderColor:K.borderColor,color:K.textSecondaryColor},children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsx("span",{style:{fontSize:et.sm},children:"Intent analysis failed"}),m.jsx("button",{onClick:J,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:K.primaryColor,color:"#ffffff"},children:"Retry"})]}),m.jsx("span",{style:{fontSize:et.xs},children:je})]})})}),m.jsxs("div",{className:"p-3 border-t",style:{borderColor:me?jn:"transparent",padding:me?"18px 20px":void 0,background:me?$o:void 0},children:[m.jsxs("div",{className:"flex gap-2",style:{alignItems:"center",border:`1px solid ${jn}`,borderRadius:me?"16px":"12px",background:ma,boxShadow:me?hl:"none",padding:me?"8px 8px 8px 14px":void 0},children:[m.jsx("input",{type:"text",value:yn,onChange:p=>Vr(p.target.value),onKeyPress:p=>{if(p.key==="Enter"){if(qe){p.preventDefault();return}Cr(yn)}},placeholder:oe,className:"flex-1 px-3 py-2 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"transparent",borderColor:"transparent",color:K.textColor,fontSize:me?"15px":et.sm,"--tw-ring-color":K.primaryColor}}),m.jsx("button",{onClick:()=>{if(qe){gr();return}Cr(yn)},disabled:!qe&&!yn.trim(),className:"transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:qe?"#dc2626":K.primaryColor,color:"#ffffff",borderRadius:me?"12px":"10px",width:me?"46px":void 0,height:me?"46px":void 0,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:me?`0 10px 20px ${wt(Et,.18)}`:"none"},children:qe?m.jsx(nl,{size:14}):m.jsx(Nd,{size:14})})]}),Ui("legacy")]})]})}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,children:m.jsx("button",{onClick:ua,className:"flex items-center gap-2 px-4 py-3 rounded-full shadow-lg transition-all duration-200 hover:scale-105 active:scale-95",style:{position:"fixed",...kn,backgroundColor:K.primaryColor,color:"#ffffff",zIndex:9999,fontSize:et.base,...d},children:m.jsx("span",{className:"font-medium",children:c})})})};typeof globalThis<"u"&&typeof globalThis.process>"u"&&(globalThis.process={env:{NODE_ENV:"production",ADMESH_ENV:"production"}});const ll={"mobile-leaderboard":{width:320,height:100},"medium-rectangle":{width:300,height:250},leaderboard:{width:728,height:90},"half-page":{width:300,height:600},"large-rectangle":{width:336,height:280},skyscraper:{width:120,height:600},billboard:{width:970,height:250}},Qh={"mobile-leaderboard":"carousel","medium-rectangle":"carousel",leaderboard:"carousel","large-rectangle":"carousel",billboard:"carousel","half-page":"stacked",skyscraper:"stacked"},qh={"mobile-leaderboard":!1,"medium-rectangle":!1,leaderboard:!1},Kh={"mobile-leaderboard":!1,leaderboard:!1},Xh={"mobile-leaderboard":!1,leaderboard:!1},Gh={"mobile-leaderboard":!1,leaderboard:!1},oc={"mobile-leaderboard":"expand",leaderboard:"expand"},ul={"half-page":"medium-rectangle","large-rectangle":"medium-rectangle",skyscraper:"medium-rectangle",billboard:"medium-rectangle",leaderboard:"mobile-leaderboard"},Zh=60*1e3,ac="admesh-publisher-assistant-embed-styles",ic=window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com";function Jh(){if(document.getElementById(ac))return;const s=document.createElement("style");s.id=ac,s.textContent=`
1221
+ `)},W=(I=>{const A=C(I).split(`
1222
+ `),H=[];let U=0;for(;U<A.length;){const ee=A[U],te=A[U+1]||"";if(ee.includes("|")&&M(te)){H.length>0&&H[H.length-1].trim()&&H.push("");const{heading:re,headerLine:ne}=N(ee);for(re&&H.push(re),H.push(ne,q(ne,te)),U+=2;U<A.length&&A[U].includes("|")&&A[U].trim();)H.push(A[U]),U+=1;U<A.length&&A[U].trim()&&H.push("");continue}H.push(ee),U+=1}return H.join(`
1223
+ `)})(s).split(/\n\s*\n/).map(I=>I.trim()).filter(Boolean);return m.jsx("div",{style:{margin:0,color:l.textColor,fontSize:d},children:W.map((I,A)=>{const H=I.split(`
1224
+ `).map(ne=>ne.trim()).filter(Boolean),U=H.every(ne=>/^[-*]\s+/.test(ne)),ee=H.every(ne=>/^\d+\.\s+/.test(ne)),te=H.length===1&&/^#{1,3}\s+/.test(H[0]),re=y(H);if(te){const ne=H[0].replace(/^#{1,3}\s+/,"");return m.jsx("h3",{style:{marginTop:A===0?0:"1rem",marginBottom:"0.75rem",fontWeight:"600",fontSize:"1.05em",color:l.textColor},children:c(ne)},A)}if(re){const{heading:ne,lines:ie}=_(H),Q=v(ie[0]),O=ie.slice(2).map(v).filter(fe=>fe.length===Q.length);return m.jsxs("div",{style:{width:"100%",overflowX:"auto",marginBottom:"1rem"},children:[ne?m.jsx("p",{style:{marginTop:A===0?0:"1rem",marginBottom:"0.75rem",fontWeight:600,color:l.textColor,fontSize:d},children:c(ne)}):null,m.jsx("div",{style:{border:`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.28)"}`,borderRadius:8,overflowX:"auto"},children:m.jsxs("table",{style:{width:"100%",minWidth:Q.length>3?520:void 0,borderCollapse:"collapse",color:l.textColor,fontSize:d,lineHeight:1.45},children:[m.jsx("thead",{children:m.jsx("tr",{children:Q.map((fe,le)=>m.jsx("th",{style:{textAlign:"left",padding:"9px 10px",fontWeight:600,background:l.surfaceColor||"rgba(148, 163, 184, 0.12)",borderBottom:`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.28)"}`,whiteSpace:"normal"},children:c(fe)},le))})}),m.jsx("tbody",{children:O.map((fe,le)=>m.jsx("tr",{children:fe.map((ge,$e)=>m.jsx("td",{style:{padding:"9px 10px",verticalAlign:"top",borderBottom:le===O.length-1?"none":`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.18)"}`,whiteSpace:"normal"},children:c(ge)},$e))},le))})]})})]},A)}if(U||ee){const ne=ee?"ol":"ul";return m.jsx(ne,{style:{marginBottom:"1rem",paddingLeft:"1.25rem",color:l.textColor,fontSize:d},children:H.map((ie,Q)=>m.jsx("li",{style:{marginBottom:"0.45rem"},children:c(ie.replace(/^([-*]|\d+\.)\s+/,""))},Q))},A)}return m.jsx("p",{style:{marginBottom:"1rem",lineHeight:"1.6",color:l.textColor,fontSize:d,whiteSpace:"pre-wrap"},children:H.map((ne,ie)=>m.jsxs(x.Fragment,{children:[ie>0&&m.jsx("br",{}),c(ne)]},ie))},A)})})};function Ua(s){return s===void 0?void 0:typeof s=="number"?`${s}px`:s}function Yd(s){if(typeof s=="number")return s;if(typeof s!="string")return;const l=Number(s.trim().replace(/px$/i,""));return Number.isFinite(l)&&l>0?l:void 0}function Po(s){return s.replace(/\s+/g," ").trim()}function Oh(s,l){const d=s.filter(N=>!(N!=null&&N.is_sponsored)).slice(0,3),c=l.filter(N=>!(N!=null&&N.is_sponsored)).slice(0,3),v=l.find(N=>N?.is_sponsored);if(!v)return c.length?c:d;const M=c.length?c:d;return[v,...M].slice(0,4)}function Wh(s,l,d,c){const v=new Set,M=[],N=(C,W="information")=>{const I=Po(C);if(!I)return;const A=I.toLowerCase();v.has(A)||(v.add(A),M.push({id:`followup_${M.length}_${A.replace(/[^a-z0-9]+/g,"_")}`,text:I,type:W,is_sponsored:!1}))},q=new Set,_=C=>{const W=Po(C||"");if(!W)return;const I=W.replace(/^(how|why|what|when|where|which|who)\s+/i,"").replace(/\?+$/g,"").trim();I&&q.add(I)};(c||[]).forEach(C=>_(C?.title)),(d||[]).forEach(C=>_(C?.title)),l.split(/\n+/).map(C=>Po(C.replace(/^[-*]\s+/,""))).filter(Boolean).filter(C=>C.length>=24&&C.length<=90).forEach(C=>{q.size>=6||_(C)});const y=Po(s.replace(/[?.!]+$/g,"")),B=Array.from(q).slice(0,3);return[B[0]?`Tell me more about ${B[0]}`:"",B[1]?`Show me examples related to ${B[1]}`:"",B[2]?`Compare the main options for ${B[2]}`:"","Break this down more simply",`What should I look at next about ${y}`,"Give me the practical takeaway here"].forEach((C,W)=>{M.length>=3||N(C,W===0?"comparison":"information")}),M.slice(0,3)}function Hh(){if(typeof window>"u")return"unknown";const s=window.innerWidth;return s<768?"mobile":s<1024?"tablet":"desktop"}function ec(s){return s?{shell:{position:"fixed",left:0,right:0,bottom:0,width:"100%",maxWidth:"100%",height:"calc(100dvh - env(safe-area-inset-bottom, 0px))",maxHeight:"calc(100dvh - env(safe-area-inset-bottom, 0px))",padding:0,margin:0,zIndex:2147483001,boxSizing:"border-box"},panelWidth:"100%",panelMaxWidth:"100%",panelHeight:"100%",panelMaxHeight:"100%",panelBorderRadius:"0"}:{shell:{position:"fixed",left:"50%",bottom:"12px",transform:"translateX(-50%)",width:"min(960px, calc(100vw - 24px))",maxWidth:"100%",maxHeight:"calc(100vh - 24px)",zIndex:2147483001,boxSizing:"border-box"},panelWidth:"min(960px, calc(100vw - 24px))",panelMaxWidth:"100%",panelHeight:"min(78vh, 760px)",panelMaxHeight:void 0,panelBorderRadius:"12px"}}function tc(s){const l=s?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return!!(d.protocol&&d.hostname)}catch{return!1}}function nc(){var s;try{const l=(s=window.location.href)==null?void 0:s.trim();if(tc(l))return l}catch{return}}function rc(s){if(typeof window>"u")return{page_url:void 0,page_path:void 0,article_slug:void 0,page_title:void 0,referrer:void 0,device_type:"unknown"};const l=nc()||(tc(s)?s.trim():void 0);let d=l?window.location.pathname||"/":void 0;try{d=l?new URL(l).pathname||"/":void 0}catch{d=nc()?window.location.pathname||"/":void 0}const c=(d||"").split("/").filter(Boolean);return{page_url:l,page_path:d,article_slug:c[c.length-1],page_title:document.title||void 0,referrer:document.referrer||void 0,device_type:Hh()}}function Bh(s){var l,d;const c=(d=(l=s?.recommendation)==null?void 0:l.creative)==null?void 0:d.follow_up_suggestion,v=s?.recommendation_id;return!c||!v?null:{id:v,text:Po(c),type:"action",is_sponsored:!0,recommendation:s,metadata:{source:"assistant_query_recommendation",recommendation_id:v}}}function sl(s){return[...s].sort((l,d)=>{const c=!!l.is_sponsored,v=!!d.is_sponsored;return c===v?0:c?-1:1})}const Vh={mode:"light",primaryColor:"#3b82f6",secondaryColor:"#64748b",backgroundColor:"#ffffff",surfaceColor:"#f8fafc",borderColor:"#e2e8f0",textColor:"#1e293b",textSecondaryColor:"#64748b",borderRadius:"0.5rem",spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},shadows:{small:"0 1px 2px 0 rgb(0 0 0 / 0.05)",medium:"0 4px 6px -1px rgb(0 0 0 / 0.1)",large:"0 10px 15px -3px rgb(0 0 0 / 0.1)"}},Uh={sm:{width:"320px",height:"400px"},md:{width:"400px",height:"500px"},lg:{width:"480px",height:"600px"},xl:{width:"560px",height:"700px"}},Qh={"bottom-right":{bottom:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"top-left":{top:"20px",left:"20px"}},qh=({theme:s,className:l,style:d,triggerLabel:c="Ask Ava",headerTitle:v="Ask Ava",headerLogoUrl:M,showHeader:N=!0,showHeaderTitle:q=!0,showSubtitle:_=!0,layout:y="floating",surface:B="page",adSlotBehavior:C="expand",showCompactSlotHeader:W=!0,showCompactWelcomeMessage:I=!0,showCompactSlotInput:A=!0,showCompactSlotDisclaimer:H=!0,panelWidth:U,panelHeight:ee,analyticsPageUrl:te,fontScale:re=1,position:ne="bottom-right",size:ie="md",defaultOpen:Q,open:O,onOpenChange:fe,autoOpen:le=!1,showWelcomeMessage:ge=!1,welcomeMessage:$e="Hi, I\u2019m Ava. I\u2019ll help you find the best options.",placeholder:oe="Ask me anything about products...",adsEnabled:ue=!0,suggestions:xe,maxSuggestions:Pe=6,suggestionStyle:E="carousel",suggestionTrigger:V="always",suggestionPlacement:se="below",sponsoredCreativePlacement:ke="none",onlyShowWhenSponsored:Ee=!1,variant:f="default",queryHandler:P,suggestionsLoader:G,disclaimerText:Y,poweredByLabel:_e="Powered by AdMesh",subtitle:ye="Publisher Assistant",relatedItemsHeading:ze="Related reading",onOpen:Le,onClose:De})=>{const{sdk:Ne,sessionId:Be,theme:qt,apiKey:ae,userId:ce}=Zd(),{suggestions:be,isAnalyzingIntent:Me,intentError:je,retryIntentAnalysis:J,activeDelegationSession:Oe,hasActiveDelegationSession:X,stopDelegationSession:Ve,refreshDelegationActivity:Ge}=Gd();Th(),console.log("[AdMeshIntentAssistant] Context:",{sdk:Ne,sessionId:Be,hasContextTheme:!!qt});const K=s||qt||Vh,Je=K?.mode||"light",Fe=B==="ad-slot",un=(p=!1)=>Fe&&!(p&&C==="expand"),[it,Kt]=x.useState(Q||le),Mn=O!==void 0,Io=Mn?O:it,[vn,Vr]=x.useState(""),[Xt,Dt]=x.useState(!1),[ot,mt]=x.useState([]),[qe,dn]=x.useState(!1),[Ur,mn]=x.useState(null),[me,fn]=x.useState(!1),[xn,ve]=x.useState(new Set),[tt,Jt]=x.useState(xe||be||[]),[Mo,Yn]=x.useState(0),[cr,jo]=x.useState(0),[Qr,$i]=x.useState({}),Ro=x.useRef(null),er=x.useRef(!1),hn=x.useRef(null),ra=x.useRef(new Map),qr=x.useRef([]),jn=x.useRef(null),Ct=x.useRef(null),Ht=x.useRef(null),pr=x.useRef(!1),oa=x.useRef(!1),Oi=x.useRef(null),aa=x.useRef(null),ia=x.useRef(null),[kr,qa]=x.useState(!1),[mr,Kr]=x.useState(!1),cn=x.useRef(null),It=x.useRef(null),Nt=!!(ae!=null&&ae.toLowerCase().startsWith("pub_")),Yt=X()&&Oe?.session_id===Be?Oe:null,sa=x.useRef(new Set),fr=x.useRef(new Set),_r=x.useRef(!1),Xr=Fe&&C==="expand"&&(me||qe),[Do,Wi]=x.useState(!1);x.useEffect(()=>{if(typeof window>"u")return;const p=window.matchMedia("(max-width: 767px)"),R=()=>Wi(p.matches);return R(),p.addEventListener("change",R),()=>p.removeEventListener("change",R)},[]),x.useEffect(()=>{if(!Xr||typeof document>"u")return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[Xr]);const Ka=Fe&&C==="sticky"&&(me||ot.length>0||qe),wn=Ua(U)??"100%",tr=Ua(ee)??"100%",nr=Yd(U),gn=Yd(ee),Xa=Fe&&(gn??Number.POSITIVE_INFINITY)<=60,pn=Fe&&(nr??Number.POSITIVE_INFINITY)<=360&&(gn??Number.POSITIVE_INFINITY)<=120,Sr=x.useCallback(p=>R=>{R?ra.current.set(p,R):ra.current.delete(p)},[]),bt=x.useCallback(async(p,R={})=>{if(!(!Ne||!Be))try{await Ne.trackPublisherAssistantEvent({event_name:p,timestamp:new Date().toISOString(),session_id:Be,...rc(te),...R})}catch(D){console.warn(`[AdMeshIntentAssistant] Failed to track ${p}`,D)}},[te,Ne,Be]),hr=x.useCallback((p,R,D)=>{var L,Z;const pe=R?.recommendation_id;if(!pe)return;const Ye=`${p}:${pe}`;fr.current.has(Ye)||(fr.current.add(Ye),bt("recommendation_shown",{message_id:p,query:D,recommendation_id:pe,brand_name:(Z=(L=R.recommendation)==null?void 0:L.creative)==null?void 0:Z.brand_name,is_sponsored:!0}))},[bt]),Ga=x.useCallback((p,R,D,L,Z,pe)=>{const Ye=Array.isArray(pe)&&pe.length?pe.map((Te,We)=>{const kt=Po(Te.text||"");return kt?{id:`followup_llm_${We}_${kt.toLowerCase().replace(/[^a-z0-9]+/g,"_")}`,text:kt,type:Te.type||"information",is_sponsored:!1}:null}).filter(Te=>!!Te).slice(0,3):Wh(p,R,D,L),zt=Bh(Z),Lt=zt?[zt,...Ye.slice(0,2)]:Ye.slice(0,3);Lt.length&&Jt(sl(Lt))},[]),en=x.useCallback((p,R)=>{const D=Po(p.query||p.label||"");if(!D||!R)return;const L={id:R,text:D,type:"action",is_sponsored:!0,recommendation:{recommendation_id:R,recommendation:{creative:{follow_up_suggestion:D}},tracking:{followup_engagement_url:p.engagement_url,followup_exposure_url:p.exposure_url}}};Jt(Z=>{const pe=Z.filter(Ye=>!Ye.is_sponsored).slice(0,3);return sl([L,...pe].slice(0,4))})},[]),la=x.useCallback(()=>{const p=jn.current,R=Ct.current;if(!p||!R)return!1;const D=p.getBoundingClientRect(),L=R.getBoundingClientRect(),Z=Math.max(0,p.scrollTop+L.top-D.top);return p.scrollTop=Z,!0},[]);x.useLayoutEffect(()=>{var p;if(pr.current){la()&&(pr.current=!1);return}oa.current||(p=aa.current)==null||p.scrollIntoView({behavior:"smooth"})},[ot,la]),x.useLayoutEffect(()=>{if(!Fe||Xr)return;const p=Oi.current;if(!p)return;const R=p.closest(".admesh-publisher-assistant-reactMount"),D=tr;[p,R].forEach(Z=>{Z&&(Z.style.width=wn,Z.style.maxWidth=wn,Z.style.height=D,Z.style.maxHeight=D,Z.style.overflow="hidden",Z.style.boxSizing="border-box",Z.dataset.admeshAdSlotExpanded=Ka?"true":"false")});const L=R?.parentElement;L&&L!==document.body&&L!==document.documentElement&&(L.style.width=wn,L.style.maxWidth=wn,L.style.height=D,L.style.maxHeight=D,L.style.overflow="hidden",L.style.boxSizing="border-box")},[tr,wn,Xr,Fe,Ka]),x.useEffect(()=>{if(xe&&xe.length){Jt(xe);return}be&&be.length&&Jt(p=>Oh(p,be))},[xe,be]),x.useEffect(()=>{if(f!=="default"||!G)return;let p=!1;return G().then(R=>{!p&&Array.isArray(R)&&R.length&&Jt(R)}).catch(R=>{console.warn("[AdMeshIntentAssistant] Failed to load suggestions",R)}),()=>{p=!0}},[G,f]),x.useEffect(()=>{if(!qe){jo(0),Ro.current=null;return}Ro.current==null&&(Ro.current=typeof performance<"u"?performance.now():Date.now());const p=()=>{const D=Ro.current;if(D==null)return;const L=typeof performance<"u"?performance.now():Date.now();jo(Math.floor((L-D)/1e3))};p();const R=window.setInterval(p,1e3);return()=>window.clearInterval(R)},[qe]),x.useEffect(()=>{if(!qe||f!=="default"){Yn(0);return}const p=window.setInterval(()=>{Yn(R=>Math.min(R+1,7))},3e3);return()=>window.clearInterval(p)},[qe,f]),x.useEffect(()=>{_r.current||!Ne||!Be||(_r.current=!0,bt("assistant_loaded",{metadata:{layout:y,surface:B,variant:f,default_open:Q||le}}))},[le,Q,y,Ne,Be,B,bt,f]);const rr=x.useCallback(p=>{Mn?fe?.(p):Kt(p),p?(bt("assistant_opened",{metadata:{layout:y,surface:B,ad_slot_behavior:C,variant:f,expanded:me}}),Le?.()):De?.()},[Mn,me,y,fe,Le,De,B,bt,f]),ua=x.useCallback(()=>{rr(!0)},[rr]),Gr=x.useCallback(()=>{rr(!1)},[rr]),Hi=x.useCallback(()=>{fn(p=>!p)},[]),Za=x.useCallback(async(p,R,D,L,Z,pe,Ye)=>{var zt,Lt,Te;if(!Ne)return console.warn("[AdMeshIntentAssistant] SDK not available - using fallback response"),{text:"I'm a demo assistant. The SDK is not properly configured, but I can still help with suggestions! Try clicking on one of the suggested questions above."};try{Yt&&await Ge("turn_started",{source:"publisher_assistant",recommendation_id:Yt.recommendation_id}).catch(ht=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_started",ht)});const We=await fetch(`${Ne.getApiBaseUrl()}/api/chat/assistant`,{method:"POST",signal:pe,headers:{"Content-Type":"application/json",Accept:"text/plain","Cache-Control":"no-cache",Authorization:`Bearer ${ae}`},body:JSON.stringify({message:p,session_id:Be||"default-session",message_id:R,user_id:ce,context:{timestamp:new Date().toISOString(),source:"admesh-ui-sdk",page_context:rc(te),conversation_history:Ye,sponsored_recommendation:Z!=null&&Z.recommendation_id?{recommendation_id:Z.recommendation_id,brand_name:(Lt=(zt=Z.recommendation)==null?void 0:zt.creative)==null?void 0:Lt.brand_name}:void 0,active_delegation_session:Yt?{delegation_session_id:Yt.delegation_session_id,recommendation_id:Yt.recommendation_id,session_id:Yt.session_id,brand_name:Yt.brand_name,mcp_endpoint:Yt.mcp_endpoint,status:Yt.status}:void 0}})});if(!We.ok)throw new Error(`API request failed: ${We.status} ${We.statusText}`);const kt=(Te=We.body)==null?void 0:Te.getReader(),Gt=new TextDecoder;if(!kt)throw new Error("Response body is not readable");let Vt="",Ut,_n,Vn,Ce,He;return await(async()=>{try{for(;;){const{done:ht,value:st}=await kt.read();if(ht)break;const Sn=Gt.decode(st,{stream:!0}).split(`
1225
+ `);for(const St of Sn)if(St.startsWith("data: ")){const nn=St.slice(6);if(nn.trim()==="[DONE]")return Yt&&Ge("turn_completed",{source:"publisher_assistant",recommendation_id:Yt.recommendation_id}).catch(gt=>{console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_completed",gt)}),{text:Vt,source_links:Ut,related_items:_n,followup_suggestions:Vn,used_capability:Ce,response_time_ms:He};try{const gt=JSON.parse(nn);switch(gt.type){case"content":{const qi=gt.content||"";Vt+=qi,D?.(qi);break}case"final":{Vt=gt.reply||Vt,Ut=Array.isArray(gt.source_links)?gt.source_links:void 0,_n=Array.isArray(gt.related_items)?gt.related_items:void 0,Vn=Array.isArray(gt.followup_suggestions)?gt.followup_suggestions:void 0,Ce=typeof gt.used_capability=="string"?gt.used_capability:Ce,He=typeof gt.response_time_ms=="number"?gt.response_time_ms:He;break}case"followup_suggestions":{Vn=Array.isArray(gt.followup_suggestions)?gt.followup_suggestions:Vn;break}case"error":throw new Error(gt.message||"Unknown streaming error");case"session_start":L?.(),console.log("Session started:",gt.session_id);break}}catch{console.warn("Failed to parse streaming chunk:",nn);continue}}}}catch(ht){if(pe!=null&&pe.aborted)return{text:Vt,source_links:Ut,related_items:_n,followup_suggestions:Vn,used_capability:Ce,response_time_ms:He,error:"aborted"};throw console.error("Stream processing error:",ht),ht}finally{kt.releaseLock()}return{text:Vt,source_links:Ut,related_items:_n,followup_suggestions:Vn,used_capability:Ce,response_time_ms:He}})()}catch(We){return pe!=null&&pe.aborted?{text:"",error:"aborted"}:(console.error("Error calling assistant API:",We),{text:"I'm having trouble connecting to my services right now. Please try again in a moment.",error:We instanceof Error?We.message:"request_failed"})}},[Ne,Be,ae,ce,Yt,Ge]),gr=x.useCallback(()=>{const p=cn.current;if(!p||p.signal.aborted)return;p.abort(),dn(!1),hn.current=null,er.current=!1;const R=It.current;R&&mt(D=>D.map(L=>L.id===R&&!L.content.trim()?{...L,content:"Generation stopped."}:L))},[]),Cr=x.useCallback(async p=>{var R,D,L,Z,pe,Ye,zt,Lt;if(!p.trim()||qe)return;const Te=typeof performance<"u"?performance.now():Date.now(),We=p.trim(),kt=Date.now().toString(),Gt=new AbortController,Vt=hn.current,Ut=Vt?.recommendation||null,_n=ot.filter(Ce=>(Ce.role==="user"||Ce.role==="assistant")&&Ce.content.trim()).slice(-6).map(Ce=>({role:Ce.role,content:Ce.content.trim().slice(0,1200)}));cn.current=Gt,It.current=null,Ht.current=kt,pr.current=!0,oa.current=!0,hn.current=null,Jt(Ce=>Ce.some(He=>He.is_sponsored)?Ce.filter(He=>!He.is_sponsored):Ce),mn(null);const Vn={id:kt,role:"user",content:We,timestamp:new Date};if(bt("query_submitted",{message_id:kt,query:We}),mt(Ce=>[...Ce,Vn]),Vr(""),dn(!0),f==="default"&&P){try{const Ce=(Date.now()+1).toString(),He={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:p,initialRecommendation:null};er.current&&(ve(Sn=>new Set([...Sn,Ce])),er.current=!1),mt(Sn=>[...Sn,He]),It.current=Ce;const ht=await P(We,{sponsoredSuggestion:Vt});if(Gt.signal.aborted){hn.current=null;return}const st=ht.recommendation||Ut||null;console.log("[AdMeshIntentAssistant] Query handler completed:",{query:p,hasResponseRecommendation:!!ht.recommendation,hasSponsoredSuggestionRecommendation:!!Ut,finalRecommendationId:st?.recommendation_id}),mt(Sn=>Sn.map(St=>St.id===Ce?{...St,content:ht.answer,sourceLinks:ht.source_links,relatedItems:ht.related_items,initialRecommendation:st,responseTimeMs:(typeof performance<"u"?performance.now():Date.now())-Te}:St)),Ga(We,ht.answer,ht.source_links,ht.related_items,ht.recommendation||null,ht.followup_suggestions),bt("answer_completed",{message_id:Ce,query:We,recommendation_id:st?.recommendation_id,brand_name:(D=(R=st?.recommendation)==null?void 0:R.creative)==null?void 0:D.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:"completed",metadata:{variant:f,source:"query_handler"}}),hn.current=null}catch(Ce){console.error("Error sending message:",Ce);const He=Ce instanceof Error?Ce.message:"Unknown error occurred";mn(He);const ht={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};mt(st=>[...st,ht]),bt("answer_failed",{query:We,status:He,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,metadata:{variant:f,source:"query_handler"}}),hn.current=null}finally{cn.current===Gt&&(cn.current=null,It.current=null,dn(!1))}return}if(!Ne){setTimeout(()=>{if(Gt.signal.aborted){cn.current===Gt&&(cn.current=null,It.current=null);return}const Ce={id:(Date.now()+1).toString(),role:"assistant",content:"I'm a demo assistant. The SDK is not properly configured, but I can still help! Try clicking on the suggested questions above, or check your AdMesh API key configuration.",timestamp:new Date,recommendations:[],userQuery:p};mt(He=>[...He,Ce]),cn.current===Gt&&(cn.current=null,It.current=null,dn(!1))},1e3);return}try{const Ce=(Date.now()+1).toString(),He=Ut,ht={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:p,initialRecommendation:He};er.current&&(ve(St=>new Set([...St,Ce])),er.current=!1),mt(St=>[...St,ht]),It.current=Ce;const st=await Za(We,kt,St=>{mt(nn=>nn.map(gt=>gt.id===Ce?{...gt,content:gt.content+St}:gt))},()=>{dn(!0),Yn(0)},He,Gt.signal,_n);if(Gt.signal.aborted){st.text.trim()||mt(St=>St.map(nn=>nn.id===Ce&&!nn.content.trim()?{...nn,content:"Generation stopped."}:nn)),bt("answer_failed",{message_id:Ce,query:We,recommendation_id:He?.recommendation_id,brand_name:(Z=(L=He?.recommendation)==null?void 0:L.creative)==null?void 0:Z.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:"aborted",metadata:{variant:f,source:"api_chat_assistant"}}),hn.current=null;return}const Sn=typeof st.response_time_ms=="number"?st.response_time_ms:(typeof performance<"u"?performance.now():Date.now())-Te;mt(St=>St.map(nn=>nn.id===Ce?{...nn,content:st.text,sourceLinks:st.source_links,relatedItems:st.related_items,initialRecommendation:nn.initialRecommendation||He,responseTimeMs:Sn}:nn)),Ga(We,st.text,st.source_links,st.related_items,null,st.followup_suggestions),st.error?bt("answer_failed",{message_id:Ce,query:We,recommendation_id:He?.recommendation_id,brand_name:(Ye=(pe=He?.recommendation)==null?void 0:pe.creative)==null?void 0:Ye.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:st.error,metadata:{variant:f,source:"api_chat_assistant"}}):bt("answer_completed",{message_id:Ce,query:We,recommendation_id:He?.recommendation_id,brand_name:(Lt=(zt=He?.recommendation)==null?void 0:zt.creative)==null?void 0:Lt.brand_name,used_capability:st.used_capability,latency_ms:Sn,status:"completed",metadata:{variant:f,source:"api_chat_assistant",response_time_ms:Sn}}),hn.current=null}catch(Ce){console.error("Error sending message:",Ce);const He=Ce instanceof Error?Ce.message:"Unknown error occurred";mn(He);const ht={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};mt(st=>[...st,ht]),bt("answer_failed",{query:We,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:He,metadata:{variant:f,source:"api_chat_assistant"}}),hn.current=null}finally{cn.current===Gt&&(cn.current=null,It.current=null,dn(!1))}},[qe,Za,P,Ga,Ne,bt,f]),or=tt,No=x.useMemo(()=>or.some(p=>p?.is_sponsored),[or]),Zr=x.useMemo(()=>or.filter(p=>p&&typeof p.id=="string"?Ee?No:!0:!1),[No,Ee,or]),Bt=x.useMemo(()=>sl(Zr),[Zr]),Jr=x.useMemo(()=>ke==="below-input-container"&&ue?Bt.find(p=>p.is_sponsored&&p.recommendation)??null:null,[ue,Bt,ke]),br=x.useCallback(async p=>{var R,D,L,Z,pe,Ye,zt;console.log("[AdMeshIntentAssistant] \u{1F5B1}\uFE0F Suggestion clicked:",{text:p.text,is_sponsored:p.is_sponsored,hasRecommendation:!!p.recommendation,recommendationId:((R=p.recommendation)==null?void 0:R.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((L=(D=p.recommendation)==null?void 0:D.tracking)!=null&&L.followup_engagement_url),sessionId:Be}),er.current=p.is_sponsored||!1,hn.current=p.is_sponsored?p:null;const Lt=Bt.findIndex(Te=>Te.id===p.id);bt("suggestion_clicked",{suggestion_id:p.id,suggestion_text:p.text,suggestion_type:p.type,suggestion_position:Lt>=0?Lt:void 0,is_sponsored:p.is_sponsored,recommendation_id:(Z=p.recommendation)==null?void 0:Z.recommendation_id,brand_name:(zt=(Ye=(pe=p.recommendation)==null?void 0:pe.recommendation)==null?void 0:Ye.creative)==null?void 0:zt.brand_name,query:p.text}),Cr(p.text),p.is_sponsored&&p.recommendation&&Ne?setTimeout(async()=>{var Te;try{const We=(Te=p.recommendation.tracking)==null?void 0:Te.followup_engagement_url,kt=p.recommendation.recommendation_id;console.log("[AdMeshIntentAssistant] \u{1F3AF} Preparing to fire sponsored suggestion engagement:",{followupEngagementUrl:We,recommendationId:kt,sessionId:Be}),We&&kt&&Be?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing sponsored suggestion engagement tracking"),await Ne.fireFollowupEngagement(We,kt,Be),console.log("[AdMeshIntentAssistant] \u2705 Engagement tracking fired successfully")):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing required data for engagement tracking:",{hasFollowupEngagementUrl:!!We,hasRecommendationId:!!kt,hasSessionId:!!Be})}catch(We){console.error("[AdMeshIntentAssistant] Error firing sponsored suggestion engagement:",We)}},0):console.log("[AdMeshIntentAssistant] \u2139\uFE0F Not a sponsored suggestion or missing data, skipping engagement tracking")},[Cr,Bt,Ne,Be,bt]),kn=Qh[ne],da=Uh[ie];x.useEffect(()=>{if(qr.current.forEach(p=>p()),qr.current=[],!(typeof window>"u"||typeof IntersectionObserver>"u"))return Bt.forEach((p,R)=>{const D=ra.current.get(p.id);if(!D)return;const L=`${Be||"anonymous"}:${p.id}:${p.is_sponsored?"s":"o"}`;if(sa.current.has(L))return;let Z=null,pe=null;const Ye=()=>{Z&&(clearTimeout(Z),Z=null),pe?.disconnect(),pe=null},zt=()=>{var Lt,Te,We,kt,Gt;if(sa.current.has(L)){Ye();return}if(sa.current.add(L),Ye(),bt("suggestion_exposure",{suggestion_id:p.id,suggestion_text:p.text,suggestion_type:p.type,suggestion_position:R,is_sponsored:p.is_sponsored,recommendation_id:(Lt=p.recommendation)==null?void 0:Lt.recommendation_id,brand_name:(kt=(We=(Te=p.recommendation)==null?void 0:Te.recommendation)==null?void 0:We.creative)==null?void 0:kt.brand_name}),Ne&&Be&&p.is_sponsored&&p.recommendation){const Vt=(Gt=p.recommendation.tracking)==null?void 0:Gt.followup_exposure_url,Ut=p.recommendation.recommendation_id;Vt&&Ut?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing viewable sponsored suggestion exposure:",{exposureUrl:Vt,recommendationId:Ut,suggestionText:p.text,sessionId:Be}),Ne.fireFollowupExposure(Vt,Ut,Be)):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing exposure URL or recommendation ID for sponsored suggestion:",{hasExposureUrl:!!Vt,hasRecommendationId:!!Ut,suggestionText:p.text})}};pe=new IntersectionObserver(Lt=>{const Te=Lt[0];if(Te){if(Te.intersectionRatio>=.5){Z||(Z=setTimeout(zt,1e3));return}Z&&(clearTimeout(Z),Z=null)}},{threshold:[0,.25,.5,.75,1],rootMargin:"0px"}),pe.observe(D),qr.current.push(Ye)}),()=>{qr.current.forEach(p=>p()),qr.current=[]}},[Bt,Ne,Be,bt,Xt]),console.log("[AdMeshIntentAssistant] \u{1F4E5} Received suggestions:",{totalSuggestions:or.length,safeSuggestions:Zr.length,isAnalyzingIntent:Me,hasIntentError:!!je,onlyShowWhenSponsored:Ee,hasSponsoredSuggestions:No,sponsoredCount:or.filter(p=>p?.is_sponsored).length,nonSponsoredCount:or.filter(p=>p&&!(p!=null&&p.is_sponsored)).length,modalShouldAppear:Ee?No:!0,suggestions:or.map(p=>{var R,D,L;return{id:p?.id,text:p?.text,type:p?.type,is_sponsored:p?.is_sponsored,hasRecommendation:!!(p!=null&&p.recommendation),recommendationId:((R=p?.recommendation)==null?void 0:R.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((L=(D=p?.recommendation)==null?void 0:D.tracking)!=null&&L.followup_engagement_url)}}),renderedSuggestions:Bt.map(p=>{var R,D,L;return{id:p?.id,text:p?.text,type:p?.type,is_sponsored:p?.is_sponsored,hasRecommendation:!!(p!=null&&p.recommendation),recommendationId:((R=p?.recommendation)==null?void 0:R.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((L=(D=p?.recommendation)==null?void 0:D.tracking)!=null&&L.followup_engagement_url)}})});const et={base:`${16*re}px`,sm:`${14*re}px`,xs:`${12*re}px`},Er=Y||"AI-generated responses may contain errors. Please verify important information independently.",Yr=["Searching trusted sources...","Reviewing publisher coverage...","Checking relevant context...","Comparing supporting signals...","Identifying the strongest examples...","Organizing the most useful details...","Shaping the response for clarity...","Preparing the clearest answer...","Finishing the response..."],eo=p=>{const R=p?.accentColor||yt,D=p?.metaColor||Lo,L=p?.includeSteps??f==="default",Z=`${cr}s`,pe=L?`${Yr[Mo]} (${Z})`:`Generating answer... ${Z}`;return m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:p!=null&&p.compact?"8px":"10px",color:D,fontSize:p!=null&&p.compact?et.xs:et.sm},children:[m.jsx("span",{style:{width:p!=null&&p.compact?8:9,height:p!=null&&p.compact?8:9,borderRadius:999,background:R,animation:"admeshPulse 1.4s ease-in-out infinite",boxShadow:`0 0 0 0 ${wt(Et,.28)}`,flexShrink:0}}),m.jsx("span",{children:pe})]})},ca=x.useCallback((p,R)=>{if(Qr[p.id])return;const D=R?"helpful":"not_helpful";$i(L=>({...L,[p.id]:D})),bt("answer_feedback",{message_id:p.id,query:p.userQuery,status:D,latency_ms:p.responseTimeMs,metadata:{helpful:R}})},[Qr,bt]);function pa(p,R){if(p.role!=="assistant"||!p.content.trim()||qe&&p.id===It.current)return null;const D=R?.accentColor||yt,L=R?.metaColor||Lo,Z=Qr[p.id],pe=typeof p.responseTimeMs=="number";return m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",marginTop:"10px",paddingTop:"10px",borderTop:`1px solid ${tn}`,flexWrap:"wrap"},children:[m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"8px",minWidth:0,flex:"1 1 auto",flexWrap:"wrap"},children:[m.jsx("span",{style:{fontSize:et.xs,color:L,whiteSpace:"nowrap"},children:Z?"Thanks for your feedback":"Is this helpful?"}),Z?m.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",background:wt(D,.12),color:D,flexShrink:0},children:Z==="helpful"?m.jsx(Nd,{size:14}):m.jsx(Dd,{size:14})}):m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px",flexShrink:0},children:[m.jsx("button",{type:"button","aria-label":"Mark answer as helpful",onClick:()=>ca(p,!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,padding:0,margin:0,minWidth:0,flexShrink:0,borderRadius:"6px",border:`1px solid ${tn}`,background:Mt,color:L,cursor:"pointer"},children:m.jsx(Nd,{size:14,style:{flexShrink:0}})}),m.jsx("button",{type:"button","aria-label":"Mark answer as not helpful",onClick:()=>ca(p,!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,padding:0,margin:0,minWidth:0,flexShrink:0,borderRadius:"6px",border:`1px solid ${tn}`,background:Mt,color:L,cursor:"pointer"},children:m.jsx(Dd,{size:14,style:{flexShrink:0}})})]})]}),pe?m.jsxs("span",{style:{fontSize:et.xs,color:L,whiteSpace:"nowrap",flex:"0 1 auto",marginLeft:"auto"},children:["Answer Completed in ",$h(p.responseTimeMs)]}):null]})}const ar=x.useCallback(()=>{const p=ia.current;if(!p)return;const R=Math.max(0,p.scrollWidth-p.clientWidth);qa(p.scrollLeft>4),Kr(p.scrollLeft<R-4)},[]);x.useEffect(()=>(ar(),window.addEventListener("resize",ar),()=>window.removeEventListener("resize",ar)),[ar,Bt.length]);const Wn=x.useCallback(p=>{const R=ia.current;R&&R.scrollBy({left:p==="left"?-Math.max(160,Math.floor(R.clientWidth*.75)):Math.max(160,Math.floor(R.clientWidth*.75)),behavior:"smooth"})},[]),wt=(p,R)=>{if(!p||!p.startsWith("#"))return`rgba(15, 23, 42, ${R})`;const D=p.slice(1),L=D.length===3?D.split("").map(zt=>`${zt}${zt}`).join(""):D;if(L.length!==6)return p;const Z=parseInt(L.slice(0,2),16),pe=parseInt(L.slice(2,4),16),Ye=parseInt(L.slice(4,6),16);return`rgba(${Z}, ${pe}, ${Ye}, ${R})`},Et=K.primaryColor||"#3F037F",Mt=K.surfaceColor||"#ffffff",Ja=K.backgroundColor||"#eef2ff",tn=K.borderColor||"#e5e7eb",Tt=K.textColor||"#111827",Hn=K.textSecondaryColor||"#6b7280";wt(Et,.12);const To=wt(Et,.24);wt(Et,.38);const Bi=Mt,yt=Et,Bn=K.primaryTextColor||"#ffffff",Lo=Hn,to=ye||"Publisher Assistant",no=Me&&Bt.length===0&&ot.length===0,Fo=Mt,$o=Mt,Rn=tn,Oo=tn,Ya="0 16px 64px rgba(15, 23, 42, 0.14)",ei=Hn,ml=Hn,fl=yt,ma=Ja,hl="none",gl="rgba(15, 23, 42, 0.18)";function Vi(p){return Yt?m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:p==="default"?"10px 12px":"8px 10px",borderRadius:p==="default"?"14px":"12px",border:`1px solid ${To}`,background:wt("#ffffff",.9),marginBottom:"4px"},children:[m.jsxs("div",{style:{minWidth:0},children:[m.jsx("div",{style:{color:yt,fontSize:et.xs,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Agent Connected"}),m.jsxs("div",{style:{color:Tt,fontSize:et.sm,fontWeight:600,lineHeight:1.3},children:[Yt.brand_name," agent is active"]})]}),m.jsx("button",{type:"button",onClick:()=>{Ve("user_stopped",{source:"publisher_assistant"})},style:{border:`1px solid ${To}`,borderRadius:999,background:wt("#ffffff",.92),color:yt,padding:"7px 12px",fontSize:et.xs,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Stop"})]}):null}function Ui(p,R=Fe){const D=Do&&!R,L=R||D?"9px":"11px";return m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:R||p==="default"?"2px":"8px",marginTop:R?"0":p==="default"?"4px":0,flexShrink:0,textAlign:"center",width:"100%"},children:m.jsx("div",{style:{color:ml,fontSize:L,lineHeight:D?1.3:1.45,maxWidth:"100%",textAlign:"center"},children:Er})})}function ti(p){const R=p==="publisher"?[180,220,196]:["100%","82%","68%"];return p==="publisher"?m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[m.jsx("div",{style:{width:28,height:28,borderRadius:"6px",background:wt(Tt,.06),flexShrink:0}}),m.jsx("div",{style:{display:"flex",gap:"10px",overflow:"hidden",flex:1},children:R.map((D,L)=>m.jsx("div",{style:{width:D,maxWidth:"100%",height:40,borderRadius:"6px",background:wt(Tt,.06),backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:"none",flexShrink:0}},`suggestion-skeleton-${L}`))}),m.jsx("div",{style:{width:28,height:28,borderRadius:"6px",background:wt(Tt,.06),flexShrink:0}})]}):m.jsx("div",{"aria-hidden":"true",style:{display:"flex",flexDirection:"column",gap:p==="publisher"?"10px":"12px"},children:R.map((D,L)=>m.jsx("div",{style:{width:D,maxWidth:"100%",height:p==="publisher"?40:52,borderRadius:999,background:`linear-gradient(90deg, ${wt(Et,.08)} 0%, ${wt(Et,.18)} 50%, ${wt(Et,.08)} 100%)`,backgroundSize:"200% 100%",animation:"admeshShimmer 1.4s ease-in-out infinite",boxShadow:p==="publisher"?`0 8px 22px ${wt(Et,.08)}`:"none"}},`suggestion-skeleton-${L}`))})}function Qi(p=Fe){if(qe)return null;if(no)return ti("publisher");if(!Bt.length)return null;const R=p&&Xa,D=Bt.slice(0,Pe);return E==="stacked"?m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:p?"6px":"8px",flexShrink:0,overflowY:"auto",maxHeight:p?"240px":void 0,paddingRight:p?"2px":0,scrollbarWidth:"none",msOverflowStyle:"none"},children:D.map(L=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":L.is_sponsored?"true":void 0,ref:Sr(L.id),onClick:()=>{f==="default"&&(fn(!0),y==="floating"&&rr(!0)),br(L)},type:"button",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",width:"100%",minWidth:0,borderRadius:"8px",border:`1px solid ${L.is_sponsored?Et:tn}`,background:L.is_sponsored?Et:Mt,color:L.is_sponsored?Bn:Tt,padding:p?"8px 10px":"10px 14px",fontSize:p?"12px":"13px",fontWeight:500,lineHeight:1.25,textAlign:"left",boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{style:{minWidth:0},children:L.text}),ue&&L.is_sponsored&&m.jsx("span",{style:{flexShrink:0,borderRadius:"6px",background:wt("#ffffff",.18),padding:"2px 6px",fontSize:"10px",fontWeight:700},children:"Ad"})]},L.id))}):m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R?"4px":pn?"5px":p?"6px":"10px",flexShrink:0},children:[!R&&m.jsx("button",{type:"button",onClick:()=>Wn("left"),disabled:!kr,"aria-label":"Scroll suggestions left",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,padding:0,margin:0,minWidth:0,width:pn?20:p?24:28,height:pn?20:p?24:28,borderRadius:"6px",border:`1px solid ${tn}`,background:Mt,color:"#6b7280",fontSize:pn?"13px":void 0,lineHeight:1,cursor:kr?"pointer":"default",opacity:kr?1:.55},children:m.jsx(Xf,{size:pn?13:p?14:16,style:{flexShrink:0},"aria-hidden":"true"})}),m.jsx("div",{ref:ia,onScroll:ar,style:{display:"flex",gap:R?"4px":pn?"5px":p?"6px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",flex:1},children:D.map(L=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":L.is_sponsored?"true":void 0,ref:Sr(L.id),onClick:()=>{f==="default"&&(fn(!0),y==="floating"&&rr(!0)),br(L)},type:"button",style:{display:"inline-flex",alignItems:"center",gap:R?"4px":pn?"5px":"8px",whiteSpace:"nowrap",borderRadius:"6px",border:`1px solid ${L.is_sponsored?Et:tn}`,background:L.is_sponsored?Et:Mt,color:L.is_sponsored?Bn:Tt,padding:R?"4px 8px":pn?"5px 8px":p?"7px 10px":"8px 14px",fontSize:R?"10px":pn?"11px":p?"12px":"13px",fontWeight:500,lineHeight:R?1:pn?1.1:void 0,boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{children:L.text}),ue&&L.is_sponsored&&m.jsx("sup",{style:{fontSize:"10px",opacity:.9},children:"Ad"})]},L.id))}),!R&&m.jsx("button",{type:"button",onClick:()=>Wn("right"),disabled:!mr,"aria-label":"Scroll suggestions right",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,padding:0,margin:0,minWidth:0,width:pn?20:p?24:28,height:pn?20:p?24:28,borderRadius:"6px",border:`1px solid ${tn}`,background:Mt,color:"#6b7280",fontSize:pn?"13px":void 0,lineHeight:1,cursor:mr?"pointer":"default",opacity:mr?1:.55},children:m.jsx(Gf,{size:pn?13:p?14:16,style:{flexShrink:0},"aria-hidden":"true"})})]})}function bl(p=Fe){if(p||!(Jr!=null&&Jr.recommendation))return null;const R=`publisher-sponsored-creative-${Jr.id}`;return m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"2px"},children:m.jsx(Va,{messageId:R,query:Jr.text,initialRecommendation:Jr.recommendation,onFollowupDetected:en,onRecommendationsShown:(D,L)=>{hr(D,L,Jr.text)},onError:D=>{console.error("[AdMeshIntentAssistant] Sponsored creative error:",D)}})})}function yl(p){var R,D;return(R=p.relatedItems)!=null&&R.length||!((D=p.sourceLinks)!=null&&D.length)?null:m.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"16px"},children:[m.jsx("div",{style:{width:"100%",fontSize:"11px",fontWeight:600,color:Hn},children:"Sources"}),p.sourceLinks.map(L=>m.jsxs("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{bt("source_link_clicked",{message_id:p.id,query:p.userQuery,metadata:{source_title:L.title,source_url:L.url}})},style:{color:yt,fontSize:et.xs,textDecoration:"none",borderBottom:`1px solid ${wt(Et,.18)}`},children:[L.title||L.url," ",m.jsx(qf,{size:12,style:{display:"inline",verticalAlign:"middle"},"aria-hidden":"true"})]},`${p.id}-${L.url}`))]})}function vl(p,R=Fe){var D;return(D=p.relatedItems)!=null&&D.length?m.jsxs("div",{style:{marginTop:"14px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:Hn,marginBottom:"8px"},children:ze}),m.jsx("div",{style:{display:"flex",gap:R?"8px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",padding:"2px 2px 6px",maxWidth:"100%",scrollSnapType:"x proximity"},children:p.relatedItems.slice(0,4).map(L=>m.jsxs("a",{className:"admesh-publisher-source",href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{bt("source_link_clicked",{message_id:p.id,query:p.userQuery,metadata:{source_title:L.title,source_url:L.url,source_publisher:L.publisher,source_type:"related_item"}})},style:{display:"flex",flexDirection:"column",gap:R?"6px":"10px",padding:R?"10px":"14px",borderRadius:"8px",textDecoration:"none",color:Tt,border:`1px solid ${tn}`,background:Mt,boxShadow:"none",flex:R?"0 0 min(220px, calc(100% - 8px))":"0 0 min(250px, calc(100% - 16px))",minWidth:0,maxWidth:R?"220px":"250px",flexShrink:0,scrollSnapAlign:"start",boxSizing:"border-box"},children:[m.jsx("div",{style:{fontSize:R?"12px":"14px",fontWeight:650,lineHeight:1.35,color:Tt,overflowWrap:"anywhere"},children:L.title||L.url}),L.publisher&&m.jsx("div",{style:{fontSize:R?"11px":"12px",color:Hn,lineHeight:1.4,overflowWrap:"anywhere"},children:L.publisher})]},`${p.id}-${L.url}`))})]}):null}function xl(p=Fe){const R=p?"13px":"15px";return m.jsxs("div",{ref:jn,style:{flex:p?"1 1 0":1,minHeight:0,maxHeight:"100%",overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",scrollbarWidth:"thin",padding:p?"0 2px 4px":me?"16px 16px 8px":0},children:[ot.map(D=>{const L=D.role==="user"&&D.id===Ht.current;return m.jsx("div",{ref:L?Ct:void 0,style:{marginBottom:p?"16px":"28px",textAlign:D.role==="user"?"right":"left"},children:(()=>{const Z=!!D.content.trim()||!qe;return m.jsx(m.Fragment,{children:m.jsxs("div",{style:{display:D.role==="assistant"?"block":"inline-block",width:D.role==="assistant"?"100%":void 0,maxWidth:D.role==="assistant"?"100%":"76%",padding:D.role==="assistant"?"4px 6px 4px 2px":"10px 14px",borderRadius:D.role==="assistant"?0:"8px",background:D.role==="user"?wt(Tt,.05):"transparent",color:Tt,boxShadow:"none",border:"none",fontSize:D.role==="assistant"?R:p?"12px":"13px",lineHeight:D.role==="assistant"?1.62:1.4},children:[D.role==="assistant"?D.content.trim()?m.jsx(il,{content:D.content,theme:{...K,textColor:Tt},fontSize:R}):qe&&D.id===It.current?eo({includeSteps:!0}):null:m.jsx("p",{style:{margin:0,color:Tt},children:D.content}),D.role==="assistant"&&yl(D),D.role==="assistant"&&vl(D,p),D.role==="assistant"&&pa(D),D.role==="assistant"&&Z&&xn.has(D.id)&&D.initialRecommendation&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Va,{messageId:D.id,query:D.userQuery,initialRecommendation:D.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(pe,Ye)=>{hr(pe,Ye,D.userQuery)},onError:pe=>{console.error("[AdMeshIntentAssistant] Recommendation error:",pe)}})}),D.role==="assistant"&&Z&&!xn.has(D.id)&&(D.initialRecommendation||Nt)&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Va,{messageId:D.id,query:D.userQuery,initialRecommendation:D.initialRecommendation||void 0,onFollowupDetected:en,onRecommendationsShown:(pe,Ye)=>{hr(pe,Ye,D.userQuery)},onError:pe=>{console.error("[AdMeshIntentAssistant] Recommendation error:",pe)}})})]})})})()},D.id)}),Ur&&m.jsx("div",{role:"alert",style:{color:Tt,fontSize:et.sm,border:`1px solid ${tn}`,borderLeft:"3px solid #b45309",borderRadius:"6px",padding:"12px"},children:"Unable to complete the answer. Please try again."}),m.jsx("div",{ref:aa})]})}if(f==="default"){let p=function(L){const Z=ec(Do);return el.createPortal(m.jsxs(m.Fragment,{children:[m.jsx("div",{style:D}),m.jsx("div",{style:Z.shell,children:L})]}),document.body)},R=function(L=!1){const Z=un(L),pe=L||Z&&me,Ye=!pe&&V==="input",zt=Z&&!pe&&Xa,Lt=pe&&!(Fe&&C==="expand"&&!L&&Xr),Te=pe?ec(Do):null,We=!!(Te&&Do&&!Z),kt=Z?wn:Te?Te.panelWidth:y==="inline"?"100%":"min(420px, calc(100vw - 32px))",Gt=Z?tr:Te?Te.panelHeight:"auto",Vt=Z?wn:Te?.panelMaxWidth??"100%",Ut=Z?tr:Te?.panelMaxHeight,_n=N&&!zt&&pe;return m.jsxs("div",{className:"admesh-publisher-panel","data-compact":Z?"true":"false",style:{"--publisher-accent":yt,color:Tt,width:kt,maxWidth:Vt,height:Gt,maxHeight:Ut,boxSizing:"border-box",display:"flex",flexDirection:"column",background:pe?Fo:Bi,borderRadius:!Z&&Te?Te.panelBorderRadius:"12px",padding:pe?0:Z?"6px":0,boxShadow:We?"none":pe?Ya:"none",border:We||Ye?"none":`1px solid ${Oo}`,overflow:"hidden",minHeight:Z?0:void 0},children:[m.jsx("style",{children:Td}),_n&&m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:Z?"8px 10px":"14px 20px",background:$o,color:Tt,borderBottom:`1px solid ${Rn}`,flexShrink:0},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",minWidth:0},children:[m.jsx("div",{style:{width:Z?26:32,height:Z?26:32,flexShrink:0,borderRadius:"6px",background:wt(Tt,.04),display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,fontWeight:700,color:yt,overflow:"hidden"},children:M?m.jsx("img",{src:M,alt:`${v||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:Mt,padding:4}}):m.jsx(tl,{size:Z?14:17,strokeWidth:1.5,"aria-hidden":"true"})}),(q||_)&&m.jsxs("div",{style:{minWidth:0,overflowWrap:"anywhere"},children:[q&&m.jsx("div",{style:{fontSize:Z?"13px":"14px",fontWeight:600,lineHeight:1.1,letterSpacing:0},children:v}),_&&m.jsx("div",{style:{fontSize:Z?"10px":"12px",color:ei,marginTop:"2px"},children:to})]})]}),pe&&(!Z||L)&&m.jsx("button",{type:"button",onClick:()=>fn(!1),"aria-label":"Minimize assistant",style:{width:36,height:36,padding:0,margin:0,minWidth:0,flexShrink:0,borderRadius:"8px",border:`1px solid ${Rn}`,background:Mt,color:ei,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(jd,{size:16,strokeWidth:1.5,style:{flexShrink:0},"aria-hidden":"true"})})]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:zt?"2px":Z?"6px":"16px",minHeight:0,flex:Z||pe?"1 1 0":void 0,overflow:Z||pe?"hidden":void 0,overscrollBehavior:"contain",padding:Ye?Z?"4px":"8px":Z?"8px":"20px",justifyContent:pe?void 0:"center",background:Fo},children:[Vi("default"),Lt&&xl(Z),!Ye&&m.jsxs(m.Fragment,{children:[Z&&!pe&&!zt&&m.jsx("div",{"aria-hidden":"true",style:{flex:"1 1 auto",minHeight:0}}),Z&&!pe&&ge&&I&&ot.length===0&&m.jsx("div",{style:{fontSize:15,fontWeight:600,textAlign:"center"},children:$e}),Qi(Z)]}),(Ye||!Z||pe||A)&&m.jsx(eh,{value:vn,onChange:Vr,open:Ye&&Xt&&!me,onOpenChange:Ye?Dt:Lh,suggestions:Bt.slice(0,Pe),registerSuggestion:Sr,loading:qe,analyzing:no,compact:Z,expanded:pe,showLogo:!pe,suggestionPlacement:se,logoUrl:M,title:v,placeholder:oe,colors:{accent:yt,accentText:Bn,surface:ma,text:Tt,muted:Hn,border:tn},onStop:gr,onSend:()=>{hn.current=null,er.current=!1,fn(!0),y==="floating"&&rr(!0),Cr(vn)},onSuggestion:Vn=>{fn(!0),y==="floating"&&rr(!0),br(Vn)}}),pe&&Ui("default",Z),!pe&&V==="always"&&bl(Z)]})]})};const D={position:"fixed",inset:0,background:gl,backdropFilter:"blur(2px)",zIndex:2147483e3};return y==="inline"?Fe?m.jsxs("div",{ref:Oi,className:"admesh-component","data-admesh-theme":Je,"data-admesh-surface":"ad-slot","data-admesh-ad-slot-behavior":C,"data-admesh-ad-slot-expanded":Ka?"true":"false",style:{width:wn,height:tr,maxWidth:wn,maxHeight:tr,position:"relative",overflow:"hidden"},children:[R(!1),Xr&&typeof document<"u"&&p(R(!0))]}):m.jsxs("div",{className:"admesh-component","data-admesh-theme":Je,style:{width:"100%",position:"relative"},children:[R(!1),me&&typeof document<"u"&&p(R(!0))]}):Io?m.jsxs("div",{className:"admesh-component","data-admesh-theme":Je,children:[!me&&m.jsx("div",{style:{position:"fixed",...kn,zIndex:2147483001},children:R(!1)}),me&&typeof document<"u"&&p(R(!0))]}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,children:m.jsxs("button",{type:"button",onClick:ua,style:{position:"fixed",...kn,zIndex:2147483e3,border:"none",borderRadius:"6px",background:K.primaryColor,color:Bn,display:"flex",alignItems:"center",gap:"8px",fontSize:"13px",fontWeight:600,padding:"12px 16px",boxShadow:"0 4px 16px rgba(15, 23, 42, 0.12)",cursor:"pointer"},children:[m.jsx(tl,{size:16,strokeWidth:1.5,"aria-hidden":"true"}),c]})})}return Bt.length===0&&!no?(console.log("[AdMeshIntentAssistant] No suggestions available - not rendering"),null):y==="inline"?m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,children:m.jsx("div",{className:`overflow-hidden rounded-[2rem] ${l||""}`,style:{width:Ua(U)??"100%",backgroundColor:"#eef2ff",fontSize:et.base,...d},children:m.jsxs("div",{className:"space-y-4 rounded-[1.75rem] p-4",style:{backgroundColor:"rgba(255, 255, 255, 0.35)"},children:[no?ti("legacy"):Bt.length>0&&m.jsx("div",{className:"flex flex-col gap-3",children:Bt.slice(0,Pe).map((p,R)=>m.jsxs("button",{ref:Sr(p.id),onClick:()=>br(p),className:"rounded-full px-5 py-4 text-left shadow-sm transition-transform duration-200 hover:scale-[1.01] active:scale-[0.99]",style:{width:R===0?"100%":R===1?"82%":"68%",backgroundColor:K.surfaceColor||"#ffffff",color:K.textColor||"#1e293b",border:`1px solid ${K.borderColor||"#e2e8f0"}`,fontSize:et.sm},children:[m.jsx("span",{className:"leading-tight",children:p.text}),ue&&p.is_sponsored&&m.jsx("sup",{className:"ml-1 rounded-full px-1.5 py-0.5",style:{backgroundColor:K.backgroundColor||"#ffffff",color:K.textSecondaryColor||"#64748b",fontSize:"9px",lineHeight:1},children:"Ad"})]},p.id))}),ot.length>0&&m.jsxs("div",{ref:jn,className:"max-h-[280px] space-y-3 overflow-y-auto rounded-[1.5rem] bg-white/80 p-4",style:{color:K.textColor,overscrollBehavior:"contain",WebkitOverflowScrolling:"touch"},children:[ot.map(p=>{const R=p.role==="user"&&p.id===Ht.current;return m.jsx("div",{ref:R?Ct:void 0,className:p.role==="user"?"text-right":"text-left",children:m.jsx("div",{className:"inline-block max-w-[85%] rounded-2xl px-4 py-3",style:{backgroundColor:p.role==="user"?K.primaryColor:"#ffffff",color:p.role==="user"?K.primaryTextColor||"#ffffff":K.textColor,fontSize:et.sm},children:p.role==="assistant"?p.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx(il,{content:p.content,theme:K,fontSize:et.sm}),pa(p,{accentColor:K.primaryColor,metaColor:K.textSecondaryColor})]}):qe&&p.id===It.current?eo({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,lineHeight:"1.4"},children:p.content})})},p.id)}),qe&&!ot.some(p=>p.role==="assistant"&&p.id===It.current&&!p.content.trim())&&m.jsx("div",{className:"text-sm",style:{color:K.textSecondaryColor},children:eo({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1})}),Ur&&m.jsx("div",{className:"text-sm",style:{color:K.textSecondaryColor},children:"Connection issue. Please try again."}),m.jsx("div",{ref:aa})]}),m.jsx("div",{className:"rounded-[1.5rem] bg-white p-3 shadow-sm",children:m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("input",{type:"text",value:vn,onChange:p=>Vr(p.target.value),onKeyPress:p=>{if(p.key==="Enter"){if(qe){p.preventDefault();return}Cr(vn)}},placeholder:oe,className:"min-w-0 flex-1 rounded-full px-4 py-3 focus:outline-none",style:{backgroundColor:K.backgroundColor||"#ffffff",color:K.textColor,fontSize:et.sm}}),m.jsx("button",{onClick:()=>{if(qe){gr();return}Cr(vn)},disabled:!qe&&!vn.trim(),className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:qe?"#dc2626":K.primaryColor,color:"#ffffff"},children:qe?m.jsx(nl,{size:18}):m.jsx(Rd,{size:18})})]})}),m.jsxs("div",{className:"space-y-2 text-center",children:[m.jsxs("p",{style:{color:K.textSecondaryColor,fontSize:et.xs,fontWeight:600},children:["Powered by"," ",m.jsx("a",{href:"https://useadmesh.com",target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none",fontWeight:700},children:"AdMesh"})]}),m.jsx("p",{style:{color:K.textSecondaryColor,fontSize:et.xs,lineHeight:1.5},children:Er})]})]})})}):Io?m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,children:m.jsxs("div",{className:`flex flex-col overflow-hidden ${l||""}`,style:{position:"fixed",display:"flex",flexDirection:"column",...me?{top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(1040px, calc(100vw - 40px))",height:"min(84vh, 820px)",maxWidth:"1040px",maxHeight:"820px"}:{...kn,width:Ua(U)??da.width,height:Ua(ee)??da.height},backgroundColor:me?Fo:K.backgroundColor,zIndex:9999,fontSize:et.base,borderRadius:me?"20px":"16px",border:me?`1px solid ${Oo}`:"1px solid transparent",boxShadow:me?Ya:"0 20px 40px rgba(15, 23, 42, 0.12)",...d},children:[N&&m.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between p-4 border-b",style:{position:"sticky",top:0,zIndex:10,borderColor:me?Rn:"transparent",background:me?$o:K.backgroundColor,padding:me?"18px 20px":"16px"},children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("div",{style:{width:me?40:32,height:me?40:32,borderRadius:me?"14px":"10px",background:wt(Et,.08),color:yt,display:"flex",alignItems:"center",justifyContent:"center",fontSize:me?"15px":"13px",fontWeight:700,flexShrink:0,overflow:"hidden"},children:M?m.jsx("img",{src:M,alt:`${v||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:"#ffffff",padding:4}}):(v||"AA").slice(0,2).toUpperCase()}),(q||_&&me)&&m.jsxs("div",{children:[q&&m.jsx("div",{className:"font-medium",style:{color:K.textColor,fontSize:me?"20px":et.base,fontWeight:700,letterSpacing:me?"-0.02em":0},children:v}),_&&me&&m.jsx("div",{style:{color:ei,fontSize:"12px",marginTop:"2px"},children:to})]})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[!Fe&&m.jsx("button",{onClick:Hi,className:"transition-colors",title:me?"Minimize":"Expand",style:{width:me?36:28,height:me?36:28,borderRadius:me?"12px":"10px",border:`1px solid ${me?Rn:"transparent"}`,background:me?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:me?m.jsx(jd,{size:16,style:{color:K.textSecondaryColor}}):m.jsx(Jf,{size:16,style:{color:K.textSecondaryColor}})}),m.jsx("button",{onClick:Gr,className:"transition-colors",style:{width:me?36:28,height:me?36:28,borderRadius:me?"12px":"10px",border:`1px solid ${me?Rn:"transparent"}`,background:me?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(nl,{size:16,style:{color:K.textSecondaryColor}})})]})]}),m.jsxs("div",{ref:jn,className:"flex-1 min-h-0 overflow-y-auto p-4",style:{flex:"1 1 0%",minHeight:0,overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",padding:me?"20px":"16px"},children:[Vi("legacy"),ge&&ot.length===0&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg",children:m.jsx("p",{style:{color:K.textColor,margin:0,fontSize:et.sm},children:$e})})}),ot.map(p=>{const R=p.role==="user"&&p.id===Ht.current;return m.jsxs("div",{ref:R?Ct:void 0,className:"mb-3",children:[m.jsx("div",{className:p.role==="user"?"inline-block max-w-[85%] ml-auto":"max-w-[92%]",style:{backgroundColor:p.role==="user"?fl:"transparent",color:p.role==="user"?K.primaryTextColor||"#ffffff":K.textColor,border:"none",borderRadius:p.role==="user"?me?"14px":"12px":0,padding:p.role==="user"?me?"12px 14px":void 0:"2px 6px 2px 2px",boxShadow:"none"},children:p.role==="assistant"?p.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{fontSize:`calc(${et.sm} * 1.3)`,lineHeight:1.65},children:m.jsx(il,{content:p.content,theme:K,fontSize:`calc(${et.sm} * 1.3)`})}),pa(p,{accentColor:K.primaryColor,metaColor:K.textSecondaryColor})]}):qe&&p.id===It.current?eo({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,fontSize:et.sm,lineHeight:"1.4"},children:p.content})}),p.role==="assistant"&&!xn.has(p.id)&&m.jsx(Va,{messageId:p.id,query:p.userQuery,onFollowupDetected:en,onRecommendationsShown:(D,L)=>{hr(D,L,p.userQuery)},onError:D=>{console.error("[AdMeshIntentAssistant] Recommendations error:",D)}}),p.role==="assistant"&&xn.has(p.id)&&p.initialRecommendation&&!qe&&m.jsxs("div",{className:"mb-4",children:[m.jsx("div",{className:"text-xs text-gray-500 mb-2 font-semibold",children:"Sponsored Recommendation"}),m.jsx(Va,{messageId:p.id,query:p.userQuery,initialRecommendation:p.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(D,L)=>{hr(D,L,p.userQuery)},onError:D=>{console.error("[AdMeshIntentAssistant] Recommendations error:",D)}})]})]},p.id)}),qe&&!ot.some(p=>p.role==="assistant"&&p.id===It.current&&!p.content.trim())&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg",style:{backgroundColor:"transparent"},children:eo({compact:!0,accentColor:K.primaryColor,metaColor:K.textSecondaryColor,includeSteps:!1})})}),Ur&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg border",style:{backgroundColor:"transparent",borderColor:"transparent",color:K.textSecondaryColor},children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{style:{fontSize:et.xs},children:"\u26A0\uFE0F"}),m.jsx("span",{style:{fontSize:et.sm},children:"Connection issue. Please try again."})]})})}),m.jsx("div",{ref:aa})]}),ot.length===0&&no&&m.jsx("div",{className:"px-4 pb-2",children:ti("legacy")}),Bt.length>0&&ot.length===0&&!no&&m.jsx("div",{className:"px-4 pb-2",children:m.jsx("div",{className:"flex flex-col gap-2",children:Bt.slice(0,Pe).map(p=>m.jsxs("button",{ref:Sr(p.id),onClick:()=>br(p),className:"relative flex w-full items-center text-left transition-all duration-200",style:{backgroundColor:K.surfaceColor||"#f8fafc",color:K.textColor||"#1e293b",border:`1px solid ${K.borderColor||"#e2e8f0"}`,fontSize:et.sm,padding:"10px 12px",borderRadius:"999px",fontWeight:500},children:[m.jsx("span",{className:"leading-tight",children:p.text}),ue&&p.is_sponsored&&m.jsx("sup",{className:"absolute right-1 top-1 rounded-full px-1.5 py-0.5 tracking-wide",style:{fontSize:"9px",lineHeight:1,backgroundColor:K.backgroundColor||"#ffffff",color:K.textSecondaryColor||"#64748b"},children:"Ad"})]},p.id))})}),je&&!Me&&Zr.length===0&&m.jsx("div",{className:"px-4 pb-2",children:m.jsx("div",{className:"flex flex-col gap-2",children:m.jsxs("div",{className:"p-3 rounded-lg border",style:{backgroundColor:K.surfaceColor,borderColor:K.borderColor,color:K.textSecondaryColor},children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsx("span",{style:{fontSize:et.sm},children:"Intent analysis failed"}),m.jsx("button",{onClick:J,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:K.primaryColor,color:"#ffffff"},children:"Retry"})]}),m.jsx("span",{style:{fontSize:et.xs},children:je})]})})}),m.jsxs("div",{className:"p-3 border-t",style:{borderColor:me?Rn:"transparent",padding:me?"18px 20px":void 0,background:me?$o:void 0},children:[m.jsxs("div",{className:"flex gap-2",style:{alignItems:"center",border:`1px solid ${Rn}`,borderRadius:me?"16px":"12px",background:ma,boxShadow:me?hl:"none",padding:me?"8px 8px 8px 14px":void 0},children:[m.jsx("input",{type:"text",value:vn,onChange:p=>Vr(p.target.value),onKeyPress:p=>{if(p.key==="Enter"){if(qe){p.preventDefault();return}Cr(vn)}},placeholder:oe,className:"flex-1 px-3 py-2 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"transparent",borderColor:"transparent",color:K.textColor,fontSize:me?"15px":et.sm,"--tw-ring-color":K.primaryColor}}),m.jsx("button",{onClick:()=>{if(qe){gr();return}Cr(vn)},disabled:!qe&&!vn.trim(),className:"transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:qe?"#dc2626":K.primaryColor,color:"#ffffff",borderRadius:me?"12px":"10px",width:me?"46px":void 0,height:me?"46px":void 0,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:me?`0 10px 20px ${wt(Et,.18)}`:"none"},children:qe?m.jsx(nl,{size:14}):m.jsx(Rd,{size:14})})]}),Ui("legacy")]})]})}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Je,children:m.jsx("button",{onClick:ua,className:"flex items-center gap-2 px-4 py-3 rounded-full shadow-lg transition-all duration-200 hover:scale-105 active:scale-95",style:{position:"fixed",...kn,backgroundColor:K.primaryColor,color:"#ffffff",zIndex:9999,fontSize:et.base,...d},children:m.jsx("span",{className:"font-medium",children:c})})})};typeof globalThis<"u"&&typeof globalThis.process>"u"&&(globalThis.process={env:{NODE_ENV:"production",ADMESH_ENV:"production"}});const ll={"mobile-leaderboard":{width:320,height:100},"medium-rectangle":{width:300,height:250},leaderboard:{width:728,height:90},"half-page":{width:300,height:600},"large-rectangle":{width:336,height:280},skyscraper:{width:120,height:600},billboard:{width:970,height:250}},Kh={"mobile-leaderboard":"carousel","medium-rectangle":"carousel",leaderboard:"carousel","large-rectangle":"carousel",billboard:"carousel","half-page":"stacked",skyscraper:"stacked"},Xh={"mobile-leaderboard":!1,"medium-rectangle":!1,leaderboard:!1},Gh={"mobile-leaderboard":!1,leaderboard:!1},Zh={"mobile-leaderboard":!1,leaderboard:!1},Jh={"mobile-leaderboard":!1,leaderboard:!1},oc={"mobile-leaderboard":"expand",leaderboard:"expand"},ul={"half-page":"medium-rectangle","large-rectangle":"medium-rectangle",skyscraper:"medium-rectangle",billboard:"medium-rectangle",leaderboard:"mobile-leaderboard"},Yh=60*1e3,ac="admesh-publisher-assistant-embed-styles",ic=window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com";function eg(){if(document.getElementById(ac))return;const s=document.createElement("style");s.id=ac,s.textContent=`
1216
1226
  .admesh-publisher-assistant-root {
1217
1227
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
1218
1228
  line-height: 1.4;
@@ -1978,5 +1988,5 @@ ${te}`),A=A.replace(/\|\s*\|\s*(?=[A-Za-z0-9*])/g,`|
1978
1988
  font-size: 12px;
1979
1989
  }
1980
1990
  }
1981
- `,document.head.appendChild(s)}function Yh(s){return s?s.startsWith("/")?s:`/${s}`:"/"}function sc(s,l){const d=Yh(l.trim());if(d==="/")return s==="/";if(d.endsWith("/*")){const c=d.slice(0,-1);return s.startsWith(c)}return s===d}function eg(s,l){return l.page_rules_enabled?l.hide_on_paths.some(d=>sc(s,d))?!1:l.show_on_paths.length?l.show_on_paths.some(d=>sc(s,d)):!0:!0}function lc(){var s,l;if(typeof window>"u")return Number.POSITIVE_INFINITY;const d=[];typeof((s=window.visualViewport)==null?void 0:s.width)=="number"&&window.visualViewport.width>0&&d.push(window.visualViewport.width),(l=document.documentElement)!=null&&l.clientWidth&&document.documentElement.clientWidth>0&&d.push(document.documentElement.clientWidth),window.innerWidth>0&&d.push(window.innerWidth);try{window.parent&&window.parent!==window&&window.parent.innerWidth>0&&d.push(window.parent.innerWidth)}catch{}return d.length?Math.min(...d):window.innerWidth}function dl(){return lc()<768}function tg(s){if(!ul[s])return!1;const l=ll[s].width,d=lc();return d<l||d<768?!0:typeof window.matchMedia=="function"?window.matchMedia("(max-width: 767px)").matches:!1}function Qa(s){if(s)return tg(s)?ul[s]??s:s}function ng(s){const l=s.device_targeting||"all";if(l==="all")return!0;const d=dl();return l==="mobile_only"?d:l==="desktop_only"?!d:!0}async function rg(s,l){const d=await fetch(s,l);if(!d.ok)throw new Error(`Request failed: ${d.status}`);return d.json()}function og(){if(document.currentScript instanceof HTMLScriptElement)return document.currentScript.dataset.admeshProcessed="true",document.currentScript;const s=Array.from(document.querySelectorAll("script")).reverse().find(l=>l.src.includes("publisher-assistant.js")&&l.dataset.admeshProcessed!=="true");return s?(s.dataset.admeshProcessed="true",s):null}function ag(s){var l,d;const c=(l=s.dataset.agentDisplayId)==null?void 0:l.trim();if(c)return c;const v=(d=s.dataset.publisherId)==null?void 0:d.trim();if(v)return v}function uc(s){const l=s?.trim();if(!l)return;const d=Number(l.replace(/px$/i,""));if(!(!Number.isFinite(d)||d<=0))return Math.round(d)}function Fi(s){const l=s?.trim().toLowerCase();if(l){if(["1","true","yes","on"].includes(l))return!0;if(["0","false","no","off"].includes(l))return!1}}function ig(s){var l,d,c,v,I;const D=s.dataset.mode==="inline"||s.dataset.mode==="floating"?s.dataset.mode:void 0,q=s.dataset.size==="sm"||s.dataset.size==="md"||s.dataset.size==="lg"||s.dataset.size==="xl"?s.dataset.size:void 0,_=s.dataset.position==="bottom-left"||s.dataset.position==="top-right"||s.dataset.position==="top-left"||s.dataset.position==="bottom-right"?s.dataset.position:void 0,y=s.dataset.surface==="ad-slot"||s.dataset.surface==="page"?s.dataset.surface:s.dataset.adSlot==="true"||s.dataset.adServer==="true"?"ad-slot":void 0,B=(l=s.dataset.contextMode)==null?void 0:l.trim(),C=B==="page"||B==="ad-slot"||B==="auto"?B:void 0,W=s.dataset.suggestionStyle==="stacked"||s.dataset.suggestionStyle==="carousel"?s.dataset.suggestionStyle:void 0,M=s.dataset.behavior==="expand"||s.dataset.behavior==="sticky"?s.dataset.behavior:void 0,A=(d=s.dataset.slotType)==null?void 0:d.trim(),H=A&&A in ll?A:void 0;return{mode:D,position:_,size:q,surface:y??(H?"ad-slot":void 0),slotType:H,width:uc(s.dataset.width),height:uc(s.dataset.height),suggestionStyle:W,suggestionTrigger:s.dataset.suggestionTrigger==="input"?"input":"always",suggestionPlacement:s.dataset.suggestionPlacement==="above"?"above":"below",sponsoredCreativePlacement:s.dataset.sponsoredCreativePlacement==="below-input-container"?"below-input-container":"none",showHeader:Fi(s.dataset.showHeader),showAssistantName:Fi(s.dataset.showAssistantName),showAssistantLabel:Fi(s.dataset.showAssistantLabel),showWelcomeMessage:Fi(s.dataset.showWelcomeMessage),welcomeMessage:((c=s.dataset.welcomeMessage)==null?void 0:c.trim())||void 0,targetSelector:((v=s.dataset.targetSelector)==null?void 0:v.trim())||void 0,articleUrl:((I=s.dataset.articleUrl)==null?void 0:I.trim())||void 0,contextMode:C,behavior:M}}function cl(){try{return window.self!==window.top}catch{return!0}}function pl(s){return`admesh:publisher-assistant:country-block:${encodeURIComponent(s)}`}function sg(s){try{const l=window.localStorage.getItem(pl(s));if(!l)return null;const d=JSON.parse(l);return typeof d.expiresAt!="number"||d.expiresAt<=Date.now()?(window.localStorage.removeItem(pl(s)),null):{expiresAt:d.expiresAt,reason:typeof d.reason=="string"?d.reason:"country_not_allowed",country:typeof d.country=="string"?d.country:null}}catch{return null}}function lg(s,l){if(l.reason==="country_not_allowed")try{const d={expiresAt:Date.now()+Zh,reason:"country_not_allowed",country:l.country||null};window.localStorage.setItem(pl(s),JSON.stringify(d))}catch{}}function ug(s,l){const d=Qa(l?.slotType);if(d){const _=ll[d];return{width:_.width,height:_.height}}const c=s instanceof HTMLElement?s.getBoundingClientRect():null,v=cl()?window.innerWidth:void 0,I=cl()?window.innerHeight:void 0,D=l?.width||v||(c!=null&&c.width?Math.round(c.width):void 0),q=l?.height||I||(c!=null&&c.height?Math.round(c.height):void 0);return{width:D&&D>0?D:void 0,height:q&&q>0?q:void 0}}function dg(s){return{width:s!=null&&s.width&&s.width>0?s.width:void 0,height:s!=null&&s.height&&s.height>0?s.height:void 0}}function cg(s,l){if(s.suggestionStyle)return s.suggestionStyle;const d=Qa(s.slotType);return d?Qh[d]??"carousel":l.suggestion_style||"carousel"}function pg(s,l){return s&&oc[s]?oc[s]:l||"expand"}function mg(s){try{const l=new URL(s).pathname.split("/").filter(Boolean),d=l[l.length-1]||"publisher-assistant";return`session_${Date.now()}_${d.replace(/[^a-zA-Z0-9_-]/g,"-")}`}catch{return`session_${Date.now()}_publisher-assistant`}}function dc(s){const l=s?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return!!(d.protocol&&d.hostname)}catch{return!1}}function fg(){var s;try{const l=(s=window.location.href)==null?void 0:s.trim();if(dc(l))return l}catch{return}}function hg(s,l){const d=fg();if(d)return d;const c=l?.trim();if(dc(c))return c;if(s!=="ad-slot")return window.location.href}function gg(s){return{mode:"light",primaryColor:s.send_button_background_color,secondaryColor:s.meta_text_color,backgroundColor:s.input_background_color,surfaceColor:"#ffffff",borderColor:"rgba(17, 24, 39, 0.08)",textColor:s.input_text_color,textSecondaryColor:s.meta_text_color,primaryTextColor:s.send_button_text_color,borderRadius:"24px",spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},shadows:{small:"0 1px 2px rgba(15, 23, 42, 0.06)",medium:"0 8px 22px rgba(15, 23, 42, 0.08)",large:"0 24px 60px rgba(15, 23, 42, 0.16)"}}}function bg({config:s,runtimeApiKey:l,sessionId:d,mode:c,floatingPosition:v,size:I,surface:D,panelWidth:q,panelHeight:_,suggestionStyle:y,suggestionTrigger:B,suggestionPlacement:C,sponsoredCreativePlacement:W,showHeader:M,showAssistantName:A,showAssistantLabel:H,showWelcomeMessage:U,welcomeMessage:ee,articleUrl:te,contextMode:re,agentDisplayId:ne,adSlotBehavior:ie,showCompactSlotHeader:Q,showCompactWelcomeMessage:O,showCompactSlotInput:fe,showCompactSlotDisclaimer:le}){const ge=re||(D==="ad-slot"?"ad-slot":"auto");return gd.createElement(Qd,{apiKey:l,sessionId:d,apiBaseUrl:ic,theme:gg(s),articleUrl:te,contextMode:ge,agentDisplayId:ne},gd.createElement(Uh,{variant:"default",layout:c,surface:D,adSlotBehavior:ie,showCompactSlotHeader:Q,showCompactWelcomeMessage:O,showCompactSlotInput:fe,showCompactSlotDisclaimer:le,position:v,size:I,panelWidth:q,panelHeight:_,analyticsPageUrl:hg(D,te),suggestionStyle:y??"carousel",suggestionTrigger:B??"always",suggestionPlacement:C??"below",sponsoredCreativePlacement:W??"none",headerTitle:s.assistant_name,headerLogoUrl:s.logo_url,showHeader:M??!0,showHeaderTitle:A??s.show_assistant_name!==!1,showSubtitle:H??s.show_assistant_label!==!1,triggerLabel:s.assistant_name,placeholder:s.input_placeholder,disclaimerText:s.disclaimer_text,poweredByLabel:"Powered by AdMesh",subtitle:H??s.show_assistant_label!==!1?"Publisher Assistant":"",adsEnabled:s.ads_enabled,showWelcomeMessage:U===!0,welcomeMessage:ee||s.welcome_description}))}function yg(s,l,d){d.width&&(s.style.width=`${d.width}px`,s.style.maxWidth=dl()?"100%":""),d.height&&(s.style.height=`${d.height}px`),l&&(d.width&&(l.style.width=`${d.width}px`,l.style.maxWidth=dl()?"100%":""),d.height&&(l.style.height=`${d.height}px`),l.style.boxSizing="border-box")}function cc(s){const l=s.overrides.slotType,d=Qa(l),c=s.mode==="inline"&&s.targetSelector?document.querySelector(s.targetSelector):null;let v=dg(s.overrides);s.surface==="ad-slot"&&(v=ug(c,s.overrides)),s.mountNode.dataset.admeshRawSlotType=l??"",s.mountNode.dataset.admeshEffectiveSlotType=d??"",yg(s.mountNode,c instanceof HTMLElement?c:null,v),s.reactRoot.render(bg({config:s.config,runtimeApiKey:s.runtimeApiKey,sessionId:s.sessionId,mode:s.mode,floatingPosition:s.floatingPosition,size:s.size,surface:s.surface,panelWidth:v.width,panelHeight:v.height,suggestionStyle:cg(s.overrides,s.config),suggestionTrigger:s.overrides.suggestionTrigger,suggestionPlacement:s.overrides.suggestionPlacement,sponsoredCreativePlacement:s.overrides.sponsoredCreativePlacement,showHeader:s.overrides.showHeader,showAssistantName:s.overrides.showAssistantName,showAssistantLabel:s.overrides.showAssistantLabel,showWelcomeMessage:s.overrides.showWelcomeMessage,welcomeMessage:s.overrides.welcomeMessage,articleUrl:s.articleUrl,contextMode:s.contextMode,agentDisplayId:s.agentDisplayId,adSlotBehavior:s.surface==="ad-slot"?pg(l,s.overrides.behavior):void 0,showCompactSlotHeader:d?qh[d]??!0:!0,showCompactWelcomeMessage:d?Kh[d]??!0:!0,showCompactSlotInput:d?Xh[d]??!0:!0,showCompactSlotDisclaimer:d?Gh[d]??!0:!0}))}function vg(s){var l,d;const c=s.overrides.slotType;if(!c||!ul[c])return;let v=Qa(c);const I=()=>{const D=Qa(c);D!==v&&(v=D,cc(s))};window.addEventListener("resize",I),(l=window.visualViewport)==null||l.addEventListener("resize",I),(d=window.visualViewport)==null||d.addEventListener("scroll",I)}async function xg(){var s,l;const d=og();if(!d){console.error("[AdMesh] Publisher assistant embed script could not find its script tag.");return}const c=ag(d);if(!c){console.error("[AdMesh] Missing required data-agent-display-id or data-publisher-id attribute.");return}const v=ig(d);try{const I=sg(c);if(I){console.warn(`[AdMesh] Publisher assistant is not ready for publisher ${c}: ${I.reason}`);return}const D=await rg(`${ic}/publisher-assistant/public/${encodeURIComponent(c)}/config`),q=D.config;if(D.ready===!1)if(D.reason==="missing_inline_target_selector"&&v.targetSelector)console.warn(`[AdMesh] Publisher assistant config is missing an inline target selector; using script override ${v.targetSelector}.`);else{console.warn(`[AdMesh] Publisher assistant is not ready for publisher ${c}: ${D.reason||"unknown_reason"}`),lg(c,D);return}const _=v.mode||q.deployment_mode||"inline",y=v.position||q.floating_position,B=v.surface||(_==="inline"&&cl()?"ad-slot":"page"),C=v.contextMode||(B==="ad-slot"?"ad-slot":"auto"),W=v.articleUrl,M=v.targetSelector||((s=q.inline_target_selector)==null?void 0:s.trim()),A=((l=D.runtime_api_key)==null?void 0:l.trim())||"";if(!eg(window.location.pathname,q)||!ng(q))return;if(!A){console.warn(`[AdMesh] No active publisher runtime API key found for ${c}.`);return}const H=_==="inline"&&M?document.querySelector(M):null;if(_==="inline"&&M&&!H){console.error(`[AdMesh] Inline target not found for selector: ${M}`);return}Jh();const U=mg(window.location.href),ee=v.size||"md",te=document.createElement("div");te.className="admesh-publisher-assistant-reactMount",te.dataset.admeshSurface=B;const re=Ed.createRoot(te),ne={script:d,mountNode:te,reactRoot:re,overrides:v,config:q,runtimeApiKey:A,sessionId:U,mode:_,floatingPosition:y,surface:B,contextMode:C,articleUrl:W,agentDisplayId:c,size:ee,targetSelector:M};if(cc(ne),vg(ne),_==="inline"){if(M){H?.appendChild(te);return}d.insertAdjacentElement("afterend",te);return}document.body.appendChild(te)}catch(I){console.error("[AdMesh] Failed to initialize publisher assistant.",I)}}xg()})();})();
1991
+ `,document.head.appendChild(s)}function tg(s){return s?s.startsWith("/")?s:`/${s}`:"/"}function sc(s,l){const d=tg(l.trim());if(d==="/")return s==="/";if(d.endsWith("/*")){const c=d.slice(0,-1);return s.startsWith(c)}return s===d}function ng(s,l){return l.page_rules_enabled?l.hide_on_paths.some(d=>sc(s,d))?!1:l.show_on_paths.length?l.show_on_paths.some(d=>sc(s,d)):!0:!0}function lc(){var s,l;if(typeof window>"u")return Number.POSITIVE_INFINITY;const d=[];typeof((s=window.visualViewport)==null?void 0:s.width)=="number"&&window.visualViewport.width>0&&d.push(window.visualViewport.width),(l=document.documentElement)!=null&&l.clientWidth&&document.documentElement.clientWidth>0&&d.push(document.documentElement.clientWidth),window.innerWidth>0&&d.push(window.innerWidth);try{window.parent&&window.parent!==window&&window.parent.innerWidth>0&&d.push(window.parent.innerWidth)}catch{}return d.length?Math.min(...d):window.innerWidth}function dl(){return lc()<768}function rg(s){if(!ul[s])return!1;const l=ll[s].width,d=lc();return d<l||d<768?!0:typeof window.matchMedia=="function"?window.matchMedia("(max-width: 767px)").matches:!1}function Qa(s){if(s)return rg(s)?ul[s]??s:s}function og(s){const l=s.device_targeting||"all";if(l==="all")return!0;const d=dl();return l==="mobile_only"?d:l==="desktop_only"?!d:!0}async function ag(s,l){const d=await fetch(s,l);if(!d.ok)throw new Error(`Request failed: ${d.status}`);return d.json()}function ig(){if(document.currentScript instanceof HTMLScriptElement)return document.currentScript.dataset.admeshProcessed="true",document.currentScript;const s=Array.from(document.querySelectorAll("script")).reverse().find(l=>l.src.includes("publisher-assistant.js")&&l.dataset.admeshProcessed!=="true");return s?(s.dataset.admeshProcessed="true",s):null}function sg(s){var l,d;const c=(l=s.dataset.agentDisplayId)==null?void 0:l.trim();if(c)return c;const v=(d=s.dataset.publisherId)==null?void 0:d.trim();if(v)return v}function uc(s){const l=s?.trim();if(!l)return;const d=Number(l.replace(/px$/i,""));if(!(!Number.isFinite(d)||d<=0))return Math.round(d)}function Fi(s){const l=s?.trim().toLowerCase();if(l){if(["1","true","yes","on"].includes(l))return!0;if(["0","false","no","off"].includes(l))return!1}}function lg(s){var l,d,c,v,M;const N=s.dataset.mode==="inline"||s.dataset.mode==="floating"?s.dataset.mode:void 0,q=s.dataset.size==="sm"||s.dataset.size==="md"||s.dataset.size==="lg"||s.dataset.size==="xl"?s.dataset.size:void 0,_=s.dataset.position==="bottom-left"||s.dataset.position==="top-right"||s.dataset.position==="top-left"||s.dataset.position==="bottom-right"?s.dataset.position:void 0,y=s.dataset.surface==="ad-slot"||s.dataset.surface==="page"?s.dataset.surface:s.dataset.adSlot==="true"||s.dataset.adServer==="true"?"ad-slot":void 0,B=(l=s.dataset.contextMode)==null?void 0:l.trim(),C=B==="page"||B==="ad-slot"||B==="auto"?B:void 0,W=s.dataset.suggestionStyle==="stacked"||s.dataset.suggestionStyle==="carousel"?s.dataset.suggestionStyle:void 0,I=s.dataset.behavior==="expand"||s.dataset.behavior==="sticky"?s.dataset.behavior:void 0,A=(d=s.dataset.slotType)==null?void 0:d.trim(),H=A&&A in ll?A:void 0;return{mode:N,position:_,size:q,surface:y??(H?"ad-slot":void 0),slotType:H,width:uc(s.dataset.width),height:uc(s.dataset.height),suggestionStyle:W,suggestionTrigger:s.dataset.suggestionTrigger==="input"?"input":"always",suggestionPlacement:s.dataset.suggestionPlacement==="above"?"above":"below",sponsoredCreativePlacement:s.dataset.sponsoredCreativePlacement==="below-input-container"?"below-input-container":"none",showHeader:Fi(s.dataset.showHeader),showAssistantName:Fi(s.dataset.showAssistantName),showAssistantLabel:Fi(s.dataset.showAssistantLabel),showWelcomeMessage:Fi(s.dataset.showWelcomeMessage),welcomeMessage:((c=s.dataset.welcomeMessage)==null?void 0:c.trim())||void 0,targetSelector:((v=s.dataset.targetSelector)==null?void 0:v.trim())||void 0,articleUrl:((M=s.dataset.articleUrl)==null?void 0:M.trim())||void 0,contextMode:C,behavior:I}}function cl(){try{return window.self!==window.top}catch{return!0}}function pl(s){return`admesh:publisher-assistant:country-block:${encodeURIComponent(s)}`}function ug(s){try{const l=window.localStorage.getItem(pl(s));if(!l)return null;const d=JSON.parse(l);return typeof d.expiresAt!="number"||d.expiresAt<=Date.now()?(window.localStorage.removeItem(pl(s)),null):{expiresAt:d.expiresAt,reason:typeof d.reason=="string"?d.reason:"country_not_allowed",country:typeof d.country=="string"?d.country:null}}catch{return null}}function dg(s,l){if(l.reason==="country_not_allowed")try{const d={expiresAt:Date.now()+Yh,reason:"country_not_allowed",country:l.country||null};window.localStorage.setItem(pl(s),JSON.stringify(d))}catch{}}function cg(s,l){const d=Qa(l?.slotType);if(d){const _=ll[d];return{width:_.width,height:_.height}}const c=s instanceof HTMLElement?s.getBoundingClientRect():null,v=cl()?window.innerWidth:void 0,M=cl()?window.innerHeight:void 0,N=l?.width||v||(c!=null&&c.width?Math.round(c.width):void 0),q=l?.height||M||(c!=null&&c.height?Math.round(c.height):void 0);return{width:N&&N>0?N:void 0,height:q&&q>0?q:void 0}}function pg(s){return{width:s!=null&&s.width&&s.width>0?s.width:void 0,height:s!=null&&s.height&&s.height>0?s.height:void 0}}function mg(s,l){if(s.suggestionStyle)return s.suggestionStyle;const d=Qa(s.slotType);return d?Kh[d]??"carousel":l.suggestion_style||"carousel"}function fg(s,l){return s&&oc[s]?oc[s]:l||"expand"}function hg(s){try{const l=new URL(s).pathname.split("/").filter(Boolean),d=l[l.length-1]||"publisher-assistant";return`session_${Date.now()}_${d.replace(/[^a-zA-Z0-9_-]/g,"-")}`}catch{return`session_${Date.now()}_publisher-assistant`}}function dc(s){const l=s?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const d=new URL(l);return!!(d.protocol&&d.hostname)}catch{return!1}}function gg(){var s;try{const l=(s=window.location.href)==null?void 0:s.trim();if(dc(l))return l}catch{return}}function bg(s,l){const d=gg();if(d)return d;const c=l?.trim();if(dc(c))return c;if(s!=="ad-slot")return window.location.href}function yg(s){return{mode:"light",primaryColor:s.send_button_background_color,secondaryColor:s.meta_text_color,backgroundColor:s.input_background_color,surfaceColor:"#ffffff",borderColor:"rgba(17, 24, 39, 0.08)",textColor:s.input_text_color,textSecondaryColor:s.meta_text_color,primaryTextColor:s.send_button_text_color,borderRadius:"24px",spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},shadows:{small:"0 1px 2px rgba(15, 23, 42, 0.06)",medium:"0 8px 22px rgba(15, 23, 42, 0.08)",large:"0 24px 60px rgba(15, 23, 42, 0.16)"}}}function vg({config:s,runtimeApiKey:l,sessionId:d,mode:c,floatingPosition:v,size:M,surface:N,panelWidth:q,panelHeight:_,suggestionStyle:y,suggestionTrigger:B,suggestionPlacement:C,sponsoredCreativePlacement:W,showHeader:I,showAssistantName:A,showAssistantLabel:H,showWelcomeMessage:U,welcomeMessage:ee,articleUrl:te,contextMode:re,agentDisplayId:ne,adSlotBehavior:ie,showCompactSlotHeader:Q,showCompactWelcomeMessage:O,showCompactSlotInput:fe,showCompactSlotDisclaimer:le}){const ge=re||(N==="ad-slot"?"ad-slot":"auto");return gd.createElement(Qd,{apiKey:l,sessionId:d,apiBaseUrl:ic,theme:yg(s),articleUrl:te,contextMode:ge,agentDisplayId:ne},gd.createElement(qh,{variant:"default",layout:c,surface:N,adSlotBehavior:ie,showCompactSlotHeader:Q,showCompactWelcomeMessage:O,showCompactSlotInput:fe,showCompactSlotDisclaimer:le,position:v,size:M,panelWidth:q,panelHeight:_,analyticsPageUrl:bg(N,te),suggestionStyle:y??"carousel",suggestionTrigger:B??"always",suggestionPlacement:C??"below",sponsoredCreativePlacement:W??"none",headerTitle:s.assistant_name,headerLogoUrl:s.logo_url,showHeader:I??!0,showHeaderTitle:A??s.show_assistant_name!==!1,showSubtitle:H??s.show_assistant_label!==!1,triggerLabel:s.assistant_name,placeholder:s.input_placeholder,disclaimerText:s.disclaimer_text,poweredByLabel:"Powered by AdMesh",subtitle:H??s.show_assistant_label!==!1?"Publisher Assistant":"",adsEnabled:s.ads_enabled,showWelcomeMessage:U===!0,welcomeMessage:ee||s.welcome_description}))}function xg(s,l,d){d.width&&(s.style.width=`${d.width}px`,s.style.maxWidth=dl()?"100%":""),d.height&&(s.style.height=`${d.height}px`),l&&(d.width&&(l.style.width=`${d.width}px`,l.style.maxWidth=dl()?"100%":""),d.height&&(l.style.height=`${d.height}px`),l.style.boxSizing="border-box")}function cc(s){const l=s.overrides.slotType,d=Qa(l),c=s.mode==="inline"&&s.targetSelector?document.querySelector(s.targetSelector):null;let v=pg(s.overrides);s.surface==="ad-slot"&&(v=cg(c,s.overrides)),s.mountNode.dataset.admeshRawSlotType=l??"",s.mountNode.dataset.admeshEffectiveSlotType=d??"",xg(s.mountNode,c instanceof HTMLElement?c:null,v),s.reactRoot.render(vg({config:s.config,runtimeApiKey:s.runtimeApiKey,sessionId:s.sessionId,mode:s.mode,floatingPosition:s.floatingPosition,size:s.size,surface:s.surface,panelWidth:v.width,panelHeight:v.height,suggestionStyle:mg(s.overrides,s.config),suggestionTrigger:s.overrides.suggestionTrigger,suggestionPlacement:s.overrides.suggestionPlacement,sponsoredCreativePlacement:s.overrides.sponsoredCreativePlacement,showHeader:s.overrides.showHeader,showAssistantName:s.overrides.showAssistantName,showAssistantLabel:s.overrides.showAssistantLabel,showWelcomeMessage:s.overrides.showWelcomeMessage,welcomeMessage:s.overrides.welcomeMessage,articleUrl:s.articleUrl,contextMode:s.contextMode,agentDisplayId:s.agentDisplayId,adSlotBehavior:s.surface==="ad-slot"?fg(l,s.overrides.behavior):void 0,showCompactSlotHeader:d?Xh[d]??!0:!0,showCompactWelcomeMessage:d?Gh[d]??!0:!0,showCompactSlotInput:d?Zh[d]??!0:!0,showCompactSlotDisclaimer:d?Jh[d]??!0:!0}))}function wg(s){var l,d;const c=s.overrides.slotType;if(!c||!ul[c])return;let v=Qa(c);const M=()=>{const N=Qa(c);N!==v&&(v=N,cc(s))};window.addEventListener("resize",M),(l=window.visualViewport)==null||l.addEventListener("resize",M),(d=window.visualViewport)==null||d.addEventListener("scroll",M)}async function kg(){var s,l;const d=ig();if(!d){console.error("[AdMesh] Publisher assistant embed script could not find its script tag.");return}const c=sg(d);if(!c){console.error("[AdMesh] Missing required data-agent-display-id or data-publisher-id attribute.");return}const v=lg(d);try{const M=ug(c);if(M){console.warn(`[AdMesh] Publisher assistant is not ready for publisher ${c}: ${M.reason}`);return}const N=await ag(`${ic}/publisher-assistant/public/${encodeURIComponent(c)}/config`),q=N.config;if(N.ready===!1)if(N.reason==="missing_inline_target_selector"&&v.targetSelector)console.warn(`[AdMesh] Publisher assistant config is missing an inline target selector; using script override ${v.targetSelector}.`);else{console.warn(`[AdMesh] Publisher assistant is not ready for publisher ${c}: ${N.reason||"unknown_reason"}`),dg(c,N);return}const _=v.mode||q.deployment_mode||"inline",y=v.position||q.floating_position,B=v.surface||(_==="inline"&&cl()?"ad-slot":"page"),C=v.contextMode||(B==="ad-slot"?"ad-slot":"auto"),W=v.articleUrl,I=v.targetSelector||((s=q.inline_target_selector)==null?void 0:s.trim()),A=((l=N.runtime_api_key)==null?void 0:l.trim())||"";if(!ng(window.location.pathname,q)||!og(q))return;if(!A){console.warn(`[AdMesh] No active publisher runtime API key found for ${c}.`);return}const H=_==="inline"&&I?document.querySelector(I):null;if(_==="inline"&&I&&!H){console.error(`[AdMesh] Inline target not found for selector: ${I}`);return}eg();const U=hg(window.location.href),ee=v.size||"md",te=document.createElement("div");te.className="admesh-publisher-assistant-reactMount",te.dataset.admeshSurface=B;const re=Ed.createRoot(te),ne={script:d,mountNode:te,reactRoot:re,overrides:v,config:q,runtimeApiKey:A,sessionId:U,mode:_,floatingPosition:y,surface:B,contextMode:C,articleUrl:W,agentDisplayId:c,size:ee,targetSelector:I};if(cc(ne),wg(ne),_==="inline"){if(I){H?.appendChild(te);return}d.insertAdjacentElement("afterend",te);return}document.body.appendChild(te)}catch(M){console.error("[AdMesh] Failed to initialize publisher assistant.",M)}}kg()})();})();
1982
1992
  //# sourceMappingURL=publisher-assistant.js.map