admesh-ui-sdk 1.0.48 → 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.
- package/dist/brand-assistant.js +1226 -0
- package/dist/brand-assistant.js.map +1 -0
- package/dist/brandAssistantEmbed.d.ts +2 -0
- package/dist/brandAssistantEmbed.d.ts.map +1 -0
- package/dist/components/AdMeshIntentAssistant.d.ts +1 -0
- package/dist/components/AdMeshIntentAssistant.d.ts.map +1 -1
- package/dist/context/AdMeshProvider.d.ts +2 -0
- package/dist/context/AdMeshProvider.d.ts.map +1 -1
- package/dist/index.js +56 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2699 -2660
- package/dist/index.mjs.map +1 -1
- package/dist/publisher-assistant.js +66 -56
- package/dist/publisher-assistant.js.map +1 -1
- package/dist/sdk/AdMeshSDK.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,1226 @@
|
|
|
1
|
+
(()=>{var h0=Object.defineProperty,g0=(Wr,cr,Ao)=>cr in Wr?h0(Wr,cr,{enumerable:!0,configurable:!0,writable:!0,value:Ao}):Wr[cr]=Ao,qr=(Wr,cr,Ao)=>g0(Wr,typeof cr!="symbol"?cr+"":cr,Ao);(function(){"use strict";var Wr;function cr(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var Ao={exports:{}},Ie={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var uc;function xp(){if(uc)return Ie;uc=1;var u=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),L=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),W=Symbol.iterator;function N(p){return p===null||typeof p!="object"?null:(p=W&&p[W]||p["@@iterator"],typeof p=="function"?p:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H=Object.assign,V={};function ee(p,I,G){this.props=p,this.context=I,this.refs=V,this.updater=G||P}ee.prototype.isReactComponent={},ee.prototype.setState=function(p,I){if(typeof p!="object"&&typeof p!="function"&&p!=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,p,I,"setState")},ee.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function se(){}se.prototype=ee.prototype;function oe(p,I,G){this.props=p,this.context=I,this.refs=V,this.updater=G||P}var re=oe.prototype=new se;re.constructor=oe,H(re,ee.prototype),re.isPureReactComponent=!0;var ae=Array.isArray;function Q(){}var U={H:null,A:null,T:null,S:null},he=Object.prototype.hasOwnProperty;function ce(p,I,G){var Y=G.ref;return{$$typeof:u,type:p,key:I,ref:Y!==void 0?Y:null,props:G}}function ye(p,I){return ce(p.type,I,p.props)}function $e(p){return typeof p=="object"&&p!==null&&p.$$typeof===u}function te(p){var I={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(G){return I[G]})}var le=/\/+/g;function xe(p,I){return typeof p=="object"&&p!==null&&p.key!=null?te(""+p.key):I.toString(36)}function Pe(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(Q,Q):(p.status="pending",p.then(function(I){p.status==="pending"&&(p.status="fulfilled",p.value=I)},function(I){p.status==="pending"&&(p.status="rejected",p.reason=I)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function C(p,I,G,Y,_e){var ve=typeof p;(ve==="undefined"||ve==="boolean")&&(p=null);var Ae=!1;if(p===null)Ae=!0;else switch(ve){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(p.$$typeof){case u:case l:Ae=!0;break;case $:return Ae=p._init,C(Ae(p._payload),I,G,Y,_e)}}if(Ae)return _e=_e(p),Ae=Y===""?"."+xe(p,0):Y,ae(_e)?(G="",Ae!=null&&(G=Ae.replace(le,"$&/")+"/"),C(_e,I,G,"",function(je){return je})):_e!=null&&($e(_e)&&(_e=ye(_e,G+(_e.key==null||p&&p.key===_e.key?"":(""+_e.key).replace(le,"$&/")+"/")+Ae)),I.push(_e)),1;Ae=0;var Le=Y===""?".":Y+":";if(ae(p))for(var Ne=0;Ne<p.length;Ne++)Y=p[Ne],ve=Le+xe(Y,Ne),Ae+=C(Y,I,G,ve,_e);else if(Ne=N(p),typeof Ne=="function")for(p=Ne.call(p),Ne=0;!(Y=p.next()).done;)Y=Y.value,ve=Le+xe(Y,Ne++),Ae+=C(Y,I,G,ve,_e);else if(ve==="object"){if(typeof p.then=="function")return C(Pe(p),I,G,Y,_e);throw I=String(p),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function q(p,I,G){if(p==null)return p;var Y=[],_e=0;return C(p,Y,"","",function(ve){return I.call(G,ve,_e++)}),Y}function ie(p){if(p._status===-1){var I=p._result;I=I(),I.then(function(G){(p._status===0||p._status===-1)&&(p._status=1,p._result=G)},function(G){(p._status===0||p._status===-1)&&(p._status=2,p._result=G)}),p._status===-1&&(p._status=0,p._result=I)}if(p._status===1)return p._result.default;throw p._result}var ke=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof p=="object"&&p!==null&&typeof p.message=="string"?String(p.message):String(p),error:p});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)},Ee={map:q,forEach:function(p,I,G){q(p,function(){I.apply(this,arguments)},G)},count:function(p){var I=0;return q(p,function(){I++}),I},toArray:function(p){return q(p,function(I){return I})||[]},only:function(p){if(!$e(p))throw Error("React.Children.only expected to receive a single React element child.");return p}};return Ie.Activity=E,Ie.Children=Ee,Ie.Component=ee,Ie.Fragment=f,Ie.Profiler=k,Ie.PureComponent=oe,Ie.StrictMode=d,Ie.Suspense=S,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(p){return U.H.useMemoCache(p)}},Ie.cache=function(p){return function(){return p.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(p,I,G){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var Y=H({},p.props),_e=p.key;if(I!=null)for(ve in I.key!==void 0&&(_e=""+I.key),I)!he.call(I,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&I.ref===void 0||(Y[ve]=I[ve]);var ve=arguments.length-2;if(ve===1)Y.children=G;else if(1<ve){for(var Ae=Array(ve),Le=0;Le<ve;Le++)Ae[Le]=arguments[Le+2];Y.children=Ae}return ce(p.type,_e,Y)},Ie.createContext=function(p){return p={$$typeof:L,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null},p.Provider=p,p.Consumer={$$typeof:M,_context:p},p},Ie.createElement=function(p,I,G){var Y,_e={},ve=null;if(I!=null)for(Y in I.key!==void 0&&(ve=""+I.key),I)he.call(I,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(_e[Y]=I[Y]);var Ae=arguments.length-2;if(Ae===1)_e.children=G;else if(1<Ae){for(var Le=Array(Ae),Ne=0;Ne<Ae;Ne++)Le[Ne]=arguments[Ne+2];_e.children=Le}if(p&&p.defaultProps)for(Y in Ae=p.defaultProps,Ae)_e[Y]===void 0&&(_e[Y]=Ae[Y]);return ce(p,ve,_e)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(p){return{$$typeof:X,render:p}},Ie.isValidElement=$e,Ie.lazy=function(p){return{$$typeof:$,_payload:{_status:-1,_result:p},_init:ie}},Ie.memo=function(p,I){return{$$typeof:y,type:p,compare:I===void 0?null:I}},Ie.startTransition=function(p){var I=U.T,G={};U.T=G;try{var Y=p(),_e=U.S;_e!==null&&_e(G,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(Q,ke)}catch(ve){ke(ve)}finally{I!==null&&G.types!==null&&(I.types=G.types),U.T=I}},Ie.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Ie.use=function(p){return U.H.use(p)},Ie.useActionState=function(p,I,G){return U.H.useActionState(p,I,G)},Ie.useCallback=function(p,I){return U.H.useCallback(p,I)},Ie.useContext=function(p){return U.H.useContext(p)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(p,I){return U.H.useDeferredValue(p,I)},Ie.useEffect=function(p,I){return U.H.useEffect(p,I)},Ie.useEffectEvent=function(p){return U.H.useEffectEvent(p)},Ie.useId=function(){return U.H.useId()},Ie.useImperativeHandle=function(p,I,G){return U.H.useImperativeHandle(p,I,G)},Ie.useInsertionEffect=function(p,I){return U.H.useInsertionEffect(p,I)},Ie.useLayoutEffect=function(p,I){return U.H.useLayoutEffect(p,I)},Ie.useMemo=function(p,I){return U.H.useMemo(p,I)},Ie.useOptimistic=function(p,I){return U.H.useOptimistic(p,I)},Ie.useReducer=function(p,I,G){return U.H.useReducer(p,I,G)},Ie.useRef=function(p){return U.H.useRef(p)},Ie.useState=function(p){return U.H.useState(p)},Ie.useSyncExternalStore=function(p,I,G){return U.H.useSyncExternalStore(p,I,G)},Ie.useTransition=function(){return U.H.useTransition()},Ie.version="19.2.1",Ie}var cc;function Gl(){return cc||(cc=1,Ao.exports=xp()),Ao.exports}var b=Gl();const Jl=cr(b);var Zl={exports:{}},qa={},dc={exports:{}},mc={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* scheduler.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var fc;function wp(){return fc||(fc=1,(function(u){function l(C,q){var ie=C.length;C.push(q);e:for(;0<ie;){var ke=ie-1>>>1,Ee=C[ke];if(0<k(Ee,q))C[ke]=q,C[ie]=Ee,ie=ke;else break e}}function f(C){return C.length===0?null:C[0]}function d(C){if(C.length===0)return null;var q=C[0],ie=C.pop();if(ie!==q){C[0]=ie;e:for(var ke=0,Ee=C.length,p=Ee>>>1;ke<p;){var I=2*(ke+1)-1,G=C[I],Y=I+1,_e=C[Y];if(0>k(G,ie))Y<Ee&&0>k(_e,G)?(C[ke]=_e,C[Y]=ie,ke=Y):(C[ke]=G,C[I]=ie,ke=I);else if(Y<Ee&&0>k(_e,ie))C[ke]=_e,C[Y]=ie,ke=Y;else break e}}return q}function k(C,q){var ie=C.sortIndex-q.sortIndex;return ie!==0?ie:C.id-q.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var M=performance;u.unstable_now=function(){return M.now()}}else{var L=Date,X=L.now();u.unstable_now=function(){return L.now()-X}}var S=[],y=[],$=1,E=null,W=3,N=!1,P=!1,H=!1,V=!1,ee=typeof setTimeout=="function"?setTimeout:null,se=typeof clearTimeout=="function"?clearTimeout:null,oe=typeof setImmediate<"u"?setImmediate:null;function re(C){for(var q=f(y);q!==null;){if(q.callback===null)d(y);else if(q.startTime<=C)d(y),q.sortIndex=q.expirationTime,l(S,q);else break;q=f(y)}}function ae(C){if(H=!1,re(C),!P)if(f(S)!==null)P=!0,Q||(Q=!0,te());else{var q=f(y);q!==null&&Pe(ae,q.startTime-C)}}var Q=!1,U=-1,he=5,ce=-1;function ye(){return V?!0:!(u.unstable_now()-ce<he)}function $e(){if(V=!1,Q){var C=u.unstable_now();ce=C;var q=!0;try{e:{P=!1,H&&(H=!1,se(U),U=-1),N=!0;var ie=W;try{t:{for(re(C),E=f(S);E!==null&&!(E.expirationTime>C&&ye());){var ke=E.callback;if(typeof ke=="function"){E.callback=null,W=E.priorityLevel;var Ee=ke(E.expirationTime<=C);if(C=u.unstable_now(),typeof Ee=="function"){E.callback=Ee,re(C),q=!0;break t}E===f(S)&&d(S),re(C)}else d(S);E=f(S)}if(E!==null)q=!0;else{var p=f(y);p!==null&&Pe(ae,p.startTime-C),q=!1}}break e}finally{E=null,W=ie,N=!1}q=void 0}}finally{q?te():Q=!1}}}var te;if(typeof oe=="function")te=function(){oe($e)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,xe=le.port2;le.port1.onmessage=$e,te=function(){xe.postMessage(null)}}else te=function(){ee($e,0)};function Pe(C,q){U=ee(function(){C(u.unstable_now())},q)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(C){C.callback=null},u.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):he=0<C?Math.floor(1e3/C):5},u.unstable_getCurrentPriorityLevel=function(){return W},u.unstable_next=function(C){switch(W){case 1:case 2:case 3:var q=3;break;default:q=W}var ie=W;W=q;try{return C()}finally{W=ie}},u.unstable_requestPaint=function(){V=!0},u.unstable_runWithPriority=function(C,q){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var ie=W;W=C;try{return q()}finally{W=ie}},u.unstable_scheduleCallback=function(C,q,ie){var ke=u.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?ke+ie:ke):ie=ke,C){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=ie+Ee,C={id:$++,callback:q,priorityLevel:C,startTime:ie,expirationTime:Ee,sortIndex:-1},ie>ke?(C.sortIndex=ie,l(y,C),f(S)===null&&C===f(y)&&(H?(se(U),U=-1):H=!0,Pe(ae,ie-ke))):(C.sortIndex=Ee,l(S,C),P||N||(P=!0,Q||(Q=!0,te()))),C},u.unstable_shouldYield=ye,u.unstable_wrapCallback=function(C){var q=W;return function(){var ie=W;W=q;try{return C.apply(this,arguments)}finally{W=ie}}}})(mc)),mc}var pc;function kp(){return pc||(pc=1,dc.exports=wp()),dc.exports}var Yl={exports:{}},sn={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react-dom.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var hc;function _p(){if(hc)return sn;hc=1;var u=Gl();function l(S){var y="https://react.dev/errors/"+S;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var $=2;$<arguments.length;$++)y+="&args[]="+encodeURIComponent(arguments[$])}return"Minified React error #"+S+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(){}var d={d:{f,r:function(){throw Error(l(522))},D:f,C:f,L:f,m:f,X:f,S:f,M:f},p:0,findDOMNode:null},k=Symbol.for("react.portal");function M(S,y,$){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:E==null?null:""+E,children:S,containerInfo:y,implementation:$}}var L=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function X(S,y){if(S==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,sn.createPortal=function(S,y){var $=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(S,y,null,$)},sn.flushSync=function(S){var y=L.T,$=d.p;try{if(L.T=null,d.p=2,S)return S()}finally{L.T=y,d.p=$,d.d.f()}},sn.preconnect=function(S,y){typeof S=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,d.d.C(S,y))},sn.prefetchDNS=function(S){typeof S=="string"&&d.d.D(S)},sn.preinit=function(S,y){if(typeof S=="string"&&y&&typeof y.as=="string"){var $=y.as,E=X($,y.crossOrigin),W=typeof y.integrity=="string"?y.integrity:void 0,N=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;$==="style"?d.d.S(S,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:E,integrity:W,fetchPriority:N}):$==="script"&&d.d.X(S,{crossOrigin:E,integrity:W,fetchPriority:N,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},sn.preinitModule=function(S,y){if(typeof S=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var $=X(y.as,y.crossOrigin);d.d.M(S,{crossOrigin:$,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&d.d.M(S)},sn.preload=function(S,y){if(typeof S=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var $=y.as,E=X($,y.crossOrigin);d.d.L(S,$,{crossOrigin:E,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})}},sn.preloadModule=function(S,y){if(typeof S=="string")if(y){var $=X(y.as,y.crossOrigin);d.d.m(S,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:$,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else d.d.m(S)},sn.requestFormReset=function(S){d.d.r(S)},sn.unstable_batchedUpdates=function(S,y){return S(y)},sn.useFormState=function(S,y,$){return L.H.useFormState(S,y,$)},sn.useFormStatus=function(){return L.H.useHostTransitionStatus()},sn.version="19.2.1",sn}var gc;function yc(){if(gc)return Yl.exports;gc=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(l){console.error(l)}}return u(),Yl.exports=_p(),Yl.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom-client.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var vc;function Sp(){if(vc)return qa;vc=1;var u=kp(),l=Gl(),f=yc();function d(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 k(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 L(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 X(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 S(e){if(M(e)!==e)throw Error(d(188))}function y(e){var t=e.alternate;if(!t){if(t=M(e),t===null)throw Error(d(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 S(o),e;if(a===r)return S(o),t;a=a.sibling}throw Error(d(188))}if(n.return!==r.return)n=o,r=a;else{for(var i=!1,s=o.child;s;){if(s===n){i=!0,n=o,r=a;break}if(s===r){i=!0,r=o,n=a;break}s=s.sibling}if(!i){for(s=a.child;s;){if(s===n){i=!0,n=a,r=o;break}if(s===r){i=!0,r=a,n=o;break}s=s.sibling}if(!i)throw Error(d(189))}}if(n.alternate!==r)throw Error(d(190))}if(n.tag!==3)throw Error(d(188));return n.stateNode.current===n?e:t}function $(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=$(e),t!==null)return t;e=e.sibling}return null}var E=Object.assign,W=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),oe=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),he=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),ye=Symbol.for("react.memo_cache_sentinel"),$e=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=$e&&e[$e]||e["@@iterator"],typeof e=="function"?e:null)}var le=Symbol.for("react.client.reference");function xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case H:return"Fragment";case ee:return"Profiler";case V:return"StrictMode";case ae:return"Suspense";case Q:return"SuspenseList";case ce:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case P:return"Portal";case oe:return e.displayName||"Context";case se:return(e._context.displayName||"Context")+".Consumer";case re:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case he:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var Pe=Array.isArray,C=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=f.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},ke=[],Ee=-1;function p(e){return{current:e}}function I(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=p(null),_e=p(null),ve=p(null),Ae=p(null);function Le(e,t){switch(G(ve,t),G(_e,e),G(Y,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Wf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Wf(t),e=Hf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}I(Y),G(Y,e)}function Ne(){I(Y),I(_e),I(ve)}function je(e){e.memoizedState!==null&&G(Ae,e);var t=Y.current,n=Hf(t,e.type);t!==n&&(G(_e,e),G(Y,n))}function We(e){_e.current===e&&(I(Y),I(_e)),Ae.current===e&&(I(Ae),zi._currentValue=ie)}var Bt,ne;function de(e){if(Bt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Bt=t&&t[1]||"",ne=-1<n.stack.indexOf(`
|
|
34
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
35
|
+
`+Bt+e+ne}var ge=!1;function Me(e,t){if(!e||ge)return"";ge=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(O,[])}catch(A){var _=A}Reflect.construct(e,[],O)}else{try{O.call()}catch(A){_=A}e.call(O.prototype)}}else{try{throw Error()}catch(A){_=A}(O=e())&&typeof O.catch=="function"&&O.catch(function(){})}}catch(A){if(A&&_&&typeof A.stack=="string")return[A.stack,_.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],s=a[1];if(i&&s){var h=i.split(`
|
|
36
|
+
`),w=s.split(`
|
|
37
|
+
`);for(o=r=0;r<h.length&&!h[r].includes("DetermineComponentFrameRoot");)r++;for(;o<w.length&&!w[o].includes("DetermineComponentFrameRoot");)o++;if(r===h.length||o===w.length)for(r=h.length-1,o=w.length-1;1<=r&&0<=o&&h[r]!==w[o];)o--;for(;1<=r&&0<=o;r--,o--)if(h[r]!==w[o]){if(r!==1||o!==1)do if(r--,o--,0>o||h[r]!==w[o]){var R=`
|
|
38
|
+
`+h[r].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),R}while(1<=r&&0<=o);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?de(n):""}function De(e,t){switch(e.tag){case 26:case 27:case 5:return de(e.type);case 16:return de("Lazy");case 13:return e.child!==t&&t!==null?de("Suspense Fallback"):de("Suspense");case 19:return de("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 de("Activity");default:return""}}function Z(e){try{var t="",n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
|
|
39
|
+
Error generating stack: `+r.message+`
|
|
40
|
+
`+r.stack}}var Oe=Object.prototype.hasOwnProperty,K=u.unstable_scheduleCallback,He=u.unstable_cancelCallback,Ge=u.unstable_shouldYield,B=u.unstable_requestPaint,Ze=u.unstable_now,Fe=u.unstable_getCurrentPriorityLevel,un=u.unstable_ImmediatePriority,it=u.unstable_UserBlockingPriority,Kt=u.unstable_NormalPriority,Mn=u.unstable_LowPriority,Ro=u.unstable_IdlePriority,bn=u.log,Hr=u.unstable_setDisableYieldValue,Xt=null,Nt=null;function ot(e){if(typeof bn=="function"&&Hr(e),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(Xt,e)}catch{}}var ft=Math.clz32?Math.clz32:Vr,Be=Math.log,cn=Math.LN2;function Vr(e){return e>>>=0,e===0?32:31-(Be(e)/cn|0)|0}var fn=256,fe=262144,pn=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 be(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 s=r&134217727;return s!==0?(r=s&~a,r!==0?o=xn(r):(i&=s,i!==0?o=xn(i):n||(n=s&~e,n!==0&&(o=xn(n))))):(s=r&~a,s!==0?o=xn(s):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 Zt(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=pn;return pn<<=1,(pn&62914560)===0&&(pn=4194304),e}function Yn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function dr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Do(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 s=e.entanglements,h=e.expirationTimes,w=e.hiddenUpdates;for(n=i&~n;0<n;){var R=31-ft(n),O=1<<R;s[R]=0,h[R]=-1;var _=w[R];if(_!==null)for(w[R]=null,R=0;R<_.length;R++){var A=_[R];A!==null&&(A.lane&=-536870913)}n&=~O}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-ft(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Fi(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ft(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}function zo(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=q.p;return e!==0?e:(e=window.event,e===void 0?32:fp(e.type))}function Br(e,t){var n=q.p;try{return q.p=e,t()}finally{q.p=n}}var Dn=Math.random().toString(36).slice(2),Ct="__reactFiber$"+Dn,qt="__reactProps$"+Dn,mr="__reactContainer$"+Dn,oa="__reactEvents$"+Dn,$i="__reactListeners$"+Dn,aa="__reactHandles$"+Dn,ia="__reactResources$"+Dn,kr="__reactMarker$"+Dn;function Qa(e){delete e[Ct],delete e[qt],delete e[oa],delete e[$i],delete e[aa]}function fr(e){var t=e[Ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mr]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Jf(e);e!==null;){if(n=e[Ct])return n;e=Jf(e)}return t}e=n,n=e.parentNode}return null}function Kr(e){if(e=e[Ct]||e[mr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(d(33))}function Rt(e){var t=e[ia];return t||(t=e[ia]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function jt(e){e[kr]=!0}var Yt=new Set,la={};function pr(e,t){_r(e,t),_r(e+"Capture",t)}function _r(e,t){for(la[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]*$"),No={},Oi={};function Ba(e){return Oe.call(Oi,e)?!0:Oe.call(No,e)?!1:Xr.test(e)?Oi[e]=!0:(No[e]=!0,!1)}function wn(e,t,n){if(Ba(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 Ka(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mn(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=Ka(e)?"checked":"value";e._valueTracker=mn(e,t,""+e[t])}}function yt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ka(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 Xa=/[\n"\\]/g;function en(e){return e.replace(Xa,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function sa(e,t,n,r,o,a,i,s){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"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+gn(s):e.removeAttribute("name")}function rr(e,t,n,r,o,a,i,s){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,s||t===e.value||(e.value=t),e.defaultValue=t}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=s?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 Ui(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 Ga(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(d(92));if(Pe(r)){if(1<r.length)throw Error(d(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 jo(e,t,n){if(t!=null&&typeof t!="object")throw Error(d(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 Jr(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 Wt=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"]]),Zr=/^[\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 yr(e){return Zr.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function kn(){}var ca=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[qt]||null;e:switch(e=t.stateNode,t.type){case"input":if(sa(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[qt]||null;if(!o)throw Error(d(90));sa(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&&yt(r)}break e;case"textarea":Ui(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Gr(e,!!n.multiple,t,!1)}}}var da=!1;function ma(e,t,n){if(da)return e(t,n);da=!0;try{var r=e(t);return r}finally{if(da=!1,(Er!==null||Yr!==null)&&(Il(),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[qt]||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(d(231,t,typeof n));return n}var Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wt=!1;if(Un)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 qn(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 qi(){return!1}function vt(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 s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?To:qi,this.isPropagationStopped=qi,this}return E(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 Wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lo=vt(Wn),to=E({},Wn,{view:0,detail:0}),no=vt(to),Fo,$o,zn,Oo=E({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:c,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!==zn&&(zn&&e.type==="mousemove"?(Fo=e.screenX-zn.screenX,$o=e.screenY-zn.screenY):$o=Fo=0,zn=e),Fo)},movementY:function(e){return"movementY"in e?e.movementY:$o}}),Za=vt(Oo),Ya=E({},Oo,{dataTransfer:0}),ss=vt(Ya),us=E({},to,{relatedTarget:0}),fa=vt(us),cs=E({},Wn,{animationName:0,elapsedTime:0,pseudoElement:0}),ds=vt(cs),Wi=E({},Wn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hi=vt(Wi),ei=E({},Wn,{data:0}),Vi=vt(ei),ms={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fs={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"},ps={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hs(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ps[e])?!!t[e]:!1}function c(){return hs}var D=E({},to,{key:function(e){if(e.key){var t=ms[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=qn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:c,charCode:function(e){return e.type==="keypress"?qn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?qn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),z=vt(D),T=E({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),J=vt(T),me=E({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:c}),Ye=vt(me),At=E({},Wn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lt=vt(At),Te=E({},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}),Ue=vt(Te),kt=E({},Wn,{newState:0,oldState:0}),Gt=vt(kt),Ht=[9,13,27,32],Vt=Un&&"CompositionEvent"in window,_n=null;Un&&"documentMode"in document&&(_n=document.documentMode);var Hn=Un&&"TextEvent"in window&&!_n,Ce=Un&&(!Vt||_n&&8<_n&&11>=_n),qe=" ",ht=!1;function lt(e,t){switch(e){case"keyup":return Ht.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,qe);case"textInput":return e=t.data,e===qe&&ht?null:e;default:return null}}function gt(e,t){if(St)return e==="compositionend"||!Vt&<(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 Yc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qi[e.type]:t==="textarea"}function ed(e,t,n,r){Er?Yr?Yr.push(r):Yr=[r]:Er=r,t=jl(t,"onChange"),0<t.length&&(n=new Lo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ti=null,ni=null;function qh(e){Lf(e,0)}function Bi(e){var t=dn(e);if(yt(t))return e}function td(e,t){if(e==="change")return t}var nd=!1;if(Un){var gs;if(Un){var ys="oninput"in document;if(!ys){var rd=document.createElement("div");rd.setAttribute("oninput","return;"),ys=typeof rd.oninput=="function"}gs=ys}else gs=!1;nd=gs&&(!document.documentMode||9<document.documentMode)}function od(){ti&&(ti.detachEvent("onpropertychange",ad),ni=ti=null)}function ad(e){if(e.propertyName==="value"&&Bi(ni)){var t=[];ed(t,ni,e,et(e)),ma(qh,t)}}function Wh(e,t,n){e==="focusin"?(od(),ti=t,ni=n,ti.attachEvent("onpropertychange",ad)):e==="focusout"&&od()}function Hh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bi(ni)}function Vh(e,t){if(e==="click")return Bi(t)}function Qh(e,t){if(e==="input"||e==="change")return Bi(t)}function Bh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nn=typeof Object.is=="function"?Object.is:Bh;function ri(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 id(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ld(e,t){var n=id(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=id(n)}}function sd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ud(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 vs(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 Kh=Un&&"documentMode"in document&&11>=document.documentMode,pa=null,bs=null,oi=null,xs=!1;function cd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xs||pa==null||pa!==hr(r)||(r=pa,"selectionStart"in r&&vs(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}),oi&&ri(oi,r)||(oi=r,r=jl(bs,"onSelect"),0<r.length&&(t=new Lo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=pa)))}function Uo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ha={animationend:Uo("Animation","AnimationEnd"),animationiteration:Uo("Animation","AnimationIteration"),animationstart:Uo("Animation","AnimationStart"),transitionrun:Uo("Transition","TransitionRun"),transitionstart:Uo("Transition","TransitionStart"),transitioncancel:Uo("Transition","TransitionCancel"),transitionend:Uo("Transition","TransitionEnd")},ws={},dd={};Un&&(dd=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 qo(e){if(ws[e])return ws[e];if(!ha[e])return e;var t=ha[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in dd)return ws[e]=t[n];return e}var md=qo("animationend"),fd=qo("animationiteration"),pd=qo("animationstart"),Xh=qo("transitionrun"),Gh=qo("transitionstart"),Jh=qo("transitioncancel"),hd=qo("transitionend"),gd=new Map,ks="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(" ");ks.push("scrollEnd");function ir(e,t){gd.set(e,t),pr(t,[e])}var Ki=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,_s=0;function Xi(){for(var e=ga,t=_s=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&&yd(n,o,a)}}function Gi(e,t,n,r){Vn[ga++]=e,Vn[ga++]=t,Vn[ga++]=n,Vn[ga++]=r,_s|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ss(e,t,n,r){return Gi(e,t,n,r),Ji(e)}function Wo(e,t){return Gi(e,null,null,t),Ji(e)}function yd(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-ft(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<Ei)throw Ei=0,zu=null,Error(d(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ya={};function Zh(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 jn(e,t,n,r){return new Zh(e,t,n,r)}function Cs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ar(e,t){var n=e.alternate;return n===null?(n=jn(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 vd(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 Zi(e,t,n,r,o,a){var i=0;if(r=e,typeof e=="function")Cs(e)&&(i=1);else if(typeof e=="string")i=r0(e,n,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ce:return e=jn(31,n,t,o),e.elementType=ce,e.lanes=a,e;case H:return Ho(n.children,o,a,t);case V:i=8,o|=24;break;case ee:return e=jn(12,n,t,o|2),e.elementType=ee,e.lanes=a,e;case ae:return e=jn(13,n,t,o),e.elementType=ae,e.lanes=a,e;case Q:return e=jn(19,n,t,o),e.elementType=Q,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case oe:i=10;break e;case se:i=9;break e;case re:i=11;break e;case U:i=14;break e;case he:i=16,r=null;break e}i=29,n=Error(d(130,e===null?"null":typeof e,"")),r=null}return t=jn(i,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Ho(e,t,n,r){return e=jn(7,e,r,t),e.lanes=n,e}function Es(e,t,n){return e=jn(6,e,null,t),e.lanes=n,e}function bd(e){var t=jn(18,null,null,0);return t.stateNode=e,t}function As(e,t,n){return t=jn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xd=new WeakMap;function Qn(e,t){if(typeof e=="object"&&e!==null){var n=xd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Z(t)},xd.set(e,t),t)}return{value:e,source:t,stack:Z(t)}}var va=[],ba=0,Yi=null,ai=0,Bn=[],Kn=0,ro=null,vr=1,br="";function Ir(e,t){va[ba++]=ai,va[ba++]=Yi,Yi=e,ai=t}function wd(e,t,n){Bn[Kn++]=vr,Bn[Kn++]=br,Bn[Kn++]=ro,ro=e;var r=vr;e=br;var o=32-ft(r)-1;r&=~(1<<o),n+=1;var a=32-ft(t)+o;if(30<a){var i=o-o%5;a=(r&(1<<i)-1).toString(32),r>>=i,o-=i,vr=1<<32-ft(t)+o|n<<o|r,br=a+e}else vr=1<<a|n<<o|r,br=e}function Is(e){e.return!==null&&(Ir(e,1),wd(e,1,0))}function Ps(e){for(;e===Yi;)Yi=va[--ba],va[ba]=null,ai=va[--ba],va[ba]=null;for(;e===ro;)ro=Bn[--Kn],Bn[Kn]=null,br=Bn[--Kn],Bn[Kn]=null,vr=Bn[--Kn],Bn[Kn]=null}function kd(e,t){Bn[Kn++]=vr,Bn[Kn++]=br,Bn[Kn++]=ro,vr=t.id,br=t.overflow,ro=e}var rn=null,bt=null,Je=!1,oo=null,Xn=!1,Rs=Error(d(519));function ao(e){var t=Error(d(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ii(Qn(t,e)),Rs}function _d(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[qt]=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<Ii.length;n++)Qe(Ii[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),Ga(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||Uf(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 Sd(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(!Je)return Sd(e),Je=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Ku(e.type,e.memoizedProps)),n=!n),n&&bt&&ao(e),Sd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));bt=Gf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));bt=Gf(e)}else t===27?(t=bt,xo(e.type)?(e=Yu,Yu=null,bt=e):bt=t):bt=rn?Gn(e.stateNode.nextSibling):null;return!0}function Vo(){bt=rn=null,Je=!1}function Ms(){var e=oo;return e!==null&&(In===null?In=e:In.push.apply(In,e),oo=null),e}function ii(e){oo===null?oo=[e]:oo.push(e)}var Ds=p(null),Qo=null,Pr=null;function io(e,t,n){G(Ds,t._currentValue),t._currentValue=n}function Rr(e){e._currentValue=Ds.current,I(Ds)}function zs(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 Ns(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 s=a;a=o;for(var h=0;h<t.length;h++)if(s.context===t[h]){a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),zs(a.return,n,e),r||(i=null);break e}a=s.next}}else if(o.tag===18){if(i=o.return,i===null)throw Error(d(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),zs(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(d(387));if(i=i.memoizedProps,i!==null){var s=o.type;Nn(o.pendingProps.value,i.value)||(e!==null?e.push(s):e=[s])}}else if(o===Ae.current){if(i=o.alternate,i===null)throw Error(d(387));i.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(zi):e=[zi])}o=o.return}e!==null&&Ns(t,e,n,r),t.flags|=262144}function el(e){for(e=e.firstContext;e!==null;){if(!Nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Bo(e){Qo=e,Pr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function on(e){return Cd(Qo,e)}function tl(e,t){return Qo===null&&Bo(e),Cd(e,t)}function Cd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pr===null){if(e===null)throw Error(d(308));Pr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pr=Pr.next=t;return n}var Yh=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()})}},eg=u.unstable_scheduleCallback,tg=u.unstable_NormalPriority,Ft={$$typeof:oe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function js(){return{controller:new Yh,data:new Map,refCount:0}}function li(e){e.refCount--,e.refCount===0&&eg(tg,function(){e.controller.abort()})}var si=null,Ts=0,ka=0,_a=null;function ng(e,t){if(si===null){var n=si=[];Ts=0,ka=$u(),_a={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Ts++,t.then(Ed,Ed),t}function Ed(){if(--Ts===0&&si!==null){_a!==null&&(_a.status="fulfilled");var e=si;si=null,ka=0,_a=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function rg(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 Ad=C.S;C.S=function(e,t){df=Ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ng(e,t),Ad!==null&&Ad(e,t)};var Ko=p(null);function Ls(){var e=Ko.current;return e!==null?e:pt.pooledCache}function nl(e,t){t===null?G(Ko,Ko.current):G(Ko,t.pool)}function Id(){var e=Ls();return e===null?null:{parent:Ft._currentValue,pool:e}}var Sa=Error(d(460)),Fs=Error(d(474)),rl=Error(d(542)),ol={then:function(){}};function Pd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Rd(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,Dd(e),e;default:if(typeof t.status=="string")t.then(kn,kn);else{if(e=pt,e!==null&&100<e.shellSuspendCounter)throw Error(d(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,Dd(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 Md(){if(Go===null)throw Error(d(459));var e=Go;return Go=null,e}function Dd(e){if(e===Sa||e===rl)throw Error(d(483))}var Ca=null,ui=0;function al(e){var t=ui;return ui+=1,Ca===null&&(Ca=[]),Rd(Ca,e,t)}function ci(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function il(e,t){throw t.$$typeof===W?Error(d(525)):(e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function zd(e){function t(v,g){if(e){var x=v.deletions;x===null?(v.deletions=[g],v.flags|=16):x.push(g)}}function n(v,g){if(!e)return null;for(;g!==null;)t(v,g),g=g.sibling;return null}function r(v){for(var g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function o(v,g){return v=Ar(v,g),v.index=0,v.sibling=null,v}function a(v,g,x){return v.index=x,e?(x=v.alternate,x!==null?(x=x.index,x<g?(v.flags|=67108866,g):x):(v.flags|=67108866,g)):(v.flags|=1048576,g)}function i(v){return e&&v.alternate===null&&(v.flags|=67108866),v}function s(v,g,x,j){return g===null||g.tag!==6?(g=Es(x,v.mode,j),g.return=v,g):(g=o(g,x),g.return=v,g)}function h(v,g,x,j){var we=x.type;return we===H?R(v,g,x.props.children,j,x.key):g!==null&&(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===he&&Xo(we)===g.type)?(g=o(g,x.props),ci(g,x),g.return=v,g):(g=Zi(x.type,x.key,x.props,null,v.mode,j),ci(g,x),g.return=v,g)}function w(v,g,x,j){return g===null||g.tag!==4||g.stateNode.containerInfo!==x.containerInfo||g.stateNode.implementation!==x.implementation?(g=As(x,v.mode,j),g.return=v,g):(g=o(g,x.children||[]),g.return=v,g)}function R(v,g,x,j,we){return g===null||g.tag!==7?(g=Ho(x,v.mode,j,we),g.return=v,g):(g=o(g,x),g.return=v,g)}function O(v,g,x){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Es(""+g,v.mode,x),g.return=v,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case N:return x=Zi(g.type,g.key,g.props,null,v.mode,x),ci(x,g),x.return=v,x;case P:return g=As(g,v.mode,x),g.return=v,g;case he:return g=Xo(g),O(v,g,x)}if(Pe(g)||te(g))return g=Ho(g,v.mode,x,null),g.return=v,g;if(typeof g.then=="function")return O(v,al(g),x);if(g.$$typeof===oe)return O(v,tl(v,g),x);il(v,g)}return null}function _(v,g,x,j){var we=g!==null?g.key:null;if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return we!==null?null:s(v,g,""+x,j);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case N:return x.key===we?h(v,g,x,j):null;case P:return x.key===we?w(v,g,x,j):null;case he:return x=Xo(x),_(v,g,x,j)}if(Pe(x)||te(x))return we!==null?null:R(v,g,x,j,null);if(typeof x.then=="function")return _(v,g,al(x),j);if(x.$$typeof===oe)return _(v,g,tl(v,x),j);il(v,x)}return null}function A(v,g,x,j,we){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return v=v.get(x)||null,s(g,v,""+j,we);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case N:return v=v.get(j.key===null?x:j.key)||null,h(g,v,j,we);case P:return v=v.get(j.key===null?x:j.key)||null,w(g,v,j,we);case he:return j=Xo(j),A(v,g,x,j,we)}if(Pe(j)||te(j))return v=v.get(x)||null,R(g,v,j,we,null);if(typeof j.then=="function")return A(v,g,x,al(j),we);if(j.$$typeof===oe)return A(v,g,x,tl(g,j),we);il(g,j)}return null}function ue(v,g,x,j){for(var we=null,nt=null,pe=g,ze=g=0,Xe=null;pe!==null&&ze<x.length;ze++){pe.index>ze?(Xe=pe,pe=null):Xe=pe.sibling;var rt=_(v,pe,x[ze],j);if(rt===null){pe===null&&(pe=Xe);break}e&&pe&&rt.alternate===null&&t(v,pe),g=a(rt,g,ze),nt===null?we=rt:nt.sibling=rt,nt=rt,pe=Xe}if(ze===x.length)return n(v,pe),Je&&Ir(v,ze),we;if(pe===null){for(;ze<x.length;ze++)pe=O(v,x[ze],j),pe!==null&&(g=a(pe,g,ze),nt===null?we=pe:nt.sibling=pe,nt=pe);return Je&&Ir(v,ze),we}for(pe=r(pe);ze<x.length;ze++)Xe=A(pe,v,ze,x[ze],j),Xe!==null&&(e&&Xe.alternate!==null&&pe.delete(Xe.key===null?ze:Xe.key),g=a(Xe,g,ze),nt===null?we=Xe:nt.sibling=Xe,nt=Xe);return e&&pe.forEach(function(Co){return t(v,Co)}),Je&&Ir(v,ze),we}function Se(v,g,x,j){if(x==null)throw Error(d(151));for(var we=null,nt=null,pe=g,ze=g=0,Xe=null,rt=x.next();pe!==null&&!rt.done;ze++,rt=x.next()){pe.index>ze?(Xe=pe,pe=null):Xe=pe.sibling;var Co=_(v,pe,rt.value,j);if(Co===null){pe===null&&(pe=Xe);break}e&&pe&&Co.alternate===null&&t(v,pe),g=a(Co,g,ze),nt===null?we=Co:nt.sibling=Co,nt=Co,pe=Xe}if(rt.done)return n(v,pe),Je&&Ir(v,ze),we;if(pe===null){for(;!rt.done;ze++,rt=x.next())rt=O(v,rt.value,j),rt!==null&&(g=a(rt,g,ze),nt===null?we=rt:nt.sibling=rt,nt=rt);return Je&&Ir(v,ze),we}for(pe=r(pe);!rt.done;ze++,rt=x.next())rt=A(pe,v,ze,rt.value,j),rt!==null&&(e&&rt.alternate!==null&&pe.delete(rt.key===null?ze:rt.key),g=a(rt,g,ze),nt===null?we=rt:nt.sibling=rt,nt=rt);return e&&pe.forEach(function(p0){return t(v,p0)}),Je&&Ir(v,ze),we}function mt(v,g,x,j){if(typeof x=="object"&&x!==null&&x.type===H&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case N:e:{for(var we=x.key;g!==null;){if(g.key===we){if(we=x.type,we===H){if(g.tag===7){n(v,g.sibling),j=o(g,x.props.children),j.return=v,v=j;break e}}else if(g.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===he&&Xo(we)===g.type){n(v,g.sibling),j=o(g,x.props),ci(j,x),j.return=v,v=j;break e}n(v,g);break}else t(v,g);g=g.sibling}x.type===H?(j=Ho(x.props.children,v.mode,j,x.key),j.return=v,v=j):(j=Zi(x.type,x.key,x.props,null,v.mode,j),ci(j,x),j.return=v,v=j)}return i(v);case P:e:{for(we=x.key;g!==null;){if(g.key===we)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){n(v,g.sibling),j=o(g,x.children||[]),j.return=v,v=j;break e}else{n(v,g);break}else t(v,g);g=g.sibling}j=As(x,v.mode,j),j.return=v,v=j}return i(v);case he:return x=Xo(x),mt(v,g,x,j)}if(Pe(x))return ue(v,g,x,j);if(te(x)){if(we=te(x),typeof we!="function")throw Error(d(150));return x=we.call(x),Se(v,g,x,j)}if(typeof x.then=="function")return mt(v,g,al(x),j);if(x.$$typeof===oe)return mt(v,g,tl(v,x),j);il(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,g!==null&&g.tag===6?(n(v,g.sibling),j=o(g,x),j.return=v,v=j):(n(v,g),j=Es(x,v.mode,j),j.return=v,v=j),i(v)):n(v,g)}return function(v,g,x,j){try{ui=0;var we=mt(v,g,x,j);return Ca=null,we}catch(pe){if(pe===Sa||pe===rl)throw pe;var nt=jn(29,pe,null,v.mode);return nt.lanes=j,nt.return=v,nt}finally{}}}var Jo=zd(!0),Nd=zd(!1),lo=!1;function $s(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Os(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 so(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),yd(e,null,n),t}return Gi(e,r,t,n),Ji(e)}function di(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,Fi(e,n)}}function Us(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 qs=!1;function mi(){if(qs){var e=_a;if(e!==null)throw e}}function fi(e,t,n,r){qs=!1;var o=e.updateQueue;lo=!1;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var h=s,w=h.next;h.next=null,i===null?a=w:i.next=w,i=h;var R=e.alternate;R!==null&&(R=R.updateQueue,s=R.lastBaseUpdate,s!==i&&(s===null?R.firstBaseUpdate=w:s.next=w,R.lastBaseUpdate=h))}if(a!==null){var O=o.baseState;i=0,R=w=h=null,s=a;do{var _=s.lane&-536870913,A=_!==s.lane;if(A?(Ke&_)===_:(r&_)===_){_!==0&&_===ka&&(qs=!0),R!==null&&(R=R.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var ue=e,Se=s;_=t;var mt=n;switch(Se.tag){case 1:if(ue=Se.payload,typeof ue=="function"){O=ue.call(mt,O,_);break e}O=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=Se.payload,_=typeof ue=="function"?ue.call(mt,O,_):ue,_==null)break e;O=E({},O,_);break e;case 2:lo=!0}}_=s.callback,_!==null&&(e.flags|=64,A&&(e.flags|=8192),A=o.callbacks,A===null?o.callbacks=[_]:A.push(_))}else A={lane:_,tag:s.tag,payload:s.payload,callback:s.callback,next:null},R===null?(w=R=A,h=O):R=R.next=A,i|=_;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;A=s,s=A.next,A.next=null,o.lastBaseUpdate=A,o.shared.pending=null}}while(!0);R===null&&(h=O),o.baseState=h,o.firstBaseUpdate=w,o.lastBaseUpdate=R,a===null&&(o.shared.lanes=0),ho|=i,e.lanes=i,e.memoizedState=O}}function jd(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function Td(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)jd(n[e],t)}var Ea=p(null),ll=p(0);function Ld(e,t){e=$r,G(ll,e),G(Ea,t),$r=e|t.baseLanes}function Ws(){G(ll,$r),G(Ea,Ea.current)}function Hs(){$r=ll.current,I(Ea),I(ll)}var Tn=p(null),lr=null;function co(e){var t=e.alternate;G(Dt,Dt.current&1),G(Tn,e),lr===null&&(t===null||Ea.current!==null||t.memoizedState!==null)&&(lr=e)}function Vs(e){G(Dt,Dt.current),G(Tn,e),lr===null&&(lr=e)}function Fd(e){e.tag===22?(G(Dt,Dt.current),G(Tn,e),lr===null&&(lr=e)):mo()}function mo(){G(Dt,Dt.current),G(Tn,Tn.current)}function Ln(e){I(Tn),lr===e&&(lr=null),I(Dt)}var Dt=p(0);function sl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ju(n)||Zu(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,Re=null,ct=null,$t=null,ul=!1,Aa=!1,Zo=!1,cl=0,pi=0,Ia=null,og=0;function It(){throw Error(d(321))}function Qs(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 Bs(e,t,n,r,o,a){return Mr=a,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?wm:su,Zo=!1,a=n(r,o),Zo=!1,Aa&&(a=Od(t,n,r,o)),$d(e),a}function $d(e){C.H=yi;var t=ct!==null&&ct.next!==null;if(Mr=0,$t=ct=Re=null,ul=!1,pi=0,Ia=null,t)throw Error(d(300));e===null||Ot||(e=e.dependencies,e!==null&&el(e)&&(Ot=!0))}function Od(e,t,n,r){Re=e;var o=0;do{if(Aa&&(Ia=null),pi=0,Aa=!1,25<=o)throw Error(d(301));if(o+=1,$t=ct=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}C.H=km,a=t(n,r)}while(Aa);return a}function ag(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?hi(t):t,e=e.useState()[0],(ct!==null?ct.memoizedState:null)!==e&&(Re.flags|=1024),t}function Ks(){var e=cl!==0;return cl=0,e}function Xs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Gs(e){if(ul){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ul=!1}Mr=0,$t=ct=Re=null,Aa=!1,pi=cl=0,Ia=null}function yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Re.memoizedState=$t=e:$t=$t.next=e,$t}function zt(){if(ct===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=$t===null?Re.memoizedState:$t.next;if(t!==null)$t=t,ct=e;else{if(e===null)throw Re.alternate===null?Error(d(467)):Error(d(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},$t===null?Re.memoizedState=$t=e:$t=$t.next=e}return $t}function dl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hi(e){var t=pi;return pi+=1,Ia===null&&(Ia=[]),e=Rd(Ia,e,t),t=Re,($t===null?t.memoizedState:$t.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?wm:su),e}function ml(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return hi(e);if(e.$$typeof===oe)return on(e)}throw Error(d(438,String(e)))}function Js(e){var t=null,n=Re.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Re.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=dl(),Re.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]=ye;return t.index++,n}function Dr(e,t){return typeof t=="function"?t(e):t}function fl(e){var t=zt();return Zs(t,ct,e)}function Zs(e,t,n){var r=e.queue;if(r===null)throw Error(d(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 s=i=null,h=null,w=t,R=!1;do{var O=w.lane&-536870913;if(O!==w.lane?(Ke&O)===O:(Mr&O)===O){var _=w.revertLane;if(_===0)h!==null&&(h=h.next={lane:0,revertLane:0,gesture:null,action:w.action,hasEagerState:w.hasEagerState,eagerState:w.eagerState,next:null}),O===ka&&(R=!0);else if((Mr&_)===_){w=w.next,_===ka&&(R=!0);continue}else O={lane:0,revertLane:w.revertLane,gesture:null,action:w.action,hasEagerState:w.hasEagerState,eagerState:w.eagerState,next:null},h===null?(s=h=O,i=a):h=h.next=O,Re.lanes|=_,ho|=_;O=w.action,Zo&&n(a,O),a=w.hasEagerState?w.eagerState:n(a,O)}else _={lane:O,revertLane:w.revertLane,gesture:w.gesture,action:w.action,hasEagerState:w.hasEagerState,eagerState:w.eagerState,next:null},h===null?(s=h=_,i=a):h=h.next=_,Re.lanes|=O,ho|=O;w=w.next}while(w!==null&&w!==t);if(h===null?i=a:h.next=s,!Nn(a,e.memoizedState)&&(Ot=!0,R&&(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 Ys(e){var t=zt(),n=t.queue;if(n===null)throw Error(d(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 Ud(e,t,n){var r=Re,o=zt(),a=Je;if(a){if(n===void 0)throw Error(d(407));n=n()}else n=t();var i=!Nn((ct||o).memoizedState,n);if(i&&(o.memoizedState=n,Ot=!0),o=o.queue,nu(Hd.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},Wd.bind(null,r,o,n,t),null),pt===null)throw Error(d(349));a||(Mr&127)!==0||qd(r,t,n)}return n}function qd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Re.updateQueue,t===null?(t=dl(),Re.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wd(e,t,n,r){t.value=n,t.getSnapshot=r,Vd(t)&&Qd(e)}function Hd(e,t,n){return n(function(){Vd(t)&&Qd(e)})}function Vd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Nn(e,n)}catch{return!0}}function Qd(e){var t=Wo(e,2);t!==null&&Pn(t,e,2)}function eu(e){var t=yn();if(typeof e=="function"){var n=e;if(e=n(),Zo){ot(!0);try{n()}finally{ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:e},t}function Bd(e,t,n,r){return e.baseState=n,Zs(e,ct,typeof r=="function"?r:Dr)}function ig(e,t,n,r,o){if(gl(e))throw Error(d(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)}};C.T!==null?n(!0):a.isTransition=!1,r(a),n=t.pending,n===null?(a.next=t.pending=a,Kd(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Kd(e,t){var n=t.action,r=t.payload,o=e.state;if(t.isTransition){var a=C.T,i={};C.T=i;try{var s=n(o,r),h=C.S;h!==null&&h(i,s),Xd(e,t,s)}catch(w){tu(e,t,w)}finally{a!==null&&i.types!==null&&(a.types=i.types),C.T=a}}else try{a=n(o,r),Xd(e,t,a)}catch(w){tu(e,t,w)}}function Xd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){Gd(e,t,r)},function(r){return tu(e,t,r)}):Gd(e,t,n)}function Gd(e,t,n){t.status="fulfilled",t.value=n,Jd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Kd(e,n)))}function tu(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,Jd(t),t=t.next;while(t!==r)}e.action=null}function Jd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zd(e,t){return t}function Yd(e,t){if(Je){var n=pt.formState;if(n!==null){e:{var r=Re;if(Je){if(bt){t:{for(var o=bt,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){bt=Gn(o.nextSibling),r=o.data==="F!";break e}}ao(r)}r=!1}r&&(t=n[0])}}return n=yn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zd,lastRenderedState:t},n.queue=r,n=vm.bind(null,Re,r),r.dispatch=n,r=eu(!1),a=lu.bind(null,Re,!1,r.queue),r=yn(),o={state:t,dispatch:null,action:e,pending:null},r.queue=o,n=ig.bind(null,Re,o,a,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function em(e){var t=zt();return tm(t,ct,e)}function tm(e,t,n){if(t=Zs(e,t,Zd)[0],e=fl(Dr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=hi(t)}catch(i){throw i===Sa?rl:i}else r=t;t=zt();var o=t.queue,a=o.dispatch;return n!==t.memoizedState&&(Re.flags|=2048,Pa(9,{destroy:void 0},lg.bind(null,o,n),null)),[r,a,e]}function lg(e,t){e.action=t}function nm(e){var t=zt(),n=ct;if(n!==null)return tm(t,n,e);zt(),t=t.memoizedState,n=zt();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=Re.updateQueue,t===null&&(t=dl(),Re.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 rm(){return zt().memoizedState}function pl(e,t,n,r){var o=yn();Re.flags|=e,o.memoizedState=Pa(1|t,{destroy:void 0},n,r===void 0?null:r)}function hl(e,t,n,r){var o=zt();r=r===void 0?null:r;var a=o.memoizedState.inst;ct!==null&&r!==null&&Qs(r,ct.memoizedState.deps)?o.memoizedState=Pa(t,a,n,r):(Re.flags|=e,o.memoizedState=Pa(1|t,a,n,r))}function om(e,t){pl(8390656,8,e,t)}function nu(e,t){hl(2048,8,e,t)}function sg(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=dl(),Re.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function am(e){var t=zt().memoizedState;return sg({ref:t,nextImpl:e}),function(){if((at&2)!==0)throw Error(d(440));return t.impl.apply(void 0,arguments)}}function im(e,t){return hl(4,2,e,t)}function lm(e,t){return hl(4,4,e,t)}function sm(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 um(e,t,n){n=n!=null?n.concat([e]):null,hl(4,4,sm.bind(null,t,e),n)}function ru(){}function cm(e,t){var n=zt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qs(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function dm(e,t){var n=zt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qs(t,r[1]))return r[0];if(r=e(),Zo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r}function ou(e,t,n){return n===void 0||(Mr&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=ff(),Re.lanes|=e,ho|=e,n)}function mm(e,t,n,r){return Nn(n,t)?n:Ea.current!==null?(e=ou(e,n,r),Nn(e,t)||(Ot=!0),e):(Mr&42)===0||(Mr&1073741824)!==0&&(Ke&261930)===0?(Ot=!0,e.memoizedState=n):(e=ff(),Re.lanes|=e,ho|=e,t)}function fm(e,t,n,r,o){var a=q.p;q.p=a!==0&&8>a?a:8;var i=C.T,s={};C.T=s,lu(e,!1,t,n);try{var h=o(),w=C.S;if(w!==null&&w(s,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var R=rg(h,r);gi(e,t,R,On(e))}else gi(e,t,r,On(e))}catch(O){gi(e,t,{then:function(){},status:"rejected",reason:O},On())}finally{q.p=a,i!==null&&s.types!==null&&(i.types=s.types),C.T=i}}function ug(){}function au(e,t,n,r){if(e.tag!==5)throw Error(d(476));var o=pm(e).queue;fm(e,o,t,ie,n===null?ug:function(){return hm(e),n(r)})}function pm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function hm(e){var t=pm(e);t.next===null&&(t=e.alternate.memoizedState),gi(e,t.next.queue,{},On())}function iu(){return on(zi)}function gm(){return zt().memoizedState}function ym(){return zt().memoizedState}function cg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=On();e=so(n);var r=uo(t,e,n);r!==null&&(Pn(r,t,n),di(r,t,n)),t={cache:js()},e.payload=t;return}t=t.return}}function dg(e,t,n){var r=On();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},gl(e)?bm(t,n):(n=Ss(e,t,n,r),n!==null&&(Pn(n,e,r),xm(n,t,r)))}function vm(e,t,n){var r=On();gi(e,t,n,r)}function gi(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(gl(e))bm(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,s=a(i,n);if(o.hasEagerState=!0,o.eagerState=s,Nn(s,i))return Gi(e,t,o,0),pt===null&&Xi(),!1}catch{}finally{}if(n=Ss(e,t,o,r),n!==null)return Pn(n,e,r),xm(n,t,r),!0}return!1}function lu(e,t,n,r){if(r={lane:2,revertLane:$u(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},gl(e)){if(t)throw Error(d(479))}else t=Ss(e,n,r,2),t!==null&&Pn(t,e,2)}function gl(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function bm(e,t){Aa=ul=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xm(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Fi(e,n)}}var yi={readContext:on,use:ml,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};yi.useEffectEvent=It;var wm={readContext:on,use:ml,useCallback:function(e,t){return yn().memoizedState=[e,t===void 0?null:t],e},useContext:on,useEffect:om,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,pl(4194308,4,sm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pl(4194308,4,e,t)},useInsertionEffect:function(e,t){pl(4,2,e,t)},useMemo:function(e,t){var n=yn();t=t===void 0?null:t;var r=e();if(Zo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=yn();if(n!==void 0){var o=n(t);if(Zo){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=dg.bind(null,Re,e),[r.memoizedState,e]},useRef:function(e){var t=yn();return e={current:e},t.memoizedState=e},useState:function(e){e=eu(e);var t=e.queue,n=vm.bind(null,Re,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ru,useDeferredValue:function(e,t){var n=yn();return ou(n,e,t)},useTransition:function(){var e=eu(!1);return e=fm.bind(null,Re,e.queue,!0,!1),yn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Re,o=yn();if(Je){if(n===void 0)throw Error(d(407));n=n()}else{if(n=t(),pt===null)throw Error(d(349));(Ke&127)!==0||qd(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,om(Hd.bind(null,r,a,e),[e]),r.flags|=2048,Pa(9,{destroy:void 0},Wd.bind(null,r,a,n,t),null),n},useId:function(){var e=yn(),t=pt.identifierPrefix;if(Je){var n=br,r=vr;n=(r&~(1<<32-ft(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=cl++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=og++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:iu,useFormState:Yd,useActionState:Yd,useOptimistic:function(e){var t=yn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=lu.bind(null,Re,!0,n),n.dispatch=t,[e,t]},useMemoCache:Js,useCacheRefresh:function(){return yn().memoizedState=cg.bind(null,Re)},useEffectEvent:function(e){var t=yn(),n={impl:e};return t.memoizedState=n,function(){if((at&2)!==0)throw Error(d(440));return n.impl.apply(void 0,arguments)}}},su={readContext:on,use:ml,useCallback:cm,useContext:on,useEffect:nu,useImperativeHandle:um,useInsertionEffect:im,useLayoutEffect:lm,useMemo:dm,useReducer:fl,useRef:rm,useState:function(){return fl(Dr)},useDebugValue:ru,useDeferredValue:function(e,t){var n=zt();return mm(n,ct.memoizedState,e,t)},useTransition:function(){var e=fl(Dr)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:hi(e),t]},useSyncExternalStore:Ud,useId:gm,useHostTransitionStatus:iu,useFormState:em,useActionState:em,useOptimistic:function(e,t){var n=zt();return Bd(n,ct,e,t)},useMemoCache:Js,useCacheRefresh:ym};su.useEffectEvent=am;var km={readContext:on,use:ml,useCallback:cm,useContext:on,useEffect:nu,useImperativeHandle:um,useInsertionEffect:im,useLayoutEffect:lm,useMemo:dm,useReducer:Ys,useRef:rm,useState:function(){return Ys(Dr)},useDebugValue:ru,useDeferredValue:function(e,t){var n=zt();return ct===null?ou(n,e,t):mm(n,ct.memoizedState,e,t)},useTransition:function(){var e=Ys(Dr)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:hi(e),t]},useSyncExternalStore:Ud,useId:gm,useHostTransitionStatus:iu,useFormState:nm,useActionState:nm,useOptimistic:function(e,t){var n=zt();return ct!==null?Bd(n,ct,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Js,useCacheRefresh:ym};km.useEffectEvent=am;function uu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var cu={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=On(),o=so(r);o.payload=t,n!=null&&(o.callback=n),t=uo(e,o,r),t!==null&&(Pn(t,e,r),di(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=On(),o=so(r);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=uo(e,o,r),t!==null&&(Pn(t,e,r),di(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=On(),r=so(n);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,n),t!==null&&(Pn(t,e,n),di(t,e,n))}};function _m(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?!ri(n,r)||!ri(o,a):!0}function Sm(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&&cu.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=E({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function Cm(e){Ki(e)}function Em(e){console.error(e)}function Am(e){Ki(e)}function yl(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Im(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 du(e,t,n){return n=so(n),n.tag=3,n.payload={element:null},n.callback=function(){yl(e,t)},n}function Pm(e){return e=so(e),e.tag=3,e}function Rm(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(){Im(t,n,r)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Im(t,n,r),typeof o!="function"&&(go===null?go=new Set([this]):go.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function mg(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 lr===null?Pl():n.alternate===null&&Pt===0&&(Pt=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===ol?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Tu(e,r,o)),!1;case 22:return n.flags|=65536,r===ol?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)),Tu(e,r,o)),!1}throw Error(d(435,n.tag))}return Tu(e,r,o),Pl(),!1}if(Je)return t=Tn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==Rs&&(e=Error(d(422),{cause:r}),ii(Qn(e,n)))):(r!==Rs&&(t=Error(d(423),{cause:r}),ii(Qn(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=Qn(r,n),o=du(e.stateNode,r,o),Us(e,o),Pt!==4&&(Pt=2)),!1;var a=Error(d(520),{cause:r});if(a=Qn(a,n),Ci===null?Ci=[a]:Ci.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=du(n.stateNode,r,e),Us(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=Pm(o),Rm(o,e,n,r),Us(n,o),!1}n=n.return}while(n!==null);return!1}var mu=Error(d(461)),Ot=!1;function an(e,t,n,r){t.child=e===null?Nd(t,null,n,r):Jo(t,e.child,n,r)}function Mm(e,t,n,r,o){n=n.render;var a=t.ref;if("ref"in r){var i={};for(var s in r)s!=="ref"&&(i[s]=r[s])}else i=r;return Bo(t),r=Bs(e,t,n,i,a,o),s=Ks(),e!==null&&!Ot?(Xs(e,t,o),zr(e,t,o)):(Je&&s&&Is(t),t.flags|=1,an(e,t,r,o),t.child)}function Dm(e,t,n,r,o){if(e===null){var a=n.type;return typeof a=="function"&&!Cs(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zm(e,t,a,r,o)):(e=Zi(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!xu(e,o)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:ri,n(i,r)&&e.ref===t.ref)return zr(e,t,o)}return t.flags|=1,e=Ar(a,r),e.ref=t.ref,e.return=t,t.child=e}function zm(e,t,n,r,o){if(e!==null){var a=e.memoizedProps;if(ri(a,r)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=r=a,xu(e,o))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,zr(e,t,o)}return fu(e,t,n,r,o)}function Nm(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 jm(e,t,a,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&nl(t,a!==null?a.cachePool:null),a!==null?Ld(t,a):Ws(),Fd(t);else return r=t.lanes=536870912,jm(e,t,a!==null?a.baseLanes|n:n,n,r)}else a!==null?(nl(t,a.cachePool),Ld(t,a),mo(),t.memoizedState=null):(e!==null&&nl(t,null),Ws(),mo());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 jm(e,t,n,r,o){var a=Ls();return a=a===null?null:{parent:Ft._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&nl(t,null),Ws(),Fd(t),e!==null&&wa(e,t,r,!0),t.childLanes=o,null}function vl(e,t){return t=xl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Tm(e,t,n){return Jo(t,e.child,null,n),e=vl(t,t.pendingProps),e.flags|=2,Ln(t),t.memoizedState=null,e}function fg(e,t,n){var r=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Je){if(r.mode==="hidden")return e=vl(t,r),t.lanes=536870912,vi(null,e);if(Vs(t),(e=bt)?(e=Xf(e,Xn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ro!==null?{id:vr,overflow:br}:null,retryLane:536870912,hydrationErrors:null},n=bd(e),n.return=t,t.child=n,rn=t,bt=null)):e=null,e===null)throw ao(t);return t.lanes=536870912,null}return vl(t,r)}var a=e.memoizedState;if(a!==null){var i=a.dehydrated;if(Vs(t),o)if(t.flags&256)t.flags&=-257,t=Tm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(d(558));else if(Ot||wa(e,t,n,!1),o=(n&e.childLanes)!==0,Ot||o){if(r=pt,r!==null&&(i=zo(r,n),i!==0&&i!==a.retryLane))throw a.retryLane=i,Wo(e,i),Pn(r,e,i),mu;Pl(),t=Tm(e,t,n)}else e=a.treeContext,bt=Gn(i.nextSibling),rn=t,Je=!0,oo=null,Xn=!1,e!==null&&kd(t,e),t=vl(t,r),t.flags|=4096;return t}return e=Ar(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bl(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(d(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function fu(e,t,n,r,o){return Bo(t),n=Bs(e,t,n,r,void 0,o),r=Ks(),e!==null&&!Ot?(Xs(e,t,o),zr(e,t,o)):(Je&&r&&Is(t),t.flags|=1,an(e,t,n,o),t.child)}function Lm(e,t,n,r,o,a){return Bo(t),t.updateQueue=null,n=Od(t,r,n,o),$d(e),r=Ks(),e!==null&&!Ot?(Xs(e,t,a),zr(e,t,a)):(Je&&r&&Is(t),t.flags|=1,an(e,t,n,a),t.child)}function Fm(e,t,n,r,o){if(Bo(t),t.stateNode===null){var a=ya,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=cu,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},$s(t),i=n.contextType,a.context=typeof i=="object"&&i!==null?on(i):ya,a.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(uu(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&&cu.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 s=t.memoizedProps,h=Yo(n,s);a.props=h;var w=a.context,R=n.contextType;i=ya,typeof R=="object"&&R!==null&&(i=on(R));var O=n.getDerivedStateFromProps;R=typeof O=="function"||typeof a.getSnapshotBeforeUpdate=="function",s=t.pendingProps!==s,R||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s||w!==i)&&Sm(t,a,r,i),lo=!1;var _=t.memoizedState;a.state=_,fi(t,r,a,o),mi(),w=t.memoizedState,s||_!==w||lo?(typeof O=="function"&&(uu(t,n,O,r),w=t.memoizedState),(h=lo||_m(t,n,h,r,_,w,i))?(R||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=w),a.props=r,a.state=w,a.context=i,r=h):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Os(e,t),i=t.memoizedProps,R=Yo(n,i),a.props=R,O=t.pendingProps,_=a.context,w=n.contextType,h=ya,typeof w=="object"&&w!==null&&(h=on(w)),s=n.getDerivedStateFromProps,(w=typeof s=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==O||_!==h)&&Sm(t,a,r,h),lo=!1,_=t.memoizedState,a.state=_,fi(t,r,a,o),mi();var A=t.memoizedState;i!==O||_!==A||lo||e!==null&&e.dependencies!==null&&el(e.dependencies)?(typeof s=="function"&&(uu(t,n,s,r),A=t.memoizedState),(R=lo||_m(t,n,R,r,_,A,h)||e!==null&&e.dependencies!==null&&el(e.dependencies))?(w||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,A,h),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,A,h)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=A),a.props=r,a.state=A,a.context=h,r=R):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,bl(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=Jo(t,e.child,null,o),t.child=Jo(t,null,n,o)):an(e,t,n,o),t.memoizedState=a.state,e=t.child):e=zr(e,t,o),e}function $m(e,t,n,r){return Vo(),t.flags|=256,an(e,t,n,r),t.child}var pu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hu(e){return{baseLanes:e,cachePool:Id()}}function gu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=$n),e}function Om(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:(Dt.current&2)!==0),i&&(o=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Je){if(o?co(t):mo(),(e=bt)?(e=Xf(e,Xn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ro!==null?{id:vr,overflow:br}:null,retryLane:536870912,hydrationErrors:null},n=bd(e),n.return=t,t.child=n,rn=t,bt=null)):e=null,e===null)throw ao(t);return Zu(e)?t.lanes=32:t.lanes=536870912,null}var s=r.children;return r=r.fallback,o?(mo(),o=t.mode,s=xl({mode:"hidden",children:s},o),r=Ho(r,o,n,null),s.return=t,r.return=t,s.sibling=r,t.child=s,r=t.child,r.memoizedState=hu(n),r.childLanes=gu(e,i,n),t.memoizedState=pu,vi(null,r)):(co(t),yu(t,s))}var h=e.memoizedState;if(h!==null&&(s=h.dehydrated,s!==null)){if(a)t.flags&256?(co(t),t.flags&=-257,t=vu(e,t,n)):t.memoizedState!==null?(mo(),t.child=e.child,t.flags|=128,t=null):(mo(),s=r.fallback,o=t.mode,r=xl({mode:"visible",children:r.children},o),s=Ho(s,o,n,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,Jo(t,e.child,null,n),r=t.child,r.memoizedState=hu(n),r.childLanes=gu(e,i,n),t.memoizedState=pu,t=vi(null,r));else if(co(t),Zu(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var w=i.dgst;i=w,r=Error(d(419)),r.stack="",r.digest=i,ii({value:r,source:null,stack:null}),t=vu(e,t,n)}else if(Ot||wa(e,t,n,!1),i=(n&e.childLanes)!==0,Ot||i){if(i=pt,i!==null&&(r=zo(i,n),r!==0&&r!==h.retryLane))throw h.retryLane=r,Wo(e,r),Pn(i,e,r),mu;Ju(s)||Pl(),t=vu(e,t,n)}else Ju(s)?(t.flags|=192,t.child=e.child,t=null):(e=h.treeContext,bt=Gn(s.nextSibling),rn=t,Je=!0,oo=null,Xn=!1,e!==null&&kd(t,e),t=yu(t,r.children),t.flags|=4096);return t}return o?(mo(),s=r.fallback,o=t.mode,h=e.child,w=h.sibling,r=Ar(h,{mode:"hidden",children:r.children}),r.subtreeFlags=h.subtreeFlags&65011712,w!==null?s=Ar(w,s):(s=Ho(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,vi(null,r),r=t.child,s=e.child.memoizedState,s===null?s=hu(n):(o=s.cachePool,o!==null?(h=Ft._currentValue,o=o.parent!==h?{parent:h,pool:h}:o):o=Id(),s={baseLanes:s.baseLanes|n,cachePool:o}),r.memoizedState=s,r.childLanes=gu(e,i,n),t.memoizedState=pu,vi(e.child,r)):(co(t),n=e.child,e=n.sibling,n=Ar(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 yu(e,t){return t=xl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function xl(e,t){return e=jn(22,e,null,t),e.lanes=0,e}function vu(e,t,n){return Jo(t,e.child,null,n),e=yu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Um(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),zs(e.return,t,n)}function bu(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 qm(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;r=r.children;var i=Dt.current,s=(i&2)!==0;if(s?(i=i&1|2,t.flags|=128):i&=1,G(Dt,i),an(e,t,r,n),r=Je?ai:0,!s&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Um(e,n,t);else if(e.tag===19)Um(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&&sl(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),bu(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&&sl(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}bu(t,!0,n,null,a,r);break;case"together":bu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function zr(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(d(153));if(t.child!==null){for(e=t.child,n=Ar(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ar(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function xu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&el(e)))}function pg(e,t,n){switch(t.tag){case 3:Le(t,t.stateNode.containerInfo),io(t,Ft,e.memoizedState.cache),Vo();break;case 27:case 5:je(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,Vs(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?Om(e,t,n):(co(t),e=zr(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 qm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(Dt,Dt.current),r)break;return null;case 22:return t.lanes=0,Nm(e,t,n,t.pendingProps);case 24:io(t,Ft,e.memoizedState.cache)}return zr(e,t,n)}function Wm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!xu(e,n)&&(t.flags&128)===0)return Ot=!1,pg(e,t,n);Ot=(e.flags&131072)!==0}else Ot=!1,Je&&(t.flags&1048576)!==0&&wd(t,ai,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")Cs(e)?(r=Yo(e,r),t.tag=1,t=Fm(null,t,e,r,n)):(t.tag=0,t=fu(null,t,e,r,n));else{if(e!=null){var o=e.$$typeof;if(o===re){t.tag=11,t=Mm(null,t,e,r,n);break e}else if(o===U){t.tag=14,t=Dm(null,t,e,r,n);break e}}throw t=xe(e)||e,Error(d(306,t,""))}}return t;case 0:return fu(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,o=Yo(r,t.pendingProps),Fm(e,t,r,o,n);case 3:e:{if(Le(t,t.stateNode.containerInfo),e===null)throw Error(d(387));r=t.pendingProps;var a=t.memoizedState;o=a.element,Os(e,t),fi(t,r,null,n);var i=t.memoizedState;if(r=i.cache,io(t,Ft,r),r!==a.cache&&Ns(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=$m(e,t,r,n);break e}else if(r!==o){o=Qn(Error(d(424)),t),ii(o),t=$m(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(bt=Gn(e.firstChild),rn=t,Je=!0,oo=null,Xn=!0,n=Nd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Vo(),r===o){t=zr(e,t,n);break e}an(e,t,r,n)}t=t.child}return t;case 26:return bl(e,t),e===null?(n=tp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Je||(n=t.type,e=t.pendingProps,r=Tl(ve.current).createElement(n),r[Ct]=t,r[qt]=e,ln(r,n,e),jt(r),t.stateNode=r):t.memoizedState=tp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return je(t),e===null&&Je&&(r=t.stateNode=Zf(t.type,t.pendingProps,ve.current),rn=t,Xn=!0,o=bt,xo(t.type)?(Yu=o,bt=Gn(r.firstChild)):bt=o),an(e,t,t.pendingProps.children,n),bl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Je&&((o=r=bt)&&(r=Hg(r,t.type,t.pendingProps,Xn),r!==null?(t.stateNode=r,rn=t,bt=Gn(r.firstChild),Xn=!1,o=!0):o=!1),o||ao(t)),je(t),o=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,r=a.children,Ku(o,a)?r=null:i!==null&&Ku(o,i)&&(t.flags|=32),t.memoizedState!==null&&(o=Bs(e,t,ag,null,null,n),zi._currentValue=o),bl(e,t),an(e,t,r,n),t.child;case 6:return e===null&&Je&&((e=n=bt)&&(n=Vg(n,t.pendingProps,Xn),n!==null?(t.stateNode=n,rn=t,bt=null,e=!0):e=!1),e||ao(t)),null;case 13:return Om(e,t,n);case 4:return Le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Jo(t,null,r,n):an(e,t,r,n),t.child;case 11:return Mm(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,Bo(t),o=on(o),r=r(o),t.flags|=1,an(e,t,r,n),t.child;case 14:return Dm(e,t,t.type,t.pendingProps,n);case 15:return zm(e,t,t.type,t.pendingProps,n);case 19:return qm(e,t,n);case 31:return fg(e,t,n);case 22:return Nm(e,t,n,t.pendingProps);case 24:return Bo(t),r=on(Ft),e===null?(o=Ls(),o===null&&(o=pt,a=js(),o.pooledCache=a,a.refCount++,a!==null&&(o.pooledCacheLanes|=n),o=a),t.memoizedState={parent:r,cache:o},$s(t),io(t,Ft,o)):((e.lanes&n)!==0&&(Os(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&&Ns(t,[Ft],n,!0))),an(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(d(156,t.tag))}function Nr(e){e.flags|=4}function wu(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(yf())e.flags|=8192;else throw Go=ol,Fs}else e.flags&=-16777217}function Hm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ip(t))if(yf())e.flags|=8192;else throw Go=ol,Fs}function wl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Mo():536870912,e.lanes|=t,za|=t)}function bi(e,t){if(!Je)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 hg(e,t,n){var r=t.pendingProps;switch(Ps(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),Rr(Ft),Ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(xa(t)?Nr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ms())),xt(t),null;case 26:var o=t.type,a=t.memoizedState;return e===null?(Nr(t),a!==null?(xt(t),Hm(t,a)):(xt(t),wu(t,o,null,r,n))):a?a!==e.memoizedState?(Nr(t),xt(t),Hm(t,a)):(xt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Nr(t),xt(t),wu(t,o,e,r,n)),null;case 27:if(We(t),n=ve.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nr(t);else{if(!r){if(t.stateNode===null)throw Error(d(166));return xt(t),null}e=Y.current,xa(t)?_d(t):(e=Zf(o,r,n),t.stateNode=e,Nr(t))}return xt(t),null;case 5:if(We(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nr(t);else{if(!r){if(t.stateNode===null)throw Error(d(166));return xt(t),null}if(a=Y.current,xa(t))_d(t);else{var i=Tl(ve.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[qt]=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(ln(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&&Nr(t)}}return xt(t),wu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Nr(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(d(166));if(e=ve.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||Uf(e.nodeValue,n)),e||ao(t,!0)}else e=Tl(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(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[Ct]=t}else Vo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else n=Ms(),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(d(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(d(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(d(317));o[Ct]=t}else Vo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),o=!1}else o=Ms(),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),wl(t,t.updateQueue),xt(t),null);case 4:return Ne(),e===null&&Wu(t.stateNode.containerInfo),xt(t),null;case 10:return Rr(t.type),xt(t),null;case 19:if(I(Dt),r=t.memoizedState,r===null)return xt(t),null;if(o=(t.flags&128)!==0,a=r.rendering,a===null)if(o)bi(r,!1);else{if(Pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=sl(e),a!==null){for(t.flags|=128,bi(r,!1),e=a.updateQueue,t.updateQueue=e,wl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vd(n,e),n=n.sibling;return G(Dt,Dt.current&1|2),Je&&Ir(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ze()>El&&(t.flags|=128,o=!0,bi(r,!1),t.lanes=4194304)}else{if(!o)if(e=sl(a),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,wl(t,e),bi(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!Je)return xt(t),null}else 2*Ze()-r.renderingStartTime>El&&n!==536870912&&(t.flags|=128,o=!0,bi(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=Ze(),e.sibling=null,n=Dt.current,G(Dt,o?n&1|2:n&1),Je&&Ir(t,r.treeForkCount),e):(xt(t),null);case 22:case 23:return Ln(t),Hs(),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&&wl(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&&I(Ko),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Rr(Ft),xt(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function gg(e,t){switch(Ps(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Rr(Ft),Ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return We(t),null;case 31:if(t.memoizedState!==null){if(Ln(t),t.alternate===null)throw Error(d(340));Vo()}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(d(340));Vo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(Dt),null;case 4:return Ne(),null;case 10:return Rr(t.type),null;case 22:case 23:return Ln(t),Hs(),e!==null&&I(Ko),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Rr(Ft),null;case 25:return null;default:return null}}function Vm(e,t){switch(Ps(t),t.tag){case 3:Rr(Ft),Ne();break;case 26:case 27:case 5:We(t);break;case 4:Ne();break;case 31:t.memoizedState!==null&&Ln(t);break;case 13:Ln(t);break;case 19:I(Dt);break;case 10:Rr(t.type);break;case 22:case 23:Ln(t),Hs(),e!==null&&I(Ko);break;case 24:Rr(Ft)}}function xi(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(s){ut(t,t.return,s)}}function fo(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,s=i.destroy;if(s!==void 0){i.destroy=void 0,o=t;var h=n,w=s;try{w()}catch(R){ut(o,h,R)}}}r=r.next}while(r!==a)}}catch(R){ut(t,t.return,R)}}function Qm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Td(t,n)}catch(r){ut(e,e.return,r)}}}function Bm(e,t,n){n.props=Yo(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){ut(e,t,r)}}function wi(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 Km(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 ku(e,t,n){try{var r=e.stateNode;Fg(r,e.type,n,t),r[qt]=t}catch(o){ut(e,e.return,o)}}function Xm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xo(e.type)||e.tag===4}function _u(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xm(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 Su(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(Su(e,t,n),e=e.sibling;e!==null;)Su(e,t,n),e=e.sibling}function kl(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(kl(e,t,n),e=e.sibling;e!==null;)kl(e,t,n),e=e.sibling}function Gm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);ln(t,r,n),t[Ct]=e,t[qt]=n}catch(a){ut(e,e.return,a)}}var jr=!1,Ut=!1,Cu=!1,Jm=typeof WeakSet=="function"?WeakSet:Set,Jt=null;function yg(e,t){if(e=e.containerInfo,Qu=Wl,e=ud(e),vs(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,s=-1,h=-1,w=0,R=0,O=e,_=null;t:for(;;){for(var A;O!==n||o!==0&&O.nodeType!==3||(s=i+o),O!==a||r!==0&&O.nodeType!==3||(h=i+r),O.nodeType===3&&(i+=O.nodeValue.length),(A=O.firstChild)!==null;)_=O,O=A;for(;;){if(O===e)break t;if(_===n&&++w===o&&(s=i),_===a&&++R===r&&(h=i),(A=O.nextSibling)!==null)break;O=_,_=O.parentNode}O=A}n=s===-1||h===-1?null:{start:s,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bu={focusedElem:e,selectionRange:n},Wl=!1,Jt=t;Jt!==null;)if(t=Jt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Jt=e;else for(;Jt!==null;){switch(t=Jt,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 ue=Yo(n.type,o);e=r.getSnapshotBeforeUpdate(ue,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)Gu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gu(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(d(163))}if(e=t.sibling,e!==null){e.return=t.return,Jt=e;break}Jt=t.return}}function Zm(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lr(e,n),r&4&&xi(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&&Qm(n),r&512&&wi(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{Td(e,t)}catch(i){ut(n,n.return,i)}}break;case 27:t===null&&r&4&&Gm(n);case 26:case 5:Lr(e,n),t===null&&r&4&&Km(n),r&512&&wi(n,n.return);break;case 12:Lr(e,n);break;case 31:Lr(e,n),r&4&&tf(e,n);break;case 13:Lr(e,n),r&4&&nf(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Eg.bind(null,n),Qg(e,n))));break;case 22:if(r=n.memoizedState!==null||jr,!r){t=t!==null&&t.memoizedState!==null||Ut,o=jr;var a=Ut;jr=r,(Ut=t)&&!a?Fr(e,n,(n.subtreeFlags&8772)!==0):Lr(e,n),jr=o,Ut=a}break;case 30:break;default:Lr(e,n)}}function Ym(e){var t=e.alternate;t!==null&&(e.alternate=null,Ym(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;)ef(e,t,n),n=n.sibling}function ef(e,t,n){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(Xt,n)}catch{}switch(n.tag){case 26:Ut||xr(n,t),Tr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ut||xr(n,t);var r=_t,o=Cn;xo(n.type)&&(_t=n.stateNode,Cn=!1),Tr(e,t,n),Ri(n.stateNode),_t=r,Cn=o;break;case 5:Ut||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,Bf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ua(e)):Bf(_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:fo(2,n,t),Ut||fo(4,n,t),Tr(e,t,n);break;case 1:Ut||(xr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&Bm(n,t,r)),Tr(e,t,n);break;case 21:Tr(e,t,n);break;case 22:Ut=(r=Ut)||n.memoizedState!==null,Tr(e,t,n),Ut=r;break;default:Tr(e,t,n)}}function tf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ua(e)}catch(n){ut(t,t.return,n)}}}function nf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ua(e)}catch(n){ut(t,t.return,n)}}function vg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Jm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Jm),t;default:throw Error(d(435,e.tag))}}function _l(e,t){var n=vg(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var o=Ag.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,s=i;e:for(;s!==null;){switch(s.tag){case 27:if(xo(s.type)){_t=s.stateNode,Cn=!1;break e}break;case 5:_t=s.stateNode,Cn=!1;break e;case 3:case 4:_t=s.stateNode.containerInfo,Cn=!0;break e}s=s.return}if(_t===null)throw Error(d(160));ef(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;)rf(t,e),t=t.sibling}var sr=null;function rf(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:En(t,e),An(e),r&4&&(fo(3,e,e.return),xi(3,e),fo(5,e,e.return));break;case 1:En(t,e),An(e),r&512&&(Ut||n===null||xr(n,n.return)),r&64&&jr&&(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=sr;if(En(t,e),An(e),r&512&&(Ut||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"))),ln(a,r,n),a[Ct]=e,jt(a),r=a;break e;case"link":var i=op("link","href",o).get(r+(n.href||""));if(i){for(var s=0;s<i.length;s++)if(a=i[s],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(s,1);break t}}a=o.createElement(r),ln(a,r,n),o.head.appendChild(a);break;case"meta":if(i=op("meta","content",o).get(r+(n.content||""))){for(s=0;s<i.length;s++)if(a=i[s],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(s,1);break t}}a=o.createElement(r),ln(a,r,n),o.head.appendChild(a);break;default:throw Error(d(468,r))}a[Ct]=e,jt(a),r=a}e.stateNode=r}else ap(o,e.type,e.stateNode);else e.stateNode=rp(o,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?ap(o,e.type,e.stateNode):rp(o,r,e.memoizedProps)):r===null&&e.stateNode!==null&&ku(e,e.memoizedProps,n.memoizedProps)}break;case 27:En(t,e),An(e),r&512&&(Ut||n===null||xr(n,n.return)),n!==null&&r&4&&ku(e,e.memoizedProps,n.memoizedProps);break;case 5:if(En(t,e),An(e),r&512&&(Ut||n===null||xr(n,n.return)),e.flags&32){o=e.stateNode;try{gr(o,"")}catch(ue){ut(e,e.return,ue)}}r&4&&e.stateNode!=null&&(o=e.memoizedProps,ku(e,o,n!==null?n.memoizedProps:o)),r&1024&&(Cu=!0);break;case 6:if(En(t,e),An(e),r&4){if(e.stateNode===null)throw Error(d(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ue){ut(e,e.return,ue)}}break;case 3:if($l=null,o=sr,sr=Ll(t.containerInfo),En(t,e),sr=o,An(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ua(t.containerInfo)}catch(ue){ut(e,e.return,ue)}Cu&&(Cu=!1,of(e));break;case 4:r=sr,sr=Ll(e.stateNode.containerInfo),En(t,e),An(e),sr=r;break;case 12:En(t,e),An(e);break;case 31:En(t,e),An(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 13:En(t,e),An(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Cl=Ze()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 22:o=e.memoizedState!==null;var h=n!==null&&n.memoizedState!==null,w=jr,R=Ut;if(jr=w||o,Ut=R||h,En(t,e),Ut=R,jr=w,An(e),r&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||h||jr||Ut||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{s=h.stateNode;var O=h.memoizedProps.style,_=O!=null&&O.hasOwnProperty("display")?O.display:null;s.style.display=_==null||typeof _=="boolean"?"":(""+_).trim()}}catch(ue){ut(h,h.return,ue)}}}else if(t.tag===6){if(n===null){h=t;try{h.stateNode.nodeValue=o?"":h.memoizedProps}catch(ue){ut(h,h.return,ue)}}}else if(t.tag===18){if(n===null){h=t;try{var A=h.stateNode;o?Kf(A,!0):Kf(h.stateNode,!1)}catch(ue){ut(h,h.return,ue)}}}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,_l(e,n))));break;case 19:En(t,e),An(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 30:break;case 21:break;default:En(t,e),An(e)}}function An(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Xm(r)){n=r;break}r=r.return}if(n==null)throw Error(d(160));switch(n.tag){case 27:var o=n.stateNode,a=_u(e);kl(e,a,o);break;case 5:var i=n.stateNode;n.flags&32&&(gr(i,""),n.flags&=-33);var s=_u(e);kl(e,s,i);break;case 3:case 4:var h=n.stateNode.containerInfo,w=_u(e);Su(e,w,h);break;default:throw Error(d(161))}}catch(R){ut(e,e.return,R)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function of(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;of(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;)Zm(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:fo(4,t,t.return),ea(t);break;case 1:xr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Bm(t,t.return,n),ea(t);break;case 27:Ri(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),xi(4,a);break;case 1:if(Fr(o,a,n),r=a,o=r.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(w){ut(r,r.return,w)}if(r=a,o=r.updateQueue,o!==null){var s=r.stateNode;try{var h=o.shared.hiddenCallbacks;if(h!==null)for(o.shared.hiddenCallbacks=null,o=0;o<h.length;o++)jd(h[o],s)}catch(w){ut(r,r.return,w)}}n&&i&64&&Qm(a),wi(a,a.return);break;case 27:Gm(a);case 26:case 5:Fr(o,a,n),n&&r===null&&i&4&&Km(a),wi(a,a.return);break;case 12:Fr(o,a,n);break;case 31:Fr(o,a,n),n&&i&4&&tf(o,a);break;case 13:Fr(o,a,n),n&&i&4&&nf(o,a);break;case 22:a.memoizedState===null&&Fr(o,a,n),wi(a,a.return);break;case 30:break;default:Fr(o,a,n)}t=t.sibling}}function Eu(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 Au(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;)af(e,t,n,r),t=t.sibling}function af(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:ur(e,t,n,r),o&2048&&xi(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,s=a.onPostCommit;typeof s=="function"&&s(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):ki(e,t):a._visibility&2?ur(e,t,n,r):(a._visibility|=2,Ra(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Eu(i,t);break;case 24:ur(e,t,n,r),o&2048&&Au(t.alternate,t);break;default:ur(e,t,n,r)}}function Ra(e,t,n,r,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,i=t,s=n,h=r,w=i.flags;switch(i.tag){case 0:case 11:case 15:Ra(a,i,s,h,o),xi(8,i);break;case 23:break;case 22:var R=i.stateNode;i.memoizedState!==null?R._visibility&2?Ra(a,i,s,h,o):ki(a,i):(R._visibility|=2,Ra(a,i,s,h,o)),o&&w&2048&&Eu(i.alternate,i);break;case 24:Ra(a,i,s,h,o),o&&w&2048&&Au(i.alternate,i);break;default:Ra(a,i,s,h,o)}t=t.sibling}}function ki(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:ki(n,r),o&2048&&Eu(r.alternate,r);break;case 24:ki(n,r),o&2048&&Au(r.alternate,r);break;default:ki(n,r)}t=t.sibling}}var _i=8192;function Ma(e,t,n){if(e.subtreeFlags&_i)for(e=e.child;e!==null;)lf(e,t,n),e=e.sibling}function lf(e,t,n){switch(e.tag){case 26:Ma(e,t,n),e.flags&_i&&e.memoizedState!==null&&o0(n,sr,e.memoizedState,e.memoizedProps);break;case 5:Ma(e,t,n);break;case 3:case 4:var r=sr;sr=Ll(e.stateNode.containerInfo),Ma(e,t,n),sr=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=_i,_i=16777216,Ma(e,t,n),_i=r):Ma(e,t,n));break;default:Ma(e,t,n)}}function sf(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 Si(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];Jt=r,cf(r,e)}sf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)uf(e),e=e.sibling}function uf(e){switch(e.tag){case 0:case 11:case 15:Si(e),e.flags&2048&&fo(9,e,e.return);break;case 3:Si(e);break;case 12:Si(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Sl(e)):Si(e);break;default:Si(e)}}function Sl(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];Jt=r,cf(r,e)}sf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:fo(8,t,t.return),Sl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Sl(t));break;default:Sl(t)}e=e.sibling}}function cf(e,t){for(;Jt!==null;){var n=Jt;switch(n.tag){case 0:case 11:case 15:fo(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,Jt=r;else e:for(n=e;Jt!==null;){r=Jt;var o=r.sibling,a=r.return;if(Ym(r),r===n){Jt=null;break e}if(o!==null){o.return=a,Jt=o;break e}Jt=a}}}var bg={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}},xg=typeof WeakMap=="function"?WeakMap:Map,at=0,pt=null,Ve=null,Ke=0,st=0,Fn=null,po=!1,Da=!1,Iu=!1,$r=0,Pt=0,ho=0,ta=0,Pu=0,$n=0,za=0,Ci=null,In=null,Ru=!1,Cl=0,df=0,El=1/0,Al=null,go=null,Qt=0,yo=null,Na=null,Or=0,Mu=0,Du=null,mf=null,Ei=0,zu=null;function On(){return(at&2)!==0&&Ke!==0?Ke&-Ke:C.T!==null?$u():ra()}function ff(){if($n===0)if((Ke&536870912)===0||Je){var e=fe;fe<<=1,(fe&3932160)===0&&(fe=262144),$n=e}else $n=536870912;return e=Tn.current,e!==null&&(e.flags|=32),$n}function Pn(e,t,n){(e===pt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(ja(e,0),vo(e,Ke,$n,!1)),dr(e,n),((at&2)===0||e!==pt)&&(e===pt&&((at&2)===0&&(ta|=n),Pt===4&&vo(e,Ke,$n,!1)),wr(e))}function pf(e,t,n){if((at&6)!==0)throw Error(d(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||tt(e,t),o=r?_g(e,t):ju(e,t,!0),a=r;do{if(o===0){Da&&!r&&vo(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!wg(n)){o=ju(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 s=e;o=Ci;var h=s.current.memoizedState.isDehydrated;if(h&&(ja(s,i).flags|=256),i=ju(s,i,!1),i!==2){if(Iu&&!h){s.errorRecoveryDisabledLanes|=a,ta|=a,o=4;break e}a=In,In=o,a!==null&&(In===null?In=a:In.push.apply(In,a))}o=i}if(a=!1,o!==2)continue}}if(o===1){ja(e,0),vo(e,t,0,!0);break}e:{switch(r=e,a=o,a){case 0:case 1:throw Error(d(345));case 4:if((t&4194048)!==t)break;case 6:vo(r,t,$n,!po);break e;case 2:In=null;break;case 3:case 5:break;default:throw Error(d(329))}if((t&62914560)===t&&(o=Cl+300-Ze(),10<o)){if(vo(r,t,$n,!po),be(r,0,!0)!==0)break e;Or=t,r.timeoutHandle=Vf(hf.bind(null,r,n,In,Al,Ru,t,$n,ta,za,po,a,"Throttled",-0,0),o);break e}hf(r,n,In,Al,Ru,t,$n,ta,za,po,a,null,-0,0)}}break}while(!0);wr(e)}function hf(e,t,n,r,o,a,i,s,h,w,R,O,_,A){if(e.timeoutHandle=-1,O=t.subtreeFlags,O&8192||(O&16785408)===16785408){O={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kn},lf(t,a,O);var ue=(a&62914560)===a?Cl-Ze():(a&4194048)===a?df-Ze():0;if(ue=a0(O,ue),ue!==null){Or=a,e.cancelPendingCommit=ue(_f.bind(null,e,t,a,n,r,o,i,s,h,R,O,null,_,A)),vo(e,a,i,!w);return}}_f(e,t,a,n,r,o,i,s,h)}function wg(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 vo(e,t,n,r){t&=~Pu,t&=~ta,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var a=31-ft(o),i=1<<a;r[a]=-1,o&=~i}n!==0&&Qr(e,n,t)}function Il(){return(at&6)===0?(Ai(0),!1):!0}function Nu(){if(Ve!==null){if(st===0)var e=Ve.return;else e=Ve,Pr=Qo=null,Gs(e),Ca=null,ui=0,e=Ve;for(;e!==null;)Vm(e.alternate,e),e=e.return;Ve=null}}function ja(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Ug(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Or=0,Nu(),pt=e,Ve=n=Ar(e.current,null),Ke=t,st=0,Fn=null,po=!1,Da=tt(e,t),Iu=!1,za=$n=Pu=ta=ho=Pt=0,In=Ci=null,Ru=!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-ft(r),a=1<<o;t|=e[o],r&=~a}return $r=t,Xi(),n}function gf(e,t){Re=null,C.H=yi,t===Sa||t===rl?(t=Md(),st=3):t===Fs?(t=Md(),st=4):st=t===mu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Fn=t,Ve===null&&(Pt=1,yl(e,Qn(t,e.current)))}function yf(){var e=Tn.current;return e===null?!0:(Ke&4194048)===Ke?lr===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===lr:!1}function vf(){var e=C.H;return C.H=yi,e===null?yi:e}function bf(){var e=C.A;return C.A=bg,e}function Pl(){Pt=4,po||(Ke&4194048)!==Ke&&Tn.current!==null||(Da=!0),(ho&134217727)===0&&(ta&134217727)===0||pt===null||vo(pt,Ke,$n,!1)}function ju(e,t,n){var r=at;at|=2;var o=vf(),a=bf();(pt!==e||Ke!==t)&&(Al=null,ja(e,t)),t=!1;var i=Pt;e:do try{if(st!==0&&Ve!==null){var s=Ve,h=Fn;switch(st){case 8:Nu(),i=6;break e;case 3:case 2:case 9:case 6:Tn.current===null&&(t=!0);var w=st;if(st=0,Fn=null,Ta(e,s,h,w),n&&Da){i=0;break e}break;default:w=st,st=0,Fn=null,Ta(e,s,h,w)}}kg(),i=Pt;break}catch(R){gf(e,R)}while(!0);return t&&e.shellSuspendCounter++,Pr=Qo=null,at=r,C.H=o,C.A=a,Ve===null&&(pt=null,Ke=0,Xi()),i}function kg(){for(;Ve!==null;)xf(Ve)}function _g(e,t){var n=at;at|=2;var r=vf(),o=bf();pt!==e||Ke!==t?(Al=null,El=Ze()+500,ja(e,t)):Da=tt(e,t);e:do try{if(st!==0&&Ve!==null){t=Ve;var a=Fn;t:switch(st){case 1:st=0,Fn=null,Ta(e,t,a,1);break;case 2:case 9:if(Pd(a)){st=0,Fn=null,wf(t);break}t=function(){st!==2&&st!==9||pt!==e||(st=7),wr(e)},a.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Pd(a)?(st=0,Fn=null,wf(t)):(st=0,Fn=null,Ta(e,t,a,7));break;case 5:var i=null;switch(Ve.tag){case 26:i=Ve.memoizedState;case 5:case 27:var s=Ve;if(i?ip(i):s.stateNode.complete){st=0,Fn=null;var h=s.sibling;if(h!==null)Ve=h;else{var w=s.return;w!==null?(Ve=w,Rl(w)):Ve=null}break t}}st=0,Fn=null,Ta(e,t,a,5);break;case 6:st=0,Fn=null,Ta(e,t,a,6);break;case 8:Nu(),Pt=6;break e;default:throw Error(d(462))}}Sg();break}catch(R){gf(e,R)}while(!0);return Pr=Qo=null,C.H=r,C.A=o,at=n,Ve!==null?0:(pt=null,Ke=0,Xi(),Pt)}function Sg(){for(;Ve!==null&&!Ge();)xf(Ve)}function xf(e){var t=Wm(e.alternate,e,$r);e.memoizedProps=e.pendingProps,t===null?Rl(e):Ve=t}function wf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Lm(n,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=Lm(n,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:Gs(t);default:Vm(n,t),t=Ve=vd(t,$r),t=Wm(n,t,$r)}e.memoizedProps=e.pendingProps,t===null?Rl(e):Ve=t}function Ta(e,t,n,r){Pr=Qo=null,Gs(t),Ca=null,ui=0;var o=t.return;try{if(mg(e,o,t,n,Ke)){Pt=1,yl(e,Qn(n,e.current)),Ve=null;return}}catch(a){if(o!==null)throw Ve=o,a;Pt=1,yl(e,Qn(n,e.current)),Ve=null;return}t.flags&32768?(Je||r===1?e=!0:Da||(Ke&536870912)!==0?e=!1:(po=e=!0,(r===2||r===9||r===3||r===6)&&(r=Tn.current,r!==null&&r.tag===13&&(r.flags|=16384))),kf(t,e)):Rl(t)}function Rl(e){var t=e;do{if((t.flags&32768)!==0){kf(t,po);return}e=t.return;var n=hg(t.alternate,t,$r);if(n!==null){Ve=n;return}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);Pt===0&&(Pt=5)}function kf(e,t){do{var n=gg(e.alternate,e);if(n!==null){n.flags&=32767,Ve=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=n}while(e!==null);Pt=6,Ve=null}function _f(e,t,n,r,o,a,i,s,h){e.cancelPendingCommit=null;do Ml();while(Qt!==0);if((at&6)!==0)throw Error(d(327));if(t!==null){if(t===e.current)throw Error(d(177));if(a=t.lanes|t.childLanes,a|=_s,Do(e,n,a,i,s,h),e===pt&&(Ve=pt=null,Ke=0),Na=t,yo=e,Or=n,Mu=a,Du=o,mf=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ig(Kt,function(){return If(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=C.T,C.T=null,o=q.p,q.p=2,i=at,at|=4;try{yg(e,t,n)}finally{at=i,q.p=o,C.T=r}}Qt=1,Sf(),Cf(),Ef()}}function Sf(){if(Qt===1){Qt=0;var e=yo,t=Na,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=C.T,C.T=null;var r=q.p;q.p=2;var o=at;at|=4;try{rf(t,e);var a=Bu,i=ud(e.containerInfo),s=a.focusedElem,h=a.selectionRange;if(i!==s&&s&&s.ownerDocument&&sd(s.ownerDocument.documentElement,s)){if(h!==null&&vs(s)){var w=h.start,R=h.end;if(R===void 0&&(R=w),"selectionStart"in s)s.selectionStart=w,s.selectionEnd=Math.min(R,s.value.length);else{var O=s.ownerDocument||document,_=O&&O.defaultView||window;if(_.getSelection){var A=_.getSelection(),ue=s.textContent.length,Se=Math.min(h.start,ue),mt=h.end===void 0?Se:Math.min(h.end,ue);!A.extend&&Se>mt&&(i=mt,mt=Se,Se=i);var v=ld(s,Se),g=ld(s,mt);if(v&&g&&(A.rangeCount!==1||A.anchorNode!==v.node||A.anchorOffset!==v.offset||A.focusNode!==g.node||A.focusOffset!==g.offset)){var x=O.createRange();x.setStart(v.node,v.offset),A.removeAllRanges(),Se>mt?(A.addRange(x),A.extend(g.node,g.offset)):(x.setEnd(g.node,g.offset),A.addRange(x))}}}}for(O=[],A=s;A=A.parentNode;)A.nodeType===1&&O.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<O.length;s++){var j=O[s];j.element.scrollLeft=j.left,j.element.scrollTop=j.top}}Wl=!!Qu,Bu=Qu=null}finally{at=o,q.p=r,C.T=n}}e.current=t,Qt=2}}function Cf(){if(Qt===2){Qt=0;var e=yo,t=Na,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=C.T,C.T=null;var r=q.p;q.p=2;var o=at;at|=4;try{Zm(e,t.alternate,t)}finally{at=o,q.p=r,C.T=n}}Qt=3}}function Ef(){if(Qt===4||Qt===3){Qt=0,B();var e=yo,t=Na,n=Or,r=mf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Qt=5:(Qt=0,Na=yo=null,Af(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(go=null),hn(n),t=t.stateNode,Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=C.T,o=q.p,q.p=2,C.T=null;try{for(var a=e.onRecoverableError,i=0;i<r.length;i++){var s=r[i];a(s.value,{componentStack:s.stack})}}finally{C.T=t,q.p=o}}(Or&3)!==0&&Ml(),wr(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===zu?Ei++:(Ei=0,zu=e):Ei=0,Ai(0)}}function Af(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,li(t)))}function Ml(){return Sf(),Cf(),Ef(),If()}function If(){if(Qt!==5)return!1;var e=yo,t=Mu;Mu=0;var n=hn(Or),r=C.T,o=q.p;try{q.p=32>n?32:n,C.T=null,n=Du,Du=null;var a=yo,i=Or;if(Qt=0,Na=yo=null,Or=0,(at&6)!==0)throw Error(d(331));var s=at;if(at|=4,uf(a.current),af(a,a.current,i,n),at=s,Ai(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Xt,a)}catch{}return!0}finally{q.p=o,C.T=r,Af(e,t)}}function Pf(e,t,n){t=Qn(n,t),t=du(e.stateNode,t,2),e=uo(e,t,2),e!==null&&(dr(e,2),wr(e))}function ut(e,t,n){if(e.tag===3)Pf(e,e,n);else for(;t!==null;){if(t.tag===3){Pf(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=Pm(2),r=uo(t,n,2),r!==null&&(Rm(n,r,t,e),dr(r,2),wr(r));break}}t=t.return}}function Tu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new xg;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)||(Iu=!0,o.add(n),e=Cg.bind(null,e,t,n),t.then(e,e))}function Cg(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,pt===e&&(Ke&n)===n&&(Pt===4||Pt===3&&(Ke&62914560)===Ke&&300>Ze()-Cl?(at&2)===0&&ja(e,0):Pu|=n,za===Ke&&(za=0)),wr(e)}function Rf(e,t){t===0&&(t=Mo()),e=Wo(e,t),e!==null&&(dr(e,t),wr(e))}function Eg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Rf(e,n)}function Ag(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(d(314))}r!==null&&r.delete(t),Rf(e,n)}function Ig(e,t){return K(e,t)}var Dl=null,La=null,Lu=!1,zl=!1,Fu=!1,bo=0;function wr(e){e!==La&&e.next===null&&(La===null?Dl=La=e:La=La.next=e),zl=!0,Lu||(Lu=!0,Rg())}function Ai(e,t){if(!Fu&&zl){Fu=!0;do for(var n=!1,r=Dl;r!==null;){if(e!==0){var o=r.pendingLanes;if(o===0)var a=0;else{var i=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ft(42|e)+1)-1,a&=o&~(i&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Nf(r,a))}else a=Ke,a=be(r,r===pt?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(a&3)===0||tt(r,a)||(n=!0,Nf(r,a));r=r.next}while(n);Fu=!1}}function Pg(){Mf()}function Mf(){zl=Lu=!1;var e=0;bo!==0&&Og()&&(e=bo);for(var t=Ze(),n=null,r=Dl;r!==null;){var o=r.next,a=Df(r,t);a===0?(r.next=null,n===null?Dl=o:n.next=o,o===null&&(La=n)):(n=r,(e!==0||(a&3)!==0)&&(zl=!0)),r=o}Qt!==0&&Qt!==5||Ai(e),bo!==0&&(bo=0)}function Df(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var i=31-ft(a),s=1<<i,h=o[i];h===-1?((s&n)===0||(s&r)!==0)&&(o[i]=Zt(s,t)):h<=t&&(e.expiredLanes|=s),a&=~s}if(t=pt,n=Ke,n=be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&He(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&&He(r),hn(n)){case 2:case 8:n=it;break;case 32:n=Kt;break;case 268435456:n=Ro;break;default:n=Kt}return r=zf.bind(null,e),n=K(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&He(r),e.callbackPriority=2,e.callbackNode=null,2}function zf(e,t){if(Qt!==0&&Qt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ml()&&e.callbackNode!==n)return null;var r=Ke;return r=be(e,e===pt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(pf(e,r,t),Df(e,Ze()),e.callbackNode!=null&&e.callbackNode===n?zf.bind(null,e):null)}function Nf(e,t){if(Ml())return null;pf(e,t,!0)}function Rg(){qg(function(){(at&6)!==0?K(un,Pg):Mf()})}function $u(){if(bo===0){var e=ka;e===0&&(e=fn,fn<<=1,(fn&261888)===0&&(fn=256)),bo=e}return bo}function jf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:yr(""+e)}function Tf(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 Mg(e,t,n,r,o){if(t==="submit"&&n&&n.stateNode===o){var a=jf((o[qt]||null).action),i=r.submitter;i&&(t=(t=i[qt]||null)?jf(t.formAction):i.getAttribute("formAction"),t!==null&&(a=t,i=null));var s=new Lo("action","action",null,r,o);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(bo!==0){var h=i?Tf(o,i):new FormData(o);au(n,{pending:!0,data:h,method:o.method,action:a},null,h)}}else typeof a=="function"&&(s.preventDefault(),h=i?Tf(o,i):new FormData(o),au(n,{pending:!0,data:h,method:o.method,action:a},a,h))},currentTarget:o}]})}}for(var Ou=0;Ou<ks.length;Ou++){var Uu=ks[Ou],Dg=Uu.toLowerCase(),zg=Uu[0].toUpperCase()+Uu.slice(1);ir(Dg,"on"+zg)}ir(md,"onAnimationEnd"),ir(fd,"onAnimationIteration"),ir(pd,"onAnimationStart"),ir("dblclick","onDoubleClick"),ir("focusin","onFocus"),ir("focusout","onBlur"),ir(Xh,"onTransitionRun"),ir(Gh,"onTransitionStart"),ir(Jh,"onTransitionCancel"),ir(hd,"onTransitionEnd"),_r("onMouseEnter",["mouseout","mouseover"]),_r("onMouseLeave",["mouseout","mouseover"]),_r("onPointerEnter",["pointerout","pointerover"]),_r("onPointerLeave",["pointerout","pointerover"]),pr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pr("onBeforeInput",["compositionend","keypress","textInput","paste"]),pr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="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(" "),Ng=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ii));function Lf(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 s=r[i],h=s.instance,w=s.currentTarget;if(s=s.listener,h!==a&&o.isPropagationStopped())break e;a=s,o.currentTarget=w;try{a(o)}catch(R){Ki(R)}o.currentTarget=null,a=h}else for(i=0;i<r.length;i++){if(s=r[i],h=s.instance,w=s.currentTarget,s=s.listener,h!==a&&o.isPropagationStopped())break e;a=s,o.currentTarget=w;try{a(o)}catch(R){Ki(R)}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)||(Ff(t,e,2,!1),n.add(r))}function qu(e,t,n){var r=0;t&&(r|=4),Ff(n,e,r,t)}var Nl="_reactListening"+Math.random().toString(36).slice(2);function Wu(e){if(!e[Nl]){e[Nl]=!0,Yt.forEach(function(n){n!=="selectionchange"&&(Ng.has(n)||qu(n,!1,e),qu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nl]||(t[Nl]=!0,qu("selectionchange",!1,t))}}function Ff(e,t,n,r){switch(fp(t)){case 2:var o=s0;break;case 8:o=u0;break;default:o=oc}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 Hu(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 s=r.stateNode.containerInfo;if(s===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(;s!==null;){if(i=fr(s),i===null)return;if(h=i.tag,h===5||h===6||h===26||h===27){r=a=i;continue e}s=s.parentNode}}r=r.return}ma(function(){var w=a,R=et(n),O=[];e:{var _=gd.get(e);if(_!==void 0){var A=Lo,ue=e;switch(e){case"keypress":if(qn(n)===0)break e;case"keydown":case"keyup":A=z;break;case"focusin":ue="focus",A=fa;break;case"focusout":ue="blur",A=fa;break;case"beforeblur":case"afterblur":A=fa;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":A=Za;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":A=ss;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":A=Ye;break;case md:case fd:case pd:A=ds;break;case hd:A=Lt;break;case"scroll":case"scrollend":A=no;break;case"wheel":A=Ue;break;case"copy":case"cut":case"paste":A=Hi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":A=J;break;case"toggle":case"beforetoggle":A=Gt}var Se=(t&4)!==0,mt=!Se&&(e==="scroll"||e==="scrollend"),v=Se?_!==null?_+"Capture":null:_;Se=[];for(var g=w,x;g!==null;){var j=g;if(x=j.stateNode,j=j.tag,j!==5&&j!==26&&j!==27||x===null||v===null||(j=ar(g,v),j!=null&&Se.push(Pi(g,j,x))),mt)break;g=g.return}0<Se.length&&(_=new A(_,ue,null,n,R),O.push({event:_,listeners:Se}))}}if((t&7)===0){e:{if(_=e==="mouseover"||e==="pointerover",A=e==="mouseout"||e==="pointerout",_&&n!==ca&&(ue=n.relatedTarget||n.fromElement)&&(fr(ue)||ue[mr]))break e;if((A||_)&&(_=R.window===R?R:(_=R.ownerDocument)?_.defaultView||_.parentWindow:window,A?(ue=n.relatedTarget||n.toElement,A=w,ue=ue?fr(ue):null,ue!==null&&(mt=M(ue),Se=ue.tag,ue!==mt||Se!==5&&Se!==27&&Se!==6)&&(ue=null)):(A=null,ue=w),A!==ue)){if(Se=Za,j="onMouseLeave",v="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(Se=J,j="onPointerLeave",v="onPointerEnter",g="pointer"),mt=A==null?_:dn(A),x=ue==null?_:dn(ue),_=new Se(j,g+"leave",A,n,R),_.target=mt,_.relatedTarget=x,j=null,fr(R)===w&&(Se=new Se(v,g+"enter",ue,n,R),Se.target=x,Se.relatedTarget=mt,j=Se),mt=j,A&&ue)t:{for(Se=jg,v=A,g=ue,x=0,j=v;j;j=Se(j))x++;j=0;for(var we=g;we;we=Se(we))j++;for(;0<x-j;)v=Se(v),x--;for(;0<j-x;)g=Se(g),j--;for(;x--;){if(v===g||g!==null&&v===g.alternate){Se=v;break t}v=Se(v),g=Se(g)}Se=null}else Se=null;A!==null&&$f(O,_,A,Se,!1),ue!==null&&mt!==null&&$f(O,mt,ue,Se,!0)}}e:{if(_=w?dn(w):window,A=_.nodeName&&_.nodeName.toLowerCase(),A==="select"||A==="input"&&_.type==="file")var nt=td;else if(Yc(_))if(nd)nt=Qh;else{nt=Hh;var pe=Wh}else A=_.nodeName,!A||A.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?w&&Jr(w.elementType)&&(nt=td):nt=Vh;if(nt&&(nt=nt(e,w))){ed(O,nt,n,R);break e}pe&&pe(e,_,w),e==="focusout"&&w&&_.type==="number"&&w.memoizedProps.value!=null&&ua(_,"number",_.value)}switch(pe=w?dn(w):window,e){case"focusin":(Yc(pe)||pe.contentEditable==="true")&&(pa=pe,bs=w,oi=null);break;case"focusout":oi=bs=pa=null;break;case"mousedown":xs=!0;break;case"contextmenu":case"mouseup":case"dragend":xs=!1,cd(O,n,R);break;case"selectionchange":if(Kh)break;case"keydown":case"keyup":cd(O,n,R)}var ze;if(Vt)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?lt(e,n)&&(Xe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Xe="onCompositionStart");Xe&&(Ce&&n.locale!=="ko"&&(St||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&St&&(ze=Tt()):(Mt=R,Ja="value"in Mt?Mt.value:Mt.textContent,St=!0)),pe=jl(w,Xe),0<pe.length&&(Xe=new Vi(Xe,e,null,n,R),O.push({event:Xe,listeners:pe}),ze?Xe.data=ze:(ze=Sn(n),ze!==null&&(Xe.data=ze)))),(ze=Hn?nn(e,n):gt(e,n))&&(Xe=jl(w,"onBeforeInput"),0<Xe.length&&(pe=new Vi("onBeforeInput","beforeinput",null,n,R),O.push({event:pe,listeners:Xe}),pe.data=ze)),Mg(O,e,w,n,R)}Lf(O,t)})}function Pi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jl(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(Pi(e,o,a)),o=ar(e,t),o!=null&&r.push(Pi(e,o,a))),e.tag===3)return r;e=e.return}return[]}function jg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $f(e,t,n,r,o){for(var a=t._reactName,i=[];n!==null&&n!==r;){var s=n,h=s.alternate,w=s.stateNode;if(s=s.tag,h!==null&&h===r)break;s!==5&&s!==26&&s!==27||w===null||(h=w,o?(w=ar(n,a),w!=null&&i.unshift(Pi(n,w,h))):o||(w=ar(n,a),w!=null&&i.push(Pi(n,w,h)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var Tg=/\r\n?/g,Lg=/\u0000|\uFFFD/g;function Of(e){return(typeof e=="string"?e:""+e).replace(Tg,`
|
|
41
|
+
`).replace(Lg,"")}function Uf(e,t){return t=Of(t),Of(e)===t}function dt(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":jo(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=yr(""+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"&&dt(e,t,"name",o.name,o,null),dt(e,t,"formEncType",o.formEncType,o,null),dt(e,t,"formMethod",o.formMethod,o,null),dt(e,t,"formTarget",o.formTarget,o,null)):(dt(e,t,"encType",o.encType,o,null),dt(e,t,"method",o.method,o,null),dt(e,t,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=yr(""+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(d(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(d(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=yr(""+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=Wt.get(n)||n,wn(e,n,r))}}function Vu(e,t,n,r,o,a){switch(n){case"style":jo(e,r,a);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(d(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(d(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(!la.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[qt]||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 ln(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(d(137,t));default:dt(e,t,a,i,n,null)}}o&&dt(e,t,"srcSet",n.srcSet,n,null),r&&dt(e,t,"src",n.src,n,null);return;case"input":Qe("invalid",e);var s=a=i=o=null,h=null,w=null;for(r in n)if(n.hasOwnProperty(r)){var R=n[r];if(R!=null)switch(r){case"name":o=R;break;case"type":i=R;break;case"checked":h=R;break;case"defaultChecked":w=R;break;case"value":a=R;break;case"defaultValue":s=R;break;case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(d(137,t));break;default:dt(e,t,r,R,n,null)}}rr(e,a,s,h,w,i,o,!1);return;case"select":Qe("invalid",e),r=i=a=null;for(o in n)if(n.hasOwnProperty(o)&&(s=n[o],s!=null))switch(o){case"value":a=s;break;case"defaultValue":i=s;break;case"multiple":r=s;default:dt(e,t,o,s,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)&&(s=n[i],s!=null))switch(i){case"value":r=s;break;case"defaultValue":o=s;break;case"children":a=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(d(91));break;default:dt(e,t,i,s,n,null)}Ga(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:dt(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<Ii.length;r++)Qe(Ii[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(w in n)if(n.hasOwnProperty(w)&&(r=n[w],r!=null))switch(w){case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:dt(e,t,w,r,n,null)}return;default:if(Jr(t)){for(R in n)n.hasOwnProperty(R)&&(r=n[R],r!==void 0&&Vu(e,t,R,r,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(r=n[s],r!=null&&dt(e,t,s,r,n,null))}function Fg(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,s=null,h=null,w=null,R=null;for(A in n){var O=n[A];if(n.hasOwnProperty(A)&&O!=null)switch(A){case"checked":break;case"value":break;case"defaultValue":h=O;default:r.hasOwnProperty(A)||dt(e,t,A,null,r,O)}}for(var _ in r){var A=r[_];if(O=n[_],r.hasOwnProperty(_)&&(A!=null||O!=null))switch(_){case"type":a=A;break;case"name":o=A;break;case"checked":w=A;break;case"defaultChecked":R=A;break;case"value":i=A;break;case"defaultValue":s=A;break;case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(d(137,t));break;default:A!==O&&dt(e,t,_,A,r,O)}}sa(e,i,s,h,w,R,a,o);return;case"select":A=i=s=_=null;for(a in n)if(h=n[a],n.hasOwnProperty(a)&&h!=null)switch(a){case"value":break;case"multiple":A=h;default:r.hasOwnProperty(a)||dt(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":_=a;break;case"defaultValue":s=a;break;case"multiple":i=a;default:a!==h&&dt(e,t,o,a,r,h)}t=s,n=i,r=A,_!=null?Gr(e,!!n,_,!1):!!r!=!!n&&(t!=null?Gr(e,!!n,t,!0):Gr(e,!!n,n?[]:"",!1));return;case"textarea":A=_=null;for(s in n)if(o=n[s],n.hasOwnProperty(s)&&o!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:dt(e,t,s,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":_=o;break;case"defaultValue":A=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(d(91));break;default:o!==a&&dt(e,t,i,o,r,a)}Ui(e,_,A);return;case"option":for(var ue in n)if(_=n[ue],n.hasOwnProperty(ue)&&_!=null&&!r.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:dt(e,t,ue,null,r,_)}for(h in r)if(_=r[h],A=n[h],r.hasOwnProperty(h)&&_!==A&&(_!=null||A!=null))switch(h){case"selected":e.selected=_&&typeof _!="function"&&typeof _!="symbol";break;default:dt(e,t,h,_,r,A)}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)_=n[Se],n.hasOwnProperty(Se)&&_!=null&&!r.hasOwnProperty(Se)&&dt(e,t,Se,null,r,_);for(w in r)if(_=r[w],A=n[w],r.hasOwnProperty(w)&&_!==A&&(_!=null||A!=null))switch(w){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(d(137,t));break;default:dt(e,t,w,_,r,A)}return;default:if(Jr(t)){for(var mt in n)_=n[mt],n.hasOwnProperty(mt)&&_!==void 0&&!r.hasOwnProperty(mt)&&Vu(e,t,mt,void 0,r,_);for(R in r)_=r[R],A=n[R],!r.hasOwnProperty(R)||_===A||_===void 0&&A===void 0||Vu(e,t,R,_,r,A);return}}for(var v in n)_=n[v],n.hasOwnProperty(v)&&_!=null&&!r.hasOwnProperty(v)&&dt(e,t,v,null,r,_);for(O in r)_=r[O],A=n[O],!r.hasOwnProperty(O)||_===A||_==null&&A==null||dt(e,t,O,_,r,A)}function qf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $g(){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,s=o.duration;if(a&&s&&qf(i)){for(i=0,s=o.responseEnd,r+=1;r<n.length;r++){var h=n[r],w=h.startTime;if(w>s)break;var R=h.transferSize,O=h.initiatorType;R&&qf(O)&&(h=h.responseEnd,i+=R*(h<s?1:(s-w)/(h-w)))}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 Qu=null,Bu=null;function Tl(e){return e.nodeType===9?e:e.ownerDocument}function Wf(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 Hf(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 Ku(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 Xu=null;function Og(){var e=window.event;return e&&e.type==="popstate"?e===Xu?!1:(Xu=e,!0):(Xu=null,!1)}var Vf=typeof setTimeout=="function"?setTimeout:void 0,Ug=typeof clearTimeout=="function"?clearTimeout:void 0,Qf=typeof Promise=="function"?Promise:void 0,qg=typeof queueMicrotask=="function"?queueMicrotask:typeof Qf<"u"?function(e){return Qf.resolve(null).then(e).catch(Wg)}:Vf;function Wg(e){setTimeout(function(){throw e})}function xo(e){return e==="head"}function Bf(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),Ua(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Ri(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ri(n);for(var a=n.firstChild;a;){var i=a.nextSibling,s=a.nodeName;a[kr]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=i}}else n==="body"&&Ri(e.ownerDocument.body);n=o}while(n);Ua(t)}function Kf(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 Gu(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":Gu(n),Qa(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Hg(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 Vg(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 Xf(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 Ju(e){return e.data==="$?"||e.data==="$~"}function Zu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Qg(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 Yu=null;function Gf(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 Jf(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 Zf(e,t,n){switch(t=Tl(n),e){case"html":if(e=t.documentElement,!e)throw Error(d(452));return e;case"head":if(e=t.head,!e)throw Error(d(453));return e;case"body":if(e=t.body,!e)throw Error(d(454));return e;default:throw Error(d(451))}}function Ri(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Qa(e)}var Jn=new Map,Yf=new Set;function Ll(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ur=q.d;q.d={f:Bg,r:Kg,D:Xg,C:Gg,L:Jg,m:Zg,X:e0,S:Yg,M:t0};function Bg(){var e=Ur.f(),t=Il();return e||t}function Kg(e){var t=Kr(e);t!==null&&t.tag===5&&t.type==="form"?hm(t):Ur.r(e)}var Fa=typeof document>"u"?null:document;function ep(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+'"]'),Yf.has(o)||(Yf.add(o),e={rel:e,crossOrigin:n,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),ln(t,"link",e),jt(t),r.head.appendChild(t)))}}function Xg(e){Ur.D(e),ep("dns-prefetch",e,null)}function Gg(e,t){Ur.C(e,t),ep("preconnect",e,t)}function Jg(e,t,n){Ur.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)}Jn.has(a)||(e=E({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Jn.set(a,e),r.querySelector(o)!==null||t==="style"&&r.querySelector(Mi(a))||t==="script"&&r.querySelector(Di(a))||(t=r.createElement("link"),ln(t,"link",e),jt(t),r.head.appendChild(t)))}}function Zg(e,t){Ur.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(!Jn.has(a)&&(e=E({rel:"modulepreload",href:e},t),Jn.set(a,e),n.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Di(a)))return}r=n.createElement("link"),ln(r,"link",e),jt(r),n.head.appendChild(r)}}}function Yg(e,t,n){Ur.S(e,t,n);var r=Fa;if(r&&e){var o=Rt(r).hoistableStyles,a=$a(e);t=t||"default";var i=o.get(a);if(!i){var s={loading:0,preload:null};if(i=r.querySelector(Mi(a)))s.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Jn.get(a))&&ec(e,n);var h=i=r.createElement("link");jt(h),ln(h,"link",e),h._p=new Promise(function(w,R){h.onload=w,h.onerror=R}),h.addEventListener("load",function(){s.loading|=1}),h.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Fl(i,t,r)}i={type:"stylesheet",instance:i,count:1,state:s},o.set(a,i)}}}function e0(e,t){Ur.X(e,t);var n=Fa;if(n&&e){var r=Rt(n).hoistableScripts,o=Oa(e),a=r.get(o);a||(a=n.querySelector(Di(o)),a||(e=E({src:e,async:!0},t),(t=Jn.get(o))&&tc(e,t),a=n.createElement("script"),jt(a),ln(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function t0(e,t){Ur.M(e,t);var n=Fa;if(n&&e){var r=Rt(n).hoistableScripts,o=Oa(e),a=r.get(o);a||(a=n.querySelector(Di(o)),a||(e=E({src:e,async:!0,type:"module"},t),(t=Jn.get(o))&&tc(e,t),a=n.createElement("script"),jt(a),ln(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(o,a))}}function tp(e,t,n,r){var o=(o=ve.current)?Ll(o):null;if(!o)throw Error(d(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=Rt(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=Rt(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(Mi(e)))&&!a._p&&(i.instance=a,i.state.loading=5),Jn.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},Jn.set(e,n),a||n0(o,e,n,i.state))),t&&r===null)throw Error(d(528,""));return i}if(t&&r!==null)throw Error(d(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=Rt(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(d(444,e))}}function $a(e){return'href="'+en(e)+'"'}function Mi(e){return'link[rel="stylesheet"]['+e+"]"}function np(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function n0(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}),ln(t,"link",n),jt(t),e.head.appendChild(t))}function Oa(e){return'[src="'+en(e)+'"]'}function Di(e){return"script[async]"+e}function rp(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,jt(r),r;var o=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),jt(r),ln(r,"style",o),Fl(r,n.precedence,e),t.instance=r;case"stylesheet":o=$a(n.href);var a=e.querySelector(Mi(o));if(a)return t.state.loading|=4,t.instance=a,jt(a),a;r=np(n),(o=Jn.get(o))&&ec(r,o),a=(e.ownerDocument||e).createElement("link"),jt(a);var i=a;return i._p=new Promise(function(s,h){i.onload=s,i.onerror=h}),ln(a,"link",r),t.state.loading|=4,Fl(a,n.precedence,e),t.instance=a;case"script":return a=Oa(n.src),(o=e.querySelector(Di(a)))?(t.instance=o,jt(o),o):(r=n,(o=Jn.get(a))&&(r=E({},n),tc(r,o)),e=e.ownerDocument||e,o=e.createElement("script"),jt(o),ln(o,"link",r),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Fl(r,n.precedence,e));return t.instance}function Fl(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 s=r[i];if(s.dataset.precedence===t)a=s;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 ec(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function tc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var $l=null;function op(e,t,n){if($l===null){var r=new Map,o=$l=new Map;o.set(n,r)}else o=$l,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 s=r.get(i);s?s.push(a):r.set(i,[a])}}return r}function ap(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function r0(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 ip(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function o0(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(Mi(o));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ol.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,jt(a);return}a=t.ownerDocument||t,r=np(r),(o=Jn.get(o))&&ec(r,o),a=a.createElement("link"),jt(a);var i=a;i._p=new Promise(function(s,h){i.onload=s,i.onerror=h}),ln(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=Ol.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var nc=0;function a0(e,t){return e.stylesheets&&e.count===0&&ql(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ql(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&nc===0&&(nc=62500*$g());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ql(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>nc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function Ol(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ql(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ul=null;function ql(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ul=new Map,t.forEach(i0,e),Ul=null,Ol.call(e))}function i0(e,t){if(!(t.state.loading&4)){var n=Ul.get(e);if(n)var r=n.get(null);else{n=new Map,Ul.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=Ol.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 zi={$$typeof:oe,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function l0(e,t,n,r,o,a,i,s,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 lp(e,t,n,r,o,a,i,s,h,w,R,O){return e=new l0(e,t,n,i,h,w,R,O,s),t=1,a===!0&&(t|=24),a=jn(3,null,null,t),e.current=a,a.stateNode=e,t=js(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},$s(a),e}function sp(e){return e?(e=ya,e):ya}function up(e,t,n,r,o,a){o=sp(o),r.context===null?r.context=o:r.pendingContext=o,r=so(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),di(n,e,t))}function cp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function rc(e,t){cp(e,t),(e=e.alternate)&&cp(e,t)}function dp(e){if(e.tag===13||e.tag===31){var t=Wo(e,67108864);t!==null&&Pn(t,e,67108864),rc(e,67108864)}}function mp(e){if(e.tag===13||e.tag===31){var t=On();t=er(t);var n=Wo(e,t);n!==null&&Pn(n,e,t),rc(e,t)}}var Wl=!0;function s0(e,t,n,r){var o=C.T;C.T=null;var a=q.p;try{q.p=2,oc(e,t,n,r)}finally{q.p=a,C.T=o}}function u0(e,t,n,r){var o=C.T;C.T=null;var a=q.p;try{q.p=8,oc(e,t,n,r)}finally{q.p=a,C.T=o}}function oc(e,t,n,r){if(Wl){var o=ac(r);if(o===null)Hu(e,t,r,Hl,n),pp(e,r);else if(d0(o,e,t,n,r))r.stopPropagation();else if(pp(e,r),t&4&&-1<c0.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 s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var h=1<<31-ft(i);s.entanglements[1]|=h,i&=~h}wr(a),(at&6)===0&&(El=Ze()+500,Ai(0))}}break;case 31:case 13:s=Wo(a,2),s!==null&&Pn(s,a,2),Il(),rc(a,2)}if(a=ac(r),a===null&&Hu(e,t,r,Hl,n),a===o)break;o=a}o!==null&&r.stopPropagation()}else Hu(e,t,r,null,n)}}function ac(e){return e=et(e),ic(e)}var Hl=null;function ic(e){if(Hl=null,e=fr(e),e!==null){var t=M(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=L(t),e!==null)return e;e=null}else if(n===31){if(e=X(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 Hl=e,null}function fp(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 Ro:return 268435456;default:return 32}default:return 32}}var lc=!1,wo=null,ko=null,_o=null,Ni=new Map,ji=new Map,So=[],c0="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 pp(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":ji.delete(t.pointerId)}}function Ti(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&&dp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function d0(e,t,n,r,o){switch(t){case"focusin":return wo=Ti(wo,e,t,n,r,o),!0;case"dragenter":return ko=Ti(ko,e,t,n,r,o),!0;case"mouseover":return _o=Ti(_o,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return Ni.set(a,Ti(Ni.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,ji.set(a,Ti(ji.get(a)||null,e,t,n,r,o)),!0}return!1}function hp(e){var t=fr(e.target);if(t!==null){var n=M(t);if(n!==null){if(t=n.tag,t===13){if(t=L(n),t!==null){e.blockedOn=t,Br(e.priority,function(){mp(n)});return}}else if(t===31){if(t=X(n),t!==null){e.blockedOn=t,Br(e.priority,function(){mp(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 Vl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ac(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ca=r,n.target.dispatchEvent(r),ca=null}else return t=Kr(n),t!==null&&dp(t),e.blockedOn=n,!1;t.shift()}return!0}function gp(e,t,n){Vl(e)&&n.delete(t)}function m0(){lc=!1,wo!==null&&Vl(wo)&&(wo=null),ko!==null&&Vl(ko)&&(ko=null),_o!==null&&Vl(_o)&&(_o=null),Ni.forEach(gp),ji.forEach(gp)}function Ql(e,t){e.blockedOn===t&&(e.blockedOn=null,lc||(lc=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,m0)))}var Bl=null;function yp(e){Bl!==e&&(Bl=e,u.unstable_scheduleCallback(u.unstable_NormalPriority,function(){Bl===e&&(Bl=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(ic(r||n)===null)continue;break}var a=Kr(n);a!==null&&(e.splice(t,3),t-=3,au(a,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Ua(e){function t(h){return Ql(h,e)}wo!==null&&Ql(wo,e),ko!==null&&Ql(ko,e),_o!==null&&Ql(_o,e),Ni.forEach(t),ji.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);)hp(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[qt]||null;if(typeof a=="function")i||yp(n);else if(i){var s=null;if(a&&a.hasAttribute("formAction")){if(o=a,i=a[qt]||null)s=i.formAction;else if(ic(o)!==null)continue}else s=i.action;typeof s=="function"?n[r+1]=s:(n.splice(r,3),r-=3),yp(n)}}}function vp(){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 sc(e){this._internalRoot=e}Kl.prototype.render=sc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(d(409));var n=t.current,r=On();up(n,r,e,t,null,null)},Kl.prototype.unmount=sc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;up(e.current,2,null,e,null,null),Il(),t[mr]=null}};function Kl(e){this._internalRoot=e}Kl.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&&hp(e)}};var bp=l.version;if(bp!=="19.2.1")throw Error(d(527,bp,"19.2.1"));q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(d(188)):(e=Object.keys(e).join(","),Error(d(268,e)));return e=y(t),e=e!==null?$(e):null,e=e===null?null:e.stateNode,e};var f0={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xl.isDisabled&&Xl.supportsFiber)try{Xt=Xl.inject(f0),Nt=Xl}catch{}}return qa.createRoot=function(e,t){if(!k(e))throw Error(d(299));var n=!1,r="",o=Cm,a=Em,i=Am;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=lp(e,1,!1,null,null,n,r,null,o,a,i,vp),e[mr]=t.current,Wu(e),new sc(t)},qa.hydrateRoot=function(e,t,n){if(!k(e))throw Error(d(299));var r=!1,o="",a=Cm,i=Em,s=Am,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&&(s=n.onRecoverableError),n.formState!==void 0&&(h=n.formState)),t=lp(e,1,!0,t,n??null,r,o,h,a,i,s,vp),t.context=sp(null),n=t.current,r=On(),r=er(r),o=so(r),o.callback=null,uo(n,o,r),n=r,t.current.lanes=n,dr(t,n),wr(t),e[mr]=t.current,Wu(e),new Kl(t)},qa.version="19.2.1",qa}var bc;function Cp(){if(bc)return Zl.exports;bc=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(l){console.error(l)}}return u(),Zl.exports=Sp(),Zl.exports}var Ep=Cp();const xc=cr(Ep);var wc={exports:{}},Wa={};/**
|
|
42
|
+
* @license React
|
|
43
|
+
* react-jsx-runtime.production.js
|
|
44
|
+
*
|
|
45
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the MIT license found in the
|
|
48
|
+
* LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/var kc;function Ap(){if(kc)return Wa;kc=1;var u=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function f(d,k,M){var L=null;if(M!==void 0&&(L=""+M),k.key!==void 0&&(L=""+k.key),"key"in k){M={};for(var X in k)X!=="key"&&(M[X]=k[X])}else M=k;return k=M.ref,{$$typeof:u,type:d,key:L,ref:k!==void 0?k:null,props:M}}return Wa.Fragment=l,Wa.jsx=f,Wa.jsxs=f,Wa}var _c;function Ip(){return _c||(_c=1,wc.exports=Ap()),wc.exports}var m=Ip(),es=yc();/**
|
|
50
|
+
* @license lucide-react v0.563.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const Sc=(...u)=>u.filter((l,f,d)=>!!l&&l.trim()!==""&&d.indexOf(l)===f).join(" ").trim();/**
|
|
55
|
+
* @license lucide-react v0.563.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/const Pp=u=>u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
60
|
+
* @license lucide-react v0.563.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/const Rp=u=>u.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,f,d)=>d?d.toUpperCase():f.toLowerCase());/**
|
|
65
|
+
* @license lucide-react v0.563.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const Cc=u=>{const l=Rp(u);return l.charAt(0).toUpperCase()+l.slice(1)};/**
|
|
70
|
+
* @license lucide-react v0.563.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/var Mp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
75
|
+
* @license lucide-react v0.563.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/const Dp=u=>{for(const l in u)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};/**
|
|
80
|
+
* @license lucide-react v0.563.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/const zp=b.forwardRef(({color:u="currentColor",size:l=24,strokeWidth:f=2,absoluteStrokeWidth:d,className:k="",children:M,iconNode:L,...X},S)=>b.createElement("svg",{ref:S,...Mp,width:l,height:l,stroke:u,strokeWidth:d?Number(f)*24/Number(l):f,className:Sc("lucide",k),...!M&&!Dp(X)&&{"aria-hidden":"true"},...X},[...L.map(([y,$])=>b.createElement(y,$)),...Array.isArray(M)?M:[M]]));/**
|
|
85
|
+
* @license lucide-react v0.563.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/const Rn=(u,l)=>{const f=b.forwardRef(({className:d,...k},M)=>b.createElement(zp,{ref:M,iconNode:l,className:Sc(`lucide-${Pp(Cc(u))}`,`lucide-${u}`,d),...k}));return f.displayName=Cc(u),f};/**
|
|
90
|
+
* @license lucide-react v0.563.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const Np=Rn("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
95
|
+
* @license lucide-react v0.563.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const jp=Rn("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
100
|
+
* @license lucide-react v0.563.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const Tp=Rn("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
105
|
+
* @license lucide-react v0.563.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const Lp=Rn("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
110
|
+
* @license lucide-react v0.563.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const Fp=Rn("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
|
+
* @license lucide-react v0.563.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const $p=Rn("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
|
+
* @license lucide-react v0.563.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const ts=Rn("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
|
+
* @license lucide-react v0.563.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const Ec=Rn("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
|
+
* @license lucide-react v0.563.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const Ac=Rn("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
|
+
* @license lucide-react v0.563.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const Op=Rn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
140
|
+
* @license lucide-react v0.563.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const Ic=Rn("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 Pc=Rn("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 ns=Rn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vn=":not([data-admesh-ad-content], [data-admesh-ad-content] *)",Rc=`
|
|
155
|
+
.admesh-publisher-panel {
|
|
156
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
157
|
+
text-align: left;
|
|
158
|
+
line-height: 1.5;
|
|
159
|
+
-webkit-font-smoothing: antialiased;
|
|
160
|
+
}
|
|
161
|
+
.admesh-publisher-panel *${vn}, .admesh-publisher-panel *${vn}::before, .admesh-publisher-panel *${vn}::after {
|
|
162
|
+
box-sizing: border-box;
|
|
163
|
+
}
|
|
164
|
+
.admesh-publisher-panel button${vn}, .admesh-publisher-panel input${vn} { font-family: inherit; }
|
|
165
|
+
.admesh-publisher-panel button${vn} { transition: border-color 150ms ease, background-color 150ms ease; }
|
|
166
|
+
.admesh-publisher-panel button${vn}:focus-visible, .admesh-publisher-panel a${vn}:focus-visible {
|
|
167
|
+
outline: 2px solid var(--publisher-accent);
|
|
168
|
+
outline-offset: 2px;
|
|
169
|
+
}
|
|
170
|
+
.admesh-publisher-panel .admesh-publisher-suggestion:hover,
|
|
171
|
+
.admesh-publisher-panel .admesh-publisher-source:hover {
|
|
172
|
+
border-color: var(--publisher-accent) !important;
|
|
173
|
+
}
|
|
174
|
+
.admesh-publisher-composer:focus-within {
|
|
175
|
+
outline: 2px solid var(--publisher-accent);
|
|
176
|
+
outline-offset: 2px;
|
|
177
|
+
}
|
|
178
|
+
.admesh-publisher-panel .admesh-publisher-source { transition: border-color 150ms ease; }
|
|
179
|
+
.admesh-publisher-panel .admesh-publisher-suggestion { overflow-wrap: anywhere; }
|
|
180
|
+
.admesh-publisher-panel input${vn} { min-width: 0; }
|
|
181
|
+
.admesh-publisher-panel a${vn} { text-underline-offset: 3px; }
|
|
182
|
+
@media (prefers-reduced-motion: reduce) {
|
|
183
|
+
.admesh-publisher-panel *${vn}, .admesh-publisher-panel *${vn}::before, .admesh-publisher-panel *${vn}::after {
|
|
184
|
+
animation: none !important;
|
|
185
|
+
transition: none !important;
|
|
186
|
+
scroll-behavior: auto !important;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
@media (max-width: 767px) {
|
|
190
|
+
.admesh-publisher-panel:not([data-compact="true"]) input${vn} { font-size: 16px !important; }
|
|
191
|
+
}
|
|
192
|
+
`;function Up({value:u,onChange:l,onSend:f,onStop:d,onSuggestion:k,suggestions:M,registerSuggestion:L,open:X,onOpenChange:S,loading:y,analyzing:$,compact:E,expanded:W,suggestionPlacement:N="below",showLogo:P=!0,logoUrl:H,title:V,placeholder:ee,colors:se}){const oe=b.useId(),re=b.useRef(null),ae=b.useRef(null),Q=b.useRef(null),[U,he]=b.useState({visibility:"hidden"}),ce=X&&!y&&($||M.length>0);b.useLayoutEffect(()=>{var te;if(!ce)return;const le=()=>{var Pe,C;const q=(Pe=re.current)==null?void 0:Pe.getBoundingClientRect();if(!q)return;const ie=((C=window.visualViewport)==null?void 0:C.height)??window.innerHeight,ke=document.documentElement.clientWidth,Ee=ie-q.bottom-16,p=q.top-16,I=N==="above"?!(p<96&&Ee>p):Ee<96&&p>Ee;he({position:"fixed",left:Math.max(8,Math.min(q.left,ke-q.width-8)),width:Math.min(q.width,ke-16),maxHeight:Math.max(40,Math.min(300,I?p:Ee)),...I?{bottom:window.innerHeight-q.top+8}:{top:q.bottom+8},zIndex:2147483002})},xe=Pe=>{var C,q;const ie=Pe.target;!((C=re.current)!=null&&C.contains(ie))&&!((q=Q.current)!=null&&q.contains(ie))&&S(!1)};return le(),window.addEventListener("resize",le),window.addEventListener("scroll",le,!0),(te=window.visualViewport)==null||te.addEventListener("resize",le),document.addEventListener("pointerdown",xe),()=>{var Pe;window.removeEventListener("resize",le),window.removeEventListener("scroll",le,!0),(Pe=window.visualViewport)==null||Pe.removeEventListener("resize",le),document.removeEventListener("pointerdown",xe)}},[ce,N,S]);const ye=te=>{var le,xe;!((le=re.current)!=null&&le.contains(te))&&!((xe=Q.current)!=null&&xe.contains(te))&&S(!1)},$e=()=>{!u.trim()||y||(S(!1),f())};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{ref:re,className:"admesh-publisher-composer",onBlur:te=>ye(te.relatedTarget),onClick:te=>{var le;te.target.closest("button, a")||((le=ae.current)==null||le.focus(),S(!0))},style:{display:"flex",alignItems:"center",gap:E?8:12,minWidth:0,width:"100%",flexShrink:0,border:`1px solid ${se.border}`,borderRadius:8,background:se.surface,cursor:"text",padding:E?"6px":"8px 8px 8px 12px"},children:[P&&!W&&m.jsx("div",{style:{width:E?24:32,height:E?24:32,display:"grid",placeItems:"center",flexShrink:0,color:se.accent},children:H?m.jsx("img",{src:H,alt:`${V} logo`,style:{width:"100%",height:"100%",objectFit:"contain"}}):m.jsx(ts,{size:E?18:21,strokeWidth:1.5,"aria-label":V})}),m.jsx("input",{ref:ae,type:"text",value:u,placeholder:ee,"aria-label":"Ask the publisher assistant","aria-expanded":ce,"aria-controls":ce?oe:void 0,onFocus:()=>S(!0),onChange:te=>{l(te.target.value),S(!0)},onKeyDown:te=>{var le,xe;te.nativeEvent.isComposing||(te.key==="Escape"&&(te.preventDefault(),S(!1)),te.key==="ArrowDown"&&(te.preventDefault(),ce?(xe=(le=Q.current)==null?void 0:le.querySelector("button"))==null||xe.focus():S(!0)),te.key==="Enter"&&(te.preventDefault(),$e()))},style:{flex:1,minWidth:0,border:"none",outline:"none",padding:E?"6px 0":"10px 0",fontSize:E?13:15,color:se.text,background:"transparent"}}),m.jsxs("span",{style:{flexShrink:0,fontSize:E?8:9,lineHeight:1.3,color:se.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&&!u.trim(),onClick:y?d:$e,style:{display:"grid",placeItems:"center",flexShrink:0,width:E?32:40,height:E?32:40,border:"none",borderRadius:6,background:se.accent,color:se.accentText,cursor:"pointer",opacity:!y&&!u.trim()?.5:1},children:y?m.jsx(Op,{size:14,fill:"currentColor","aria-hidden":"true"}):m.jsx(jp,{size:18,"aria-hidden":"true"})})]}),ce&&es.createPortal(m.jsxs("div",{ref:Q,id:oe,role:"group","aria-label":"Suggested questions",className:"admesh-publisher-panel",onBlur:te=>ye(te.relatedTarget),onKeyDown:te=>{var le,xe,Pe,C;if(te.key==="Escape"&&(te.preventDefault(),(le=ae.current)==null||le.focus(),S(!1)),te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();const q=Array.from(((xe=Q.current)==null?void 0:xe.querySelectorAll("button"))??[]),ie=q.indexOf(document.activeElement)+(te.key==="ArrowDown"?1:-1);ie<0?(Pe=ae.current)==null||Pe.focus():(C=q[Math.min(ie,q.length-1)])==null||C.focus()}},style:{...U,"--publisher-accent":se.accent,padding:6,border:`1px solid ${se.border}`,borderRadius:10,background:se.surface,overflowY:"auto",overscrollBehavior:"contain",boxShadow:"0 8px 24px rgba(15,23,42,0.1)"},children:[m.jsx("style",{children:Rc}),$&&!M.length?m.jsx("div",{role:"status",style:{padding:12,color:se.muted,fontSize:13},children:"Finding suggested questions\u2026"}):M.map(te=>m.jsxs("button",{ref:L(te.id),type:"button",className:"admesh-publisher-suggestion","data-admesh-sponsored":te.is_sponsored?"true":void 0,onClick:()=>{S(!1),k(te)},style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,width:"100%",minWidth:0,margin:"0 0 4px",padding:"10px 12px",border:`1px solid ${te.is_sponsored?se.accent:se.border}`,borderRadius:6,textAlign:"left",fontSize:13,fontWeight:500,lineHeight:1.4,cursor:"pointer",background:te.is_sponsored?se.accent:se.surface,color:te.is_sponsored?se.accentText:se.text},children:[m.jsx("span",{children:te.text}),te.is_sponsored&&m.jsx("span",{style:{fontSize:10,flexShrink:0},children:"Ad"})]},te.id))]}),document.body)]})}let Io=!1;try{typeof globalThis.importMeta<"u"&&(Wr=globalThis.importMeta.env)!=null&&Wr.PROD&&(Io=!0)}catch{}Io||(Io=typeof process<"u"&&!0||typeof process<"u"&&!0);const F={log:(...u)=>{Io||console.log(...u)},warn:(...u)=>{Io||console.warn(...u)},error:(...u)=>{console.error(...u)},info:(...u)=>{Io||console.info(...u)},debug:(...u)=>{Io||console.debug(...u)}};function qp(u,l,f){const d=u*l>242500;return{visibilityThreshold:d?.3:.5,minimumDuration:1e3,isLargeAd:d,...f}}function Wp(u){return u<768?"mobile":u<1024?"tablet":"desktop"}function Hp(u){const l=u.getBoundingClientRect(),f=window.innerHeight||document.documentElement.clientHeight,d=window.innerWidth||document.documentElement.clientWidth,k=l.height,M=l.width;if(k===0||M===0)return 0;const L=Math.max(0,l.top),X=Math.min(f,l.bottom),S=Math.max(0,l.left),y=Math.min(d,l.right),$=Math.max(0,X-L),E=Math.max(0,y-S),W=$*E,N=k*M;return N>0?W/N:0}function Mc(){const u=window.innerHeight,l=document.documentElement.scrollHeight,f=window.pageYOffset||document.documentElement.scrollTop,d=l-u;return d<=0?100:Math.min(100,f/d*100)}function Vp(u){const l=u.getBoundingClientRect(),f=window.pageYOffset||document.documentElement.scrollTop,d=window.pageXOffset||document.documentElement.scrollLeft;return{top:l.top+f,left:l.left+d}}function Qp(u){const l=u.getBoundingClientRect(),f=Vp(u),d=window.innerWidth||document.documentElement.clientWidth,k=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:Wp(d),viewportWidth:d,viewportHeight:k,adWidth:l.width,adHeight:l.height,adPositionTop:f.top,adPositionLeft:f.left,isDarkMode:M,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}function Bp(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}function Kp(u,l,f){return u>=f.visibilityThreshold&&l>=f.minimumDuration}function Dc(u=new Date){return u.toISOString()}function Xp(u){return u.length===0?0:u.reduce((l,f)=>l+f,0)/u.length}function zc(u,l){let f;return function(...d){f||(u(...d),f=!0,setTimeout(()=>f=!1,l))}}let Gp={enabled:!0,apiEndpoint:"",enableBatching:!1,batchSize:10,batchTimeout:5e3,debug:!1,enableRetry:!1,maxRetries:3,retryDelay:1e3},Jp=!1;function Zp({productId:u,offerId:l,agentId:f,recommendationId:d,elementRef:k,config:M}){const L={...Gp,...M},X=b.useRef(Bp()),[S,y]=b.useState({isVisible:!1,isViewable:!1,visibilityPercentage:0,timeMetrics:{loadedAt:Dc(),totalVisibleDuration:0,totalViewableDuration:0,totalHoverDuration:0,totalFocusDuration:0},engagementMetrics:{currentScrollDepth:0,viewportEnterCount:0,viewportExitCount:0,hoverCount:0,wasClicked:!1,maxVisibilityPercentage:0,averageVisibilityPercentage:0},isTracking:L.enabled}),$=b.useRef(null),E=b.useRef(null),W=b.useRef(null),N=b.useRef(null),P=b.useRef(null),H=b.useRef([]),V=b.useRef([]),ee=b.useRef(null),se=b.useCallback(Q=>{L.debug&&F.log(`[AdMesh Viewability] ${Q}`)},[L.debug]),oe=b.useCallback(async(Q,U)=>{if(!(!L.enabled||Jp||!k.current||!$.current)&&(se(`Analytics disabled - skipping event: ${Q}`),L.onEvent)){const he=Qp(k.current),ce={eventType:Q,timestamp:Dc(),sessionId:X.current,productId:u,offerId:l,agentId:f,recommendationId:d,timeMetrics:S.timeMetrics,engagementMetrics:S.engagementMetrics,contextMetrics:he,mrcStandards:$.current,isViewable:S.isViewable,metadata:U};L.onEvent(ce)}},[L,u,l,f,d,k,S,se]),re=b.useCallback(async()=>{V.current.length!==0&&(se("Analytics disabled - clearing batch without sending"),V.current=[],ee.current&&(clearTimeout(ee.current),ee.current=null))},[se]),ae=b.useCallback(zc(()=>{if(!k.current)return;const Q=Hp(k.current),U=Date.now(),he=new Date(S.timeMetrics.loadedAt).getTime();y(ce=>{const ye={...ce};Q>0&&H.current.push(Q);const $e=ce.isVisible,te=Q>0;if(te&&!$e)E.current=U,ye.engagementMetrics.viewportEnterCount++,ye.timeMetrics.timeToFirstVisible||(ye.timeMetrics.timeToFirstVisible=U-he,ye.engagementMetrics.scrollDepthAtFirstVisible=Mc(),oe("ad_visible"));else if(!te&&$e){if(E.current){const le=U-E.current;ye.timeMetrics.totalVisibleDuration+=le,E.current=null}ye.engagementMetrics.viewportExitCount++,oe("ad_hidden")}else if(te&&$e&&E.current){const le=U-E.current;ye.timeMetrics.totalVisibleDuration+=le,E.current=U}if(ye.isVisible=te,ye.visibilityPercentage=Q,Q>ye.engagementMetrics.maxVisibilityPercentage&&(ye.engagementMetrics.maxVisibilityPercentage=Q),H.current.length>0&&(ye.engagementMetrics.averageVisibilityPercentage=Xp(H.current)),$.current){const le=ce.isViewable,xe=Kp(Q,ye.timeMetrics.totalVisibleDuration,$.current);if(xe&&!le)ye.isViewable=!0,ye.timeMetrics.timeToViewable=U-he,W.current=U,oe("ad_viewable");else if(xe&&le&&W.current){const Pe=U-W.current;ye.timeMetrics.totalViewableDuration+=Pe,W.current=U}}return ye.engagementMetrics.currentScrollDepth=Mc(),ye})},100),[k,S.timeMetrics.loadedAt,oe]);return b.useEffect(()=>{if(!k.current)return;const Q=k.current.getBoundingClientRect();$.current=qp(Q.width,Q.height,L.mrcStandards),se("Initialized MRC standards"),oe("ad_loaded")},[k,L.mrcStandards,se,oe]),b.useEffect(()=>{if(!L.enabled||!k.current)return;const Q=new IntersectionObserver(U=>{U.forEach(()=>{ae()})},{threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],rootMargin:"0px"});return Q.observe(k.current),()=>{Q.disconnect()}},[L.enabled,k,ae]),b.useEffect(()=>{if(!L.enabled)return;const Q=zc(()=>{ae()},100);return window.addEventListener("scroll",Q,{passive:!0}),()=>window.removeEventListener("scroll",Q)},[L.enabled,ae]),b.useEffect(()=>{if(!L.enabled||!k.current)return;const Q=k.current,U=()=>{N.current=Date.now(),y(ce=>({...ce,engagementMetrics:{...ce.engagementMetrics,hoverCount:ce.engagementMetrics.hoverCount+1}})),oe("ad_hover_start")},he=()=>{if(N.current){const ce=Date.now()-N.current;y(ye=>({...ye,timeMetrics:{...ye.timeMetrics,totalHoverDuration:ye.timeMetrics.totalHoverDuration+ce}})),N.current=null,oe("ad_hover_end",{hoverDuration:ce})}};return Q.addEventListener("mouseenter",U),Q.addEventListener("mouseleave",he),()=>{Q.removeEventListener("mouseenter",U),Q.removeEventListener("mouseleave",he)}},[L.enabled,k,oe]),b.useEffect(()=>{if(!L.enabled||!k.current)return;const Q=k.current,U=()=>{P.current=Date.now(),oe("ad_focus")},he=()=>{if(P.current){const ce=Date.now()-P.current;y(ye=>({...ye,timeMetrics:{...ye.timeMetrics,totalFocusDuration:ye.timeMetrics.totalFocusDuration+ce}})),P.current=null,oe("ad_blur",{focusDuration:ce})}};return Q.addEventListener("focus",U),Q.addEventListener("blur",he),()=>{Q.removeEventListener("focus",U),Q.removeEventListener("blur",he)}},[L.enabled,k,oe]),b.useEffect(()=>{if(!L.enabled||!k.current)return;const Q=k.current,U=()=>{y(he=>({...he,engagementMetrics:{...he.engagementMetrics,wasClicked:!0}})),oe("ad_click")};return Q.addEventListener("click",U),()=>{Q.removeEventListener("click",U)}},[L.enabled,k,oe]),b.useEffect(()=>()=>{const Q=Date.now(),U=new Date(S.timeMetrics.loadedAt).getTime(),he=Q-U;y(ce=>({...ce,timeMetrics:{...ce.timeMetrics,sessionDuration:he}})),oe("ad_unloaded",{sessionDuration:he}),re()},[]),S}const rs=({productId:u,offerId:l,agentId:f,recommendationId:d,exposureUrl:k,sessionId:M,triggerExposureUrl:L=!0,children:X,config:S,className:y,style:$,onViewabilityChange:E,onVisible:W,onViewable:N,onClick:P})=>{const H=b.useRef(null),V=b.useRef(!1),ee=Zp({productId:u,offerId:l,agentId:f,recommendationId:d,elementRef:H,config:S}),se=b.useRef(ee.isViewable);b.useEffect(()=>{V.current=!1,se.current=!1},[k,d,M]),b.useEffect(()=>{ee.isViewable!==se.current&&(se.current=ee.isViewable,E&&E(ee.isViewable),ee.isViewable&&N&&N(),ee.isViewable&&!V.current&&L&&(F.log("[AdMeshViewabilityTracker] \u{1F3AF} Ad is viewable, checking exposure pixel requirements:",{exposureUrl:k?"present":"MISSING",sessionId:M?"present":"MISSING",recommendationId:d}),k&&M?(V.current=!0,F.log("[AdMeshViewabilityTracker] \u{1F525} Firing exposure pixel:",k),fetch(k,{method:"GET",keepalive:!0}).then(()=>{F.log("[AdMesh] \u2705 Exposure pixel fired successfully")}).catch(ae=>{F.warn("[AdMesh] \u26A0\uFE0F Failed to fire exposure pixel:",ae),V.current=!1})):F.warn("[AdMeshViewabilityTracker] \u26A0\uFE0F Cannot fire exposure pixel - missing required data:",{hasExposureUrl:!!k,hasSessionId:!!M})))},[ee.isViewable,E,N,k,M,d,L]);const oe=b.useRef(ee.isVisible);b.useEffect(()=>{ee.isVisible!==oe.current&&(oe.current=ee.isVisible,ee.isVisible&&W&&W())},[ee.isVisible,W]);const re=()=>{P&&P()};return m.jsx("div",{ref:H,className:y,style:$,onClick:re,"data-admesh-viewability-tracker":!0,"data-recommendation-id":d,"data-is-viewable":ee.isViewable,"data-is-visible":ee.isVisible,"data-visibility-percentage":ee.visibilityPercentage.toFixed(2),children:X})};rs.displayName="AdMeshViewabilityTracker";const Nc=u=>{try{return new URL(u),!0}catch{return!1}},na=u=>typeof u=="string"?u.trim():typeof u=="number"?String(u):"",Zn=u=>na(u)||void 0,Yp=u=>u&&u.trim()?u.trim():"",eh=(u,l)=>{if(u==null||u==="")return"";if(typeof u=="number")try{return new Intl.NumberFormat("en-US",{style:"currency",currency:l||"USD",maximumFractionDigits:2}).format(u)}catch{return String(u)}return na(u)},jc=({recommendations:u,theme:l,className:f="",style:d={},sessionId:k,triggerExposureUrl:M=!0,onDelegationConsent:L,onDelegationActivated:X,onStartDelegation:S,onRecommendationReport:y})=>{var $,E,W,N,P,H,V,ee,se;if(!u||u.length===0)return F.log("[AdMesh Compact Tail Ad] No recommendations provided - not rendering"),null;const oe=u[0],re=oe?.recommendation,ae=re?.creative,Q=oe?.tracking,U=oe?.delegation,he=oe?.recommendation_id||"",ce=re?.offerId||"",ye=ae?.brand_name||"",$e=ae?.headline||"",te=ae?.description||"",le=ae?.logo_url||"",xe=Q?.click_url||ae?.landing_page_url||"",Pe=Q?.exposure_url||"",C=re?.disclosure||"Sponsored",q=ae?.products||[],ie=q.slice(0,4),ke=q.length>1,Ee=(re?.format||"tail")==="bridge",p=U?.available===!0,I=Ee&&p,G=U?.brand_name||ye,Y="Talk to Agent",_e=Yp(ae?.cta_text),ve=!ke&&!!_e&&!!xe;if(!ye&&!$e&&!te)return F.log("[AdMesh Compact Tail Ad] No valid recommendation data provided - not rendering",{recommendationId:he}),null;const Ae=$e&&$e!==ye?$e:ye,Le=te,Ne=ye.trim().toLowerCase(),je=Ae.trim().toLowerCase(),We=!!ye&&Ne!==je,[Bt,ne]=b.useState(!1),[de,ge]=b.useState(!1),[Me,De]=b.useState(!1),[Z,Oe]=b.useState(null),K=b.useRef(null);b.useEffect(()=>()=>{K.current&&(K.current(!1),K.current=null)},[]);const He=be=>{var tt;be&&ge(!0),(tt=K.current)==null||tt.call(K,be),K.current=null,be||(ge(!1),ne(!1))},Ge=async()=>L?await L(oe):await new Promise(be=>{K.current=be,ne(!0)}),B=(be,tt)=>{tt&&tt.stopPropagation(),typeof window<"u"&&window.admeshTracker&&window.admeshTracker.trackClick({recommendationId:he,productId:ce,clickUrl:xe,source:be}).catch(()=>{F.error(`[AdMesh] Failed to track ${be} click`)})},Ze=[{value:"irrelevant",label:"Not relevant"},{value:"misleading",label:"Misleading"},{value:"inappropriate",label:"Inappropriate"},{value:"broken_link",label:"Broken link"},{value:"other",label:"Other"}],Fe=be=>{be.preventDefault(),be.stopPropagation(),!Z&&De(tt=>!tt)},un=async(be,tt)=>{if(be.preventDefault(),be.stopPropagation(),De(!1),Oe(tt),!!y)try{await y({recommendation:oe,recommendation_id:he,reason:tt,session_id:k})}catch(Zt){F.warn("[AdMesh Compact Tail Ad] Failed to submit recommendation report:",Zt)}},it=()=>{ke||!xe||(B("compact_tail_ad_card"),typeof window<"u"&&window.open(xe,"_blank","noopener,noreferrer"))},Kt=be=>{ke||!xe||(be.key==="Enter"||be.key===" ")&&(be.preventDefault(),it())},Mn=async()=>{if(he&&k)try{const be=typeof window<"u"&&window.__ADMESH_API_BASE_URL__||"https://api.useadmesh.com",tt=await fetch(`${be}/click/bridge-engagement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({recommendation_id:he,session_id:k,is_test:!1})});tt.ok||F.warn("[AdMesh Compact Tail Ad] Delegation engagement tracking failed:",tt.statusText)}catch(be){F.error("[AdMesh Compact Tail Ad] Error tracking delegation engagement:",be)}},Ro=async be=>{if(be.preventDefault(),be.stopPropagation(),!oe||!I||(B("compact_tail_ad_delegation_cta"),!await Ge()))return;Mn();const tt=U!=null&&U.available?{recommendation_id:oe.recommendation_id,brand_id:Zn(U.brand_id),brand_name:Zn(U.brand_name||ae?.brand_name),mcp_endpoint:Zn(U.mcp_endpoint),eligibility_reason:Zn(U.eligibility_reason),delegate_reason:Zn(U.delegate_reason),session_goal:Zn(U.session_goal),desired_outcome_type:U.desired_outcome_type,required_user_inputs:Array.isArray(U.required_user_inputs)?U.required_user_inputs.filter(Zt=>typeof Zt=="string"):[],required_consent_types:Array.isArray(U.required_consent_types)?U.required_consent_types.filter(Zt=>typeof Zt=="string"):[],success_outcome:Zn(U.success_outcome),fallback_message:Zn(U.fallback_message),session_mode:Zn(U.session_mode),status:Zn(U.status),capabilities:U.capabilities||[],allowed_data_types:U.allowed_data_types||[],consent_requirements:U.consent_requirements||[],auth_model:Zn(U.auth_model),handoff_protocol:U.handoff_protocol&&typeof U.handoff_protocol=="object"?U.handoff_protocol:void 0,supported_actions:U.supported_actions||[],metadata:U.metadata&&typeof U.metadata=="object"?U.metadata:void 0,platform_response:oe}:null;if(X&&tt){try{await X(tt)}finally{ge(!1),ne(!1)}return}if(S){try{await S(oe)}finally{ge(!1),ne(!1)}return}ge(!1),ne(!1)},[bn,Hr]=b.useState(!1),Xt=l?.mode==="dark"||typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Nt=l?.surfaceColor||((E=($=l?.components)==null?void 0:$.card)==null?void 0:E.backgroundColor)||(Xt?"#111827":"#ffffff"),ot=l?.borderColor||((N=(W=l?.components)==null?void 0:W.card)==null?void 0:N.borderColor)||(Xt?"rgba(255, 255, 255, 0.10)":"rgba(15, 23, 42, 0.08)"),ft=((P=l?.shadows)==null?void 0:P.medium)||((V=(H=l?.components)==null?void 0:H.card)==null?void 0:V.boxShadow)||(Xt?"0 8px 18px rgba(0, 0, 0, 0.28)":"0 8px 18px rgba(15, 23, 42, 0.08)"),Be="#2563eb",cn=Xt?"#9ca3af":"#6b7280",Vr=Xt?"#e5e7eb":"#374151",fn=Xt?"#f9fafb":"#0f172a",fe=Xt?"rgba(255, 255, 255, 0.04)":"#f8fafc",pn="50px",xn=I||ve?m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[I?m.jsx("button",{type:"button",onClick:Ro,style:{background:"none",border:"none",padding:0,color:Be,fontSize:"12px",fontWeight:500,cursor:"pointer",textDecoration:"none"},children:Y}):null,ve?m.jsx("a",{href:xe,target:"_blank",rel:"noopener noreferrer",onClick:be=>B("compact_tail_ad_cta",be),style:{color:Be,fontSize:"12px",fontWeight:600,textDecoration:"none"},children:_e}):null]}):null;return m.jsxs(rs,{productId:ce,recommendationId:he,exposureUrl:Pe,sessionId:k,triggerExposureUrl:M,className:`admesh-compact-tail-ad ${f}`,style:{all:"initial",boxSizing:"border-box",display:"block",fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",lineHeight:1.4,...d},children:[m.jsx("style",{children:`
|
|
193
|
+
.admesh-compact-tail-ad,
|
|
194
|
+
.admesh-compact-tail-ad * {
|
|
195
|
+
box-sizing: border-box;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.admesh-compact-line-clamp-1 {
|
|
199
|
+
overflow: hidden;
|
|
200
|
+
display: -webkit-box;
|
|
201
|
+
-webkit-box-orient: vertical;
|
|
202
|
+
-webkit-line-clamp: 1;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.admesh-compact-line-clamp-2 {
|
|
206
|
+
overflow: hidden;
|
|
207
|
+
display: -webkit-box;
|
|
208
|
+
-webkit-box-orient: vertical;
|
|
209
|
+
-webkit-line-clamp: 2;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.admesh-compact-tail-scroll {
|
|
213
|
+
-ms-overflow-style: none;
|
|
214
|
+
scrollbar-width: none;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.admesh-compact-tail-scroll::-webkit-scrollbar {
|
|
218
|
+
display: none;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@media (max-width: 420px) {
|
|
222
|
+
.admesh-compact-meta-row {
|
|
223
|
+
align-items: flex-start !important;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.admesh-compact-disclosure-actions {
|
|
227
|
+
gap: 4px !important;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.admesh-compact-footer-row,
|
|
231
|
+
.admesh-compact-report-panel,
|
|
232
|
+
.admesh-compact-report-status {
|
|
233
|
+
margin-left: 0 !important;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.admesh-compact-report-panel {
|
|
237
|
+
width: 100%;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.admesh-compact-report-option {
|
|
241
|
+
flex: 1 1 calc(50% - 6px);
|
|
242
|
+
min-height: 34px;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
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||((se=(ee=l?.components)==null?void 0:ee.card)==null?void 0:se.borderRadius)||"14px",border:`1px solid ${ot}`,background:Nt,boxShadow:ft,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:!bn&&le&&Nc(le)?m.jsx("img",{src:le,alt:`${ye} logo`,style:{width:"100%",height:"100%",objectFit:"contain",padding:"6px",background:"#ffffff"},onError:()=>Hr(!0)}):m.jsx("span",{style:{fontSize:"14px",fontWeight:700,color:cn},children:(ye||"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:cn},children:We?ye:""}),m.jsx("span",{style:{flexShrink:0,fontSize:"10px",color:cn,textTransform:"uppercase",letterSpacing:"0.08em"},children:C})]}),!ke&&m.jsx("div",{className:"admesh-compact-line-clamp-2",style:{fontSize:"14px",lineHeight:1.3,fontWeight:700,color:fn,marginBottom:"4px"},title:Ae,children:Ae}),Le&&m.jsx("p",{className:"admesh-compact-line-clamp-2",style:{margin:0,fontSize:"12px",lineHeight:1.35,color:Vr},title:Le,children:Le})]})]}),ke&&m.jsx("div",{className:"admesh-compact-tail-scroll",style:{display:"flex",gap:"8px",overflowX:"auto",paddingBottom:"2px"},children:ie.map(be=>{const tt=na(be.product_name)||"Product",Zt=na(be.product_link)||na(be.product_url)||xe||"#",Mo=eh(be.product_price,be.product_currency),Yn=na(be.product_image_url),dr=Yn&&Nc(Yn)?Yn:"",Do=Zt!=="#";return m.jsx("a",{href:Zt,target:Do?"_blank":void 0,rel:Do?"noopener noreferrer":void 0,onClick:Qr=>B(`compact_tail_ad_product_${be.product_id||"item"}`,Qr),style:{minWidth:"220px",maxWidth:"220px",display:"block",textDecoration:"none",color:"inherit",border:`1px solid ${ot}`,borderRadius:"12px",background:fe,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:cn,fontSize:"12px",fontWeight:700},children:dr?m.jsx("img",{src:dr,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:fn,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:fn},children:Mo})})]})]})},be.product_id||`${he}-${tt}`)})}),m.jsxs("div",{className:"admesh-compact-footer-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",flexWrap:"wrap",marginLeft:ke?0:pn},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&&q.length>ie.length?m.jsxs("span",{style:{fontSize:"10px",color:cn},children:["+",q.length-ie.length," more"]}):null,m.jsx("button",{type:"button","aria-label":Z?"Recommendation reported":"Report recommendation",title:Z?"Reported":"Report recommendation",disabled:!!Z,onClick:Fe,style:{width:"28px",height:"28px",borderRadius:"999px",border:`1px solid ${ot}`,background:Z?fe:Nt,color:Z?Be:cn,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,cursor:Z?"default":"pointer",flexShrink:0},children:m.jsx(Fp,{size:13})})]})]}),Me?m.jsx("div",{className:"admesh-compact-report-panel",onClick:be=>be.stopPropagation(),style:{marginLeft:ke?0:pn,border:`1px solid ${ot}`,borderRadius:"12px",background:fe,padding:"8px",display:"flex",flexWrap:"wrap",gap:"6px"},children:Ze.map(be=>m.jsx("button",{className:"admesh-compact-report-option",type:"button",onClick:tt=>un(tt,be.value),style:{borderRadius:"999px",border:`1px solid ${ot}`,background:Nt,color:fn,fontSize:"11px",fontWeight:600,padding:"6px 9px",cursor:"pointer"},children:be.label},be.value))}):null,Z?m.jsx("div",{className:"admesh-compact-report-status",style:{marginLeft:ke?0:pn,fontSize:"11px",color:cn},children:"Thanks for reporting this recommendation."}):null,Bt?m.jsxs("div",{style:{marginTop:"2px",border:`1px solid ${ot}`,borderRadius:"12px",background:fe,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:Be},children:"Confirm Agent Access"}),m.jsxs("div",{style:{fontSize:"13px",lineHeight:1.4,color:fn,fontWeight:600},children:["Allow ",G||"this brand"," to start a delegated session?"]}),m.jsx("div",{style:{fontSize:"12px",lineHeight:1.45,color:Vr},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:de,onClick:be=>{be.preventDefault(),be.stopPropagation(),!de&&He(!1)},style:{borderRadius:"10px",border:`1px solid ${ot}`,background:Nt,color:fn,fontSize:"12px",fontWeight:600,padding:"8px 12px",cursor:de?"not-allowed":"pointer",opacity:de?.65:1},children:"Not now"}),m.jsx("button",{type:"button",disabled:de,onClick:be=>{be.preventDefault(),be.stopPropagation(),!de&&He(!0)},style:{borderRadius:"10px",border:"none",background:Be,color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 12px",cursor:de?"wait":"pointer",opacity:de?.86:1},children:de?"Connecting...":"Allow agent"})]})]}):null]})]})},th=({recommendations:u,theme:l,className:f,style:d,sessionId:k,onDelegationConsent:M,onDelegationActivated:L,onStartDelegation:X})=>{const S=u.filter($=>$&&typeof $=="object"&&typeof $.recommendation_id=="string"&&$.recommendation_id.length>0);if(!S||S.length===0)return F.log("[AdMeshLayout] Empty or invalid recommendations array - not rendering anything"),null;F.log(`[AdMeshLayout] Rendering with ${S.length} valid recommendations`);const y=()=>{var $;if(S.length>0){const E=S[0],W=($=E.recommendation)==null?void 0:$.format;F.log("[AdMeshLayout] \u{1F50D} Checking format:",{preferredFormat:W,recommendationKeys:Object.keys(E||{})}),(W==="product_card"||W==="weave"||W==="bridge")&&F.warn(`[AdMeshLayout] ${W} format requested, falling back to tail for canonical render payload`)}return m.jsx(jc,{recommendations:S,theme:l,sessionId:k,onDelegationConsent:M,onDelegationActivated:L,onStartDelegation:X})};return m.jsx("div",{className:`admesh-layout ${f}`,style:{fontFamily:l?.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',...d},children:y()})};class nh{constructor(l){qr(this,"firedExposures",new Set),qr(this,"debug",!1),qr(this,"mrcThreshold",{visibilityPercentage:50,minimumDurationMs:1e3}),this.debug=l.debug||!1}fireExposure(l,f,d){const k=`${d}_${f}`;if(this.firedExposures.has(k)){this.debug&&F.log("[Tracker] Exposure already fired");return}this.firedExposures.add(k);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,f,d,k){const M=`${d}_${f}`;if(this.firedExposures.has(M)){this.debug&&F.log("[Tracker] MRC exposure already fired");return}return new Promise(L=>{let X=null,S=null;const y=new IntersectionObserver(E=>{E.forEach(W=>{W.intersectionRatio*100>=this.mrcThreshold.visibilityPercentage?X===null&&(X=Date.now(),this.debug&&F.log("[Tracker] Ad reached MRC visibility threshold"),S=setTimeout(()=>{this.fireExposure(l,f,d),y.disconnect(),L()},this.mrcThreshold.minimumDurationMs)):X!==null&&(S&&(clearTimeout(S),S=null),X=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(k);const $=setTimeout(()=>{y.disconnect(),S&&clearTimeout(S),L()},3e4);k.__admeshTrackerCleanup=()=>{y.disconnect(),S&&clearTimeout(S),clearTimeout($)}})}clearFiredExposures(){this.firedExposures.clear()}getMRCThreshold(){return{...this.mrcThreshold}}setMRCThreshold(l){this.mrcThreshold={...this.mrcThreshold,...l}}fireFollowupExposure(l,f,d){this.fireExposure(l,f,d)}fireFollowupEngagement(l,f,d){return fetch(l,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:d})}).catch(k=>{this.debug&&F.warn("[Tracker] Failed to fire followup engagement (non-critical):",k)}).then(()=>{})}}function rh(u){const l=u.split("/").filter(Boolean),f=(l[l.length-1]||l[l.length-2]||"").replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return f?f.replace(/\b\w/g,d=>d.toUpperCase()):"This page"}function oh(){var u;try{console.log("[AdMesh] Starting direct headings extraction...");const l=S=>S.replace(/\s+/g," ").trim(),f=()=>{var S;const y=["article","main article","main",'[role="main"]',"[data-admesh-article]",".article-content",".post-content",".entry-content",".content"],$=["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(","),E=(((S=y.map(N=>document.querySelector(N)).filter(N=>!!N).map(N=>{const P=N.cloneNode(!0);P.querySelectorAll($).forEach(V=>V.remove());const H=l(P.textContent||"");return{element:N,text:H}}).filter(N=>N.text.length>=200).sort((N,P)=>P.text.length-N.text.length)[0])==null?void 0:S.element)||document.body).cloneNode(!0);E.querySelectorAll($).forEach(N=>N.remove());const W=Array.from(E.querySelectorAll("h1, h2, h3, p, li, blockquote")).map(N=>l(N.textContent||"")).filter(N=>N.length>=24);return(W.length>0?W.join(`
|
|
246
|
+
`):l(E.textContent||"")).slice(0,6e3)},d=rh(window.location.pathname||"/"),k=l(document.title||"")||d,M=(()=>{const S=[],y=document.querySelectorAll("h1, h2, h3, h4, h5, h6");return Array.from(y).forEach($=>{const E=l($.textContent||"");E.length>0&&S.push(E)}),S})(),L=M.length>0?M:[k||d],X={title:k,headings:L,article_text:f(),url:window.location.href,domain:window.location.hostname,extracted_at:new Date().toISOString()};return console.log("[AdMesh] Extracted headings:",{title:X.title,headingsCount:X.headings.length,articleTextLength:((u=X.article_text)==null?void 0:u.length)||0,domain:X.domain}),X}catch(l){return console.error("[AdMesh] Error in direct headings extraction:",l),null}}function ah(u){return!!(u&&typeof u=="object"&&"recommendation_id"in u&&"status"in u)}function ih(u){var l,f,d,k,M,L,X,S,y,$,E;if(!u||typeof u!="object")return;if(ah(u))return u;const W=u;if(!W.recommendation_id)return;const N=(W.products||[]).map(P=>{var H,V;return{product_id:P.product_id||"",product_link:P.product_link||P.product_click_url||W.click_url||W.url||"",product_name:P.product_name||W.title||((H=W.creative_input)==null?void 0:H.product_name)||"",product_description:P.product_description||"",product_price:P.product_price??void 0,product_discount:P.product_discount??void 0,product_currency:P.product_currency,product_discount_type:P.product_discount_type,product_cta_label:P.product_cta_label||((V=W.creative_input)==null?void 0:V.cta_label),product_image_url:P.product_image_url,product_features:P.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||((f=W.creative_input)==null?void 0:f.product_name)||"",description:((d=W.creative_input)==null?void 0:d.short_description)||((k=W.creative_input)==null?void 0:k.long_description)||"",cta_text:((M=W.creative_input)==null?void 0:M.cta_label)||((L=N[0])==null?void 0:L.product_cta_label)||"Learn more",follow_up_suggestion:W.follow_up_suggestion,logo_url:(S=(X=W.creative_input)==null?void 0:X.assets)==null?void 0:S.logo_url,image_urls:(($=(y=W.creative_input)==null?void 0:y.assets)==null?void 0:$.image_urls)||[],landing_page_url:W.url||W.click_url||((E=W.creative_input)==null?void 0:E.cta_url)||"",products:N}},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 lh(u){return{...u,suggestions:(u.suggestions||[]).map(l=>({...l,recommendation:ih(l.recommendation)}))}}function Tc(u){try{const l=new URL(u).pathname.split("/").filter(f=>f.length>0);return l[l.length-1]||void 0}catch{return}}async function sh(u,l){var f,d,k,M,L;try{console.log("[AdMesh SDK] Starting ACIE analyze-intent call...",{url:u.url});const X=Array.isArray(u.headings)?u.headings:[],S=(f=Tc(u.url))==null?void 0:f.replace(/[-_]+/g," ").replace(/\s+/g," ").trim(),y=S?S.replace(/\b\w/g,se=>se.toUpperCase()):void 0,$=l.apiKey.toLowerCase().startsWith("pub_")?Tc(u.url):void 0,E=l.extension?"extension":"admesh_ui_sdk",W=(u.domain||(typeof window<"u"?window.location.hostname:"")).trim().toLowerCase(),N={url:u.url,title:u.title||void 0,headings:X.length>0?X:y?[y]:void 0,article_text:((d=u.article_text)==null?void 0:d.trim())||void 0,domain:W,article_slug:$,agent_id:void 0,cpx_floor:void 0,source:E,api_key:l.apiKey,user_id:l.userId||void 0};console.log("[AdMesh SDK] Payload prepared:",{url:N.url,titleLength:((k=N.title)==null?void 0:k.length)||0,headingsCount:((M=N.headings)==null?void 0:M.length)||0,articleTextLength:((L=N.article_text)==null?void 0:L.length)||0,domain:N.domain,article_slug:N.article_slug,source:N.source,has_user_id:!!N.user_id});const P=`${l.apiBaseUrl}/acie/analyze-intent`;console.log("[AdMesh SDK] Calling ACIE API:",P);const H=await fetch(P,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l.apiKey}`},body:JSON.stringify(N)});if(console.log("[AdMesh SDK] ACIE API response received:",{status:H.status,statusText:H.statusText,ok:H.ok}),!H.ok){const se=await H.text();throw console.error("[AdMesh SDK] ACIE API error:",{status:H.status,statusText:H.statusText,errorText:se}),new Error(`ACIE API error: ${H.status} - ${se}`)}const V=await H.json(),ee=lh(V);return console.log("[AdMesh SDK] ACIE analysis completed:",{url:u.url,suggestionsCount:ee.suggestions.length}),ee}catch(X){return console.error("[AdMesh SDK] Error calling ACIE analyze-intent endpoint:",X),null}}async function uh(u,l){var f,d;const k=(l.apiBaseUrl||"https://api.useadmesh.com").replace(/\/$/,""),M=new URLSearchParams({url:u.trim()});(f=l.agentDisplayId)!=null&&f.trim()&&M.set("agent_display_id",l.agentDisplayId.trim()),(d=l.publisherId)!=null&&d.trim()&&M.set("publisher_id",l.publisherId.trim());const L=await fetch(`${k}/publisher-assistant/page-context?${M.toString()}`,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${l.apiKey}`}});if(!L.ok){const X=await L.text().catch(()=>"");throw new Error(`Page context request failed (${L.status}): ${X||L.statusText}`)}return await L.json()}function ch(){if(typeof window>"u")return!1;try{return window.self!==window.top}catch{return!0}}function dh(){var u;if(typeof window>"u")return null;try{const l=(u=window.location.href)==null?void 0:u.trim();if(Lc(l))return l}catch{return null}return null}function Lc(u){const l=u?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const f=new URL(l);return f.protocol==="http:"||f.protocol==="https:"}catch{return!1}}function mh(u){try{const l=new URL(u),f=l.pathname.split("/").filter(Boolean),d=(f[f.length-1]||f[f.length-2]||l.hostname).replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return d?d.replace(/\b\w/g,k=>k.toUpperCase()):l.hostname}catch{return"This page"}}function Fc(u){const l=new URL(u),f=mh(u);return{title:f,headings:[f],article_text:`Article URL: ${u}
|
|
247
|
+
Article topic inferred from URL path: ${f}`,url:u,domain:l.hostname,extracted_at:new Date().toISOString()}}const fh=6e4,$c=3;function ph(u){const l=dh();if(l)return l;const f=u?.trim();return Lc(f)?f:null}const Oc=({apiKey:u,skipSdkInitialization:l=!1,sessionId:f,extension:d,theme:k,apiBaseUrl:M,language:L,location:X,userId:S,model:y,messages:$,pageContext:E,articleUrl:W,contextMode:N="auto",agentDisplayId:P,children:H})=>{const[V,ee]=b.useState(null),[se,oe]=b.useState(new Set),[re,ae]=b.useState(new Map),[Q,U]=b.useState(null),[he,ce]=b.useState([]),[ye,$e]=b.useState(!1),[te,le]=b.useState(null),[xe,Pe]=b.useState(!1),C=b.useRef(!1),q=b.useRef(0),ie=b.useRef(null),ke=b.useRef(null);ke.current=Q;const Ee=!!E||N==="ad-slot"||N==="auto"&&(!!(W!=null&&W.trim())||ch()),p=b.useCallback(async()=>{if(E)return E;if(!Ee)return oh();const ne=ph(W);if(!ne)return F.warn("[AdMeshProvider] Ad-slot context mode requires a real article URL"),le("Article URL is required for ad-slot context"),null;if(!u)return F.warn("[AdMeshProvider] Cannot fetch page context: missing API key"),Fc(ne);try{Pe(!0);const de=await uh(ne,{apiKey:u,apiBaseUrl:M||"https://api.useadmesh.com",agentDisplayId:P});return F.log("[AdMeshProvider] Page context resolved",{source:de.source,cache_hit:de.cache_hit,domain:de.context.domain}),de.context}catch(de){return F.error("[AdMeshProvider] Failed to fetch page context:",de),F.warn("[AdMeshProvider] Falling back to URL-path context for suggestions"),Fc(ne)}finally{Pe(!1)}},[P,M,u,W,E,Ee]),I=b.useCallback((ne,de)=>{const ge=ne.filter(Me=>!Me.is_sponsored).slice(0,3);return[de,...ge]},[]),G=b.useCallback((ne,de)=>{const ge=ne.find(De=>De.is_sponsored),Me=de.filter(De=>!De.is_sponsored).slice(0,3);return ge?[ge,...Me]:Me},[]);b.useEffect(()=>{if(!f||f.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:",f)},[f]),b.useEffect(()=>{if(!l){if(!u){F.warn("[AdMeshProvider] \u26A0\uFE0F AdMesh API key not configured");return}if(!f||f.trim()===""){F.error("[AdMeshProvider] Cannot initialize SDK: sessionId is required. Use AdMeshSDK.generateSessionIdFromUrl() for URL-based detection.");return}try{const ne=new qc({apiKey:u,theme:k,apiBaseUrl:M,extension:d});ee(ne),F.log("[AdMeshProvider] \u2705 AdMesh SDK initialized with session:",f),M&&F.log("[AdMeshProvider] \u{1F4CD} Using custom API base URL")}catch(ne){F.error("[AdMeshProvider] Failed to initialize AdMesh SDK:",ne)}return()=>{F.log("[AdMeshProvider] \u{1F9F9} Provider unmounted")}}},[u,k,M,f,d,l]);const Y=b.useCallback(async ne=>{var de;if(!u){F.warn("[AdMeshProvider] \u26A0\uFE0F Cannot perform intent analysis: missing API key");return}if(d)F.log("[AdMeshProvider] \u2139\uFE0F Extension mode: allowing intent analysis for any API key");else if(!u.toLowerCase().startsWith("pub_")){F.log('[AdMeshProvider] \u2139\uFE0F Skipping auto intent analysis: API key does not start with "pub_"');return}try{$e(!0),le(null),F.log("[AdMeshProvider] \u{1F504} Starting automatic intent analysis...");const ge=ne??await p();if(!ge){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract headings for intent analysis"),le("Failed to extract page content");return}F.log("[AdMeshProvider] \u{1F4C4} Extracted headings:",{title:ge.title,headingsCount:ge.headings.length,articleTextLength:((de=ge.article_text)==null?void 0:de.length)||0,domain:ge.domain});const Me=await sh(ge,{apiKey:u,apiBaseUrl:M||"https://api.useadmesh.com",extension:d,userId:S});Me?(F.log("[AdMeshProvider] \u2705 Intent analysis completed:",{suggestionsCount:Me.suggestions.length,suggestions:(Me.suggestions||[]).map(De=>{var Z;return{id:De.id,text:De.text,is_sponsored:De.is_sponsored,recommendationId:((Z=De.recommendation)==null?void 0:Z.recommendation_id)||null}})}),ce(De=>G(De,Me.suggestions||[]))):(F.warn("[AdMeshProvider] \u26A0\uFE0F Intent analysis returned null"),le("Intent analysis failed"),ce(De=>De.length>0?(F.log("[AdMeshProvider] \u2139\uFE0F Preserving existing suggestions after null intent analysis result"),De):[{id:"fallback-1",text:"What are your questions about this content?",type:"information",is_sponsored:!1,recommendation:void 0}]))}catch(ge){F.error("[AdMeshProvider] Error in intent analysis:",ge),le("Intent analysis error"),ce(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)}},[u,M,d,S,G,p]),_e=b.useCallback(async ne=>{var de,ge,Me,De,Z,Oe;if(!V||!u||!u.toLowerCase().startsWith("pub_"))return;const K=ne??await p();if(!K){F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to extract page content for sponsored suggestion prefetch");return}const He=((ge=(de=K.headings)==null?void 0:de[0])==null?void 0:ge.trim())||((Me=K.title)==null?void 0:Me.trim());if(!He){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 V.fetchPlatformResponse({query:He,sessionId:f,messageId:qc.createMessageId(f),platformSurface:"conversation",model:y,messages:[],language:L,location:X,userId:S}),B=(Oe=(Z=(De=Ge.recommendation)==null?void 0:De.creative)==null?void 0:Z.follow_up_suggestion)==null?void 0:Oe.trim(),Ze=Ge.recommendation_id;if(!B||!Ze){F.log("[AdMeshProvider] \u2139\uFE0F No sponsored follow-up suggestion returned from /aip/context");return}const Fe={id:Ze,text:B,type:"action",is_sponsored:!0,recommendation:Ge,metadata:{source:"aip_context_prefetch",recommendation_id:Ze}};ce(un=>I(un,Fe)),F.log("[AdMeshProvider] \u2705 Sponsored suggestion prefetched from /aip/context",{recommendationId:Ze,suggestionText:B})}catch(Ge){F.warn("[AdMeshProvider] \u26A0\uFE0F Sponsored suggestion prefetch failed (non-blocking):",Ge)}},[u,L,X,y,V,f,S,I,p]),ve=b.useCallback(async()=>{F.log("[AdMeshProvider] \u{1F504} Manual retry of intent analysis"),await Y()},[Y]);b.useEffect(()=>{!V||C.current||(C.current=!0,(async()=>{const ne=await p();await Promise.allSettled([_e(ne),Y(ne)])})())},[V,Y,_e,p]);const Ae=b.useCallback(ne=>{if(!ne||ne.status!=="active")return!1;const de=Date.parse(ne.expires_at);return Number.isNaN(de)?!1:de>Date.now()},[]),Le=b.useCallback(async(ne,de,ge,Me)=>{const De=Me??Q;if(!De||!V){F.warn("[AdMeshProvider] \u26A0\uFE0F Skipping delegation event because session or SDK is missing",{endpoint:ne,eventType:de,hasSession:!!De,hasSdk:!!V});return}const Z=new Date().toISOString();F.log("[AdMeshProvider] \u{1F4E1} Sending delegation event",{endpoint:ne,eventType:de,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id,sessionId:De.session_id});const Oe=await fetch(`${V.getApiBaseUrl()}${ne}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify({delegation_session_id:De.delegation_session_id,recommendation_id:De.recommendation_id,session_id:De.session_id,event_type:de,timestamp:Z,metadata:ge||{}})});if(!Oe.ok){const Ge=await Oe.text();throw F.error("[AdMeshProvider] Delegation event failed",{endpoint:ne,eventType:de,status:Oe.status,errorBody:Ge,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id}),new Error(`Delegation event failed (${Oe.status}): ${Ge}`)}const K=await Oe.json(),He=K?.session;F.log("[AdMeshProvider] \u2705 Delegation event acknowledged",{endpoint:ne,eventType:de,recommendationId:De.recommendation_id,delegationSessionId:De.delegation_session_id,returnedStatus:He?.status||K?.status}),He&&U(He)},[Q,u,V]),Ne=b.useCallback(()=>{q.current=0},[]),je=b.useCallback(async(ne="user_stopped",de)=>{const ge=Q;if(!ge){F.warn("[AdMeshProvider] \u26A0\uFE0F stopDelegationSession called without an active SDK delegation session");return}F.log("[AdMeshProvider] \u{1F6D1} Stopping delegation session",{reason:ne,recommendationId:ge.recommendation_id,delegationSessionId:ge.delegation_session_id}),await Le("/aip/delegation/stop","session_stopped",{reason:ne,...de||{}},ge),await V?.trackPublisherAssistantEvent({event_name:"delegation_stopped",timestamp:new Date().toISOString(),session_id:ge.session_id,recommendation_id:ge.recommendation_id,delegation_session_id:ge.delegation_session_id,brand_name:ge.brand_name,status:"stopped",metadata:{reason:ne,...de||{}}}).catch(Me=>{F.warn("[AdMeshProvider] \u26A0\uFE0F Failed to track delegation_stopped event:",Me)}),q.current=0,ie.current=null,U(null),F.log("[AdMeshProvider] \u2705 Delegation session cleared locally after stop")},[Q,Le,V]),We=b.useCallback(async(ne="turn_completed",de)=>{ne==="turn_started"&&Ne(),await Le("/aip/delegation/activity",ne,de)},[Le,Ne]);b.useEffect(()=>{const ne=Q?.delegation_session_id??null;ne!==ie.current&&(ie.current=ne,q.current=0)},[Q?.delegation_session_id]),b.useEffect(()=>{if(!(Q?.delegation_session_id??null)||!V)return;const ne=ke.current;if(!ne||!Ae(ne)){U(ge=>ge?{...ge,status:"expired"}:null);return}const de=window.setInterval(()=>{const ge=ke.current;if(!(!ge||!Ae(ge))){if(q.current+=1,q.current>=$c){F.log("[AdMeshProvider] \u23F1\uFE0F Stopping delegation after idle heartbeats",{delegationSessionId:ge.delegation_session_id,heartbeatsSinceLastUserTurn:q.current,idleHeartbeatLimit:$c}),je("idle_timeout",{source:"heartbeat_idle",heartbeats_without_turn:q.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)})}},fh);return()=>{window.clearInterval(de)}},[Q?.delegation_session_id,Ae,Le,V,je]);const Bt={sdk:V,apiKey:u,sessionId:f,theme:k,language:L,location:X,userId:S,model:y,messages:$,processedMessageIds:se,recommendationResults:re,activeDelegationSession:Q,suggestions:he,isAnalyzingIntent:ye||xe,intentError:te,markMessageAsProcessed:ne=>{oe(de=>{const ge=new Set(de);return ge.add(ne),ge})},isMessageProcessed:ne=>se.has(ne),setRecommendationResult:(ne,de)=>{ae(ge=>{const Me=new Map(ge);return Me.set(ne,de),Me}),oe(ge=>{const Me=new Set(ge);return Me.add(ne),Me})},getRecommendationResult:ne=>re.get(ne),hasRecommendationResult:ne=>re.has(ne),setActiveDelegationSession:ne=>{U(ne)},getActiveDelegationSession:()=>Ae(Q)?Q:null,hasActiveDelegationSession:()=>Ae(Q),refreshDelegationActivity:We,stopDelegationSession:je,retryIntentAnalysis:ve};return m.jsx(Wc.Provider,{value:Bt,children:H})};class hh{constructor(){qr(this,"roots",new Map)}async render(l){try{F.log("[AdMeshRenderer] \u{1F3A8} Attempting to render recommendations");const f=l.response.recommendations||[];if(f.length===0){F.log("[AdMeshRenderer] \u26A0\uFE0F No recommendations to render - skipping render to avoid occupying space");return}const d=document.getElementById(l.containerId);if(!d)throw F.error("[AdMeshRenderer] Container not found"),new Error(`Container with ID "${l.containerId}" not found`);F.log("[AdMeshRenderer] \u2705 Container ready");const k=this.roots.get(l.containerId);k&&(F.log("[AdMeshRenderer] \u{1F9F9} Cleaning up existing root"),k.unmount(),this.roots.delete(l.containerId)),d.innerHTML="";const M=xc.createRoot(d);F.log("[AdMeshRenderer] \u{1F4CA} Rendering recommendations"),M.render(m.jsx(Oc,{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(th,{recommendations:f,theme:l.theme,sessionId:l.sessionId,onDelegationConsent:l.onDelegationConsent,onDelegationActivated:l.onDelegationActivated,onStartDelegation:l.onStartDelegation})})),d.style.display="block",F.log("[AdMeshRenderer] \u2705 Recommendations rendered successfully"),this.roots.set(l.containerId,M)}catch(f){throw F.error("[AdMeshRenderer] Error rendering recommendations"),f}}unmount(l){const f=this.roots.get(l);if(f){f.unmount(),this.roots.delete(l);const d=document.getElementById(l);d&&(d.style.display="none")}}unmountAll(){for(const[,l]of this.roots.entries())l.unmount();this.roots.clear()}}const gh=u=>{if(typeof u!="string")return;const l=u.trim().toUpperCase();return/^[A-Z]{2}$/.test(l)?l:void 0},Uc=class Eo{constructor(l){if(qr(this,"config"),qr(this,"apiBaseUrl"),qr(this,"renderer",null),qr(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,f){return`${l}::${f}`}getExtensionSourceDomain(){var l,f;const d=(l=this.config.extensionSourceDomain)==null?void 0:l.trim();if(d)return d.toLowerCase();if(typeof window<"u"&&(f=window.location)!=null&&f.hostname)return window.location.hostname.trim().toLowerCase()||void 0}static createSession(){const l=Date.now(),f=Math.random().toString(36).substring(2,15);return`session_${l}_${f}`}static generateSessionIdFromUrl(l){const f=l||(typeof window<"u"?window.location.href:"");if(!f)return Eo.createSession();try{const d=new URL(f).pathname.split("/").filter(M=>M.length>0),k=d[d.length-1];return k?`session_${Date.now()}_${k}`:Eo.createSession()}catch{return Eo.createSession()}}static createMessageId(l){const f=Date.now(),d=Math.random().toString(36).substring(2,9);return l?`msg_${l}_${f}_${d}`:`msg_${f}_${d}`}getRenderer(){return this.renderer||(this.renderer=new hh),this.renderer}getTracker(){return this.tracker||(this.tracker=new nh({apiKey:this.config.apiKey})),this.tracker}async postDelegationEvent(l,f,d,k){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:f.delegation_session_id,recommendation_id:f.recommendation_id,session_id:f.session_id,event_type:d,timestamp:new Date().toISOString(),metadata:k||{}})});if(!M.ok){const X=await M.text();throw new Error(`Delegation event failed (${M.status}): ${X}`)}const L=await M.json();return L?.session||null}async reportDelegationTurnStarted(l,f){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_started",f)}async reportDelegationSessionStarted(l,f){return this.postDelegationEvent("/aip/delegation/activity",l,"session_started",f)}async reportDelegationTurnCompleted(l,f){return this.postDelegationEvent("/aip/delegation/activity",l,"turn_completed",f)}async reportDelegationToolInvocation(l,f){return this.postDelegationEvent("/aip/delegation/activity",l,"tool_invoked",f)}async reportDelegationOutcome(l,f,d){return this.postDelegationEvent("/aip/delegation/complete",l,f,d)}async stopDelegationSession(l,f="user_stopped",d){return this.postDelegationEvent("/aip/delegation/stop",l,"session_stopped",{reason:f,...d||{}})}getActiveDelegationSession(l){if(!l||l.status!=="active")return null;const f=Date.parse(l.expires_at);return Number.isNaN(f)||f<=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 f=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}),d={sessionId:l.sessionId,messageId:l.messageId,recommendations:[f]},k=this.getRenderer(),M=this.getTracker();await k.render({containerId:l.containerId,followups_container_id:l.followups_container_id,response:d,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(f){throw F.error("[AdMeshSDK] Error showing recommendations"),f}}async fetchPlatformResponse(l){var f,d,k,M,L,X,S,y,$,E,W,N,P;const H=`${this.apiBaseUrl}/aip/context`;if(F.log("[AdMeshSDK] \u{1F4E5} fetchPlatformResponse called"),!l.sessionId||l.sessionId.trim()===""){const le=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"),le}const V=l.messageId;if(!V||V.trim()===""){const le=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"),le}const ee=Eo.buildPlatformResponseCacheKey(l.sessionId,V),se=Eo.inFlightPlatformResponses.get(ee);if(se)return F.log("[AdMeshSDK] \u23F3 Reusing in-flight PlatformResponse request",{sessionId:l.sessionId,messageId:V}),se;const oe=l.messages?l.messages.length:0,re=(typeof window<"u"&&window.navigator,"web"),ae=typeof window<"u"&&window.innerWidth?window.innerWidth<768?"mobile":window.innerWidth<1024?"tablet":"desktop":"desktop",Q=gh((f=l.location)==null?void 0:f.countryCode)||"US",U=typeof window<"u"&&window.location?{url:window.location.href,origin:window.location.origin,referrer:document.referrer||void 0,host:window.location.hostname}:void 0,he=l.userId??this.config.userId,ce={spec_version:"1.0",message_id:V,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:he||"",confidence:he?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:oe},surface:{channel:l.platformSurface==="embedded_assistant"?"conversation":l.platformSurface||"conversation",interaction_mode:"text",platform:re,form_factor:ae,locale:l.language||"en-US",country:Q,publisher:"placeholder"},input:{query_text:l.query,messages:l.messages||[]},context:{location:{city:((d=l.location)==null?void 0:d.city)||void 0,state:((k=l.location)==null?void 0:k.state)||void 0,state_code:((M=l.location)==null?void 0:M.stateCode)||void 0,country:((L=l.location)==null?void 0:L.country)||void 0,country_code:Q,zipcode:((X=l.location)==null?void 0:X.zipcode)||void 0,latitude:(S=l.location)==null?void 0:S.latitude,longitude:(y=l.location)==null?void 0:y.longitude},page:U}}},monetization:{enabled:!0,pricing_model:"CPX",auction:{enabled:!0,floor:{amount:0,currency:"USD"}}}};(E=($=ce.classification_input.interaction)==null?void 0:$.input.query_text)!=null&&E.trim()||F.warn("[AdMeshSDK] \u26A0\uFE0F Warning: Sending request with empty query_text");const ye=JSON.stringify(ce);F.log("[AdMeshSDK] \u{1F4E4} Sending canonical request to /aip/context",{messageId:ce.message_id,specVersion:ce.spec_version,classificationType:ce.classification_input.type,platformId:ce.platform.platform_id,surfaceChannel:(W=ce.classification_input.interaction)==null?void 0:W.surface.channel,sessionId:(P=(N=ce.classification_input.interaction)==null?void 0:N.session)==null?void 0:P.id});const $e={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`};if(this.config.extension){$e["X-AdMesh-Source"]="extension";const le=this.getExtensionSourceDomain();le&&($e["X-AdMesh-Source-Domain"]=le)}const te=(async()=>{const le=await fetch(H,{method:"POST",headers:$e,body:ye});if(!le.ok){const Pe=(await le.json().catch(()=>({}))).detail||`HTTP ${le.status}`;throw new Error(`Failed to fetch recommendation from /aip/context: ${Pe}`)}const xe=await le.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,te);try{return await te}finally{Eo.inFlightPlatformResponses.delete(ee)}}async trackPublisherAssistantEvent(l){const f=Array.isArray(l)?{events:l}:l,d=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(f),keepalive:!0});if(!d.ok){const k=await d.text().catch(()=>"");throw new Error(`Failed to track publisher assistant analytics (${d.status}): ${k}`)}}async reportSponsoredRecommendation(l){const f=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(!f.ok){const d=await f.text().catch(()=>"");throw new Error(`Failed to report sponsored recommendation (${f.status}): ${d}`)}}fireFollowupExposure(l,f,d){this.getTracker().fireFollowupExposure(l,f,d)}async fireFollowupEngagement(l,f,d){return this.getTracker().fireFollowupEngagement(l,f,d)}};qr(Uc,"inFlightPlatformResponses",new Map);let qc=Uc;const Wc=b.createContext(void 0);function Hc(){const u=b.useContext(Wc);if(!u)throw new Error("useAdMeshContext must be used within an <AdMeshProvider>. Make sure your component is wrapped with <AdMeshProvider>.");return u}function Vc(){const u=Hc();return{sdk:u.sdk,apiKey:u.apiKey,sessionId:u.sessionId,theme:u.theme,language:u.language,location:u.location,userId:u.userId,model:u.model,messages:u.messages,processedMessageIds:u.processedMessageIds,recommendationResults:u.recommendationResults,activeDelegationSession:u.activeDelegationSession,markMessageAsProcessed:u.markMessageAsProcessed,isMessageProcessed:u.isMessageProcessed,setRecommendationResult:u.setRecommendationResult,getRecommendationResult:u.getRecommendationResult,hasRecommendationResult:u.hasRecommendationResult,setActiveDelegationSession:u.setActiveDelegationSession,getActiveDelegationSession:u.getActiveDelegationSession,hasActiveDelegationSession:u.hasActiveDelegationSession,refreshDelegationActivity:u.refreshDelegationActivity,stopDelegationSession:u.stopDelegationSession}}const yh=({className:u,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:u,children:[m.jsx("path",{d:"M5 12h14"}),m.jsx("path",{d:"M12 5v14"})]}),vh=({recommendation:u,theme:l,sdk:f,sessionId:d,onExecuteQuery:k})=>{var M,L,X,S,y;const $=(L=(M=u.recommendation)==null?void 0:M.creative)!=null&&L.follow_up_suggestion&&(X=u.tracking)!=null&&X.followup_engagement_url&&(S=u.tracking)!=null&&S.followup_exposure_url?{query:u.recommendation.creative.follow_up_suggestion,engagement_url:u.tracking.followup_engagement_url,exposure_url:u.tracking.followup_exposure_url}:null,E=$?.query,W=$?.engagement_url,N=$?.exposure_url,P=u.recommendation_id,H=((y=u.recommendation)==null?void 0:y.offerId)||P;if(!E||!W||!N)return F.log("[AdMeshFollowup] Missing followup_suggestion.query, engagement_url, or exposure_url - not rendering"),null;const V=async()=>{try{W&&P&&(F.log("[AdMeshFollowup] \u{1F3AF} Firing follow-up engagement tracking"),await f.fireFollowupEngagement(W,P,d)),k&&E?(F.log(`[AdMeshFollowup] \u{1F50D} Executing query: ${E}`),await k(E)):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(rs,{productId:H,recommendationId:P||"",exposureUrl:N,sessionId:d,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:V,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===" ")&&V()},"aria-label":`Sponsored follow-up: ${E}`,children:[m.jsx("p",{className:"transition duration-200 text-[#000] dark:text-[#FFF] hover:text-[#24A0ED] admesh-followup-text",children:E}),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(yh,{size:20,className:"text-[#24A0ED] flex-shrink-0 admesh-plus-icon"})]})]})]})})},Ha=({onRecommendationsShown:u,onError:l,messageId:f,query:d,userId:k,initialRecommendation:M,triggerExposureUrl:L=!0,followups_container_id:X,onPasteToInput:S,onDelegationConsent:y,onDelegationActivated:$,onStartDelegation:E,onRecommendationReport:W,onExecuteQuery:N,onFollowupDetected:P,isContainerReady:H})=>{var V,ee,se,oe;const{sdk:re,sessionId:ae,apiKey:Q,language:U,location:he,userId:ce,model:ye,messages:$e,theme:te,getRecommendationResult:le,hasRecommendationResult:xe,setRecommendationResult:Pe,activeDelegationSession:C,setActiveDelegationSession:q,hasActiveDelegationSession:ie}=Vc(),ke=Z=>!!Z&&Z.status==="generated"&&!!Z.recommendation,Ee=k||ce,[p,I]=b.useState(null),[G,Y]=b.useState(null),[_e,ve]=b.useState(!0),[Ae,Le]=b.useState(null),Ne=b.useRef(null),je=b.useRef(!1),We=b.useRef(!1),Bt=b.useRef(u),ne=b.useRef(l);b.useEffect(()=>{Bt.current=u,ne.current=l},[u,l]),b.useEffect(()=>{Ne.current!==f&&(Ne.current=null,We.current=!1,I(null),Y(null))},[f]);const de=ie()&&C?.session_id===ae;b.useEffect(()=>{var Z,Oe,K;if(!f||!xe(f)||de)return;const He=le(f);if(!He){F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored no_match result from provider state"),I(null),Y(null),Le(null),ve(!1),Ne.current=f,je.current=!1,We.current=!0;return}let Ge=((Z=He.recommendation)==null?void 0:Z.format)||"tail";(Ge==="weave"||Ge==="product_card")&&(Ge="tail"),F.log("[AdMeshRecommendations] \u267B\uFE0F Reusing stored recommendation result from provider state",{messageId:f,recommendationId:He.recommendation_id,format:(Oe=He.recommendation)==null?void 0:Oe.format}),I(He),Y(Ge),Le(null),ve(!1),Ne.current=f,je.current=!1,We.current=!0,(K=Bt.current)==null||K.call(Bt,f,He)},[le,xe,de,f]),b.useEffect(()=>{var Z,Oe,K,He,Ge,B,Ze;if(!(!M||!f)&&!de)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"),I(null),Y(null),Le(null),ve(!1),Ne.current=f,je.current=!1,We.current=!0,Pe(f,null);return}throw new Error(`Initial recommendation is not a filled auction response (status=${un})`)}let it=((Z=Fe.recommendation)==null?void 0:Z.format)||"tail";(it==="weave"||it==="product_card")&&(it="tail"),I(Fe),Y(it),Le(null),ve(!1),Ne.current=f,je.current=!1,We.current=!0,Pe(f,Fe),(Oe=Bt.current)==null||Oe.call(Bt,f,Fe),F.log("[AdMeshRecommendations] \u267B\uFE0F Using initial recommendation payload, skipping /aip/context fetch"),F.log("[AdMeshRecommendations] \u2705 Accepted initial generated recommendation payload",{messageId:f,recommendationId:Fe.recommendation_id,format:(K=Fe.recommendation)==null?void 0:K.format,brandName:(Ge=(He=Fe.recommendation)==null?void 0:He.creative)==null?void 0:Ge.brand_name,headline:(Ze=(B=Fe.recommendation)==null?void 0:B.creative)==null?void 0:Ze.headline,hasTracking:!!Fe.tracking})}catch(Fe){const un=Fe instanceof Error?Fe:new Error(String(Fe));We.current=!1,F.warn(`[AdMeshRecommendations] \u26A0\uFE0F Failed to reuse initial recommendation, will fall back to fetch: ${un.message}`)}},[de,M,f,Pe]),b.useEffect(()=>{if(!f||!d||d.trim()===""){F.log("[AdMeshRecommendations] Validation failed - missing required parameters"),ve(!1);return}if(de){F.log("[AdMeshRecommendations] \u23F8\uFE0F Delegated session active, skipping /aip/context fetch",{messageId:f,conversationSessionId:ae,delegationSessionId:C?.delegation_session_id}),I(null),Y(null),Le(null),ve(!1),je.current=!1;return}if(!(re!=null&&re.fetchPlatformResponse)){F.log("[AdMeshRecommendations] SDK fetchPlatformResponse not available"),ve(!1);return}if(We.current){F.log("[AdMeshRecommendations] \u23ED\uFE0F Initial recommendation provided, skipping duplicate fetch");return}if(Ne.current===f){F.log("[AdMeshRecommendations] \u23ED\uFE0F Already fetched for this messageId, skipping duplicate fetch");return}if(je.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 Z,Oe,K,He,Ge,B,Ze,Fe,un;try{je.current=!0,ve(!0),Le(null);const it=await re.fetchPlatformResponse({query:d.trim(),sessionId:ae,messageId:f,language:U,location:he,userId:Ee,model:ye,...$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"),I(null),Y(null),Le(null),ve(!1),je.current=!1,Ne.current=f,Pe(f,null);return}throw new Error(`No filled recommendation returned from /aip/context (status=${Kt})`)}I(it),F.log("[AdMeshRecommendations] \u2705 Accepted fetched generated recommendation payload",{messageId:f,recommendationId:it.recommendation_id,format:(Z=it.recommendation)==null?void 0:Z.format,brandName:(K=(Oe=it.recommendation)==null?void 0:Oe.creative)==null?void 0:K.brand_name,headline:(Ge=(He=it.recommendation)==null?void 0:He.creative)==null?void 0:Ge.headline,hasTracking:!!it.tracking});let Mn=((B=it.recommendation)==null?void 0:B.format)||"tail";(Mn==="weave"||Mn==="product_card")&&(Mn="tail"),Y(Mn),Ne.current=f,Pe(f,it),F.log("[AdMeshRecommendations] \u{1F4CA} Format detection:",{preferred_format:(Ze=it.recommendation)==null?void 0:Ze.format,selected_format:Mn}),ve(!1),je.current=!1,(Fe=Bt.current)==null||Fe.call(Bt,f,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),ve(!1),je.current=!1,(un=ne.current)==null||un.call(ne,Kt)}})()},[C?.delegation_session_id,de,re,ae,f,d,U,he,Ee,ye,M,Pe]),b.useEffect(()=>{var Z,Oe,K,He;if(!p||!P)return;const Ge=(Oe=(Z=p.recommendation)==null?void 0:Z.creative)!=null&&Oe.follow_up_suggestion&&(K=p.tracking)!=null&&K.followup_engagement_url&&(He=p.tracking)!=null&&He.followup_exposure_url?{label:p.recommendation.creative.follow_up_suggestion,query:p.recommendation.creative.follow_up_suggestion,engagement_url:p.tracking.followup_engagement_url,exposure_url:p.tracking.followup_exposure_url}:null;Ge&&P(Ge,p.recommendation_id)},[p,P]);const ge=b.useCallback(async Z=>{if(!re||!ae)throw new Error("AdMesh SDK activation requires an initialized session");const Oe=await fetch(`${re.getApiBaseUrl()}/aip/delegation/activate`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${Q}`},body:JSON.stringify({session_id:ae,recommendation_id:Z.recommendation_id,metadata:Z.metadata})});if(!Oe.ok){const B=await Oe.text();throw new Error(`Failed to activate delegation session: ${Oe.status} ${B}`)}const K=await Oe.json(),He={...Z,delegation_session_id:K.delegation_session_id||Z.delegation_session_id,session_id:K.session_id||ae,brand_id:K.brand_id||Z.brand_id,brand_name:K.brand_name||Z.brand_name,mcp_endpoint:K.mcp_endpoint,eligibility_reason:K.eligibility_reason||Z.eligibility_reason,delegate_reason:K.delegate_reason||Z.delegate_reason,session_goal:K.session_goal||Z.session_goal,desired_outcome_type:K.desired_outcome_type||Z.desired_outcome_type,required_user_inputs:K.required_user_inputs||Z.required_user_inputs||[],required_consent_types:K.required_consent_types||Z.required_consent_types||[],success_outcome:K.success_outcome||Z.success_outcome,fallback_message:K.fallback_message||Z.fallback_message,session_mode:"inline",status:K.status||"active",capabilities:K.capabilities||Z.capabilities||[],allowed_data_types:K.allowed_data_types||Z.allowed_data_types||[],auth_model:K.auth_model||Z.auth_model,handoff_protocol:K.handoff_protocol||Z.handoff_protocol,supported_actions:K.supported_actions||Z.supported_actions||[],metadata:K.metadata||Z.metadata},Ge={delegation_session_id:K.delegation_session_id,recommendation_id:Z.recommendation_id,session_id:K.session_id||ae,brand_agent_id:K.brand_agent_id,brand_id:K.brand_id||Z.brand_id,brand_name:K.brand_name||Z.brand_name||"Brand",mcp_endpoint:K.mcp_endpoint,status:K.status||"active",activated_at:K.created_at,last_activity_at:K.updated_at,expires_at:K.expires_at||K.updated_at,eligibility_reason:K.eligibility_reason||Z.eligibility_reason,delegate_reason:K.delegate_reason||Z.delegate_reason,session_goal:K.session_goal||Z.session_goal,desired_outcome_type:K.desired_outcome_type||Z.desired_outcome_type,required_user_inputs:K.required_user_inputs||Z.required_user_inputs||[],required_consent_types:K.required_consent_types||Z.required_consent_types||[],success_outcome:K.success_outcome||Z.success_outcome,fallback_message:K.fallback_message||Z.fallback_message,capabilities:K.capabilities||Z.capabilities||[],allowed_data_types:K.allowed_data_types||Z.allowed_data_types||[],consent_requirements:K.consent_requirements||Z.consent_requirements||[],auth_model:K.auth_model||Z.auth_model,handoff_protocol:K.handoff_protocol||Z.handoff_protocol,supported_actions:K.supported_actions||Z.supported_actions||[],metadata:K.metadata||Z.metadata};if(q(Ge),await re.trackPublisherAssistantEvent({event_name:"delegation_started",timestamp:new Date().toISOString(),session_id:ae,recommendation_id:Z.recommendation_id,delegation_session_id:K.delegation_session_id,brand_name:Ge.brand_name,status:K.status||"active",metadata:{brand_agent_id:K.brand_agent_id,source:"recommendation_card"}}).catch(B=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to track delegation_started event:",B)}),await re.reportDelegationSessionStarted(Ge,{brand_agent_id:K.brand_agent_id,brand_name:Ge.brand_name}).then(B=>{B&&q(B)}).catch(B=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report delegation session_started event:",B)}),$){try{await $(He)}catch(B){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onDelegationActivated callback failed after successful delegation activation:",B)}return}if(E)try{await E({...Z.platform_response,delegation:{...Z.platform_response.delegation,...He,delegation_session_id:K.delegation_session_id,available:!0,status:K.status||"active"}})}catch(B){F.warn("[AdMeshRecommendations] \u26A0\uFE0F Host onStartDelegation callback failed after successful delegation activation:",B)}},[Q,$,E,re,ae,q]),Me=b.useCallback(async Z=>{var Oe,K;if(W){await W(Z);return}!re||!ae||await re.reportSponsoredRecommendation({session_id:ae,message_id:f,recommendation_id:Z.recommendation_id,reason:Z.reason,brand_name:(K=(Oe=Z.recommendation.recommendation)==null?void 0:Oe.creative)==null?void 0:K.brand_name,metadata:{reason:Z.reason,source:"recommendation_card"}}).catch(He=>{F.warn("[AdMeshRecommendations] \u26A0\uFE0F Failed to report sponsored recommendation:",He)})},[f,W,re,ae]);if(!f||!d||d.trim()===""||_e||Ae)return null;if(!p||!G)return F.log("[AdMeshRecommendations] \u{1F6AB} Nothing to render",{messageId:f,hasPlatformResult:!!p,detectedFormat:G,isLoading:_e,hasError:!!Ae}),null;F.log("[AdMeshRecommendations] \u{1F3A8} Rendering recommendation component",{messageId:f,recommendationId:p.recommendation_id,detectedFormat:G,brandName:(ee=(V=p.recommendation)==null?void 0:V.creative)==null?void 0:ee.brand_name,headline:(oe=(se=p.recommendation)==null?void 0:se.creative)==null?void 0:oe.headline});const De=typeof document<"u"&&X&&(H??!0)?document.getElementById(X):null;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"admesh-recommendations-container",style:{marginTop:"1rem"},children:m.jsx(jc,{recommendations:[p],theme:te,sessionId:ae,triggerExposureUrl:L,onPasteToInput:S,onDelegationConsent:y,onDelegationActivated:ge,onStartDelegation:E,onRecommendationReport:Me})}),De&&re&&ae?es.createPortal(m.jsx(vh,{recommendation:p,theme:te,sdk:re,sessionId:ae,onExecuteQuery:N}),De):null]})},os="admesh-ui-sdk-styles",as="admesh-ui-sdk-reset",bh=`
|
|
248
|
+
/* AdMesh UI SDK - CSS Reset & Normalization */
|
|
249
|
+
.admesh-component,
|
|
250
|
+
.admesh-component * {
|
|
251
|
+
box-sizing: border-box;
|
|
252
|
+
margin: 0;
|
|
253
|
+
padding: 0;
|
|
254
|
+
border: 0;
|
|
255
|
+
font-size: 100%;
|
|
256
|
+
font-weight: normal;
|
|
257
|
+
font-style: normal;
|
|
258
|
+
line-height: 1.5;
|
|
259
|
+
text-decoration: none;
|
|
260
|
+
background: transparent;
|
|
261
|
+
color: inherit;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.admesh-component {
|
|
265
|
+
all: revert;
|
|
266
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
267
|
+
-webkit-font-smoothing: antialiased;
|
|
268
|
+
-moz-osx-font-smoothing: grayscale;
|
|
269
|
+
text-rendering: optimizeLegibility;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.admesh-component button,
|
|
273
|
+
.admesh-component a {
|
|
274
|
+
cursor: pointer;
|
|
275
|
+
border: none;
|
|
276
|
+
background: none;
|
|
277
|
+
padding: 0;
|
|
278
|
+
margin: 0;
|
|
279
|
+
font-family: inherit;
|
|
280
|
+
font-size: inherit;
|
|
281
|
+
color: inherit;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.admesh-component a {
|
|
285
|
+
text-decoration: none;
|
|
286
|
+
color: inherit;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.admesh-component button:focus,
|
|
290
|
+
.admesh-component a:focus {
|
|
291
|
+
outline: none;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.admesh-component img {
|
|
295
|
+
max-width: 100%;
|
|
296
|
+
height: auto;
|
|
297
|
+
display: block;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.admesh-component ul,
|
|
301
|
+
.admesh-component ol {
|
|
302
|
+
list-style: none;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.admesh-component table {
|
|
306
|
+
border-collapse: collapse;
|
|
307
|
+
border-spacing: 0;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.admesh-component input,
|
|
311
|
+
.admesh-component textarea,
|
|
312
|
+
.admesh-component select {
|
|
313
|
+
font-family: inherit;
|
|
314
|
+
font-size: inherit;
|
|
315
|
+
color: inherit;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/* Prevent Tailwind and other frameworks from affecting AdMesh */
|
|
319
|
+
.admesh-component .prose,
|
|
320
|
+
.admesh-component .container,
|
|
321
|
+
.admesh-component .grid,
|
|
322
|
+
.admesh-component .flex {
|
|
323
|
+
all: revert;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/* Ensure AdMesh components are not affected by dark mode utilities */
|
|
327
|
+
.admesh-component.dark,
|
|
328
|
+
.admesh-component[data-admesh-theme="dark"] {
|
|
329
|
+
color-scheme: dark;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.admesh-component.light,
|
|
333
|
+
.admesh-component[data-admesh-theme="light"] {
|
|
334
|
+
color-scheme: light;
|
|
335
|
+
}
|
|
336
|
+
`,xh=`
|
|
337
|
+
/* AdMesh Core Component Styles */
|
|
338
|
+
|
|
339
|
+
.admesh-component {
|
|
340
|
+
position: relative;
|
|
341
|
+
display: block;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/* Product Card Styles */
|
|
345
|
+
.admesh-product-card {
|
|
346
|
+
position: relative;
|
|
347
|
+
cursor: pointer;
|
|
348
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
349
|
+
height: 100%;
|
|
350
|
+
border-radius: 0.75rem;
|
|
351
|
+
background: rgb(255, 255, 255);
|
|
352
|
+
border: 1px solid rgb(229, 231, 235);
|
|
353
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
354
|
+
overflow: hidden;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.admesh-product-card[data-admesh-theme="dark"] {
|
|
358
|
+
background: rgb(17, 24, 39);
|
|
359
|
+
border-color: rgb(31, 41, 55);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.admesh-product-card:hover {
|
|
363
|
+
transform: translateY(-4px);
|
|
364
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
|
|
365
|
+
border-color: rgba(99, 102, 241, 0.2);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.admesh-product-card__container {
|
|
369
|
+
position: relative;
|
|
370
|
+
padding: 1rem;
|
|
371
|
+
height: 100%;
|
|
372
|
+
display: flex;
|
|
373
|
+
flex-direction: column;
|
|
374
|
+
gap: 0.75rem;
|
|
375
|
+
z-index: 2;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.admesh-product-card__header {
|
|
379
|
+
display: flex;
|
|
380
|
+
justify-content: space-between;
|
|
381
|
+
align-items: flex-start;
|
|
382
|
+
gap: 0.5rem;
|
|
383
|
+
margin-bottom: 0.25rem;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.admesh-product-card__title {
|
|
387
|
+
margin: 0;
|
|
388
|
+
font-size: 1.5rem;
|
|
389
|
+
font-weight: 700;
|
|
390
|
+
line-height: 1.2;
|
|
391
|
+
color: rgb(17, 24, 39);
|
|
392
|
+
letter-spacing: -0.025em;
|
|
393
|
+
transition: all 0.3s ease;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.admesh-product-card[data-admesh-theme="dark"] .admesh-product-card__title {
|
|
397
|
+
color: rgb(243, 244, 246);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.admesh-product-card:hover .admesh-product-card__title {
|
|
401
|
+
transform: translateX(4px);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.admesh-product-card__cta {
|
|
405
|
+
position: relative;
|
|
406
|
+
display: inline-flex;
|
|
407
|
+
align-items: center;
|
|
408
|
+
justify-content: center;
|
|
409
|
+
gap: 0.5rem;
|
|
410
|
+
white-space: nowrap;
|
|
411
|
+
border-radius: 0.5rem;
|
|
412
|
+
font-size: 1rem;
|
|
413
|
+
font-weight: 600;
|
|
414
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
415
|
+
padding: 0.75rem 1.5rem;
|
|
416
|
+
background: rgb(0, 0, 0);
|
|
417
|
+
color: rgb(255, 255, 255);
|
|
418
|
+
border: none;
|
|
419
|
+
cursor: pointer;
|
|
420
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
421
|
+
overflow: hidden;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.admesh-product-card[data-admesh-theme="dark"] .admesh-product-card__cta {
|
|
425
|
+
background: rgb(255, 255, 255);
|
|
426
|
+
color: rgb(0, 0, 0);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.admesh-product-card__cta:hover {
|
|
430
|
+
transform: translateY(-2px);
|
|
431
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.admesh-product-card__cta:active {
|
|
435
|
+
transform: translateY(0);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/* Summary Unit Styles */
|
|
439
|
+
.admesh-summary-unit {
|
|
440
|
+
font-size: 1rem;
|
|
441
|
+
line-height: 1.6;
|
|
442
|
+
color: rgb(17, 24, 39);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.admesh-summary-unit[data-admesh-theme="dark"] {
|
|
446
|
+
color: rgb(243, 244, 246);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.admesh-summary-unit a {
|
|
450
|
+
color: rgb(37, 99, 235);
|
|
451
|
+
text-decoration: underline;
|
|
452
|
+
text-decoration-color: rgb(37, 99, 235);
|
|
453
|
+
text-underline-offset: 2px;
|
|
454
|
+
transition: all 0.2s ease;
|
|
455
|
+
font-weight: 500;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.admesh-summary-unit[data-admesh-theme="dark"] a {
|
|
459
|
+
color: rgb(96, 165, 250);
|
|
460
|
+
text-decoration-color: rgb(96, 165, 250);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.admesh-summary-unit a:hover {
|
|
464
|
+
color: rgb(29, 78, 216);
|
|
465
|
+
text-decoration-color: rgb(29, 78, 216);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.admesh-summary-unit[data-admesh-theme="dark"] a:hover {
|
|
469
|
+
color: rgb(147, 197, 253);
|
|
470
|
+
text-decoration-color: rgb(147, 197, 253);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/* Ecommerce Cards Styles */
|
|
474
|
+
.admesh-ecommerce-container {
|
|
475
|
+
position: relative;
|
|
476
|
+
width: 100%;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.admesh-ecommerce-card {
|
|
480
|
+
flex-shrink: 0;
|
|
481
|
+
background: white;
|
|
482
|
+
border: 1px solid rgb(229, 231, 235);
|
|
483
|
+
border-radius: 0.5rem;
|
|
484
|
+
overflow: hidden;
|
|
485
|
+
transition: all 0.2s ease-in-out;
|
|
486
|
+
cursor: pointer;
|
|
487
|
+
position: relative;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.admesh-ecommerce-card[data-admesh-theme="dark"] {
|
|
491
|
+
background: rgb(31, 41, 55);
|
|
492
|
+
border-color: rgb(55, 65, 81);
|
|
493
|
+
color: white;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.admesh-ecommerce-card:hover {
|
|
497
|
+
transform: translateY(-2px);
|
|
498
|
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/* Badge Styles */
|
|
502
|
+
.admesh-badge {
|
|
503
|
+
display: inline-flex;
|
|
504
|
+
align-items: center;
|
|
505
|
+
gap: 0.375rem;
|
|
506
|
+
border-radius: 0.5rem;
|
|
507
|
+
padding: 0.375rem 0.75rem;
|
|
508
|
+
font-size: 0.875rem;
|
|
509
|
+
font-weight: 600;
|
|
510
|
+
transition: all 0.3s ease;
|
|
511
|
+
position: relative;
|
|
512
|
+
overflow: hidden;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.admesh-badge--primary {
|
|
516
|
+
background: linear-gradient(135deg, rgb(99, 102, 241), rgb(79, 70, 229));
|
|
517
|
+
color: white;
|
|
518
|
+
box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.admesh-badge--secondary {
|
|
522
|
+
background: rgb(243, 244, 246);
|
|
523
|
+
color: rgb(55, 65, 81);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.admesh-badge[data-admesh-theme="dark"].admesh-badge--secondary {
|
|
527
|
+
background: rgb(31, 41, 55);
|
|
528
|
+
color: rgb(209, 213, 219);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
/* Responsive */
|
|
532
|
+
@media (max-width: 640px) {
|
|
533
|
+
.admesh-product-card__container {
|
|
534
|
+
padding: 0.75rem;
|
|
535
|
+
gap: 0.5rem;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.admesh-product-card__title {
|
|
539
|
+
font-size: 1.25rem;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.admesh-product-card__cta {
|
|
543
|
+
padding: 0.5rem 1rem;
|
|
544
|
+
font-size: 0.875rem;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
`,wh=()=>{if(!(typeof document>"u")&&!(document.getElementById(as)&&document.getElementById(os))){if(!document.getElementById(as)){const u=document.createElement("style");u.id=as,u.textContent=bh,document.head.appendChild(u)}if(!document.getElementById(os)){const u=document.createElement("style");u.id=os,u.textContent=xh,document.head.appendChild(u)}}},kh=`
|
|
548
|
+
/* AdMesh UI SDK - Complete Self-Contained Styles */
|
|
549
|
+
|
|
550
|
+
/* CSS Reset for AdMesh components */
|
|
551
|
+
.admesh-component, .admesh-component * {
|
|
552
|
+
box-sizing: border-box;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/* CSS Variables - Black/White Color Scheme */
|
|
556
|
+
.admesh-component {
|
|
557
|
+
--admesh-primary: #000000;
|
|
558
|
+
--admesh-primary-hover: #333333;
|
|
559
|
+
--admesh-secondary: #666666;
|
|
560
|
+
--admesh-accent: #000000;
|
|
561
|
+
--admesh-background: #ffffff;
|
|
562
|
+
--admesh-surface: #ffffff;
|
|
563
|
+
--admesh-border: #e5e7eb;
|
|
564
|
+
--admesh-text: #000000;
|
|
565
|
+
--admesh-text-muted: #666666;
|
|
566
|
+
--admesh-text-light: #999999;
|
|
567
|
+
--admesh-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
568
|
+
--admesh-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
569
|
+
--admesh-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
570
|
+
--admesh-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
|
|
571
|
+
--admesh-radius: 0.5rem;
|
|
572
|
+
--admesh-radius-sm: 0.25rem;
|
|
573
|
+
--admesh-radius-lg: 0.75rem;
|
|
574
|
+
--admesh-radius-xl: 1rem;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.admesh-component[data-admesh-theme="dark"] {
|
|
578
|
+
--admesh-primary: #ffffff;
|
|
579
|
+
--admesh-primary-hover: #e5e7eb;
|
|
580
|
+
--admesh-secondary: #9ca3af;
|
|
581
|
+
--admesh-accent: #ffffff;
|
|
582
|
+
--admesh-background: #000000;
|
|
583
|
+
--admesh-surface: #111111;
|
|
584
|
+
--admesh-border: #333333;
|
|
585
|
+
--admesh-text: #ffffff;
|
|
586
|
+
--admesh-text-muted: #9ca3af;
|
|
587
|
+
--admesh-text-light: #666666;
|
|
588
|
+
--admesh-shadow: 0 1px 3px 0 rgb(255 255 255 / 0.1), 0 1px 2px -1px rgb(255 255 255 / 0.1);
|
|
589
|
+
--admesh-shadow-md: 0 4px 6px -1px rgb(255 255 255 / 0.1), 0 2px 4px -2px rgb(255 255 255 / 0.1);
|
|
590
|
+
--admesh-shadow-lg: 0 10px 15px -3px rgb(255 255 255 / 0.1), 0 4px 6px -4px rgb(255 255 255 / 0.1);
|
|
591
|
+
--admesh-shadow-xl: 0 20px 25px -5px rgb(255 255 255 / 0.1), 0 8px 10px -6px rgb(255 255 255 / 0.1);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/* Layout Styles */
|
|
595
|
+
.admesh-layout {
|
|
596
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
597
|
+
color: var(--admesh-text);
|
|
598
|
+
background-color: var(--admesh-background);
|
|
599
|
+
border-radius: var(--admesh-radius);
|
|
600
|
+
padding: 1.5rem;
|
|
601
|
+
box-shadow: var(--admesh-shadow);
|
|
602
|
+
border: 1px solid var(--admesh-border);
|
|
603
|
+
/* Consistent width: 100% for all layouts except ecommerce */
|
|
604
|
+
width: 100%;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/* Ecommerce layout exception */
|
|
608
|
+
.admesh-layout--ecommerce {
|
|
609
|
+
width: auto;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
/* Citation Unit Styles */
|
|
613
|
+
.admesh-citation-unit {
|
|
614
|
+
width: 100%;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
/* Inline Recommendation Styles */
|
|
618
|
+
.admesh-inline-recommendation {
|
|
619
|
+
width: 100%;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/* Simple Ad Styles */
|
|
623
|
+
.admesh-simple-ad {
|
|
624
|
+
width: 100%;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.admesh-layout__header {
|
|
628
|
+
margin-bottom: 1.5rem;
|
|
629
|
+
text-align: center;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.admesh-layout__title {
|
|
633
|
+
font-size: 1.25rem;
|
|
634
|
+
font-weight: 600;
|
|
635
|
+
color: var(--admesh-text);
|
|
636
|
+
margin-bottom: 0.5rem;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
.admesh-layout__subtitle {
|
|
640
|
+
font-size: 0.875rem;
|
|
641
|
+
color: var(--admesh-text-muted);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
.admesh-layout__cards-grid {
|
|
645
|
+
display: grid;
|
|
646
|
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
647
|
+
gap: 1rem;
|
|
648
|
+
margin-bottom: 1.5rem;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.admesh-layout__more-indicator {
|
|
652
|
+
text-align: center;
|
|
653
|
+
padding: 1rem;
|
|
654
|
+
color: var(--admesh-text-muted);
|
|
655
|
+
font-size: 0.875rem;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.admesh-layout__empty {
|
|
659
|
+
text-align: center;
|
|
660
|
+
padding: 3rem 1rem;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.admesh-layout__empty-content h3 {
|
|
664
|
+
font-size: 1.125rem;
|
|
665
|
+
font-weight: 600;
|
|
666
|
+
color: var(--admesh-text-muted);
|
|
667
|
+
margin-bottom: 0.5rem;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.admesh-layout__empty-content p {
|
|
671
|
+
font-size: 0.875rem;
|
|
672
|
+
color: var(--admesh-text-muted);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/* Product Card Styles */
|
|
676
|
+
.admesh-product-card {
|
|
677
|
+
background-color: var(--admesh-surface);
|
|
678
|
+
border: 1px solid var(--admesh-border);
|
|
679
|
+
border-radius: var(--admesh-radius);
|
|
680
|
+
padding: 1.5rem;
|
|
681
|
+
transition: all 0.2s ease-in-out;
|
|
682
|
+
position: relative;
|
|
683
|
+
overflow: hidden;
|
|
684
|
+
/* Consistent width: 100% for product cards */
|
|
685
|
+
width: 100%;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.admesh-product-card:hover {
|
|
689
|
+
box-shadow: var(--admesh-shadow-lg);
|
|
690
|
+
transform: translateY(-2px);
|
|
691
|
+
border-color: var(--admesh-primary);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.admesh-product-card__header {
|
|
695
|
+
display: flex;
|
|
696
|
+
justify-content: space-between;
|
|
697
|
+
align-items: flex-start;
|
|
698
|
+
margin-bottom: 1rem;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.admesh-product-card__title {
|
|
702
|
+
font-size: 1.125rem;
|
|
703
|
+
font-weight: 600;
|
|
704
|
+
color: var(--admesh-text);
|
|
705
|
+
margin-bottom: 0.5rem;
|
|
706
|
+
line-height: 1.4;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.admesh-product-card__reason {
|
|
710
|
+
font-size: 0.875rem;
|
|
711
|
+
color: var(--admesh-text-muted);
|
|
712
|
+
line-height: 1.5;
|
|
713
|
+
margin-bottom: 1rem;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
.admesh-product-card__match-score {
|
|
717
|
+
margin-bottom: 1rem;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
.admesh-product-card__match-score-label {
|
|
721
|
+
display: flex;
|
|
722
|
+
justify-content: space-between;
|
|
723
|
+
align-items: center;
|
|
724
|
+
font-size: 0.75rem;
|
|
725
|
+
color: var(--admesh-text-muted);
|
|
726
|
+
margin-bottom: 0.25rem;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.admesh-product-card__match-score-bar {
|
|
730
|
+
width: 100%;
|
|
731
|
+
height: 0.375rem;
|
|
732
|
+
background-color: var(--admesh-border);
|
|
733
|
+
border-radius: var(--admesh-radius-sm);
|
|
734
|
+
overflow: hidden;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.admesh-product-card__match-score-fill {
|
|
738
|
+
height: 100%;
|
|
739
|
+
background: var(--admesh-primary);
|
|
740
|
+
border-radius: var(--admesh-radius-sm);
|
|
741
|
+
transition: width 0.3s ease-in-out;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.admesh-product-card__badges {
|
|
745
|
+
display: flex;
|
|
746
|
+
flex-wrap: wrap;
|
|
747
|
+
gap: 0.5rem;
|
|
748
|
+
margin-bottom: 1rem;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.admesh-product-card__badge {
|
|
752
|
+
display: inline-flex;
|
|
753
|
+
align-items: center;
|
|
754
|
+
gap: 0.25rem;
|
|
755
|
+
padding: 0.25rem 0.5rem;
|
|
756
|
+
background-color: var(--admesh-primary);
|
|
757
|
+
color: white;
|
|
758
|
+
font-size: 0.75rem;
|
|
759
|
+
font-weight: 500;
|
|
760
|
+
border-radius: var(--admesh-radius-sm);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
.admesh-product-card__badge--secondary {
|
|
764
|
+
background-color: var(--admesh-secondary);
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
.admesh-product-card__keywords {
|
|
768
|
+
display: flex;
|
|
769
|
+
flex-wrap: wrap;
|
|
770
|
+
gap: 0.25rem;
|
|
771
|
+
margin-bottom: 1rem;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.admesh-product-card__keyword {
|
|
775
|
+
padding: 0.125rem 0.375rem;
|
|
776
|
+
background-color: var(--admesh-border);
|
|
777
|
+
color: var(--admesh-text-muted);
|
|
778
|
+
font-size: 0.75rem;
|
|
779
|
+
border-radius: var(--admesh-radius-sm);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
/* Dark mode specific enhancements */
|
|
783
|
+
.admesh-component[data-admesh-theme="dark"] .admesh-product-card__keyword {
|
|
784
|
+
background-color: #4b5563;
|
|
785
|
+
color: #d1d5db;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.admesh-component[data-admesh-theme="dark"] .admesh-product-card:hover {
|
|
789
|
+
border-color: var(--admesh-primary);
|
|
790
|
+
background-color: #374151;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.admesh-component[data-admesh-theme="dark"] .admesh-product-card__button:hover {
|
|
794
|
+
background: var(--admesh-primary-hover);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.admesh-product-card__footer {
|
|
798
|
+
display: flex;
|
|
799
|
+
justify-content: flex-end;
|
|
800
|
+
margin-top: 1.5rem;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
/* Mobile-specific sidebar improvements */
|
|
804
|
+
@media (max-width: 640px) {
|
|
805
|
+
.admesh-sidebar {
|
|
806
|
+
/* Ensure proper mobile viewport handling */
|
|
807
|
+
height: 100vh !important;
|
|
808
|
+
height: 100dvh !important; /* Dynamic viewport height for mobile browsers */
|
|
809
|
+
max-height: 100vh !important;
|
|
810
|
+
max-height: 100dvh !important;
|
|
811
|
+
width: 100vw !important;
|
|
812
|
+
max-width: 90vw !important;
|
|
813
|
+
overflow: hidden !important;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
.admesh-sidebar.relative {
|
|
817
|
+
height: 100% !important;
|
|
818
|
+
width: 100% !important;
|
|
819
|
+
max-width: 100% !important;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/* Improve touch scrolling */
|
|
823
|
+
.admesh-sidebar .overflow-y-auto {
|
|
824
|
+
-webkit-overflow-scrolling: touch !important;
|
|
825
|
+
overscroll-behavior: contain !important;
|
|
826
|
+
scroll-behavior: smooth !important;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
/* Prevent body scroll when sidebar is open */
|
|
830
|
+
body:has(.admesh-sidebar[data-mobile-open="true"]) {
|
|
831
|
+
overflow: hidden !important;
|
|
832
|
+
position: fixed !important;
|
|
833
|
+
width: 100% !important;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/* Tablet improvements */
|
|
838
|
+
@media (min-width: 641px) and (max-width: 1024px) {
|
|
839
|
+
.admesh-sidebar {
|
|
840
|
+
max-width: 400px !important;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/* Mobile responsiveness improvements for all components */
|
|
845
|
+
@media (max-width: 640px) {
|
|
846
|
+
/* Product cards mobile optimization */
|
|
847
|
+
.admesh-card {
|
|
848
|
+
padding: 0.75rem !important;
|
|
849
|
+
margin-bottom: 0.75rem !important;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/* Inline recommendations mobile optimization */
|
|
853
|
+
.admesh-inline-recommendation {
|
|
854
|
+
padding: 0.5rem !important;
|
|
855
|
+
margin-bottom: 0.5rem !important;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
/* Conversation summary mobile optimization */
|
|
859
|
+
.admesh-conversation-summary {
|
|
860
|
+
padding: 1rem !important;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/* Percentage text mobile improvements */
|
|
864
|
+
.admesh-component .text-xs {
|
|
865
|
+
font-size: 0.75rem !important;
|
|
866
|
+
line-height: 1rem !important;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
.admesh-component .text-sm {
|
|
870
|
+
font-size: 0.875rem !important;
|
|
871
|
+
line-height: 1.25rem !important;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/* Button mobile improvements */
|
|
875
|
+
.admesh-component button {
|
|
876
|
+
padding: 0.375rem 0.75rem !important;
|
|
877
|
+
font-size: 0.75rem !important;
|
|
878
|
+
min-height: 2rem !important;
|
|
879
|
+
touch-action: manipulation !important;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
/* Badge mobile improvements */
|
|
883
|
+
.admesh-component .rounded-full {
|
|
884
|
+
padding: 0.25rem 0.5rem !important;
|
|
885
|
+
font-size: 0.625rem !important;
|
|
886
|
+
line-height: 1rem !important;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/* Progress bar mobile improvements */
|
|
890
|
+
.admesh-component .bg-gray-200,
|
|
891
|
+
.admesh-component .bg-slate-600 {
|
|
892
|
+
height: 0.25rem !important;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/* Flex layout mobile improvements */
|
|
896
|
+
.admesh-component .flex {
|
|
897
|
+
flex-wrap: wrap !important;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
.admesh-component .gap-2 {
|
|
901
|
+
gap: 0.375rem !important;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
.admesh-component .gap-3 {
|
|
905
|
+
gap: 0.5rem !important;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
.admesh-product-card__button {
|
|
910
|
+
display: inline-flex;
|
|
911
|
+
align-items: center;
|
|
912
|
+
gap: 0.5rem;
|
|
913
|
+
padding: 0.75rem 1.5rem;
|
|
914
|
+
background: var(--admesh-primary);
|
|
915
|
+
color: var(--admesh-background);
|
|
916
|
+
font-size: 0.875rem;
|
|
917
|
+
font-weight: 500;
|
|
918
|
+
border: none;
|
|
919
|
+
border-radius: var(--admesh-radius);
|
|
920
|
+
cursor: pointer;
|
|
921
|
+
transition: all 0.2s ease-in-out;
|
|
922
|
+
text-decoration: none;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
.admesh-product-card__button:hover {
|
|
926
|
+
transform: translateY(-1px);
|
|
927
|
+
box-shadow: var(--admesh-shadow-lg);
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
/* Utility Classes */
|
|
931
|
+
.admesh-text-xs { font-size: 0.75rem; }
|
|
932
|
+
.admesh-text-sm { font-size: 0.875rem; }
|
|
933
|
+
.admesh-text-base { font-size: 1rem; }
|
|
934
|
+
.admesh-text-lg { font-size: 1.125rem; }
|
|
935
|
+
.admesh-text-xl { font-size: 1.25rem; }
|
|
936
|
+
|
|
937
|
+
.admesh-font-medium { font-weight: 500; }
|
|
938
|
+
.admesh-font-semibold { font-weight: 600; }
|
|
939
|
+
.admesh-font-bold { font-weight: 700; }
|
|
940
|
+
|
|
941
|
+
.admesh-text-muted { color: var(--admesh-text-muted); }
|
|
942
|
+
|
|
943
|
+
/* Comparison Table Styles */
|
|
944
|
+
.admesh-compare-table {
|
|
945
|
+
width: 100%;
|
|
946
|
+
border-collapse: collapse;
|
|
947
|
+
background-color: var(--admesh-surface);
|
|
948
|
+
border: 1px solid var(--admesh-border);
|
|
949
|
+
border-radius: var(--admesh-radius);
|
|
950
|
+
overflow: hidden;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
.admesh-compare-table th,
|
|
954
|
+
.admesh-compare-table td {
|
|
955
|
+
padding: 0.75rem;
|
|
956
|
+
text-align: left;
|
|
957
|
+
border-bottom: 1px solid var(--admesh-border);
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
.admesh-compare-table th {
|
|
961
|
+
background-color: var(--admesh-background);
|
|
962
|
+
font-weight: 600;
|
|
963
|
+
color: var(--admesh-text);
|
|
964
|
+
font-size: 0.875rem;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
.admesh-compare-table td {
|
|
968
|
+
color: var(--admesh-text);
|
|
969
|
+
font-size: 0.875rem;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
.admesh-compare-table tr:hover {
|
|
973
|
+
background-color: var(--admesh-border);
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/* Dark mode table enhancements */
|
|
977
|
+
.admesh-component[data-admesh-theme="dark"] .admesh-compare-table th {
|
|
978
|
+
background-color: #374151;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.admesh-component[data-admesh-theme="dark"] .admesh-compare-table tr:hover {
|
|
982
|
+
background-color: #4b5563;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
/* Responsive Design */
|
|
986
|
+
@media (max-width: 768px) {
|
|
987
|
+
.admesh-layout {
|
|
988
|
+
padding: 1rem;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
.admesh-layout__cards-grid {
|
|
992
|
+
grid-template-columns: 1fr;
|
|
993
|
+
gap: 0.75rem;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
.admesh-product-card {
|
|
997
|
+
padding: 1rem;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
.admesh-compare-table {
|
|
1001
|
+
font-size: 0.75rem;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.admesh-compare-table th,
|
|
1005
|
+
.admesh-compare-table td {
|
|
1006
|
+
padding: 0.5rem;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
/* Essential Utility Classes for Self-Contained SDK - High Specificity */
|
|
1011
|
+
.admesh-component .relative { position: relative !important; }
|
|
1012
|
+
.admesh-component .absolute { position: absolute !important; }
|
|
1013
|
+
.admesh-component .flex { display: flex !important; }
|
|
1014
|
+
.admesh-component .inline-flex { display: inline-flex !important; }
|
|
1015
|
+
.admesh-component .grid { display: grid !important; }
|
|
1016
|
+
.admesh-component .hidden { display: none !important; }
|
|
1017
|
+
.admesh-component .block { display: block !important; }
|
|
1018
|
+
.admesh-component .inline-block { display: inline-block !important; }
|
|
1019
|
+
|
|
1020
|
+
/* Flexbox utilities */
|
|
1021
|
+
.admesh-component .flex-col { flex-direction: column !important; }
|
|
1022
|
+
.admesh-component .flex-row { flex-direction: row !important; }
|
|
1023
|
+
.admesh-component .flex-wrap { flex-wrap: wrap !important; }
|
|
1024
|
+
.admesh-component .items-center { align-items: center !important; }
|
|
1025
|
+
.admesh-component .items-start { align-items: flex-start !important; }
|
|
1026
|
+
.admesh-component .items-end { align-items: flex-end !important; }
|
|
1027
|
+
.admesh-component .justify-center { justify-content: center !important; }
|
|
1028
|
+
.admesh-component .justify-between { justify-content: space-between !important; }
|
|
1029
|
+
.admesh-component .justify-end { justify-content: flex-end !important; }
|
|
1030
|
+
.admesh-component .flex-1 { flex: 1 1 0% !important; }
|
|
1031
|
+
.admesh-component .flex-shrink-0 { flex-shrink: 0 !important; }
|
|
1032
|
+
|
|
1033
|
+
/* Grid utilities */
|
|
1034
|
+
.admesh-component .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
|
|
1035
|
+
.admesh-component .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
1036
|
+
.admesh-component .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
1037
|
+
|
|
1038
|
+
/* Spacing utilities */
|
|
1039
|
+
.admesh-component .gap-1 { gap: 0.25rem; }
|
|
1040
|
+
.admesh-component .gap-2 { gap: 0.5rem; }
|
|
1041
|
+
.admesh-component .gap-3 { gap: 0.75rem; }
|
|
1042
|
+
.admesh-component .gap-4 { gap: 1rem; }
|
|
1043
|
+
.admesh-component .gap-6 { gap: 1.5rem; }
|
|
1044
|
+
.admesh-component .gap-8 { gap: 2rem; }
|
|
1045
|
+
|
|
1046
|
+
/* Padding utilities */
|
|
1047
|
+
.admesh-component .p-1 { padding: 0.25rem; }
|
|
1048
|
+
.admesh-component .p-2 { padding: 0.5rem; }
|
|
1049
|
+
.admesh-component .p-3 { padding: 0.75rem; }
|
|
1050
|
+
.admesh-component .p-4 { padding: 1rem; }
|
|
1051
|
+
.admesh-component .p-5 { padding: 1.25rem; }
|
|
1052
|
+
.admesh-component .p-6 { padding: 1.5rem; }
|
|
1053
|
+
.admesh-component .px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
|
|
1054
|
+
.admesh-component .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
|
|
1055
|
+
.admesh-component .px-4 { padding-left: 1rem; padding-right: 1rem; }
|
|
1056
|
+
.admesh-component .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
|
|
1057
|
+
.admesh-component .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
|
|
1058
|
+
.admesh-component .py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
|
|
1059
|
+
.admesh-component .pt-2 { padding-top: 0.5rem; }
|
|
1060
|
+
.admesh-component .pt-3 { padding-top: 0.75rem; }
|
|
1061
|
+
.admesh-component .pb-2 { padding-bottom: 0.5rem; }
|
|
1062
|
+
.admesh-component .pb-3 { padding-bottom: 0.75rem; }
|
|
1063
|
+
|
|
1064
|
+
/* Margin utilities */
|
|
1065
|
+
.admesh-component .m-0 { margin: 0; }
|
|
1066
|
+
.admesh-component .mb-1 { margin-bottom: 0.25rem; }
|
|
1067
|
+
.admesh-component .mb-2 { margin-bottom: 0.5rem; }
|
|
1068
|
+
.admesh-component .mb-3 { margin-bottom: 0.75rem; }
|
|
1069
|
+
.admesh-component .mb-4 { margin-bottom: 1rem; }
|
|
1070
|
+
.admesh-component .mb-6 { margin-bottom: 1.5rem; }
|
|
1071
|
+
.admesh-component .mt-1 { margin-top: 0.25rem; }
|
|
1072
|
+
.admesh-component .mt-2 { margin-top: 0.5rem; }
|
|
1073
|
+
.admesh-component .mt-4 { margin-top: 1rem; }
|
|
1074
|
+
.admesh-component .mt-6 { margin-top: 1.5rem; }
|
|
1075
|
+
.admesh-component .mt-auto { margin-top: auto; }
|
|
1076
|
+
.admesh-component .ml-1 { margin-left: 0.25rem; }
|
|
1077
|
+
.admesh-component .mr-1 { margin-right: 0.25rem; }
|
|
1078
|
+
.admesh-component .mr-2 { margin-right: 0.5rem; }
|
|
1079
|
+
|
|
1080
|
+
/* Width and height utilities */
|
|
1081
|
+
.admesh-component .w-2 { width: 0.5rem; }
|
|
1082
|
+
.admesh-component .w-3 { width: 0.75rem; }
|
|
1083
|
+
.admesh-component .w-4 { width: 1rem; }
|
|
1084
|
+
.admesh-component .w-5 { width: 1.25rem; }
|
|
1085
|
+
.admesh-component .w-6 { width: 1.5rem; }
|
|
1086
|
+
.admesh-component .w-full { width: 100%; }
|
|
1087
|
+
.admesh-component .w-fit { width: fit-content; }
|
|
1088
|
+
.admesh-component .h-2 { height: 0.5rem; }
|
|
1089
|
+
.admesh-component .h-3 { height: 0.75rem; }
|
|
1090
|
+
.admesh-component .h-4 { height: 1rem; }
|
|
1091
|
+
.admesh-component .h-5 { height: 1.25rem; }
|
|
1092
|
+
.admesh-component .h-6 { height: 1.5rem; }
|
|
1093
|
+
.admesh-component .h-full { height: 100%; }
|
|
1094
|
+
.admesh-component .min-w-0 { min-width: 0px; }
|
|
1095
|
+
|
|
1096
|
+
/* Border utilities */
|
|
1097
|
+
.admesh-component .border { border-width: 1px; }
|
|
1098
|
+
.admesh-component .border-t { border-top-width: 1px; }
|
|
1099
|
+
.admesh-component .border-gray-100 { border-color: #f3f4f6; }
|
|
1100
|
+
.admesh-component .border-gray-200 { border-color: #e5e7eb; }
|
|
1101
|
+
.admesh-component .border-gray-300 { border-color: #d1d5db; }
|
|
1102
|
+
.admesh-component .border-blue-200 { border-color: #bfdbfe; }
|
|
1103
|
+
.admesh-component .border-green-200 { border-color: #bbf7d0; }
|
|
1104
|
+
|
|
1105
|
+
/* Border radius utilities */
|
|
1106
|
+
.admesh-component .rounded { border-radius: 0.25rem !important; }
|
|
1107
|
+
.admesh-component .rounded-md { border-radius: 0.375rem !important; }
|
|
1108
|
+
.admesh-component .rounded-lg { border-radius: 0.5rem !important; }
|
|
1109
|
+
.admesh-component .rounded-xl { border-radius: 0.75rem !important; }
|
|
1110
|
+
.admesh-component .rounded-full { border-radius: 9999px !important; }
|
|
1111
|
+
|
|
1112
|
+
/* Background utilities */
|
|
1113
|
+
.admesh-component .bg-white { background-color: #ffffff; }
|
|
1114
|
+
.admesh-component .bg-gray-50 { background-color: #f9fafb; }
|
|
1115
|
+
.admesh-component .bg-gray-100 { background-color: #f3f4f6; }
|
|
1116
|
+
.admesh-component .bg-blue-50 { background-color: #eff6ff; }
|
|
1117
|
+
.admesh-component .bg-blue-100 { background-color: #dbeafe; }
|
|
1118
|
+
.admesh-component .bg-green-100 { background-color: #dcfce7; }
|
|
1119
|
+
.admesh-component .bg-green-500 { background-color: #22c55e; }
|
|
1120
|
+
.admesh-component .bg-blue-500 { background-color: #3b82f6; }
|
|
1121
|
+
|
|
1122
|
+
/* Solid backgrounds - no gradients for minimal design */
|
|
1123
|
+
.admesh-component .bg-primary { background-color: var(--admesh-primary); }
|
|
1124
|
+
.admesh-component .bg-secondary { background-color: var(--admesh-secondary); }
|
|
1125
|
+
.admesh-component .bg-surface { background-color: var(--admesh-surface); }
|
|
1126
|
+
.admesh-component .bg-background { background-color: var(--admesh-background); }
|
|
1127
|
+
|
|
1128
|
+
/* Text utilities */
|
|
1129
|
+
.admesh-component .text-xs { font-size: 0.75rem; line-height: 1rem; }
|
|
1130
|
+
.admesh-component .text-sm { font-size: 0.875rem; line-height: 1.25rem; }
|
|
1131
|
+
.admesh-component .text-base { font-size: 1rem; line-height: 1.5rem; }
|
|
1132
|
+
.admesh-component .text-lg { font-size: 1.125rem; line-height: 1.75rem; }
|
|
1133
|
+
.admesh-component .text-xl { font-size: 1.25rem; line-height: 1.75rem; }
|
|
1134
|
+
.admesh-component .font-medium { font-weight: 500; }
|
|
1135
|
+
.admesh-component .font-semibold { font-weight: 600; }
|
|
1136
|
+
.admesh-component .font-bold { font-weight: 700; }
|
|
1137
|
+
.admesh-component .leading-relaxed { line-height: 1.625; }
|
|
1138
|
+
|
|
1139
|
+
/* Text colors */
|
|
1140
|
+
.admesh-component .text-white { color: #ffffff; }
|
|
1141
|
+
.admesh-component .text-gray-400 { color: #9ca3af; }
|
|
1142
|
+
.admesh-component .text-gray-500 { color: #6b7280; }
|
|
1143
|
+
.admesh-component .text-gray-600 { color: #4b5563; }
|
|
1144
|
+
.admesh-component .text-gray-700 { color: #374151; }
|
|
1145
|
+
.admesh-component .text-gray-800 { color: #1f2937; }
|
|
1146
|
+
.admesh-component .text-blue-600 { color: #2563eb; }
|
|
1147
|
+
.admesh-component .text-blue-700 { color: #1d4ed8; }
|
|
1148
|
+
.admesh-component .text-green-700 { color: #15803d; }
|
|
1149
|
+
|
|
1150
|
+
/* Shadow utilities */
|
|
1151
|
+
.admesh-component .shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
|
|
1152
|
+
.admesh-component .shadow { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); }
|
|
1153
|
+
.admesh-component .shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
|
|
1154
|
+
.admesh-component .shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
|
|
1155
|
+
.admesh-component .shadow-xl { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }
|
|
1156
|
+
|
|
1157
|
+
/* Transition utilities */
|
|
1158
|
+
.admesh-component .transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
|
|
1159
|
+
.admesh-component .transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
|
|
1160
|
+
.admesh-component .duration-200 { transition-duration: 200ms; }
|
|
1161
|
+
.admesh-component .duration-300 { transition-duration: 300ms; }
|
|
1162
|
+
|
|
1163
|
+
/* Transform utilities */
|
|
1164
|
+
.admesh-component .hover\\:-translate-y-1:hover { transform: translateY(-0.25rem); }
|
|
1165
|
+
.admesh-component .hover\\:scale-105:hover { transform: scale(1.05); }
|
|
1166
|
+
|
|
1167
|
+
/* Hover utilities */
|
|
1168
|
+
.admesh-component .hover\\:shadow-xl:hover { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }
|
|
1169
|
+
.admesh-component .hover\\:bg-gray-100:hover { background-color: #f3f4f6; }
|
|
1170
|
+
.admesh-component .hover\\:text-blue-800:hover { color: #1e40af; }
|
|
1171
|
+
|
|
1172
|
+
/* Cursor utilities */
|
|
1173
|
+
.admesh-component .cursor-pointer { cursor: pointer; }
|
|
1174
|
+
|
|
1175
|
+
/* Overflow utilities */
|
|
1176
|
+
.admesh-component .overflow-hidden { overflow: hidden; }
|
|
1177
|
+
.admesh-component .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1178
|
+
|
|
1179
|
+
/* Text decoration */
|
|
1180
|
+
.admesh-component .underline { text-decoration-line: underline; }
|
|
1181
|
+
|
|
1182
|
+
/* Whitespace */
|
|
1183
|
+
.admesh-component .whitespace-nowrap { white-space: nowrap; }
|
|
1184
|
+
|
|
1185
|
+
/* Dark mode utilities */
|
|
1186
|
+
@media (prefers-color-scheme: dark) {
|
|
1187
|
+
.admesh-component .dark\\:bg-slate-800 { background-color: #1e293b; }
|
|
1188
|
+
.admesh-component .dark\\:bg-slate-900 { background-color: #0f172a; }
|
|
1189
|
+
.admesh-component .dark\\:border-slate-700 { border-color: #334155; }
|
|
1190
|
+
.admesh-component .dark\\:text-white { color: #ffffff; }
|
|
1191
|
+
.admesh-component .dark\\:text-gray-200 { color: #e5e7eb; }
|
|
1192
|
+
.admesh-component .dark\\:text-gray-300 { color: #d1d5db; }
|
|
1193
|
+
.admesh-component .dark\\:text-gray-400 { color: #9ca3af; }
|
|
1194
|
+
.admesh-component .dark\\:text-blue-400 { color: #60a5fa; }
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
/* Responsive utilities */
|
|
1198
|
+
@media (min-width: 640px) {
|
|
1199
|
+
.admesh-component .sm\\:p-5 { padding: 1.25rem; }
|
|
1200
|
+
.admesh-component .sm\\:text-base { font-size: 1rem; line-height: 1.5rem; }
|
|
1201
|
+
.admesh-component .sm\\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
|
|
1202
|
+
.admesh-component .sm\\:flex-row { flex-direction: row; }
|
|
1203
|
+
.admesh-component .sm\\:items-center { align-items: center; }
|
|
1204
|
+
.admesh-component .sm\\:justify-between { justify-content: space-between; }
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
@media (min-width: 768px) {
|
|
1208
|
+
.admesh-component .md\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
@media (min-width: 1024px) {
|
|
1212
|
+
.admesh-component .lg\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
1213
|
+
.admesh-component .lg\\:col-span-1 { grid-column: span 1 / span 1; }
|
|
1214
|
+
}
|
|
1215
|
+
`;let Qc=!1;const _h=()=>{b.useEffect(()=>{if(!Qc){try{wh();const u=document.createElement("style");u.id="admesh-ui-sdk-styles-legacy",u.textContent=kh,document.getElementById("admesh-ui-sdk-styles-legacy")||document.head.appendChild(u),Qc=!0}catch{F.error("[AdMesh] Failed to inject styles")}return()=>{}}},[])},Sh=()=>{};function Ch(u){const l=Math.max(1,Math.round(u));if(l<60)return`${l}s`;const f=Math.floor(l/60),d=l%60;return d>0?`${f}m ${d}s`:`${f}m`}function Eh(u){return Ch(u/1e3)}const is=({content:u,theme:l,fontSize:f})=>{const d=N=>N.split(/(\*\*[^*]+\*\*|\[[^\]]+\]\(https?:\/\/[^)\s]+\))/g).map((P,H)=>{if(P.startsWith("**")&&P.endsWith("**")&&P.length>4)return m.jsx("strong",{style:{fontWeight:"600",color:l.textColor},children:P.slice(2,-2)},H);const V=P.match(/^\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)$/);return V?m.jsx("a",{href:V[2],target:"_blank",rel:"noopener noreferrer",style:{color:l.primaryColor,textDecoration:"underline",textUnderlineOffset:"2px"},children:V[1]},H):m.jsx(b.Fragment,{children:P},H)}),k=N=>N.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(P=>P.trim()).filter((P,H,V)=>P.length>0||H<V.length-1),M=N=>{const P=k(N);return P.length>1&&P.every(H=>/^:?-{3,}:?$/.test(H))},L=N=>{const P=N.indexOf("|");if(P<=0)return{heading:null,headerLine:N};const H=N.slice(0,P).trim();return!H||/^[-|:\s]+$/.test(H)?{heading:null,headerLine:N}:{heading:H,headerLine:N.slice(P).trim()}},X=(N,P)=>{const H=k(N).length,V=k(P).length;return H<=1||H===V?P:`| ${Array.from({length:H},()=>"---").join(" | ")} |`},S=N=>{if(N.length<2||!N[0].includes("|"))return{heading:null,lines:N};const{heading:P,headerLine:H}=L(N[0]),V=H.startsWith("|")?H:`| ${H}`,ee=X(V,N[1]);return{heading:P,lines:[V,ee,...N.slice(2)]}},y=N=>{if(N.length<2||!N[0].includes("|"))return!1;const{lines:P}=S(N);return M(P[1])&&k(P[0]).length>=2},$=N=>{if(!N.includes("|"))return[N];let P=N.trim();const H=[],V=P.indexOf("|");if(V>0){const ee=P.slice(0,V).trim();ee&&!/^[-|:\s]+$/.test(ee)&&(H.push(ee),P=P.slice(V).trim())}return P=P.replace(/\|\s*(\|(?:\s*:?-{3,}:?\s*\|)+)/g,(ee,se)=>`
|
|
1216
|
+
${se}`),P=P.replace(/\|\s*\|\s*(?=[A-Za-z0-9*])/g,`|
|
|
1217
|
+
| `),P=P.replace(/\|\s+(?=\|(?!\s*:?-{3,}:?\s*\|)[^|\n])/g,`|
|
|
1218
|
+
`),H.push(...P.split(`
|
|
1219
|
+
`).map(ee=>ee.trim()).filter(Boolean)),H},E=N=>{const P=N.split(`
|
|
1220
|
+
`),H=[];for(const V of P){if(!V.includes("|")){H.push(V);continue}H.push(...$(V))}return H.join(`
|
|
1221
|
+
`)},W=(N=>{const P=E(N).split(`
|
|
1222
|
+
`),H=[];let V=0;for(;V<P.length;){const ee=P[V],se=P[V+1]||"";if(ee.includes("|")&&M(se)){H.length>0&&H[H.length-1].trim()&&H.push("");const{heading:oe,headerLine:re}=L(ee);for(oe&&H.push(oe),H.push(re,X(re,se)),V+=2;V<P.length&&P[V].includes("|")&&P[V].trim();)H.push(P[V]),V+=1;V<P.length&&P[V].trim()&&H.push("");continue}H.push(ee),V+=1}return H.join(`
|
|
1223
|
+
`)})(u).split(/\n\s*\n/).map(N=>N.trim()).filter(Boolean);return m.jsx("div",{style:{margin:0,color:l.textColor,fontSize:f},children:W.map((N,P)=>{const H=N.split(`
|
|
1224
|
+
`).map(re=>re.trim()).filter(Boolean),V=H.every(re=>/^[-*]\s+/.test(re)),ee=H.every(re=>/^\d+\.\s+/.test(re)),se=H.length===1&&/^#{1,3}\s+/.test(H[0]),oe=y(H);if(se){const re=H[0].replace(/^#{1,3}\s+/,"");return m.jsx("h3",{style:{marginTop:P===0?0:"1rem",marginBottom:"0.75rem",fontWeight:"600",fontSize:"1.05em",color:l.textColor},children:d(re)},P)}if(oe){const{heading:re,lines:ae}=S(H),Q=k(ae[0]),U=ae.slice(2).map(k).filter(he=>he.length===Q.length);return m.jsxs("div",{style:{width:"100%",overflowX:"auto",marginBottom:"1rem"},children:[re?m.jsx("p",{style:{marginTop:P===0?0:"1rem",marginBottom:"0.75rem",fontWeight:600,color:l.textColor,fontSize:f},children:d(re)}):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:f,lineHeight:1.45},children:[m.jsx("thead",{children:m.jsx("tr",{children:Q.map((he,ce)=>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:d(he)},ce))})}),m.jsx("tbody",{children:U.map((he,ce)=>m.jsx("tr",{children:he.map((ye,$e)=>m.jsx("td",{style:{padding:"9px 10px",verticalAlign:"top",borderBottom:ce===U.length-1?"none":`1px solid ${l.borderColor||"rgba(148, 163, 184, 0.18)"}`,whiteSpace:"normal"},children:d(ye)},$e))},ce))})]})})]},P)}if(V||ee){const re=ee?"ol":"ul";return m.jsx(re,{style:{marginBottom:"1rem",paddingLeft:"1.25rem",color:l.textColor,fontSize:f},children:H.map((ae,Q)=>m.jsx("li",{style:{marginBottom:"0.45rem"},children:d(ae.replace(/^([-*]|\d+\.)\s+/,""))},Q))},P)}return m.jsx("p",{style:{marginBottom:"1rem",lineHeight:"1.6",color:l.textColor,fontSize:f,whiteSpace:"pre-wrap"},children:H.map((re,ae)=>m.jsxs(b.Fragment,{children:[ae>0&&m.jsx("br",{}),d(re)]},ae))},P)})})};function Va(u){return u===void 0?void 0:typeof u=="number"?`${u}px`:u}function Bc(u){if(typeof u=="number")return u;if(typeof u!="string")return;const l=Number(u.trim().replace(/px$/i,""));return Number.isFinite(l)&&l>0?l:void 0}function Po(u){return u.replace(/\s+/g," ").trim()}function Ah(u,l){const f=u.filter(L=>!(L!=null&&L.is_sponsored)).slice(0,3),d=l.filter(L=>!(L!=null&&L.is_sponsored)).slice(0,3),k=l.find(L=>L?.is_sponsored);if(!k)return d.length?d:f;const M=d.length?d:f;return[k,...M].slice(0,4)}function Ih(u,l,f,d){const k=new Set,M=[],L=(E,W="information")=>{const N=Po(E);if(!N)return;const P=N.toLowerCase();k.has(P)||(k.add(P),M.push({id:`followup_${M.length}_${P.replace(/[^a-z0-9]+/g,"_")}`,text:N,type:W,is_sponsored:!1}))},X=new Set,S=E=>{const W=Po(E||"");if(!W)return;const N=W.replace(/^(how|why|what|when|where|which|who)\s+/i,"").replace(/\?+$/g,"").trim();N&&X.add(N)};(d||[]).forEach(E=>S(E?.title)),(f||[]).forEach(E=>S(E?.title)),l.split(/\n+/).map(E=>Po(E.replace(/^[-*]\s+/,""))).filter(Boolean).filter(E=>E.length>=24&&E.length<=90).forEach(E=>{X.size>=6||S(E)});const y=Po(u.replace(/[?.!]+$/g,"")),$=Array.from(X).slice(0,3);return[$[0]?`Tell me more about ${$[0]}`:"",$[1]?`Show me examples related to ${$[1]}`:"",$[2]?`Compare the main options for ${$[2]}`:"","Break this down more simply",`What should I look at next about ${y}`,"Give me the practical takeaway here"].forEach((E,W)=>{M.length>=3||L(E,W===0?"comparison":"information")}),M.slice(0,3)}function Ph(){if(typeof window>"u")return"unknown";const u=window.innerWidth;return u<768?"mobile":u<1024?"tablet":"desktop"}function Kc(u){return u?{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 Xc(u){const l=u?.trim();if(!l||/%%[^%]+%%/.test(l))return!1;try{const f=new URL(l);return!!(f.protocol&&f.hostname)}catch{return!1}}function Gc(){var u;try{const l=(u=window.location.href)==null?void 0:u.trim();if(Xc(l))return l}catch{return}}function Jc(u){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=Gc()||(Xc(u)?u.trim():void 0);let f=l?window.location.pathname||"/":void 0;try{f=l?new URL(l).pathname||"/":void 0}catch{f=Gc()?window.location.pathname||"/":void 0}const d=(f||"").split("/").filter(Boolean);return{page_url:l,page_path:f,article_slug:d[d.length-1],page_title:document.title||void 0,referrer:document.referrer||void 0,device_type:Ph()}}function Rh(u){var l,f;const d=(f=(l=u?.recommendation)==null?void 0:l.creative)==null?void 0:f.follow_up_suggestion,k=u?.recommendation_id;return!d||!k?null:{id:k,text:Po(d),type:"action",is_sponsored:!0,recommendation:u,metadata:{source:"assistant_query_recommendation",recommendation_id:k}}}function ls(u){return[...u].sort((l,f)=>{const d=!!l.is_sponsored,k=!!f.is_sponsored;return d===k?0:d?-1:1})}const Mh={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)"}},Dh={sm:{width:"320px",height:"400px"},md:{width:"400px",height:"500px"},lg:{width:"480px",height:"600px"},xl:{width:"560px",height:"700px"}},zh={"bottom-right":{bottom:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"top-left":{top:"20px",left:"20px"}},Nh=({theme:u,className:l,style:f,triggerLabel:d="Ask Ava",headerTitle:k="Ask Ava",headerLogoUrl:M,showHeader:L=!0,showHeaderTitle:X=!0,showSubtitle:S=!0,layout:y="floating",surface:$="page",adSlotBehavior:E="expand",showCompactSlotHeader:W=!0,showCompactWelcomeMessage:N=!0,showCompactSlotInput:P=!0,showCompactSlotDisclaimer:H=!0,panelWidth:V,panelHeight:ee,analyticsPageUrl:se,fontScale:oe=1,position:re="bottom-right",size:ae="md",defaultOpen:Q,open:U,onOpenChange:he,autoOpen:ce=!1,showWelcomeMessage:ye=!1,welcomeMessage:$e="Hi, I\u2019m Ava. I\u2019ll help you find the best options.",placeholder:te="Ask me anything about products...",adsEnabled:le=!0,suggestions:xe,maxSuggestions:Pe=6,suggestionStyle:C="carousel",suggestionTrigger:q="always",suggestionPlacement:ie="below",sponsoredCreativePlacement:ke="none",onlyShowWhenSponsored:Ee=!1,variant:p="default",queryHandler:I,suggestionsLoader:G,disclaimerText:Y,poweredByLabel:_e="Powered by AdMesh",subtitle:ve="Publisher Assistant",relatedItemsHeading:Ae="Related reading",onOpen:Le,onClose:Ne})=>{const{sdk:je,sessionId:We,theme:Bt,apiKey:ne,userId:de}=Vc(),{suggestions:ge,isAnalyzingIntent:Me,intentError:De,retryIntentAnalysis:Z,activeDelegationSession:Oe,hasActiveDelegationSession:K,stopDelegationSession:He,refreshDelegationActivity:Ge}=Hc();_h(),console.log("[AdMeshIntentAssistant] Context:",{sdk:je,sessionId:We,hasContextTheme:!!Bt});const B=u||Bt||Mh,Ze=B?.mode||"light",Fe=$==="ad-slot",un=(c=!1)=>Fe&&!(c&&E==="expand"),[it,Kt]=b.useState(Q||ce),Mn=U!==void 0,Ro=Mn?U:it,[bn,Hr]=b.useState(""),[Xt,Nt]=b.useState(!1),[ot,ft]=b.useState([]),[Be,cn]=b.useState(!1),[Vr,fn]=b.useState(null),[fe,pn]=b.useState(!1),[xn,be]=b.useState(new Set),[tt,Zt]=b.useState(xe||ge||[]),[Mo,Yn]=b.useState(0),[dr,Do]=b.useState(0),[Qr,Fi]=b.useState({}),zo=b.useRef(null),er=b.useRef(!1),hn=b.useRef(null),ra=b.useRef(new Map),Br=b.useRef([]),Dn=b.useRef(null),Ct=b.useRef(null),qt=b.useRef(null),mr=b.useRef(!1),oa=b.useRef(!1),$i=b.useRef(null),aa=b.useRef(null),ia=b.useRef(null),[kr,Qa]=b.useState(!1),[fr,Kr]=b.useState(!1),dn=b.useRef(null),Rt=b.useRef(null),jt=!!(ne!=null&&ne.toLowerCase().startsWith("pub_")),Yt=K()&&Oe?.session_id===We?Oe:null,la=b.useRef(new Set),pr=b.useRef(new Set),_r=b.useRef(!1),Xr=Fe&&E==="expand"&&(fe||Be),[No,Oi]=b.useState(!1);b.useEffect(()=>{if(typeof window>"u")return;const c=window.matchMedia("(max-width: 767px)"),D=()=>Oi(c.matches);return D(),c.addEventListener("change",D),()=>c.removeEventListener("change",D)},[]),b.useEffect(()=>{if(!Xr||typeof document>"u")return;const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=c}},[Xr]);const Ba=Fe&&E==="sticky"&&(fe||ot.length>0||Be),wn=Va(V)??"100%",tr=Va(ee)??"100%",nr=Bc(V),gn=Bc(ee),Ka=Fe&&(gn??Number.POSITIVE_INFINITY)<=60,mn=Fe&&(nr??Number.POSITIVE_INFINITY)<=360&&(gn??Number.POSITIVE_INFINITY)<=120,Sr=b.useCallback(c=>D=>{D?ra.current.set(c,D):ra.current.delete(c)},[]),yt=b.useCallback(async(c,D={})=>{if(!(!je||!We))try{await je.trackPublisherAssistantEvent({event_name:c,timestamp:new Date().toISOString(),session_id:We,...Jc(se),...D})}catch(z){console.warn(`[AdMeshIntentAssistant] Failed to track ${c}`,z)}},[se,je,We]),hr=b.useCallback((c,D,z)=>{var T,J;const me=D?.recommendation_id;if(!me)return;const Ye=`${c}:${me}`;pr.current.has(Ye)||(pr.current.add(Ye),yt("recommendation_shown",{message_id:c,query:z,recommendation_id:me,brand_name:(J=(T=D.recommendation)==null?void 0:T.creative)==null?void 0:J.brand_name,is_sponsored:!0}))},[yt]),Xa=b.useCallback((c,D,z,T,J,me)=>{const Ye=Array.isArray(me)&&me.length?me.map((Te,Ue)=>{const kt=Po(Te.text||"");return kt?{id:`followup_llm_${Ue}_${kt.toLowerCase().replace(/[^a-z0-9]+/g,"_")}`,text:kt,type:Te.type||"information",is_sponsored:!1}:null}).filter(Te=>!!Te).slice(0,3):Ih(c,D,z,T),At=Rh(J),Lt=At?[At,...Ye.slice(0,2)]:Ye.slice(0,3);Lt.length&&Zt(ls(Lt))},[]),en=b.useCallback((c,D)=>{const z=Po(c.query||c.label||"");if(!z||!D)return;const T={id:D,text:z,type:"action",is_sponsored:!0,recommendation:{recommendation_id:D,recommendation:{creative:{follow_up_suggestion:z}},tracking:{followup_engagement_url:c.engagement_url,followup_exposure_url:c.exposure_url}}};Zt(J=>{const me=J.filter(Ye=>!Ye.is_sponsored).slice(0,3);return ls([T,...me].slice(0,4))})},[]),sa=b.useCallback(()=>{const c=Dn.current,D=Ct.current;if(!c||!D)return!1;const z=c.getBoundingClientRect(),T=D.getBoundingClientRect(),J=Math.max(0,c.scrollTop+T.top-z.top);return c.scrollTop=J,!0},[]);b.useLayoutEffect(()=>{var c;if(mr.current){sa()&&(mr.current=!1);return}oa.current||(c=aa.current)==null||c.scrollIntoView({behavior:"smooth"})},[ot,sa]),b.useLayoutEffect(()=>{if(!Fe||Xr)return;const c=$i.current;if(!c)return;const D=c.closest(".admesh-publisher-assistant-reactMount"),z=tr;[c,D].forEach(J=>{J&&(J.style.width=wn,J.style.maxWidth=wn,J.style.height=z,J.style.maxHeight=z,J.style.overflow="hidden",J.style.boxSizing="border-box",J.dataset.admeshAdSlotExpanded=Ba?"true":"false")});const T=D?.parentElement;T&&T!==document.body&&T!==document.documentElement&&(T.style.width=wn,T.style.maxWidth=wn,T.style.height=z,T.style.maxHeight=z,T.style.overflow="hidden",T.style.boxSizing="border-box")},[tr,wn,Xr,Fe,Ba]),b.useEffect(()=>{if(xe&&xe.length){Zt(xe);return}ge&&ge.length&&Zt(c=>Ah(c,ge))},[xe,ge]),b.useEffect(()=>{if(p!=="default"||!G)return;let c=!1;return G().then(D=>{!c&&Array.isArray(D)&&D.length&&Zt(D)}).catch(D=>{console.warn("[AdMeshIntentAssistant] Failed to load suggestions",D)}),()=>{c=!0}},[G,p]),b.useEffect(()=>{if(!Be){Do(0),zo.current=null;return}zo.current==null&&(zo.current=typeof performance<"u"?performance.now():Date.now());const c=()=>{const z=zo.current;if(z==null)return;const T=typeof performance<"u"?performance.now():Date.now();Do(Math.floor((T-z)/1e3))};c();const D=window.setInterval(c,1e3);return()=>window.clearInterval(D)},[Be]),b.useEffect(()=>{if(!Be||p!=="default"){Yn(0);return}const c=window.setInterval(()=>{Yn(D=>Math.min(D+1,7))},3e3);return()=>window.clearInterval(c)},[Be,p]),b.useEffect(()=>{_r.current||!je||!We||(_r.current=!0,yt("assistant_loaded",{metadata:{layout:y,surface:$,variant:p,default_open:Q||ce}}))},[ce,Q,y,je,We,$,yt,p]);const rr=b.useCallback(c=>{Mn?he?.(c):Kt(c),c?(yt("assistant_opened",{metadata:{layout:y,surface:$,ad_slot_behavior:E,variant:p,expanded:fe}}),Le?.()):Ne?.()},[Mn,fe,y,he,Le,Ne,$,yt,p]),ua=b.useCallback(()=>{rr(!0)},[rr]),Gr=b.useCallback(()=>{rr(!1)},[rr]),Ui=b.useCallback(()=>{pn(c=>!c)},[]),Ga=b.useCallback(async(c,D,z,T,J,me,Ye)=>{var At,Lt,Te;if(!je)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 Ue=await fetch(`${je.getApiBaseUrl()}/api/chat/assistant`,{method:"POST",signal:me,headers:{"Content-Type":"application/json",Accept:"text/plain","Cache-Control":"no-cache",Authorization:`Bearer ${ne}`},body:JSON.stringify({message:c,session_id:We||"default-session",message_id:D,user_id:de,context:{timestamp:new Date().toISOString(),source:"admesh-ui-sdk",page_context:Jc(se),conversation_history:Ye,sponsored_recommendation:J!=null&&J.recommendation_id?{recommendation_id:J.recommendation_id,brand_name:(Lt=(At=J.recommendation)==null?void 0:At.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(!Ue.ok)throw new Error(`API request failed: ${Ue.status} ${Ue.statusText}`);const kt=(Te=Ue.body)==null?void 0:Te.getReader(),Gt=new TextDecoder;if(!kt)throw new Error("Response body is not readable");let Ht="",Vt,_n,Hn,Ce,qe;return await(async()=>{try{for(;;){const{done:ht,value:lt}=await kt.read();if(ht)break;const Sn=Gt.decode(lt,{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:Ht,source_links:Vt,related_items:_n,followup_suggestions:Hn,used_capability:Ce,response_time_ms:qe};try{const gt=JSON.parse(nn);switch(gt.type){case"content":{const Qi=gt.content||"";Ht+=Qi,z?.(Qi);break}case"final":{Ht=gt.reply||Ht,Vt=Array.isArray(gt.source_links)?gt.source_links:void 0,_n=Array.isArray(gt.related_items)?gt.related_items:void 0,Hn=Array.isArray(gt.followup_suggestions)?gt.followup_suggestions:void 0,Ce=typeof gt.used_capability=="string"?gt.used_capability:Ce,qe=typeof gt.response_time_ms=="number"?gt.response_time_ms:qe;break}case"followup_suggestions":{Hn=Array.isArray(gt.followup_suggestions)?gt.followup_suggestions:Hn;break}case"error":throw new Error(gt.message||"Unknown streaming error");case"session_start":T?.(),console.log("Session started:",gt.session_id);break}}catch{console.warn("Failed to parse streaming chunk:",nn);continue}}}}catch(ht){if(me!=null&&me.aborted)return{text:Ht,source_links:Vt,related_items:_n,followup_suggestions:Hn,used_capability:Ce,response_time_ms:qe,error:"aborted"};throw console.error("Stream processing error:",ht),ht}finally{kt.releaseLock()}return{text:Ht,source_links:Vt,related_items:_n,followup_suggestions:Hn,used_capability:Ce,response_time_ms:qe}})()}catch(Ue){return me!=null&&me.aborted?{text:"",error:"aborted"}:(console.error("Error calling assistant API:",Ue),{text:"I'm having trouble connecting to my services right now. Please try again in a moment.",error:Ue instanceof Error?Ue.message:"request_failed"})}},[je,We,ne,de,Yt,Ge]),gr=b.useCallback(()=>{const c=dn.current;if(!c||c.signal.aborted)return;c.abort(),cn(!1),hn.current=null,er.current=!1;const D=Rt.current;D&&ft(z=>z.map(T=>T.id===D&&!T.content.trim()?{...T,content:"Generation stopped."}:T))},[]),Cr=b.useCallback(async c=>{var D,z,T,J,me,Ye,At,Lt;if(!c.trim()||Be)return;const Te=typeof performance<"u"?performance.now():Date.now(),Ue=c.trim(),kt=Date.now().toString(),Gt=new AbortController,Ht=hn.current,Vt=Ht?.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)}));dn.current=Gt,Rt.current=null,qt.current=kt,mr.current=!0,oa.current=!0,hn.current=null,Zt(Ce=>Ce.some(qe=>qe.is_sponsored)?Ce.filter(qe=>!qe.is_sponsored):Ce),fn(null);const Hn={id:kt,role:"user",content:Ue,timestamp:new Date};if(yt("query_submitted",{message_id:kt,query:Ue}),ft(Ce=>[...Ce,Hn]),Hr(""),cn(!0),p==="default"&&I){try{const Ce=(Date.now()+1).toString(),qe={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:c,initialRecommendation:null};er.current&&(be(Sn=>new Set([...Sn,Ce])),er.current=!1),ft(Sn=>[...Sn,qe]),Rt.current=Ce;const ht=await I(Ue,{sponsoredSuggestion:Ht});if(Gt.signal.aborted){hn.current=null;return}const lt=ht.recommendation||Vt||null;console.log("[AdMeshIntentAssistant] Query handler completed:",{query:c,hasResponseRecommendation:!!ht.recommendation,hasSponsoredSuggestionRecommendation:!!Vt,finalRecommendationId:lt?.recommendation_id}),ft(Sn=>Sn.map(St=>St.id===Ce?{...St,content:ht.answer,sourceLinks:ht.source_links,relatedItems:ht.related_items,initialRecommendation:lt,responseTimeMs:(typeof performance<"u"?performance.now():Date.now())-Te}:St)),Xa(Ue,ht.answer,ht.source_links,ht.related_items,ht.recommendation||null,ht.followup_suggestions),yt("answer_completed",{message_id:Ce,query:Ue,recommendation_id:lt?.recommendation_id,brand_name:(z=(D=lt?.recommendation)==null?void 0:D.creative)==null?void 0:z.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:"completed",metadata:{variant:p,source:"query_handler"}}),hn.current=null}catch(Ce){console.error("Error sending message:",Ce);const qe=Ce instanceof Error?Ce.message:"Unknown error occurred";fn(qe);const ht={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};ft(lt=>[...lt,ht]),yt("answer_failed",{query:Ue,status:qe,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,metadata:{variant:p,source:"query_handler"}}),hn.current=null}finally{dn.current===Gt&&(dn.current=null,Rt.current=null,cn(!1))}return}if(!je){setTimeout(()=>{if(Gt.signal.aborted){dn.current===Gt&&(dn.current=null,Rt.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:c};ft(qe=>[...qe,Ce]),dn.current===Gt&&(dn.current=null,Rt.current=null,cn(!1))},1e3);return}try{const Ce=(Date.now()+1).toString(),qe=Vt,ht={id:Ce,role:"assistant",content:"",timestamp:new Date,recommendations:[],userQuery:c,initialRecommendation:qe};er.current&&(be(St=>new Set([...St,Ce])),er.current=!1),ft(St=>[...St,ht]),Rt.current=Ce;const lt=await Ga(Ue,kt,St=>{ft(nn=>nn.map(gt=>gt.id===Ce?{...gt,content:gt.content+St}:gt))},()=>{cn(!0),Yn(0)},qe,Gt.signal,_n);if(Gt.signal.aborted){lt.text.trim()||ft(St=>St.map(nn=>nn.id===Ce&&!nn.content.trim()?{...nn,content:"Generation stopped."}:nn)),yt("answer_failed",{message_id:Ce,query:Ue,recommendation_id:qe?.recommendation_id,brand_name:(J=(T=qe?.recommendation)==null?void 0:T.creative)==null?void 0:J.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:"aborted",metadata:{variant:p,source:"api_chat_assistant"}}),hn.current=null;return}const Sn=typeof lt.response_time_ms=="number"?lt.response_time_ms:(typeof performance<"u"?performance.now():Date.now())-Te;ft(St=>St.map(nn=>nn.id===Ce?{...nn,content:lt.text,sourceLinks:lt.source_links,relatedItems:lt.related_items,initialRecommendation:nn.initialRecommendation||qe,responseTimeMs:Sn}:nn)),Xa(Ue,lt.text,lt.source_links,lt.related_items,null,lt.followup_suggestions),lt.error?yt("answer_failed",{message_id:Ce,query:Ue,recommendation_id:qe?.recommendation_id,brand_name:(Ye=(me=qe?.recommendation)==null?void 0:me.creative)==null?void 0:Ye.brand_name,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:lt.error,metadata:{variant:p,source:"api_chat_assistant"}}):yt("answer_completed",{message_id:Ce,query:Ue,recommendation_id:qe?.recommendation_id,brand_name:(Lt=(At=qe?.recommendation)==null?void 0:At.creative)==null?void 0:Lt.brand_name,used_capability:lt.used_capability,latency_ms:Sn,status:"completed",metadata:{variant:p,source:"api_chat_assistant",response_time_ms:Sn}}),hn.current=null}catch(Ce){console.error("Error sending message:",Ce);const qe=Ce instanceof Error?Ce.message:"Unknown error occurred";fn(qe);const ht={id:(Date.now()+1).toString(),role:"assistant",content:"Sorry, I encountered an error. Please try again.",timestamp:new Date};ft(lt=>[...lt,ht]),yt("answer_failed",{query:Ue,latency_ms:(typeof performance<"u"?performance.now():Date.now())-Te,status:qe,metadata:{variant:p,source:"api_chat_assistant"}}),hn.current=null}finally{dn.current===Gt&&(dn.current=null,Rt.current=null,cn(!1))}},[Be,Ga,I,Xa,je,yt,p]),or=tt,jo=b.useMemo(()=>or.some(c=>c?.is_sponsored),[or]),Jr=b.useMemo(()=>or.filter(c=>c&&typeof c.id=="string"?Ee?jo:!0:!1),[jo,Ee,or]),Wt=b.useMemo(()=>ls(Jr),[Jr]),Zr=b.useMemo(()=>ke==="below-input-container"&&le?Wt.find(c=>c.is_sponsored&&c.recommendation)??null:null,[le,Wt,ke]),yr=b.useCallback(async c=>{var D,z,T,J,me,Ye,At;console.log("[AdMeshIntentAssistant] \u{1F5B1}\uFE0F Suggestion clicked:",{text:c.text,is_sponsored:c.is_sponsored,hasRecommendation:!!c.recommendation,recommendationId:((D=c.recommendation)==null?void 0:D.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((T=(z=c.recommendation)==null?void 0:z.tracking)!=null&&T.followup_engagement_url),sessionId:We}),er.current=c.is_sponsored||!1,hn.current=c.is_sponsored?c:null;const Lt=Wt.findIndex(Te=>Te.id===c.id);yt("suggestion_clicked",{suggestion_id:c.id,suggestion_text:c.text,suggestion_type:c.type,suggestion_position:Lt>=0?Lt:void 0,is_sponsored:c.is_sponsored,recommendation_id:(J=c.recommendation)==null?void 0:J.recommendation_id,brand_name:(At=(Ye=(me=c.recommendation)==null?void 0:me.recommendation)==null?void 0:Ye.creative)==null?void 0:At.brand_name,query:c.text}),Cr(c.text),c.is_sponsored&&c.recommendation&&je?setTimeout(async()=>{var Te;try{const Ue=(Te=c.recommendation.tracking)==null?void 0:Te.followup_engagement_url,kt=c.recommendation.recommendation_id;console.log("[AdMeshIntentAssistant] \u{1F3AF} Preparing to fire sponsored suggestion engagement:",{followupEngagementUrl:Ue,recommendationId:kt,sessionId:We}),Ue&&kt&&We?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing sponsored suggestion engagement tracking"),await je.fireFollowupEngagement(Ue,kt,We),console.log("[AdMeshIntentAssistant] \u2705 Engagement tracking fired successfully")):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing required data for engagement tracking:",{hasFollowupEngagementUrl:!!Ue,hasRecommendationId:!!kt,hasSessionId:!!We})}catch(Ue){console.error("[AdMeshIntentAssistant] Error firing sponsored suggestion engagement:",Ue)}},0):console.log("[AdMeshIntentAssistant] \u2139\uFE0F Not a sponsored suggestion or missing data, skipping engagement tracking")},[Cr,Wt,je,We,yt]),kn=zh[re],ca=Dh[ae];b.useEffect(()=>{if(Br.current.forEach(c=>c()),Br.current=[],!(typeof window>"u"||typeof IntersectionObserver>"u"))return Wt.forEach((c,D)=>{const z=ra.current.get(c.id);if(!z)return;const T=`${We||"anonymous"}:${c.id}:${c.is_sponsored?"s":"o"}`;if(la.current.has(T))return;let J=null,me=null;const Ye=()=>{J&&(clearTimeout(J),J=null),me?.disconnect(),me=null},At=()=>{var Lt,Te,Ue,kt,Gt;if(la.current.has(T)){Ye();return}if(la.current.add(T),Ye(),yt("suggestion_exposure",{suggestion_id:c.id,suggestion_text:c.text,suggestion_type:c.type,suggestion_position:D,is_sponsored:c.is_sponsored,recommendation_id:(Lt=c.recommendation)==null?void 0:Lt.recommendation_id,brand_name:(kt=(Ue=(Te=c.recommendation)==null?void 0:Te.recommendation)==null?void 0:Ue.creative)==null?void 0:kt.brand_name}),je&&We&&c.is_sponsored&&c.recommendation){const Ht=(Gt=c.recommendation.tracking)==null?void 0:Gt.followup_exposure_url,Vt=c.recommendation.recommendation_id;Ht&&Vt?(console.log("[AdMeshIntentAssistant] \u{1F3AF} Firing viewable sponsored suggestion exposure:",{exposureUrl:Ht,recommendationId:Vt,suggestionText:c.text,sessionId:We}),je.fireFollowupExposure(Ht,Vt,We)):console.warn("[AdMeshIntentAssistant] \u26A0\uFE0F Missing exposure URL or recommendation ID for sponsored suggestion:",{hasExposureUrl:!!Ht,hasRecommendationId:!!Vt,suggestionText:c.text})}};me=new IntersectionObserver(Lt=>{const Te=Lt[0];if(Te){if(Te.intersectionRatio>=.5){J||(J=setTimeout(At,1e3));return}J&&(clearTimeout(J),J=null)}},{threshold:[0,.25,.5,.75,1],rootMargin:"0px"}),me.observe(z),Br.current.push(Ye)}),()=>{Br.current.forEach(c=>c()),Br.current=[]}},[Wt,je,We,yt,Xt]),console.log("[AdMeshIntentAssistant] \u{1F4E5} Received suggestions:",{totalSuggestions:or.length,safeSuggestions:Jr.length,isAnalyzingIntent:Me,hasIntentError:!!De,onlyShowWhenSponsored:Ee,hasSponsoredSuggestions:jo,sponsoredCount:or.filter(c=>c?.is_sponsored).length,nonSponsoredCount:or.filter(c=>c&&!(c!=null&&c.is_sponsored)).length,modalShouldAppear:Ee?jo:!0,suggestions:or.map(c=>{var D,z,T;return{id:c?.id,text:c?.text,type:c?.type,is_sponsored:c?.is_sponsored,hasRecommendation:!!(c!=null&&c.recommendation),recommendationId:((D=c?.recommendation)==null?void 0:D.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((T=(z=c?.recommendation)==null?void 0:z.tracking)!=null&&T.followup_engagement_url)}}),renderedSuggestions:Wt.map(c=>{var D,z,T;return{id:c?.id,text:c?.text,type:c?.type,is_sponsored:c?.is_sponsored,hasRecommendation:!!(c!=null&&c.recommendation),recommendationId:((D=c?.recommendation)==null?void 0:D.recommendation_id)||void 0,hasFollowupEngagementUrl:!!((T=(z=c?.recommendation)==null?void 0:z.tracking)!=null&&T.followup_engagement_url)}})});const et={base:`${16*oe}px`,sm:`${14*oe}px`,xs:`${12*oe}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=c=>{const D=c?.accentColor||vt,z=c?.metaColor||Lo,T=c?.includeSteps??p==="default",J=`${dr}s`,me=T?`${Yr[Mo]} (${J})`:`Generating answer... ${J}`;return m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:c!=null&&c.compact?"8px":"10px",color:z,fontSize:c!=null&&c.compact?et.xs:et.sm},children:[m.jsx("span",{style:{width:c!=null&&c.compact?8:9,height:c!=null&&c.compact?8:9,borderRadius:999,background:D,animation:"admeshPulse 1.4s ease-in-out infinite",boxShadow:`0 0 0 0 ${wt(Et,.28)}`,flexShrink:0}}),m.jsx("span",{children:me})]})},da=b.useCallback((c,D)=>{if(Qr[c.id])return;const z=D?"helpful":"not_helpful";Fi(T=>({...T,[c.id]:z})),yt("answer_feedback",{message_id:c.id,query:c.userQuery,status:z,latency_ms:c.responseTimeMs,metadata:{helpful:D}})},[Qr,yt]);function ma(c,D){if(c.role!=="assistant"||!c.content.trim()||Be&&c.id===Rt.current)return null;const z=D?.accentColor||vt,T=D?.metaColor||Lo,J=Qr[c.id],me=typeof c.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:T,whiteSpace:"nowrap"},children:J?"Thanks for your feedback":"Is this helpful?"}),J?m.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",background:wt(z,.12),color:z,flexShrink:0},children:J==="helpful"?m.jsx(Pc,{size:14}):m.jsx(Ic,{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:()=>da(c,!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:T,cursor:"pointer"},children:m.jsx(Pc,{size:14,style:{flexShrink:0}})}),m.jsx("button",{type:"button","aria-label":"Mark answer as not helpful",onClick:()=>da(c,!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:T,cursor:"pointer"},children:m.jsx(Ic,{size:14,style:{flexShrink:0}})})]})]}),me?m.jsxs("span",{style:{fontSize:et.xs,color:T,whiteSpace:"nowrap",flex:"0 1 auto",marginLeft:"auto"},children:["Answer Completed in ",Eh(c.responseTimeMs)]}):null]})}const ar=b.useCallback(()=>{const c=ia.current;if(!c)return;const D=Math.max(0,c.scrollWidth-c.clientWidth);Qa(c.scrollLeft>4),Kr(c.scrollLeft<D-4)},[]);b.useEffect(()=>(ar(),window.addEventListener("resize",ar),()=>window.removeEventListener("resize",ar)),[ar,Wt.length]);const Un=b.useCallback(c=>{const D=ia.current;D&&D.scrollBy({left:c==="left"?-Math.max(160,Math.floor(D.clientWidth*.75)):Math.max(160,Math.floor(D.clientWidth*.75)),behavior:"smooth"})},[]),wt=(c,D)=>{if(!c||!c.startsWith("#"))return`rgba(15, 23, 42, ${D})`;const z=c.slice(1),T=z.length===3?z.split("").map(At=>`${At}${At}`).join(""):z;if(T.length!==6)return c;const J=parseInt(T.slice(0,2),16),me=parseInt(T.slice(2,4),16),Ye=parseInt(T.slice(4,6),16);return`rgba(${J}, ${me}, ${Ye}, ${D})`},Et=B.primaryColor||"#3F037F",Mt=B.surfaceColor||"#ffffff",Ja=B.backgroundColor||"#eef2ff",tn=B.borderColor||"#e5e7eb",Tt=B.textColor||"#111827",qn=B.textSecondaryColor||"#6b7280";wt(Et,.12);const To=wt(Et,.24);wt(Et,.38);const qi=Mt,vt=Et,Wn=B.primaryTextColor||"#ffffff",Lo=qn,to=ve||"Publisher Assistant",no=Me&&Wt.length===0&&ot.length===0,Fo=Mt,$o=Mt,zn=tn,Oo=tn,Za="0 16px 64px rgba(15, 23, 42, 0.14)",Ya=qn,ss=qn,us=vt,fa=Ja,cs="none",ds="rgba(15, 23, 42, 0.18)";function Wi(c){return Yt?m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:c==="default"?"10px 12px":"8px 10px",borderRadius:c==="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:vt,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:()=>{He("user_stopped",{source:"publisher_assistant"})},style:{border:`1px solid ${To}`,borderRadius:999,background:wt("#ffffff",.92),color:vt,padding:"7px 12px",fontSize:et.xs,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Stop"})]}):null}function Hi(c,D=Fe){const z=No&&!D,T=D||z?"9px":"11px";return m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:D||c==="default"?"2px":"8px",marginTop:D?"0":c==="default"?"4px":0,flexShrink:0,textAlign:"center",width:"100%"},children:m.jsx("div",{style:{color:ss,fontSize:T,lineHeight:z?1.3:1.45,maxWidth:"100%",textAlign:"center"},children:Er})})}function ei(c){const D=c==="publisher"?[180,220,196]:["100%","82%","68%"];return c==="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:D.map((z,T)=>m.jsx("div",{style:{width:z,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-${T}`))}),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:c==="publisher"?"10px":"12px"},children:D.map((z,T)=>m.jsx("div",{style:{width:z,maxWidth:"100%",height:c==="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:c==="publisher"?`0 8px 22px ${wt(Et,.08)}`:"none"}},`suggestion-skeleton-${T}`))})}function Vi(c=Fe){if(Be)return null;if(no)return ei("publisher");if(!Wt.length)return null;const D=c&&Ka,z=Wt.slice(0,Pe);return C==="stacked"?m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:c?"6px":"8px",flexShrink:0,overflowY:"auto",maxHeight:c?"240px":void 0,paddingRight:c?"2px":0,scrollbarWidth:"none",msOverflowStyle:"none"},children:z.map(T=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":T.is_sponsored?"true":void 0,ref:Sr(T.id),onClick:()=>{p==="default"&&(pn(!0),y==="floating"&&rr(!0)),yr(T)},type:"button",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",width:"100%",minWidth:0,borderRadius:"8px",border:`1px solid ${T.is_sponsored?Et:tn}`,background:T.is_sponsored?Et:Mt,color:T.is_sponsored?Wn:Tt,padding:c?"8px 10px":"10px 14px",fontSize:c?"12px":"13px",fontWeight:500,lineHeight:1.25,textAlign:"left",boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{style:{minWidth:0},children:T.text}),le&&T.is_sponsored&&m.jsx("span",{style:{flexShrink:0,borderRadius:"6px",background:wt("#ffffff",.18),padding:"2px 6px",fontSize:"10px",fontWeight:700},children:"Ad"})]},T.id))}):m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:D?"4px":mn?"5px":c?"6px":"10px",flexShrink:0},children:[!D&&m.jsx("button",{type:"button",onClick:()=>Un("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:mn?20:c?24:28,height:mn?20:c?24:28,borderRadius:"6px",border:`1px solid ${tn}`,background:Mt,color:"#6b7280",fontSize:mn?"13px":void 0,lineHeight:1,cursor:kr?"pointer":"default",opacity:kr?1:.55},children:m.jsx(Tp,{size:mn?13:c?14:16,style:{flexShrink:0},"aria-hidden":"true"})}),m.jsx("div",{ref:ia,onScroll:ar,style:{display:"flex",gap:D?"4px":mn?"5px":c?"6px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",flex:1},children:z.map(T=>m.jsxs("button",{className:"admesh-publisher-suggestion","data-admesh-sponsored":T.is_sponsored?"true":void 0,ref:Sr(T.id),onClick:()=>{p==="default"&&(pn(!0),y==="floating"&&rr(!0)),yr(T)},type:"button",style:{display:"inline-flex",alignItems:"center",gap:D?"4px":mn?"5px":"8px",whiteSpace:"nowrap",borderRadius:"6px",border:`1px solid ${T.is_sponsored?Et:tn}`,background:T.is_sponsored?Et:Mt,color:T.is_sponsored?Wn:Tt,padding:D?"4px 8px":mn?"5px 8px":c?"7px 10px":"8px 14px",fontSize:D?"10px":mn?"11px":c?"12px":"13px",fontWeight:500,lineHeight:D?1:mn?1.1:void 0,boxShadow:"none",cursor:"pointer"},children:[m.jsx("span",{children:T.text}),le&&T.is_sponsored&&m.jsx("sup",{style:{fontSize:"10px",opacity:.9},children:"Ad"})]},T.id))}),!D&&m.jsx("button",{type:"button",onClick:()=>Un("right"),disabled:!fr,"aria-label":"Scroll suggestions right",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,padding:0,margin:0,minWidth:0,width:mn?20:c?24:28,height:mn?20:c?24:28,borderRadius:"6px",border:`1px solid ${tn}`,background:Mt,color:"#6b7280",fontSize:mn?"13px":void 0,lineHeight:1,cursor:fr?"pointer":"default",opacity:fr?1:.55},children:m.jsx(Lp,{size:mn?13:c?14:16,style:{flexShrink:0},"aria-hidden":"true"})})]})}function ms(c=Fe){if(c||!(Zr!=null&&Zr.recommendation))return null;const D=`publisher-sponsored-creative-${Zr.id}`;return m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"2px"},children:m.jsx(Ha,{messageId:D,query:Zr.text,initialRecommendation:Zr.recommendation,onFollowupDetected:en,onRecommendationsShown:(z,T)=>{hr(z,T,Zr.text)},onError:z=>{console.error("[AdMeshIntentAssistant] Sponsored creative error:",z)}})})}function fs(c){var D,z;return(D=c.relatedItems)!=null&&D.length||!((z=c.sourceLinks)!=null&&z.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:qn},children:"Sources"}),c.sourceLinks.map(T=>m.jsxs("a",{href:T.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{yt("source_link_clicked",{message_id:c.id,query:c.userQuery,metadata:{source_title:T.title,source_url:T.url}})},style:{color:vt,fontSize:et.xs,textDecoration:"none",borderBottom:`1px solid ${wt(Et,.18)}`},children:[T.title||T.url," ",m.jsx(Np,{size:12,style:{display:"inline",verticalAlign:"middle"},"aria-hidden":"true"})]},`${c.id}-${T.url}`))]})}function ps(c,D=Fe){var z;return(z=c.relatedItems)!=null&&z.length?m.jsxs("div",{style:{marginTop:"14px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:qn,marginBottom:"8px"},children:Ae}),m.jsx("div",{style:{display:"flex",gap:D?"8px":"10px",overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",padding:"2px 2px 6px",maxWidth:"100%",scrollSnapType:"x proximity"},children:c.relatedItems.slice(0,4).map(T=>m.jsxs("a",{className:"admesh-publisher-source",href:T.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{yt("source_link_clicked",{message_id:c.id,query:c.userQuery,metadata:{source_title:T.title,source_url:T.url,source_publisher:T.publisher,source_type:"related_item"}})},style:{display:"flex",flexDirection:"column",gap:D?"6px":"10px",padding:D?"10px":"14px",borderRadius:"8px",textDecoration:"none",color:Tt,border:`1px solid ${tn}`,background:Mt,boxShadow:"none",flex:D?"0 0 min(220px, calc(100% - 8px))":"0 0 min(250px, calc(100% - 16px))",minWidth:0,maxWidth:D?"220px":"250px",flexShrink:0,scrollSnapAlign:"start",boxSizing:"border-box"},children:[m.jsx("div",{style:{fontSize:D?"12px":"14px",fontWeight:650,lineHeight:1.35,color:Tt,overflowWrap:"anywhere"},children:T.title||T.url}),T.publisher&&m.jsx("div",{style:{fontSize:D?"11px":"12px",color:qn,lineHeight:1.4,overflowWrap:"anywhere"},children:T.publisher})]},`${c.id}-${T.url}`))})]}):null}function hs(c=Fe){const D=c?"13px":"15px";return m.jsxs("div",{ref:Dn,style:{flex:c?"1 1 0":1,minHeight:0,maxHeight:"100%",overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",scrollbarWidth:"thin",padding:c?"0 2px 4px":fe?"16px 16px 8px":0},children:[ot.map(z=>{const T=z.role==="user"&&z.id===qt.current;return m.jsx("div",{ref:T?Ct:void 0,style:{marginBottom:c?"16px":"28px",textAlign:z.role==="user"?"right":"left"},children:(()=>{const J=!!z.content.trim()||!Be;return m.jsx(m.Fragment,{children:m.jsxs("div",{style:{display:z.role==="assistant"?"block":"inline-block",width:z.role==="assistant"?"100%":void 0,maxWidth:z.role==="assistant"?"100%":"76%",padding:z.role==="assistant"?"4px 6px 4px 2px":"10px 14px",borderRadius:z.role==="assistant"?0:"8px",background:z.role==="user"?wt(Tt,.05):"transparent",color:Tt,boxShadow:"none",border:"none",fontSize:z.role==="assistant"?D:c?"12px":"13px",lineHeight:z.role==="assistant"?1.62:1.4},children:[z.role==="assistant"?z.content.trim()?m.jsx(is,{content:z.content,theme:{...B,textColor:Tt},fontSize:D}):Be&&z.id===Rt.current?eo({includeSteps:!0}):null:m.jsx("p",{style:{margin:0,color:Tt},children:z.content}),z.role==="assistant"&&fs(z),z.role==="assistant"&&ps(z,c),z.role==="assistant"&&ma(z),z.role==="assistant"&&J&&xn.has(z.id)&&z.initialRecommendation&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Ha,{messageId:z.id,query:z.userQuery,initialRecommendation:z.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(me,Ye)=>{hr(me,Ye,z.userQuery)},onError:me=>{console.error("[AdMeshIntentAssistant] Recommendation error:",me)}})}),z.role==="assistant"&&J&&!xn.has(z.id)&&(z.initialRecommendation||jt)&&m.jsx("div",{"data-admesh-ad-content":!0,style:{marginTop:"14px"},children:m.jsx(Ha,{messageId:z.id,query:z.userQuery,initialRecommendation:z.initialRecommendation||void 0,onFollowupDetected:en,onRecommendationsShown:(me,Ye)=>{hr(me,Ye,z.userQuery)},onError:me=>{console.error("[AdMeshIntentAssistant] Recommendation error:",me)}})})]})})})()},z.id)}),Vr&&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(p==="default"){let c=function(T){const J=Kc(No);return es.createPortal(m.jsxs(m.Fragment,{children:[m.jsx("div",{style:z}),m.jsx("div",{style:J.shell,children:T})]}),document.body)},D=function(T=!1){const J=un(T),me=T||J&&fe,Ye=!me&&q==="input",At=J&&!me&&Ka,Lt=me&&!(Fe&&E==="expand"&&!T&&Xr),Te=me?Kc(No):null,Ue=!!(Te&&No&&!J),kt=J?wn:Te?Te.panelWidth:y==="inline"?"100%":"min(420px, calc(100vw - 32px))",Gt=J?tr:Te?Te.panelHeight:"auto",Ht=J?wn:Te?.panelMaxWidth??"100%",Vt=J?tr:Te?.panelMaxHeight,_n=L&&!At&&me;return m.jsxs("div",{className:"admesh-publisher-panel","data-compact":J?"true":"false",style:{"--publisher-accent":vt,color:Tt,width:kt,maxWidth:Ht,height:Gt,maxHeight:Vt,boxSizing:"border-box",display:"flex",flexDirection:"column",background:me?Fo:qi,borderRadius:!J&&Te?Te.panelBorderRadius:"12px",padding:me?0:J?"6px":0,boxShadow:Ue?"none":me?Za:"none",border:Ue||Ye?"none":`1px solid ${Oo}`,overflow:"hidden",minHeight:J?0:void 0},children:[m.jsx("style",{children:Rc}),_n&&m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:J?"8px 10px":"14px 20px",background:$o,color:Tt,borderBottom:`1px solid ${zn}`,flexShrink:0},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",minWidth:0},children:[m.jsx("div",{style:{width:J?26:32,height:J?26:32,flexShrink:0,borderRadius:"6px",background:wt(Tt,.04),display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,fontWeight:700,color:vt,overflow:"hidden"},children:M?m.jsx("img",{src:M,alt:`${k||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:Mt,padding:4}}):m.jsx(ts,{size:J?14:17,strokeWidth:1.5,"aria-hidden":"true"})}),(X||S)&&m.jsxs("div",{style:{minWidth:0,overflowWrap:"anywhere"},children:[X&&m.jsx("div",{style:{fontSize:J?"13px":"14px",fontWeight:600,lineHeight:1.1,letterSpacing:0},children:k}),S&&m.jsx("div",{style:{fontSize:J?"10px":"12px",color:Ya,marginTop:"2px"},children:to})]})]}),me&&(!J||T)&&m.jsx("button",{type:"button",onClick:()=>pn(!1),"aria-label":"Minimize assistant",style:{width:36,height:36,padding:0,margin:0,minWidth:0,flexShrink:0,borderRadius:"8px",border:`1px solid ${zn}`,background:Mt,color:Ya,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(Ec,{size:16,strokeWidth:1.5,style:{flexShrink:0},"aria-hidden":"true"})})]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:At?"2px":J?"6px":"16px",minHeight:0,flex:J||me?"1 1 0":void 0,overflow:J||me?"hidden":void 0,overscrollBehavior:"contain",padding:Ye?J?"4px":"8px":J?"8px":"20px",justifyContent:me?void 0:"center",background:Fo},children:[Wi("default"),Lt&&hs(J),!Ye&&m.jsxs(m.Fragment,{children:[J&&!me&&!At&&m.jsx("div",{"aria-hidden":"true",style:{flex:"1 1 auto",minHeight:0}}),J&&!me&&ye&&N&&ot.length===0&&m.jsx("div",{style:{fontSize:15,fontWeight:600,textAlign:"center"},children:$e}),Vi(J)]}),(Ye||!J||me||P)&&m.jsx(Up,{value:bn,onChange:Hr,open:Ye&&Xt&&!fe,onOpenChange:Ye?Nt:Sh,suggestions:Wt.slice(0,Pe),registerSuggestion:Sr,loading:Be,analyzing:no,compact:J,expanded:me,showLogo:!me,suggestionPlacement:ie,logoUrl:M,title:k,placeholder:te,colors:{accent:vt,accentText:Wn,surface:fa,text:Tt,muted:qn,border:tn},onStop:gr,onSend:()=>{hn.current=null,er.current=!1,pn(!0),y==="floating"&&rr(!0),Cr(bn)},onSuggestion:Hn=>{pn(!0),y==="floating"&&rr(!0),yr(Hn)}}),me&&Hi("default",J),!me&&q==="always"&&ms(J)]})]})};const z={position:"fixed",inset:0,background:ds,backdropFilter:"blur(2px)",zIndex:2147483e3};return y==="inline"?Fe?m.jsxs("div",{ref:$i,className:"admesh-component","data-admesh-theme":Ze,"data-admesh-surface":"ad-slot","data-admesh-ad-slot-behavior":E,"data-admesh-ad-slot-expanded":Ba?"true":"false",style:{width:wn,height:tr,maxWidth:wn,maxHeight:tr,position:"relative",overflow:"hidden"},children:[D(!1),Xr&&typeof document<"u"&&c(D(!0))]}):m.jsxs("div",{className:"admesh-component","data-admesh-theme":Ze,style:{width:"100%",position:"relative"},children:[D(!1),fe&&typeof document<"u"&&c(D(!0))]}):Ro?m.jsxs("div",{className:"admesh-component","data-admesh-theme":Ze,children:[!fe&&m.jsx("div",{style:{position:"fixed",...kn,zIndex:2147483001},children:D(!1)}),fe&&typeof document<"u"&&c(D(!0))]}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Ze,children:m.jsxs("button",{type:"button",onClick:ua,style:{position:"fixed",...kn,zIndex:2147483e3,border:"none",borderRadius:"6px",background:B.primaryColor,color:Wn,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(ts,{size:16,strokeWidth:1.5,"aria-hidden":"true"}),d]})})}return Wt.length===0&&!no?(console.log("[AdMeshIntentAssistant] No suggestions available - not rendering"),null):y==="inline"?m.jsx("div",{className:"admesh-component","data-admesh-theme":Ze,children:m.jsx("div",{className:`overflow-hidden rounded-[2rem] ${l||""}`,style:{width:Va(V)??"100%",backgroundColor:"#eef2ff",fontSize:et.base,...f},children:m.jsxs("div",{className:"space-y-4 rounded-[1.75rem] p-4",style:{backgroundColor:"rgba(255, 255, 255, 0.35)"},children:[no?ei("legacy"):Wt.length>0&&m.jsx("div",{className:"flex flex-col gap-3",children:Wt.slice(0,Pe).map((c,D)=>m.jsxs("button",{ref:Sr(c.id),onClick:()=>yr(c),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:D===0?"100%":D===1?"82%":"68%",backgroundColor:B.surfaceColor||"#ffffff",color:B.textColor||"#1e293b",border:`1px solid ${B.borderColor||"#e2e8f0"}`,fontSize:et.sm},children:[m.jsx("span",{className:"leading-tight",children:c.text}),le&&c.is_sponsored&&m.jsx("sup",{className:"ml-1 rounded-full px-1.5 py-0.5",style:{backgroundColor:B.backgroundColor||"#ffffff",color:B.textSecondaryColor||"#64748b",fontSize:"9px",lineHeight:1},children:"Ad"})]},c.id))}),ot.length>0&&m.jsxs("div",{ref:Dn,className:"max-h-[280px] space-y-3 overflow-y-auto rounded-[1.5rem] bg-white/80 p-4",style:{color:B.textColor,overscrollBehavior:"contain",WebkitOverflowScrolling:"touch"},children:[ot.map(c=>{const D=c.role==="user"&&c.id===qt.current;return m.jsx("div",{ref:D?Ct:void 0,className:c.role==="user"?"text-right":"text-left",children:m.jsx("div",{className:"inline-block max-w-[85%] rounded-2xl px-4 py-3",style:{backgroundColor:c.role==="user"?B.primaryColor:"#ffffff",color:c.role==="user"?B.primaryTextColor||"#ffffff":B.textColor,fontSize:et.sm},children:c.role==="assistant"?c.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx(is,{content:c.content,theme:B,fontSize:et.sm}),ma(c,{accentColor:B.primaryColor,metaColor:B.textSecondaryColor})]}):Be&&c.id===Rt.current?eo({compact:!0,accentColor:B.primaryColor,metaColor:B.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,lineHeight:"1.4"},children:c.content})})},c.id)}),Be&&!ot.some(c=>c.role==="assistant"&&c.id===Rt.current&&!c.content.trim())&&m.jsx("div",{className:"text-sm",style:{color:B.textSecondaryColor},children:eo({compact:!0,accentColor:B.primaryColor,metaColor:B.textSecondaryColor,includeSteps:!1})}),Vr&&m.jsx("div",{className:"text-sm",style:{color:B.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:bn,onChange:c=>Hr(c.target.value),onKeyPress:c=>{if(c.key==="Enter"){if(Be){c.preventDefault();return}Cr(bn)}},placeholder:te,className:"min-w-0 flex-1 rounded-full px-4 py-3 focus:outline-none",style:{backgroundColor:B.backgroundColor||"#ffffff",color:B.textColor,fontSize:et.sm}}),m.jsx("button",{onClick:()=>{if(Be){gr();return}Cr(bn)},disabled:!Be&&!bn.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:Be?"#dc2626":B.primaryColor,color:"#ffffff"},children:Be?m.jsx(ns,{size:18}):m.jsx(Ac,{size:18})})]})}),m.jsxs("div",{className:"space-y-2 text-center",children:[m.jsxs("p",{style:{color:B.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:B.textSecondaryColor,fontSize:et.xs,lineHeight:1.5},children:Er})]})]})})}):Ro?m.jsx("div",{className:"admesh-component","data-admesh-theme":Ze,children:m.jsxs("div",{className:`flex flex-col overflow-hidden ${l||""}`,style:{position:"fixed",display:"flex",flexDirection:"column",...fe?{top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(1040px, calc(100vw - 40px))",height:"min(84vh, 820px)",maxWidth:"1040px",maxHeight:"820px"}:{...kn,width:Va(V)??ca.width,height:Va(ee)??ca.height},backgroundColor:fe?Fo:B.backgroundColor,zIndex:9999,fontSize:et.base,borderRadius:fe?"20px":"16px",border:fe?`1px solid ${Oo}`:"1px solid transparent",boxShadow:fe?Za:"0 20px 40px rgba(15, 23, 42, 0.12)",...f},children:[L&&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:fe?zn:"transparent",background:fe?$o:B.backgroundColor,padding:fe?"18px 20px":"16px"},children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("div",{style:{width:fe?40:32,height:fe?40:32,borderRadius:fe?"14px":"10px",background:wt(Et,.08),color:vt,display:"flex",alignItems:"center",justifyContent:"center",fontSize:fe?"15px":"13px",fontWeight:700,flexShrink:0,overflow:"hidden"},children:M?m.jsx("img",{src:M,alt:`${k||"Assistant"} logo`,style:{width:"100%",height:"100%",objectFit:"contain",background:"#ffffff",padding:4}}):(k||"AA").slice(0,2).toUpperCase()}),(X||S&&fe)&&m.jsxs("div",{children:[X&&m.jsx("div",{className:"font-medium",style:{color:B.textColor,fontSize:fe?"20px":et.base,fontWeight:700,letterSpacing:fe?"-0.02em":0},children:k}),S&&fe&&m.jsx("div",{style:{color:Ya,fontSize:"12px",marginTop:"2px"},children:to})]})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[!Fe&&m.jsx("button",{onClick:Ui,className:"transition-colors",title:fe?"Minimize":"Expand",style:{width:fe?36:28,height:fe?36:28,borderRadius:fe?"12px":"10px",border:`1px solid ${fe?zn:"transparent"}`,background:fe?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:fe?m.jsx(Ec,{size:16,style:{color:B.textSecondaryColor}}):m.jsx($p,{size:16,style:{color:B.textSecondaryColor}})}),m.jsx("button",{onClick:Gr,className:"transition-colors",style:{width:fe?36:28,height:fe?36:28,borderRadius:fe?"12px":"10px",border:`1px solid ${fe?zn:"transparent"}`,background:fe?"#ffffff":"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(ns,{size:16,style:{color:B.textSecondaryColor}})})]})]}),m.jsxs("div",{ref:Dn,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:fe?"20px":"16px"},children:[Wi("legacy"),ye&&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:B.textColor,margin:0,fontSize:et.sm},children:$e})})}),ot.map(c=>{const D=c.role==="user"&&c.id===qt.current;return m.jsxs("div",{ref:D?Ct:void 0,className:"mb-3",children:[m.jsx("div",{className:c.role==="user"?"inline-block max-w-[85%] ml-auto":"max-w-[92%]",style:{backgroundColor:c.role==="user"?us:"transparent",color:c.role==="user"?B.primaryTextColor||"#ffffff":B.textColor,border:"none",borderRadius:c.role==="user"?fe?"14px":"12px":0,padding:c.role==="user"?fe?"12px 14px":void 0:"2px 6px 2px 2px",boxShadow:"none"},children:c.role==="assistant"?c.content.trim()?m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{fontSize:`calc(${et.sm} * 1.3)`,lineHeight:1.65},children:m.jsx(is,{content:c.content,theme:B,fontSize:`calc(${et.sm} * 1.3)`})}),ma(c,{accentColor:B.primaryColor,metaColor:B.textSecondaryColor})]}):Be&&c.id===Rt.current?eo({compact:!0,accentColor:B.primaryColor,metaColor:B.textSecondaryColor,includeSteps:!1}):null:m.jsx("p",{style:{margin:0,fontSize:et.sm,lineHeight:"1.4"},children:c.content})}),c.role==="assistant"&&!xn.has(c.id)&&m.jsx(Ha,{messageId:c.id,query:c.userQuery,onFollowupDetected:en,onRecommendationsShown:(z,T)=>{hr(z,T,c.userQuery)},onError:z=>{console.error("[AdMeshIntentAssistant] Recommendations error:",z)}}),c.role==="assistant"&&xn.has(c.id)&&c.initialRecommendation&&!Be&&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(Ha,{messageId:c.id,query:c.userQuery,initialRecommendation:c.initialRecommendation,onFollowupDetected:en,onRecommendationsShown:(z,T)=>{hr(z,T,c.userQuery)},onError:z=>{console.error("[AdMeshIntentAssistant] Recommendations error:",z)}})]})]},c.id)}),Be&&!ot.some(c=>c.role==="assistant"&&c.id===Rt.current&&!c.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:B.primaryColor,metaColor:B.textSecondaryColor,includeSteps:!1})})}),Vr&&m.jsx("div",{className:"mb-3",children:m.jsx("div",{className:"inline-block p-2 rounded-lg border",style:{backgroundColor:"transparent",borderColor:"transparent",color:B.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:ei("legacy")}),Wt.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:Wt.slice(0,Pe).map(c=>m.jsxs("button",{ref:Sr(c.id),onClick:()=>yr(c),className:"relative flex w-full items-center text-left transition-all duration-200",style:{backgroundColor:B.surfaceColor||"#f8fafc",color:B.textColor||"#1e293b",border:`1px solid ${B.borderColor||"#e2e8f0"}`,fontSize:et.sm,padding:"10px 12px",borderRadius:"999px",fontWeight:500},children:[m.jsx("span",{className:"leading-tight",children:c.text}),le&&c.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:B.backgroundColor||"#ffffff",color:B.textSecondaryColor||"#64748b"},children:"Ad"})]},c.id))})}),De&&!Me&&Jr.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:B.surfaceColor,borderColor:B.borderColor,color:B.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:Z,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:B.primaryColor,color:"#ffffff"},children:"Retry"})]}),m.jsx("span",{style:{fontSize:et.xs},children:De})]})})}),m.jsxs("div",{className:"p-3 border-t",style:{borderColor:fe?zn:"transparent",padding:fe?"18px 20px":void 0,background:fe?$o:void 0},children:[m.jsxs("div",{className:"flex gap-2",style:{alignItems:"center",border:`1px solid ${zn}`,borderRadius:fe?"16px":"12px",background:fa,boxShadow:fe?cs:"none",padding:fe?"8px 8px 8px 14px":void 0},children:[m.jsx("input",{type:"text",value:bn,onChange:c=>Hr(c.target.value),onKeyPress:c=>{if(c.key==="Enter"){if(Be){c.preventDefault();return}Cr(bn)}},placeholder:te,className:"flex-1 px-3 py-2 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"transparent",borderColor:"transparent",color:B.textColor,fontSize:fe?"15px":et.sm,"--tw-ring-color":B.primaryColor}}),m.jsx("button",{onClick:()=>{if(Be){gr();return}Cr(bn)},disabled:!Be&&!bn.trim(),className:"transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:Be?"#dc2626":B.primaryColor,color:"#ffffff",borderRadius:fe?"12px":"10px",width:fe?"46px":void 0,height:fe?"46px":void 0,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:fe?`0 10px 20px ${wt(Et,.18)}`:"none"},children:Be?m.jsx(ns,{size:14}):m.jsx(Ac,{size:14})})]}),Hi("legacy")]})]})}):m.jsx("div",{className:"admesh-component","data-admesh-theme":Ze,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:B.primaryColor,color:"#ffffff",zIndex:9999,fontSize:et.base,...f},children:m.jsx("span",{className:"font-medium",children:d})})})};typeof globalThis<"u"&&typeof globalThis.process>"u"&&(globalThis.process={env:{NODE_ENV:"production",ADMESH_ENV:"production"}});const jh=/^[a-z0-9](?:[a-z0-9-]{1,46}[a-z0-9])?$/,Li=new WeakMap,Th={mode:"light",primaryColor:"#42116e",primaryTextColor:"#ffffff",secondaryColor:"#6b5e75",backgroundColor:"#faf9fb",surfaceColor:"#ffffff",borderColor:"#e7e1ec",textColor:"#302039",textSecondaryColor:"#6b5e75",borderRadius:"16px"};function Lh(){const u=document.currentScript;return u instanceof HTMLScriptElement?u:Array.from(document.scripts).find(l=>l.src.includes("/brand-assistant.js")&&l.dataset.admeshMounted!=="true")||null}function Zc(u,l){if(!u||typeof u!="object")return null;const f=u;if(f.slug!==l||typeof f.assistant_name!="string"||typeof f.welcome_message!="string"||!Array.isArray(f.suggested_questions))return null;const d=f.assistant_name.trim().slice(0,160)||"Brand Assistant";let k=null;if(typeof f.support_url=="string")try{const L=new URL(f.support_url);L.protocol==="https:"&&(k=L.href)}catch{}const M=f.suggested_questions.filter(L=>typeof L=="string").slice(0,4).map(L=>L.slice(0,300)).filter(Boolean);return{slug:l,assistant_name:d,logo_url:typeof f.logo_url=="string"?f.logo_url:null,support_url:k,welcome_message:f.welcome_message.slice(0,500),suggested_questions:M.length?M:[`What is ${d}?`]}}async function Fh(u,l,f){if(u.dataset.brandPreview)try{return Zc(JSON.parse(u.dataset.brandPreview),l)}catch{return null}const d=await fetch(`${f}/api/public/brands/${encodeURIComponent(l)}/embed/`,{cache:"no-store",headers:{Accept:"application/json"},credentials:"omit"});return d.ok?Zc(await d.json(),l):null}function $h(u,l,f,d){let k=[],M=!1;return async L=>{if(f)throw new Error("Questions become available after this profile is published.");const X=L.trim().slice(0,500);if(!X)throw new Error("Enter a question.");M||(M=!0,fetch(`${l}/api/public/brands/${encodeURIComponent(u)}/qa-start/`,{method:"POST",credentials:"omit",keepalive:!0}).catch(()=>{}));const S=await fetch(`${l}/api/public/brands/${encodeURIComponent(u)}/ask/`,{method:"POST",cache:"no-store",credentials:"omit",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({question:X,history:k.slice(-6)}),signal:AbortSignal.timeout(25e3)});if(!S.ok){const $=await S.json().catch(()=>null);throw new Error($?.detail||"The Brand Agent could not answer right now. Please try again.")}const y=await S.json();if(y.outcome!=="answered"&&y.outcome!=="no_answer"||typeof y.answer!="string"||!Array.isArray(y.sources))throw new Error("The Brand Agent returned an unexpected answer. Please try again.");return k=[...k,{role:"visitor",text:X},{role:"assistant",text:y.answer}].slice(-6).map($=>({...$,text:$.text.slice(0,1e3)})),{answer:y.answer,source_links:y.sources.filter($=>$&&typeof $.url=="string").map($=>({title:$.title,url:$.url})),related_items:y.outcome==="no_answer"&&d?[{title:"Contact the brand",url:d}]:void 0}}}function Oh({config:u,mode:l,queryHandler:f,suggestions:d,preview:k}){const[M,L]=b.useState(()=>window.location.hash==="#brand-assistant");return b.useEffect(()=>{const X=()=>{window.location.hash==="#brand-assistant"&&L(!0)},S=y=>{y.target instanceof Element&&y.target.closest('a[href="#brand-assistant"]')&&L(!0)};return window.addEventListener("hashchange",X),document.addEventListener("click",S),()=>{window.removeEventListener("hashchange",X),document.removeEventListener("click",S)}},[]),Jl.createElement(Nh,{variant:"default",layout:l,position:"bottom-right",size:"md",open:M,onOpenChange:L,adsEnabled:!1,onlyShowWhenSponsored:!1,headerTitle:u.assistant_name,headerLogoUrl:u.logo_url,triggerLabel:`Ask ${u.assistant_name}`,subtitle:"Brand Assistant",showWelcomeMessage:!0,welcomeMessage:u.welcome_message,placeholder:`Ask ${u.assistant_name} a question\u2026`,disclaimerText:k?"Private preview. Questions become available after publication.":"Answers use this brand's approved public information. Avoid sharing personal details.",poweredByLabel:"Powered by AdMesh",relatedItemsHeading:"Need more help?",suggestions:d,queryHandler:f})}async function Uh(){var u;const l=Lh();if(!l||!l.isConnected||Li.has(l))return;const f=((u=l.dataset.brandSlug)==null?void 0:u.trim().toLowerCase())||"";if(!jh.test(f)){console.error("[AdMesh] Brand assistant script requires a valid data-brand-slug.");return}const d=new URL(l.src).origin,k=d==="https://embed.useadmesh.com"?"https://useadmesh.com":d,M=await Fh(l,f,k).catch(()=>null);if(!l.isConnected)return;if(!M){l.dispatchEvent(new Event("admesh:brand-assistant-unavailable"));return}const L=!!l.dataset.brandPreview,X=l.dataset.mode==="inline"?"inline":"floating",S=X==="inline"?document.querySelector(l.dataset.target||"#admesh-brand-assistant"):document.body;if(!S){console.error("[AdMesh] Brand assistant inline target was not found.");return}const y=document.createElement("div");y.className="admesh-publisher-assistant-reactMount",y.dataset.brandAssistant=f,S.appendChild(y);const $=xc.createRoot(y),E=`brand-${f}-${crypto.randomUUID()}`,W=M.suggested_questions.map((N,P)=>({id:`brand-${P}`,text:N,type:"information"}));$.render(Jl.createElement(Oc,{apiKey:"",sessionId:E,skipSdkInitialization:!0,theme:Th},Jl.createElement(Oh,{config:M,mode:X,suggestions:W,preview:L,queryHandler:$h(f,k,L,M.support_url)}))),l.dataset.admeshMounted="true",Li.set(l,{unmount:()=>{$.unmount(),y.remove(),l.dataset.admeshMounted="false"}}),l.dispatchEvent(new Event("admesh:brand-assistant-ready"))}window.AdMeshBrandAssistant={unmount(u){var l;(l=Li.get(u))==null||l.unmount(),Li.delete(u)}},Uh()})();})();
|
|
1226
|
+
//# sourceMappingURL=brand-assistant.js.map
|