@eka-care/medassist-widget-embed 0.0.5 → 0.0.6
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/iframe-helper.d.ts +11 -0
- package/dist/iframe-helper.d.ts.map +1 -0
- package/dist/iframe-helper.js +96 -0
- package/dist/iframe.d.ts +1 -0
- package/dist/iframe.d.ts.map +1 -0
- package/dist/iframe.html +37 -0
- package/dist/iframe.js +152 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/src/medassist-widget.css +1 -1
- package/dist/src/medassist-widget.js +21 -22
- package/dist/src/medassist-widget.js.map +1 -1
- package/iframe-helper.ts +123 -0
- package/iframe.html +37 -0
- package/iframe.ts +192 -0
- package/index.ts +1 -1
- package/package.json +5 -2
- package/src/medassist-widget.css +1 -1
- package/src/medassist-widget.js +21 -22
- package/src/medassist-widget.js.map +1 -1
- package/test.html +10 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var MedAssistWidget=(function(Dl){"use strict";function tv(n,a){for(var i=0;i<a.length;i++){const s=a[i];if(typeof s!="string"&&!Array.isArray(s)){for(const u in s)if(u!=="default"&&!(u in n)){const l=Object.getOwnPropertyDescriptor(s,u);l&&Object.defineProperty(n,u,l.get?l:{enumerable:!0,get:()=>s[u]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ws(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Il={exports:{}},Ca={};var dd;function nv(){if(dd)return Ca;dd=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(s,u,l){var c=null;if(l!==void 0&&(c=""+l),u.key!==void 0&&(c=""+u.key),"key"in u){l={};for(var f in u)f!=="key"&&(l[f]=u[f])}else l=u;return u=l.ref,{$$typeof:n,type:s,key:c,ref:u!==void 0?u:null,props:l}}return Ca.Fragment=a,Ca.jsx=i,Ca.jsxs=i,Ca}var hd;function rv(){return hd||(hd=1,Il.exports=nv()),Il.exports}var H=rv(),jl={exports:{}},He={};var pd;function iv(){if(pd)return He;pd=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),_=Symbol.iterator;function m(z){return z===null||typeof z!="object"?null:(z=_&&z[_]||z["@@iterator"],typeof z=="function"?z:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,x={};function w(z,I,B){this.props=z,this.context=I,this.refs=x,this.updater=B||C}w.prototype.isReactComponent={},w.prototype.setState=function(z,I){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,I,"setState")},w.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function k(){}k.prototype=w.prototype;function N(z,I,B){this.props=z,this.context=I,this.refs=x,this.updater=B||C}var j=N.prototype=new k;j.constructor=N,S(j,w.prototype),j.isPureReactComponent=!0;var D=Array.isArray;function M(){}var L={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function F(z,I,B){var te=B.ref;return{$$typeof:n,type:z,key:I,ref:te!==void 0?te:null,props:B}}function W(z,I){return F(z.type,I,z.props)}function oe(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function R(z){var I={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(B){return I[B]})}var Q=/\/+/g;function E(z,I){return typeof z=="object"&&z!==null&&z.key!=null?R(""+z.key):I.toString(36)}function G(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(M,M):(z.status="pending",z.then(function(I){z.status==="pending"&&(z.status="fulfilled",z.value=I)},function(I){z.status==="pending"&&(z.status="rejected",z.reason=I)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function J(z,I,B,te,ae){var xe=typeof z;(xe==="undefined"||xe==="boolean")&&(z=null);var Te=!1;if(z===null)Te=!0;else switch(xe){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(z.$$typeof){case n:case a:Te=!0;break;case y:return Te=z._init,J(Te(z._payload),I,B,te,ae)}}if(Te)return ae=ae(z),Te=te===""?"."+E(z,0):te,D(ae)?(B="",Te!=null&&(B=Te.replace(Q,"$&/")+"/"),J(ae,I,B,"",function(je){return je})):ae!=null&&(oe(ae)&&(ae=W(ae,B+(ae.key==null||z&&z.key===ae.key?"":(""+ae.key).replace(Q,"$&/")+"/")+Te)),I.push(ae)),1;Te=0;var Ce=te===""?".":te+":";if(D(z))for(var ke=0;ke<z.length;ke++)te=z[ke],xe=Ce+E(te,ke),Te+=J(te,I,B,xe,ae);else if(ke=m(z),typeof ke=="function")for(z=ke.call(z),ke=0;!(te=z.next()).done;)te=te.value,xe=Ce+E(te,ke++),Te+=J(te,I,B,xe,ae);else if(xe==="object"){if(typeof z.then=="function")return J(G(z),I,B,te,ae);throw I=String(z),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return Te}function K(z,I,B){if(z==null)return z;var te=[],ae=0;return J(z,te,"","",function(xe){return I.call(B,xe,ae++)}),te}function ue(z){if(z._status===-1){var I=z._result;I=I(),I.then(function(B){(z._status===0||z._status===-1)&&(z._status=1,z._result=B)},function(B){(z._status===0||z._status===-1)&&(z._status=2,z._result=B)}),z._status===-1&&(z._status=0,z._result=I)}if(z._status===1)return z._result.default;throw z._result}var re=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},q={map:K,forEach:function(z,I,B){K(z,function(){I.apply(this,arguments)},B)},count:function(z){var I=0;return K(z,function(){I++}),I},toArray:function(z){return K(z,function(I){return I})||[]},only:function(z){if(!oe(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return He.Activity=b,He.Children=q,He.Component=w,He.Fragment=i,He.Profiler=u,He.PureComponent=N,He.StrictMode=s,He.Suspense=d,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,He.__COMPILER_RUNTIME={__proto__:null,c:function(z){return L.H.useMemoCache(z)}},He.cache=function(z){return function(){return z.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(z,I,B){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var te=S({},z.props),ae=z.key;if(I!=null)for(xe in I.key!==void 0&&(ae=""+I.key),I)!V.call(I,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&I.ref===void 0||(te[xe]=I[xe]);var xe=arguments.length-2;if(xe===1)te.children=B;else if(1<xe){for(var Te=Array(xe),Ce=0;Ce<xe;Ce++)Te[Ce]=arguments[Ce+2];te.children=Te}return F(z.type,ae,te)},He.createContext=function(z){return z={$$typeof:c,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:l,_context:z},z},He.createElement=function(z,I,B){var te,ae={},xe=null;if(I!=null)for(te in I.key!==void 0&&(xe=""+I.key),I)V.call(I,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ae[te]=I[te]);var Te=arguments.length-2;if(Te===1)ae.children=B;else if(1<Te){for(var Ce=Array(Te),ke=0;ke<Te;ke++)Ce[ke]=arguments[ke+2];ae.children=Ce}if(z&&z.defaultProps)for(te in Te=z.defaultProps,Te)ae[te]===void 0&&(ae[te]=Te[te]);return F(z,xe,ae)},He.createRef=function(){return{current:null}},He.forwardRef=function(z){return{$$typeof:f,render:z}},He.isValidElement=oe,He.lazy=function(z){return{$$typeof:y,_payload:{_status:-1,_result:z},_init:ue}},He.memo=function(z,I){return{$$typeof:h,type:z,compare:I===void 0?null:I}},He.startTransition=function(z){var I=L.T,B={};L.T=B;try{var te=z(),ae=L.S;ae!==null&&ae(B,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(M,re)}catch(xe){re(xe)}finally{I!==null&&B.types!==null&&(I.types=B.types),L.T=I}},He.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},He.use=function(z){return L.H.use(z)},He.useActionState=function(z,I,B){return L.H.useActionState(z,I,B)},He.useCallback=function(z,I){return L.H.useCallback(z,I)},He.useContext=function(z){return L.H.useContext(z)},He.useDebugValue=function(){},He.useDeferredValue=function(z,I){return L.H.useDeferredValue(z,I)},He.useEffect=function(z,I){return L.H.useEffect(z,I)},He.useEffectEvent=function(z){return L.H.useEffectEvent(z)},He.useId=function(){return L.H.useId()},He.useImperativeHandle=function(z,I,B){return L.H.useImperativeHandle(z,I,B)},He.useInsertionEffect=function(z,I){return L.H.useInsertionEffect(z,I)},He.useLayoutEffect=function(z,I){return L.H.useLayoutEffect(z,I)},He.useMemo=function(z,I){return L.H.useMemo(z,I)},He.useOptimistic=function(z,I){return L.H.useOptimistic(z,I)},He.useReducer=function(z,I,B){return L.H.useReducer(z,I,B)},He.useRef=function(z){return L.H.useRef(z)},He.useState=function(z){return L.H.useState(z)},He.useSyncExternalStore=function(z,I,B){return L.H.useSyncExternalStore(z,I,B)},He.useTransition=function(){return L.H.useTransition()},He.version="19.2.0",He}var md;function Js(){return md||(md=1,jl.exports=iv()),jl.exports}var $=Js();const ka=Ws($),gd=tv({__proto__:null,default:ka},[$]);var Ll={exports:{}},Ta={},Bl={exports:{}},Ul={};var yd;function av(){return yd||(yd=1,(function(n){function a(J,K){var ue=J.length;J.push(K);e:for(;0<ue;){var re=ue-1>>>1,q=J[re];if(0<u(q,K))J[re]=K,J[ue]=q,ue=re;else break e}}function i(J){return J.length===0?null:J[0]}function s(J){if(J.length===0)return null;var K=J[0],ue=J.pop();if(ue!==K){J[0]=ue;e:for(var re=0,q=J.length,z=q>>>1;re<z;){var I=2*(re+1)-1,B=J[I],te=I+1,ae=J[te];if(0>u(B,ue))te<q&&0>u(ae,B)?(J[re]=ae,J[te]=ue,re=te):(J[re]=B,J[I]=ue,re=I);else if(te<q&&0>u(ae,ue))J[re]=ae,J[te]=ue,re=te;else break e}}return K}function u(J,K){var ue=J.sortIndex-K.sortIndex;return ue!==0?ue:J.id-K.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;n.unstable_now=function(){return l.now()}}else{var c=Date,f=c.now();n.unstable_now=function(){return c.now()-f}}var d=[],h=[],y=1,b=null,_=3,m=!1,C=!1,S=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function j(J){for(var K=i(h);K!==null;){if(K.callback===null)s(h);else if(K.startTime<=J)s(h),K.sortIndex=K.expirationTime,a(d,K);else break;K=i(h)}}function D(J){if(S=!1,j(J),!C)if(i(d)!==null)C=!0,M||(M=!0,R());else{var K=i(h);K!==null&&G(D,K.startTime-J)}}var M=!1,L=-1,V=5,F=-1;function W(){return x?!0:!(n.unstable_now()-F<V)}function oe(){if(x=!1,M){var J=n.unstable_now();F=J;var K=!0;try{e:{C=!1,S&&(S=!1,k(L),L=-1),m=!0;var ue=_;try{t:{for(j(J),b=i(d);b!==null&&!(b.expirationTime>J&&W());){var re=b.callback;if(typeof re=="function"){b.callback=null,_=b.priorityLevel;var q=re(b.expirationTime<=J);if(J=n.unstable_now(),typeof q=="function"){b.callback=q,j(J),K=!0;break t}b===i(d)&&s(d),j(J)}else s(d);b=i(d)}if(b!==null)K=!0;else{var z=i(h);z!==null&&G(D,z.startTime-J),K=!1}}break e}finally{b=null,_=ue,m=!1}K=void 0}}finally{K?R():M=!1}}}var R;if(typeof N=="function")R=function(){N(oe)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,E=Q.port2;Q.port1.onmessage=oe,R=function(){E.postMessage(null)}}else R=function(){w(oe,0)};function G(J,K){L=w(function(){J(n.unstable_now())},K)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(J){J.callback=null},n.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<J?Math.floor(1e3/J):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(J){switch(_){case 1:case 2:case 3:var K=3;break;default:K=_}var ue=_;_=K;try{return J()}finally{_=ue}},n.unstable_requestPaint=function(){x=!0},n.unstable_runWithPriority=function(J,K){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var ue=_;_=J;try{return K()}finally{_=ue}},n.unstable_scheduleCallback=function(J,K,ue){var re=n.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?re+ue:re):ue=re,J){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=ue+q,J={id:y++,callback:K,priorityLevel:J,startTime:ue,expirationTime:q,sortIndex:-1},ue>re?(J.sortIndex=ue,a(h,J),i(d)===null&&J===i(h)&&(S?(k(L),L=-1):S=!0,G(D,ue-re))):(J.sortIndex=q,a(d,J),C||m||(C=!0,M||(M=!0,R()))),J},n.unstable_shouldYield=W,n.unstable_wrapCallback=function(J){var K=_;return function(){var ue=_;_=K;try{return J.apply(this,arguments)}finally{_=ue}}}})(Ul)),Ul}var bd;function sv(){return bd||(bd=1,Bl.exports=av()),Bl.exports}var Fl={exports:{}},Ht={};var vd;function ov(){if(vd)return Ht;vd=1;var n=Js();function a(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+d+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(a(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},u=Symbol.for("react.portal");function l(d,h,y){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:b==null?null:""+b,children:d,containerInfo:h,implementation:y}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Ht.createPortal=function(d,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(a(299));return l(d,h,null,y)},Ht.flushSync=function(d){var h=c.T,y=s.p;try{if(c.T=null,s.p=2,d)return d()}finally{c.T=h,s.p=y,s.d.f()}},Ht.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(d,h))},Ht.prefetchDNS=function(d){typeof d=="string"&&s.d.D(d)},Ht.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var y=h.as,b=f(y,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,m=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?s.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:_,fetchPriority:m}):y==="script"&&s.d.X(d,{crossOrigin:b,integrity:_,fetchPriority:m,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ht.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=f(h.as,h.crossOrigin);s.d.M(d,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&s.d.M(d)},Ht.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,b=f(y,h.crossOrigin);s.d.L(d,y,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Ht.preloadModule=function(d,h){if(typeof d=="string")if(h){var y=f(h.as,h.crossOrigin);s.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else s.d.m(d)},Ht.requestFormReset=function(d){s.d.r(d)},Ht.unstable_batchedUpdates=function(d,h){return d(h)},Ht.useFormState=function(d,h,y){return c.H.useFormState(d,h,y)},Ht.useFormStatus=function(){return c.H.useHostTransitionStatus()},Ht.version="19.2.0",Ht}var _d;function Sd(){if(_d)return Fl.exports;_d=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Fl.exports=ov(),Fl.exports}var Ed;function lv(){if(Ed)return Ta;Ed=1;var n=sv(),a=Js(),i=Sd();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function c(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 f(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 d(e){if(l(e)!==e)throw Error(s(188))}function h(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t!==e?null:e}for(var r=e,o=t;;){var p=r.return;if(p===null)break;var v=p.alternate;if(v===null){if(o=p.return,o!==null){r=o;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===r)return d(p),e;if(v===o)return d(p),t;v=v.sibling}throw Error(s(188))}if(r.return!==o.return)r=p,o=v;else{for(var O=!1,P=p.child;P;){if(P===r){O=!0,r=p,o=v;break}if(P===o){O=!0,o=p,r=v;break}P=P.sibling}if(!O){for(P=v.child;P;){if(P===r){O=!0,r=v,o=p;break}if(P===o){O=!0,o=v,r=p;break}P=P.sibling}if(!O)throw Error(s(189))}}if(r.alternate!==o)throw Error(s(190))}if(r.tag!==3)throw Error(s(188));return r.stateNode.current===r?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,_=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),N=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function R(e){return e===null||typeof e!="object"?null:(e=oe&&e[oe]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Symbol.for("react.client.reference");function E(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case F:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case N:return e.displayName||"Context";case k:return(e._context.displayName||"Context")+".Consumer";case j:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return t=e.displayName||null,t!==null?t:E(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return E(e(t))}catch{}}return null}var G=Array.isArray,J=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},re=[],q=-1;function z(e){return{current:e}}function I(e){0>q||(e.current=re[q],re[q]=null,q--)}function B(e,t){q++,re[q]=e.current,e.current=t}var te=z(null),ae=z(null),xe=z(null),Te=z(null);function Ce(e,t){switch(B(xe,t),B(ae,e),B(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xb(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xb(t),e=Cb(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}I(te),B(te,e)}function ke(){I(te),I(ae),I(xe)}function je(e){e.memoizedState!==null&&B(Te,e);var t=te.current,r=Cb(t,e.type);t!==r&&(B(ae,e),B(te,r))}function _e(e){ae.current===e&&(I(te),I(ae)),Te.current===e&&(I(Te),Zs._currentValue=ue)}var Re,Ne;function g(e){if(Re===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Re=t&&t[1]||"",Ne=-1<r.stack.indexOf(`
|
|
1
|
+
var MedAssistWidget=(function(hs){"use strict";function Ab(n,l){for(var i=0;i<l.length;i++){const o=l[i];if(typeof o!="string"&&!Array.isArray(o)){for(const u in o)if(u!=="default"&&!(u in n)){const s=Object.getOwnPropertyDescriptor(o,u);s&&Object.defineProperty(n,u,s.get?s:{enumerable:!0,get:()=>o[u]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var Rl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ms(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ps={exports:{}},oa={};var Gf;function kb(){if(Gf)return oa;Gf=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(o,u,s){var c=null;if(s!==void 0&&(c=""+s),u.key!==void 0&&(c=""+u.key),"key"in u){s={};for(var f in u)f!=="key"&&(s[f]=u[f])}else s=u;return u=s.ref,{$$typeof:n,type:o,key:c,ref:u!==void 0?u:null,props:s}}return oa.Fragment=l,oa.jsx=i,oa.jsxs=i,oa}var Xf;function Nb(){return Xf||(Xf=1,ps.exports=kb()),ps.exports}var O=Nb(),gs={exports:{}},Ue={};var Zf;function Rb(){if(Zf)return Ue;Zf=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function b(N){return N===null||typeof N!="object"?null:(N=v&&N[v]||N["@@iterator"],typeof N=="function"?N:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,T={};function _(N,B,z){this.props=N,this.context=B,this.refs=T,this.updater=z||w}_.prototype.isReactComponent={},_.prototype.setState=function(N,B){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,B,"setState")},_.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function A(){}A.prototype=_.prototype;function k(N,B,z){this.props=N,this.context=B,this.refs=T,this.updater=z||w}var q=k.prototype=new A;q.constructor=k,E(q,_.prototype),q.isPureReactComponent=!0;var H=Array.isArray;function M(){}var I={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function F(N,B,z){var re=z.ref;return{$$typeof:n,type:N,key:B,ref:re!==void 0?re:null,props:z}}function $(N,B){return F(N.type,B,N.props)}function ie(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function D(N){var B={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(z){return B[z]})}var ne=/\/+/g;function C(N,B){return typeof N=="object"&&N!==null&&N.key!=null?D(""+N.key):B.toString(36)}function V(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(M,M):(N.status="pending",N.then(function(B){N.status==="pending"&&(N.status="fulfilled",N.value=B)},function(B){N.status==="pending"&&(N.status="rejected",N.reason=B)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function Z(N,B,z,re,ce){var we=typeof N;(we==="undefined"||we==="boolean")&&(N=null);var Te=!1;if(N===null)Te=!0;else switch(we){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(N.$$typeof){case n:case l:Te=!0;break;case g:return Te=N._init,Z(Te(N._payload),B,z,re,ce)}}if(Te)return ce=ce(N),Te=re===""?"."+C(N,0):re,H(ce)?(z="",Te!=null&&(z=Te.replace(ne,"$&/")+"/"),Z(ce,B,z,"",function(He){return He})):ce!=null&&(ie(ce)&&(ce=$(ce,z+(ce.key==null||N&&N.key===ce.key?"":(""+ce.key).replace(ne,"$&/")+"/")+Te)),B.push(ce)),1;Te=0;var ke=re===""?".":re+":";if(H(N))for(var Ae=0;Ae<N.length;Ae++)re=N[Ae],we=ke+C(re,Ae),Te+=Z(re,B,z,we,ce);else if(Ae=b(N),typeof Ae=="function")for(N=Ae.call(N),Ae=0;!(re=N.next()).done;)re=re.value,we=ke+C(re,Ae++),Te+=Z(re,B,z,we,ce);else if(we==="object"){if(typeof N.then=="function")return Z(V(N),B,z,re,ce);throw B=String(N),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return Te}function Q(N,B,z){if(N==null)return N;var re=[],ce=0;return Z(N,re,"","",function(we){return B.call(z,we,ce++)}),re}function se(N){if(N._status===-1){var B=N._result;B=B(),B.then(function(z){(N._status===0||N._status===-1)&&(N._status=1,N._result=z)},function(z){(N._status===0||N._status===-1)&&(N._status=2,N._result=z)}),N._status===-1&&(N._status=0,N._result=B)}if(N._status===1)return N._result.default;throw N._result}var de=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}},L={map:Q,forEach:function(N,B,z){Q(N,function(){B.apply(this,arguments)},z)},count:function(N){var B=0;return Q(N,function(){B++}),B},toArray:function(N){return Q(N,function(B){return B})||[]},only:function(N){if(!ie(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Ue.Activity=y,Ue.Children=L,Ue.Component=_,Ue.Fragment=i,Ue.Profiler=u,Ue.PureComponent=k,Ue.StrictMode=o,Ue.Suspense=m,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(N){return I.H.useMemoCache(N)}},Ue.cache=function(N){return function(){return N.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(N,B,z){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var re=E({},N.props),ce=N.key;if(B!=null)for(we in B.key!==void 0&&(ce=""+B.key),B)!Y.call(B,we)||we==="key"||we==="__self"||we==="__source"||we==="ref"&&B.ref===void 0||(re[we]=B[we]);var we=arguments.length-2;if(we===1)re.children=z;else if(1<we){for(var Te=Array(we),ke=0;ke<we;ke++)Te[ke]=arguments[ke+2];re.children=Te}return F(N.type,ce,re)},Ue.createContext=function(N){return N={$$typeof:c,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:s,_context:N},N},Ue.createElement=function(N,B,z){var re,ce={},we=null;if(B!=null)for(re in B.key!==void 0&&(we=""+B.key),B)Y.call(B,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ce[re]=B[re]);var Te=arguments.length-2;if(Te===1)ce.children=z;else if(1<Te){for(var ke=Array(Te),Ae=0;Ae<Te;Ae++)ke[Ae]=arguments[Ae+2];ce.children=ke}if(N&&N.defaultProps)for(re in Te=N.defaultProps,Te)ce[re]===void 0&&(ce[re]=Te[re]);return F(N,we,ce)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(N){return{$$typeof:f,render:N}},Ue.isValidElement=ie,Ue.lazy=function(N){return{$$typeof:g,_payload:{_status:-1,_result:N},_init:se}},Ue.memo=function(N,B){return{$$typeof:h,type:N,compare:B===void 0?null:B}},Ue.startTransition=function(N){var B=I.T,z={};I.T=z;try{var re=N(),ce=I.S;ce!==null&&ce(z,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(M,de)}catch(we){de(we)}finally{B!==null&&z.types!==null&&(B.types=z.types),I.T=B}},Ue.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Ue.use=function(N){return I.H.use(N)},Ue.useActionState=function(N,B,z){return I.H.useActionState(N,B,z)},Ue.useCallback=function(N,B){return I.H.useCallback(N,B)},Ue.useContext=function(N){return I.H.useContext(N)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(N,B){return I.H.useDeferredValue(N,B)},Ue.useEffect=function(N,B){return I.H.useEffect(N,B)},Ue.useEffectEvent=function(N){return I.H.useEffectEvent(N)},Ue.useId=function(){return I.H.useId()},Ue.useImperativeHandle=function(N,B,z){return I.H.useImperativeHandle(N,B,z)},Ue.useInsertionEffect=function(N,B){return I.H.useInsertionEffect(N,B)},Ue.useLayoutEffect=function(N,B){return I.H.useLayoutEffect(N,B)},Ue.useMemo=function(N,B){return I.H.useMemo(N,B)},Ue.useOptimistic=function(N,B){return I.H.useOptimistic(N,B)},Ue.useReducer=function(N,B,z){return I.H.useReducer(N,B,z)},Ue.useRef=function(N){return I.H.useRef(N)},Ue.useState=function(N){return I.H.useState(N)},Ue.useSyncExternalStore=function(N,B,z){return I.H.useSyncExternalStore(N,B,z)},Ue.useTransition=function(){return I.H.useTransition()},Ue.version="19.2.0",Ue}var Kf;function Ol(){return Kf||(Kf=1,gs.exports=Rb()),gs.exports}var P=Ol();const sa=ms(P),Qf=Ab({__proto__:null,default:sa},[P]);var ys={exports:{}},ua={},bs={exports:{}},vs={};var Jf;function Ob(){return Jf||(Jf=1,(function(n){function l(Z,Q){var se=Z.length;Z.push(Q);e:for(;0<se;){var de=se-1>>>1,L=Z[de];if(0<u(L,Q))Z[de]=Q,Z[se]=L,se=de;else break e}}function i(Z){return Z.length===0?null:Z[0]}function o(Z){if(Z.length===0)return null;var Q=Z[0],se=Z.pop();if(se!==Q){Z[0]=se;e:for(var de=0,L=Z.length,N=L>>>1;de<N;){var B=2*(de+1)-1,z=Z[B],re=B+1,ce=Z[re];if(0>u(z,se))re<L&&0>u(ce,z)?(Z[de]=ce,Z[re]=se,de=re):(Z[de]=z,Z[B]=se,de=B);else if(re<L&&0>u(ce,se))Z[de]=ce,Z[re]=se,de=re;else break e}}return Q}function u(Z,Q){var se=Z.sortIndex-Q.sortIndex;return se!==0?se:Z.id-Q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var c=Date,f=c.now();n.unstable_now=function(){return c.now()-f}}var m=[],h=[],g=1,y=null,v=3,b=!1,w=!1,E=!1,T=!1,_=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function q(Z){for(var Q=i(h);Q!==null;){if(Q.callback===null)o(h);else if(Q.startTime<=Z)o(h),Q.sortIndex=Q.expirationTime,l(m,Q);else break;Q=i(h)}}function H(Z){if(E=!1,q(Z),!w)if(i(m)!==null)w=!0,M||(M=!0,D());else{var Q=i(h);Q!==null&&V(H,Q.startTime-Z)}}var M=!1,I=-1,Y=5,F=-1;function $(){return T?!0:!(n.unstable_now()-F<Y)}function ie(){if(T=!1,M){var Z=n.unstable_now();F=Z;var Q=!0;try{e:{w=!1,E&&(E=!1,A(I),I=-1),b=!0;var se=v;try{t:{for(q(Z),y=i(m);y!==null&&!(y.expirationTime>Z&&$());){var de=y.callback;if(typeof de=="function"){y.callback=null,v=y.priorityLevel;var L=de(y.expirationTime<=Z);if(Z=n.unstable_now(),typeof L=="function"){y.callback=L,q(Z),Q=!0;break t}y===i(m)&&o(m),q(Z)}else o(m);y=i(m)}if(y!==null)Q=!0;else{var N=i(h);N!==null&&V(H,N.startTime-Z),Q=!1}}break e}finally{y=null,v=se,b=!1}Q=void 0}}finally{Q?D():M=!1}}}var D;if(typeof k=="function")D=function(){k(ie)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,C=ne.port2;ne.port1.onmessage=ie,D=function(){C.postMessage(null)}}else D=function(){_(ie,0)};function V(Z,Q){I=_(function(){Z(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(Z){Z.callback=null},n.unstable_forceFrameRate=function(Z){0>Z||125<Z||(Y=0<Z?Math.floor(1e3/Z):5)},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(Z){switch(v){case 1:case 2:case 3:var Q=3;break;default:Q=v}var se=v;v=Q;try{return Z()}finally{v=se}},n.unstable_requestPaint=function(){T=!0},n.unstable_runWithPriority=function(Z,Q){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var se=v;v=Z;try{return Q()}finally{v=se}},n.unstable_scheduleCallback=function(Z,Q,se){var de=n.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?de+se:de):se=de,Z){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=se+L,Z={id:g++,callback:Q,priorityLevel:Z,startTime:se,expirationTime:L,sortIndex:-1},se>de?(Z.sortIndex=se,l(h,Z),i(m)===null&&Z===i(h)&&(E?(A(I),I=-1):E=!0,V(H,se-de))):(Z.sortIndex=L,l(m,Z),w||b||(w=!0,M||(M=!0,D()))),Z},n.unstable_shouldYield=$,n.unstable_wrapCallback=function(Z){var Q=v;return function(){var se=v;v=Q;try{return Z.apply(this,arguments)}finally{v=se}}}})(vs)),vs}var Wf;function zb(){return Wf||(Wf=1,bs.exports=Ob()),bs.exports}var Ss={exports:{}},Ut={};var $f;function Mb(){if($f)return Ut;$f=1;var n=Ol();function l(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var o={d:{f:i,r:function(){throw Error(l(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},u=Symbol.for("react.portal");function s(m,h,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:y==null?null:""+y,children:m,containerInfo:h,implementation:g}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Ut.createPortal=function(m,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(l(299));return s(m,h,null,g)},Ut.flushSync=function(m){var h=c.T,g=o.p;try{if(c.T=null,o.p=2,m)return m()}finally{c.T=h,o.p=g,o.d.f()}},Ut.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(m,h))},Ut.prefetchDNS=function(m){typeof m=="string"&&o.d.D(m)},Ut.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var g=h.as,y=f(g,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?o.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:b}):g==="script"&&o.d.X(m,{crossOrigin:y,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ut.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);o.d.M(m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(m)},Ut.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,y=f(g,h.crossOrigin);o.d.L(m,g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Ut.preloadModule=function(m,h){if(typeof m=="string")if(h){var g=f(h.as,h.crossOrigin);o.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(m)},Ut.requestFormReset=function(m){o.d.r(m)},Ut.unstable_batchedUpdates=function(m,h){return m(h)},Ut.useFormState=function(m,h,g){return c.H.useFormState(m,h,g)},Ut.useFormStatus=function(){return c.H.useHostTransitionStatus()},Ut.version="19.2.0",Ut}var ed;function td(){if(ed)return Ss.exports;ed=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch{}}return n(),Ss.exports=Mb(),Ss.exports}var nd;function Db(){if(nd)return ua;nd=1;var n=zb(),l=Ol(),i=td();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function c(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 f(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 m(e){if(s(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(o(188));return t!==e?null:e}for(var r=e,a=t;;){var d=r.return;if(d===null)break;var p=d.alternate;if(p===null){if(a=d.return,a!==null){r=a;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===r)return m(d),e;if(p===a)return m(d),t;p=p.sibling}throw Error(o(188))}if(r.return!==a.return)r=d,a=p;else{for(var x=!1,R=d.child;R;){if(R===r){x=!0,r=d,a=p;break}if(R===a){x=!0,a=d,r=p;break}R=R.sibling}if(!x){for(R=p.child;R;){if(R===r){x=!0,r=p,a=d;break}if(R===a){x=!0,a=p,r=d;break}R=R.sibling}if(!x)throw Error(o(189))}}if(r.alternate!==a)throw Error(o(190))}if(r.tag!==3)throw Error(o(188));return r.stateNode.current===r?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),k=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function D(e){return e===null||typeof e!="object"?null:(e=ie&&e[ie]||e["@@iterator"],typeof e=="function"?e:null)}var ne=Symbol.for("react.client.reference");function C(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case _:return"Profiler";case T:return"StrictMode";case H:return"Suspense";case M:return"SuspenseList";case F:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case k:return e.displayName||"Context";case A:return(e._context.displayName||"Context")+".Consumer";case q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return t=e.displayName||null,t!==null?t:C(e.type)||"Memo";case Y:t=e._payload,e=e._init;try{return C(e(t))}catch{}}return null}var V=Array.isArray,Z=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},de=[],L=-1;function N(e){return{current:e}}function B(e){0>L||(e.current=de[L],de[L]=null,L--)}function z(e,t){L++,de[L]=e.current,e.current=t}var re=N(null),ce=N(null),we=N(null),Te=N(null);function ke(e,t){switch(z(we,t),z(ce,e),z(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Q0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Q0(t),e=J0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(re),z(re,e)}function Ae(){B(re),B(ce),B(we)}function He(e){e.memoizedState!==null&&z(Te,e);var t=re.current,r=J0(t,e.type);t!==r&&(z(ce,e),z(re,r))}function ve(e){ce.current===e&&(B(re),B(ce)),Te.current===e&&(B(Te),Tl._currentValue=se)}var ze,je;function S(e){if(ze===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);ze=t&&t[1]||"",je=-1<r.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
4
|
-
`),
|
|
5
|
-
`);for(
|
|
6
|
-
`+
|
|
7
|
-
Error generating stack: `+
|
|
8
|
-
`+o.stack}}var U=Object.prototype.hasOwnProperty,ee=n.unstable_scheduleCallback,se=n.unstable_cancelCallback,X=n.unstable_shouldYield,ce=n.unstable_requestPaint,pe=n.unstable_now,de=n.unstable_getCurrentPriorityLevel,ie=n.unstable_ImmediatePriority,be=n.unstable_UserBlockingPriority,Ee=n.unstable_NormalPriority,De=n.unstable_LowPriority,qe=n.unstable_IdlePriority,$e=n.log,Et=n.unstable_setDisableYieldValue,Le=null,st=null;function vt(e){if(typeof $e=="function"&&Et(e),st&&typeof st.setStrictMode=="function")try{st.setStrictMode(Le,e)}catch{}}var Pe=Math.clz32?Math.clz32:as,$t=Math.log,Zt=Math.LN2;function as(e){return e>>>=0,e===0?32:31-($t(e)/Zt|0)|0}var Nr=256,qn=262144,Vt=4194304;function jt(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 So(e,t,r){var o=e.pendingLanes;if(o===0)return 0;var p=0,v=e.suspendedLanes,O=e.pingedLanes;e=e.warmLanes;var P=o&134217727;return P!==0?(o=P&~v,o!==0?p=jt(o):(O&=P,O!==0?p=jt(O):r||(r=P&~e,r!==0&&(p=jt(r))))):(P=o&~v,P!==0?p=jt(P):O!==0?p=jt(O):r||(r=o&~e,r!==0&&(p=jt(r)))),p===0?0:t!==0&&t!==p&&(t&v)===0&&(v=p&-p,r=t&-t,v>=r||v===32&&(r&4194048)!==0)?t:p}function ss(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Q2(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 ag(){var e=Vt;return Vt<<=1,(Vt&62914560)===0&&(Vt=4194304),e}function $u(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function os(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function W2(e,t,r,o,p,v){var O=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var P=e.entanglements,ne=e.expirationTimes,me=e.hiddenUpdates;for(r=O&~r;0<r;){var ve=31-Pe(r),we=1<<ve;P[ve]=0,ne[ve]=-1;var ge=me[ve];if(ge!==null)for(me[ve]=null,ve=0;ve<ge.length;ve++){var ye=ge[ve];ye!==null&&(ye.lane&=-536870913)}r&=~we}o!==0&&sg(e,o,0),v!==0&&p===0&&e.tag!==0&&(e.suspendedLanes|=v&~(O&~t))}function sg(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Pe(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|r&261930}function og(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var o=31-Pe(r),p=1<<o;p&t|e[o]&t&&(e[o]|=t),r&=~p}}function lg(e,t){var r=t&-t;return r=(r&42)!==0?1:ec(r),(r&(e.suspendedLanes|t))!==0?0:r}function ec(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 tc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ug(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:Xb(e.type))}function cg(e,t){var r=K.p;try{return K.p=e,t()}finally{K.p=r}}var Or=Math.random().toString(36).slice(2),Lt="__reactFiber$"+Or,en="__reactProps$"+Or,Pi="__reactContainer$"+Or,nc="__reactEvents$"+Or,J2="__reactListeners$"+Or,$2="__reactHandles$"+Or,fg="__reactResources$"+Or,ls="__reactMarker$"+Or;function rc(e){delete e[Lt],delete e[en],delete e[nc],delete e[J2],delete e[$2]}function Hi(e){var t=e[Lt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Pi]||r[Lt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=zb(e);e!==null;){if(r=e[Lt])return r;e=zb(e)}return t}e=r,r=e.parentNode}return null}function qi(e){if(e=e[Lt]||e[Pi]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function us(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Gi(e){var t=e[fg];return t||(t=e[fg]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Dt(e){e[ls]=!0}var dg=new Set,hg={};function fi(e,t){Vi(e,t),Vi(e+"Capture",t)}function Vi(e,t){for(hg[e]=t,e=0;e<t.length;e++)dg.add(t[e])}var eC=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]*$"),pg={},mg={};function tC(e){return U.call(mg,e)?!0:U.call(pg,e)?!1:eC.test(e)?mg[e]=!0:(pg[e]=!0,!1)}function Eo(e,t,r){if(tC(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function wo(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function tr(e,t,r,o){if(o===null)e.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+o)}}function wn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function nC(e,t,r){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,v=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return p.call(this)},set:function(O){r=""+O,v.call(this,O)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return r},setValue:function(O){r=""+O},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ic(e){if(!e._valueTracker){var t=gg(e)?"checked":"value";e._valueTracker=nC(e,t,""+e[t])}}function yg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),o="";return e&&(o=gg(e)?e.checked?"true":"false":e.value),e=o,e!==r?(t.setValue(e),!0):!1}function xo(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 rC=/[\n"\\]/g;function xn(e){return e.replace(rC,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ac(e,t,r,o,p,v,O,P){e.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.type=O:e.removeAttribute("type"),t!=null?O==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+wn(t)):e.value!==""+wn(t)&&(e.value=""+wn(t)):O!=="submit"&&O!=="reset"||e.removeAttribute("value"),t!=null?sc(e,O,wn(t)):r!=null?sc(e,O,wn(r)):o!=null&&e.removeAttribute("value"),p==null&&v!=null&&(e.defaultChecked=!!v),p!=null&&(e.checked=p&&typeof p!="function"&&typeof p!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?e.name=""+wn(P):e.removeAttribute("name")}function bg(e,t,r,o,p,v,O,P){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.type=v),t!=null||r!=null){if(!(v!=="submit"&&v!=="reset"||t!=null)){ic(e);return}r=r!=null?""+wn(r):"",t=t!=null?""+wn(t):r,P||t===e.value||(e.value=t),e.defaultValue=t}o=o??p,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=P?e.checked:!!o,e.defaultChecked=!!o,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(e.name=O),ic(e)}function sc(e,t,r){t==="number"&&xo(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Yi(e,t,r,o){if(e=e.options,t){t={};for(var p=0;p<r.length;p++)t["$"+r[p]]=!0;for(r=0;r<e.length;r++)p=t.hasOwnProperty("$"+e[r].value),e[r].selected!==p&&(e[r].selected=p),p&&o&&(e[r].defaultSelected=!0)}else{for(r=""+wn(r),t=null,p=0;p<e.length;p++){if(e[p].value===r){e[p].selected=!0,o&&(e[p].defaultSelected=!0);return}t!==null||e[p].disabled||(t=e[p])}t!==null&&(t.selected=!0)}}function vg(e,t,r){if(t!=null&&(t=""+wn(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+wn(r):""}function _g(e,t,r,o){if(t==null){if(o!=null){if(r!=null)throw Error(s(92));if(G(o)){if(1<o.length)throw Error(s(93));o=o[0]}r=o}r==null&&(r=""),t=r}r=wn(t),e.defaultValue=r,o=e.textContent,o===r&&o!==""&&o!==null&&(e.value=o),ic(e)}function Zi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var iC=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 Sg(e,t,r){var o=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,r):typeof r!="number"||r===0||iC.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function Eg(e,t,r){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,r!=null){for(var o in r)!r.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var p in t)o=t[p],t.hasOwnProperty(p)&&r[p]!==o&&Sg(e,p,o)}else for(var v in t)t.hasOwnProperty(v)&&Sg(e,v,t[v])}function oc(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 aC=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"]]),sC=/^[\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 Co(e){return sC.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function nr(){}var lc=null;function uc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xi=null,Ki=null;function wg(e){var t=qi(e);if(t&&(e=t.stateNode)){var r=e[en]||null;e:switch(e=t.stateNode,t.type){case"input":if(ac(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+xn(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var o=r[t];if(o!==e&&o.form===e.form){var p=o[en]||null;if(!p)throw Error(s(90));ac(o,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(t=0;t<r.length;t++)o=r[t],o.form===e.form&&yg(o)}break e;case"textarea":vg(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&Yi(e,!!r.multiple,t,!1)}}}var cc=!1;function xg(e,t,r){if(cc)return e(t,r);cc=!0;try{var o=e(t);return o}finally{if(cc=!1,(Xi!==null||Ki!==null)&&(dl(),Xi&&(t=Xi,e=Ki,Ki=Xi=null,wg(t),e)))for(t=0;t<e.length;t++)wg(e[t])}}function cs(e,t){var r=e.stateNode;if(r===null)return null;var o=r[en]||null;if(o===null)return null;r=o[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":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(s(231,t,typeof r));return r}var rr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fc=!1;if(rr)try{var fs={};Object.defineProperty(fs,"passive",{get:function(){fc=!0}}),window.addEventListener("test",fs,fs),window.removeEventListener("test",fs,fs)}catch{fc=!1}var zr=null,dc=null,ko=null;function Cg(){if(ko)return ko;var e,t=dc,r=t.length,o,p="value"in zr?zr.value:zr.textContent,v=p.length;for(e=0;e<r&&t[e]===p[e];e++);var O=r-e;for(o=1;o<=O&&t[r-o]===p[v-o];o++);return ko=p.slice(e,1<o?1-o:void 0)}function To(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 Ao(){return!0}function kg(){return!1}function tn(e){function t(r,o,p,v,O){this._reactName=r,this._targetInst=p,this.type=o,this.nativeEvent=v,this.target=O,this.currentTarget=null;for(var P in e)e.hasOwnProperty(P)&&(r=e[P],this[P]=r?r(v):v[P]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Ao:kg,this.isPropagationStopped=kg,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ao)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ao)},persist:function(){},isPersistent:Ao}),t}var di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ro=tn(di),ds=b({},di,{view:0,detail:0}),oC=tn(ds),hc,pc,hs,No=b({},ds,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gc,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!==hs&&(hs&&e.type==="mousemove"?(hc=e.screenX-hs.screenX,pc=e.screenY-hs.screenY):pc=hc=0,hs=e),hc)},movementY:function(e){return"movementY"in e?e.movementY:pc}}),Tg=tn(No),lC=b({},No,{dataTransfer:0}),uC=tn(lC),cC=b({},ds,{relatedTarget:0}),mc=tn(cC),fC=b({},di,{animationName:0,elapsedTime:0,pseudoElement:0}),dC=tn(fC),hC=b({},di,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pC=tn(hC),mC=b({},di,{data:0}),Ag=tn(mC),gC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yC={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"},bC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vC(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bC[e])?!!t[e]:!1}function gc(){return vC}var _C=b({},ds,{key:function(e){if(e.key){var t=gC[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=To(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yC[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gc,charCode:function(e){return e.type==="keypress"?To(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?To(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),SC=tn(_C),EC=b({},No,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rg=tn(EC),wC=b({},ds,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gc}),xC=tn(wC),CC=b({},di,{propertyName:0,elapsedTime:0,pseudoElement:0}),kC=tn(CC),TC=b({},No,{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}),AC=tn(TC),RC=b({},di,{newState:0,oldState:0}),NC=tn(RC),OC=[9,13,27,32],yc=rr&&"CompositionEvent"in window,ps=null;rr&&"documentMode"in document&&(ps=document.documentMode);var zC=rr&&"TextEvent"in window&&!ps,Ng=rr&&(!yc||ps&&8<ps&&11>=ps),Og=" ",zg=!1;function Mg(e,t){switch(e){case"keyup":return OC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qi=!1;function MC(e,t){switch(e){case"compositionend":return Dg(t);case"keypress":return t.which!==32?null:(zg=!0,Og);case"textInput":return e=t.data,e===Og&&zg?null:e;default:return null}}function DC(e,t){if(Qi)return e==="compositionend"||!yc&&Mg(e,t)?(e=Cg(),ko=dc=zr=null,Qi=!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 Ng&&t.locale!=="ko"?null:t.data;default:return null}}var IC={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 Ig(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!IC[e.type]:t==="textarea"}function jg(e,t,r,o){Xi?Ki?Ki.push(o):Ki=[o]:Xi=o,t=vl(t,"onChange"),0<t.length&&(r=new Ro("onChange","change",null,r,o),e.push({event:r,listeners:t}))}var ms=null,gs=null;function jC(e){bb(e,0)}function Oo(e){var t=us(e);if(yg(t))return e}function Lg(e,t){if(e==="change")return t}var Bg=!1;if(rr){var bc;if(rr){var vc="oninput"in document;if(!vc){var Ug=document.createElement("div");Ug.setAttribute("oninput","return;"),vc=typeof Ug.oninput=="function"}bc=vc}else bc=!1;Bg=bc&&(!document.documentMode||9<document.documentMode)}function Fg(){ms&&(ms.detachEvent("onpropertychange",Pg),gs=ms=null)}function Pg(e){if(e.propertyName==="value"&&Oo(gs)){var t=[];jg(t,gs,e,uc(e)),xg(jC,t)}}function LC(e,t,r){e==="focusin"?(Fg(),ms=t,gs=r,ms.attachEvent("onpropertychange",Pg)):e==="focusout"&&Fg()}function BC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Oo(gs)}function UC(e,t){if(e==="click")return Oo(t)}function FC(e,t){if(e==="input"||e==="change")return Oo(t)}function PC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:PC;function ys(e,t){if(dn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(o=0;o<r.length;o++){var p=r[o];if(!U.call(t,p)||!dn(e[p],t[p]))return!1}return!0}function Hg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qg(e,t){var r=Hg(e);e=0;for(var o;r;){if(r.nodeType===3){if(o=e+r.textContent.length,e<=t&&o>=t)return{node:r,offset:t-e};e=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Hg(r)}}function Gg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xo(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=xo(e.document)}return t}function _c(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 HC=rr&&"documentMode"in document&&11>=document.documentMode,Wi=null,Sc=null,bs=null,Ec=!1;function Yg(e,t,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ec||Wi==null||Wi!==xo(o)||(o=Wi,"selectionStart"in o&&_c(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),bs&&ys(bs,o)||(bs=o,o=vl(Sc,"onSelect"),0<o.length&&(t=new Ro("onSelect","select",null,t,r),e.push({event:t,listeners:o}),t.target=Wi)))}function hi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ji={animationend:hi("Animation","AnimationEnd"),animationiteration:hi("Animation","AnimationIteration"),animationstart:hi("Animation","AnimationStart"),transitionrun:hi("Transition","TransitionRun"),transitionstart:hi("Transition","TransitionStart"),transitioncancel:hi("Transition","TransitionCancel"),transitionend:hi("Transition","TransitionEnd")},wc={},Zg={};rr&&(Zg=document.createElement("div").style,"AnimationEvent"in window||(delete Ji.animationend.animation,delete Ji.animationiteration.animation,delete Ji.animationstart.animation),"TransitionEvent"in window||delete Ji.transitionend.transition);function pi(e){if(wc[e])return wc[e];if(!Ji[e])return e;var t=Ji[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Zg)return wc[e]=t[r];return e}var Xg=pi("animationend"),Kg=pi("animationiteration"),Qg=pi("animationstart"),qC=pi("transitionrun"),GC=pi("transitionstart"),VC=pi("transitioncancel"),Wg=pi("transitionend"),Jg=new Map,xc="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(" ");xc.push("scrollEnd");function Dn(e,t){Jg.set(e,t),fi(t,[e])}var zo=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)},Cn=[],$i=0,Cc=0;function Mo(){for(var e=$i,t=Cc=$i=0;t<e;){var r=Cn[t];Cn[t++]=null;var o=Cn[t];Cn[t++]=null;var p=Cn[t];Cn[t++]=null;var v=Cn[t];if(Cn[t++]=null,o!==null&&p!==null){var O=o.pending;O===null?p.next=p:(p.next=O.next,O.next=p),o.pending=p}v!==0&&$g(r,p,v)}}function Do(e,t,r,o){Cn[$i++]=e,Cn[$i++]=t,Cn[$i++]=r,Cn[$i++]=o,Cc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function kc(e,t,r,o){return Do(e,t,r,o),Io(e)}function mi(e,t){return Do(e,null,null,t),Io(e)}function $g(e,t,r){e.lanes|=r;var o=e.alternate;o!==null&&(o.lanes|=r);for(var p=!1,v=e.return;v!==null;)v.childLanes|=r,o=v.alternate,o!==null&&(o.childLanes|=r),v.tag===22&&(e=v.stateNode,e===null||e._visibility&1||(p=!0)),e=v,v=v.return;return e.tag===3?(v=e.stateNode,p&&t!==null&&(p=31-Pe(r),e=v.hiddenUpdates,o=e[p],o===null?e[p]=[t]:o.push(t),t.lane=r|536870912),v):null}function Io(e){if(50<Fs)throw Fs=0,jf=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ea={};function YC(e,t,r,o){this.tag=e,this.key=r,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hn(e,t,r,o){return new YC(e,t,r,o)}function Tc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ir(e,t){var r=e.alternate;return r===null?(r=hn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function ey(e,t){e.flags&=65011714;var r=e.alternate;return r===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=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function jo(e,t,r,o,p,v){var O=0;if(o=e,typeof e=="function")Tc(e)&&(O=1);else if(typeof e=="string")O=Wk(e,r,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case F:return e=hn(31,r,t,p),e.elementType=F,e.lanes=v,e;case S:return gi(r.children,p,v,t);case x:O=8,p|=24;break;case w:return e=hn(12,r,t,p|2),e.elementType=w,e.lanes=v,e;case D:return e=hn(13,r,t,p),e.elementType=D,e.lanes=v,e;case M:return e=hn(19,r,t,p),e.elementType=M,e.lanes=v,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:O=10;break e;case k:O=9;break e;case j:O=11;break e;case L:O=14;break e;case V:O=16,o=null;break e}O=29,r=Error(s(130,e===null?"null":typeof e,"")),o=null}return t=hn(O,r,t,p),t.elementType=e,t.type=o,t.lanes=v,t}function gi(e,t,r,o){return e=hn(7,e,o,t),e.lanes=r,e}function Ac(e,t,r){return e=hn(6,e,null,t),e.lanes=r,e}function ty(e){var t=hn(18,null,null,0);return t.stateNode=e,t}function Rc(e,t,r){return t=hn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ny=new WeakMap;function kn(e,t){if(typeof e=="object"&&e!==null){var r=ny.get(e);return r!==void 0?r:(t={value:e,source:t,stack:T(t)},ny.set(e,t),t)}return{value:e,source:t,stack:T(t)}}var ta=[],na=0,Lo=null,vs=0,Tn=[],An=0,Mr=null,Gn=1,Vn="";function ar(e,t){ta[na++]=vs,ta[na++]=Lo,Lo=e,vs=t}function ry(e,t,r){Tn[An++]=Gn,Tn[An++]=Vn,Tn[An++]=Mr,Mr=e;var o=Gn;e=Vn;var p=32-Pe(o)-1;o&=~(1<<p),r+=1;var v=32-Pe(t)+p;if(30<v){var O=p-p%5;v=(o&(1<<O)-1).toString(32),o>>=O,p-=O,Gn=1<<32-Pe(t)+p|r<<p|o,Vn=v+e}else Gn=1<<v|r<<p|o,Vn=e}function Nc(e){e.return!==null&&(ar(e,1),ry(e,1,0))}function Oc(e){for(;e===Lo;)Lo=ta[--na],ta[na]=null,vs=ta[--na],ta[na]=null;for(;e===Mr;)Mr=Tn[--An],Tn[An]=null,Vn=Tn[--An],Tn[An]=null,Gn=Tn[--An],Tn[An]=null}function iy(e,t){Tn[An++]=Gn,Tn[An++]=Vn,Tn[An++]=Mr,Gn=t.id,Vn=t.overflow,Mr=e}var Bt=null,mt=null,et=!1,Dr=null,Rn=!1,zc=Error(s(519));function Ir(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _s(kn(t,e)),zc}function ay(e){var t=e.stateNode,r=e.type,o=e.memoizedProps;switch(t[Lt]=e,t[en]=o,r){case"dialog":Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":case"embed":Qe("load",t);break;case"video":case"audio":for(r=0;r<Hs.length;r++)Qe(Hs[r],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),bg(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Qe("invalid",t);break;case"textarea":Qe("invalid",t),_g(t,o.value,o.defaultValue,o.children)}r=o.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||o.suppressHydrationWarning===!0||Eb(t.textContent,r)?(o.popover!=null&&(Qe("beforetoggle",t),Qe("toggle",t)),o.onScroll!=null&&Qe("scroll",t),o.onScrollEnd!=null&&Qe("scrollend",t),o.onClick!=null&&(t.onclick=nr),t=!0):t=!1,t||Ir(e,!0)}function sy(e){for(Bt=e.return;Bt;)switch(Bt.tag){case 5:case 31:case 13:Rn=!1;return;case 27:case 3:Rn=!0;return;default:Bt=Bt.return}}function ra(e){if(e!==Bt)return!1;if(!et)return sy(e),et=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Wf(e.type,e.memoizedProps)),r=!r),r&&mt&&Ir(e),sy(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));mt=Ob(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));mt=Ob(e)}else t===27?(t=mt,Kr(e.type)?(e=nd,nd=null,mt=e):mt=t):mt=Bt?On(e.stateNode.nextSibling):null;return!0}function yi(){mt=Bt=null,et=!1}function Mc(){var e=Dr;return e!==null&&(sn===null?sn=e:sn.push.apply(sn,e),Dr=null),e}function _s(e){Dr===null?Dr=[e]:Dr.push(e)}var Dc=z(null),bi=null,sr=null;function jr(e,t,r){B(Dc,t._currentValue),t._currentValue=r}function or(e){e._currentValue=Dc.current,I(Dc)}function Ic(e,t,r){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===r)break;e=e.return}}function jc(e,t,r,o){var p=e.child;for(p!==null&&(p.return=e);p!==null;){var v=p.dependencies;if(v!==null){var O=p.child;v=v.firstContext;e:for(;v!==null;){var P=v;v=p;for(var ne=0;ne<t.length;ne++)if(P.context===t[ne]){v.lanes|=r,P=v.alternate,P!==null&&(P.lanes|=r),Ic(v.return,r,e),o||(O=null);break e}v=P.next}}else if(p.tag===18){if(O=p.return,O===null)throw Error(s(341));O.lanes|=r,v=O.alternate,v!==null&&(v.lanes|=r),Ic(O,r,e),O=null}else O=p.child;if(O!==null)O.return=p;else for(O=p;O!==null;){if(O===e){O=null;break}if(p=O.sibling,p!==null){p.return=O.return,O=p;break}O=O.return}p=O}}function ia(e,t,r,o){e=null;for(var p=t,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var O=p.alternate;if(O===null)throw Error(s(387));if(O=O.memoizedProps,O!==null){var P=p.type;dn(p.pendingProps.value,O.value)||(e!==null?e.push(P):e=[P])}}else if(p===Te.current){if(O=p.alternate,O===null)throw Error(s(387));O.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(e!==null?e.push(Zs):e=[Zs])}p=p.return}e!==null&&jc(t,e,r,o),t.flags|=262144}function Bo(e){for(e=e.firstContext;e!==null;){if(!dn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function vi(e){bi=e,sr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ut(e){return oy(bi,e)}function Uo(e,t){return bi===null&&vi(e),oy(e,t)}function oy(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},sr===null){if(e===null)throw Error(s(308));sr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else sr=sr.next=t;return r}var ZC=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},XC=n.unstable_scheduleCallback,KC=n.unstable_NormalPriority,kt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lc(){return{controller:new ZC,data:new Map,refCount:0}}function Ss(e){e.refCount--,e.refCount===0&&XC(KC,function(){e.controller.abort()})}var Es=null,Bc=0,aa=0,sa=null;function QC(e,t){if(Es===null){var r=Es=[];Bc=0,aa=Hf(),sa={status:"pending",value:void 0,then:function(o){r.push(o)}}}return Bc++,t.then(ly,ly),t}function ly(){if(--Bc===0&&Es!==null){sa!==null&&(sa.status="fulfilled");var e=Es;Es=null,aa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function WC(e,t){var r=[],o={status:"pending",value:null,reason:null,then:function(p){r.push(p)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var p=0;p<r.length;p++)(0,r[p])(t)},function(p){for(o.status="rejected",o.reason=p,p=0;p<r.length;p++)(0,r[p])(void 0)}),o}var uy=J.S;J.S=function(e,t){Y0=pe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&QC(e,t),uy!==null&&uy(e,t)};var _i=z(null);function Uc(){var e=_i.current;return e!==null?e:dt.pooledCache}function Fo(e,t){t===null?B(_i,_i.current):B(_i,t.pool)}function cy(){var e=Uc();return e===null?null:{parent:kt._currentValue,pool:e}}var oa=Error(s(460)),Fc=Error(s(474)),Po=Error(s(542)),Ho={then:function(){}};function fy(e){return e=e.status,e==="fulfilled"||e==="rejected"}function dy(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(nr,nr),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,py(e),e;default:if(typeof t.status=="string")t.then(nr,nr);else{if(e=dt,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var p=t;p.status="fulfilled",p.value=o}},function(o){if(t.status==="pending"){var p=t;p.status="rejected",p.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,py(e),e}throw Ei=t,oa}}function Si(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Ei=r,oa):r}}var Ei=null;function hy(){if(Ei===null)throw Error(s(459));var e=Ei;return Ei=null,e}function py(e){if(e===oa||e===Po)throw Error(s(483))}var la=null,ws=0;function qo(e){var t=ws;return ws+=1,la===null&&(la=[]),dy(la,e,t)}function xs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Go(e,t){throw t.$$typeof===_?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function my(e){function t(fe,le){if(e){var he=fe.deletions;he===null?(fe.deletions=[le],fe.flags|=16):he.push(le)}}function r(fe,le){if(!e)return null;for(;le!==null;)t(fe,le),le=le.sibling;return null}function o(fe){for(var le=new Map;fe!==null;)fe.key!==null?le.set(fe.key,fe):le.set(fe.index,fe),fe=fe.sibling;return le}function p(fe,le){return fe=ir(fe,le),fe.index=0,fe.sibling=null,fe}function v(fe,le,he){return fe.index=he,e?(he=fe.alternate,he!==null?(he=he.index,he<le?(fe.flags|=67108866,le):he):(fe.flags|=67108866,le)):(fe.flags|=1048576,le)}function O(fe){return e&&fe.alternate===null&&(fe.flags|=67108866),fe}function P(fe,le,he,Se){return le===null||le.tag!==6?(le=Ac(he,fe.mode,Se),le.return=fe,le):(le=p(le,he),le.return=fe,le)}function ne(fe,le,he,Se){var Be=he.type;return Be===S?ve(fe,le,he.props.children,Se,he.key):le!==null&&(le.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===V&&Si(Be)===le.type)?(le=p(le,he.props),xs(le,he),le.return=fe,le):(le=jo(he.type,he.key,he.props,null,fe.mode,Se),xs(le,he),le.return=fe,le)}function me(fe,le,he,Se){return le===null||le.tag!==4||le.stateNode.containerInfo!==he.containerInfo||le.stateNode.implementation!==he.implementation?(le=Rc(he,fe.mode,Se),le.return=fe,le):(le=p(le,he.children||[]),le.return=fe,le)}function ve(fe,le,he,Se,Be){return le===null||le.tag!==7?(le=gi(he,fe.mode,Se,Be),le.return=fe,le):(le=p(le,he),le.return=fe,le)}function we(fe,le,he){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return le=Ac(""+le,fe.mode,he),le.return=fe,le;if(typeof le=="object"&&le!==null){switch(le.$$typeof){case m:return he=jo(le.type,le.key,le.props,null,fe.mode,he),xs(he,le),he.return=fe,he;case C:return le=Rc(le,fe.mode,he),le.return=fe,le;case V:return le=Si(le),we(fe,le,he)}if(G(le)||R(le))return le=gi(le,fe.mode,he,null),le.return=fe,le;if(typeof le.then=="function")return we(fe,qo(le),he);if(le.$$typeof===N)return we(fe,Uo(fe,le),he);Go(fe,le)}return null}function ge(fe,le,he,Se){var Be=le!==null?le.key:null;if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Be!==null?null:P(fe,le,""+he,Se);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case m:return he.key===Be?ne(fe,le,he,Se):null;case C:return he.key===Be?me(fe,le,he,Se):null;case V:return he=Si(he),ge(fe,le,he,Se)}if(G(he)||R(he))return Be!==null?null:ve(fe,le,he,Se,null);if(typeof he.then=="function")return ge(fe,le,qo(he),Se);if(he.$$typeof===N)return ge(fe,le,Uo(fe,he),Se);Go(fe,he)}return null}function ye(fe,le,he,Se,Be){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return fe=fe.get(he)||null,P(le,fe,""+Se,Be);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case m:return fe=fe.get(Se.key===null?he:Se.key)||null,ne(le,fe,Se,Be);case C:return fe=fe.get(Se.key===null?he:Se.key)||null,me(le,fe,Se,Be);case V:return Se=Si(Se),ye(fe,le,he,Se,Be)}if(G(Se)||R(Se))return fe=fe.get(he)||null,ve(le,fe,Se,Be,null);if(typeof Se.then=="function")return ye(fe,le,he,qo(Se),Be);if(Se.$$typeof===N)return ye(fe,le,he,Uo(le,Se),Be);Go(le,Se)}return null}function Oe(fe,le,he,Se){for(var Be=null,tt=null,Ie=le,Ye=le=0,Je=null;Ie!==null&&Ye<he.length;Ye++){Ie.index>Ye?(Je=Ie,Ie=null):Je=Ie.sibling;var nt=ge(fe,Ie,he[Ye],Se);if(nt===null){Ie===null&&(Ie=Je);break}e&&Ie&&nt.alternate===null&&t(fe,Ie),le=v(nt,le,Ye),tt===null?Be=nt:tt.sibling=nt,tt=nt,Ie=Je}if(Ye===he.length)return r(fe,Ie),et&&ar(fe,Ye),Be;if(Ie===null){for(;Ye<he.length;Ye++)Ie=we(fe,he[Ye],Se),Ie!==null&&(le=v(Ie,le,Ye),tt===null?Be=Ie:tt.sibling=Ie,tt=Ie);return et&&ar(fe,Ye),Be}for(Ie=o(Ie);Ye<he.length;Ye++)Je=ye(Ie,fe,Ye,he[Ye],Se),Je!==null&&(e&&Je.alternate!==null&&Ie.delete(Je.key===null?Ye:Je.key),le=v(Je,le,Ye),tt===null?Be=Je:tt.sibling=Je,tt=Je);return e&&Ie.forEach(function(ei){return t(fe,ei)}),et&&ar(fe,Ye),Be}function Ue(fe,le,he,Se){if(he==null)throw Error(s(151));for(var Be=null,tt=null,Ie=le,Ye=le=0,Je=null,nt=he.next();Ie!==null&&!nt.done;Ye++,nt=he.next()){Ie.index>Ye?(Je=Ie,Ie=null):Je=Ie.sibling;var ei=ge(fe,Ie,nt.value,Se);if(ei===null){Ie===null&&(Ie=Je);break}e&&Ie&&ei.alternate===null&&t(fe,Ie),le=v(ei,le,Ye),tt===null?Be=ei:tt.sibling=ei,tt=ei,Ie=Je}if(nt.done)return r(fe,Ie),et&&ar(fe,Ye),Be;if(Ie===null){for(;!nt.done;Ye++,nt=he.next())nt=we(fe,nt.value,Se),nt!==null&&(le=v(nt,le,Ye),tt===null?Be=nt:tt.sibling=nt,tt=nt);return et&&ar(fe,Ye),Be}for(Ie=o(Ie);!nt.done;Ye++,nt=he.next())nt=ye(Ie,fe,Ye,nt.value,Se),nt!==null&&(e&&nt.alternate!==null&&Ie.delete(nt.key===null?Ye:nt.key),le=v(nt,le,Ye),tt===null?Be=nt:tt.sibling=nt,tt=nt);return e&&Ie.forEach(function(lT){return t(fe,lT)}),et&&ar(fe,Ye),Be}function ft(fe,le,he,Se){if(typeof he=="object"&&he!==null&&he.type===S&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case m:e:{for(var Be=he.key;le!==null;){if(le.key===Be){if(Be=he.type,Be===S){if(le.tag===7){r(fe,le.sibling),Se=p(le,he.props.children),Se.return=fe,fe=Se;break e}}else if(le.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===V&&Si(Be)===le.type){r(fe,le.sibling),Se=p(le,he.props),xs(Se,he),Se.return=fe,fe=Se;break e}r(fe,le);break}else t(fe,le);le=le.sibling}he.type===S?(Se=gi(he.props.children,fe.mode,Se,he.key),Se.return=fe,fe=Se):(Se=jo(he.type,he.key,he.props,null,fe.mode,Se),xs(Se,he),Se.return=fe,fe=Se)}return O(fe);case C:e:{for(Be=he.key;le!==null;){if(le.key===Be)if(le.tag===4&&le.stateNode.containerInfo===he.containerInfo&&le.stateNode.implementation===he.implementation){r(fe,le.sibling),Se=p(le,he.children||[]),Se.return=fe,fe=Se;break e}else{r(fe,le);break}else t(fe,le);le=le.sibling}Se=Rc(he,fe.mode,Se),Se.return=fe,fe=Se}return O(fe);case V:return he=Si(he),ft(fe,le,he,Se)}if(G(he))return Oe(fe,le,he,Se);if(R(he)){if(Be=R(he),typeof Be!="function")throw Error(s(150));return he=Be.call(he),Ue(fe,le,he,Se)}if(typeof he.then=="function")return ft(fe,le,qo(he),Se);if(he.$$typeof===N)return ft(fe,le,Uo(fe,he),Se);Go(fe,he)}return typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint"?(he=""+he,le!==null&&le.tag===6?(r(fe,le.sibling),Se=p(le,he),Se.return=fe,fe=Se):(r(fe,le),Se=Ac(he,fe.mode,Se),Se.return=fe,fe=Se),O(fe)):r(fe,le)}return function(fe,le,he,Se){try{ws=0;var Be=ft(fe,le,he,Se);return la=null,Be}catch(Ie){if(Ie===oa||Ie===Po)throw Ie;var tt=hn(29,Ie,null,fe.mode);return tt.lanes=Se,tt.return=fe,tt}finally{}}}var wi=my(!0),gy=my(!1),Lr=!1;function Pc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hc(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 Br(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ur(e,t,r){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(at&2)!==0){var p=o.pending;return p===null?t.next=t:(t.next=p.next,p.next=t),o.pending=t,t=Io(e),$g(e,null,r),t}return Do(e,o,t,r),Io(e)}function Cs(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,og(e,r)}}function qc(e,t){var r=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var p=null,v=null;if(r=r.firstBaseUpdate,r!==null){do{var O={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};v===null?p=v=O:v=v.next=O,r=r.next}while(r!==null);v===null?p=v=t:v=v.next=t}else p=v=t;r={baseState:o.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:o.shared,callbacks:o.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Gc=!1;function ks(){if(Gc){var e=sa;if(e!==null)throw e}}function Ts(e,t,r,o){Gc=!1;var p=e.updateQueue;Lr=!1;var v=p.firstBaseUpdate,O=p.lastBaseUpdate,P=p.shared.pending;if(P!==null){p.shared.pending=null;var ne=P,me=ne.next;ne.next=null,O===null?v=me:O.next=me,O=ne;var ve=e.alternate;ve!==null&&(ve=ve.updateQueue,P=ve.lastBaseUpdate,P!==O&&(P===null?ve.firstBaseUpdate=me:P.next=me,ve.lastBaseUpdate=ne))}if(v!==null){var we=p.baseState;O=0,ve=me=ne=null,P=v;do{var ge=P.lane&-536870913,ye=ge!==P.lane;if(ye?(We&ge)===ge:(o&ge)===ge){ge!==0&&ge===aa&&(Gc=!0),ve!==null&&(ve=ve.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Oe=e,Ue=P;ge=t;var ft=r;switch(Ue.tag){case 1:if(Oe=Ue.payload,typeof Oe=="function"){we=Oe.call(ft,we,ge);break e}we=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ue.payload,ge=typeof Oe=="function"?Oe.call(ft,we,ge):Oe,ge==null)break e;we=b({},we,ge);break e;case 2:Lr=!0}}ge=P.callback,ge!==null&&(e.flags|=64,ye&&(e.flags|=8192),ye=p.callbacks,ye===null?p.callbacks=[ge]:ye.push(ge))}else ye={lane:ge,tag:P.tag,payload:P.payload,callback:P.callback,next:null},ve===null?(me=ve=ye,ne=we):ve=ve.next=ye,O|=ge;if(P=P.next,P===null){if(P=p.shared.pending,P===null)break;ye=P,P=ye.next,ye.next=null,p.lastBaseUpdate=ye,p.shared.pending=null}}while(!0);ve===null&&(ne=we),p.baseState=ne,p.firstBaseUpdate=me,p.lastBaseUpdate=ve,v===null&&(p.shared.lanes=0),Gr|=O,e.lanes=O,e.memoizedState=we}}function yy(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function by(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)yy(r[e],t)}var ua=z(null),Vo=z(0);function vy(e,t){e=gr,B(Vo,e),B(ua,t),gr=e|t.baseLanes}function Vc(){B(Vo,gr),B(ua,ua.current)}function Yc(){gr=Vo.current,I(ua),I(Vo)}var pn=z(null),Nn=null;function Fr(e){var t=e.alternate;B(wt,wt.current&1),B(pn,e),Nn===null&&(t===null||ua.current!==null||t.memoizedState!==null)&&(Nn=e)}function Zc(e){B(wt,wt.current),B(pn,e),Nn===null&&(Nn=e)}function _y(e){e.tag===22?(B(wt,wt.current),B(pn,e),Nn===null&&(Nn=e)):Pr()}function Pr(){B(wt,wt.current),B(pn,pn.current)}function mn(e){I(pn),Nn===e&&(Nn=null),I(wt)}var wt=z(0);function Yo(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||ed(r)||td(r)))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 lr=0,Ge=null,ut=null,Tt=null,Zo=!1,ca=!1,xi=!1,Xo=0,As=0,fa=null,JC=0;function _t(){throw Error(s(321))}function Xc(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!dn(e[r],t[r]))return!1;return!0}function Kc(e,t,r,o,p,v){return lr=v,Ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,J.H=e===null||e.memoizedState===null?r0:ff,xi=!1,v=r(o,p),xi=!1,ca&&(v=Ey(t,r,o,p)),Sy(e),v}function Sy(e){J.H=Os;var t=ut!==null&&ut.next!==null;if(lr=0,Tt=ut=Ge=null,Zo=!1,As=0,fa=null,t)throw Error(s(300));e===null||At||(e=e.dependencies,e!==null&&Bo(e)&&(At=!0))}function Ey(e,t,r,o){Ge=e;var p=0;do{if(ca&&(fa=null),As=0,ca=!1,25<=p)throw Error(s(301));if(p+=1,Tt=ut=null,e.updateQueue!=null){var v=e.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}J.H=i0,v=t(r,o)}while(ca);return v}function $C(){var e=J.H,t=e.useState()[0];return t=typeof t.then=="function"?Rs(t):t,e=e.useState()[0],(ut!==null?ut.memoizedState:null)!==e&&(Ge.flags|=1024),t}function Qc(){var e=Xo!==0;return Xo=0,e}function Wc(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function Jc(e){if(Zo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Zo=!1}lr=0,Tt=ut=Ge=null,ca=!1,As=Xo=0,fa=null}function Xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Ge.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function xt(){if(ut===null){var e=Ge.alternate;e=e!==null?e.memoizedState:null}else e=ut.next;var t=Tt===null?Ge.memoizedState:Tt.next;if(t!==null)Tt=t,ut=e;else{if(e===null)throw Ge.alternate===null?Error(s(467)):Error(s(310));ut=e,e={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},Tt===null?Ge.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function Ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rs(e){var t=As;return As+=1,fa===null&&(fa=[]),e=dy(fa,e,t),t=Ge,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,J.H=t===null||t.memoizedState===null?r0:ff),e}function Qo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Rs(e);if(e.$$typeof===N)return Ut(e)}throw Error(s(438,String(e)))}function $c(e){var t=null,r=Ge.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var o=Ge.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(p){return p.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=Ko(),Ge.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),o=0;o<e;o++)r[o]=W;return t.index++,r}function ur(e,t){return typeof t=="function"?t(e):t}function Wo(e){var t=xt();return ef(t,ut,e)}function ef(e,t,r){var o=e.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=r;var p=e.baseQueue,v=o.pending;if(v!==null){if(p!==null){var O=p.next;p.next=v.next,v.next=O}t.baseQueue=p=v,o.pending=null}if(v=e.baseState,p===null)e.memoizedState=v;else{t=p.next;var P=O=null,ne=null,me=t,ve=!1;do{var we=me.lane&-536870913;if(we!==me.lane?(We&we)===we:(lr&we)===we){var ge=me.revertLane;if(ge===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),we===aa&&(ve=!0);else if((lr&ge)===ge){me=me.next,ge===aa&&(ve=!0);continue}else we={lane:0,revertLane:me.revertLane,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},ne===null?(P=ne=we,O=v):ne=ne.next=we,Ge.lanes|=ge,Gr|=ge;we=me.action,xi&&r(v,we),v=me.hasEagerState?me.eagerState:r(v,we)}else ge={lane:we,revertLane:me.revertLane,gesture:me.gesture,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},ne===null?(P=ne=ge,O=v):ne=ne.next=ge,Ge.lanes|=we,Gr|=we;me=me.next}while(me!==null&&me!==t);if(ne===null?O=v:ne.next=P,!dn(v,e.memoizedState)&&(At=!0,ve&&(r=sa,r!==null)))throw r;e.memoizedState=v,e.baseState=O,e.baseQueue=ne,o.lastRenderedState=v}return p===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function tf(e){var t=xt(),r=t.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=e;var o=r.dispatch,p=r.pending,v=t.memoizedState;if(p!==null){r.pending=null;var O=p=p.next;do v=e(v,O.action),O=O.next;while(O!==p);dn(v,t.memoizedState)||(At=!0),t.memoizedState=v,t.baseQueue===null&&(t.baseState=v),r.lastRenderedState=v}return[v,o]}function wy(e,t,r){var o=Ge,p=xt(),v=et;if(v){if(r===void 0)throw Error(s(407));r=r()}else r=t();var O=!dn((ut||p).memoizedState,r);if(O&&(p.memoizedState=r,At=!0),p=p.queue,af(ky.bind(null,o,p,e),[e]),p.getSnapshot!==t||O||Tt!==null&&Tt.memoizedState.tag&1){if(o.flags|=2048,da(9,{destroy:void 0},Cy.bind(null,o,p,r,t),null),dt===null)throw Error(s(349));v||(lr&127)!==0||xy(o,t,r)}return r}function xy(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ge.updateQueue,t===null?(t=Ko(),Ge.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Cy(e,t,r,o){t.value=r,t.getSnapshot=o,Ty(t)&&Ay(e)}function ky(e,t,r){return r(function(){Ty(t)&&Ay(e)})}function Ty(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!dn(e,r)}catch{return!0}}function Ay(e){var t=mi(e,2);t!==null&&on(t,e,2)}function nf(e){var t=Xt();if(typeof e=="function"){var r=e;if(e=r(),xi){vt(!0);try{r()}finally{vt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:e},t}function Ry(e,t,r,o){return e.baseState=r,ef(e,ut,typeof o=="function"?o:ur)}function ek(e,t,r,o,p){if(el(e))throw Error(s(485));if(e=t.action,e!==null){var v={payload:p,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){v.listeners.push(O)}};J.T!==null?r(!0):v.isTransition=!1,o(v),r=t.pending,r===null?(v.next=t.pending=v,Ny(t,v)):(v.next=r.next,t.pending=r.next=v)}}function Ny(e,t){var r=t.action,o=t.payload,p=e.state;if(t.isTransition){var v=J.T,O={};J.T=O;try{var P=r(p,o),ne=J.S;ne!==null&&ne(O,P),Oy(e,t,P)}catch(me){rf(e,t,me)}finally{v!==null&&O.types!==null&&(v.types=O.types),J.T=v}}else try{v=r(p,o),Oy(e,t,v)}catch(me){rf(e,t,me)}}function Oy(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(o){zy(e,t,o)},function(o){return rf(e,t,o)}):zy(e,t,r)}function zy(e,t,r){t.status="fulfilled",t.value=r,My(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,Ny(e,r)))}function rf(e,t,r){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=r,My(t),t=t.next;while(t!==o)}e.action=null}function My(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Dy(e,t){return t}function Iy(e,t){if(et){var r=dt.formState;if(r!==null){e:{var o=Ge;if(et){if(mt){t:{for(var p=mt,v=Rn;p.nodeType!==8;){if(!v){p=null;break t}if(p=On(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){mt=On(p.nextSibling),o=p.data==="F!";break e}}Ir(o)}o=!1}o&&(t=r[0])}}return r=Xt(),r.memoizedState=r.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dy,lastRenderedState:t},r.queue=o,r=e0.bind(null,Ge,o),o.dispatch=r,o=nf(!1),v=cf.bind(null,Ge,!1,o.queue),o=Xt(),p={state:t,dispatch:null,action:e,pending:null},o.queue=p,r=ek.bind(null,Ge,p,v,r),p.dispatch=r,o.memoizedState=e,[t,r,!1]}function jy(e){var t=xt();return Ly(t,ut,e)}function Ly(e,t,r){if(t=ef(e,t,Dy)[0],e=Wo(ur)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=Rs(t)}catch(O){throw O===oa?Po:O}else o=t;t=xt();var p=t.queue,v=p.dispatch;return r!==t.memoizedState&&(Ge.flags|=2048,da(9,{destroy:void 0},tk.bind(null,p,r),null)),[o,v,e]}function tk(e,t){e.action=t}function By(e){var t=xt(),r=ut;if(r!==null)return Ly(t,r,e);xt(),t=t.memoizedState,r=xt();var o=r.queue.dispatch;return r.memoizedState=e,[t,o,!1]}function da(e,t,r,o){return e={tag:e,create:r,deps:o,inst:t,next:null},t=Ge.updateQueue,t===null&&(t=Ko(),Ge.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(o=r.next,r.next=e,e.next=o,t.lastEffect=e),e}function Uy(){return xt().memoizedState}function Jo(e,t,r,o){var p=Xt();Ge.flags|=e,p.memoizedState=da(1|t,{destroy:void 0},r,o===void 0?null:o)}function $o(e,t,r,o){var p=xt();o=o===void 0?null:o;var v=p.memoizedState.inst;ut!==null&&o!==null&&Xc(o,ut.memoizedState.deps)?p.memoizedState=da(t,v,r,o):(Ge.flags|=e,p.memoizedState=da(1|t,v,r,o))}function Fy(e,t){Jo(8390656,8,e,t)}function af(e,t){$o(2048,8,e,t)}function nk(e){Ge.flags|=4;var t=Ge.updateQueue;if(t===null)t=Ko(),Ge.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function Py(e){var t=xt().memoizedState;return nk({ref:t,nextImpl:e}),function(){if((at&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function Hy(e,t){return $o(4,2,e,t)}function qy(e,t){return $o(4,4,e,t)}function Gy(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Vy(e,t,r){r=r!=null?r.concat([e]):null,$o(4,4,Gy.bind(null,t,e),r)}function sf(){}function Yy(e,t){var r=xt();t=t===void 0?null:t;var o=r.memoizedState;return t!==null&&Xc(t,o[1])?o[0]:(r.memoizedState=[e,t],e)}function Zy(e,t){var r=xt();t=t===void 0?null:t;var o=r.memoizedState;if(t!==null&&Xc(t,o[1]))return o[0];if(o=e(),xi){vt(!0);try{e()}finally{vt(!1)}}return r.memoizedState=[o,t],o}function of(e,t,r){return r===void 0||(lr&1073741824)!==0&&(We&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=X0(),Ge.lanes|=e,Gr|=e,r)}function Xy(e,t,r,o){return dn(r,t)?r:ua.current!==null?(e=of(e,r,o),dn(e,t)||(At=!0),e):(lr&42)===0||(lr&1073741824)!==0&&(We&261930)===0?(At=!0,e.memoizedState=r):(e=X0(),Ge.lanes|=e,Gr|=e,t)}function Ky(e,t,r,o,p){var v=K.p;K.p=v!==0&&8>v?v:8;var O=J.T,P={};J.T=P,cf(e,!1,t,r);try{var ne=p(),me=J.S;if(me!==null&&me(P,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var ve=WC(ne,o);Ns(e,t,ve,bn(e))}else Ns(e,t,o,bn(e))}catch(we){Ns(e,t,{then:function(){},status:"rejected",reason:we},bn())}finally{K.p=v,O!==null&&P.types!==null&&(O.types=P.types),J.T=O}}function rk(){}function lf(e,t,r,o){if(e.tag!==5)throw Error(s(476));var p=Qy(e).queue;Ky(e,p,t,ue,r===null?rk:function(){return Wy(e),r(o)})}function Qy(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:ue},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Wy(e){var t=Qy(e);t.next===null&&(t=e.alternate.memoizedState),Ns(e,t.next.queue,{},bn())}function uf(){return Ut(Zs)}function Jy(){return xt().memoizedState}function $y(){return xt().memoizedState}function ik(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=bn();e=Br(r);var o=Ur(t,e,r);o!==null&&(on(o,t,r),Cs(o,t,r)),t={cache:Lc()},e.payload=t;return}t=t.return}}function ak(e,t,r){var o=bn();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},el(e)?t0(t,r):(r=kc(e,t,r,o),r!==null&&(on(r,e,o),n0(r,t,o)))}function e0(e,t,r){var o=bn();Ns(e,t,r,o)}function Ns(e,t,r,o){var p={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(el(e))t0(t,p);else{var v=e.alternate;if(e.lanes===0&&(v===null||v.lanes===0)&&(v=t.lastRenderedReducer,v!==null))try{var O=t.lastRenderedState,P=v(O,r);if(p.hasEagerState=!0,p.eagerState=P,dn(P,O))return Do(e,t,p,0),dt===null&&Mo(),!1}catch{}finally{}if(r=kc(e,t,p,o),r!==null)return on(r,e,o),n0(r,t,o),!0}return!1}function cf(e,t,r,o){if(o={lane:2,revertLane:Hf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},el(e)){if(t)throw Error(s(479))}else t=kc(e,r,o,2),t!==null&&on(t,e,2)}function el(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function t0(e,t){ca=Zo=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function n0(e,t,r){if((r&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,og(e,r)}}var Os={readContext:Ut,use:Qo,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t};Os.useEffectEvent=_t;var r0={readContext:Ut,use:Qo,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:Fy,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,Jo(4194308,4,Gy.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Jo(4194308,4,e,t)},useInsertionEffect:function(e,t){Jo(4,2,e,t)},useMemo:function(e,t){var r=Xt();t=t===void 0?null:t;var o=e();if(xi){vt(!0);try{e()}finally{vt(!1)}}return r.memoizedState=[o,t],o},useReducer:function(e,t,r){var o=Xt();if(r!==void 0){var p=r(t);if(xi){vt(!0);try{r(t)}finally{vt(!1)}}}else p=t;return o.memoizedState=o.baseState=p,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:p},o.queue=e,e=e.dispatch=ak.bind(null,Ge,e),[o.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:function(e){e=nf(e);var t=e.queue,r=e0.bind(null,Ge,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:sf,useDeferredValue:function(e,t){var r=Xt();return of(r,e,t)},useTransition:function(){var e=nf(!1);return e=Ky.bind(null,Ge,e.queue,!0,!1),Xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var o=Ge,p=Xt();if(et){if(r===void 0)throw Error(s(407));r=r()}else{if(r=t(),dt===null)throw Error(s(349));(We&127)!==0||xy(o,t,r)}p.memoizedState=r;var v={value:r,getSnapshot:t};return p.queue=v,Fy(ky.bind(null,o,v,e),[e]),o.flags|=2048,da(9,{destroy:void 0},Cy.bind(null,o,v,r,t),null),r},useId:function(){var e=Xt(),t=dt.identifierPrefix;if(et){var r=Vn,o=Gn;r=(o&~(1<<32-Pe(o)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Xo++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=JC++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:uf,useFormState:Iy,useActionState:Iy,useOptimistic:function(e){var t=Xt();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=cf.bind(null,Ge,!0,r),r.dispatch=t,[e,t]},useMemoCache:$c,useCacheRefresh:function(){return Xt().memoizedState=ik.bind(null,Ge)},useEffectEvent:function(e){var t=Xt(),r={impl:e};return t.memoizedState=r,function(){if((at&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},ff={readContext:Ut,use:Qo,useCallback:Yy,useContext:Ut,useEffect:af,useImperativeHandle:Vy,useInsertionEffect:Hy,useLayoutEffect:qy,useMemo:Zy,useReducer:Wo,useRef:Uy,useState:function(){return Wo(ur)},useDebugValue:sf,useDeferredValue:function(e,t){var r=xt();return Xy(r,ut.memoizedState,e,t)},useTransition:function(){var e=Wo(ur)[0],t=xt().memoizedState;return[typeof e=="boolean"?e:Rs(e),t]},useSyncExternalStore:wy,useId:Jy,useHostTransitionStatus:uf,useFormState:jy,useActionState:jy,useOptimistic:function(e,t){var r=xt();return Ry(r,ut,e,t)},useMemoCache:$c,useCacheRefresh:$y};ff.useEffectEvent=Py;var i0={readContext:Ut,use:Qo,useCallback:Yy,useContext:Ut,useEffect:af,useImperativeHandle:Vy,useInsertionEffect:Hy,useLayoutEffect:qy,useMemo:Zy,useReducer:tf,useRef:Uy,useState:function(){return tf(ur)},useDebugValue:sf,useDeferredValue:function(e,t){var r=xt();return ut===null?of(r,e,t):Xy(r,ut.memoizedState,e,t)},useTransition:function(){var e=tf(ur)[0],t=xt().memoizedState;return[typeof e=="boolean"?e:Rs(e),t]},useSyncExternalStore:wy,useId:Jy,useHostTransitionStatus:uf,useFormState:By,useActionState:By,useOptimistic:function(e,t){var r=xt();return ut!==null?Ry(r,ut,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:$c,useCacheRefresh:$y};i0.useEffectEvent=Py;function df(e,t,r,o){t=e.memoizedState,r=r(o,t),r=r==null?t:b({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var hf={enqueueSetState:function(e,t,r){e=e._reactInternals;var o=bn(),p=Br(o);p.payload=t,r!=null&&(p.callback=r),t=Ur(e,p,o),t!==null&&(on(t,e,o),Cs(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var o=bn(),p=Br(o);p.tag=1,p.payload=t,r!=null&&(p.callback=r),t=Ur(e,p,o),t!==null&&(on(t,e,o),Cs(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=bn(),o=Br(r);o.tag=2,t!=null&&(o.callback=t),t=Ur(e,o,r),t!==null&&(on(t,e,r),Cs(t,e,r))}};function a0(e,t,r,o,p,v,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,v,O):t.prototype&&t.prototype.isPureReactComponent?!ys(r,o)||!ys(p,v):!0}function s0(e,t,r,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,o),t.state!==e&&hf.enqueueReplaceState(t,t.state,null)}function Ci(e,t){var r=t;if("ref"in t){r={};for(var o in t)o!=="ref"&&(r[o]=t[o])}if(e=e.defaultProps){r===t&&(r=b({},r));for(var p in e)r[p]===void 0&&(r[p]=e[p])}return r}function o0(e){zo(e)}function l0(e){console.error(e)}function u0(e){zo(e)}function tl(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function c0(e,t,r){try{var o=e.onCaughtError;o(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function pf(e,t,r){return r=Br(r),r.tag=3,r.payload={element:null},r.callback=function(){tl(e,t)},r}function f0(e){return e=Br(e),e.tag=3,e}function d0(e,t,r,o){var p=r.type.getDerivedStateFromError;if(typeof p=="function"){var v=o.value;e.payload=function(){return p(v)},e.callback=function(){c0(t,r,o)}}var O=r.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(e.callback=function(){c0(t,r,o),typeof p!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var P=o.stack;this.componentDidCatch(o.value,{componentStack:P!==null?P:""})})}function sk(e,t,r,o,p){if(r.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=r.alternate,t!==null&&ia(t,r,p,!0),r=pn.current,r!==null){switch(r.tag){case 31:case 13:return Nn===null?hl():r.alternate===null&&St===0&&(St=3),r.flags&=-257,r.flags|=65536,r.lanes=p,o===Ho?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([o]):t.add(o),Uf(e,o,p)),!1;case 22:return r.flags|=65536,o===Ho?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([o]):r.add(o)),Uf(e,o,p)),!1}throw Error(s(435,r.tag))}return Uf(e,o,p),hl(),!1}if(et)return t=pn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=p,o!==zc&&(e=Error(s(422),{cause:o}),_s(kn(e,r)))):(o!==zc&&(t=Error(s(423),{cause:o}),_s(kn(t,r))),e=e.current.alternate,e.flags|=65536,p&=-p,e.lanes|=p,o=kn(o,r),p=pf(e.stateNode,o,p),qc(e,p),St!==4&&(St=2)),!1;var v=Error(s(520),{cause:o});if(v=kn(v,r),Us===null?Us=[v]:Us.push(v),St!==4&&(St=2),t===null)return!0;o=kn(o,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=p&-p,r.lanes|=e,e=pf(r.stateNode,o,e),qc(r,e),!1;case 1:if(t=r.type,v=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Vr===null||!Vr.has(v))))return r.flags|=65536,p&=-p,r.lanes|=p,p=f0(p),d0(p,e,r,o),qc(r,p),!1}r=r.return}while(r!==null);return!1}var mf=Error(s(461)),At=!1;function Ft(e,t,r,o){t.child=e===null?gy(t,null,r,o):wi(t,e.child,r,o)}function h0(e,t,r,o,p){r=r.render;var v=t.ref;if("ref"in o){var O={};for(var P in o)P!=="ref"&&(O[P]=o[P])}else O=o;return vi(t),o=Kc(e,t,r,O,v,p),P=Qc(),e!==null&&!At?(Wc(e,t,p),cr(e,t,p)):(et&&P&&Nc(t),t.flags|=1,Ft(e,t,o,p),t.child)}function p0(e,t,r,o,p){if(e===null){var v=r.type;return typeof v=="function"&&!Tc(v)&&v.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=v,m0(e,t,v,o,p)):(e=jo(r.type,null,o,t,t.mode,p),e.ref=t.ref,e.return=t,t.child=e)}if(v=e.child,!wf(e,p)){var O=v.memoizedProps;if(r=r.compare,r=r!==null?r:ys,r(O,o)&&e.ref===t.ref)return cr(e,t,p)}return t.flags|=1,e=ir(v,o),e.ref=t.ref,e.return=t,t.child=e}function m0(e,t,r,o,p){if(e!==null){var v=e.memoizedProps;if(ys(v,o)&&e.ref===t.ref)if(At=!1,t.pendingProps=o=v,wf(e,p))(e.flags&131072)!==0&&(At=!0);else return t.lanes=e.lanes,cr(e,t,p)}return gf(e,t,r,o,p)}function g0(e,t,r,o){var p=o.children,v=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(v=v!==null?v.baseLanes|r:r,e!==null){for(o=t.child=e.child,p=0;o!==null;)p=p|o.lanes|o.childLanes,o=o.sibling;o=p&~v}else o=0,t.child=null;return y0(e,t,v,r,o)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fo(t,v!==null?v.cachePool:null),v!==null?vy(t,v):Vc(),_y(t);else return o=t.lanes=536870912,y0(e,t,v!==null?v.baseLanes|r:r,r,o)}else v!==null?(Fo(t,v.cachePool),vy(t,v),Pr(),t.memoizedState=null):(e!==null&&Fo(t,null),Vc(),Pr());return Ft(e,t,p,r),t.child}function zs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function y0(e,t,r,o,p){var v=Uc();return v=v===null?null:{parent:kt._currentValue,pool:v},t.memoizedState={baseLanes:r,cachePool:v},e!==null&&Fo(t,null),Vc(),_y(t),e!==null&&ia(e,t,o,!0),t.childLanes=p,null}function nl(e,t){return t=il({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function b0(e,t,r){return wi(t,e.child,null,r),e=nl(t,t.pendingProps),e.flags|=2,mn(t),t.memoizedState=null,e}function ok(e,t,r){var o=t.pendingProps,p=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(et){if(o.mode==="hidden")return e=nl(t,o),t.lanes=536870912,zs(null,e);if(Zc(t),(e=mt)?(e=Nb(e,Rn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mr!==null?{id:Gn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},r=ty(e),r.return=t,t.child=r,Bt=t,mt=null)):e=null,e===null)throw Ir(t);return t.lanes=536870912,null}return nl(t,o)}var v=e.memoizedState;if(v!==null){var O=v.dehydrated;if(Zc(t),p)if(t.flags&256)t.flags&=-257,t=b0(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(At||ia(e,t,r,!1),p=(r&e.childLanes)!==0,At||p){if(o=dt,o!==null&&(O=lg(o,r),O!==0&&O!==v.retryLane))throw v.retryLane=O,mi(e,O),on(o,e,O),mf;hl(),t=b0(e,t,r)}else e=v.treeContext,mt=On(O.nextSibling),Bt=t,et=!0,Dr=null,Rn=!1,e!==null&&iy(t,e),t=nl(t,o),t.flags|=4096;return t}return e=ir(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function rl(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function gf(e,t,r,o,p){return vi(t),r=Kc(e,t,r,o,void 0,p),o=Qc(),e!==null&&!At?(Wc(e,t,p),cr(e,t,p)):(et&&o&&Nc(t),t.flags|=1,Ft(e,t,r,p),t.child)}function v0(e,t,r,o,p,v){return vi(t),t.updateQueue=null,r=Ey(t,o,r,p),Sy(e),o=Qc(),e!==null&&!At?(Wc(e,t,v),cr(e,t,v)):(et&&o&&Nc(t),t.flags|=1,Ft(e,t,r,v),t.child)}function _0(e,t,r,o,p){if(vi(t),t.stateNode===null){var v=ea,O=r.contextType;typeof O=="object"&&O!==null&&(v=Ut(O)),v=new r(o,v),t.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=hf,t.stateNode=v,v._reactInternals=t,v=t.stateNode,v.props=o,v.state=t.memoizedState,v.refs={},Pc(t),O=r.contextType,v.context=typeof O=="object"&&O!==null?Ut(O):ea,v.state=t.memoizedState,O=r.getDerivedStateFromProps,typeof O=="function"&&(df(t,r,O,o),v.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(O=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),O!==v.state&&hf.enqueueReplaceState(v,v.state,null),Ts(t,o,v,p),ks(),v.state=t.memoizedState),typeof v.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){v=t.stateNode;var P=t.memoizedProps,ne=Ci(r,P);v.props=ne;var me=v.context,ve=r.contextType;O=ea,typeof ve=="object"&&ve!==null&&(O=Ut(ve));var we=r.getDerivedStateFromProps;ve=typeof we=="function"||typeof v.getSnapshotBeforeUpdate=="function",P=t.pendingProps!==P,ve||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(P||me!==O)&&s0(t,v,o,O),Lr=!1;var ge=t.memoizedState;v.state=ge,Ts(t,o,v,p),ks(),me=t.memoizedState,P||ge!==me||Lr?(typeof we=="function"&&(df(t,r,we,o),me=t.memoizedState),(ne=Lr||a0(t,r,ne,o,ge,me,O))?(ve||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=me),v.props=o,v.state=me,v.context=O,o=ne):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{v=t.stateNode,Hc(e,t),O=t.memoizedProps,ve=Ci(r,O),v.props=ve,we=t.pendingProps,ge=v.context,me=r.contextType,ne=ea,typeof me=="object"&&me!==null&&(ne=Ut(me)),P=r.getDerivedStateFromProps,(me=typeof P=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(O!==we||ge!==ne)&&s0(t,v,o,ne),Lr=!1,ge=t.memoizedState,v.state=ge,Ts(t,o,v,p),ks();var ye=t.memoizedState;O!==we||ge!==ye||Lr||e!==null&&e.dependencies!==null&&Bo(e.dependencies)?(typeof P=="function"&&(df(t,r,P,o),ye=t.memoizedState),(ve=Lr||a0(t,r,ve,o,ge,ye,ne)||e!==null&&e.dependencies!==null&&Bo(e.dependencies))?(me||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(o,ye,ne),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(o,ye,ne)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||O===e.memoizedProps&&ge===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ge===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=ye),v.props=o,v.state=ye,v.context=ne,o=ve):(typeof v.componentDidUpdate!="function"||O===e.memoizedProps&&ge===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ge===e.memoizedState||(t.flags|=1024),o=!1)}return v=o,rl(e,t),o=(t.flags&128)!==0,v||o?(v=t.stateNode,r=o&&typeof r.getDerivedStateFromError!="function"?null:v.render(),t.flags|=1,e!==null&&o?(t.child=wi(t,e.child,null,p),t.child=wi(t,null,r,p)):Ft(e,t,r,p),t.memoizedState=v.state,e=t.child):e=cr(e,t,p),e}function S0(e,t,r,o){return yi(),t.flags|=256,Ft(e,t,r,o),t.child}var yf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bf(e){return{baseLanes:e,cachePool:cy()}}function vf(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=yn),e}function E0(e,t,r){var o=t.pendingProps,p=!1,v=(t.flags&128)!==0,O;if((O=v)||(O=e!==null&&e.memoizedState===null?!1:(wt.current&2)!==0),O&&(p=!0,t.flags&=-129),O=(t.flags&32)!==0,t.flags&=-33,e===null){if(et){if(p?Fr(t):Pr(),(e=mt)?(e=Nb(e,Rn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mr!==null?{id:Gn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},r=ty(e),r.return=t,t.child=r,Bt=t,mt=null)):e=null,e===null)throw Ir(t);return td(e)?t.lanes=32:t.lanes=536870912,null}var P=o.children;return o=o.fallback,p?(Pr(),p=t.mode,P=il({mode:"hidden",children:P},p),o=gi(o,p,r,null),P.return=t,o.return=t,P.sibling=o,t.child=P,o=t.child,o.memoizedState=bf(r),o.childLanes=vf(e,O,r),t.memoizedState=yf,zs(null,o)):(Fr(t),_f(t,P))}var ne=e.memoizedState;if(ne!==null&&(P=ne.dehydrated,P!==null)){if(v)t.flags&256?(Fr(t),t.flags&=-257,t=Sf(e,t,r)):t.memoizedState!==null?(Pr(),t.child=e.child,t.flags|=128,t=null):(Pr(),P=o.fallback,p=t.mode,o=il({mode:"visible",children:o.children},p),P=gi(P,p,r,null),P.flags|=2,o.return=t,P.return=t,o.sibling=P,t.child=o,wi(t,e.child,null,r),o=t.child,o.memoizedState=bf(r),o.childLanes=vf(e,O,r),t.memoizedState=yf,t=zs(null,o));else if(Fr(t),td(P)){if(O=P.nextSibling&&P.nextSibling.dataset,O)var me=O.dgst;O=me,o=Error(s(419)),o.stack="",o.digest=O,_s({value:o,source:null,stack:null}),t=Sf(e,t,r)}else if(At||ia(e,t,r,!1),O=(r&e.childLanes)!==0,At||O){if(O=dt,O!==null&&(o=lg(O,r),o!==0&&o!==ne.retryLane))throw ne.retryLane=o,mi(e,o),on(O,e,o),mf;ed(P)||hl(),t=Sf(e,t,r)}else ed(P)?(t.flags|=192,t.child=e.child,t=null):(e=ne.treeContext,mt=On(P.nextSibling),Bt=t,et=!0,Dr=null,Rn=!1,e!==null&&iy(t,e),t=_f(t,o.children),t.flags|=4096);return t}return p?(Pr(),P=o.fallback,p=t.mode,ne=e.child,me=ne.sibling,o=ir(ne,{mode:"hidden",children:o.children}),o.subtreeFlags=ne.subtreeFlags&65011712,me!==null?P=ir(me,P):(P=gi(P,p,r,null),P.flags|=2),P.return=t,o.return=t,o.sibling=P,t.child=o,zs(null,o),o=t.child,P=e.child.memoizedState,P===null?P=bf(r):(p=P.cachePool,p!==null?(ne=kt._currentValue,p=p.parent!==ne?{parent:ne,pool:ne}:p):p=cy(),P={baseLanes:P.baseLanes|r,cachePool:p}),o.memoizedState=P,o.childLanes=vf(e,O,r),t.memoizedState=yf,zs(e.child,o)):(Fr(t),r=e.child,e=r.sibling,r=ir(r,{mode:"visible",children:o.children}),r.return=t,r.sibling=null,e!==null&&(O=t.deletions,O===null?(t.deletions=[e],t.flags|=16):O.push(e)),t.child=r,t.memoizedState=null,r)}function _f(e,t){return t=il({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function il(e,t){return e=hn(22,e,null,t),e.lanes=0,e}function Sf(e,t,r){return wi(t,e.child,null,r),e=_f(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function w0(e,t,r){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),Ic(e.return,t,r)}function Ef(e,t,r,o,p,v){var O=e.memoizedState;O===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:r,tailMode:p,treeForkCount:v}:(O.isBackwards=t,O.rendering=null,O.renderingStartTime=0,O.last=o,O.tail=r,O.tailMode=p,O.treeForkCount=v)}function x0(e,t,r){var o=t.pendingProps,p=o.revealOrder,v=o.tail;o=o.children;var O=wt.current,P=(O&2)!==0;if(P?(O=O&1|2,t.flags|=128):O&=1,B(wt,O),Ft(e,t,o,r),o=et?vs:0,!P&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&w0(e,r,t);else if(e.tag===19)w0(e,r,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(p){case"forwards":for(r=t.child,p=null;r!==null;)e=r.alternate,e!==null&&Yo(e)===null&&(p=r),r=r.sibling;r=p,r===null?(p=t.child,t.child=null):(p=r.sibling,r.sibling=null),Ef(t,!1,p,r,v,o);break;case"backwards":case"unstable_legacy-backwards":for(r=null,p=t.child,t.child=null;p!==null;){if(e=p.alternate,e!==null&&Yo(e)===null){t.child=p;break}e=p.sibling,p.sibling=r,r=p,p=e}Ef(t,!0,r,null,v,o);break;case"together":Ef(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function cr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Gr|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(ia(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,r=ir(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=ir(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function wf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Bo(e)))}function lk(e,t,r){switch(t.tag){case 3:Ce(t,t.stateNode.containerInfo),jr(t,kt,e.memoizedState.cache),yi();break;case 27:case 5:je(t);break;case 4:Ce(t,t.stateNode.containerInfo);break;case 10:jr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Zc(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Fr(t),t.flags|=128,null):(r&t.child.childLanes)!==0?E0(e,t,r):(Fr(t),e=cr(e,t,r),e!==null?e.sibling:null);Fr(t);break;case 19:var p=(e.flags&128)!==0;if(o=(r&t.childLanes)!==0,o||(ia(e,t,r,!1),o=(r&t.childLanes)!==0),p){if(o)return x0(e,t,r);t.flags|=128}if(p=t.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),B(wt,wt.current),o)break;return null;case 22:return t.lanes=0,g0(e,t,r,t.pendingProps);case 24:jr(t,kt,e.memoizedState.cache)}return cr(e,t,r)}function C0(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)At=!0;else{if(!wf(e,r)&&(t.flags&128)===0)return At=!1,lk(e,t,r);At=(e.flags&131072)!==0}else At=!1,et&&(t.flags&1048576)!==0&&ry(t,vs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=Si(t.elementType),t.type=e,typeof e=="function")Tc(e)?(o=Ci(e,o),t.tag=1,t=_0(null,t,e,o,r)):(t.tag=0,t=gf(null,t,e,o,r));else{if(e!=null){var p=e.$$typeof;if(p===j){t.tag=11,t=h0(null,t,e,o,r);break e}else if(p===L){t.tag=14,t=p0(null,t,e,o,r);break e}}throw t=E(e)||e,Error(s(306,t,""))}}return t;case 0:return gf(e,t,t.type,t.pendingProps,r);case 1:return o=t.type,p=Ci(o,t.pendingProps),_0(e,t,o,p,r);case 3:e:{if(Ce(t,t.stateNode.containerInfo),e===null)throw Error(s(387));o=t.pendingProps;var v=t.memoizedState;p=v.element,Hc(e,t),Ts(t,o,null,r);var O=t.memoizedState;if(o=O.cache,jr(t,kt,o),o!==v.cache&&jc(t,[kt],r,!0),ks(),o=O.element,v.isDehydrated)if(v={element:o,isDehydrated:!1,cache:O.cache},t.updateQueue.baseState=v,t.memoizedState=v,t.flags&256){t=S0(e,t,o,r);break e}else if(o!==p){p=kn(Error(s(424)),t),_s(p),t=S0(e,t,o,r);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(mt=On(e.firstChild),Bt=t,et=!0,Dr=null,Rn=!0,r=gy(t,null,o,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(yi(),o===p){t=cr(e,t,r);break e}Ft(e,t,o,r)}t=t.child}return t;case 26:return rl(e,t),e===null?(r=jb(t.type,null,t.pendingProps,null))?t.memoizedState=r:et||(r=t.type,e=t.pendingProps,o=_l(xe.current).createElement(r),o[Lt]=t,o[en]=e,Pt(o,r,e),Dt(o),t.stateNode=o):t.memoizedState=jb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return je(t),e===null&&et&&(o=t.stateNode=Mb(t.type,t.pendingProps,xe.current),Bt=t,Rn=!0,p=mt,Kr(t.type)?(nd=p,mt=On(o.firstChild)):mt=p),Ft(e,t,t.pendingProps.children,r),rl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&et&&((p=o=mt)&&(o=Bk(o,t.type,t.pendingProps,Rn),o!==null?(t.stateNode=o,Bt=t,mt=On(o.firstChild),Rn=!1,p=!0):p=!1),p||Ir(t)),je(t),p=t.type,v=t.pendingProps,O=e!==null?e.memoizedProps:null,o=v.children,Wf(p,v)?o=null:O!==null&&Wf(p,O)&&(t.flags|=32),t.memoizedState!==null&&(p=Kc(e,t,$C,null,null,r),Zs._currentValue=p),rl(e,t),Ft(e,t,o,r),t.child;case 6:return e===null&&et&&((e=r=mt)&&(r=Uk(r,t.pendingProps,Rn),r!==null?(t.stateNode=r,Bt=t,mt=null,e=!0):e=!1),e||Ir(t)),null;case 13:return E0(e,t,r);case 4:return Ce(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=wi(t,null,o,r):Ft(e,t,o,r),t.child;case 11:return h0(e,t,t.type,t.pendingProps,r);case 7:return Ft(e,t,t.pendingProps,r),t.child;case 8:return Ft(e,t,t.pendingProps.children,r),t.child;case 12:return Ft(e,t,t.pendingProps.children,r),t.child;case 10:return o=t.pendingProps,jr(t,t.type,o.value),Ft(e,t,o.children,r),t.child;case 9:return p=t.type._context,o=t.pendingProps.children,vi(t),p=Ut(p),o=o(p),t.flags|=1,Ft(e,t,o,r),t.child;case 14:return p0(e,t,t.type,t.pendingProps,r);case 15:return m0(e,t,t.type,t.pendingProps,r);case 19:return x0(e,t,r);case 31:return ok(e,t,r);case 22:return g0(e,t,r,t.pendingProps);case 24:return vi(t),o=Ut(kt),e===null?(p=Uc(),p===null&&(p=dt,v=Lc(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=r),p=v),t.memoizedState={parent:o,cache:p},Pc(t),jr(t,kt,p)):((e.lanes&r)!==0&&(Hc(e,t),Ts(t,null,null,r),ks()),p=e.memoizedState,v=t.memoizedState,p.parent!==o?(p={parent:o,cache:o},t.memoizedState=p,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=p),jr(t,kt,o)):(o=v.cache,jr(t,kt,o),o!==p.cache&&jc(t,[kt],r,!0))),Ft(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function fr(e){e.flags|=4}function xf(e,t,r,o,p){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(p&335544128)===p)if(e.stateNode.complete)e.flags|=8192;else if(J0())e.flags|=8192;else throw Ei=Ho,Fc}else e.flags&=-16777217}function k0(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Pb(t))if(J0())e.flags|=8192;else throw Ei=Ho,Fc}function al(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ag():536870912,e.lanes|=t,ga|=t)}function Ms(e,t){if(!et)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,o=0;if(t)for(var p=e.child;p!==null;)r|=p.lanes|p.childLanes,o|=p.subtreeFlags&65011712,o|=p.flags&65011712,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)r|=p.lanes|p.childLanes,o|=p.subtreeFlags,o|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=o,e.childLanes=r,t}function uk(e,t,r){var o=t.pendingProps;switch(Oc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return r=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),or(kt),ke(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ra(t)?fr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Mc())),gt(t),null;case 26:var p=t.type,v=t.memoizedState;return e===null?(fr(t),v!==null?(gt(t),k0(t,v)):(gt(t),xf(t,p,null,o,r))):v?v!==e.memoizedState?(fr(t),gt(t),k0(t,v)):(gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&fr(t),gt(t),xf(t,p,e,o,r)),null;case 27:if(_e(t),r=xe.current,p=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&fr(t);else{if(!o){if(t.stateNode===null)throw Error(s(166));return gt(t),null}e=te.current,ra(t)?ay(t):(e=Mb(p,o,r),t.stateNode=e,fr(t))}return gt(t),null;case 5:if(_e(t),p=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&fr(t);else{if(!o){if(t.stateNode===null)throw Error(s(166));return gt(t),null}if(v=te.current,ra(t))ay(t);else{var O=_l(xe.current);switch(v){case 1:v=O.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=O.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=O.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=O.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=O.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof o.is=="string"?O.createElement("select",{is:o.is}):O.createElement("select"),o.multiple?v.multiple=!0:o.size&&(v.size=o.size);break;default:v=typeof o.is=="string"?O.createElement(p,{is:o.is}):O.createElement(p)}}v[Lt]=t,v[en]=o;e:for(O=t.child;O!==null;){if(O.tag===5||O.tag===6)v.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===t)break e;for(;O.sibling===null;){if(O.return===null||O.return===t)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}t.stateNode=v;e:switch(Pt(v,p,o),p){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&fr(t)}}return gt(t),xf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&fr(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(s(166));if(e=xe.current,ra(t)){if(e=t.stateNode,r=t.memoizedProps,o=null,p=Bt,p!==null)switch(p.tag){case 27:case 5:o=p.memoizedProps}e[Lt]=t,e=!!(e.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||Eb(e.nodeValue,r)),e||Ir(t,!0)}else e=_l(e).createTextNode(o),e[Lt]=t,t.stateNode=e}return gt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(o=ra(t),r!==null){if(e===null){if(!o)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[Lt]=t}else yi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else r=Mc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(mn(t),t):(mn(t),null);if((t.flags&128)!==0)throw Error(s(558))}return gt(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(p=ra(t),o!==null&&o.dehydrated!==null){if(e===null){if(!p)throw Error(s(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[Lt]=t}else yi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),p=!1}else p=Mc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=p),p=!0;if(!p)return t.flags&256?(mn(t),t):(mn(t),null)}return mn(t),(t.flags&128)!==0?(t.lanes=r,t):(r=o!==null,e=e!==null&&e.memoizedState!==null,r&&(o=t.child,p=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(p=o.alternate.memoizedState.cachePool.pool),v=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(v=o.memoizedState.cachePool.pool),v!==p&&(o.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),al(t,t.updateQueue),gt(t),null);case 4:return ke(),e===null&&Yf(t.stateNode.containerInfo),gt(t),null;case 10:return or(t.type),gt(t),null;case 19:if(I(wt),o=t.memoizedState,o===null)return gt(t),null;if(p=(t.flags&128)!==0,v=o.rendering,v===null)if(p)Ms(o,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=Yo(e),v!==null){for(t.flags|=128,Ms(o,!1),e=v.updateQueue,t.updateQueue=e,al(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)ey(r,e),r=r.sibling;return B(wt,wt.current&1|2),et&&ar(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&pe()>cl&&(t.flags|=128,p=!0,Ms(o,!1),t.lanes=4194304)}else{if(!p)if(e=Yo(v),e!==null){if(t.flags|=128,p=!0,e=e.updateQueue,t.updateQueue=e,al(t,e),Ms(o,!0),o.tail===null&&o.tailMode==="hidden"&&!v.alternate&&!et)return gt(t),null}else 2*pe()-o.renderingStartTime>cl&&r!==536870912&&(t.flags|=128,p=!0,Ms(o,!1),t.lanes=4194304);o.isBackwards?(v.sibling=t.child,t.child=v):(e=o.last,e!==null?e.sibling=v:t.child=v,o.last=v)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=pe(),e.sibling=null,r=wt.current,B(wt,p?r&1|2:r&1),et&&ar(t,o.treeForkCount),e):(gt(t),null);case 22:case 23:return mn(t),Yc(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(r&536870912)!==0&&(t.flags&128)===0&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),r=t.updateQueue,r!==null&&al(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==r&&(t.flags|=2048),e!==null&&I(_i),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),or(kt),gt(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function ck(e,t){switch(Oc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return or(kt),ke(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(mn(t),t.alternate===null)throw Error(s(340));yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(wt),null;case 4:return ke(),null;case 10:return or(t.type),null;case 22:case 23:return mn(t),Yc(),e!==null&&I(_i),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return or(kt),null;case 25:return null;default:return null}}function T0(e,t){switch(Oc(t),t.tag){case 3:or(kt),ke();break;case 26:case 27:case 5:_e(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&mn(t);break;case 13:mn(t);break;case 19:I(wt);break;case 10:or(t.type);break;case 22:case 23:mn(t),Yc(),e!==null&&I(_i);break;case 24:or(kt)}}function Ds(e,t){try{var r=t.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var p=o.next;r=p;do{if((r.tag&e)===e){o=void 0;var v=r.create,O=r.inst;o=v(),O.destroy=o}r=r.next}while(r!==p)}}catch(P){lt(t,t.return,P)}}function Hr(e,t,r){try{var o=t.updateQueue,p=o!==null?o.lastEffect:null;if(p!==null){var v=p.next;o=v;do{if((o.tag&e)===e){var O=o.inst,P=O.destroy;if(P!==void 0){O.destroy=void 0,p=t;var ne=r,me=P;try{me()}catch(ve){lt(p,ne,ve)}}}o=o.next}while(o!==v)}}catch(ve){lt(t,t.return,ve)}}function A0(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{by(t,r)}catch(o){lt(e,e.return,o)}}}function R0(e,t,r){r.props=Ci(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(o){lt(e,t,o)}}function Is(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof r=="function"?e.refCleanup=r(o):r.current=o}}catch(p){lt(e,t,p)}}function Yn(e,t){var r=e.ref,o=e.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(p){lt(e,t,p)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(p){lt(e,t,p)}else r.current=null}function N0(e){var t=e.type,r=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(p){lt(e,e.return,p)}}function Cf(e,t,r){try{var o=e.stateNode;zk(o,e.type,r,t),o[en]=t}catch(p){lt(e,e.return,p)}}function O0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Kr(e.type)||e.tag===4}function kf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||O0(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&&Kr(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 Tf(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=nr));else if(o!==4&&(o===27&&Kr(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(Tf(e,t,r),e=e.sibling;e!==null;)Tf(e,t,r),e=e.sibling}function sl(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(o!==4&&(o===27&&Kr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(sl(e,t,r),e=e.sibling;e!==null;)sl(e,t,r),e=e.sibling}function z0(e){var t=e.stateNode,r=e.memoizedProps;try{for(var o=e.type,p=t.attributes;p.length;)t.removeAttributeNode(p[0]);Pt(t,o,r),t[Lt]=e,t[en]=r}catch(v){lt(e,e.return,v)}}var dr=!1,Rt=!1,Af=!1,M0=typeof WeakSet=="function"?WeakSet:Set,It=null;function fk(e,t){if(e=e.containerInfo,Kf=Tl,e=Vg(e),_c(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var p=o.anchorOffset,v=o.focusNode;o=o.focusOffset;try{r.nodeType,v.nodeType}catch{r=null;break e}var O=0,P=-1,ne=-1,me=0,ve=0,we=e,ge=null;t:for(;;){for(var ye;we!==r||p!==0&&we.nodeType!==3||(P=O+p),we!==v||o!==0&&we.nodeType!==3||(ne=O+o),we.nodeType===3&&(O+=we.nodeValue.length),(ye=we.firstChild)!==null;)ge=we,we=ye;for(;;){if(we===e)break t;if(ge===r&&++me===p&&(P=O),ge===v&&++ve===o&&(ne=O),(ye=we.nextSibling)!==null)break;we=ge,ge=we.parentNode}we=ye}r=P===-1||ne===-1?null:{start:P,end:ne}}else r=null}r=r||{start:0,end:0}}else r=null;for(Qf={focusedElem:e,selectionRange:r},Tl=!1,It=t;It!==null;)if(t=It,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,It=e;else for(;It!==null;){switch(t=It,v=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(r=0;r<e.length;r++)p=e[r],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&v!==null){e=void 0,r=t,p=v.memoizedProps,v=v.memoizedState,o=r.stateNode;try{var Oe=Ci(r.type,p);e=o.getSnapshotBeforeUpdate(Oe,v),o.__reactInternalSnapshotBeforeUpdate=e}catch(Ue){lt(r,r.return,Ue)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)$f(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":$f(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(s(163))}if(e=t.sibling,e!==null){e.return=t.return,It=e;break}It=t.return}}function D0(e,t,r){var o=r.flags;switch(r.tag){case 0:case 11:case 15:pr(e,r),o&4&&Ds(5,r);break;case 1:if(pr(e,r),o&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(O){lt(r,r.return,O)}else{var p=Ci(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(p,t,e.__reactInternalSnapshotBeforeUpdate)}catch(O){lt(r,r.return,O)}}o&64&&A0(r),o&512&&Is(r,r.return);break;case 3:if(pr(e,r),o&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{by(e,t)}catch(O){lt(r,r.return,O)}}break;case 27:t===null&&o&4&&z0(r);case 26:case 5:pr(e,r),t===null&&o&4&&N0(r),o&512&&Is(r,r.return);break;case 12:pr(e,r);break;case 31:pr(e,r),o&4&&L0(e,r);break;case 13:pr(e,r),o&4&&B0(e,r),o&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=_k.bind(null,r),Fk(e,r))));break;case 22:if(o=r.memoizedState!==null||dr,!o){t=t!==null&&t.memoizedState!==null||Rt,p=dr;var v=Rt;dr=o,(Rt=t)&&!v?mr(e,r,(r.subtreeFlags&8772)!==0):pr(e,r),dr=p,Rt=v}break;case 30:break;default:pr(e,r)}}function I0(e){var t=e.alternate;t!==null&&(e.alternate=null,I0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&rc(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 yt=null,nn=!1;function hr(e,t,r){for(r=r.child;r!==null;)j0(e,t,r),r=r.sibling}function j0(e,t,r){if(st&&typeof st.onCommitFiberUnmount=="function")try{st.onCommitFiberUnmount(Le,r)}catch{}switch(r.tag){case 26:Rt||Yn(r,t),hr(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Rt||Yn(r,t);var o=yt,p=nn;Kr(r.type)&&(yt=r.stateNode,nn=!1),hr(e,t,r),Gs(r.stateNode),yt=o,nn=p;break;case 5:Rt||Yn(r,t);case 6:if(o=yt,p=nn,yt=null,hr(e,t,r),yt=o,nn=p,yt!==null)if(nn)try{(yt.nodeType===9?yt.body:yt.nodeName==="HTML"?yt.ownerDocument.body:yt).removeChild(r.stateNode)}catch(v){lt(r,t,v)}else try{yt.removeChild(r.stateNode)}catch(v){lt(r,t,v)}break;case 18:yt!==null&&(nn?(e=yt,Ab(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),xa(e)):Ab(yt,r.stateNode));break;case 4:o=yt,p=nn,yt=r.stateNode.containerInfo,nn=!0,hr(e,t,r),yt=o,nn=p;break;case 0:case 11:case 14:case 15:Hr(2,r,t),Rt||Hr(4,r,t),hr(e,t,r);break;case 1:Rt||(Yn(r,t),o=r.stateNode,typeof o.componentWillUnmount=="function"&&R0(r,t,o)),hr(e,t,r);break;case 21:hr(e,t,r);break;case 22:Rt=(o=Rt)||r.memoizedState!==null,hr(e,t,r),Rt=o;break;default:hr(e,t,r)}}function L0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{xa(e)}catch(r){lt(t,t.return,r)}}}function B0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{xa(e)}catch(r){lt(t,t.return,r)}}function dk(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new M0),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new M0),t;default:throw Error(s(435,e.tag))}}function ol(e,t){var r=dk(e);t.forEach(function(o){if(!r.has(o)){r.add(o);var p=Sk.bind(null,e,o);o.then(p,p)}})}function rn(e,t){var r=t.deletions;if(r!==null)for(var o=0;o<r.length;o++){var p=r[o],v=e,O=t,P=O;e:for(;P!==null;){switch(P.tag){case 27:if(Kr(P.type)){yt=P.stateNode,nn=!1;break e}break;case 5:yt=P.stateNode,nn=!1;break e;case 3:case 4:yt=P.stateNode.containerInfo,nn=!0;break e}P=P.return}if(yt===null)throw Error(s(160));j0(v,O,p),yt=null,nn=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)U0(t,e),t=t.sibling}var In=null;function U0(e,t){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:rn(t,e),an(e),o&4&&(Hr(3,e,e.return),Ds(3,e),Hr(5,e,e.return));break;case 1:rn(t,e),an(e),o&512&&(Rt||r===null||Yn(r,r.return)),o&64&&dr&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?o:r.concat(o))));break;case 26:var p=In;if(rn(t,e),an(e),o&512&&(Rt||r===null||Yn(r,r.return)),o&4){var v=r!==null?r.memoizedState:null;if(o=e.memoizedState,r===null)if(o===null)if(e.stateNode===null){e:{o=e.type,r=e.memoizedProps,p=p.ownerDocument||p;t:switch(o){case"title":v=p.getElementsByTagName("title")[0],(!v||v[ls]||v[Lt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(o),p.head.insertBefore(v,p.querySelector("head > title"))),Pt(v,o,r),v[Lt]=e,Dt(v),o=v;break e;case"link":var O=Ub("link","href",p).get(o+(r.href||""));if(O){for(var P=0;P<O.length;P++)if(v=O[P],v.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&v.getAttribute("rel")===(r.rel==null?null:r.rel)&&v.getAttribute("title")===(r.title==null?null:r.title)&&v.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){O.splice(P,1);break t}}v=p.createElement(o),Pt(v,o,r),p.head.appendChild(v);break;case"meta":if(O=Ub("meta","content",p).get(o+(r.content||""))){for(P=0;P<O.length;P++)if(v=O[P],v.getAttribute("content")===(r.content==null?null:""+r.content)&&v.getAttribute("name")===(r.name==null?null:r.name)&&v.getAttribute("property")===(r.property==null?null:r.property)&&v.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&v.getAttribute("charset")===(r.charSet==null?null:r.charSet)){O.splice(P,1);break t}}v=p.createElement(o),Pt(v,o,r),p.head.appendChild(v);break;default:throw Error(s(468,o))}v[Lt]=e,Dt(v),o=v}e.stateNode=o}else Fb(p,e.type,e.stateNode);else e.stateNode=Bb(p,o,e.memoizedProps);else v!==o?(v===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):v.count--,o===null?Fb(p,e.type,e.stateNode):Bb(p,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Cf(e,e.memoizedProps,r.memoizedProps)}break;case 27:rn(t,e),an(e),o&512&&(Rt||r===null||Yn(r,r.return)),r!==null&&o&4&&Cf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(rn(t,e),an(e),o&512&&(Rt||r===null||Yn(r,r.return)),e.flags&32){p=e.stateNode;try{Zi(p,"")}catch(Oe){lt(e,e.return,Oe)}}o&4&&e.stateNode!=null&&(p=e.memoizedProps,Cf(e,p,r!==null?r.memoizedProps:p)),o&1024&&(Af=!0);break;case 6:if(rn(t,e),an(e),o&4){if(e.stateNode===null)throw Error(s(162));o=e.memoizedProps,r=e.stateNode;try{r.nodeValue=o}catch(Oe){lt(e,e.return,Oe)}}break;case 3:if(wl=null,p=In,In=Sl(t.containerInfo),rn(t,e),In=p,an(e),o&4&&r!==null&&r.memoizedState.isDehydrated)try{xa(t.containerInfo)}catch(Oe){lt(e,e.return,Oe)}Af&&(Af=!1,F0(e));break;case 4:o=In,In=Sl(e.stateNode.containerInfo),rn(t,e),an(e),In=o;break;case 12:rn(t,e),an(e);break;case 31:rn(t,e),an(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ol(e,o)));break;case 13:rn(t,e),an(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(ul=pe()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ol(e,o)));break;case 22:p=e.memoizedState!==null;var ne=r!==null&&r.memoizedState!==null,me=dr,ve=Rt;if(dr=me||p,Rt=ve||ne,rn(t,e),Rt=ve,dr=me,an(e),o&8192)e:for(t=e.stateNode,t._visibility=p?t._visibility&-2:t._visibility|1,p&&(r===null||ne||dr||Rt||ki(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){ne=r=t;try{if(v=ne.stateNode,p)O=v.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{P=ne.stateNode;var we=ne.memoizedProps.style,ge=we!=null&&we.hasOwnProperty("display")?we.display:null;P.style.display=ge==null||typeof ge=="boolean"?"":(""+ge).trim()}}catch(Oe){lt(ne,ne.return,Oe)}}}else if(t.tag===6){if(r===null){ne=t;try{ne.stateNode.nodeValue=p?"":ne.memoizedProps}catch(Oe){lt(ne,ne.return,Oe)}}}else if(t.tag===18){if(r===null){ne=t;try{var ye=ne.stateNode;p?Rb(ye,!0):Rb(ne.stateNode,!1)}catch(Oe){lt(ne,ne.return,Oe)}}}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;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(r=o.retryQueue,r!==null&&(o.retryQueue=null,ol(e,r))));break;case 19:rn(t,e),an(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ol(e,o)));break;case 30:break;case 21:break;default:rn(t,e),an(e)}}function an(e){var t=e.flags;if(t&2){try{for(var r,o=e.return;o!==null;){if(O0(o)){r=o;break}o=o.return}if(r==null)throw Error(s(160));switch(r.tag){case 27:var p=r.stateNode,v=kf(e);sl(e,v,p);break;case 5:var O=r.stateNode;r.flags&32&&(Zi(O,""),r.flags&=-33);var P=kf(e);sl(e,P,O);break;case 3:case 4:var ne=r.stateNode.containerInfo,me=kf(e);Tf(e,me,ne);break;default:throw Error(s(161))}}catch(ve){lt(e,e.return,ve)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function F0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;F0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function pr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)D0(e,t.alternate,t),t=t.sibling}function ki(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hr(4,t,t.return),ki(t);break;case 1:Yn(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&R0(t,t.return,r),ki(t);break;case 27:Gs(t.stateNode);case 26:case 5:Yn(t,t.return),ki(t);break;case 22:t.memoizedState===null&&ki(t);break;case 30:ki(t);break;default:ki(t)}e=e.sibling}}function mr(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,p=e,v=t,O=v.flags;switch(v.tag){case 0:case 11:case 15:mr(p,v,r),Ds(4,v);break;case 1:if(mr(p,v,r),o=v,p=o.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(me){lt(o,o.return,me)}if(o=v,p=o.updateQueue,p!==null){var P=o.stateNode;try{var ne=p.shared.hiddenCallbacks;if(ne!==null)for(p.shared.hiddenCallbacks=null,p=0;p<ne.length;p++)yy(ne[p],P)}catch(me){lt(o,o.return,me)}}r&&O&64&&A0(v),Is(v,v.return);break;case 27:z0(v);case 26:case 5:mr(p,v,r),r&&o===null&&O&4&&N0(v),Is(v,v.return);break;case 12:mr(p,v,r);break;case 31:mr(p,v,r),r&&O&4&&L0(p,v);break;case 13:mr(p,v,r),r&&O&4&&B0(p,v);break;case 22:v.memoizedState===null&&mr(p,v,r),Is(v,v.return);break;case 30:break;default:mr(p,v,r)}t=t.sibling}}function Rf(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&Ss(r))}function Nf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ss(e))}function jn(e,t,r,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)P0(e,t,r,o),t=t.sibling}function P0(e,t,r,o){var p=t.flags;switch(t.tag){case 0:case 11:case 15:jn(e,t,r,o),p&2048&&Ds(9,t);break;case 1:jn(e,t,r,o);break;case 3:jn(e,t,r,o),p&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ss(e)));break;case 12:if(p&2048){jn(e,t,r,o),e=t.stateNode;try{var v=t.memoizedProps,O=v.id,P=v.onPostCommit;typeof P=="function"&&P(O,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(ne){lt(t,t.return,ne)}}else jn(e,t,r,o);break;case 31:jn(e,t,r,o);break;case 13:jn(e,t,r,o);break;case 23:break;case 22:v=t.stateNode,O=t.alternate,t.memoizedState!==null?v._visibility&2?jn(e,t,r,o):js(e,t):v._visibility&2?jn(e,t,r,o):(v._visibility|=2,ha(e,t,r,o,(t.subtreeFlags&10256)!==0||!1)),p&2048&&Rf(O,t);break;case 24:jn(e,t,r,o),p&2048&&Nf(t.alternate,t);break;default:jn(e,t,r,o)}}function ha(e,t,r,o,p){for(p=p&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var v=e,O=t,P=r,ne=o,me=O.flags;switch(O.tag){case 0:case 11:case 15:ha(v,O,P,ne,p),Ds(8,O);break;case 23:break;case 22:var ve=O.stateNode;O.memoizedState!==null?ve._visibility&2?ha(v,O,P,ne,p):js(v,O):(ve._visibility|=2,ha(v,O,P,ne,p)),p&&me&2048&&Rf(O.alternate,O);break;case 24:ha(v,O,P,ne,p),p&&me&2048&&Nf(O.alternate,O);break;default:ha(v,O,P,ne,p)}t=t.sibling}}function js(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,o=t,p=o.flags;switch(o.tag){case 22:js(r,o),p&2048&&Rf(o.alternate,o);break;case 24:js(r,o),p&2048&&Nf(o.alternate,o);break;default:js(r,o)}t=t.sibling}}var Ls=8192;function pa(e,t,r){if(e.subtreeFlags&Ls)for(e=e.child;e!==null;)H0(e,t,r),e=e.sibling}function H0(e,t,r){switch(e.tag){case 26:pa(e,t,r),e.flags&Ls&&e.memoizedState!==null&&Jk(r,In,e.memoizedState,e.memoizedProps);break;case 5:pa(e,t,r);break;case 3:case 4:var o=In;In=Sl(e.stateNode.containerInfo),pa(e,t,r),In=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=Ls,Ls=16777216,pa(e,t,r),Ls=o):pa(e,t,r));break;default:pa(e,t,r)}}function q0(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 Bs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var o=t[r];It=o,V0(o,e)}q0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)G0(e),e=e.sibling}function G0(e){switch(e.tag){case 0:case 11:case 15:Bs(e),e.flags&2048&&Hr(9,e,e.return);break;case 3:Bs(e);break;case 12:Bs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ll(e)):Bs(e);break;default:Bs(e)}}function ll(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var o=t[r];It=o,V0(o,e)}q0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hr(8,t,t.return),ll(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,ll(t));break;default:ll(t)}e=e.sibling}}function V0(e,t){for(;It!==null;){var r=It;switch(r.tag){case 0:case 11:case 15:Hr(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var o=r.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Ss(r.memoizedState.cache)}if(o=r.child,o!==null)o.return=r,It=o;else e:for(r=e;It!==null;){o=It;var p=o.sibling,v=o.return;if(I0(o),o===r){It=null;break e}if(p!==null){p.return=v,It=p;break e}It=v}}}var hk={getCacheForType:function(e){var t=Ut(kt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return Ut(kt).controller.signal}},pk=typeof WeakMap=="function"?WeakMap:Map,at=0,dt=null,Ke=null,We=0,ot=0,gn=null,qr=!1,ma=!1,Of=!1,gr=0,St=0,Gr=0,Ti=0,zf=0,yn=0,ga=0,Us=null,sn=null,Mf=!1,ul=0,Y0=0,cl=1/0,fl=null,Vr=null,zt=0,Yr=null,ya=null,yr=0,Df=0,If=null,Z0=null,Fs=0,jf=null;function bn(){return(at&2)!==0&&We!==0?We&-We:J.T!==null?Hf():ug()}function X0(){if(yn===0)if((We&536870912)===0||et){var e=qn;qn<<=1,(qn&3932160)===0&&(qn=262144),yn=e}else yn=536870912;return e=pn.current,e!==null&&(e.flags|=32),yn}function on(e,t,r){(e===dt&&(ot===2||ot===9)||e.cancelPendingCommit!==null)&&(ba(e,0),Zr(e,We,yn,!1)),os(e,r),((at&2)===0||e!==dt)&&(e===dt&&((at&2)===0&&(Ti|=r),St===4&&Zr(e,We,yn,!1)),Zn(e))}function K0(e,t,r){if((at&6)!==0)throw Error(s(327));var o=!r&&(t&127)===0&&(t&e.expiredLanes)===0||ss(e,t),p=o?yk(e,t):Bf(e,t,!0),v=o;do{if(p===0){ma&&!o&&Zr(e,t,0,!1);break}else{if(r=e.current.alternate,v&&!mk(r)){p=Bf(e,t,!1),v=!1;continue}if(p===2){if(v=t,e.errorRecoveryDisabledLanes&v)var O=0;else O=e.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){t=O;e:{var P=e;p=Us;var ne=P.current.memoizedState.isDehydrated;if(ne&&(ba(P,O).flags|=256),O=Bf(P,O,!1),O!==2){if(Of&&!ne){P.errorRecoveryDisabledLanes|=v,Ti|=v,p=4;break e}v=sn,sn=p,v!==null&&(sn===null?sn=v:sn.push.apply(sn,v))}p=O}if(v=!1,p!==2)continue}}if(p===1){ba(e,0),Zr(e,t,0,!0);break}e:{switch(o=e,v=p,v){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:Zr(o,t,yn,!qr);break e;case 2:sn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(p=ul+300-pe(),10<p)){if(Zr(o,t,yn,!qr),So(o,0,!0)!==0)break e;yr=t,o.timeoutHandle=kb(Q0.bind(null,o,r,sn,fl,Mf,t,yn,Ti,ga,qr,v,"Throttled",-0,0),p);break e}Q0(o,r,sn,fl,Mf,t,yn,Ti,ga,qr,v,null,-0,0)}}break}while(!0);Zn(e)}function Q0(e,t,r,o,p,v,O,P,ne,me,ve,we,ge,ye){if(e.timeoutHandle=-1,we=t.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nr},H0(t,v,we);var Oe=(v&62914560)===v?ul-pe():(v&4194048)===v?Y0-pe():0;if(Oe=$k(we,Oe),Oe!==null){yr=v,e.cancelPendingCommit=Oe(ib.bind(null,e,t,v,r,o,p,O,P,ne,ve,we,null,ge,ye)),Zr(e,v,O,!me);return}}ib(e,t,v,r,o,p,O,P,ne)}function mk(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var o=0;o<r.length;o++){var p=r[o],v=p.getSnapshot;p=p.value;try{if(!dn(v(),p))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Zr(e,t,r,o){t&=~zf,t&=~Ti,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var p=t;0<p;){var v=31-Pe(p),O=1<<v;o[v]=-1,p&=~O}r!==0&&sg(e,r,t)}function dl(){return(at&6)===0?(Ps(0),!1):!0}function Lf(){if(Ke!==null){if(ot===0)var e=Ke.return;else e=Ke,sr=bi=null,Jc(e),la=null,ws=0,e=Ke;for(;e!==null;)T0(e.alternate,e),e=e.return;Ke=null}}function ba(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,Ik(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),yr=0,Lf(),dt=e,Ke=r=ir(e.current,null),We=t,ot=0,gn=null,qr=!1,ma=ss(e,t),Of=!1,ga=yn=zf=Ti=Gr=St=0,sn=Us=null,Mf=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var p=31-Pe(o),v=1<<p;t|=e[p],o&=~v}return gr=t,Mo(),r}function W0(e,t){Ge=null,J.H=Os,t===oa||t===Po?(t=hy(),ot=3):t===Fc?(t=hy(),ot=4):ot=t===mf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,gn=t,Ke===null&&(St=1,tl(e,kn(t,e.current)))}function J0(){var e=pn.current;return e===null?!0:(We&4194048)===We?Nn===null:(We&62914560)===We||(We&536870912)!==0?e===Nn:!1}function $0(){var e=J.H;return J.H=Os,e===null?Os:e}function eb(){var e=J.A;return J.A=hk,e}function hl(){St=4,qr||(We&4194048)!==We&&pn.current!==null||(ma=!0),(Gr&134217727)===0&&(Ti&134217727)===0||dt===null||Zr(dt,We,yn,!1)}function Bf(e,t,r){var o=at;at|=2;var p=$0(),v=eb();(dt!==e||We!==t)&&(fl=null,ba(e,t)),t=!1;var O=St;e:do try{if(ot!==0&&Ke!==null){var P=Ke,ne=gn;switch(ot){case 8:Lf(),O=6;break e;case 3:case 2:case 9:case 6:pn.current===null&&(t=!0);var me=ot;if(ot=0,gn=null,va(e,P,ne,me),r&&ma){O=0;break e}break;default:me=ot,ot=0,gn=null,va(e,P,ne,me)}}gk(),O=St;break}catch(ve){W0(e,ve)}while(!0);return t&&e.shellSuspendCounter++,sr=bi=null,at=o,J.H=p,J.A=v,Ke===null&&(dt=null,We=0,Mo()),O}function gk(){for(;Ke!==null;)tb(Ke)}function yk(e,t){var r=at;at|=2;var o=$0(),p=eb();dt!==e||We!==t?(fl=null,cl=pe()+500,ba(e,t)):ma=ss(e,t);e:do try{if(ot!==0&&Ke!==null){t=Ke;var v=gn;t:switch(ot){case 1:ot=0,gn=null,va(e,t,v,1);break;case 2:case 9:if(fy(v)){ot=0,gn=null,nb(t);break}t=function(){ot!==2&&ot!==9||dt!==e||(ot=7),Zn(e)},v.then(t,t);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:fy(v)?(ot=0,gn=null,nb(t)):(ot=0,gn=null,va(e,t,v,7));break;case 5:var O=null;switch(Ke.tag){case 26:O=Ke.memoizedState;case 5:case 27:var P=Ke;if(O?Pb(O):P.stateNode.complete){ot=0,gn=null;var ne=P.sibling;if(ne!==null)Ke=ne;else{var me=P.return;me!==null?(Ke=me,pl(me)):Ke=null}break t}}ot=0,gn=null,va(e,t,v,5);break;case 6:ot=0,gn=null,va(e,t,v,6);break;case 8:Lf(),St=6;break e;default:throw Error(s(462))}}bk();break}catch(ve){W0(e,ve)}while(!0);return sr=bi=null,J.H=o,J.A=p,at=r,Ke!==null?0:(dt=null,We=0,Mo(),St)}function bk(){for(;Ke!==null&&!X();)tb(Ke)}function tb(e){var t=C0(e.alternate,e,gr);e.memoizedProps=e.pendingProps,t===null?pl(e):Ke=t}function nb(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=v0(r,t,t.pendingProps,t.type,void 0,We);break;case 11:t=v0(r,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:Jc(t);default:T0(r,t),t=Ke=ey(t,gr),t=C0(r,t,gr)}e.memoizedProps=e.pendingProps,t===null?pl(e):Ke=t}function va(e,t,r,o){sr=bi=null,Jc(t),la=null,ws=0;var p=t.return;try{if(sk(e,p,t,r,We)){St=1,tl(e,kn(r,e.current)),Ke=null;return}}catch(v){if(p!==null)throw Ke=p,v;St=1,tl(e,kn(r,e.current)),Ke=null;return}t.flags&32768?(et||o===1?e=!0:ma||(We&536870912)!==0?e=!1:(qr=e=!0,(o===2||o===9||o===3||o===6)&&(o=pn.current,o!==null&&o.tag===13&&(o.flags|=16384))),rb(t,e)):pl(t)}function pl(e){var t=e;do{if((t.flags&32768)!==0){rb(t,qr);return}e=t.return;var r=uk(t.alternate,t,gr);if(r!==null){Ke=r;return}if(t=t.sibling,t!==null){Ke=t;return}Ke=t=e}while(t!==null);St===0&&(St=5)}function rb(e,t){do{var r=ck(e.alternate,e);if(r!==null){r.flags&=32767,Ke=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){Ke=e;return}Ke=e=r}while(e!==null);St=6,Ke=null}function ib(e,t,r,o,p,v,O,P,ne){e.cancelPendingCommit=null;do ml();while(zt!==0);if((at&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(v=t.lanes|t.childLanes,v|=Cc,W2(e,r,v,O,P,ne),e===dt&&(Ke=dt=null,We=0),ya=t,Yr=e,yr=r,Df=v,If=p,Z0=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ek(Ee,function(){return ub(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=J.T,J.T=null,p=K.p,K.p=2,O=at,at|=4;try{fk(e,t,r)}finally{at=O,K.p=p,J.T=o}}zt=1,ab(),sb(),ob()}}function ab(){if(zt===1){zt=0;var e=Yr,t=ya,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=J.T,J.T=null;var o=K.p;K.p=2;var p=at;at|=4;try{U0(t,e);var v=Qf,O=Vg(e.containerInfo),P=v.focusedElem,ne=v.selectionRange;if(O!==P&&P&&P.ownerDocument&&Gg(P.ownerDocument.documentElement,P)){if(ne!==null&&_c(P)){var me=ne.start,ve=ne.end;if(ve===void 0&&(ve=me),"selectionStart"in P)P.selectionStart=me,P.selectionEnd=Math.min(ve,P.value.length);else{var we=P.ownerDocument||document,ge=we&&we.defaultView||window;if(ge.getSelection){var ye=ge.getSelection(),Oe=P.textContent.length,Ue=Math.min(ne.start,Oe),ft=ne.end===void 0?Ue:Math.min(ne.end,Oe);!ye.extend&&Ue>ft&&(O=ft,ft=Ue,Ue=O);var fe=qg(P,Ue),le=qg(P,ft);if(fe&&le&&(ye.rangeCount!==1||ye.anchorNode!==fe.node||ye.anchorOffset!==fe.offset||ye.focusNode!==le.node||ye.focusOffset!==le.offset)){var he=we.createRange();he.setStart(fe.node,fe.offset),ye.removeAllRanges(),Ue>ft?(ye.addRange(he),ye.extend(le.node,le.offset)):(he.setEnd(le.node,le.offset),ye.addRange(he))}}}}for(we=[],ye=P;ye=ye.parentNode;)ye.nodeType===1&&we.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<we.length;P++){var Se=we[P];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}Tl=!!Kf,Qf=Kf=null}finally{at=p,K.p=o,J.T=r}}e.current=t,zt=2}}function sb(){if(zt===2){zt=0;var e=Yr,t=ya,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=J.T,J.T=null;var o=K.p;K.p=2;var p=at;at|=4;try{D0(e,t.alternate,t)}finally{at=p,K.p=o,J.T=r}}zt=3}}function ob(){if(zt===4||zt===3){zt=0,ce();var e=Yr,t=ya,r=yr,o=Z0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?zt=5:(zt=0,ya=Yr=null,lb(e,e.pendingLanes));var p=e.pendingLanes;if(p===0&&(Vr=null),tc(r),t=t.stateNode,st&&typeof st.onCommitFiberRoot=="function")try{st.onCommitFiberRoot(Le,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=J.T,p=K.p,K.p=2,J.T=null;try{for(var v=e.onRecoverableError,O=0;O<o.length;O++){var P=o[O];v(P.value,{componentStack:P.stack})}}finally{J.T=t,K.p=p}}(yr&3)!==0&&ml(),Zn(e),p=e.pendingLanes,(r&261930)!==0&&(p&42)!==0?e===jf?Fs++:(Fs=0,jf=e):Fs=0,Ps(0)}}function lb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ss(t)))}function ml(){return ab(),sb(),ob(),ub()}function ub(){if(zt!==5)return!1;var e=Yr,t=Df;Df=0;var r=tc(yr),o=J.T,p=K.p;try{K.p=32>r?32:r,J.T=null,r=If,If=null;var v=Yr,O=yr;if(zt=0,ya=Yr=null,yr=0,(at&6)!==0)throw Error(s(331));var P=at;if(at|=4,G0(v.current),P0(v,v.current,O,r),at=P,Ps(0,!1),st&&typeof st.onPostCommitFiberRoot=="function")try{st.onPostCommitFiberRoot(Le,v)}catch{}return!0}finally{K.p=p,J.T=o,lb(e,t)}}function cb(e,t,r){t=kn(r,t),t=pf(e.stateNode,t,2),e=Ur(e,t,2),e!==null&&(os(e,2),Zn(e))}function lt(e,t,r){if(e.tag===3)cb(e,e,r);else for(;t!==null;){if(t.tag===3){cb(t,e,r);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Vr===null||!Vr.has(o))){e=kn(r,e),r=f0(2),o=Ur(t,r,2),o!==null&&(d0(r,o,t,e),os(o,2),Zn(o));break}}t=t.return}}function Uf(e,t,r){var o=e.pingCache;if(o===null){o=e.pingCache=new pk;var p=new Set;o.set(t,p)}else p=o.get(t),p===void 0&&(p=new Set,o.set(t,p));p.has(r)||(Of=!0,p.add(r),e=vk.bind(null,e,t,r),t.then(e,e))}function vk(e,t,r){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,dt===e&&(We&r)===r&&(St===4||St===3&&(We&62914560)===We&&300>pe()-ul?(at&2)===0&&ba(e,0):zf|=r,ga===We&&(ga=0)),Zn(e)}function fb(e,t){t===0&&(t=ag()),e=mi(e,t),e!==null&&(os(e,t),Zn(e))}function _k(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),fb(e,r)}function Sk(e,t){var r=0;switch(e.tag){case 31:case 13:var o=e.stateNode,p=e.memoizedState;p!==null&&(r=p.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(t),fb(e,r)}function Ek(e,t){return ee(e,t)}var gl=null,_a=null,Ff=!1,yl=!1,Pf=!1,Xr=0;function Zn(e){e!==_a&&e.next===null&&(_a===null?gl=_a=e:_a=_a.next=e),yl=!0,Ff||(Ff=!0,xk())}function Ps(e,t){if(!Pf&&yl){Pf=!0;do for(var r=!1,o=gl;o!==null;){if(e!==0){var p=o.pendingLanes;if(p===0)var v=0;else{var O=o.suspendedLanes,P=o.pingedLanes;v=(1<<31-Pe(42|e)+1)-1,v&=p&~(O&~P),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(r=!0,mb(o,v))}else v=We,v=So(o,o===dt?v:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(v&3)===0||ss(o,v)||(r=!0,mb(o,v));o=o.next}while(r);Pf=!1}}function wk(){db()}function db(){yl=Ff=!1;var e=0;Xr!==0&&Dk()&&(e=Xr);for(var t=pe(),r=null,o=gl;o!==null;){var p=o.next,v=hb(o,t);v===0?(o.next=null,r===null?gl=p:r.next=p,p===null&&(_a=r)):(r=o,(e!==0||(v&3)!==0)&&(yl=!0)),o=p}zt!==0&&zt!==5||Ps(e),Xr!==0&&(Xr=0)}function hb(e,t){for(var r=e.suspendedLanes,o=e.pingedLanes,p=e.expirationTimes,v=e.pendingLanes&-62914561;0<v;){var O=31-Pe(v),P=1<<O,ne=p[O];ne===-1?((P&r)===0||(P&o)!==0)&&(p[O]=Q2(P,t)):ne<=t&&(e.expiredLanes|=P),v&=~P}if(t=dt,r=We,r=So(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,r===0||e===t&&(ot===2||ot===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&se(o),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||ss(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(o!==null&&se(o),tc(r)){case 2:case 8:r=be;break;case 32:r=Ee;break;case 268435456:r=qe;break;default:r=Ee}return o=pb.bind(null,e),r=ee(r,o),e.callbackPriority=t,e.callbackNode=r,t}return o!==null&&o!==null&&se(o),e.callbackPriority=2,e.callbackNode=null,2}function pb(e,t){if(zt!==0&&zt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(ml()&&e.callbackNode!==r)return null;var o=We;return o=So(e,e===dt?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(K0(e,o,t),hb(e,pe()),e.callbackNode!=null&&e.callbackNode===r?pb.bind(null,e):null)}function mb(e,t){if(ml())return null;K0(e,t,!0)}function xk(){jk(function(){(at&6)!==0?ee(ie,wk):db()})}function Hf(){if(Xr===0){var e=aa;e===0&&(e=Nr,Nr<<=1,(Nr&261888)===0&&(Nr=256)),Xr=e}return Xr}function gb(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Co(""+e)}function yb(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function Ck(e,t,r,o,p){if(t==="submit"&&r&&r.stateNode===p){var v=gb((p[en]||null).action),O=o.submitter;O&&(t=(t=O[en]||null)?gb(t.formAction):O.getAttribute("formAction"),t!==null&&(v=t,O=null));var P=new Ro("action","action",null,o,p);e.push({event:P,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Xr!==0){var ne=O?yb(p,O):new FormData(p);lf(r,{pending:!0,data:ne,method:p.method,action:v},null,ne)}}else typeof v=="function"&&(P.preventDefault(),ne=O?yb(p,O):new FormData(p),lf(r,{pending:!0,data:ne,method:p.method,action:v},v,ne))},currentTarget:p}]})}}for(var qf=0;qf<xc.length;qf++){var Gf=xc[qf],kk=Gf.toLowerCase(),Tk=Gf[0].toUpperCase()+Gf.slice(1);Dn(kk,"on"+Tk)}Dn(Xg,"onAnimationEnd"),Dn(Kg,"onAnimationIteration"),Dn(Qg,"onAnimationStart"),Dn("dblclick","onDoubleClick"),Dn("focusin","onFocus"),Dn("focusout","onBlur"),Dn(qC,"onTransitionRun"),Dn(GC,"onTransitionStart"),Dn(VC,"onTransitionCancel"),Dn(Wg,"onTransitionEnd"),Vi("onMouseEnter",["mouseout","mouseover"]),Vi("onMouseLeave",["mouseout","mouseover"]),Vi("onPointerEnter",["pointerout","pointerover"]),Vi("onPointerLeave",["pointerout","pointerover"]),fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hs="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(" "),Ak=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hs));function bb(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var o=e[r],p=o.event;o=o.listeners;e:{var v=void 0;if(t)for(var O=o.length-1;0<=O;O--){var P=o[O],ne=P.instance,me=P.currentTarget;if(P=P.listener,ne!==v&&p.isPropagationStopped())break e;v=P,p.currentTarget=me;try{v(p)}catch(ve){zo(ve)}p.currentTarget=null,v=ne}else for(O=0;O<o.length;O++){if(P=o[O],ne=P.instance,me=P.currentTarget,P=P.listener,ne!==v&&p.isPropagationStopped())break e;v=P,p.currentTarget=me;try{v(p)}catch(ve){zo(ve)}p.currentTarget=null,v=ne}}}}function Qe(e,t){var r=t[nc];r===void 0&&(r=t[nc]=new Set);var o=e+"__bubble";r.has(o)||(vb(t,e,2,!1),r.add(o))}function Vf(e,t,r){var o=0;t&&(o|=4),vb(r,e,o,t)}var bl="_reactListening"+Math.random().toString(36).slice(2);function Yf(e){if(!e[bl]){e[bl]=!0,dg.forEach(function(r){r!=="selectionchange"&&(Ak.has(r)||Vf(r,!1,e),Vf(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bl]||(t[bl]=!0,Vf("selectionchange",!1,t))}}function vb(e,t,r,o){switch(Xb(t)){case 2:var p=nT;break;case 8:p=rT;break;default:p=od}r=p.bind(null,t,r,e),p=void 0,!fc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(p=!0),o?p!==void 0?e.addEventListener(t,r,{capture:!0,passive:p}):e.addEventListener(t,r,!0):p!==void 0?e.addEventListener(t,r,{passive:p}):e.addEventListener(t,r,!1)}function Zf(e,t,r,o,p){var v=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var O=o.tag;if(O===3||O===4){var P=o.stateNode.containerInfo;if(P===p)break;if(O===4)for(O=o.return;O!==null;){var ne=O.tag;if((ne===3||ne===4)&&O.stateNode.containerInfo===p)return;O=O.return}for(;P!==null;){if(O=Hi(P),O===null)return;if(ne=O.tag,ne===5||ne===6||ne===26||ne===27){o=v=O;continue e}P=P.parentNode}}o=o.return}xg(function(){var me=v,ve=uc(r),we=[];e:{var ge=Jg.get(e);if(ge!==void 0){var ye=Ro,Oe=e;switch(e){case"keypress":if(To(r)===0)break e;case"keydown":case"keyup":ye=SC;break;case"focusin":Oe="focus",ye=mc;break;case"focusout":Oe="blur",ye=mc;break;case"beforeblur":case"afterblur":ye=mc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=Tg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=uC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=xC;break;case Xg:case Kg:case Qg:ye=dC;break;case Wg:ye=kC;break;case"scroll":case"scrollend":ye=oC;break;case"wheel":ye=AC;break;case"copy":case"cut":case"paste":ye=pC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=Rg;break;case"toggle":case"beforetoggle":ye=NC}var Ue=(t&4)!==0,ft=!Ue&&(e==="scroll"||e==="scrollend"),fe=Ue?ge!==null?ge+"Capture":null:ge;Ue=[];for(var le=me,he;le!==null;){var Se=le;if(he=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||he===null||fe===null||(Se=cs(le,fe),Se!=null&&Ue.push(qs(le,Se,he))),ft)break;le=le.return}0<Ue.length&&(ge=new ye(ge,Oe,null,r,ve),we.push({event:ge,listeners:Ue}))}}if((t&7)===0){e:{if(ge=e==="mouseover"||e==="pointerover",ye=e==="mouseout"||e==="pointerout",ge&&r!==lc&&(Oe=r.relatedTarget||r.fromElement)&&(Hi(Oe)||Oe[Pi]))break e;if((ye||ge)&&(ge=ve.window===ve?ve:(ge=ve.ownerDocument)?ge.defaultView||ge.parentWindow:window,ye?(Oe=r.relatedTarget||r.toElement,ye=me,Oe=Oe?Hi(Oe):null,Oe!==null&&(ft=l(Oe),Ue=Oe.tag,Oe!==ft||Ue!==5&&Ue!==27&&Ue!==6)&&(Oe=null)):(ye=null,Oe=me),ye!==Oe)){if(Ue=Tg,Se="onMouseLeave",fe="onMouseEnter",le="mouse",(e==="pointerout"||e==="pointerover")&&(Ue=Rg,Se="onPointerLeave",fe="onPointerEnter",le="pointer"),ft=ye==null?ge:us(ye),he=Oe==null?ge:us(Oe),ge=new Ue(Se,le+"leave",ye,r,ve),ge.target=ft,ge.relatedTarget=he,Se=null,Hi(ve)===me&&(Ue=new Ue(fe,le+"enter",Oe,r,ve),Ue.target=he,Ue.relatedTarget=ft,Se=Ue),ft=Se,ye&&Oe)t:{for(Ue=Rk,fe=ye,le=Oe,he=0,Se=fe;Se;Se=Ue(Se))he++;Se=0;for(var Be=le;Be;Be=Ue(Be))Se++;for(;0<he-Se;)fe=Ue(fe),he--;for(;0<Se-he;)le=Ue(le),Se--;for(;he--;){if(fe===le||le!==null&&fe===le.alternate){Ue=fe;break t}fe=Ue(fe),le=Ue(le)}Ue=null}else Ue=null;ye!==null&&_b(we,ge,ye,Ue,!1),Oe!==null&&ft!==null&&_b(we,ft,Oe,Ue,!0)}}e:{if(ge=me?us(me):window,ye=ge.nodeName&&ge.nodeName.toLowerCase(),ye==="select"||ye==="input"&&ge.type==="file")var tt=Lg;else if(Ig(ge))if(Bg)tt=FC;else{tt=BC;var Ie=LC}else ye=ge.nodeName,!ye||ye.toLowerCase()!=="input"||ge.type!=="checkbox"&&ge.type!=="radio"?me&&oc(me.elementType)&&(tt=Lg):tt=UC;if(tt&&(tt=tt(e,me))){jg(we,tt,r,ve);break e}Ie&&Ie(e,ge,me),e==="focusout"&&me&&ge.type==="number"&&me.memoizedProps.value!=null&&sc(ge,"number",ge.value)}switch(Ie=me?us(me):window,e){case"focusin":(Ig(Ie)||Ie.contentEditable==="true")&&(Wi=Ie,Sc=me,bs=null);break;case"focusout":bs=Sc=Wi=null;break;case"mousedown":Ec=!0;break;case"contextmenu":case"mouseup":case"dragend":Ec=!1,Yg(we,r,ve);break;case"selectionchange":if(HC)break;case"keydown":case"keyup":Yg(we,r,ve)}var Ye;if(yc)e:{switch(e){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else Qi?Mg(e,r)&&(Je="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Je="onCompositionStart");Je&&(Ng&&r.locale!=="ko"&&(Qi||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&Qi&&(Ye=Cg()):(zr=ve,dc="value"in zr?zr.value:zr.textContent,Qi=!0)),Ie=vl(me,Je),0<Ie.length&&(Je=new Ag(Je,e,null,r,ve),we.push({event:Je,listeners:Ie}),Ye?Je.data=Ye:(Ye=Dg(r),Ye!==null&&(Je.data=Ye)))),(Ye=zC?MC(e,r):DC(e,r))&&(Je=vl(me,"onBeforeInput"),0<Je.length&&(Ie=new Ag("onBeforeInput","beforeinput",null,r,ve),we.push({event:Ie,listeners:Je}),Ie.data=Ye)),Ck(we,e,me,r,ve)}bb(we,t)})}function qs(e,t,r){return{instance:e,listener:t,currentTarget:r}}function vl(e,t){for(var r=t+"Capture",o=[];e!==null;){var p=e,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=cs(e,r),p!=null&&o.unshift(qs(e,p,v)),p=cs(e,t),p!=null&&o.push(qs(e,p,v))),e.tag===3)return o;e=e.return}return[]}function Rk(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function _b(e,t,r,o,p){for(var v=t._reactName,O=[];r!==null&&r!==o;){var P=r,ne=P.alternate,me=P.stateNode;if(P=P.tag,ne!==null&&ne===o)break;P!==5&&P!==26&&P!==27||me===null||(ne=me,p?(me=cs(r,v),me!=null&&O.unshift(qs(r,me,ne))):p||(me=cs(r,v),me!=null&&O.push(qs(r,me,ne)))),r=r.return}O.length!==0&&e.push({event:t,listeners:O})}var Nk=/\r\n?/g,Ok=/\u0000|\uFFFD/g;function Sb(e){return(typeof e=="string"?e:""+e).replace(Nk,`
|
|
9
|
-
`).replace(Ok,"")}function Eb(e,t){return t=Sb(t),Sb(e)===t}function ct(e,t,r,o,p,v){switch(r){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||Zi(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&Zi(e,""+o);break;case"className":wo(e,"class",o);break;case"tabIndex":wo(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":wo(e,r,o);break;case"style":Eg(e,o,v);break;case"data":if(t!=="object"){wo(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(r);break}o=Co(""+o),e.setAttribute(r,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(r,"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 v=="function"&&(r==="formAction"?(t!=="input"&&ct(e,t,"name",p.name,p,null),ct(e,t,"formEncType",p.formEncType,p,null),ct(e,t,"formMethod",p.formMethod,p,null),ct(e,t,"formTarget",p.formTarget,p,null)):(ct(e,t,"encType",p.encType,p,null),ct(e,t,"method",p.method,p,null),ct(e,t,"target",p.target,p,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(r);break}o=Co(""+o),e.setAttribute(r,o);break;case"onClick":o!=null&&(e.onclick=nr);break;case"onScroll":o!=null&&Qe("scroll",e);break;case"onScrollEnd":o!=null&&Qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(r=o.__html,r!=null){if(p.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}r=Co(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,""+o):e.removeAttribute(r);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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":o===!0?e.setAttribute(r,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,o):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(r,o):e.removeAttribute(r);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(r):e.setAttribute(r,o);break;case"popover":Qe("beforetoggle",e),Qe("toggle",e),Eo(e,"popover",o);break;case"xlinkActuate":tr(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":tr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":tr(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":tr(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":tr(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":tr(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":tr(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":tr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":tr(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Eo(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=aC.get(r)||r,Eo(e,r,o))}}function Xf(e,t,r,o,p,v){switch(r){case"style":Eg(e,o,v);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(r=o.__html,r!=null){if(p.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"children":typeof o=="string"?Zi(e,o):(typeof o=="number"||typeof o=="bigint")&&Zi(e,""+o);break;case"onScroll":o!=null&&Qe("scroll",e);break;case"onScrollEnd":o!=null&&Qe("scrollend",e);break;case"onClick":o!=null&&(e.onclick=nr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hg.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(p=r.endsWith("Capture"),t=r.slice(2,p?r.length-7:void 0),v=e[en]||null,v=v!=null?v[r]:null,typeof v=="function"&&e.removeEventListener(t,v,p),typeof o=="function")){typeof v!="function"&&v!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,o,p);break e}r in e?e[r]=o:o===!0?e.setAttribute(r,""):Eo(e,r,o)}}}function Pt(e,t,r){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 o=!1,p=!1,v;for(v in r)if(r.hasOwnProperty(v)){var O=r[v];if(O!=null)switch(v){case"src":o=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:ct(e,t,v,O,r,null)}}p&&ct(e,t,"srcSet",r.srcSet,r,null),o&&ct(e,t,"src",r.src,r,null);return;case"input":Qe("invalid",e);var P=v=O=p=null,ne=null,me=null;for(o in r)if(r.hasOwnProperty(o)){var ve=r[o];if(ve!=null)switch(o){case"name":p=ve;break;case"type":O=ve;break;case"checked":ne=ve;break;case"defaultChecked":me=ve;break;case"value":v=ve;break;case"defaultValue":P=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(s(137,t));break;default:ct(e,t,o,ve,r,null)}}bg(e,v,P,ne,me,O,p,!1);return;case"select":Qe("invalid",e),o=O=v=null;for(p in r)if(r.hasOwnProperty(p)&&(P=r[p],P!=null))switch(p){case"value":v=P;break;case"defaultValue":O=P;break;case"multiple":o=P;default:ct(e,t,p,P,r,null)}t=v,r=O,e.multiple=!!o,t!=null?Yi(e,!!o,t,!1):r!=null&&Yi(e,!!o,r,!0);return;case"textarea":Qe("invalid",e),v=p=o=null;for(O in r)if(r.hasOwnProperty(O)&&(P=r[O],P!=null))switch(O){case"value":o=P;break;case"defaultValue":p=P;break;case"children":v=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(s(91));break;default:ct(e,t,O,P,r,null)}_g(e,o,p,v);return;case"option":for(ne in r)if(r.hasOwnProperty(ne)&&(o=r[ne],o!=null))switch(ne){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ct(e,t,ne,o,r,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(o=0;o<Hs.length;o++)Qe(Hs[o],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(me in r)if(r.hasOwnProperty(me)&&(o=r[me],o!=null))switch(me){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:ct(e,t,me,o,r,null)}return;default:if(oc(t)){for(ve in r)r.hasOwnProperty(ve)&&(o=r[ve],o!==void 0&&Xf(e,t,ve,o,r,void 0));return}}for(P in r)r.hasOwnProperty(P)&&(o=r[P],o!=null&&ct(e,t,P,o,r,null))}function zk(e,t,r,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,O=null,P=null,ne=null,me=null,ve=null;for(ye in r){var we=r[ye];if(r.hasOwnProperty(ye)&&we!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":ne=we;default:o.hasOwnProperty(ye)||ct(e,t,ye,null,o,we)}}for(var ge in o){var ye=o[ge];if(we=r[ge],o.hasOwnProperty(ge)&&(ye!=null||we!=null))switch(ge){case"type":v=ye;break;case"name":p=ye;break;case"checked":me=ye;break;case"defaultChecked":ve=ye;break;case"value":O=ye;break;case"defaultValue":P=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,t));break;default:ye!==we&&ct(e,t,ge,ye,o,we)}}ac(e,O,P,ne,me,ve,v,p);return;case"select":ye=O=P=ge=null;for(v in r)if(ne=r[v],r.hasOwnProperty(v)&&ne!=null)switch(v){case"value":break;case"multiple":ye=ne;default:o.hasOwnProperty(v)||ct(e,t,v,null,o,ne)}for(p in o)if(v=o[p],ne=r[p],o.hasOwnProperty(p)&&(v!=null||ne!=null))switch(p){case"value":ge=v;break;case"defaultValue":P=v;break;case"multiple":O=v;default:v!==ne&&ct(e,t,p,v,o,ne)}t=P,r=O,o=ye,ge!=null?Yi(e,!!r,ge,!1):!!o!=!!r&&(t!=null?Yi(e,!!r,t,!0):Yi(e,!!r,r?[]:"",!1));return;case"textarea":ye=ge=null;for(P in r)if(p=r[P],r.hasOwnProperty(P)&&p!=null&&!o.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:ct(e,t,P,null,o,p)}for(O in o)if(p=o[O],v=r[O],o.hasOwnProperty(O)&&(p!=null||v!=null))switch(O){case"value":ge=p;break;case"defaultValue":ye=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(s(91));break;default:p!==v&&ct(e,t,O,p,o,v)}vg(e,ge,ye);return;case"option":for(var Oe in r)if(ge=r[Oe],r.hasOwnProperty(Oe)&&ge!=null&&!o.hasOwnProperty(Oe))switch(Oe){case"selected":e.selected=!1;break;default:ct(e,t,Oe,null,o,ge)}for(ne in o)if(ge=o[ne],ye=r[ne],o.hasOwnProperty(ne)&&ge!==ye&&(ge!=null||ye!=null))switch(ne){case"selected":e.selected=ge&&typeof ge!="function"&&typeof ge!="symbol";break;default:ct(e,t,ne,ge,o,ye)}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 Ue in r)ge=r[Ue],r.hasOwnProperty(Ue)&&ge!=null&&!o.hasOwnProperty(Ue)&&ct(e,t,Ue,null,o,ge);for(me in o)if(ge=o[me],ye=r[me],o.hasOwnProperty(me)&&ge!==ye&&(ge!=null||ye!=null))switch(me){case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(s(137,t));break;default:ct(e,t,me,ge,o,ye)}return;default:if(oc(t)){for(var ft in r)ge=r[ft],r.hasOwnProperty(ft)&&ge!==void 0&&!o.hasOwnProperty(ft)&&Xf(e,t,ft,void 0,o,ge);for(ve in o)ge=o[ve],ye=r[ve],!o.hasOwnProperty(ve)||ge===ye||ge===void 0&&ye===void 0||Xf(e,t,ve,ge,o,ye);return}}for(var fe in r)ge=r[fe],r.hasOwnProperty(fe)&&ge!=null&&!o.hasOwnProperty(fe)&&ct(e,t,fe,null,o,ge);for(we in o)ge=o[we],ye=r[we],!o.hasOwnProperty(we)||ge===ye||ge==null&&ye==null||ct(e,t,we,ge,o,ye)}function wb(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Mk(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,r=performance.getEntriesByType("resource"),o=0;o<r.length;o++){var p=r[o],v=p.transferSize,O=p.initiatorType,P=p.duration;if(v&&P&&wb(O)){for(O=0,P=p.responseEnd,o+=1;o<r.length;o++){var ne=r[o],me=ne.startTime;if(me>P)break;var ve=ne.transferSize,we=ne.initiatorType;ve&&wb(we)&&(ne=ne.responseEnd,O+=ve*(ne<P?1:(P-me)/(ne-me)))}if(--o,t+=8*(v+O)/(p.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 Kf=null,Qf=null;function _l(e){return e.nodeType===9?e:e.ownerDocument}function xb(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 Cb(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 Wf(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 Jf=null;function Dk(){var e=window.event;return e&&e.type==="popstate"?e===Jf?!1:(Jf=e,!0):(Jf=null,!1)}var kb=typeof setTimeout=="function"?setTimeout:void 0,Ik=typeof clearTimeout=="function"?clearTimeout:void 0,Tb=typeof Promise=="function"?Promise:void 0,jk=typeof queueMicrotask=="function"?queueMicrotask:typeof Tb<"u"?function(e){return Tb.resolve(null).then(e).catch(Lk)}:kb;function Lk(e){setTimeout(function(){throw e})}function Kr(e){return e==="head"}function Ab(e,t){var r=t,o=0;do{var p=r.nextSibling;if(e.removeChild(r),p&&p.nodeType===8)if(r=p.data,r==="/$"||r==="/&"){if(o===0){e.removeChild(p),xa(t);return}o--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")o++;else if(r==="html")Gs(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Gs(r);for(var v=r.firstChild;v;){var O=v.nextSibling,P=v.nodeName;v[ls]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&v.rel.toLowerCase()==="stylesheet"||r.removeChild(v),v=O}}else r==="body"&&Gs(e.ownerDocument.body);r=p}while(r);xa(t)}function Rb(e,t){var r=e;e=0;do{var o=r.nextSibling;if(r.nodeType===1?t?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(t?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=o}while(r)}function $f(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":$f(r),rc(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function Bk(e,t,r,o){for(;e.nodeType===1;){var p=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[ls])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(v=e.getAttribute("rel"),v==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(v!==p.rel||e.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||e.getAttribute("title")!==(p.title==null?null:p.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(v=e.getAttribute("src"),(v!==(p.src==null?null:p.src)||e.getAttribute("type")!==(p.type==null?null:p.type)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&e.getAttribute("name")===v)return e}else return e;if(e=On(e.nextSibling),e===null)break}return null}function Uk(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=On(e.nextSibling),e===null))return null;return e}function Nb(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=On(e.nextSibling),e===null))return null;return e}function ed(e){return e.data==="$?"||e.data==="$~"}function td(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Fk(e,t){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||r.readyState!=="loading")t();else{var o=function(){t(),r.removeEventListener("DOMContentLoaded",o)};r.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function On(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 nd=null;function Ob(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return On(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function zb(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(t===0)return e;t--}else r!=="/$"&&r!=="/&"||t++}e=e.previousSibling}return null}function Mb(e,t,r){switch(t=_l(r),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Gs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);rc(e)}var zn=new Map,Db=new Set;function Sl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var br=K.d;K.d={f:Pk,r:Hk,D:qk,C:Gk,L:Vk,m:Yk,X:Xk,S:Zk,M:Kk};function Pk(){var e=br.f(),t=dl();return e||t}function Hk(e){var t=qi(e);t!==null&&t.tag===5&&t.type==="form"?Wy(t):br.r(e)}var Sa=typeof document>"u"?null:document;function Ib(e,t,r){var o=Sa;if(o&&typeof t=="string"&&t){var p=xn(t);p='link[rel="'+e+'"][href="'+p+'"]',typeof r=="string"&&(p+='[crossorigin="'+r+'"]'),Db.has(p)||(Db.add(p),e={rel:e,crossOrigin:r,href:t},o.querySelector(p)===null&&(t=o.createElement("link"),Pt(t,"link",e),Dt(t),o.head.appendChild(t)))}}function qk(e){br.D(e),Ib("dns-prefetch",e,null)}function Gk(e,t){br.C(e,t),Ib("preconnect",e,t)}function Vk(e,t,r){br.L(e,t,r);var o=Sa;if(o&&e&&t){var p='link[rel="preload"][as="'+xn(t)+'"]';t==="image"&&r&&r.imageSrcSet?(p+='[imagesrcset="'+xn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(p+='[imagesizes="'+xn(r.imageSizes)+'"]')):p+='[href="'+xn(e)+'"]';var v=p;switch(t){case"style":v=Ea(e);break;case"script":v=wa(e)}zn.has(v)||(e=b({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),zn.set(v,e),o.querySelector(p)!==null||t==="style"&&o.querySelector(Vs(v))||t==="script"&&o.querySelector(Ys(v))||(t=o.createElement("link"),Pt(t,"link",e),Dt(t),o.head.appendChild(t)))}}function Yk(e,t){br.m(e,t);var r=Sa;if(r&&e){var o=t&&typeof t.as=="string"?t.as:"script",p='link[rel="modulepreload"][as="'+xn(o)+'"][href="'+xn(e)+'"]',v=p;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=wa(e)}if(!zn.has(v)&&(e=b({rel:"modulepreload",href:e},t),zn.set(v,e),r.querySelector(p)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Ys(v)))return}o=r.createElement("link"),Pt(o,"link",e),Dt(o),r.head.appendChild(o)}}}function Zk(e,t,r){br.S(e,t,r);var o=Sa;if(o&&e){var p=Gi(o).hoistableStyles,v=Ea(e);t=t||"default";var O=p.get(v);if(!O){var P={loading:0,preload:null};if(O=o.querySelector(Vs(v)))P.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},r),(r=zn.get(v))&&rd(e,r);var ne=O=o.createElement("link");Dt(ne),Pt(ne,"link",e),ne._p=new Promise(function(me,ve){ne.onload=me,ne.onerror=ve}),ne.addEventListener("load",function(){P.loading|=1}),ne.addEventListener("error",function(){P.loading|=2}),P.loading|=4,El(O,t,o)}O={type:"stylesheet",instance:O,count:1,state:P},p.set(v,O)}}}function Xk(e,t){br.X(e,t);var r=Sa;if(r&&e){var o=Gi(r).hoistableScripts,p=wa(e),v=o.get(p);v||(v=r.querySelector(Ys(p)),v||(e=b({src:e,async:!0},t),(t=zn.get(p))&&id(e,t),v=r.createElement("script"),Dt(v),Pt(v,"link",e),r.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},o.set(p,v))}}function Kk(e,t){br.M(e,t);var r=Sa;if(r&&e){var o=Gi(r).hoistableScripts,p=wa(e),v=o.get(p);v||(v=r.querySelector(Ys(p)),v||(e=b({src:e,async:!0,type:"module"},t),(t=zn.get(p))&&id(e,t),v=r.createElement("script"),Dt(v),Pt(v,"link",e),r.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},o.set(p,v))}}function jb(e,t,r,o){var p=(p=xe.current)?Sl(p):null;if(!p)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=Ea(r.href),r=Gi(p).hoistableStyles,o=r.get(t),o||(o={type:"style",instance:null,count:0,state:null},r.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Ea(r.href);var v=Gi(p).hoistableStyles,O=v.get(e);if(O||(p=p.ownerDocument||p,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(e,O),(v=p.querySelector(Vs(e)))&&!v._p&&(O.instance=v,O.state.loading=5),zn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},zn.set(e,r),v||Qk(p,e,r,O.state))),t&&o===null)throw Error(s(528,""));return O}if(t&&o!==null)throw Error(s(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=wa(r),r=Gi(p).hoistableScripts,o=r.get(t),o||(o={type:"script",instance:null,count:0,state:null},r.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Ea(e){return'href="'+xn(e)+'"'}function Vs(e){return'link[rel="stylesheet"]['+e+"]"}function Lb(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Qk(e,t,r,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),Pt(t,"link",r),Dt(t),e.head.appendChild(t))}function wa(e){return'[src="'+xn(e)+'"]'}function Ys(e){return"script[async]"+e}function Bb(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+xn(r.href)+'"]');if(o)return t.instance=o,Dt(o),o;var p=b({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),Dt(o),Pt(o,"style",p),El(o,r.precedence,e),t.instance=o;case"stylesheet":p=Ea(r.href);var v=e.querySelector(Vs(p));if(v)return t.state.loading|=4,t.instance=v,Dt(v),v;o=Lb(r),(p=zn.get(p))&&rd(o,p),v=(e.ownerDocument||e).createElement("link"),Dt(v);var O=v;return O._p=new Promise(function(P,ne){O.onload=P,O.onerror=ne}),Pt(v,"link",o),t.state.loading|=4,El(v,r.precedence,e),t.instance=v;case"script":return v=wa(r.src),(p=e.querySelector(Ys(v)))?(t.instance=p,Dt(p),p):(o=r,(p=zn.get(v))&&(o=b({},r),id(o,p)),e=e.ownerDocument||e,p=e.createElement("script"),Dt(p),Pt(p,"link",o),e.head.appendChild(p),t.instance=p);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,El(o,r.precedence,e));return t.instance}function El(e,t,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=o.length?o[o.length-1]:null,v=p,O=0;O<o.length;O++){var P=o[O];if(P.dataset.precedence===t)v=P;else if(v!==p)break}v?v.parentNode.insertBefore(e,v.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function rd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function id(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var wl=null;function Ub(e,t,r){if(wl===null){var o=new Map,p=wl=new Map;p.set(r,o)}else p=wl,o=p.get(r),o||(o=new Map,p.set(r,o));if(o.has(e))return o;for(o.set(e,null),r=r.getElementsByTagName(e),p=0;p<r.length;p++){var v=r[p];if(!(v[ls]||v[Lt]||e==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var O=v.getAttribute(t)||"";O=e+O;var P=o.get(O);P?P.push(v):o.set(O,[v])}}return o}function Fb(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function Wk(e,t,r){if(r===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 Pb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jk(e,t,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var p=Ea(o.href),v=t.querySelector(Vs(p));if(v){t=v._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=xl.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=v,Dt(v);return}v=t.ownerDocument||t,o=Lb(o),(p=zn.get(p))&&rd(o,p),v=v.createElement("link"),Dt(v);var O=v;O._p=new Promise(function(P,ne){O.onload=P,O.onerror=ne}),Pt(v,"link",o),r.instance=v}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=xl.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var ad=0;function $k(e,t){return e.stylesheets&&e.count===0&&kl(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var o=setTimeout(function(){if(e.stylesheets&&kl(e,e.stylesheets),e.unsuspend){var v=e.unsuspend;e.unsuspend=null,v()}},6e4+t);0<e.imgBytes&&ad===0&&(ad=62500*Mk());var p=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&kl(e,e.stylesheets),e.unsuspend)){var v=e.unsuspend;e.unsuspend=null,v()}},(e.imgBytes>ad?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(p)}}:null}function xl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Cl=null;function kl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Cl=new Map,t.forEach(eT,e),Cl=null,xl.call(e))}function eT(e,t){if(!(t.state.loading&4)){var r=Cl.get(e);if(r)var o=r.get(null);else{r=new Map,Cl.set(e,r);for(var p=e.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var O=p[v];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(r.set(O.dataset.precedence,O),o=O)}o&&r.set(null,o)}p=t.instance,O=p.getAttribute("data-precedence"),v=r.get(O)||o,v===o&&r.set(null,p),r.set(O,p),this.count++,o=xl.bind(this),p.addEventListener("load",o),p.addEventListener("error",o),v?v.parentNode.insertBefore(p,v.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(p,e.firstChild)),t.state.loading|=4}}var Zs={$$typeof:N,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function tT(e,t,r,o,p,v,O,P,ne){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=$u(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$u(0),this.hiddenUpdates=$u(null),this.identifierPrefix=o,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function Hb(e,t,r,o,p,v,O,P,ne,me,ve,we){return e=new tT(e,t,r,O,ne,me,ve,we,P),t=1,v===!0&&(t|=24),v=hn(3,null,null,t),e.current=v,v.stateNode=e,t=Lc(),t.refCount++,e.pooledCache=t,t.refCount++,v.memoizedState={element:o,isDehydrated:r,cache:t},Pc(v),e}function qb(e){return e?(e=ea,e):ea}function Gb(e,t,r,o,p,v){p=qb(p),o.context===null?o.context=p:o.pendingContext=p,o=Br(t),o.payload={element:r},v=v===void 0?null:v,v!==null&&(o.callback=v),r=Ur(e,o,t),r!==null&&(on(r,e,t),Cs(r,e,t))}function Vb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function sd(e,t){Vb(e,t),(e=e.alternate)&&Vb(e,t)}function Yb(e){if(e.tag===13||e.tag===31){var t=mi(e,67108864);t!==null&&on(t,e,67108864),sd(e,67108864)}}function Zb(e){if(e.tag===13||e.tag===31){var t=bn();t=ec(t);var r=mi(e,t);r!==null&&on(r,e,t),sd(e,t)}}var Tl=!0;function nT(e,t,r,o){var p=J.T;J.T=null;var v=K.p;try{K.p=2,od(e,t,r,o)}finally{K.p=v,J.T=p}}function rT(e,t,r,o){var p=J.T;J.T=null;var v=K.p;try{K.p=8,od(e,t,r,o)}finally{K.p=v,J.T=p}}function od(e,t,r,o){if(Tl){var p=ld(o);if(p===null)Zf(e,t,o,Al,r),Kb(e,o);else if(aT(p,e,t,r,o))o.stopPropagation();else if(Kb(e,o),t&4&&-1<iT.indexOf(e)){for(;p!==null;){var v=qi(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var O=jt(v.pendingLanes);if(O!==0){var P=v;for(P.pendingLanes|=2,P.entangledLanes|=2;O;){var ne=1<<31-Pe(O);P.entanglements[1]|=ne,O&=~ne}Zn(v),(at&6)===0&&(cl=pe()+500,Ps(0))}}break;case 31:case 13:P=mi(v,2),P!==null&&on(P,v,2),dl(),sd(v,2)}if(v=ld(o),v===null&&Zf(e,t,o,Al,r),v===p)break;p=v}p!==null&&o.stopPropagation()}else Zf(e,t,o,null,r)}}function ld(e){return e=uc(e),ud(e)}var Al=null;function ud(e){if(Al=null,e=Hi(e),e!==null){var t=l(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=c(t),e!==null)return e;e=null}else if(r===31){if(e=f(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Al=e,null}function Xb(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(de()){case ie:return 2;case be:return 8;case Ee:case De:return 32;case qe:return 268435456;default:return 32}default:return 32}}var cd=!1,Qr=null,Wr=null,Jr=null,Xs=new Map,Ks=new Map,$r=[],iT="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 Kb(e,t){switch(e){case"focusin":case"focusout":Qr=null;break;case"dragenter":case"dragleave":Wr=null;break;case"mouseover":case"mouseout":Jr=null;break;case"pointerover":case"pointerout":Xs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ks.delete(t.pointerId)}}function Qs(e,t,r,o,p,v){return e===null||e.nativeEvent!==v?(e={blockedOn:t,domEventName:r,eventSystemFlags:o,nativeEvent:v,targetContainers:[p]},t!==null&&(t=qi(t),t!==null&&Yb(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,p!==null&&t.indexOf(p)===-1&&t.push(p),e)}function aT(e,t,r,o,p){switch(t){case"focusin":return Qr=Qs(Qr,e,t,r,o,p),!0;case"dragenter":return Wr=Qs(Wr,e,t,r,o,p),!0;case"mouseover":return Jr=Qs(Jr,e,t,r,o,p),!0;case"pointerover":var v=p.pointerId;return Xs.set(v,Qs(Xs.get(v)||null,e,t,r,o,p)),!0;case"gotpointercapture":return v=p.pointerId,Ks.set(v,Qs(Ks.get(v)||null,e,t,r,o,p)),!0}return!1}function Qb(e){var t=Hi(e.target);if(t!==null){var r=l(t);if(r!==null){if(t=r.tag,t===13){if(t=c(r),t!==null){e.blockedOn=t,cg(e.priority,function(){Zb(r)});return}}else if(t===31){if(t=f(r),t!==null){e.blockedOn=t,cg(e.priority,function(){Zb(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ld(e.nativeEvent);if(r===null){r=e.nativeEvent;var o=new r.constructor(r.type,r);lc=o,r.target.dispatchEvent(o),lc=null}else return t=qi(r),t!==null&&Yb(t),e.blockedOn=r,!1;t.shift()}return!0}function Wb(e,t,r){Rl(e)&&r.delete(t)}function sT(){cd=!1,Qr!==null&&Rl(Qr)&&(Qr=null),Wr!==null&&Rl(Wr)&&(Wr=null),Jr!==null&&Rl(Jr)&&(Jr=null),Xs.forEach(Wb),Ks.forEach(Wb)}function Nl(e,t){e.blockedOn===t&&(e.blockedOn=null,cd||(cd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,sT)))}var Ol=null;function Jb(e){Ol!==e&&(Ol=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ol===e&&(Ol=null);for(var t=0;t<e.length;t+=3){var r=e[t],o=e[t+1],p=e[t+2];if(typeof o!="function"){if(ud(o||r)===null)continue;break}var v=qi(r);v!==null&&(e.splice(t,3),t-=3,lf(v,{pending:!0,data:p,method:r.method,action:o},o,p))}}))}function xa(e){function t(ne){return Nl(ne,e)}Qr!==null&&Nl(Qr,e),Wr!==null&&Nl(Wr,e),Jr!==null&&Nl(Jr,e),Xs.forEach(t),Ks.forEach(t);for(var r=0;r<$r.length;r++){var o=$r[r];o.blockedOn===e&&(o.blockedOn=null)}for(;0<$r.length&&(r=$r[0],r.blockedOn===null);)Qb(r),r.blockedOn===null&&$r.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(o=0;o<r.length;o+=3){var p=r[o],v=r[o+1],O=p[en]||null;if(typeof v=="function")O||Jb(r);else if(O){var P=null;if(v&&v.hasAttribute("formAction")){if(p=v,O=v[en]||null)P=O.formAction;else if(ud(p)!==null)continue}else P=O.action;typeof P=="function"?r[o+1]=P:(r.splice(o,3),o-=3),Jb(r)}}}function $b(){function e(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(O){return p=O})},focusReset:"manual",scroll:"manual"})}function t(){p!==null&&(p(),p=null),o||setTimeout(r,20)}function r(){if(!o&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,p=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(r,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),p!==null&&(p(),p=null)}}}function fd(e){this._internalRoot=e}zl.prototype.render=fd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var r=t.current,o=bn();Gb(r,o,e,t,null,null)},zl.prototype.unmount=fd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Gb(e.current,2,null,e,null,null),dl(),t[Pi]=null}};function zl(e){this._internalRoot=e}zl.prototype.unstable_scheduleHydration=function(e){if(e){var t=ug();e={blockedOn:null,target:e,priority:t};for(var r=0;r<$r.length&&t!==0&&t<$r[r].priority;r++);$r.splice(r,0,e),r===0&&Qb(e)}};var ev=a.version;if(ev!=="19.2.0")throw Error(s(527,ev,"19.2.0"));K.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=h(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var oT={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:J,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ml=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ml.isDisabled&&Ml.supportsFiber)try{Le=Ml.inject(oT),st=Ml}catch{}}return Ta.createRoot=function(e,t){if(!u(e))throw Error(s(299));var r=!1,o="",p=o0,v=l0,O=u0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(p=t.onUncaughtError),t.onCaughtError!==void 0&&(v=t.onCaughtError),t.onRecoverableError!==void 0&&(O=t.onRecoverableError)),t=Hb(e,1,!1,null,null,r,o,null,p,v,O,$b),e[Pi]=t.current,Yf(e),new fd(t)},Ta.hydrateRoot=function(e,t,r){if(!u(e))throw Error(s(299));var o=!1,p="",v=o0,O=l0,P=u0,ne=null;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(p=r.identifierPrefix),r.onUncaughtError!==void 0&&(v=r.onUncaughtError),r.onCaughtError!==void 0&&(O=r.onCaughtError),r.onRecoverableError!==void 0&&(P=r.onRecoverableError),r.formState!==void 0&&(ne=r.formState)),t=Hb(e,1,!0,t,r??null,o,p,ne,v,O,P,$b),t.context=qb(null),r=t.current,o=bn(),o=ec(o),p=Br(o),p.callback=null,Ur(r,p,o),r=o,t.current.lanes=r,os(t,r),Zn(t),e[Pi]=t.current,Yf(e),new zl(t)},Ta.version="19.2.0",Ta}var wd;function uv(){if(wd)return Ll.exports;wd=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Ll.exports=lv(),Ll.exports}var cv=uv();Sd();function xd(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}function Pl(...n){return a=>{let i=!1;const s=n.map(u=>{const l=xd(u,a);return!i&&typeof l=="function"&&(i=!0),l});if(i)return()=>{for(let u=0;u<s.length;u++){const l=s[u];typeof l=="function"?l():xd(n[u],null)}}}}function Xn(...n){return $.useCallback(Pl(...n),n)}function fv(n){const a=dv(n),i=$.forwardRef((s,u)=>{const{children:l,...c}=s,f=$.Children.toArray(l),d=f.find(pv);if(d){const h=d.props.children,y=f.map(b=>b===d?$.Children.count(h)>1?$.Children.only(null):$.isValidElement(h)?h.props.children:null:b);return H.jsx(a,{...c,ref:u,children:$.isValidElement(h)?$.cloneElement(h,void 0,y):null})}return H.jsx(a,{...c,ref:u,children:l})});return i.displayName=`${n}.Slot`,i}function dv(n){const a=$.forwardRef((i,s)=>{const{children:u,...l}=i;if($.isValidElement(u)){const c=gv(u),f=mv(l,u.props);return u.type!==$.Fragment&&(f.ref=s?Pl(s,c):c),$.cloneElement(u,f)}return $.Children.count(u)>1?$.Children.only(null):null});return a.displayName=`${n}.SlotClone`,a}var hv=Symbol("radix.slottable");function pv(n){return $.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===hv}function mv(n,a){const i={...a};for(const s in a){const u=n[s],l=a[s];/^on[A-Z]/.test(s)?u&&l?i[s]=(...f)=>{const d=l(...f);return u(...f),d}:u&&(i[s]=u):s==="style"?i[s]={...u,...l}:s==="className"&&(i[s]=[u,l].filter(Boolean).join(" "))}return{...n,...i}}function gv(n){let a=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,i=a&&"isReactWarning"in a&&a.isReactWarning;return i?n.ref:(a=Object.getOwnPropertyDescriptor(n,"ref")?.get,i=a&&"isReactWarning"in a&&a.isReactWarning,i?n.props.ref:n.props.ref||n.ref)}var yv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_r=yv.reduce((n,a)=>{const i=fv(`Primitive.${a}`),s=$.forwardRef((u,l)=>{const{asChild:c,...f}=u,d=c?i:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),H.jsx(d,{...f,ref:l})});return s.displayName=`Primitive.${a}`,{...n,[a]:s}},{}),Sr=globalThis?.document?$.useLayoutEffect:()=>{};function bv(n,a){return $.useReducer((i,s)=>a[i][s]??i,n)}var Ai=n=>{const{present:a,children:i}=n,s=vv(a),u=typeof i=="function"?i({present:s.isPresent}):$.Children.only(i),l=Xn(s.ref,_v(u));return typeof i=="function"||s.isPresent?$.cloneElement(u,{ref:l}):null};Ai.displayName="Presence";function vv(n){const[a,i]=$.useState(),s=$.useRef(null),u=$.useRef(n),l=$.useRef("none"),c=n?"mounted":"unmounted",[f,d]=bv(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return $.useEffect(()=>{const h=$s(s.current);l.current=f==="mounted"?h:"none"},[f]),Sr(()=>{const h=s.current,y=u.current;if(y!==n){const _=l.current,m=$s(h);n?d("MOUNT"):m==="none"||h?.display==="none"?d("UNMOUNT"):d(y&&_!==m?"ANIMATION_OUT":"UNMOUNT"),u.current=n}},[n,d]),Sr(()=>{if(a){let h;const y=a.ownerDocument.defaultView??window,b=m=>{const S=$s(s.current).includes(CSS.escape(m.animationName));if(m.target===a&&S&&(d("ANIMATION_END"),!u.current)){const x=a.style.animationFillMode;a.style.animationFillMode="forwards",h=y.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=x)})}},_=m=>{m.target===a&&(l.current=$s(s.current))};return a.addEventListener("animationstart",_),a.addEventListener("animationcancel",b),a.addEventListener("animationend",b),()=>{y.clearTimeout(h),a.removeEventListener("animationstart",_),a.removeEventListener("animationcancel",b),a.removeEventListener("animationend",b)}}else d("ANIMATION_END")},[a,d]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:$.useCallback(h=>{s.current=h?getComputedStyle(h):null,i(h)},[])}}function $s(n){return n?.animationName||"none"}function _v(n){let a=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,i=a&&"isReactWarning"in a&&a.isReactWarning;return i?n.ref:(a=Object.getOwnPropertyDescriptor(n,"ref")?.get,i=a&&"isReactWarning"in a&&a.isReactWarning,i?n.props.ref:n.props.ref||n.ref)}function Cd(n,a=[]){let i=[];function s(l,c){const f=$.createContext(c),d=i.length;i=[...i,c];const h=b=>{const{scope:_,children:m,...C}=b,S=_?.[n]?.[d]||f,x=$.useMemo(()=>C,Object.values(C));return H.jsx(S.Provider,{value:x,children:m})};h.displayName=l+"Provider";function y(b,_){const m=_?.[n]?.[d]||f,C=$.useContext(m);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${b}\` must be used within \`${l}\``)}return[h,y]}const u=()=>{const l=i.map(c=>$.createContext(c));return function(f){const d=f?.[n]||l;return $.useMemo(()=>({[`__scope${n}`]:{...f,[n]:d}}),[f,d])}};return u.scopeName=n,[s,Sv(u,...a)]}function Sv(...n){const a=n[0];if(n.length===1)return a;const i=()=>{const s=n.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(l){const c=s.reduce((f,{useScope:d,scopeName:h})=>{const b=d(l)[`__scope${h}`];return{...f,...b}},{});return $.useMemo(()=>({[`__scope${a.scopeName}`]:c}),[c])}};return i.scopeName=a.scopeName,i}function Er(n){const a=$.useRef(n);return $.useEffect(()=>{a.current=n}),$.useMemo(()=>(...i)=>a.current?.(...i),[])}var Ev=$.createContext(void 0);function wv(n){const a=$.useContext(Ev);return n||a||"ltr"}function xv(n,[a,i]){return Math.min(i,Math.max(a,n))}function Kn(n,a,{checkForDefaultPrevented:i=!0}={}){return function(u){if(n?.(u),i===!1||!u.defaultPrevented)return a?.(u)}}function Cv(n,a){return $.useReducer((i,s)=>a[i][s]??i,n)}var Hl="ScrollArea",[kd]=Cd(Hl),[kv,vn]=kd(Hl),Td=$.forwardRef((n,a)=>{const{__scopeScrollArea:i,type:s="hover",dir:u,scrollHideDelay:l=600,...c}=n,[f,d]=$.useState(null),[h,y]=$.useState(null),[b,_]=$.useState(null),[m,C]=$.useState(null),[S,x]=$.useState(null),[w,k]=$.useState(0),[N,j]=$.useState(0),[D,M]=$.useState(!1),[L,V]=$.useState(!1),F=Xn(a,oe=>d(oe)),W=wv(u);return H.jsx(kv,{scope:i,type:s,dir:W,scrollHideDelay:l,scrollArea:f,viewport:h,onViewportChange:y,content:b,onContentChange:_,scrollbarX:m,onScrollbarXChange:C,scrollbarXEnabled:D,onScrollbarXEnabledChange:M,scrollbarY:S,onScrollbarYChange:x,scrollbarYEnabled:L,onScrollbarYEnabledChange:V,onCornerWidthChange:k,onCornerHeightChange:j,children:H.jsx(_r.div,{dir:W,...c,ref:F,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":N+"px",...n.style}})})});Td.displayName=Hl;var Ad="ScrollAreaViewport",Rd=$.forwardRef((n,a)=>{const{__scopeScrollArea:i,children:s,nonce:u,...l}=n,c=vn(Ad,i),f=$.useRef(null),d=Xn(a,f,c.onViewportChange);return H.jsxs(H.Fragment,{children:[H.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),H.jsx(_r.div,{"data-radix-scroll-area-viewport":"",...l,ref:d,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...n.style},children:H.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});Rd.displayName=Ad;var Ln="ScrollAreaScrollbar",ql=$.forwardRef((n,a)=>{const{forceMount:i,...s}=n,u=vn(Ln,n.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=u,f=n.orientation==="horizontal";return $.useEffect(()=>(f?l(!0):c(!0),()=>{f?l(!1):c(!1)}),[f,l,c]),u.type==="hover"?H.jsx(Tv,{...s,ref:a,forceMount:i}):u.type==="scroll"?H.jsx(Av,{...s,ref:a,forceMount:i}):u.type==="auto"?H.jsx(Nd,{...s,ref:a,forceMount:i}):u.type==="always"?H.jsx(Gl,{...s,ref:a}):null});ql.displayName=Ln;var Tv=$.forwardRef((n,a)=>{const{forceMount:i,...s}=n,u=vn(Ln,n.__scopeScrollArea),[l,c]=$.useState(!1);return $.useEffect(()=>{const f=u.scrollArea;let d=0;if(f){const h=()=>{window.clearTimeout(d),c(!0)},y=()=>{d=window.setTimeout(()=>c(!1),u.scrollHideDelay)};return f.addEventListener("pointerenter",h),f.addEventListener("pointerleave",y),()=>{window.clearTimeout(d),f.removeEventListener("pointerenter",h),f.removeEventListener("pointerleave",y)}}},[u.scrollArea,u.scrollHideDelay]),H.jsx(Ai,{present:i||l,children:H.jsx(Nd,{"data-state":l?"visible":"hidden",...s,ref:a})})}),Av=$.forwardRef((n,a)=>{const{forceMount:i,...s}=n,u=vn(Ln,n.__scopeScrollArea),l=n.orientation==="horizontal",c=ro(()=>d("SCROLL_END"),100),[f,d]=Cv("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return $.useEffect(()=>{if(f==="idle"){const h=window.setTimeout(()=>d("HIDE"),u.scrollHideDelay);return()=>window.clearTimeout(h)}},[f,u.scrollHideDelay,d]),$.useEffect(()=>{const h=u.viewport,y=l?"scrollLeft":"scrollTop";if(h){let b=h[y];const _=()=>{const m=h[y];b!==m&&(d("SCROLL"),c()),b=m};return h.addEventListener("scroll",_),()=>h.removeEventListener("scroll",_)}},[u.viewport,l,d,c]),H.jsx(Ai,{present:i||f!=="hidden",children:H.jsx(Gl,{"data-state":f==="hidden"?"hidden":"visible",...s,ref:a,onPointerEnter:Kn(n.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Kn(n.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),Nd=$.forwardRef((n,a)=>{const i=vn(Ln,n.__scopeScrollArea),{forceMount:s,...u}=n,[l,c]=$.useState(!1),f=n.orientation==="horizontal",d=ro(()=>{if(i.viewport){const h=i.viewport.offsetWidth<i.viewport.scrollWidth,y=i.viewport.offsetHeight<i.viewport.scrollHeight;c(f?h:y)}},10);return Ri(i.viewport,d),Ri(i.content,d),H.jsx(Ai,{present:s||l,children:H.jsx(Gl,{"data-state":l?"visible":"hidden",...u,ref:a})})}),Gl=$.forwardRef((n,a)=>{const{orientation:i="vertical",...s}=n,u=vn(Ln,n.__scopeScrollArea),l=$.useRef(null),c=$.useRef(0),[f,d]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=Id(f.viewport,f.content),y={...s,sizes:f,onSizesChange:d,hasThumb:h>0&&h<1,onThumbChange:_=>l.current=_,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:_=>c.current=_};function b(_,m){return Dv(_,c.current,f,m)}return i==="horizontal"?H.jsx(Rv,{...y,ref:a,onThumbPositionChange:()=>{if(u.viewport&&l.current){const _=u.viewport.scrollLeft,m=jd(_,f,u.dir);l.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:_=>{u.viewport&&(u.viewport.scrollLeft=_)},onDragScroll:_=>{u.viewport&&(u.viewport.scrollLeft=b(_,u.dir))}}):i==="vertical"?H.jsx(Nv,{...y,ref:a,onThumbPositionChange:()=>{if(u.viewport&&l.current){const _=u.viewport.scrollTop,m=jd(_,f);l.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:_=>{u.viewport&&(u.viewport.scrollTop=_)},onDragScroll:_=>{u.viewport&&(u.viewport.scrollTop=b(_))}}):null}),Rv=$.forwardRef((n,a)=>{const{sizes:i,onSizesChange:s,...u}=n,l=vn(Ln,n.__scopeScrollArea),[c,f]=$.useState(),d=$.useRef(null),h=Xn(a,d,l.onScrollbarXChange);return $.useEffect(()=>{d.current&&f(getComputedStyle(d.current))},[d]),H.jsx(zd,{"data-orientation":"horizontal",...u,ref:h,sizes:i,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":no(i)+"px",...n.style},onThumbPointerDown:y=>n.onThumbPointerDown(y.x),onDragScroll:y=>n.onDragScroll(y.x),onWheelScroll:(y,b)=>{if(l.viewport){const _=l.viewport.scrollLeft+y.deltaX;n.onWheelScroll(_),Bd(_,b)&&y.preventDefault()}},onResize:()=>{d.current&&l.viewport&&c&&s({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:to(c.paddingLeft),paddingEnd:to(c.paddingRight)}})}})}),Nv=$.forwardRef((n,a)=>{const{sizes:i,onSizesChange:s,...u}=n,l=vn(Ln,n.__scopeScrollArea),[c,f]=$.useState(),d=$.useRef(null),h=Xn(a,d,l.onScrollbarYChange);return $.useEffect(()=>{d.current&&f(getComputedStyle(d.current))},[d]),H.jsx(zd,{"data-orientation":"vertical",...u,ref:h,sizes:i,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":no(i)+"px",...n.style},onThumbPointerDown:y=>n.onThumbPointerDown(y.y),onDragScroll:y=>n.onDragScroll(y.y),onWheelScroll:(y,b)=>{if(l.viewport){const _=l.viewport.scrollTop+y.deltaY;n.onWheelScroll(_),Bd(_,b)&&y.preventDefault()}},onResize:()=>{d.current&&l.viewport&&c&&s({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:to(c.paddingTop),paddingEnd:to(c.paddingBottom)}})}})}),[Ov,Od]=kd(Ln),zd=$.forwardRef((n,a)=>{const{__scopeScrollArea:i,sizes:s,hasThumb:u,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:f,onThumbPositionChange:d,onDragScroll:h,onWheelScroll:y,onResize:b,..._}=n,m=vn(Ln,i),[C,S]=$.useState(null),x=Xn(a,F=>S(F)),w=$.useRef(null),k=$.useRef(""),N=m.viewport,j=s.content-s.viewport,D=Er(y),M=Er(d),L=ro(b,10);function V(F){if(w.current){const W=F.clientX-w.current.left,oe=F.clientY-w.current.top;h({x:W,y:oe})}}return $.useEffect(()=>{const F=W=>{const oe=W.target;C?.contains(oe)&&D(W,j)};return document.addEventListener("wheel",F,{passive:!1}),()=>document.removeEventListener("wheel",F,{passive:!1})},[N,C,j,D]),$.useEffect(M,[s,M]),Ri(C,L),Ri(m.content,L),H.jsx(Ov,{scope:i,scrollbar:C,hasThumb:u,onThumbChange:Er(l),onThumbPointerUp:Er(c),onThumbPositionChange:M,onThumbPointerDown:Er(f),children:H.jsx(_r.div,{..._,ref:x,style:{position:"absolute",..._.style},onPointerDown:Kn(n.onPointerDown,F=>{F.button===0&&(F.target.setPointerCapture(F.pointerId),w.current=C.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),V(F))}),onPointerMove:Kn(n.onPointerMove,V),onPointerUp:Kn(n.onPointerUp,F=>{const W=F.target;W.hasPointerCapture(F.pointerId)&&W.releasePointerCapture(F.pointerId),document.body.style.webkitUserSelect=k.current,m.viewport&&(m.viewport.style.scrollBehavior=""),w.current=null})})})}),eo="ScrollAreaThumb",Md=$.forwardRef((n,a)=>{const{forceMount:i,...s}=n,u=Od(eo,n.__scopeScrollArea);return H.jsx(Ai,{present:i||u.hasThumb,children:H.jsx(zv,{ref:a,...s})})}),zv=$.forwardRef((n,a)=>{const{__scopeScrollArea:i,style:s,...u}=n,l=vn(eo,i),c=Od(eo,i),{onThumbPositionChange:f}=c,d=Xn(a,b=>c.onThumbChange(b)),h=$.useRef(void 0),y=ro(()=>{h.current&&(h.current(),h.current=void 0)},100);return $.useEffect(()=>{const b=l.viewport;if(b){const _=()=>{if(y(),!h.current){const m=Iv(b,f);h.current=m,f()}};return f(),b.addEventListener("scroll",_),()=>b.removeEventListener("scroll",_)}},[l.viewport,y,f]),H.jsx(_r.div,{"data-state":c.hasThumb?"visible":"hidden",...u,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:Kn(n.onPointerDownCapture,b=>{const m=b.target.getBoundingClientRect(),C=b.clientX-m.left,S=b.clientY-m.top;c.onThumbPointerDown({x:C,y:S})}),onPointerUp:Kn(n.onPointerUp,c.onThumbPointerUp)})});Md.displayName=eo;var Vl="ScrollAreaCorner",Dd=$.forwardRef((n,a)=>{const i=vn(Vl,n.__scopeScrollArea),s=!!(i.scrollbarX&&i.scrollbarY);return i.type!=="scroll"&&s?H.jsx(Mv,{...n,ref:a}):null});Dd.displayName=Vl;var Mv=$.forwardRef((n,a)=>{const{__scopeScrollArea:i,...s}=n,u=vn(Vl,i),[l,c]=$.useState(0),[f,d]=$.useState(0),h=!!(l&&f);return Ri(u.scrollbarX,()=>{const y=u.scrollbarX?.offsetHeight||0;u.onCornerHeightChange(y),d(y)}),Ri(u.scrollbarY,()=>{const y=u.scrollbarY?.offsetWidth||0;u.onCornerWidthChange(y),c(y)}),h?H.jsx(_r.div,{...s,ref:a,style:{width:l,height:f,position:"absolute",right:u.dir==="ltr"?0:void 0,left:u.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function to(n){return n?parseInt(n,10):0}function Id(n,a){const i=n/a;return isNaN(i)?0:i}function no(n){const a=Id(n.viewport,n.content),i=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,s=(n.scrollbar.size-i)*a;return Math.max(s,18)}function Dv(n,a,i,s="ltr"){const u=no(i),l=u/2,c=a||l,f=u-c,d=i.scrollbar.paddingStart+c,h=i.scrollbar.size-i.scrollbar.paddingEnd-f,y=i.content-i.viewport,b=s==="ltr"?[0,y]:[y*-1,0];return Ld([d,h],b)(n)}function jd(n,a,i="ltr"){const s=no(a),u=a.scrollbar.paddingStart+a.scrollbar.paddingEnd,l=a.scrollbar.size-u,c=a.content-a.viewport,f=l-s,d=i==="ltr"?[0,c]:[c*-1,0],h=xv(n,d);return Ld([0,c],[0,f])(h)}function Ld(n,a){return i=>{if(n[0]===n[1]||a[0]===a[1])return a[0];const s=(a[1]-a[0])/(n[1]-n[0]);return a[0]+s*(i-n[0])}}function Bd(n,a){return n>0&&n<a}var Iv=(n,a=()=>{})=>{let i={left:n.scrollLeft,top:n.scrollTop},s=0;return(function u(){const l={left:n.scrollLeft,top:n.scrollTop},c=i.left!==l.left,f=i.top!==l.top;(c||f)&&a(),i=l,s=window.requestAnimationFrame(u)})(),()=>window.cancelAnimationFrame(s)};function ro(n,a){const i=Er(n),s=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(s.current),[]),$.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(i,a)},[i,a])}function Ri(n,a){const i=Er(a);Sr(()=>{let s=0;if(n){const u=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(i)});return u.observe(n),()=>{window.cancelAnimationFrame(s),u.unobserve(n)}}},[n,i])}var Ud=Td,jv=Rd,Lv=Dd;function Fd(n){var a,i,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(a=0;a<u;a++)n[a]&&(i=Fd(n[a]))&&(s&&(s+=" "),s+=i)}else for(i in n)n[i]&&(s&&(s+=" "),s+=i);return s}function Pd(){for(var n,a,i=0,s="",u=arguments.length;i<u;i++)(n=arguments[i])&&(a=Fd(n))&&(s&&(s+=" "),s+=a);return s}const Bv=(n,a)=>{const i=new Array(n.length+a.length);for(let s=0;s<n.length;s++)i[s]=n[s];for(let s=0;s<a.length;s++)i[n.length+s]=a[s];return i},Uv=(n,a)=>({classGroupId:n,validator:a}),Hd=(n=new Map,a=null,i)=>({nextPart:n,validators:a,classGroupId:i}),io="-",qd=[],Fv="arbitrary..",Pv=n=>{const a=qv(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=n;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return Hv(c);const f=c.split(io),d=f[0]===""&&f.length>1?1:0;return Gd(f,d,a)},getConflictingClassGroupIds:(c,f)=>{if(f){const d=s[c],h=i[c];return d?h?Bv(h,d):d:h||qd}return i[c]||qd}}},Gd=(n,a,i)=>{if(n.length-a===0)return i.classGroupId;const u=n[a],l=i.nextPart.get(u);if(l){const h=Gd(n,a+1,l);if(h)return h}const c=i.validators;if(c===null)return;const f=a===0?n.join(io):n.slice(a).join(io),d=c.length;for(let h=0;h<d;h++){const y=c[h];if(y.validator(f))return y.classGroupId}},Hv=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=n.slice(1,-1),i=a.indexOf(":"),s=a.slice(0,i);return s?Fv+s:void 0})(),qv=n=>{const{theme:a,classGroups:i}=n;return Gv(i,a)},Gv=(n,a)=>{const i=Hd();for(const s in n){const u=n[s];Yl(u,i,s,a)}return i},Yl=(n,a,i,s)=>{const u=n.length;for(let l=0;l<u;l++){const c=n[l];Vv(c,a,i,s)}},Vv=(n,a,i,s)=>{if(typeof n=="string"){Yv(n,a,i);return}if(typeof n=="function"){Zv(n,a,i,s);return}Xv(n,a,i,s)},Yv=(n,a,i)=>{const s=n===""?a:Vd(a,n);s.classGroupId=i},Zv=(n,a,i,s)=>{if(Kv(n)){Yl(n(s),a,i,s);return}a.validators===null&&(a.validators=[]),a.validators.push(Uv(i,n))},Xv=(n,a,i,s)=>{const u=Object.entries(n),l=u.length;for(let c=0;c<l;c++){const[f,d]=u[c];Yl(d,Vd(a,f),i,s)}},Vd=(n,a)=>{let i=n;const s=a.split(io),u=s.length;for(let l=0;l<u;l++){const c=s[l];let f=i.nextPart.get(c);f||(f=Hd(),i.nextPart.set(c,f)),i=f}return i},Kv=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,Qv=n=>{if(n<1)return{get:()=>{},set:()=>{}};let a=0,i=Object.create(null),s=Object.create(null);const u=(l,c)=>{i[l]=c,a++,a>n&&(a=0,s=i,i=Object.create(null))};return{get(l){let c=i[l];if(c!==void 0)return c;if((c=s[l])!==void 0)return u(l,c),c},set(l,c){l in i?i[l]=c:u(l,c)}}},Zl="!",Yd=":",Wv=[],Zd=(n,a,i,s,u)=>({modifiers:n,hasImportantModifier:a,baseClassName:i,maybePostfixModifierPosition:s,isExternal:u}),Jv=n=>{const{prefix:a,experimentalParseClassName:i}=n;let s=u=>{const l=[];let c=0,f=0,d=0,h;const y=u.length;for(let S=0;S<y;S++){const x=u[S];if(c===0&&f===0){if(x===Yd){l.push(u.slice(d,S)),d=S+1;continue}if(x==="/"){h=S;continue}}x==="["?c++:x==="]"?c--:x==="("?f++:x===")"&&f--}const b=l.length===0?u:u.slice(d);let _=b,m=!1;b.endsWith(Zl)?(_=b.slice(0,-1),m=!0):b.startsWith(Zl)&&(_=b.slice(1),m=!0);const C=h&&h>d?h-d:void 0;return Zd(l,m,_,C)};if(a){const u=a+Yd,l=s;s=c=>c.startsWith(u)?l(c.slice(u.length)):Zd(Wv,!1,c,void 0,!0)}if(i){const u=s;s=l=>i({className:l,parseClassName:u})}return s},$v=n=>{const a=new Map;return n.orderSensitiveModifiers.forEach((i,s)=>{a.set(i,1e6+s)}),i=>{const s=[];let u=[];for(let l=0;l<i.length;l++){const c=i[l],f=c[0]==="[",d=a.has(c);f||d?(u.length>0&&(u.sort(),s.push(...u),u=[]),s.push(c)):u.push(c)}return u.length>0&&(u.sort(),s.push(...u)),s}},e1=n=>({cache:Qv(n.cacheSize),parseClassName:Jv(n),sortModifiers:$v(n),...Pv(n)}),t1=/\s+/,n1=(n,a)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:u,sortModifiers:l}=a,c=[],f=n.trim().split(t1);let d="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:b,modifiers:_,hasImportantModifier:m,baseClassName:C,maybePostfixModifierPosition:S}=i(y);if(b){d=y+(d.length>0?" "+d:d);continue}let x=!!S,w=s(x?C.substring(0,S):C);if(!w){if(!x){d=y+(d.length>0?" "+d:d);continue}if(w=s(C),!w){d=y+(d.length>0?" "+d:d);continue}x=!1}const k=_.length===0?"":_.length===1?_[0]:l(_).join(":"),N=m?k+Zl:k,j=N+w;if(c.indexOf(j)>-1)continue;c.push(j);const D=u(w,x);for(let M=0;M<D.length;++M){const L=D[M];c.push(N+L)}d=y+(d.length>0?" "+d:d)}return d},r1=(...n)=>{let a=0,i,s,u="";for(;a<n.length;)(i=n[a++])&&(s=Xd(i))&&(u&&(u+=" "),u+=s);return u},Xd=n=>{if(typeof n=="string")return n;let a,i="";for(let s=0;s<n.length;s++)n[s]&&(a=Xd(n[s]))&&(i&&(i+=" "),i+=a);return i},i1=(n,...a)=>{let i,s,u,l;const c=d=>{const h=a.reduce((y,b)=>b(y),n());return i=e1(h),s=i.cache.get,u=i.cache.set,l=f,f(d)},f=d=>{const h=s(d);if(h)return h;const y=n1(d,i);return u(d,y),y};return l=c,(...d)=>l(r1(...d))},a1=[],Nt=n=>{const a=i=>i[n]||a1;return a.isThemeGetter=!0,a},Kd=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qd=/^\((?:(\w[\w-]*):)?(.+)\)$/i,s1=/^\d+\/\d+$/,o1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,l1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,u1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,c1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,f1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ni=n=>s1.test(n),Xe=n=>!!n&&!Number.isNaN(Number(n)),wr=n=>!!n&&Number.isInteger(Number(n)),Xl=n=>n.endsWith("%")&&Xe(n.slice(0,-1)),Qn=n=>o1.test(n),d1=()=>!0,h1=n=>l1.test(n)&&!u1.test(n),Wd=()=>!1,p1=n=>c1.test(n),m1=n=>f1.test(n),g1=n=>!ze(n)&&!Me(n),y1=n=>Oi(n,nh,Wd),ze=n=>Kd.test(n),ti=n=>Oi(n,rh,h1),Kl=n=>Oi(n,E1,Xe),Jd=n=>Oi(n,eh,Wd),b1=n=>Oi(n,th,m1),ao=n=>Oi(n,ih,p1),Me=n=>Qd.test(n),Aa=n=>zi(n,rh),v1=n=>zi(n,w1),$d=n=>zi(n,eh),_1=n=>zi(n,nh),S1=n=>zi(n,th),so=n=>zi(n,ih,!0),Oi=(n,a,i)=>{const s=Kd.exec(n);return s?s[1]?a(s[1]):i(s[2]):!1},zi=(n,a,i=!1)=>{const s=Qd.exec(n);return s?s[1]?a(s[1]):i:!1},eh=n=>n==="position"||n==="percentage",th=n=>n==="image"||n==="url",nh=n=>n==="length"||n==="size"||n==="bg-size",rh=n=>n==="length",E1=n=>n==="number",w1=n=>n==="family-name",ih=n=>n==="shadow",x1=i1(()=>{const n=Nt("color"),a=Nt("font"),i=Nt("text"),s=Nt("font-weight"),u=Nt("tracking"),l=Nt("leading"),c=Nt("breakpoint"),f=Nt("container"),d=Nt("spacing"),h=Nt("radius"),y=Nt("shadow"),b=Nt("inset-shadow"),_=Nt("text-shadow"),m=Nt("drop-shadow"),C=Nt("blur"),S=Nt("perspective"),x=Nt("aspect"),w=Nt("ease"),k=Nt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...j(),Me,ze],M=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],V=()=>[Me,ze,d],F=()=>[Ni,"full","auto",...V()],W=()=>[wr,"none","subgrid",Me,ze],oe=()=>["auto",{span:["full",wr,Me,ze]},wr,Me,ze],R=()=>[wr,"auto",Me,ze],Q=()=>["auto","min","max","fr",Me,ze],E=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...V()],K=()=>[Ni,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],ue=()=>[n,Me,ze],re=()=>[...j(),$d,Jd,{position:[Me,ze]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",_1,y1,{size:[Me,ze]}],I=()=>[Xl,Aa,ti],B=()=>["","none","full",h,Me,ze],te=()=>["",Xe,Aa,ti],ae=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Te=()=>[Xe,Xl,$d,Jd],Ce=()=>["","none",C,Me,ze],ke=()=>["none",Xe,Me,ze],je=()=>["none",Xe,Me,ze],_e=()=>[Xe,Me,ze],Re=()=>[Ni,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Qn],breakpoint:[Qn],color:[d1],container:[Qn],"drop-shadow":[Qn],ease:["in","out","in-out"],font:[g1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Qn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Qn],shadow:[Qn],spacing:["px",Xe],text:[Qn],"text-shadow":[Qn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ni,ze,Me,x]}],container:["container"],columns:[{columns:[Xe,ze,Me,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[wr,"auto",Me,ze]}],basis:[{basis:[Ni,"full","auto",f,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,Ni,"auto","initial","none",ze]}],grow:[{grow:["",Xe,Me,ze]}],shrink:[{shrink:["",Xe,Me,ze]}],order:[{order:[wr,"first","last","none",Me,ze]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...E(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...E()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[f,"screen",...K()]}],"min-w":[{"min-w":[f,"screen","none",...K()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",i,Aa,ti]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Me,Kl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xl,ze]}],"font-family":[{font:[v1,ze,a]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[u,Me,ze]}],"line-clamp":[{"line-clamp":[Xe,"none",Me,Kl]}],leading:[{leading:[l,...V()]}],"list-image":[{"list-image":["none",Me,ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ue()}],"text-color":[{text:ue()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",Me,ti]}],"text-decoration-color":[{decoration:ue()}],"underline-offset":[{"underline-offset":[Xe,"auto",Me,ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,ze]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me,ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wr,Me,ze],radial:["",Me,ze],conic:[wr,Me,ze]},S1,b1]}],"bg-color":[{bg:ue()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:ue()}],"gradient-via":[{via:ue()}],"gradient-to":[{to:ue()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:ue()}],"border-color-x":[{"border-x":ue()}],"border-color-y":[{"border-y":ue()}],"border-color-s":[{"border-s":ue()}],"border-color-e":[{"border-e":ue()}],"border-color-t":[{"border-t":ue()}],"border-color-r":[{"border-r":ue()}],"border-color-b":[{"border-b":ue()}],"border-color-l":[{"border-l":ue()}],"divide-color":[{divide:ue()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,Me,ze]}],"outline-w":[{outline:["",Xe,Aa,ti]}],"outline-color":[{outline:ue()}],shadow:[{shadow:["","none",y,so,ao]}],"shadow-color":[{shadow:ue()}],"inset-shadow":[{"inset-shadow":["none",b,so,ao]}],"inset-shadow-color":[{"inset-shadow":ue()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ue()}],"ring-offset-w":[{"ring-offset":[Xe,ti]}],"ring-offset-color":[{"ring-offset":ue()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":ue()}],"text-shadow":[{"text-shadow":["none",_,so,ao]}],"text-shadow-color":[{"text-shadow":ue()}],opacity:[{opacity:[Xe,Me,ze]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Te()}],"mask-image-linear-to-pos":[{"mask-linear-to":Te()}],"mask-image-linear-from-color":[{"mask-linear-from":ue()}],"mask-image-linear-to-color":[{"mask-linear-to":ue()}],"mask-image-t-from-pos":[{"mask-t-from":Te()}],"mask-image-t-to-pos":[{"mask-t-to":Te()}],"mask-image-t-from-color":[{"mask-t-from":ue()}],"mask-image-t-to-color":[{"mask-t-to":ue()}],"mask-image-r-from-pos":[{"mask-r-from":Te()}],"mask-image-r-to-pos":[{"mask-r-to":Te()}],"mask-image-r-from-color":[{"mask-r-from":ue()}],"mask-image-r-to-color":[{"mask-r-to":ue()}],"mask-image-b-from-pos":[{"mask-b-from":Te()}],"mask-image-b-to-pos":[{"mask-b-to":Te()}],"mask-image-b-from-color":[{"mask-b-from":ue()}],"mask-image-b-to-color":[{"mask-b-to":ue()}],"mask-image-l-from-pos":[{"mask-l-from":Te()}],"mask-image-l-to-pos":[{"mask-l-to":Te()}],"mask-image-l-from-color":[{"mask-l-from":ue()}],"mask-image-l-to-color":[{"mask-l-to":ue()}],"mask-image-x-from-pos":[{"mask-x-from":Te()}],"mask-image-x-to-pos":[{"mask-x-to":Te()}],"mask-image-x-from-color":[{"mask-x-from":ue()}],"mask-image-x-to-color":[{"mask-x-to":ue()}],"mask-image-y-from-pos":[{"mask-y-from":Te()}],"mask-image-y-to-pos":[{"mask-y-to":Te()}],"mask-image-y-from-color":[{"mask-y-from":ue()}],"mask-image-y-to-color":[{"mask-y-to":ue()}],"mask-image-radial":[{"mask-radial":[Me,ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":Te()}],"mask-image-radial-to-pos":[{"mask-radial-to":Te()}],"mask-image-radial-from-color":[{"mask-radial-from":ue()}],"mask-image-radial-to-color":[{"mask-radial-to":ue()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Te()}],"mask-image-conic-to-pos":[{"mask-conic-to":Te()}],"mask-image-conic-from-color":[{"mask-conic-from":ue()}],"mask-image-conic-to-color":[{"mask-conic-to":ue()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,ze]}],filter:[{filter:["","none",Me,ze]}],blur:[{blur:Ce()}],brightness:[{brightness:[Xe,Me,ze]}],contrast:[{contrast:[Xe,Me,ze]}],"drop-shadow":[{"drop-shadow":["","none",m,so,ao]}],"drop-shadow-color":[{"drop-shadow":ue()}],grayscale:[{grayscale:["",Xe,Me,ze]}],"hue-rotate":[{"hue-rotate":[Xe,Me,ze]}],invert:[{invert:["",Xe,Me,ze]}],saturate:[{saturate:[Xe,Me,ze]}],sepia:[{sepia:["",Xe,Me,ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,ze]}],"backdrop-blur":[{"backdrop-blur":Ce()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,Me,ze]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,Me,ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,Me,ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,Me,ze]}],"backdrop-invert":[{"backdrop-invert":["",Xe,Me,ze]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,Me,ze]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,Me,ze]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,Me,ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",Me,ze]}],ease:[{ease:["linear","initial",w,Me,ze]}],delay:[{delay:[Xe,Me,ze]}],animate:[{animate:["none",k,Me,ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Me,ze]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:ke()}],"rotate-x":[{"rotate-x":ke()}],"rotate-y":[{"rotate-y":ke()}],"rotate-z":[{"rotate-z":ke()}],scale:[{scale:je()}],"scale-x":[{"scale-x":je()}],"scale-y":[{"scale-y":je()}],"scale-z":[{"scale-z":je()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[Me,ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Re()}],"translate-x":[{"translate-x":Re()}],"translate-y":[{"translate-y":Re()}],"translate-z":[{"translate-z":Re()}],"translate-none":["translate-none"],accent:[{accent:ue()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ue()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Me,ze]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Me,ze]}],fill:[{fill:["none",...ue()]}],"stroke-w":[{stroke:[Xe,Aa,ti,Kl]}],stroke:[{stroke:["none",...ue()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ze(...n){return x1(Pd(n))}function Ra(n){if(!n&&n!==0)return"";const a=n instanceof Date?n:new Date(typeof n=="number"?n:Number(n)||n);return Number.isNaN(a.getTime())?"":a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}const C1=n=>new Promise(a=>setTimeout(a,n)),ah=$.forwardRef(({className:n,children:a,...i},s)=>H.jsxs(Ud,{ref:s,className:Ze("relative overflow-hidden",n),...i,children:[H.jsx(jv,{className:"h-full w-full rounded-[inherit]",children:a}),H.jsx(sh,{}),H.jsx(Lv,{})]}));ah.displayName=Ud.displayName;const sh=$.forwardRef(({className:n,orientation:a="vertical",...i},s)=>H.jsx(ql,{ref:s,orientation:a,className:Ze("flex touch-none select-none transition-colors",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...i,children:H.jsx(Md,{className:"relative flex-1 rounded-full bg-border"})}));sh.displayName=ql.displayName;var k1=Symbol.for("react.lazy"),oo=gd[" use ".trim().toString()];function T1(n){return typeof n=="object"&&n!==null&&"then"in n}function oh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===k1&&"_payload"in n&&T1(n._payload)}function lh(n){const a=R1(n),i=$.forwardRef((s,u)=>{let{children:l,...c}=s;oh(l)&&typeof oo=="function"&&(l=oo(l._payload));const f=$.Children.toArray(l),d=f.find(O1);if(d){const h=d.props.children,y=f.map(b=>b===d?$.Children.count(h)>1?$.Children.only(null):$.isValidElement(h)?h.props.children:null:b);return H.jsx(a,{...c,ref:u,children:$.isValidElement(h)?$.cloneElement(h,void 0,y):null})}return H.jsx(a,{...c,ref:u,children:l})});return i.displayName=`${n}.Slot`,i}var A1=lh("Slot");function R1(n){const a=$.forwardRef((i,s)=>{let{children:u,...l}=i;if(oh(u)&&typeof oo=="function"&&(u=oo(u._payload)),$.isValidElement(u)){const c=M1(u),f=z1(l,u.props);return u.type!==$.Fragment&&(f.ref=s?Pl(s,c):c),$.cloneElement(u,f)}return $.Children.count(u)>1?$.Children.only(null):null});return a.displayName=`${n}.SlotClone`,a}var N1=Symbol("radix.slottable");function O1(n){return $.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===N1}function z1(n,a){const i={...a};for(const s in a){const u=n[s],l=a[s];/^on[A-Z]/.test(s)?u&&l?i[s]=(...f)=>{const d=l(...f);return u(...f),d}:u&&(i[s]=u):s==="style"?i[s]={...u,...l}:s==="className"&&(i[s]=[u,l].filter(Boolean).join(" "))}return{...n,...i}}function M1(n){let a=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,i=a&&"isReactWarning"in a&&a.isReactWarning;return i?n.ref:(a=Object.getOwnPropertyDescriptor(n,"ref")?.get,i=a&&"isReactWarning"in a&&a.isReactWarning,i?n.props.ref:n.props.ref||n.ref)}const uh=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,ch=Pd,D1=((n,a)=>i=>{var s;if(a?.variants==null)return ch(n,i?.class,i?.className);const{variants:u,defaultVariants:l}=a,c=Object.keys(u).map(h=>{const y=i?.[h],b=l?.[h];if(y===null)return null;const _=uh(y)||uh(b);return u[h][_]}),f=i&&Object.entries(i).reduce((h,y)=>{let[b,_]=y;return _===void 0||(h[b]=_),h},{}),d=a==null||(s=a.compoundVariants)===null||s===void 0?void 0:s.reduce((h,y)=>{let{class:b,className:_,...m}=y;return Object.entries(m).every(C=>{let[S,x]=C;return Array.isArray(x)?x.includes({...l,...f}[S]):{...l,...f}[S]===x})?[...h,b,_]:h},[]);return ch(n,c,d,i?.class,i?.className)})("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ot=$.forwardRef(({className:n,variant:a,size:i,asChild:s=!1,...u},l)=>{const c=s?A1:"button";return H.jsx(c,{className:Ze(D1({variant:a,size:i,className:n})),ref:l,...u})});Ot.displayName="Button";const I1=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j1=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,i,s)=>s?s.toUpperCase():i.toLowerCase()),fh=n=>{const a=j1(n);return a.charAt(0).toUpperCase()+a.slice(1)},dh=(...n)=>n.filter((a,i,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===i).join(" ").trim(),L1=n=>{for(const a in n)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var B1={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"};const U1=$.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:u="",children:l,iconNode:c,...f},d)=>$.createElement("svg",{ref:d,...B1,width:a,height:a,stroke:n,strokeWidth:s?Number(i)*24/Number(a):i,className:dh("lucide",u),...!l&&!L1(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,y])=>$.createElement(h,y)),...Array.isArray(l)?l:[l]]));const Mt=(n,a)=>{const i=$.forwardRef(({className:s,...u},l)=>$.createElement(U1,{ref:l,iconNode:a,className:dh(`lucide-${I1(fh(n))}`,`lucide-${n}`,s),...u}));return i.displayName=fh(n),i};const F1=Mt("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const hh=Mt("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const ph=Mt("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]]);const P1=Mt("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const mh=Mt("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Ql=Mt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const H1=Mt("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const q1=Mt("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const G1=Mt("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const V1=Mt("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Y1=Mt("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);const gh=Mt("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Z1=Mt("message-square-plus",[["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"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]);const X1=Mt("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);const K1=Mt("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);const Q1=Mt("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"}]]);const W1=Mt("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const Wl=Mt("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Na=$.forwardRef(({className:n,...a},i)=>H.jsx("div",{ref:i,className:Ze("rounded-xl border bg-card text-card-foreground shadow",n),...a}));Na.displayName="Card";const yh=$.forwardRef(({className:n,...a},i)=>H.jsx("div",{ref:i,className:Ze("flex flex-col space-y-1.5 p-6",n),...a}));yh.displayName="CardHeader";const J1=$.forwardRef(({className:n,...a},i)=>H.jsx("div",{ref:i,className:Ze("font-semibold leading-none tracking-tight",n),...a}));J1.displayName="CardTitle";const $1=$.forwardRef(({className:n,...a},i)=>H.jsx("div",{ref:i,className:Ze("text-sm text-muted-foreground",n),...a}));$1.displayName="CardDescription";const bh=$.forwardRef(({className:n,...a},i)=>H.jsx("div",{ref:i,className:Ze("p-6 pt-0",n),...a}));bh.displayName="CardContent";const e_=$.forwardRef(({className:n,...a},i)=>H.jsx("div",{ref:i,className:Ze("flex items-center p-6 pt-0",n),...a}));e_.displayName="CardFooter";function t_(n,a=[]){let i=[];function s(l,c){const f=$.createContext(c);f.displayName=l+"Context";const d=i.length;i=[...i,c];const h=b=>{const{scope:_,children:m,...C}=b,S=_?.[n]?.[d]||f,x=$.useMemo(()=>C,Object.values(C));return H.jsx(S.Provider,{value:x,children:m})};h.displayName=l+"Provider";function y(b,_){const m=_?.[n]?.[d]||f,C=$.useContext(m);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${b}\` must be used within \`${l}\``)}return[h,y]}const u=()=>{const l=i.map(c=>$.createContext(c));return function(f){const d=f?.[n]||l;return $.useMemo(()=>({[`__scope${n}`]:{...f,[n]:d}}),[f,d])}};return u.scopeName=n,[s,n_(u,...a)]}function n_(...n){const a=n[0];if(n.length===1)return a;const i=()=>{const s=n.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(l){const c=s.reduce((f,{useScope:d,scopeName:h})=>{const b=d(l)[`__scope${h}`];return{...f,...b}},{});return $.useMemo(()=>({[`__scope${a.scopeName}`]:c}),[c])}};return i.scopeName=a.scopeName,i}var r_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jl=r_.reduce((n,a)=>{const i=lh(`Primitive.${a}`),s=$.forwardRef((u,l)=>{const{asChild:c,...f}=u,d=c?i:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),H.jsx(d,{...f,ref:l})});return s.displayName=`Primitive.${a}`,{...n,[a]:s}},{}),$l={exports:{}},eu={};var vh;function i_(){if(vh)return eu;vh=1;var n=Js();function a(b,_){return b===_&&(b!==0||1/b===1/_)||b!==b&&_!==_}var i=typeof Object.is=="function"?Object.is:a,s=n.useState,u=n.useEffect,l=n.useLayoutEffect,c=n.useDebugValue;function f(b,_){var m=_(),C=s({inst:{value:m,getSnapshot:_}}),S=C[0].inst,x=C[1];return l(function(){S.value=m,S.getSnapshot=_,d(S)&&x({inst:S})},[b,m,_]),u(function(){return d(S)&&x({inst:S}),b(function(){d(S)&&x({inst:S})})},[b]),c(m),m}function d(b){var _=b.getSnapshot;b=b.value;try{var m=_();return!i(b,m)}catch{return!0}}function h(b,_){return _()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return eu.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:y,eu}var _h;function a_(){return _h||(_h=1,$l.exports=i_()),$l.exports}var s_=a_();function o_(){return s_.useSyncExternalStore(l_,()=>!0,()=>!1)}function l_(){return()=>{}}var tu="Avatar",[u_]=t_(tu),[c_,Sh]=u_(tu),Eh=$.forwardRef((n,a)=>{const{__scopeAvatar:i,...s}=n,[u,l]=$.useState("idle");return H.jsx(c_,{scope:i,imageLoadingStatus:u,onImageLoadingStatusChange:l,children:H.jsx(Jl.span,{...s,ref:a})})});Eh.displayName=tu;var wh="AvatarImage",xh=$.forwardRef((n,a)=>{const{__scopeAvatar:i,src:s,onLoadingStatusChange:u=()=>{},...l}=n,c=Sh(wh,i),f=f_(s,l),d=Er(h=>{u(h),c.onImageLoadingStatusChange(h)});return Sr(()=>{f!=="idle"&&d(f)},[f,d]),f==="loaded"?H.jsx(Jl.img,{...l,ref:a,src:s}):null});xh.displayName=wh;var Ch="AvatarFallback",kh=$.forwardRef((n,a)=>{const{__scopeAvatar:i,delayMs:s,...u}=n,l=Sh(Ch,i),[c,f]=$.useState(s===void 0);return $.useEffect(()=>{if(s!==void 0){const d=window.setTimeout(()=>f(!0),s);return()=>window.clearTimeout(d)}},[s]),c&&l.imageLoadingStatus!=="loaded"?H.jsx(Jl.span,{...u,ref:a}):null});kh.displayName=Ch;function Th(n,a){return n?a?(n.src!==a&&(n.src=a),n.complete&&n.naturalWidth>0?"loaded":"loading"):"error":"idle"}function f_(n,{referrerPolicy:a,crossOrigin:i}){const s=o_(),u=$.useRef(null),l=s?(u.current||(u.current=new window.Image),u.current):null,[c,f]=$.useState(()=>Th(l,n));return Sr(()=>{f(Th(l,n))},[l,n]),Sr(()=>{const d=b=>()=>{f(b)};if(!l)return;const h=d("loaded"),y=d("error");return l.addEventListener("load",h),l.addEventListener("error",y),a&&(l.referrerPolicy=a),typeof i=="string"&&(l.crossOrigin=i),()=>{l.removeEventListener("load",h),l.removeEventListener("error",y)}},[l,i,a]),c}var Ah=Eh,Rh=xh,Nh=kh;const Oa=$.forwardRef(({className:n,...a},i)=>H.jsx(Ah,{ref:i,className:Ze("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",n),...a}));Oa.displayName=Ah.displayName;const Oh=$.forwardRef(({className:n,...a},i)=>H.jsx(Rh,{ref:i,className:Ze("aspect-square h-full w-full",n),...a}));Oh.displayName=Rh.displayName;const za=$.forwardRef(({className:n,...a},i)=>H.jsx(Nh,{ref:i,className:Ze("flex h-full w-full items-center justify-center rounded-full bg-muted",n),...a}));za.displayName=Nh.displayName;var ni={},Ma={},nu={},Da={},Ia={},ja={},zh;function d_(){if(zh)return ja;zh=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.EventEmitter=void 0;class n{eventListeners=new Map;on(i,s){const u=this.eventListeners.get(i)||new Set;u.add(s),this.eventListeners.set(i,u)}off(i,s){const u=this.eventListeners.get(i);u&&(u.delete(s),u.size===0&&this.eventListeners.delete(i))}emit(i,...s){const u=this.eventListeners.get(i);u&&u.forEach(l=>l(...s))}}return ja.EventEmitter=n,ja}var ri={},Mh;function ru(){return Mh||(Mh=1,Object.defineProperty(ri,"__esModule",{value:!0}),ri.DisconnectionReason=ri.ConnectionStatus=void 0,ri.ConnectionStatus={CONNECTING:"connecting",CONNECTED:"connected",NOT_CONNECTED:"not_connected"},ri.DisconnectionReason={CLIENT_CLOSED:"client_closed",SERVER_CLOSED:"server_closed",CONNECTION_ERROR:"connection_error",AUTHENTICATION_ERROR:"authentication_error",MAX_RECONNECT_ATTEMPTS:"max_reconnect_attempts",TIMEOUT:"timeout",NETWORK_ERROR:"network_error"}),ri}var Dh;function Ih(){if(Dh)return Ia;Dh=1,Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.BaseConnection=void 0;const n=d_(),a=ru();class i{status=a.ConnectionStatus.CONNECTING;queue=[];eventEmitter=new n.EventEmitter;disconnectionDetails=null;onErrorCallback=null;onDisconnectCallback=null;onMessageCallback=null;onOpenCallback=null;onStatusChangeCallback=null;getStatus(){return this.status}onOpen(u){this.onOpenCallback=u}onMessage(u){if(this.onMessageCallback=u,this.queue.length>0){const l=[...this.queue];this.queue.length=0,queueMicrotask(()=>{l.forEach(c=>{this.onMessageCallback?.(c)})})}}onDisconnect(u){this.onDisconnectCallback=u;const l=this.disconnectionDetails;l&&queueMicrotask(()=>{this.onDisconnectCallback?.(l)})}onError(u){this.onErrorCallback=u}on(u,l){this.eventEmitter.on(u,l)}off(u,l){this.eventEmitter.off(u,l)}emit(u,...l){this.eventEmitter.emit(u,...l)}onStatusChange(u){this.onStatusChangeCallback=u,queueMicrotask(()=>{u(this.status)})}disconnect(u){this.disconnectionDetails||(this.disconnectionDetails=u,this.updateStatus(a.ConnectionStatus.NOT_CONNECTED),this.onDisconnectCallback?.(u))}handleMessage(u){this.onMessageCallback?this.onMessageCallback(u):this.queue.push(u)}updateStatus(u){this.status!==u&&(this.status=u,this.onStatusChangeCallback?.(u))}}return Ia.BaseConnection=i,Ia}var iu={},jh;function Bn(){return jh||(jh=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ValidationError=n.ConfigurationError=n.StoreError=n.MessageError=n.SessionError=n.FileError=n.RecordingError=n.ConnectionError=n.InternalServerError=n.RateLimitError=n.MethodNotAllowedError=n.NotFoundError=n.PermissionDeniedError=n.UnauthorizedError=n.BadRequestError=n.APIConnectionTimeoutError=n.APIUserAbortError=n.APIError=n.SynapseError=n.SynapseErrorCode=void 0,n.normalizeError=j,n.SynapseErrorCode={API:"API_ERROR",CONNECTION:"CONNECTION_ERROR",RECORDING:"RECORDING_ERROR",FILE:"FILE_ERROR",SESSION:"SESSION_ERROR",MESSAGE:"MESSAGE_ERROR",STORE:"STORE_ERROR",CONFIGURATION:"CONFIGURATION_ERROR",VALIDATION:"VALIDATION_ERROR",AUTH:"AUTH_ERROR",UNKNOWN:"UNKNOWN_ERROR"};class a extends Error{code;timestamp;cause;context;hint;displayMessage;constructor(M,L=n.SynapseErrorCode.UNKNOWN,V={}){super(M),this.name="SynapseError",this.code=L,this.timestamp=new Date,this.cause=V.cause,this.context=V.context,this.hint=V.hint,this.displayMessage=V.displayMessage||V?.hint||M,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}n.SynapseError=a;class i extends a{status;error;headers;constructor(M,L,V,F){const W=i.makeMessage(L,V,M);super(W,n.SynapseErrorCode.API,{cause:V,context:{status:L,hasBody:!!V},hint:L&&L>=500?"Retry the request or contact support if the issue persists.":void 0,displayMessage:M||"Something went wrong"}),this.name="APIError",this.status=L,this.error=V,this.headers=F}static makeMessage(M,L,V){const F=L instanceof Error?L.message:V;return M&&F?`HTTP ${M}: ${F}`:M?`${M} status code (no body)`:F||"(no status code or body)"}static generate(M,L,V,F){if(!M)return new s({message:V});const W=L?.error,oe=W&&typeof W=="object"&&!Array.isArray(W)?W:void 0;switch(M){case 400:return new l(V||"Bad Request",M,oe,F);case 401:return new c(V||"Unauthorized",M,oe,F);case 403:return new f(V||"Permission Denied",M,oe,F);case 404:return new d(V||"Not Found",M,oe,F);case 405:return new h(V||"Method Not Allowed",M,oe,F);case 429:return new y(V||"Rate Limit Exceeded",M,oe,F);case 500:return new b(V||"Internal Server Error",M,oe,F);default:return new i(V||"API Error",M,oe,F)}}}n.APIError=i;class s extends i{constructor({message:M}={}){super(M||"Request was aborted.",void 0,void 0,void 0),this.name="APIUserAbortError"}}n.APIUserAbortError=s;class u extends i{constructor({message:M}={}){super(M||"Request timed out.",void 0,void 0,void 0),this.name="APIConnectionTimeoutError"}}n.APIConnectionTimeoutError=u;class l extends i{constructor(M,L,V,F){super(M,L,V,F),this.name="BadRequestError"}}n.BadRequestError=l;class c extends i{constructor(M,L,V,F){super(M,L,V,F),this.name="UnauthorizedError"}}n.UnauthorizedError=c;class f extends i{constructor(M,L,V,F){super(M,L,V,F),this.name="PermissionDeniedError"}}n.PermissionDeniedError=f;class d extends i{constructor(M,L,V,F){super(M,L,V,F),this.name="NotFoundError"}}n.NotFoundError=d;class h extends i{constructor(M,L,V,F){super(M,L,V,F),this.name="MethodNotAllowedError"}}n.MethodNotAllowedError=h;class y extends i{constructor(M,L,V,F){super(M,L,V,F),this.name="RateLimitError"}}n.RateLimitError=y;class b extends i{constructor(M,L,V,F){super(M,L,V,F),this.name="InternalServerError"}}n.InternalServerError=b;class _ extends a{constructor(M,L={}){super(M,n.SynapseErrorCode.CONNECTION,L),this.name="ConnectionError"}}n.ConnectionError=_;class m extends a{constructor(M,L={}){super(M,n.SynapseErrorCode.RECORDING,L),this.name="RecordingError"}}n.RecordingError=m;class C extends a{constructor(M,L={}){super(M,n.SynapseErrorCode.FILE,L),this.name="FileError"}}n.FileError=C;class S extends a{constructor(M,L={}){super(M,n.SynapseErrorCode.SESSION,L),this.name="SessionError"}}n.SessionError=S;class x extends a{constructor(M,L={}){super(M,n.SynapseErrorCode.MESSAGE,L),this.name="MessageError"}}n.MessageError=x;class w extends a{constructor(M,L={}){super(M,n.SynapseErrorCode.STORE,L),this.name="StoreError"}}n.StoreError=w;class k extends a{constructor(M,L={}){super(M,n.SynapseErrorCode.CONFIGURATION,L),this.name="ConfigurationError"}}n.ConfigurationError=k;class N extends a{constructor(M,L={}){super(M,n.SynapseErrorCode.VALIDATION,L),this.name="ValidationError"}}n.ValidationError=N;function j(D,M,L,V={}){if(D instanceof M)return D;const F={...V,context:{...D instanceof a?D.context:void 0,...V.context},hint:V.hint??(D instanceof a?D.hint:void 0),cause:V.cause??D};if(D instanceof a)return new M(D.message,F);const W=D instanceof Error&&D.message?D.message:L;return new M(W,F)}})(iu)),iu}var Lh;function Bh(){if(Lh)return Da;Lh=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.WebSocketConnection=void 0;const n=Ih(),a=ru(),i=Bn();class s extends n.BaseConnection{conversationId;socket=null;config;reconnectCount=0;constructor(l){super(),this.config={...l,reconnect:l.reconnect||!0,reconnectAttempts:l.reconnectAttempts||3,reconnectDelay:l.reconnectDelay||1e3},this.conversationId=l.auth.sessionId,this.connect()}connect(){try{this.updateStatus(a.ConnectionStatus.CONNECTING);const l=this.buildConnectionUrl();this.socket=new WebSocket(l),this.socket.onopen=this.handleOpen.bind(this),this.socket.onmessage=this.handleSocketMessage.bind(this),this.socket.onerror=this.handleError.bind(this),this.socket.onclose=this.handleClose.bind(this)}catch(l){const c=(0,i.normalizeError)(l,i.ConnectionError,"Failed to establish WebSocket connection",{context:{stage:"connect"}});this.onErrorCallback?.(c),this.disconnect({reason:a.DisconnectionReason.CONNECTION_ERROR,message:c.message,timestamp:new Date})}}buildConnectionUrl(){const l=new URL(this.config.serverUrl);return l.pathname=`/reloaded/ws/med-assist/session/${this.config.auth.sessionId}/`,l.toString()}handleOpen(){this.onOpenCallback?.()}handleSocketMessage(l){try{const c=JSON.parse(l.data);this.handleMessage(c)}catch(c){const f=(0,i.normalizeError)(c,i.MessageError,"Failed to parse incoming WebSocket message",{context:{stage:"handleSocketMessage"}});this.onErrorCallback?.(f)}}handleError(l){const c=new i.ConnectionError("WebSocket error",{context:{stage:"handleError"},cause:l});this.onErrorCallback?.(c)}handleClose(l){const c=l.wasClean,f=l.code,d=l.reason;let h,y;f===1e3?(h=a.DisconnectionReason.CLIENT_CLOSED,y="Connection closed normally"):f===1001||f===1006?(h=a.DisconnectionReason.NETWORK_ERROR,y="Network connection lost"):f===4001?(h=a.DisconnectionReason.AUTHENTICATION_ERROR,y="Authentication failed"):c?(h=a.DisconnectionReason.SERVER_CLOSED,y=d||"Server closed connection"):(h=a.DisconnectionReason.CONNECTION_ERROR,y=d||"Connection closed unexpectedly"),this.config.reconnect&&h!==a.DisconnectionReason.AUTHENTICATION_ERROR&&h!==a.DisconnectionReason.CLIENT_CLOSED&&this.reconnectCount<(this.config.reconnectAttempts||3)?(this.reconnectCount++,setTimeout(()=>{this.connect()},this.config.reconnectDelay||1e3)):this.disconnect({reason:h,message:y,code:f,timestamp:new Date})}sendMessage(l){if(!this.socket||this.socket.readyState!==WebSocket.OPEN)throw new i.ConnectionError("Cannot send message: connection not open",{context:{stage:"sendMessage",readyState:this.socket?.readyState},hint:"Ensure the WebSocket is open before sending messages."});try{this.socket.send(JSON.stringify(l))}catch(c){const f=(0,i.normalizeError)(c,i.ConnectionError,"Failed to send WebSocket message",{context:{stage:"sendMessage"}});throw this.onErrorCallback?.(f),f}}close(){this.socket&&(this.updateStatus(a.ConnectionStatus.NOT_CONNECTED),this.socket.close(1e3,"Client closed connection"),this.socket=null)}isConnected(){return this.socket?.readyState===WebSocket.OPEN}handleConnected(){this.updateStatus(a.ConnectionStatus.CONNECTED),this.reconnectCount=0}}return Da.WebSocketConnection=s,Da}var Uh;function Fh(){return Uh||(Uh=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ConnectionFactory=n.ConnectionType=void 0;const a=Bh(),i=Bn();n.ConnectionType={SOCKET:"socket"};class s{static async createConnection(l,c){switch(l){case n.ConnectionType.SOCKET:return new a.WebSocketConnection(c);default:throw new i.ConnectionError(`Unsupported connection type: ${l}`,{context:{type:l}})}}}n.ConnectionFactory=s})(nu)),nu}var ii={},Ph;function h_(){if(Ph)return ii;Ph=1,Object.defineProperty(ii,"__esModule",{value:!0}),ii.SYNAPSE_TOOL_NAME=ii.getConfig=void 0;const n={WEBSOCKET_URL:"wss://matrix-ws.eka.care/reloaded",BASE_API_URL:"https://matrix.eka.care/reloaded"},a={WEBSOCKET_URL:"wss://matrix-ws.dev.eka.care/reloaded",BASE_API_URL:"https://matrix.dev.eka.care/reloaded"},i={WEBSOCKET_URL:"wss://matrix-ws.dev.eka.care",BASE_API_URL:"https://matrix.dev.eka.care"},s=(l="production")=>l==="development"?a:l==="production"?n:l==="staging"?i:n;ii.getConfig=s;var u;return(function(l){l.MOBILE_VERIFICATION="mobile_verification",l.AVAILABILITY_DATES="availability_dates",l.AVAILABILITY_SLOTS="availability_slots",l.DOCTOR_DETAILS="doctor_details",l.GET_LOCATION="get_location"})(u||(ii.SYNAPSE_TOOL_NAME=u={})),ii}var La={},Ba={},Hh;function qh(){if(Hh)return Ba;Hh=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.HttpClient=void 0;const n=Bn();class a{baseUrl;headers;timeout;maxRetries;constructor(s){this.baseUrl=s.baseUrl.replace(/\/$/,""),this.timeout=s.timeout||3e4,this.maxRetries=s.maxRetries||3,this.headers={"Content-Type":"application/json",...s.headers},s.authorization&&(this.headers.Authorization=s.authorization)}async request(s,u,l){const c=l?.retries??this.maxRetries;let f;for(let d=0;d<=c;d++)try{const h=this.buildUrl(u,l?.params),y=await fetch(h,{method:s,headers:{...this.headers,...l?.headers},body:l?.body?JSON.stringify(l.body):void 0,signal:AbortSignal.timeout(this.timeout)});return y.ok||await this.handleError(y),y.json()}catch(h){if(f=h,d===c||!(h instanceof TypeError&&h.message==="Failed to fetch"||h instanceof DOMException&&h.name==="AbortError"||h instanceof SyntaxError))break;const b=Math.pow(2,d)*100;await new Promise(_=>setTimeout(_,b))}throw f?f instanceof TypeError&&f.message==="Failed to fetch"?new n.APIError("Network error: Unable to connect to the server. Please check your internet connection.",0,{type:"NETWORK_ERROR",originalError:f.message}):f instanceof DOMException&&f.name==="AbortError"?new n.APIConnectionTimeoutError({message:`Request timed out after ${this.timeout}ms`}):f instanceof SyntaxError?new n.APIError("Invalid response format from server",502,{type:"PARSE_ERROR",originalError:f.message}):f instanceof n.APIError?f:new n.APIError(`Request failed: ${f.message||"Unknown error"}`,500,{type:"UNKNOWN_ERROR",originalError:f}):new n.APIError("Unknown error occurred",500,{type:"UNKNOWN_ERROR"})}async get(s,u,l){return this.request("GET",s,{params:u,...l})}async post(s,u,l){return this.request("POST",s,{body:u,...l})}async put(s,u,l){return this.request("PUT",s,{body:u,...l})}async delete(s,u){return this.request("DELETE",s,{...u})}async patch(s,u,l){return this.request("PATCH",s,{body:u,...l})}buildUrl(s,u){let l=`${this.baseUrl}${s}`;if(u){const c=new URLSearchParams(u).toString();l+=`?${c}`}return l}async handleError(s){let u,l;try{l=await s.json(),u=l.message||l?.msg||s.statusText}catch{u=s.statusText}throw n.APIError.generate(s.status,l,u,s.headers)}}return Ba.HttpClient=a,Ba}var Ua={},Fa={},Gh;function Vh(){if(Gh)return Fa;Gh=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.BaseResource=void 0;class n{client;constructor(i){this.client=i}async get(i,s,u){return this.client.get(i,s,u)}async post(i,s,u){return this.client.post(i,s,u)}async put(i,s,u){return this.client.put(i,s,u)}async delete(i,s){return this.client.delete(i,s)}async patch(i,s,u){return this.client.patch(i,s,u)}buildPath(i,s){let u=i;for(const[l,c]of Object.entries(s))u=u.replace(`:${l}`,encodeURIComponent(c));return u}}return Fa.BaseResource=n,Fa}var Yh;function Zh(){if(Yh)return Ua;Yh=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.Session=void 0;const n=Vh();class a extends n.BaseResource{basePath="/med-assist/session";async create(s){return this.post(this.basePath,{user_id:s})}async retrieve(s){return this.get(`${this.basePath}/${s}`)}async refresh(s,u){return this.get(`${this.basePath}/${s}/refresh`,void 0,{headers:{"x-sess-token":u}})}async feedback(s,u,l,c){return this.patch(`${this.basePath}/${s}/${u}`,{feedback:l,feedback_reason:c})}}return Ua.Session=a,Ua}var Pa={},Wn={},Xh;function Kh(){if(Xh)return Wn;Xh=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.SYNAPSE_TOOL_CALLBACK_NAME=Wn.SYNAPSE_COMPONENTS=Wn.SYNAPSE_TOOL_NAME=void 0;var n;(function(i){i.MOBILE_VERIFICATION="mobile_verification",i.AVAILABILITY_DATES="availability_dates",i.AVAILABILITY_SLOTS="availability_slots",i.DOCTOR_DETAILS="doctor_details",i.GET_LOCATION="get_location"})(n||(Wn.SYNAPSE_TOOL_NAME=n={})),Wn.SYNAPSE_COMPONENTS={MOBILE_VERIFICATION:"mobile_verification",PILL:"pills",MULTI:"multi",DOCTOR_CARD:"doctor_card"};var a;return(function(i){i.AVAILABILITY_DATES="tool_callback_availability_dates",i.AVAILABILITY_SLOTS="tool_callback_availability_slots",i.MOBILE_VERIFICATION="tool_callback_mobile_verification",i.DOCTOR_DETAILS="tool_callback_doctor_details"})(a||(Wn.SYNAPSE_TOOL_CALLBACK_NAME=a={})),Wn}var Qh;function Wh(){if(Qh)return Pa;Qh=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.ToolCall=void 0;const n=Vh(),a=Kh();class i extends n.BaseResource{basePath="/med-assist/api-call-tool";async callTool(u,l,c){return l===a.SYNAPSE_TOOL_NAME.GET_LOCATION?this.requestLocation():this.post(`${this.basePath}?session_id=${u}&tool_name=${l}`,{tool_params:c})}async requestLocation(){return new Promise((u,l)=>{if(typeof navigator>"u"||!navigator.geolocation){l({code:500,message:"Geolocation is not supported by this browser",status:500,type:"GEOLOCATION_ERROR",originalError:new Error("Geolocation is not supported by this browser")});return}navigator.geolocation.getCurrentPosition(c=>{u({latitude:c.coords.latitude,longitude:c.coords.longitude,accuracy:c.coords?.accuracy??void 0})},c=>{l({code:c.code,message:c.message,status:500,type:"GEOLOCATION_ERROR",originalError:c})},{timeout:1e4,maximumAge:0,enableHighAccuracy:!0})})}}return Pa.ToolCall=i,Pa}var Jh;function $h(){if(Jh)return La;Jh=1,Object.defineProperty(La,"__esModule",{value:!0}),La.ResourceManager=void 0;const n=qh(),a=Zh(),i=Bn(),s=Wh();class u{resourceConfig;httpClient;session;toolCall=null;constructor(c){this.resourceConfig=c,this.httpClient=new n.HttpClient({baseUrl:this.resourceConfig.serverUrl,headers:{"X-agent-id":this.resourceConfig.agentId}}),this.session=new a.Session(this.httpClient)}async createSession(c){try{const f=await this.session.create(c);if(!f?.session_id||!f?.session_token)throw new i.APIError("Failed to start session.",500,void 0,void 0);return f}catch(f){throw f instanceof i.APIError?f:new i.APIError("Failed to start session.",500,void 0,void 0)}}async validateSession(c){try{const f=await this.session.retrieve(c);return f.msg&&f.msg==="Session Active"?{expired:!1,active:!0}:{expired:!0,active:!1}}catch(f){if(f instanceof i.APIError)switch(f.status){case 404:return{expired:!1,active:!1};case 500:return{expired:!1,active:!1};case 401:return{expired:!0,active:!1};default:return{expired:!1,active:!1}}throw new i.APIError("Failed to validate session.",500,void 0,void 0)}}async refreshSession(c,f){return await this.session.refresh(c,f)}async sendFeedback(c,f,d,h){return await this.session.feedback(c,f,d,h)}async callTool(c,f,d){return this.toolCall||(this.toolCall=new s.ToolCall(this.httpClient)),await this.toolCall.callTool(c,f,d)}}return La.ResourceManager=u,La}var Ha={},au={},ep;function su(){return ep||(ep=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.MULTI_SELECT_ADDITIONAL_OPTION=n.SOCKET_EVENTS=n.SOCKET_CONTENT_TYPES=void 0,n.IsValidSocketMesssage=a,n.SOCKET_CONTENT_TYPES={TEXT:"text",AUDIO:"audio",FILE:"file",TOOL_CALL:"tool",TIPS:"tips",INLINE_TEXT:"inline_text",TOOL_START:"tool_start",TOOL_END:"tool_end"},n.SOCKET_EVENTS={PING:"ping",PONG:"pong",CHAT:"chat",STREAM:"stream",AUTH:"auth",END_OF_STREAM:"eos",SYNC:"sync",ERROR:"err",CONNECTION_ESTABLISHED:"conn"},n.MULTI_SELECT_ADDITIONAL_OPTION={NOTA:"none_of_the_above",AOTA:"all_of_the_above"};function a(i){return[n.SOCKET_EVENTS.PING,n.SOCKET_EVENTS.PONG,n.SOCKET_EVENTS.ERROR,n.SOCKET_EVENTS.SYNC,n.SOCKET_EVENTS.CONNECTION_ESTABLISHED,n.SOCKET_EVENTS.CHAT,n.SOCKET_EVENTS.STREAM,n.SOCKET_EVENTS.END_OF_STREAM].includes(i.ev)}})(au)),au}var ai={};function xr(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ou={exports:{}};var tp;function p_(){return tp||(tp=1,(function(n,a){(function(i){n.exports=i()})(function(){return(function i(s,u,l){function c(h,y){if(!u[h]){if(!s[h]){var b=typeof xr=="function"&&xr;if(!y&&b)return b(h,!0);if(f)return f(h,!0);var _=new Error("Cannot find module '"+h+"'");throw _.code="MODULE_NOT_FOUND",_}var m=u[h]={exports:{}};s[h][0].call(m.exports,function(C){var S=s[h][1][C];return c(S||C)},m,m.exports,i,s,u,l)}return u[h].exports}for(var f=typeof xr=="function"&&xr,d=0;d<l.length;d++)c(l[d]);return c})({1:[function(i,s,u){var l=i("./utils"),c=i("./support"),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";u.encode=function(d){for(var h,y,b,_,m,C,S,x=[],w=0,k=d.length,N=k,j=l.getTypeOf(d)!=="string";w<d.length;)N=k-w,b=j?(h=d[w++],y=w<k?d[w++]:0,w<k?d[w++]:0):(h=d.charCodeAt(w++),y=w<k?d.charCodeAt(w++):0,w<k?d.charCodeAt(w++):0),_=h>>2,m=(3&h)<<4|y>>4,C=1<N?(15&y)<<2|b>>6:64,S=2<N?63&b:64,x.push(f.charAt(_)+f.charAt(m)+f.charAt(C)+f.charAt(S));return x.join("")},u.decode=function(d){var h,y,b,_,m,C,S=0,x=0,w="data:";if(d.substr(0,w.length)===w)throw new Error("Invalid base64 input, it looks like a data url.");var k,N=3*(d=d.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(d.charAt(d.length-1)===f.charAt(64)&&N--,d.charAt(d.length-2)===f.charAt(64)&&N--,N%1!=0)throw new Error("Invalid base64 input, bad content length.");for(k=c.uint8array?new Uint8Array(0|N):new Array(0|N);S<d.length;)h=f.indexOf(d.charAt(S++))<<2|(_=f.indexOf(d.charAt(S++)))>>4,y=(15&_)<<4|(m=f.indexOf(d.charAt(S++)))>>2,b=(3&m)<<6|(C=f.indexOf(d.charAt(S++))),k[x++]=h,m!==64&&(k[x++]=y),C!==64&&(k[x++]=b);return k}},{"./support":30,"./utils":32}],2:[function(i,s,u){var l=i("./external"),c=i("./stream/DataWorker"),f=i("./stream/Crc32Probe"),d=i("./stream/DataLengthProbe");function h(y,b,_,m,C){this.compressedSize=y,this.uncompressedSize=b,this.crc32=_,this.compression=m,this.compressedContent=C}h.prototype={getContentWorker:function(){var y=new c(l.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new d("data_length")),b=this;return y.on("end",function(){if(this.streamInfo.data_length!==b.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),y},getCompressedWorker:function(){return new c(l.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},h.createWorkerFrom=function(y,b,_){return y.pipe(new f).pipe(new d("uncompressedSize")).pipe(b.compressWorker(_)).pipe(new d("compressedSize")).withStreamInfo("compression",b)},s.exports=h},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,s,u){var l=i("./stream/GenericWorker");u.STORE={magic:"\0\0",compressWorker:function(){return new l("STORE compression")},uncompressWorker:function(){return new l("STORE decompression")}},u.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,s,u){var l=i("./utils"),c=(function(){for(var f,d=[],h=0;h<256;h++){f=h;for(var y=0;y<8;y++)f=1&f?3988292384^f>>>1:f>>>1;d[h]=f}return d})();s.exports=function(f,d){return f!==void 0&&f.length?l.getTypeOf(f)!=="string"?(function(h,y,b,_){var m=c,C=_+b;h^=-1;for(var S=_;S<C;S++)h=h>>>8^m[255&(h^y[S])];return-1^h})(0|d,f,f.length,0):(function(h,y,b,_){var m=c,C=_+b;h^=-1;for(var S=_;S<C;S++)h=h>>>8^m[255&(h^y.charCodeAt(S))];return-1^h})(0|d,f,f.length,0):0}},{"./utils":32}],5:[function(i,s,u){u.base64=!1,u.binary=!1,u.dir=!1,u.createFolders=!0,u.date=null,u.compression=null,u.compressionOptions=null,u.comment=null,u.unixPermissions=null,u.dosPermissions=null},{}],6:[function(i,s,u){var l=null;l=typeof Promise<"u"?Promise:i("lie"),s.exports={Promise:l}},{lie:37}],7:[function(i,s,u){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",c=i("pako"),f=i("./utils"),d=i("./stream/GenericWorker"),h=l?"uint8array":"array";function y(b,_){d.call(this,"FlateWorker/"+b),this._pako=null,this._pakoAction=b,this._pakoOptions=_,this.meta={}}u.magic="\b\0",f.inherits(y,d),y.prototype.processChunk=function(b){this.meta=b.meta,this._pako===null&&this._createPako(),this._pako.push(f.transformTo(h,b.data),!1)},y.prototype.flush=function(){d.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new c[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var b=this;this._pako.onData=function(_){b.push({data:_,meta:b.meta})}},u.compressWorker=function(b){return new y("Deflate",b)},u.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,s,u){function l(m,C){var S,x="";for(S=0;S<C;S++)x+=String.fromCharCode(255&m),m>>>=8;return x}function c(m,C,S,x,w,k){var N,j,D=m.file,M=m.compression,L=k!==h.utf8encode,V=f.transformTo("string",k(D.name)),F=f.transformTo("string",h.utf8encode(D.name)),W=D.comment,oe=f.transformTo("string",k(W)),R=f.transformTo("string",h.utf8encode(W)),Q=F.length!==D.name.length,E=R.length!==W.length,G="",J="",K="",ue=D.dir,re=D.date,q={crc32:0,compressedSize:0,uncompressedSize:0};C&&!S||(q.crc32=m.crc32,q.compressedSize=m.compressedSize,q.uncompressedSize=m.uncompressedSize);var z=0;C&&(z|=8),L||!Q&&!E||(z|=2048);var I=0,B=0;ue&&(I|=16),w==="UNIX"?(B=798,I|=(function(ae,xe){var Te=ae;return ae||(Te=xe?16893:33204),(65535&Te)<<16})(D.unixPermissions,ue)):(B=20,I|=(function(ae){return 63&(ae||0)})(D.dosPermissions)),N=re.getUTCHours(),N<<=6,N|=re.getUTCMinutes(),N<<=5,N|=re.getUTCSeconds()/2,j=re.getUTCFullYear()-1980,j<<=4,j|=re.getUTCMonth()+1,j<<=5,j|=re.getUTCDate(),Q&&(J=l(1,1)+l(y(V),4)+F,G+="up"+l(J.length,2)+J),E&&(K=l(1,1)+l(y(oe),4)+R,G+="uc"+l(K.length,2)+K);var te="";return te+=`
|
|
10
|
-
\0`,te+=l(z,2),te+=M.magic,te+=l(N,2),te+=l(j,2),te+=l(q.crc32,4),te+=l(q.compressedSize,4),te+=l(q.uncompressedSize,4),te+=l(V.length,2),te+=l(G.length,2),{fileRecord:b.LOCAL_FILE_HEADER+te+V+G,dirRecord:b.CENTRAL_FILE_HEADER+l(B,2)+te+l(oe.length,2)+"\0\0\0\0"+l(I,4)+l(x,4)+V+G+oe}}var f=i("../utils"),d=i("../stream/GenericWorker"),h=i("../utf8"),y=i("../crc32"),b=i("../signature");function _(m,C,S,x){d.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=C,this.zipPlatform=S,this.encodeFileName=x,this.streamFiles=m,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}f.inherits(_,d),_.prototype.push=function(m){var C=m.meta.percent||0,S=this.entriesCount,x=this._sources.length;this.accumulate?this.contentBuffer.push(m):(this.bytesWritten+=m.data.length,d.prototype.push.call(this,{data:m.data,meta:{currentFile:this.currentFile,percent:S?(C+100*(S-x-1))/S:100}}))},_.prototype.openedSource=function(m){this.currentSourceOffset=this.bytesWritten,this.currentFile=m.file.name;var C=this.streamFiles&&!m.file.dir;if(C){var S=c(m,C,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:S.fileRecord,meta:{percent:0}})}else this.accumulate=!0},_.prototype.closedSource=function(m){this.accumulate=!1;var C=this.streamFiles&&!m.file.dir,S=c(m,C,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(S.dirRecord),C)this.push({data:(function(x){return b.DATA_DESCRIPTOR+l(x.crc32,4)+l(x.compressedSize,4)+l(x.uncompressedSize,4)})(m),meta:{percent:100}});else for(this.push({data:S.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},_.prototype.flush=function(){for(var m=this.bytesWritten,C=0;C<this.dirRecords.length;C++)this.push({data:this.dirRecords[C],meta:{percent:100}});var S=this.bytesWritten-m,x=(function(w,k,N,j,D){var M=f.transformTo("string",D(j));return b.CENTRAL_DIRECTORY_END+"\0\0\0\0"+l(w,2)+l(w,2)+l(k,4)+l(N,4)+l(M.length,2)+M})(this.dirRecords.length,S,m,this.zipComment,this.encodeFileName);this.push({data:x,meta:{percent:100}})},_.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},_.prototype.registerPrevious=function(m){this._sources.push(m);var C=this;return m.on("data",function(S){C.processChunk(S)}),m.on("end",function(){C.closedSource(C.previous.streamInfo),C._sources.length?C.prepareNextSource():C.end()}),m.on("error",function(S){C.error(S)}),this},_.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},_.prototype.error=function(m){var C=this._sources;if(!d.prototype.error.call(this,m))return!1;for(var S=0;S<C.length;S++)try{C[S].error(m)}catch{}return!0},_.prototype.lock=function(){d.prototype.lock.call(this);for(var m=this._sources,C=0;C<m.length;C++)m[C].lock()},s.exports=_},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(i,s,u){var l=i("../compressions"),c=i("./ZipFileWorker");u.generateWorker=function(f,d,h){var y=new c(d.streamFiles,h,d.platform,d.encodeFileName),b=0;try{f.forEach(function(_,m){b++;var C=(function(k,N){var j=k||N,D=l[j];if(!D)throw new Error(j+" is not a valid compression method !");return D})(m.options.compression,d.compression),S=m.options.compressionOptions||d.compressionOptions||{},x=m.dir,w=m.date;m._compressWorker(C,S).withStreamInfo("file",{name:_,dir:x,date:w,comment:m.comment||"",unixPermissions:m.unixPermissions,dosPermissions:m.dosPermissions}).pipe(y)}),y.entriesCount=b}catch(_){y.error(_)}return y}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(i,s,u){function l(){if(!(this instanceof l))return new l;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var c=new l;for(var f in this)typeof this[f]!="function"&&(c[f]=this[f]);return c}}(l.prototype=i("./object")).loadAsync=i("./load"),l.support=i("./support"),l.defaults=i("./defaults"),l.version="3.10.1",l.loadAsync=function(c,f){return new l().loadAsync(c,f)},l.external=i("./external"),s.exports=l},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(i,s,u){var l=i("./utils"),c=i("./external"),f=i("./utf8"),d=i("./zipEntries"),h=i("./stream/Crc32Probe"),y=i("./nodejsUtils");function b(_){return new c.Promise(function(m,C){var S=_.decompressed.getContentWorker().pipe(new h);S.on("error",function(x){C(x)}).on("end",function(){S.streamInfo.crc32!==_.decompressed.crc32?C(new Error("Corrupted zip : CRC32 mismatch")):m()}).resume()})}s.exports=function(_,m){var C=this;return m=l.extend(m||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:f.utf8decode}),y.isNode&&y.isStream(_)?c.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):l.prepareContent("the loaded zip file",_,!0,m.optimizedBinaryString,m.base64).then(function(S){var x=new d(m);return x.load(S),x}).then(function(S){var x=[c.Promise.resolve(S)],w=S.files;if(m.checkCRC32)for(var k=0;k<w.length;k++)x.push(b(w[k]));return c.Promise.all(x)}).then(function(S){for(var x=S.shift(),w=x.files,k=0;k<w.length;k++){var N=w[k],j=N.fileNameStr,D=l.resolve(N.fileNameStr);C.file(D,N.decompressed,{binary:!0,optimizedBinaryString:!0,date:N.date,dir:N.dir,comment:N.fileCommentStr.length?N.fileCommentStr:null,unixPermissions:N.unixPermissions,dosPermissions:N.dosPermissions,createFolders:m.createFolders}),N.dir||(C.file(D).unsafeOriginalName=j)}return x.zipComment.length&&(C.comment=x.zipComment),C})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(i,s,u){var l=i("../utils"),c=i("../stream/GenericWorker");function f(d,h){c.call(this,"Nodejs stream input adapter for "+d),this._upstreamEnded=!1,this._bindStream(h)}l.inherits(f,c),f.prototype._bindStream=function(d){var h=this;(this._stream=d).pause(),d.on("data",function(y){h.push({data:y,meta:{percent:0}})}).on("error",function(y){h.isPaused?this.generatedError=y:h.error(y)}).on("end",function(){h.isPaused?h._upstreamEnded=!0:h.end()})},f.prototype.pause=function(){return!!c.prototype.pause.call(this)&&(this._stream.pause(),!0)},f.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},s.exports=f},{"../stream/GenericWorker":28,"../utils":32}],13:[function(i,s,u){var l=i("readable-stream").Readable;function c(f,d,h){l.call(this,d),this._helper=f;var y=this;f.on("data",function(b,_){y.push(b)||y._helper.pause(),h&&h(_)}).on("error",function(b){y.emit("error",b)}).on("end",function(){y.push(null)})}i("../utils").inherits(c,l),c.prototype._read=function(){this._helper.resume()},s.exports=c},{"../utils":32,"readable-stream":16}],14:[function(i,s,u){s.exports={isNode:typeof Buffer<"u",newBufferFrom:function(l,c){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(l,c);if(typeof l=="number")throw new Error('The "data" argument must not be a number');return new Buffer(l,c)},allocBuffer:function(l){if(Buffer.alloc)return Buffer.alloc(l);var c=new Buffer(l);return c.fill(0),c},isBuffer:function(l){return Buffer.isBuffer(l)},isStream:function(l){return l&&typeof l.on=="function"&&typeof l.pause=="function"&&typeof l.resume=="function"}}},{}],15:[function(i,s,u){function l(D,M,L){var V,F=f.getTypeOf(M),W=f.extend(L||{},y);W.date=W.date||new Date,W.compression!==null&&(W.compression=W.compression.toUpperCase()),typeof W.unixPermissions=="string"&&(W.unixPermissions=parseInt(W.unixPermissions,8)),W.unixPermissions&&16384&W.unixPermissions&&(W.dir=!0),W.dosPermissions&&16&W.dosPermissions&&(W.dir=!0),W.dir&&(D=w(D)),W.createFolders&&(V=x(D))&&k.call(this,V,!0);var oe=F==="string"&&W.binary===!1&&W.base64===!1;L&&L.binary!==void 0||(W.binary=!oe),(M instanceof b&&M.uncompressedSize===0||W.dir||!M||M.length===0)&&(W.base64=!1,W.binary=!0,M="",W.compression="STORE",F="string");var R=null;R=M instanceof b||M instanceof d?M:C.isNode&&C.isStream(M)?new S(D,M):f.prepareContent(D,M,W.binary,W.optimizedBinaryString,W.base64);var Q=new _(D,R,W);this.files[D]=Q}var c=i("./utf8"),f=i("./utils"),d=i("./stream/GenericWorker"),h=i("./stream/StreamHelper"),y=i("./defaults"),b=i("./compressedObject"),_=i("./zipObject"),m=i("./generate"),C=i("./nodejsUtils"),S=i("./nodejs/NodejsStreamInputAdapter"),x=function(D){D.slice(-1)==="/"&&(D=D.substring(0,D.length-1));var M=D.lastIndexOf("/");return 0<M?D.substring(0,M):""},w=function(D){return D.slice(-1)!=="/"&&(D+="/"),D},k=function(D,M){return M=M!==void 0?M:y.createFolders,D=w(D),this.files[D]||l.call(this,D,null,{dir:!0,createFolders:M}),this.files[D]};function N(D){return Object.prototype.toString.call(D)==="[object RegExp]"}var j={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(D){var M,L,V;for(M in this.files)V=this.files[M],(L=M.slice(this.root.length,M.length))&&M.slice(0,this.root.length)===this.root&&D(L,V)},filter:function(D){var M=[];return this.forEach(function(L,V){D(L,V)&&M.push(V)}),M},file:function(D,M,L){if(arguments.length!==1)return D=this.root+D,l.call(this,D,M,L),this;if(N(D)){var V=D;return this.filter(function(W,oe){return!oe.dir&&V.test(W)})}var F=this.files[this.root+D];return F&&!F.dir?F:null},folder:function(D){if(!D)return this;if(N(D))return this.filter(function(F,W){return W.dir&&D.test(F)});var M=this.root+D,L=k.call(this,M),V=this.clone();return V.root=L.name,V},remove:function(D){D=this.root+D;var M=this.files[D];if(M||(D.slice(-1)!=="/"&&(D+="/"),M=this.files[D]),M&&!M.dir)delete this.files[D];else for(var L=this.filter(function(F,W){return W.name.slice(0,D.length)===D}),V=0;V<L.length;V++)delete this.files[L[V].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(D){var M,L={};try{if((L=f.extend(D||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:c.utf8encode})).type=L.type.toLowerCase(),L.compression=L.compression.toUpperCase(),L.type==="binarystring"&&(L.type="string"),!L.type)throw new Error("No output type specified.");f.checkSupport(L.type),L.platform!=="darwin"&&L.platform!=="freebsd"&&L.platform!=="linux"&&L.platform!=="sunos"||(L.platform="UNIX"),L.platform==="win32"&&(L.platform="DOS");var V=L.comment||this.comment||"";M=m.generateWorker(this,L,V)}catch(F){(M=new d("error")).error(F)}return new h(M,L.type||"string",L.mimeType)},generateAsync:function(D,M){return this.generateInternalStream(D).accumulate(M)},generateNodeStream:function(D,M){return(D=D||{}).type||(D.type="nodebuffer"),this.generateInternalStream(D).toNodejsStream(M)}};s.exports=j},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(i,s,u){s.exports=i("stream")},{stream:void 0}],17:[function(i,s,u){var l=i("./DataReader");function c(f){l.call(this,f);for(var d=0;d<this.data.length;d++)f[d]=255&f[d]}i("../utils").inherits(c,l),c.prototype.byteAt=function(f){return this.data[this.zero+f]},c.prototype.lastIndexOfSignature=function(f){for(var d=f.charCodeAt(0),h=f.charCodeAt(1),y=f.charCodeAt(2),b=f.charCodeAt(3),_=this.length-4;0<=_;--_)if(this.data[_]===d&&this.data[_+1]===h&&this.data[_+2]===y&&this.data[_+3]===b)return _-this.zero;return-1},c.prototype.readAndCheckSignature=function(f){var d=f.charCodeAt(0),h=f.charCodeAt(1),y=f.charCodeAt(2),b=f.charCodeAt(3),_=this.readData(4);return d===_[0]&&h===_[1]&&y===_[2]&&b===_[3]},c.prototype.readData=function(f){if(this.checkOffset(f),f===0)return[];var d=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,d},s.exports=c},{"../utils":32,"./DataReader":18}],18:[function(i,s,u){var l=i("../utils");function c(f){this.data=f,this.length=f.length,this.index=0,this.zero=0}c.prototype={checkOffset:function(f){this.checkIndex(this.index+f)},checkIndex:function(f){if(this.length<this.zero+f||f<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+f+"). Corrupted zip ?")},setIndex:function(f){this.checkIndex(f),this.index=f},skip:function(f){this.setIndex(this.index+f)},byteAt:function(){},readInt:function(f){var d,h=0;for(this.checkOffset(f),d=this.index+f-1;d>=this.index;d--)h=(h<<8)+this.byteAt(d);return this.index+=f,h},readString:function(f){return l.transformTo("string",this.readData(f))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var f=this.readInt(4);return new Date(Date.UTC(1980+(f>>25&127),(f>>21&15)-1,f>>16&31,f>>11&31,f>>5&63,(31&f)<<1))}},s.exports=c},{"../utils":32}],19:[function(i,s,u){var l=i("./Uint8ArrayReader");function c(f){l.call(this,f)}i("../utils").inherits(c,l),c.prototype.readData=function(f){this.checkOffset(f);var d=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,d},s.exports=c},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(i,s,u){var l=i("./DataReader");function c(f){l.call(this,f)}i("../utils").inherits(c,l),c.prototype.byteAt=function(f){return this.data.charCodeAt(this.zero+f)},c.prototype.lastIndexOfSignature=function(f){return this.data.lastIndexOf(f)-this.zero},c.prototype.readAndCheckSignature=function(f){return f===this.readData(4)},c.prototype.readData=function(f){this.checkOffset(f);var d=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,d},s.exports=c},{"../utils":32,"./DataReader":18}],21:[function(i,s,u){var l=i("./ArrayReader");function c(f){l.call(this,f)}i("../utils").inherits(c,l),c.prototype.readData=function(f){if(this.checkOffset(f),f===0)return new Uint8Array(0);var d=this.data.subarray(this.zero+this.index,this.zero+this.index+f);return this.index+=f,d},s.exports=c},{"../utils":32,"./ArrayReader":17}],22:[function(i,s,u){var l=i("../utils"),c=i("../support"),f=i("./ArrayReader"),d=i("./StringReader"),h=i("./NodeBufferReader"),y=i("./Uint8ArrayReader");s.exports=function(b){var _=l.getTypeOf(b);return l.checkSupport(_),_!=="string"||c.uint8array?_==="nodebuffer"?new h(b):c.uint8array?new y(l.transformTo("uint8array",b)):new f(l.transformTo("array",b)):new d(b)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(i,s,u){u.LOCAL_FILE_HEADER="PK",u.CENTRAL_FILE_HEADER="PK",u.CENTRAL_DIRECTORY_END="PK",u.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",u.ZIP64_CENTRAL_DIRECTORY_END="PK",u.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(i,s,u){var l=i("./GenericWorker"),c=i("../utils");function f(d){l.call(this,"ConvertWorker to "+d),this.destType=d}c.inherits(f,l),f.prototype.processChunk=function(d){this.push({data:c.transformTo(this.destType,d.data),meta:d.meta})},s.exports=f},{"../utils":32,"./GenericWorker":28}],25:[function(i,s,u){var l=i("./GenericWorker"),c=i("../crc32");function f(){l.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}i("../utils").inherits(f,l),f.prototype.processChunk=function(d){this.streamInfo.crc32=c(d.data,this.streamInfo.crc32||0),this.push(d)},s.exports=f},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(i,s,u){var l=i("../utils"),c=i("./GenericWorker");function f(d){c.call(this,"DataLengthProbe for "+d),this.propName=d,this.withStreamInfo(d,0)}l.inherits(f,c),f.prototype.processChunk=function(d){if(d){var h=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=h+d.data.length}c.prototype.processChunk.call(this,d)},s.exports=f},{"../utils":32,"./GenericWorker":28}],27:[function(i,s,u){var l=i("../utils"),c=i("./GenericWorker");function f(d){c.call(this,"DataWorker");var h=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,d.then(function(y){h.dataIsReady=!0,h.data=y,h.max=y&&y.length||0,h.type=l.getTypeOf(y),h.isPaused||h._tickAndRepeat()},function(y){h.error(y)})}l.inherits(f,c),f.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this.data=null},f.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,l.delay(this._tickAndRepeat,[],this)),!0)},f.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(l.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},f.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var d=null,h=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":d=this.data.substring(this.index,h);break;case"uint8array":d=this.data.subarray(this.index,h);break;case"array":case"nodebuffer":d=this.data.slice(this.index,h)}return this.index=h,this.push({data:d,meta:{percent:this.max?this.index/this.max*100:0}})},s.exports=f},{"../utils":32,"./GenericWorker":28}],28:[function(i,s,u){function l(c){this.name=c||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}l.prototype={push:function(c){this.emit("data",c)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(c){this.emit("error",c)}return!0},error:function(c){return!this.isFinished&&(this.isPaused?this.generatedError=c:(this.isFinished=!0,this.emit("error",c),this.previous&&this.previous.error(c),this.cleanUp()),!0)},on:function(c,f){return this._listeners[c].push(f),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(c,f){if(this._listeners[c])for(var d=0;d<this._listeners[c].length;d++)this._listeners[c][d].call(this,f)},pipe:function(c){return c.registerPrevious(this)},registerPrevious:function(c){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=c.streamInfo,this.mergeStreamInfo(),this.previous=c;var f=this;return c.on("data",function(d){f.processChunk(d)}),c.on("end",function(){f.end()}),c.on("error",function(d){f.error(d)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var c=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),c=!0),this.previous&&this.previous.resume(),!c},flush:function(){},processChunk:function(c){this.push(c)},withStreamInfo:function(c,f){return this.extraStreamInfo[c]=f,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var c in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,c)&&(this.streamInfo[c]=this.extraStreamInfo[c])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var c="Worker "+this.name;return this.previous?this.previous+" -> "+c:c}},s.exports=l},{}],29:[function(i,s,u){var l=i("../utils"),c=i("./ConvertWorker"),f=i("./GenericWorker"),d=i("../base64"),h=i("../support"),y=i("../external"),b=null;if(h.nodestream)try{b=i("../nodejs/NodejsStreamOutputAdapter")}catch{}function _(C,S){return new y.Promise(function(x,w){var k=[],N=C._internalType,j=C._outputType,D=C._mimeType;C.on("data",function(M,L){k.push(M),S&&S(L)}).on("error",function(M){k=[],w(M)}).on("end",function(){try{var M=(function(L,V,F){switch(L){case"blob":return l.newBlob(l.transformTo("arraybuffer",V),F);case"base64":return d.encode(V);default:return l.transformTo(L,V)}})(j,(function(L,V){var F,W=0,oe=null,R=0;for(F=0;F<V.length;F++)R+=V[F].length;switch(L){case"string":return V.join("");case"array":return Array.prototype.concat.apply([],V);case"uint8array":for(oe=new Uint8Array(R),F=0;F<V.length;F++)oe.set(V[F],W),W+=V[F].length;return oe;case"nodebuffer":return Buffer.concat(V);default:throw new Error("concat : unsupported type '"+L+"'")}})(N,k),D);x(M)}catch(L){w(L)}k=[]}).resume()})}function m(C,S,x){var w=S;switch(S){case"blob":case"arraybuffer":w="uint8array";break;case"base64":w="string"}try{this._internalType=w,this._outputType=S,this._mimeType=x,l.checkSupport(w),this._worker=C.pipe(new c(w)),C.lock()}catch(k){this._worker=new f("error"),this._worker.error(k)}}m.prototype={accumulate:function(C){return _(this,C)},on:function(C,S){var x=this;return C==="data"?this._worker.on(C,function(w){S.call(x,w.data,w.meta)}):this._worker.on(C,function(){l.delay(S,arguments,x)}),this},resume:function(){return l.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(C){if(l.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new b(this,{objectMode:this._outputType!=="nodebuffer"},C)}},s.exports=m},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(i,s,u){if(u.base64=!0,u.array=!0,u.string=!0,u.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",u.nodebuffer=typeof Buffer<"u",u.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")u.blob=!1;else{var l=new ArrayBuffer(0);try{u.blob=new Blob([l],{type:"application/zip"}).size===0}catch{try{var c=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);c.append(l),u.blob=c.getBlob("application/zip").size===0}catch{u.blob=!1}}}try{u.nodestream=!!i("readable-stream").Readable}catch{u.nodestream=!1}},{"readable-stream":16}],31:[function(i,s,u){for(var l=i("./utils"),c=i("./support"),f=i("./nodejsUtils"),d=i("./stream/GenericWorker"),h=new Array(256),y=0;y<256;y++)h[y]=252<=y?6:248<=y?5:240<=y?4:224<=y?3:192<=y?2:1;h[254]=h[254]=1;function b(){d.call(this,"utf-8 decode"),this.leftOver=null}function _(){d.call(this,"utf-8 encode")}u.utf8encode=function(m){return c.nodebuffer?f.newBufferFrom(m,"utf-8"):(function(C){var S,x,w,k,N,j=C.length,D=0;for(k=0;k<j;k++)(64512&(x=C.charCodeAt(k)))==55296&&k+1<j&&(64512&(w=C.charCodeAt(k+1)))==56320&&(x=65536+(x-55296<<10)+(w-56320),k++),D+=x<128?1:x<2048?2:x<65536?3:4;for(S=c.uint8array?new Uint8Array(D):new Array(D),k=N=0;N<D;k++)(64512&(x=C.charCodeAt(k)))==55296&&k+1<j&&(64512&(w=C.charCodeAt(k+1)))==56320&&(x=65536+(x-55296<<10)+(w-56320),k++),x<128?S[N++]=x:(x<2048?S[N++]=192|x>>>6:(x<65536?S[N++]=224|x>>>12:(S[N++]=240|x>>>18,S[N++]=128|x>>>12&63),S[N++]=128|x>>>6&63),S[N++]=128|63&x);return S})(m)},u.utf8decode=function(m){return c.nodebuffer?l.transformTo("nodebuffer",m).toString("utf-8"):(function(C){var S,x,w,k,N=C.length,j=new Array(2*N);for(S=x=0;S<N;)if((w=C[S++])<128)j[x++]=w;else if(4<(k=h[w]))j[x++]=65533,S+=k-1;else{for(w&=k===2?31:k===3?15:7;1<k&&S<N;)w=w<<6|63&C[S++],k--;1<k?j[x++]=65533:w<65536?j[x++]=w:(w-=65536,j[x++]=55296|w>>10&1023,j[x++]=56320|1023&w)}return j.length!==x&&(j.subarray?j=j.subarray(0,x):j.length=x),l.applyFromCharCode(j)})(m=l.transformTo(c.uint8array?"uint8array":"array",m))},l.inherits(b,d),b.prototype.processChunk=function(m){var C=l.transformTo(c.uint8array?"uint8array":"array",m.data);if(this.leftOver&&this.leftOver.length){if(c.uint8array){var S=C;(C=new Uint8Array(S.length+this.leftOver.length)).set(this.leftOver,0),C.set(S,this.leftOver.length)}else C=this.leftOver.concat(C);this.leftOver=null}var x=(function(k,N){var j;for((N=N||k.length)>k.length&&(N=k.length),j=N-1;0<=j&&(192&k[j])==128;)j--;return j<0||j===0?N:j+h[k[j]]>N?j:N})(C),w=C;x!==C.length&&(c.uint8array?(w=C.subarray(0,x),this.leftOver=C.subarray(x,C.length)):(w=C.slice(0,x),this.leftOver=C.slice(x,C.length))),this.push({data:u.utf8decode(w),meta:m.meta})},b.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:u.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},u.Utf8DecodeWorker=b,l.inherits(_,d),_.prototype.processChunk=function(m){this.push({data:u.utf8encode(m.data),meta:m.meta})},u.Utf8EncodeWorker=_},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(i,s,u){var l=i("./support"),c=i("./base64"),f=i("./nodejsUtils"),d=i("./external");function h(S){return S}function y(S,x){for(var w=0;w<S.length;++w)x[w]=255&S.charCodeAt(w);return x}i("setimmediate"),u.newBlob=function(S,x){u.checkSupport("blob");try{return new Blob([S],{type:x})}catch{try{var w=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return w.append(S),w.getBlob(x)}catch{throw new Error("Bug : can't construct the Blob.")}}};var b={stringifyByChunk:function(S,x,w){var k=[],N=0,j=S.length;if(j<=w)return String.fromCharCode.apply(null,S);for(;N<j;)x==="array"||x==="nodebuffer"?k.push(String.fromCharCode.apply(null,S.slice(N,Math.min(N+w,j)))):k.push(String.fromCharCode.apply(null,S.subarray(N,Math.min(N+w,j)))),N+=w;return k.join("")},stringifyByChar:function(S){for(var x="",w=0;w<S.length;w++)x+=String.fromCharCode(S[w]);return x},applyCanBeUsed:{uint8array:(function(){try{return l.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return l.nodebuffer&&String.fromCharCode.apply(null,f.allocBuffer(1)).length===1}catch{return!1}})()}};function _(S){var x=65536,w=u.getTypeOf(S),k=!0;if(w==="uint8array"?k=b.applyCanBeUsed.uint8array:w==="nodebuffer"&&(k=b.applyCanBeUsed.nodebuffer),k)for(;1<x;)try{return b.stringifyByChunk(S,w,x)}catch{x=Math.floor(x/2)}return b.stringifyByChar(S)}function m(S,x){for(var w=0;w<S.length;w++)x[w]=S[w];return x}u.applyFromCharCode=_;var C={};C.string={string:h,array:function(S){return y(S,new Array(S.length))},arraybuffer:function(S){return C.string.uint8array(S).buffer},uint8array:function(S){return y(S,new Uint8Array(S.length))},nodebuffer:function(S){return y(S,f.allocBuffer(S.length))}},C.array={string:_,array:h,arraybuffer:function(S){return new Uint8Array(S).buffer},uint8array:function(S){return new Uint8Array(S)},nodebuffer:function(S){return f.newBufferFrom(S)}},C.arraybuffer={string:function(S){return _(new Uint8Array(S))},array:function(S){return m(new Uint8Array(S),new Array(S.byteLength))},arraybuffer:h,uint8array:function(S){return new Uint8Array(S)},nodebuffer:function(S){return f.newBufferFrom(new Uint8Array(S))}},C.uint8array={string:_,array:function(S){return m(S,new Array(S.length))},arraybuffer:function(S){return S.buffer},uint8array:h,nodebuffer:function(S){return f.newBufferFrom(S)}},C.nodebuffer={string:_,array:function(S){return m(S,new Array(S.length))},arraybuffer:function(S){return C.nodebuffer.uint8array(S).buffer},uint8array:function(S){return m(S,new Uint8Array(S.length))},nodebuffer:h},u.transformTo=function(S,x){if(x=x||"",!S)return x;u.checkSupport(S);var w=u.getTypeOf(x);return C[w][S](x)},u.resolve=function(S){for(var x=S.split("/"),w=[],k=0;k<x.length;k++){var N=x[k];N==="."||N===""&&k!==0&&k!==x.length-1||(N===".."?w.pop():w.push(N))}return w.join("/")},u.getTypeOf=function(S){return typeof S=="string"?"string":Object.prototype.toString.call(S)==="[object Array]"?"array":l.nodebuffer&&f.isBuffer(S)?"nodebuffer":l.uint8array&&S instanceof Uint8Array?"uint8array":l.arraybuffer&&S instanceof ArrayBuffer?"arraybuffer":void 0},u.checkSupport=function(S){if(!l[S.toLowerCase()])throw new Error(S+" is not supported by this platform")},u.MAX_VALUE_16BITS=65535,u.MAX_VALUE_32BITS=-1,u.pretty=function(S){var x,w,k="";for(w=0;w<(S||"").length;w++)k+="\\x"+((x=S.charCodeAt(w))<16?"0":"")+x.toString(16).toUpperCase();return k},u.delay=function(S,x,w){setImmediate(function(){S.apply(w||null,x||[])})},u.inherits=function(S,x){function w(){}w.prototype=x.prototype,S.prototype=new w},u.extend=function(){var S,x,w={};for(S=0;S<arguments.length;S++)for(x in arguments[S])Object.prototype.hasOwnProperty.call(arguments[S],x)&&w[x]===void 0&&(w[x]=arguments[S][x]);return w},u.prepareContent=function(S,x,w,k,N){return d.Promise.resolve(x).then(function(j){return l.blob&&(j instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(j))!==-1)&&typeof FileReader<"u"?new d.Promise(function(D,M){var L=new FileReader;L.onload=function(V){D(V.target.result)},L.onerror=function(V){M(V.target.error)},L.readAsArrayBuffer(j)}):j}).then(function(j){var D=u.getTypeOf(j);return D?(D==="arraybuffer"?j=u.transformTo("uint8array",j):D==="string"&&(N?j=c.decode(j):w&&k!==!0&&(j=(function(M){return y(M,l.uint8array?new Uint8Array(M.length):new Array(M.length))})(j))),j):d.Promise.reject(new Error("Can't read the data of '"+S+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(i,s,u){var l=i("./reader/readerFor"),c=i("./utils"),f=i("./signature"),d=i("./zipEntry"),h=i("./support");function y(b){this.files=[],this.loadOptions=b}y.prototype={checkSignature:function(b){if(!this.reader.readAndCheckSignature(b)){this.reader.index-=4;var _=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+c.pretty(_)+", expected "+c.pretty(b)+")")}},isSignature:function(b,_){var m=this.reader.index;this.reader.setIndex(b);var C=this.reader.readString(4)===_;return this.reader.setIndex(m),C},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var b=this.reader.readData(this.zipCommentLength),_=h.uint8array?"uint8array":"array",m=c.transformTo(_,b);this.zipComment=this.loadOptions.decodeFileName(m)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var b,_,m,C=this.zip64EndOfCentralSize-44;0<C;)b=this.reader.readInt(2),_=this.reader.readInt(4),m=this.reader.readData(_),this.zip64ExtensibleData[b]={id:b,length:_,value:m}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var b,_;for(b=0;b<this.files.length;b++)_=this.files[b],this.reader.setIndex(_.localHeaderOffset),this.checkSignature(f.LOCAL_FILE_HEADER),_.readLocalPart(this.reader),_.handleUTF8(),_.processAttributes()},readCentralDir:function(){var b;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(f.CENTRAL_FILE_HEADER);)(b=new d({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(b);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var b=this.reader.lastIndexOfSignature(f.CENTRAL_DIRECTORY_END);if(b<0)throw this.isSignature(0,f.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(b);var _=b;if(this.checkSignature(f.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===c.MAX_VALUE_16BITS||this.diskWithCentralDirStart===c.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===c.MAX_VALUE_16BITS||this.centralDirRecords===c.MAX_VALUE_16BITS||this.centralDirSize===c.MAX_VALUE_32BITS||this.centralDirOffset===c.MAX_VALUE_32BITS){if(this.zip64=!0,(b=this.reader.lastIndexOfSignature(f.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(b),this.checkSignature(f.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,f.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(f.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(f.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var m=this.centralDirOffset+this.centralDirSize;this.zip64&&(m+=20,m+=12+this.zip64EndOfCentralSize);var C=_-m;if(0<C)this.isSignature(_,f.CENTRAL_FILE_HEADER)||(this.reader.zero=C);else if(C<0)throw new Error("Corrupted zip: missing "+Math.abs(C)+" bytes.")},prepareReader:function(b){this.reader=l(b)},load:function(b){this.prepareReader(b),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},s.exports=y},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(i,s,u){var l=i("./reader/readerFor"),c=i("./utils"),f=i("./compressedObject"),d=i("./crc32"),h=i("./utf8"),y=i("./compressions"),b=i("./support");function _(m,C){this.options=m,this.loadOptions=C}_.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(m){var C,S;if(m.skip(22),this.fileNameLength=m.readInt(2),S=m.readInt(2),this.fileName=m.readData(this.fileNameLength),m.skip(S),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((C=(function(x){for(var w in y)if(Object.prototype.hasOwnProperty.call(y,w)&&y[w].magic===x)return y[w];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+c.pretty(this.compressionMethod)+" unknown (inner file : "+c.transformTo("string",this.fileName)+")");this.decompressed=new f(this.compressedSize,this.uncompressedSize,this.crc32,C,m.readData(this.compressedSize))},readCentralPart:function(m){this.versionMadeBy=m.readInt(2),m.skip(2),this.bitFlag=m.readInt(2),this.compressionMethod=m.readString(2),this.date=m.readDate(),this.crc32=m.readInt(4),this.compressedSize=m.readInt(4),this.uncompressedSize=m.readInt(4);var C=m.readInt(2);if(this.extraFieldsLength=m.readInt(2),this.fileCommentLength=m.readInt(2),this.diskNumberStart=m.readInt(2),this.internalFileAttributes=m.readInt(2),this.externalFileAttributes=m.readInt(4),this.localHeaderOffset=m.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");m.skip(C),this.readExtraFields(m),this.parseZIP64ExtraField(m),this.fileComment=m.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var m=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),m==0&&(this.dosPermissions=63&this.externalFileAttributes),m==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var m=l(this.extraFields[1].value);this.uncompressedSize===c.MAX_VALUE_32BITS&&(this.uncompressedSize=m.readInt(8)),this.compressedSize===c.MAX_VALUE_32BITS&&(this.compressedSize=m.readInt(8)),this.localHeaderOffset===c.MAX_VALUE_32BITS&&(this.localHeaderOffset=m.readInt(8)),this.diskNumberStart===c.MAX_VALUE_32BITS&&(this.diskNumberStart=m.readInt(4))}},readExtraFields:function(m){var C,S,x,w=m.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});m.index+4<w;)C=m.readInt(2),S=m.readInt(2),x=m.readData(S),this.extraFields[C]={id:C,length:S,value:x};m.setIndex(w)},handleUTF8:function(){var m=b.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=h.utf8decode(this.fileName),this.fileCommentStr=h.utf8decode(this.fileComment);else{var C=this.findExtraFieldUnicodePath();if(C!==null)this.fileNameStr=C;else{var S=c.transformTo(m,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(S)}var x=this.findExtraFieldUnicodeComment();if(x!==null)this.fileCommentStr=x;else{var w=c.transformTo(m,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(w)}}},findExtraFieldUnicodePath:function(){var m=this.extraFields[28789];if(m){var C=l(m.value);return C.readInt(1)!==1||d(this.fileName)!==C.readInt(4)?null:h.utf8decode(C.readData(m.length-5))}return null},findExtraFieldUnicodeComment:function(){var m=this.extraFields[25461];if(m){var C=l(m.value);return C.readInt(1)!==1||d(this.fileComment)!==C.readInt(4)?null:h.utf8decode(C.readData(m.length-5))}return null}},s.exports=_},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(i,s,u){function l(C,S,x){this.name=C,this.dir=x.dir,this.date=x.date,this.comment=x.comment,this.unixPermissions=x.unixPermissions,this.dosPermissions=x.dosPermissions,this._data=S,this._dataBinary=x.binary,this.options={compression:x.compression,compressionOptions:x.compressionOptions}}var c=i("./stream/StreamHelper"),f=i("./stream/DataWorker"),d=i("./utf8"),h=i("./compressedObject"),y=i("./stream/GenericWorker");l.prototype={internalStream:function(C){var S=null,x="string";try{if(!C)throw new Error("No output type specified.");var w=(x=C.toLowerCase())==="string"||x==="text";x!=="binarystring"&&x!=="text"||(x="string"),S=this._decompressWorker();var k=!this._dataBinary;k&&!w&&(S=S.pipe(new d.Utf8EncodeWorker)),!k&&w&&(S=S.pipe(new d.Utf8DecodeWorker))}catch(N){(S=new y("error")).error(N)}return new c(S,x,"")},async:function(C,S){return this.internalStream(C).accumulate(S)},nodeStream:function(C,S){return this.internalStream(C||"nodebuffer").toNodejsStream(S)},_compressWorker:function(C,S){if(this._data instanceof h&&this._data.compression.magic===C.magic)return this._data.getCompressedWorker();var x=this._decompressWorker();return this._dataBinary||(x=x.pipe(new d.Utf8EncodeWorker)),h.createWorkerFrom(x,C,S)},_decompressWorker:function(){return this._data instanceof h?this._data.getContentWorker():this._data instanceof y?this._data:new f(this._data)}};for(var b=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],_=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},m=0;m<b.length;m++)l.prototype[b[m]]=_;s.exports=l},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(i,s,u){(function(l){var c,f,d=l.MutationObserver||l.WebKitMutationObserver;if(d){var h=0,y=new d(C),b=l.document.createTextNode("");y.observe(b,{characterData:!0}),c=function(){b.data=h=++h%2}}else if(l.setImmediate||l.MessageChannel===void 0)c="document"in l&&"onreadystatechange"in l.document.createElement("script")?function(){var S=l.document.createElement("script");S.onreadystatechange=function(){C(),S.onreadystatechange=null,S.parentNode.removeChild(S),S=null},l.document.documentElement.appendChild(S)}:function(){setTimeout(C,0)};else{var _=new l.MessageChannel;_.port1.onmessage=C,c=function(){_.port2.postMessage(0)}}var m=[];function C(){var S,x;f=!0;for(var w=m.length;w;){for(x=m,m=[],S=-1;++S<w;)x[S]();w=m.length}f=!1}s.exports=function(S){m.push(S)!==1||f||c()}}).call(this,typeof vr<"u"?vr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(i,s,u){var l=i("immediate");function c(){}var f={},d=["REJECTED"],h=["FULFILLED"],y=["PENDING"];function b(w){if(typeof w!="function")throw new TypeError("resolver must be a function");this.state=y,this.queue=[],this.outcome=void 0,w!==c&&S(this,w)}function _(w,k,N){this.promise=w,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof N=="function"&&(this.onRejected=N,this.callRejected=this.otherCallRejected)}function m(w,k,N){l(function(){var j;try{j=k(N)}catch(D){return f.reject(w,D)}j===w?f.reject(w,new TypeError("Cannot resolve promise with itself")):f.resolve(w,j)})}function C(w){var k=w&&w.then;if(w&&(typeof w=="object"||typeof w=="function")&&typeof k=="function")return function(){k.apply(w,arguments)}}function S(w,k){var N=!1;function j(L){N||(N=!0,f.reject(w,L))}function D(L){N||(N=!0,f.resolve(w,L))}var M=x(function(){k(D,j)});M.status==="error"&&j(M.value)}function x(w,k){var N={};try{N.value=w(k),N.status="success"}catch(j){N.status="error",N.value=j}return N}(s.exports=b).prototype.finally=function(w){if(typeof w!="function")return this;var k=this.constructor;return this.then(function(N){return k.resolve(w()).then(function(){return N})},function(N){return k.resolve(w()).then(function(){throw N})})},b.prototype.catch=function(w){return this.then(null,w)},b.prototype.then=function(w,k){if(typeof w!="function"&&this.state===h||typeof k!="function"&&this.state===d)return this;var N=new this.constructor(c);return this.state!==y?m(N,this.state===h?w:k,this.outcome):this.queue.push(new _(N,w,k)),N},_.prototype.callFulfilled=function(w){f.resolve(this.promise,w)},_.prototype.otherCallFulfilled=function(w){m(this.promise,this.onFulfilled,w)},_.prototype.callRejected=function(w){f.reject(this.promise,w)},_.prototype.otherCallRejected=function(w){m(this.promise,this.onRejected,w)},f.resolve=function(w,k){var N=x(C,k);if(N.status==="error")return f.reject(w,N.value);var j=N.value;if(j)S(w,j);else{w.state=h,w.outcome=k;for(var D=-1,M=w.queue.length;++D<M;)w.queue[D].callFulfilled(k)}return w},f.reject=function(w,k){w.state=d,w.outcome=k;for(var N=-1,j=w.queue.length;++N<j;)w.queue[N].callRejected(k);return w},b.resolve=function(w){return w instanceof this?w:f.resolve(new this(c),w)},b.reject=function(w){var k=new this(c);return f.reject(k,w)},b.all=function(w){var k=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var N=w.length,j=!1;if(!N)return this.resolve([]);for(var D=new Array(N),M=0,L=-1,V=new this(c);++L<N;)F(w[L],L);return V;function F(W,oe){k.resolve(W).then(function(R){D[oe]=R,++M!==N||j||(j=!0,f.resolve(V,D))},function(R){j||(j=!0,f.reject(V,R))})}},b.race=function(w){var k=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var N=w.length,j=!1;if(!N)return this.resolve([]);for(var D=-1,M=new this(c);++D<N;)L=w[D],k.resolve(L).then(function(V){j||(j=!0,f.resolve(M,V))},function(V){j||(j=!0,f.reject(M,V))});var L;return M}},{immediate:36}],38:[function(i,s,u){var l={};(0,i("./lib/utils/common").assign)(l,i("./lib/deflate"),i("./lib/inflate"),i("./lib/zlib/constants")),s.exports=l},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(i,s,u){var l=i("./zlib/deflate"),c=i("./utils/common"),f=i("./utils/strings"),d=i("./zlib/messages"),h=i("./zlib/zstream"),y=Object.prototype.toString,b=0,_=-1,m=0,C=8;function S(w){if(!(this instanceof S))return new S(w);this.options=c.assign({level:_,method:C,chunkSize:16384,windowBits:15,memLevel:8,strategy:m,to:""},w||{});var k=this.options;k.raw&&0<k.windowBits?k.windowBits=-k.windowBits:k.gzip&&0<k.windowBits&&k.windowBits<16&&(k.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var N=l.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(N!==b)throw new Error(d[N]);if(k.header&&l.deflateSetHeader(this.strm,k.header),k.dictionary){var j;if(j=typeof k.dictionary=="string"?f.string2buf(k.dictionary):y.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(N=l.deflateSetDictionary(this.strm,j))!==b)throw new Error(d[N]);this._dict_set=!0}}function x(w,k){var N=new S(k);if(N.push(w,!0),N.err)throw N.msg||d[N.err];return N.result}S.prototype.push=function(w,k){var N,j,D=this.strm,M=this.options.chunkSize;if(this.ended)return!1;j=k===~~k?k:k===!0?4:0,typeof w=="string"?D.input=f.string2buf(w):y.call(w)==="[object ArrayBuffer]"?D.input=new Uint8Array(w):D.input=w,D.next_in=0,D.avail_in=D.input.length;do{if(D.avail_out===0&&(D.output=new c.Buf8(M),D.next_out=0,D.avail_out=M),(N=l.deflate(D,j))!==1&&N!==b)return this.onEnd(N),!(this.ended=!0);D.avail_out!==0&&(D.avail_in!==0||j!==4&&j!==2)||(this.options.to==="string"?this.onData(f.buf2binstring(c.shrinkBuf(D.output,D.next_out))):this.onData(c.shrinkBuf(D.output,D.next_out)))}while((0<D.avail_in||D.avail_out===0)&&N!==1);return j===4?(N=l.deflateEnd(this.strm),this.onEnd(N),this.ended=!0,N===b):j!==2||(this.onEnd(b),!(D.avail_out=0))},S.prototype.onData=function(w){this.chunks.push(w)},S.prototype.onEnd=function(w){w===b&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=w,this.msg=this.strm.msg},u.Deflate=S,u.deflate=x,u.deflateRaw=function(w,k){return(k=k||{}).raw=!0,x(w,k)},u.gzip=function(w,k){return(k=k||{}).gzip=!0,x(w,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(i,s,u){var l=i("./zlib/inflate"),c=i("./utils/common"),f=i("./utils/strings"),d=i("./zlib/constants"),h=i("./zlib/messages"),y=i("./zlib/zstream"),b=i("./zlib/gzheader"),_=Object.prototype.toString;function m(S){if(!(this instanceof m))return new m(S);this.options=c.assign({chunkSize:16384,windowBits:0,to:""},S||{});var x=this.options;x.raw&&0<=x.windowBits&&x.windowBits<16&&(x.windowBits=-x.windowBits,x.windowBits===0&&(x.windowBits=-15)),!(0<=x.windowBits&&x.windowBits<16)||S&&S.windowBits||(x.windowBits+=32),15<x.windowBits&&x.windowBits<48&&(15&x.windowBits)==0&&(x.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new y,this.strm.avail_out=0;var w=l.inflateInit2(this.strm,x.windowBits);if(w!==d.Z_OK)throw new Error(h[w]);this.header=new b,l.inflateGetHeader(this.strm,this.header)}function C(S,x){var w=new m(x);if(w.push(S,!0),w.err)throw w.msg||h[w.err];return w.result}m.prototype.push=function(S,x){var w,k,N,j,D,M,L=this.strm,V=this.options.chunkSize,F=this.options.dictionary,W=!1;if(this.ended)return!1;k=x===~~x?x:x===!0?d.Z_FINISH:d.Z_NO_FLUSH,typeof S=="string"?L.input=f.binstring2buf(S):_.call(S)==="[object ArrayBuffer]"?L.input=new Uint8Array(S):L.input=S,L.next_in=0,L.avail_in=L.input.length;do{if(L.avail_out===0&&(L.output=new c.Buf8(V),L.next_out=0,L.avail_out=V),(w=l.inflate(L,d.Z_NO_FLUSH))===d.Z_NEED_DICT&&F&&(M=typeof F=="string"?f.string2buf(F):_.call(F)==="[object ArrayBuffer]"?new Uint8Array(F):F,w=l.inflateSetDictionary(this.strm,M)),w===d.Z_BUF_ERROR&&W===!0&&(w=d.Z_OK,W=!1),w!==d.Z_STREAM_END&&w!==d.Z_OK)return this.onEnd(w),!(this.ended=!0);L.next_out&&(L.avail_out!==0&&w!==d.Z_STREAM_END&&(L.avail_in!==0||k!==d.Z_FINISH&&k!==d.Z_SYNC_FLUSH)||(this.options.to==="string"?(N=f.utf8border(L.output,L.next_out),j=L.next_out-N,D=f.buf2string(L.output,N),L.next_out=j,L.avail_out=V-j,j&&c.arraySet(L.output,L.output,N,j,0),this.onData(D)):this.onData(c.shrinkBuf(L.output,L.next_out)))),L.avail_in===0&&L.avail_out===0&&(W=!0)}while((0<L.avail_in||L.avail_out===0)&&w!==d.Z_STREAM_END);return w===d.Z_STREAM_END&&(k=d.Z_FINISH),k===d.Z_FINISH?(w=l.inflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===d.Z_OK):k!==d.Z_SYNC_FLUSH||(this.onEnd(d.Z_OK),!(L.avail_out=0))},m.prototype.onData=function(S){this.chunks.push(S)},m.prototype.onEnd=function(S){S===d.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=S,this.msg=this.strm.msg},u.Inflate=m,u.inflate=C,u.inflateRaw=function(S,x){return(x=x||{}).raw=!0,C(S,x)},u.ungzip=C},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(i,s,u){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";u.assign=function(d){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var y=h.shift();if(y){if(typeof y!="object")throw new TypeError(y+"must be non-object");for(var b in y)y.hasOwnProperty(b)&&(d[b]=y[b])}}return d},u.shrinkBuf=function(d,h){return d.length===h?d:d.subarray?d.subarray(0,h):(d.length=h,d)};var c={arraySet:function(d,h,y,b,_){if(h.subarray&&d.subarray)d.set(h.subarray(y,y+b),_);else for(var m=0;m<b;m++)d[_+m]=h[y+m]},flattenChunks:function(d){var h,y,b,_,m,C;for(h=b=0,y=d.length;h<y;h++)b+=d[h].length;for(C=new Uint8Array(b),h=_=0,y=d.length;h<y;h++)m=d[h],C.set(m,_),_+=m.length;return C}},f={arraySet:function(d,h,y,b,_){for(var m=0;m<b;m++)d[_+m]=h[y+m]},flattenChunks:function(d){return[].concat.apply([],d)}};u.setTyped=function(d){d?(u.Buf8=Uint8Array,u.Buf16=Uint16Array,u.Buf32=Int32Array,u.assign(u,c)):(u.Buf8=Array,u.Buf16=Array,u.Buf32=Array,u.assign(u,f))},u.setTyped(l)},{}],42:[function(i,s,u){var l=i("./common"),c=!0,f=!0;try{String.fromCharCode.apply(null,[0])}catch{c=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{f=!1}for(var d=new l.Buf8(256),h=0;h<256;h++)d[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;function y(b,_){if(_<65537&&(b.subarray&&f||!b.subarray&&c))return String.fromCharCode.apply(null,l.shrinkBuf(b,_));for(var m="",C=0;C<_;C++)m+=String.fromCharCode(b[C]);return m}d[254]=d[254]=1,u.string2buf=function(b){var _,m,C,S,x,w=b.length,k=0;for(S=0;S<w;S++)(64512&(m=b.charCodeAt(S)))==55296&&S+1<w&&(64512&(C=b.charCodeAt(S+1)))==56320&&(m=65536+(m-55296<<10)+(C-56320),S++),k+=m<128?1:m<2048?2:m<65536?3:4;for(_=new l.Buf8(k),S=x=0;x<k;S++)(64512&(m=b.charCodeAt(S)))==55296&&S+1<w&&(64512&(C=b.charCodeAt(S+1)))==56320&&(m=65536+(m-55296<<10)+(C-56320),S++),m<128?_[x++]=m:(m<2048?_[x++]=192|m>>>6:(m<65536?_[x++]=224|m>>>12:(_[x++]=240|m>>>18,_[x++]=128|m>>>12&63),_[x++]=128|m>>>6&63),_[x++]=128|63&m);return _},u.buf2binstring=function(b){return y(b,b.length)},u.binstring2buf=function(b){for(var _=new l.Buf8(b.length),m=0,C=_.length;m<C;m++)_[m]=b.charCodeAt(m);return _},u.buf2string=function(b,_){var m,C,S,x,w=_||b.length,k=new Array(2*w);for(m=C=0;m<w;)if((S=b[m++])<128)k[C++]=S;else if(4<(x=d[S]))k[C++]=65533,m+=x-1;else{for(S&=x===2?31:x===3?15:7;1<x&&m<w;)S=S<<6|63&b[m++],x--;1<x?k[C++]=65533:S<65536?k[C++]=S:(S-=65536,k[C++]=55296|S>>10&1023,k[C++]=56320|1023&S)}return y(k,C)},u.utf8border=function(b,_){var m;for((_=_||b.length)>b.length&&(_=b.length),m=_-1;0<=m&&(192&b[m])==128;)m--;return m<0||m===0?_:m+d[b[m]]>_?m:_}},{"./common":41}],43:[function(i,s,u){s.exports=function(l,c,f,d){for(var h=65535&l|0,y=l>>>16&65535|0,b=0;f!==0;){for(f-=b=2e3<f?2e3:f;y=y+(h=h+c[d++]|0)|0,--b;);h%=65521,y%=65521}return h|y<<16|0}},{}],44:[function(i,s,u){s.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(i,s,u){var l=(function(){for(var c,f=[],d=0;d<256;d++){c=d;for(var h=0;h<8;h++)c=1&c?3988292384^c>>>1:c>>>1;f[d]=c}return f})();s.exports=function(c,f,d,h){var y=l,b=h+d;c^=-1;for(var _=h;_<b;_++)c=c>>>8^y[255&(c^f[_])];return-1^c}},{}],46:[function(i,s,u){var l,c=i("../utils/common"),f=i("./trees"),d=i("./adler32"),h=i("./crc32"),y=i("./messages"),b=0,_=4,m=0,C=-2,S=-1,x=4,w=2,k=8,N=9,j=286,D=30,M=19,L=2*j+1,V=15,F=3,W=258,oe=W+F+1,R=42,Q=113,E=1,G=2,J=3,K=4;function ue(g,Y){return g.msg=y[Y],Y}function re(g){return(g<<1)-(4<g?9:0)}function q(g){for(var Y=g.length;0<=--Y;)g[Y]=0}function z(g){var Y=g.state,Z=Y.pending;Z>g.avail_out&&(Z=g.avail_out),Z!==0&&(c.arraySet(g.output,Y.pending_buf,Y.pending_out,Z,g.next_out),g.next_out+=Z,Y.pending_out+=Z,g.total_out+=Z,g.avail_out-=Z,Y.pending-=Z,Y.pending===0&&(Y.pending_out=0))}function I(g,Y){f._tr_flush_block(g,0<=g.block_start?g.block_start:-1,g.strstart-g.block_start,Y),g.block_start=g.strstart,z(g.strm)}function B(g,Y){g.pending_buf[g.pending++]=Y}function te(g,Y){g.pending_buf[g.pending++]=Y>>>8&255,g.pending_buf[g.pending++]=255&Y}function ae(g,Y){var Z,A,T=g.max_chain_length,U=g.strstart,ee=g.prev_length,se=g.nice_match,X=g.strstart>g.w_size-oe?g.strstart-(g.w_size-oe):0,ce=g.window,pe=g.w_mask,de=g.prev,ie=g.strstart+W,be=ce[U+ee-1],Ee=ce[U+ee];g.prev_length>=g.good_match&&(T>>=2),se>g.lookahead&&(se=g.lookahead);do if(ce[(Z=Y)+ee]===Ee&&ce[Z+ee-1]===be&&ce[Z]===ce[U]&&ce[++Z]===ce[U+1]){U+=2,Z++;do;while(ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&U<ie);if(A=W-(ie-U),U=ie-W,ee<A){if(g.match_start=Y,se<=(ee=A))break;be=ce[U+ee-1],Ee=ce[U+ee]}}while((Y=de[Y&pe])>X&&--T!=0);return ee<=g.lookahead?ee:g.lookahead}function xe(g){var Y,Z,A,T,U,ee,se,X,ce,pe,de=g.w_size;do{if(T=g.window_size-g.lookahead-g.strstart,g.strstart>=de+(de-oe)){for(c.arraySet(g.window,g.window,de,de,0),g.match_start-=de,g.strstart-=de,g.block_start-=de,Y=Z=g.hash_size;A=g.head[--Y],g.head[Y]=de<=A?A-de:0,--Z;);for(Y=Z=de;A=g.prev[--Y],g.prev[Y]=de<=A?A-de:0,--Z;);T+=de}if(g.strm.avail_in===0)break;if(ee=g.strm,se=g.window,X=g.strstart+g.lookahead,ce=T,pe=void 0,pe=ee.avail_in,ce<pe&&(pe=ce),Z=pe===0?0:(ee.avail_in-=pe,c.arraySet(se,ee.input,ee.next_in,pe,X),ee.state.wrap===1?ee.adler=d(ee.adler,se,pe,X):ee.state.wrap===2&&(ee.adler=h(ee.adler,se,pe,X)),ee.next_in+=pe,ee.total_in+=pe,pe),g.lookahead+=Z,g.lookahead+g.insert>=F)for(U=g.strstart-g.insert,g.ins_h=g.window[U],g.ins_h=(g.ins_h<<g.hash_shift^g.window[U+1])&g.hash_mask;g.insert&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[U+F-1])&g.hash_mask,g.prev[U&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=U,U++,g.insert--,!(g.lookahead+g.insert<F)););}while(g.lookahead<oe&&g.strm.avail_in!==0)}function Te(g,Y){for(var Z,A;;){if(g.lookahead<oe){if(xe(g),g.lookahead<oe&&Y===b)return E;if(g.lookahead===0)break}if(Z=0,g.lookahead>=F&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+F-1])&g.hash_mask,Z=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart),Z!==0&&g.strstart-Z<=g.w_size-oe&&(g.match_length=ae(g,Z)),g.match_length>=F)if(A=f._tr_tally(g,g.strstart-g.match_start,g.match_length-F),g.lookahead-=g.match_length,g.match_length<=g.max_lazy_match&&g.lookahead>=F){for(g.match_length--;g.strstart++,g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+F-1])&g.hash_mask,Z=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart,--g.match_length!=0;);g.strstart++}else g.strstart+=g.match_length,g.match_length=0,g.ins_h=g.window[g.strstart],g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+1])&g.hash_mask;else A=f._tr_tally(g,0,g.window[g.strstart]),g.lookahead--,g.strstart++;if(A&&(I(g,!1),g.strm.avail_out===0))return E}return g.insert=g.strstart<F-1?g.strstart:F-1,Y===_?(I(g,!0),g.strm.avail_out===0?J:K):g.last_lit&&(I(g,!1),g.strm.avail_out===0)?E:G}function Ce(g,Y){for(var Z,A,T;;){if(g.lookahead<oe){if(xe(g),g.lookahead<oe&&Y===b)return E;if(g.lookahead===0)break}if(Z=0,g.lookahead>=F&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+F-1])&g.hash_mask,Z=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart),g.prev_length=g.match_length,g.prev_match=g.match_start,g.match_length=F-1,Z!==0&&g.prev_length<g.max_lazy_match&&g.strstart-Z<=g.w_size-oe&&(g.match_length=ae(g,Z),g.match_length<=5&&(g.strategy===1||g.match_length===F&&4096<g.strstart-g.match_start)&&(g.match_length=F-1)),g.prev_length>=F&&g.match_length<=g.prev_length){for(T=g.strstart+g.lookahead-F,A=f._tr_tally(g,g.strstart-1-g.prev_match,g.prev_length-F),g.lookahead-=g.prev_length-1,g.prev_length-=2;++g.strstart<=T&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+F-1])&g.hash_mask,Z=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart),--g.prev_length!=0;);if(g.match_available=0,g.match_length=F-1,g.strstart++,A&&(I(g,!1),g.strm.avail_out===0))return E}else if(g.match_available){if((A=f._tr_tally(g,0,g.window[g.strstart-1]))&&I(g,!1),g.strstart++,g.lookahead--,g.strm.avail_out===0)return E}else g.match_available=1,g.strstart++,g.lookahead--}return g.match_available&&(A=f._tr_tally(g,0,g.window[g.strstart-1]),g.match_available=0),g.insert=g.strstart<F-1?g.strstart:F-1,Y===_?(I(g,!0),g.strm.avail_out===0?J:K):g.last_lit&&(I(g,!1),g.strm.avail_out===0)?E:G}function ke(g,Y,Z,A,T){this.good_length=g,this.max_lazy=Y,this.nice_length=Z,this.max_chain=A,this.func=T}function je(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=k,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new c.Buf16(2*L),this.dyn_dtree=new c.Buf16(2*(2*D+1)),this.bl_tree=new c.Buf16(2*(2*M+1)),q(this.dyn_ltree),q(this.dyn_dtree),q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new c.Buf16(V+1),this.heap=new c.Buf16(2*j+1),q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new c.Buf16(2*j+1),q(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function _e(g){var Y;return g&&g.state?(g.total_in=g.total_out=0,g.data_type=w,(Y=g.state).pending=0,Y.pending_out=0,Y.wrap<0&&(Y.wrap=-Y.wrap),Y.status=Y.wrap?R:Q,g.adler=Y.wrap===2?0:1,Y.last_flush=b,f._tr_init(Y),m):ue(g,C)}function Re(g){var Y=_e(g);return Y===m&&(function(Z){Z.window_size=2*Z.w_size,q(Z.head),Z.max_lazy_match=l[Z.level].max_lazy,Z.good_match=l[Z.level].good_length,Z.nice_match=l[Z.level].nice_length,Z.max_chain_length=l[Z.level].max_chain,Z.strstart=0,Z.block_start=0,Z.lookahead=0,Z.insert=0,Z.match_length=Z.prev_length=F-1,Z.match_available=0,Z.ins_h=0})(g.state),Y}function Ne(g,Y,Z,A,T,U){if(!g)return C;var ee=1;if(Y===S&&(Y=6),A<0?(ee=0,A=-A):15<A&&(ee=2,A-=16),T<1||N<T||Z!==k||A<8||15<A||Y<0||9<Y||U<0||x<U)return ue(g,C);A===8&&(A=9);var se=new je;return(g.state=se).strm=g,se.wrap=ee,se.gzhead=null,se.w_bits=A,se.w_size=1<<se.w_bits,se.w_mask=se.w_size-1,se.hash_bits=T+7,se.hash_size=1<<se.hash_bits,se.hash_mask=se.hash_size-1,se.hash_shift=~~((se.hash_bits+F-1)/F),se.window=new c.Buf8(2*se.w_size),se.head=new c.Buf16(se.hash_size),se.prev=new c.Buf16(se.w_size),se.lit_bufsize=1<<T+6,se.pending_buf_size=4*se.lit_bufsize,se.pending_buf=new c.Buf8(se.pending_buf_size),se.d_buf=1*se.lit_bufsize,se.l_buf=3*se.lit_bufsize,se.level=Y,se.strategy=U,se.method=Z,Re(g)}l=[new ke(0,0,0,0,function(g,Y){var Z=65535;for(Z>g.pending_buf_size-5&&(Z=g.pending_buf_size-5);;){if(g.lookahead<=1){if(xe(g),g.lookahead===0&&Y===b)return E;if(g.lookahead===0)break}g.strstart+=g.lookahead,g.lookahead=0;var A=g.block_start+Z;if((g.strstart===0||g.strstart>=A)&&(g.lookahead=g.strstart-A,g.strstart=A,I(g,!1),g.strm.avail_out===0)||g.strstart-g.block_start>=g.w_size-oe&&(I(g,!1),g.strm.avail_out===0))return E}return g.insert=0,Y===_?(I(g,!0),g.strm.avail_out===0?J:K):(g.strstart>g.block_start&&(I(g,!1),g.strm.avail_out),E)}),new ke(4,4,8,4,Te),new ke(4,5,16,8,Te),new ke(4,6,32,32,Te),new ke(4,4,16,16,Ce),new ke(8,16,32,32,Ce),new ke(8,16,128,128,Ce),new ke(8,32,128,256,Ce),new ke(32,128,258,1024,Ce),new ke(32,258,258,4096,Ce)],u.deflateInit=function(g,Y){return Ne(g,Y,k,15,8,0)},u.deflateInit2=Ne,u.deflateReset=Re,u.deflateResetKeep=_e,u.deflateSetHeader=function(g,Y){return g&&g.state?g.state.wrap!==2?C:(g.state.gzhead=Y,m):C},u.deflate=function(g,Y){var Z,A,T,U;if(!g||!g.state||5<Y||Y<0)return g?ue(g,C):C;if(A=g.state,!g.output||!g.input&&g.avail_in!==0||A.status===666&&Y!==_)return ue(g,g.avail_out===0?-5:C);if(A.strm=g,Z=A.last_flush,A.last_flush=Y,A.status===R)if(A.wrap===2)g.adler=0,B(A,31),B(A,139),B(A,8),A.gzhead?(B(A,(A.gzhead.text?1:0)+(A.gzhead.hcrc?2:0)+(A.gzhead.extra?4:0)+(A.gzhead.name?8:0)+(A.gzhead.comment?16:0)),B(A,255&A.gzhead.time),B(A,A.gzhead.time>>8&255),B(A,A.gzhead.time>>16&255),B(A,A.gzhead.time>>24&255),B(A,A.level===9?2:2<=A.strategy||A.level<2?4:0),B(A,255&A.gzhead.os),A.gzhead.extra&&A.gzhead.extra.length&&(B(A,255&A.gzhead.extra.length),B(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(g.adler=h(g.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=69):(B(A,0),B(A,0),B(A,0),B(A,0),B(A,0),B(A,A.level===9?2:2<=A.strategy||A.level<2?4:0),B(A,3),A.status=Q);else{var ee=k+(A.w_bits-8<<4)<<8;ee|=(2<=A.strategy||A.level<2?0:A.level<6?1:A.level===6?2:3)<<6,A.strstart!==0&&(ee|=32),ee+=31-ee%31,A.status=Q,te(A,ee),A.strstart!==0&&(te(A,g.adler>>>16),te(A,65535&g.adler)),g.adler=1}if(A.status===69)if(A.gzhead.extra){for(T=A.pending;A.gzindex<(65535&A.gzhead.extra.length)&&(A.pending!==A.pending_buf_size||(A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),z(g),T=A.pending,A.pending!==A.pending_buf_size));)B(A,255&A.gzhead.extra[A.gzindex]),A.gzindex++;A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),A.gzindex===A.gzhead.extra.length&&(A.gzindex=0,A.status=73)}else A.status=73;if(A.status===73)if(A.gzhead.name){T=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),z(g),T=A.pending,A.pending===A.pending_buf_size)){U=1;break}U=A.gzindex<A.gzhead.name.length?255&A.gzhead.name.charCodeAt(A.gzindex++):0,B(A,U)}while(U!==0);A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),U===0&&(A.gzindex=0,A.status=91)}else A.status=91;if(A.status===91)if(A.gzhead.comment){T=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),z(g),T=A.pending,A.pending===A.pending_buf_size)){U=1;break}U=A.gzindex<A.gzhead.comment.length?255&A.gzhead.comment.charCodeAt(A.gzindex++):0,B(A,U)}while(U!==0);A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),U===0&&(A.status=103)}else A.status=103;if(A.status===103&&(A.gzhead.hcrc?(A.pending+2>A.pending_buf_size&&z(g),A.pending+2<=A.pending_buf_size&&(B(A,255&g.adler),B(A,g.adler>>8&255),g.adler=0,A.status=Q)):A.status=Q),A.pending!==0){if(z(g),g.avail_out===0)return A.last_flush=-1,m}else if(g.avail_in===0&&re(Y)<=re(Z)&&Y!==_)return ue(g,-5);if(A.status===666&&g.avail_in!==0)return ue(g,-5);if(g.avail_in!==0||A.lookahead!==0||Y!==b&&A.status!==666){var se=A.strategy===2?(function(X,ce){for(var pe;;){if(X.lookahead===0&&(xe(X),X.lookahead===0)){if(ce===b)return E;break}if(X.match_length=0,pe=f._tr_tally(X,0,X.window[X.strstart]),X.lookahead--,X.strstart++,pe&&(I(X,!1),X.strm.avail_out===0))return E}return X.insert=0,ce===_?(I(X,!0),X.strm.avail_out===0?J:K):X.last_lit&&(I(X,!1),X.strm.avail_out===0)?E:G})(A,Y):A.strategy===3?(function(X,ce){for(var pe,de,ie,be,Ee=X.window;;){if(X.lookahead<=W){if(xe(X),X.lookahead<=W&&ce===b)return E;if(X.lookahead===0)break}if(X.match_length=0,X.lookahead>=F&&0<X.strstart&&(de=Ee[ie=X.strstart-1])===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]){be=X.strstart+W;do;while(de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&ie<be);X.match_length=W-(be-ie),X.match_length>X.lookahead&&(X.match_length=X.lookahead)}if(X.match_length>=F?(pe=f._tr_tally(X,1,X.match_length-F),X.lookahead-=X.match_length,X.strstart+=X.match_length,X.match_length=0):(pe=f._tr_tally(X,0,X.window[X.strstart]),X.lookahead--,X.strstart++),pe&&(I(X,!1),X.strm.avail_out===0))return E}return X.insert=0,ce===_?(I(X,!0),X.strm.avail_out===0?J:K):X.last_lit&&(I(X,!1),X.strm.avail_out===0)?E:G})(A,Y):l[A.level].func(A,Y);if(se!==J&&se!==K||(A.status=666),se===E||se===J)return g.avail_out===0&&(A.last_flush=-1),m;if(se===G&&(Y===1?f._tr_align(A):Y!==5&&(f._tr_stored_block(A,0,0,!1),Y===3&&(q(A.head),A.lookahead===0&&(A.strstart=0,A.block_start=0,A.insert=0))),z(g),g.avail_out===0))return A.last_flush=-1,m}return Y!==_?m:A.wrap<=0?1:(A.wrap===2?(B(A,255&g.adler),B(A,g.adler>>8&255),B(A,g.adler>>16&255),B(A,g.adler>>24&255),B(A,255&g.total_in),B(A,g.total_in>>8&255),B(A,g.total_in>>16&255),B(A,g.total_in>>24&255)):(te(A,g.adler>>>16),te(A,65535&g.adler)),z(g),0<A.wrap&&(A.wrap=-A.wrap),A.pending!==0?m:1)},u.deflateEnd=function(g){var Y;return g&&g.state?(Y=g.state.status)!==R&&Y!==69&&Y!==73&&Y!==91&&Y!==103&&Y!==Q&&Y!==666?ue(g,C):(g.state=null,Y===Q?ue(g,-3):m):C},u.deflateSetDictionary=function(g,Y){var Z,A,T,U,ee,se,X,ce,pe=Y.length;if(!g||!g.state||(U=(Z=g.state).wrap)===2||U===1&&Z.status!==R||Z.lookahead)return C;for(U===1&&(g.adler=d(g.adler,Y,pe,0)),Z.wrap=0,pe>=Z.w_size&&(U===0&&(q(Z.head),Z.strstart=0,Z.block_start=0,Z.insert=0),ce=new c.Buf8(Z.w_size),c.arraySet(ce,Y,pe-Z.w_size,Z.w_size,0),Y=ce,pe=Z.w_size),ee=g.avail_in,se=g.next_in,X=g.input,g.avail_in=pe,g.next_in=0,g.input=Y,xe(Z);Z.lookahead>=F;){for(A=Z.strstart,T=Z.lookahead-(F-1);Z.ins_h=(Z.ins_h<<Z.hash_shift^Z.window[A+F-1])&Z.hash_mask,Z.prev[A&Z.w_mask]=Z.head[Z.ins_h],Z.head[Z.ins_h]=A,A++,--T;);Z.strstart=A,Z.lookahead=F-1,xe(Z)}return Z.strstart+=Z.lookahead,Z.block_start=Z.strstart,Z.insert=Z.lookahead,Z.lookahead=0,Z.match_length=Z.prev_length=F-1,Z.match_available=0,g.next_in=se,g.input=X,g.avail_in=ee,Z.wrap=U,m},u.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(i,s,u){s.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(i,s,u){s.exports=function(l,c){var f,d,h,y,b,_,m,C,S,x,w,k,N,j,D,M,L,V,F,W,oe,R,Q,E,G;f=l.state,d=l.next_in,E=l.input,h=d+(l.avail_in-5),y=l.next_out,G=l.output,b=y-(c-l.avail_out),_=y+(l.avail_out-257),m=f.dmax,C=f.wsize,S=f.whave,x=f.wnext,w=f.window,k=f.hold,N=f.bits,j=f.lencode,D=f.distcode,M=(1<<f.lenbits)-1,L=(1<<f.distbits)-1;e:do{N<15&&(k+=E[d++]<<N,N+=8,k+=E[d++]<<N,N+=8),V=j[k&M];t:for(;;){if(k>>>=F=V>>>24,N-=F,(F=V>>>16&255)===0)G[y++]=65535&V;else{if(!(16&F)){if((64&F)==0){V=j[(65535&V)+(k&(1<<F)-1)];continue t}if(32&F){f.mode=12;break e}l.msg="invalid literal/length code",f.mode=30;break e}W=65535&V,(F&=15)&&(N<F&&(k+=E[d++]<<N,N+=8),W+=k&(1<<F)-1,k>>>=F,N-=F),N<15&&(k+=E[d++]<<N,N+=8,k+=E[d++]<<N,N+=8),V=D[k&L];n:for(;;){if(k>>>=F=V>>>24,N-=F,!(16&(F=V>>>16&255))){if((64&F)==0){V=D[(65535&V)+(k&(1<<F)-1)];continue n}l.msg="invalid distance code",f.mode=30;break e}if(oe=65535&V,N<(F&=15)&&(k+=E[d++]<<N,(N+=8)<F&&(k+=E[d++]<<N,N+=8)),m<(oe+=k&(1<<F)-1)){l.msg="invalid distance too far back",f.mode=30;break e}if(k>>>=F,N-=F,(F=y-b)<oe){if(S<(F=oe-F)&&f.sane){l.msg="invalid distance too far back",f.mode=30;break e}if(Q=w,(R=0)===x){if(R+=C-F,F<W){for(W-=F;G[y++]=w[R++],--F;);R=y-oe,Q=G}}else if(x<F){if(R+=C+x-F,(F-=x)<W){for(W-=F;G[y++]=w[R++],--F;);if(R=0,x<W){for(W-=F=x;G[y++]=w[R++],--F;);R=y-oe,Q=G}}}else if(R+=x-F,F<W){for(W-=F;G[y++]=w[R++],--F;);R=y-oe,Q=G}for(;2<W;)G[y++]=Q[R++],G[y++]=Q[R++],G[y++]=Q[R++],W-=3;W&&(G[y++]=Q[R++],1<W&&(G[y++]=Q[R++]))}else{for(R=y-oe;G[y++]=G[R++],G[y++]=G[R++],G[y++]=G[R++],2<(W-=3););W&&(G[y++]=G[R++],1<W&&(G[y++]=G[R++]))}break}}break}}while(d<h&&y<_);d-=W=N>>3,k&=(1<<(N-=W<<3))-1,l.next_in=d,l.next_out=y,l.avail_in=d<h?h-d+5:5-(d-h),l.avail_out=y<_?_-y+257:257-(y-_),f.hold=k,f.bits=N}},{}],49:[function(i,s,u){var l=i("../utils/common"),c=i("./adler32"),f=i("./crc32"),d=i("./inffast"),h=i("./inftrees"),y=1,b=2,_=0,m=-2,C=1,S=852,x=592;function w(R){return(R>>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function k(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new l.Buf16(320),this.work=new l.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function N(R){var Q;return R&&R.state?(Q=R.state,R.total_in=R.total_out=Q.total=0,R.msg="",Q.wrap&&(R.adler=1&Q.wrap),Q.mode=C,Q.last=0,Q.havedict=0,Q.dmax=32768,Q.head=null,Q.hold=0,Q.bits=0,Q.lencode=Q.lendyn=new l.Buf32(S),Q.distcode=Q.distdyn=new l.Buf32(x),Q.sane=1,Q.back=-1,_):m}function j(R){var Q;return R&&R.state?((Q=R.state).wsize=0,Q.whave=0,Q.wnext=0,N(R)):m}function D(R,Q){var E,G;return R&&R.state?(G=R.state,Q<0?(E=0,Q=-Q):(E=1+(Q>>4),Q<48&&(Q&=15)),Q&&(Q<8||15<Q)?m:(G.window!==null&&G.wbits!==Q&&(G.window=null),G.wrap=E,G.wbits=Q,j(R))):m}function M(R,Q){var E,G;return R?(G=new k,(R.state=G).window=null,(E=D(R,Q))!==_&&(R.state=null),E):m}var L,V,F=!0;function W(R){if(F){var Q;for(L=new l.Buf32(512),V=new l.Buf32(32),Q=0;Q<144;)R.lens[Q++]=8;for(;Q<256;)R.lens[Q++]=9;for(;Q<280;)R.lens[Q++]=7;for(;Q<288;)R.lens[Q++]=8;for(h(y,R.lens,0,288,L,0,R.work,{bits:9}),Q=0;Q<32;)R.lens[Q++]=5;h(b,R.lens,0,32,V,0,R.work,{bits:5}),F=!1}R.lencode=L,R.lenbits=9,R.distcode=V,R.distbits=5}function oe(R,Q,E,G){var J,K=R.state;return K.window===null&&(K.wsize=1<<K.wbits,K.wnext=0,K.whave=0,K.window=new l.Buf8(K.wsize)),G>=K.wsize?(l.arraySet(K.window,Q,E-K.wsize,K.wsize,0),K.wnext=0,K.whave=K.wsize):(G<(J=K.wsize-K.wnext)&&(J=G),l.arraySet(K.window,Q,E-G,J,K.wnext),(G-=J)?(l.arraySet(K.window,Q,E-G,G,0),K.wnext=G,K.whave=K.wsize):(K.wnext+=J,K.wnext===K.wsize&&(K.wnext=0),K.whave<K.wsize&&(K.whave+=J))),0}u.inflateReset=j,u.inflateReset2=D,u.inflateResetKeep=N,u.inflateInit=function(R){return M(R,15)},u.inflateInit2=M,u.inflate=function(R,Q){var E,G,J,K,ue,re,q,z,I,B,te,ae,xe,Te,Ce,ke,je,_e,Re,Ne,g,Y,Z,A,T=0,U=new l.Buf8(4),ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!R||!R.state||!R.output||!R.input&&R.avail_in!==0)return m;(E=R.state).mode===12&&(E.mode=13),ue=R.next_out,J=R.output,q=R.avail_out,K=R.next_in,G=R.input,re=R.avail_in,z=E.hold,I=E.bits,B=re,te=q,Y=_;e:for(;;)switch(E.mode){case C:if(E.wrap===0){E.mode=13;break}for(;I<16;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(2&E.wrap&&z===35615){U[E.check=0]=255&z,U[1]=z>>>8&255,E.check=f(E.check,U,2,0),I=z=0,E.mode=2;break}if(E.flags=0,E.head&&(E.head.done=!1),!(1&E.wrap)||(((255&z)<<8)+(z>>8))%31){R.msg="incorrect header check",E.mode=30;break}if((15&z)!=8){R.msg="unknown compression method",E.mode=30;break}if(I-=4,g=8+(15&(z>>>=4)),E.wbits===0)E.wbits=g;else if(g>E.wbits){R.msg="invalid window size",E.mode=30;break}E.dmax=1<<g,R.adler=E.check=1,E.mode=512&z?10:12,I=z=0;break;case 2:for(;I<16;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(E.flags=z,(255&E.flags)!=8){R.msg="unknown compression method",E.mode=30;break}if(57344&E.flags){R.msg="unknown header flags set",E.mode=30;break}E.head&&(E.head.text=z>>8&1),512&E.flags&&(U[0]=255&z,U[1]=z>>>8&255,E.check=f(E.check,U,2,0)),I=z=0,E.mode=3;case 3:for(;I<32;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.head&&(E.head.time=z),512&E.flags&&(U[0]=255&z,U[1]=z>>>8&255,U[2]=z>>>16&255,U[3]=z>>>24&255,E.check=f(E.check,U,4,0)),I=z=0,E.mode=4;case 4:for(;I<16;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.head&&(E.head.xflags=255&z,E.head.os=z>>8),512&E.flags&&(U[0]=255&z,U[1]=z>>>8&255,E.check=f(E.check,U,2,0)),I=z=0,E.mode=5;case 5:if(1024&E.flags){for(;I<16;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.length=z,E.head&&(E.head.extra_len=z),512&E.flags&&(U[0]=255&z,U[1]=z>>>8&255,E.check=f(E.check,U,2,0)),I=z=0}else E.head&&(E.head.extra=null);E.mode=6;case 6:if(1024&E.flags&&(re<(ae=E.length)&&(ae=re),ae&&(E.head&&(g=E.head.extra_len-E.length,E.head.extra||(E.head.extra=new Array(E.head.extra_len)),l.arraySet(E.head.extra,G,K,ae,g)),512&E.flags&&(E.check=f(E.check,G,ae,K)),re-=ae,K+=ae,E.length-=ae),E.length))break e;E.length=0,E.mode=7;case 7:if(2048&E.flags){if(re===0)break e;for(ae=0;g=G[K+ae++],E.head&&g&&E.length<65536&&(E.head.name+=String.fromCharCode(g)),g&&ae<re;);if(512&E.flags&&(E.check=f(E.check,G,ae,K)),re-=ae,K+=ae,g)break e}else E.head&&(E.head.name=null);E.length=0,E.mode=8;case 8:if(4096&E.flags){if(re===0)break e;for(ae=0;g=G[K+ae++],E.head&&g&&E.length<65536&&(E.head.comment+=String.fromCharCode(g)),g&&ae<re;);if(512&E.flags&&(E.check=f(E.check,G,ae,K)),re-=ae,K+=ae,g)break e}else E.head&&(E.head.comment=null);E.mode=9;case 9:if(512&E.flags){for(;I<16;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(z!==(65535&E.check)){R.msg="header crc mismatch",E.mode=30;break}I=z=0}E.head&&(E.head.hcrc=E.flags>>9&1,E.head.done=!0),R.adler=E.check=0,E.mode=12;break;case 10:for(;I<32;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}R.adler=E.check=w(z),I=z=0,E.mode=11;case 11:if(E.havedict===0)return R.next_out=ue,R.avail_out=q,R.next_in=K,R.avail_in=re,E.hold=z,E.bits=I,2;R.adler=E.check=1,E.mode=12;case 12:if(Q===5||Q===6)break e;case 13:if(E.last){z>>>=7&I,I-=7&I,E.mode=27;break}for(;I<3;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}switch(E.last=1&z,I-=1,3&(z>>>=1)){case 0:E.mode=14;break;case 1:if(W(E),E.mode=20,Q!==6)break;z>>>=2,I-=2;break e;case 2:E.mode=17;break;case 3:R.msg="invalid block type",E.mode=30}z>>>=2,I-=2;break;case 14:for(z>>>=7&I,I-=7&I;I<32;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if((65535&z)!=(z>>>16^65535)){R.msg="invalid stored block lengths",E.mode=30;break}if(E.length=65535&z,I=z=0,E.mode=15,Q===6)break e;case 15:E.mode=16;case 16:if(ae=E.length){if(re<ae&&(ae=re),q<ae&&(ae=q),ae===0)break e;l.arraySet(J,G,K,ae,ue),re-=ae,K+=ae,q-=ae,ue+=ae,E.length-=ae;break}E.mode=12;break;case 17:for(;I<14;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(E.nlen=257+(31&z),z>>>=5,I-=5,E.ndist=1+(31&z),z>>>=5,I-=5,E.ncode=4+(15&z),z>>>=4,I-=4,286<E.nlen||30<E.ndist){R.msg="too many length or distance symbols",E.mode=30;break}E.have=0,E.mode=18;case 18:for(;E.have<E.ncode;){for(;I<3;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.lens[ee[E.have++]]=7&z,z>>>=3,I-=3}for(;E.have<19;)E.lens[ee[E.have++]]=0;if(E.lencode=E.lendyn,E.lenbits=7,Z={bits:E.lenbits},Y=h(0,E.lens,0,19,E.lencode,0,E.work,Z),E.lenbits=Z.bits,Y){R.msg="invalid code lengths set",E.mode=30;break}E.have=0,E.mode=19;case 19:for(;E.have<E.nlen+E.ndist;){for(;ke=(T=E.lencode[z&(1<<E.lenbits)-1])>>>16&255,je=65535&T,!((Ce=T>>>24)<=I);){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(je<16)z>>>=Ce,I-=Ce,E.lens[E.have++]=je;else{if(je===16){for(A=Ce+2;I<A;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(z>>>=Ce,I-=Ce,E.have===0){R.msg="invalid bit length repeat",E.mode=30;break}g=E.lens[E.have-1],ae=3+(3&z),z>>>=2,I-=2}else if(je===17){for(A=Ce+3;I<A;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}I-=Ce,g=0,ae=3+(7&(z>>>=Ce)),z>>>=3,I-=3}else{for(A=Ce+7;I<A;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}I-=Ce,g=0,ae=11+(127&(z>>>=Ce)),z>>>=7,I-=7}if(E.have+ae>E.nlen+E.ndist){R.msg="invalid bit length repeat",E.mode=30;break}for(;ae--;)E.lens[E.have++]=g}}if(E.mode===30)break;if(E.lens[256]===0){R.msg="invalid code -- missing end-of-block",E.mode=30;break}if(E.lenbits=9,Z={bits:E.lenbits},Y=h(y,E.lens,0,E.nlen,E.lencode,0,E.work,Z),E.lenbits=Z.bits,Y){R.msg="invalid literal/lengths set",E.mode=30;break}if(E.distbits=6,E.distcode=E.distdyn,Z={bits:E.distbits},Y=h(b,E.lens,E.nlen,E.ndist,E.distcode,0,E.work,Z),E.distbits=Z.bits,Y){R.msg="invalid distances set",E.mode=30;break}if(E.mode=20,Q===6)break e;case 20:E.mode=21;case 21:if(6<=re&&258<=q){R.next_out=ue,R.avail_out=q,R.next_in=K,R.avail_in=re,E.hold=z,E.bits=I,d(R,te),ue=R.next_out,J=R.output,q=R.avail_out,K=R.next_in,G=R.input,re=R.avail_in,z=E.hold,I=E.bits,E.mode===12&&(E.back=-1);break}for(E.back=0;ke=(T=E.lencode[z&(1<<E.lenbits)-1])>>>16&255,je=65535&T,!((Ce=T>>>24)<=I);){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(ke&&(240&ke)==0){for(_e=Ce,Re=ke,Ne=je;ke=(T=E.lencode[Ne+((z&(1<<_e+Re)-1)>>_e)])>>>16&255,je=65535&T,!(_e+(Ce=T>>>24)<=I);){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}z>>>=_e,I-=_e,E.back+=_e}if(z>>>=Ce,I-=Ce,E.back+=Ce,E.length=je,ke===0){E.mode=26;break}if(32&ke){E.back=-1,E.mode=12;break}if(64&ke){R.msg="invalid literal/length code",E.mode=30;break}E.extra=15&ke,E.mode=22;case 22:if(E.extra){for(A=E.extra;I<A;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.length+=z&(1<<E.extra)-1,z>>>=E.extra,I-=E.extra,E.back+=E.extra}E.was=E.length,E.mode=23;case 23:for(;ke=(T=E.distcode[z&(1<<E.distbits)-1])>>>16&255,je=65535&T,!((Ce=T>>>24)<=I);){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if((240&ke)==0){for(_e=Ce,Re=ke,Ne=je;ke=(T=E.distcode[Ne+((z&(1<<_e+Re)-1)>>_e)])>>>16&255,je=65535&T,!(_e+(Ce=T>>>24)<=I);){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}z>>>=_e,I-=_e,E.back+=_e}if(z>>>=Ce,I-=Ce,E.back+=Ce,64&ke){R.msg="invalid distance code",E.mode=30;break}E.offset=je,E.extra=15&ke,E.mode=24;case 24:if(E.extra){for(A=E.extra;I<A;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.offset+=z&(1<<E.extra)-1,z>>>=E.extra,I-=E.extra,E.back+=E.extra}if(E.offset>E.dmax){R.msg="invalid distance too far back",E.mode=30;break}E.mode=25;case 25:if(q===0)break e;if(ae=te-q,E.offset>ae){if((ae=E.offset-ae)>E.whave&&E.sane){R.msg="invalid distance too far back",E.mode=30;break}xe=ae>E.wnext?(ae-=E.wnext,E.wsize-ae):E.wnext-ae,ae>E.length&&(ae=E.length),Te=E.window}else Te=J,xe=ue-E.offset,ae=E.length;for(q<ae&&(ae=q),q-=ae,E.length-=ae;J[ue++]=Te[xe++],--ae;);E.length===0&&(E.mode=21);break;case 26:if(q===0)break e;J[ue++]=E.length,q--,E.mode=21;break;case 27:if(E.wrap){for(;I<32;){if(re===0)break e;re--,z|=G[K++]<<I,I+=8}if(te-=q,R.total_out+=te,E.total+=te,te&&(R.adler=E.check=E.flags?f(E.check,J,te,ue-te):c(E.check,J,te,ue-te)),te=q,(E.flags?z:w(z))!==E.check){R.msg="incorrect data check",E.mode=30;break}I=z=0}E.mode=28;case 28:if(E.wrap&&E.flags){for(;I<32;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(z!==(4294967295&E.total)){R.msg="incorrect length check",E.mode=30;break}I=z=0}E.mode=29;case 29:Y=1;break e;case 30:Y=-3;break e;case 31:return-4;case 32:default:return m}return R.next_out=ue,R.avail_out=q,R.next_in=K,R.avail_in=re,E.hold=z,E.bits=I,(E.wsize||te!==R.avail_out&&E.mode<30&&(E.mode<27||Q!==4))&&oe(R,R.output,R.next_out,te-R.avail_out)?(E.mode=31,-4):(B-=R.avail_in,te-=R.avail_out,R.total_in+=B,R.total_out+=te,E.total+=te,E.wrap&&te&&(R.adler=E.check=E.flags?f(E.check,J,te,R.next_out-te):c(E.check,J,te,R.next_out-te)),R.data_type=E.bits+(E.last?64:0)+(E.mode===12?128:0)+(E.mode===20||E.mode===15?256:0),(B==0&&te===0||Q===4)&&Y===_&&(Y=-5),Y)},u.inflateEnd=function(R){if(!R||!R.state)return m;var Q=R.state;return Q.window&&(Q.window=null),R.state=null,_},u.inflateGetHeader=function(R,Q){var E;return R&&R.state?(2&(E=R.state).wrap)==0?m:((E.head=Q).done=!1,_):m},u.inflateSetDictionary=function(R,Q){var E,G=Q.length;return R&&R.state?(E=R.state).wrap!==0&&E.mode!==11?m:E.mode===11&&c(1,Q,G,0)!==E.check?-3:oe(R,Q,G,G)?(E.mode=31,-4):(E.havedict=1,_):m},u.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(i,s,u){var l=i("../utils/common"),c=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],d=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],h=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];s.exports=function(y,b,_,m,C,S,x,w){var k,N,j,D,M,L,V,F,W,oe=w.bits,R=0,Q=0,E=0,G=0,J=0,K=0,ue=0,re=0,q=0,z=0,I=null,B=0,te=new l.Buf16(16),ae=new l.Buf16(16),xe=null,Te=0;for(R=0;R<=15;R++)te[R]=0;for(Q=0;Q<m;Q++)te[b[_+Q]]++;for(J=oe,G=15;1<=G&&te[G]===0;G--);if(G<J&&(J=G),G===0)return C[S++]=20971520,C[S++]=20971520,w.bits=1,0;for(E=1;E<G&&te[E]===0;E++);for(J<E&&(J=E),R=re=1;R<=15;R++)if(re<<=1,(re-=te[R])<0)return-1;if(0<re&&(y===0||G!==1))return-1;for(ae[1]=0,R=1;R<15;R++)ae[R+1]=ae[R]+te[R];for(Q=0;Q<m;Q++)b[_+Q]!==0&&(x[ae[b[_+Q]]++]=Q);if(L=y===0?(I=xe=x,19):y===1?(I=c,B-=257,xe=f,Te-=257,256):(I=d,xe=h,-1),R=E,M=S,ue=Q=z=0,j=-1,D=(q=1<<(K=J))-1,y===1&&852<q||y===2&&592<q)return 1;for(;;){for(V=R-ue,W=x[Q]<L?(F=0,x[Q]):x[Q]>L?(F=xe[Te+x[Q]],I[B+x[Q]]):(F=96,0),k=1<<R-ue,E=N=1<<K;C[M+(z>>ue)+(N-=k)]=V<<24|F<<16|W|0,N!==0;);for(k=1<<R-1;z&k;)k>>=1;if(k!==0?(z&=k-1,z+=k):z=0,Q++,--te[R]==0){if(R===G)break;R=b[_+x[Q]]}if(J<R&&(z&D)!==j){for(ue===0&&(ue=J),M+=E,re=1<<(K=R-ue);K+ue<G&&!((re-=te[K+ue])<=0);)K++,re<<=1;if(q+=1<<K,y===1&&852<q||y===2&&592<q)return 1;C[j=z&D]=J<<24|K<<16|M-S|0}}return z!==0&&(C[M+z]=R-ue<<24|4194304|0),w.bits=J,0}},{"../utils/common":41}],51:[function(i,s,u){s.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(i,s,u){var l=i("../utils/common"),c=0,f=1;function d(T){for(var U=T.length;0<=--U;)T[U]=0}var h=0,y=29,b=256,_=b+1+y,m=30,C=19,S=2*_+1,x=15,w=16,k=7,N=256,j=16,D=17,M=18,L=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],W=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],oe=new Array(2*(_+2));d(oe);var R=new Array(2*m);d(R);var Q=new Array(512);d(Q);var E=new Array(256);d(E);var G=new Array(y);d(G);var J,K,ue,re=new Array(m);function q(T,U,ee,se,X){this.static_tree=T,this.extra_bits=U,this.extra_base=ee,this.elems=se,this.max_length=X,this.has_stree=T&&T.length}function z(T,U){this.dyn_tree=T,this.max_code=0,this.stat_desc=U}function I(T){return T<256?Q[T]:Q[256+(T>>>7)]}function B(T,U){T.pending_buf[T.pending++]=255&U,T.pending_buf[T.pending++]=U>>>8&255}function te(T,U,ee){T.bi_valid>w-ee?(T.bi_buf|=U<<T.bi_valid&65535,B(T,T.bi_buf),T.bi_buf=U>>w-T.bi_valid,T.bi_valid+=ee-w):(T.bi_buf|=U<<T.bi_valid&65535,T.bi_valid+=ee)}function ae(T,U,ee){te(T,ee[2*U],ee[2*U+1])}function xe(T,U){for(var ee=0;ee|=1&T,T>>>=1,ee<<=1,0<--U;);return ee>>>1}function Te(T,U,ee){var se,X,ce=new Array(x+1),pe=0;for(se=1;se<=x;se++)ce[se]=pe=pe+ee[se-1]<<1;for(X=0;X<=U;X++){var de=T[2*X+1];de!==0&&(T[2*X]=xe(ce[de]++,de))}}function Ce(T){var U;for(U=0;U<_;U++)T.dyn_ltree[2*U]=0;for(U=0;U<m;U++)T.dyn_dtree[2*U]=0;for(U=0;U<C;U++)T.bl_tree[2*U]=0;T.dyn_ltree[2*N]=1,T.opt_len=T.static_len=0,T.last_lit=T.matches=0}function ke(T){8<T.bi_valid?B(T,T.bi_buf):0<T.bi_valid&&(T.pending_buf[T.pending++]=T.bi_buf),T.bi_buf=0,T.bi_valid=0}function je(T,U,ee,se){var X=2*U,ce=2*ee;return T[X]<T[ce]||T[X]===T[ce]&&se[U]<=se[ee]}function _e(T,U,ee){for(var se=T.heap[ee],X=ee<<1;X<=T.heap_len&&(X<T.heap_len&&je(U,T.heap[X+1],T.heap[X],T.depth)&&X++,!je(U,se,T.heap[X],T.depth));)T.heap[ee]=T.heap[X],ee=X,X<<=1;T.heap[ee]=se}function Re(T,U,ee){var se,X,ce,pe,de=0;if(T.last_lit!==0)for(;se=T.pending_buf[T.d_buf+2*de]<<8|T.pending_buf[T.d_buf+2*de+1],X=T.pending_buf[T.l_buf+de],de++,se===0?ae(T,X,U):(ae(T,(ce=E[X])+b+1,U),(pe=L[ce])!==0&&te(T,X-=G[ce],pe),ae(T,ce=I(--se),ee),(pe=V[ce])!==0&&te(T,se-=re[ce],pe)),de<T.last_lit;);ae(T,N,U)}function Ne(T,U){var ee,se,X,ce=U.dyn_tree,pe=U.stat_desc.static_tree,de=U.stat_desc.has_stree,ie=U.stat_desc.elems,be=-1;for(T.heap_len=0,T.heap_max=S,ee=0;ee<ie;ee++)ce[2*ee]!==0?(T.heap[++T.heap_len]=be=ee,T.depth[ee]=0):ce[2*ee+1]=0;for(;T.heap_len<2;)ce[2*(X=T.heap[++T.heap_len]=be<2?++be:0)]=1,T.depth[X]=0,T.opt_len--,de&&(T.static_len-=pe[2*X+1]);for(U.max_code=be,ee=T.heap_len>>1;1<=ee;ee--)_e(T,ce,ee);for(X=ie;ee=T.heap[1],T.heap[1]=T.heap[T.heap_len--],_e(T,ce,1),se=T.heap[1],T.heap[--T.heap_max]=ee,T.heap[--T.heap_max]=se,ce[2*X]=ce[2*ee]+ce[2*se],T.depth[X]=(T.depth[ee]>=T.depth[se]?T.depth[ee]:T.depth[se])+1,ce[2*ee+1]=ce[2*se+1]=X,T.heap[1]=X++,_e(T,ce,1),2<=T.heap_len;);T.heap[--T.heap_max]=T.heap[1],(function(Ee,De){var qe,$e,Et,Le,st,vt,Pe=De.dyn_tree,$t=De.max_code,Zt=De.stat_desc.static_tree,as=De.stat_desc.has_stree,Nr=De.stat_desc.extra_bits,qn=De.stat_desc.extra_base,Vt=De.stat_desc.max_length,jt=0;for(Le=0;Le<=x;Le++)Ee.bl_count[Le]=0;for(Pe[2*Ee.heap[Ee.heap_max]+1]=0,qe=Ee.heap_max+1;qe<S;qe++)Vt<(Le=Pe[2*Pe[2*($e=Ee.heap[qe])+1]+1]+1)&&(Le=Vt,jt++),Pe[2*$e+1]=Le,$t<$e||(Ee.bl_count[Le]++,st=0,qn<=$e&&(st=Nr[$e-qn]),vt=Pe[2*$e],Ee.opt_len+=vt*(Le+st),as&&(Ee.static_len+=vt*(Zt[2*$e+1]+st)));if(jt!==0){do{for(Le=Vt-1;Ee.bl_count[Le]===0;)Le--;Ee.bl_count[Le]--,Ee.bl_count[Le+1]+=2,Ee.bl_count[Vt]--,jt-=2}while(0<jt);for(Le=Vt;Le!==0;Le--)for($e=Ee.bl_count[Le];$e!==0;)$t<(Et=Ee.heap[--qe])||(Pe[2*Et+1]!==Le&&(Ee.opt_len+=(Le-Pe[2*Et+1])*Pe[2*Et],Pe[2*Et+1]=Le),$e--)}})(T,U),Te(ce,be,T.bl_count)}function g(T,U,ee){var se,X,ce=-1,pe=U[1],de=0,ie=7,be=4;for(pe===0&&(ie=138,be=3),U[2*(ee+1)+1]=65535,se=0;se<=ee;se++)X=pe,pe=U[2*(se+1)+1],++de<ie&&X===pe||(de<be?T.bl_tree[2*X]+=de:X!==0?(X!==ce&&T.bl_tree[2*X]++,T.bl_tree[2*j]++):de<=10?T.bl_tree[2*D]++:T.bl_tree[2*M]++,ce=X,be=(de=0)===pe?(ie=138,3):X===pe?(ie=6,3):(ie=7,4))}function Y(T,U,ee){var se,X,ce=-1,pe=U[1],de=0,ie=7,be=4;for(pe===0&&(ie=138,be=3),se=0;se<=ee;se++)if(X=pe,pe=U[2*(se+1)+1],!(++de<ie&&X===pe)){if(de<be)for(;ae(T,X,T.bl_tree),--de!=0;);else X!==0?(X!==ce&&(ae(T,X,T.bl_tree),de--),ae(T,j,T.bl_tree),te(T,de-3,2)):de<=10?(ae(T,D,T.bl_tree),te(T,de-3,3)):(ae(T,M,T.bl_tree),te(T,de-11,7));ce=X,be=(de=0)===pe?(ie=138,3):X===pe?(ie=6,3):(ie=7,4)}}d(re);var Z=!1;function A(T,U,ee,se){te(T,(h<<1)+(se?1:0),3),(function(X,ce,pe,de){ke(X),B(X,pe),B(X,~pe),l.arraySet(X.pending_buf,X.window,ce,pe,X.pending),X.pending+=pe})(T,U,ee)}u._tr_init=function(T){Z||((function(){var U,ee,se,X,ce,pe=new Array(x+1);for(X=se=0;X<y-1;X++)for(G[X]=se,U=0;U<1<<L[X];U++)E[se++]=X;for(E[se-1]=X,X=ce=0;X<16;X++)for(re[X]=ce,U=0;U<1<<V[X];U++)Q[ce++]=X;for(ce>>=7;X<m;X++)for(re[X]=ce<<7,U=0;U<1<<V[X]-7;U++)Q[256+ce++]=X;for(ee=0;ee<=x;ee++)pe[ee]=0;for(U=0;U<=143;)oe[2*U+1]=8,U++,pe[8]++;for(;U<=255;)oe[2*U+1]=9,U++,pe[9]++;for(;U<=279;)oe[2*U+1]=7,U++,pe[7]++;for(;U<=287;)oe[2*U+1]=8,U++,pe[8]++;for(Te(oe,_+1,pe),U=0;U<m;U++)R[2*U+1]=5,R[2*U]=xe(U,5);J=new q(oe,L,b+1,_,x),K=new q(R,V,0,m,x),ue=new q(new Array(0),F,0,C,k)})(),Z=!0),T.l_desc=new z(T.dyn_ltree,J),T.d_desc=new z(T.dyn_dtree,K),T.bl_desc=new z(T.bl_tree,ue),T.bi_buf=0,T.bi_valid=0,Ce(T)},u._tr_stored_block=A,u._tr_flush_block=function(T,U,ee,se){var X,ce,pe=0;0<T.level?(T.strm.data_type===2&&(T.strm.data_type=(function(de){var ie,be=4093624447;for(ie=0;ie<=31;ie++,be>>>=1)if(1&be&&de.dyn_ltree[2*ie]!==0)return c;if(de.dyn_ltree[18]!==0||de.dyn_ltree[20]!==0||de.dyn_ltree[26]!==0)return f;for(ie=32;ie<b;ie++)if(de.dyn_ltree[2*ie]!==0)return f;return c})(T)),Ne(T,T.l_desc),Ne(T,T.d_desc),pe=(function(de){var ie;for(g(de,de.dyn_ltree,de.l_desc.max_code),g(de,de.dyn_dtree,de.d_desc.max_code),Ne(de,de.bl_desc),ie=C-1;3<=ie&&de.bl_tree[2*W[ie]+1]===0;ie--);return de.opt_len+=3*(ie+1)+5+5+4,ie})(T),X=T.opt_len+3+7>>>3,(ce=T.static_len+3+7>>>3)<=X&&(X=ce)):X=ce=ee+5,ee+4<=X&&U!==-1?A(T,U,ee,se):T.strategy===4||ce===X?(te(T,2+(se?1:0),3),Re(T,oe,R)):(te(T,4+(se?1:0),3),(function(de,ie,be,Ee){var De;for(te(de,ie-257,5),te(de,be-1,5),te(de,Ee-4,4),De=0;De<Ee;De++)te(de,de.bl_tree[2*W[De]+1],3);Y(de,de.dyn_ltree,ie-1),Y(de,de.dyn_dtree,be-1)})(T,T.l_desc.max_code+1,T.d_desc.max_code+1,pe+1),Re(T,T.dyn_ltree,T.dyn_dtree)),Ce(T),se&&ke(T)},u._tr_tally=function(T,U,ee){return T.pending_buf[T.d_buf+2*T.last_lit]=U>>>8&255,T.pending_buf[T.d_buf+2*T.last_lit+1]=255&U,T.pending_buf[T.l_buf+T.last_lit]=255&ee,T.last_lit++,U===0?T.dyn_ltree[2*ee]++:(T.matches++,U--,T.dyn_ltree[2*(E[ee]+b+1)]++,T.dyn_dtree[2*I(U)]++),T.last_lit===T.lit_bufsize-1},u._tr_align=function(T){te(T,2,3),ae(T,N,oe),(function(U){U.bi_valid===16?(B(U,U.bi_buf),U.bi_buf=0,U.bi_valid=0):8<=U.bi_valid&&(U.pending_buf[U.pending++]=255&U.bi_buf,U.bi_buf>>=8,U.bi_valid-=8)})(T)}},{"../utils/common":41}],53:[function(i,s,u){s.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(i,s,u){(function(l){(function(c,f){if(!c.setImmediate){var d,h,y,b,_=1,m={},C=!1,S=c.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(c);x=x&&x.setTimeout?x:c,d={}.toString.call(c.process)==="[object process]"?function(j){process.nextTick(function(){k(j)})}:(function(){if(c.postMessage&&!c.importScripts){var j=!0,D=c.onmessage;return c.onmessage=function(){j=!1},c.postMessage("","*"),c.onmessage=D,j}})()?(b="setImmediate$"+Math.random()+"$",c.addEventListener?c.addEventListener("message",N,!1):c.attachEvent("onmessage",N),function(j){c.postMessage(b+j,"*")}):c.MessageChannel?((y=new MessageChannel).port1.onmessage=function(j){k(j.data)},function(j){y.port2.postMessage(j)}):S&&"onreadystatechange"in S.createElement("script")?(h=S.documentElement,function(j){var D=S.createElement("script");D.onreadystatechange=function(){k(j),D.onreadystatechange=null,h.removeChild(D),D=null},h.appendChild(D)}):function(j){setTimeout(k,0,j)},x.setImmediate=function(j){typeof j!="function"&&(j=new Function(""+j));for(var D=new Array(arguments.length-1),M=0;M<D.length;M++)D[M]=arguments[M+1];var L={callback:j,args:D};return m[_]=L,d(_),_++},x.clearImmediate=w}function w(j){delete m[j]}function k(j){if(C)setTimeout(k,0,j);else{var D=m[j];if(D){C=!0;try{(function(M){var L=M.callback,V=M.args;switch(V.length){case 0:L();break;case 1:L(V[0]);break;case 2:L(V[0],V[1]);break;case 3:L(V[0],V[1],V[2]);break;default:L.apply(f,V)}})(D)}finally{w(j),C=!1}}}}function N(j){j.source===c&&typeof j.data=="string"&&j.data.indexOf(b)===0&&k(+j.data.slice(b.length))}})(typeof self>"u"?l===void 0?this:l:self)}).call(this,typeof vr<"u"?vr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(ou)),ou.exports}var np;function m_(){if(np)return ai;np=1;var n=ai&&ai.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(ai,"__esModule",{value:!0}),ai.Filemanager=void 0;const a=n(p_()),i=Bn();class s{pendingFiles=[];pendingMessage="";pendingFormat="";setFilesForUpload(l,c){this.pendingFiles.length>0&&this.clearPendingFilesState();const f=l.filter(d=>this.validateFileType(d));if(f.length===0)throw new i.FileError("No valid files provided",{context:{stage:"setFilesForUpload"}});this.pendingFiles=f,c&&c.trim()&&(this.pendingMessage=c),this.pendingFormat=f.length>1?"zip":f?.[0]?.type?.split("/")?.[1]||"unknown"}getPendingFileState(){return{files:this.pendingFiles,message:this.pendingMessage||"",format:this.pendingFormat||""}}async uploadFilesToPresignedUrl(l){let c=0;const f=l.filter(d=>d&&d.trim());try{if(f.length===0)throw new i.FileError("No valid presigned URLs provided",{context:{stage:"uploadFilesToPresignedUrl"}});let d,h;if(this.shouldZipFiles()){const y=await this.zipFiles(),b=this.getUploadFileName();d=this.blobToFile(y,b),h="application/zip"}else d=this.pendingFiles?.[0],h=d.type;for(let y=0;y<f.length;y++){const b=f[y],_=await fetch(b,{method:"PUT",body:d,headers:{"Content-Type":h,"x-ms-blob-type":"BlockBlob"}});if(!_.ok)throw new i.FileError(`Failed to upload ${d.name} to URL ${y+1}: ${_.status} ${_.statusText}`,{context:{stage:"uploadFilesToPresignedUrl",status:_.status,url:b}});c++}return f[0]}catch(d){if(c>0)return f[0];throw(0,i.normalizeError)(d,i.FileError,"Failed to upload files to presigned URL",{context:{stage:"uploadFilesToPresignedUrl"}})}}async zipFiles(){const l=new a.default;return this.pendingFiles.forEach(f=>{l.file(f.name,f)}),await l.generateAsync({type:"blob"})}blobToFile(l,c){return new File([l],c,{type:l.type})}shouldZipFiles(){return this.pendingFiles.length>1}getUploadFileName(){return this.shouldZipFiles()?`uploaded_files_${Date.now()}.zip`:this.pendingFiles[0]?.name||"file"}validateFileType(l){return["application/pdf","image/jpeg","image/png","image/jpg","image/tiff","text/plain","text/markdown","image/heif","image/heic","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(l.type)}clearPendingFilesState(){this.pendingFiles=[],this.pendingMessage="",this.pendingFormat=""}}return ai.Filemanager=s,ai}var Mn={},rp;function lo(){if(rp)return Mn;rp=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.SYNAPSE_REALTIME_RESERVED_EVENTS=Mn.SYNAPSE_REALTIME_ERROR_CODES=Mn.SYNAPSE_REALTIME_EVENTS=Mn.SYNAPSE_MESSAGE_TYPES=void 0;const n=su();return Mn.SYNAPSE_MESSAGE_TYPES=n.SOCKET_CONTENT_TYPES,Mn.SYNAPSE_REALTIME_EVENTS={CONNECTED:"connected",DISCONNECTED:"disconnected",PROGRESS_MESSAGE:"progress_message",MESSAGE_CHUNK:"message_chunk",TIPS_MESSAGE:"tips_message",END_OF_STREAM:"end_of_stream",ERROR:"error",TOOL_CALL:"tool_call",INLINE_TEXT:"inline_text",TOOL_START:"tool_start",TOOL_END:"tool_end"},Mn.SYNAPSE_REALTIME_ERROR_CODES={SESSION_INACTIVE:"session_not_found",SESSION_EXPIRED:"session_expired",INVALID_EVENT:"invalid_event",INVALID_CONTENT_TYPE:"invalid_content",PARSING_ERROR:"parsing",FILE_UPLOAD_INPROGRESS:"file_upload_inprogress",TIMEOUT:"timeout",SERVER_ERROR:"server_error",SESSION_TOKEN_MISMATCH:"session_token_mismatch"},Mn.SYNAPSE_REALTIME_RESERVED_EVENTS={SESSION_EXPIRED:"session_expired"},Mn}var qa={},ip;function g_(){if(ip)return qa;ip=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.AudioManager=void 0;const n=Bn();class a{mediaRecorder=null;mediaStream=null;recordingStartTime=0;autoPauseTimer=null;config;onAudioData=null;onAudioError=null;suppressCallbacks=!1;constructor(s={}){this.config={mimeType:"audio/webm;codecs=opus",audioBitsPerSecond:128e3,maxRecordingDuration:9e5,autoPauseEnabled:!0,...s}}async checkCurrentPermissionState(){const s=await navigator.permissions.query({name:"microphone"});if(s.state==="denied")throw new n.RecordingError("Microphone permission denied",{context:{permissionState:s.state},hint:"Ensure the browser has microphone access enabled for this site."});return s.state}async start(s,u){try{if(!navigator.mediaDevices)throw new n.RecordingError("Media devices API is not available. This usually means the page is not served over HTTPS or there are browser restrictions.",{context:{feature:"mediaDevices"},hint:"Serve the app over HTTPS and verify browser/device microphone support.",displayMessage:"Microphone access is unavailable."});if(!window.MediaRecorder)throw new n.RecordingError("MediaRecorder is not supported in this browser",{context:{feature:"MediaRecorder"},hint:"Use a browser that supports the MediaRecorder API.",displayMessage:"Microphone access is unavailable."});const l=["audio/mp3","audio/ogg;codecs=opus","audio/mp4","audio/ogg","audio/wav"].filter(c=>MediaRecorder.isTypeSupported(c));if(l.length===0)throw new n.RecordingError("No supported audio formats found in this browser",{context:{requestedTypes:l},hint:"Verify codec support or adjust the requested MIME types.",displayMessage:"Microphone access is unavailable."});if(this.config.mimeType=l[0],await this.checkCurrentPermissionState(),this.onAudioData=s,this.onAudioError=u??null,this.suppressCallbacks=!1,this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1,sampleRate:44100,channelCount:1}}),this.mediaRecorder=new MediaRecorder(this.mediaStream,{mimeType:this.config.mimeType,audioBitsPerSecond:this.config.audioBitsPerSecond}),this.mediaRecorder.state!=="inactive")throw new n.RecordingError("MediaRecorder is in an invalid state for start()",{context:{recorderState:this.mediaRecorder.state},displayMessage:"Failed to start recording"});this.setupMediaRecorderEvents(),this.mediaRecorder.start(),this.recordingStartTime=Date.now(),this.config.autoPauseEnabled&&this.setupAutoPauseTimer()}catch(l){throw this.toRecordingError(l,"Failed to start audio recording",{stage:"start"})}}async processAudioChunk(s){try{const u=await this.blobToBase64(s),l=Date.now();if(!this.onAudioData)return;const c={audio:u,format:this.config.mimeType,duration:this.recordingStartTime>0?l-this.recordingStartTime:0,timestamp:this.recordingStartTime>0?this.recordingStartTime:l};this.onAudioData(c)}catch(u){this.handleError(u,{stage:"process_audio_chunk"})}}toRecordingError(s,u,l){if(s instanceof n.RecordingError)return s;if(s instanceof n.SynapseError)return new n.RecordingError(s.message,{cause:s,context:{...s.context,...l},hint:s.hint});const c=s instanceof Error&&s.message?s.message:u;return new n.RecordingError(c,{cause:s,context:l})}handleError(s,u){const l=this.toRecordingError(s,"Unexpected recording error",u);if(this.onAudioError)try{this.onAudioError(l)}catch(c){console.error("Audio error callback failed:",c)}else console.error("AudioManager error:",l)}setupAutoPauseTimer(){this.autoPauseTimer&&clearTimeout(this.autoPauseTimer),this.autoPauseTimer=setTimeout(()=>{console.log("Auto-pause timer triggered after 15 minutes"),this.stop()},this.config.maxRecordingDuration)}setupMediaRecorderEvents(){this.mediaRecorder&&(this.mediaRecorder.ondataavailable=s=>{this.suppressCallbacks||s.data.size<=0||this.processAudioChunk(s.data).catch(u=>this.handleError(u,{stage:"media_recorder_ondataavailable",hasData:s.data.size>0}))},this.mediaRecorder.onstop=async()=>{this.recordingStartTime=0},this.mediaRecorder.onerror=s=>{this.handleError(s.error instanceof Error?s.error:new Error("MediaRecorder encountered an unknown error"),{stage:"media_recorder_onerror"})},this.mediaRecorder.onstart=()=>{console.log("MediaRecorder started recording"),this.mediaRecorder&&(console.log("MediaRecorder state:",this.mediaRecorder.state),console.log("MediaRecorder MIME type:",this.mediaRecorder.mimeType))})}blobToBase64(s){return new Promise((u,l)=>{const c=new FileReader;c.onload=()=>{if(typeof c.result=="string"){const f=c.result.split(",")[1];u(f)}else l(new n.RecordingError("Failed to convert blob to base64",{context:{stage:"blob_to_base64"}}))},c.onerror=()=>l(new n.RecordingError("FileReader error while converting audio chunk to base64",{cause:c.error??void 0,context:{stage:"blob_to_base64"}})),c.readAsDataURL(s)})}stop(){if(this.mediaRecorder)try{this.autoPauseTimer&&(clearTimeout(this.autoPauseTimer),this.autoPauseTimer=null),this.mediaRecorder.state==="recording"&&this.mediaRecorder.stop(),this.mediaStream&&(this.mediaStream.getTracks().forEach(s=>s.stop()),this.mediaStream=null),console.log("Audio recording stopped manually")}catch(s){throw this.toRecordingError(s,"Failed to stop audio recording",{stage:"stop"})}}cancel(){if(this.mediaRecorder)try{this.suppressCallbacks=!0,this.autoPauseTimer&&(clearTimeout(this.autoPauseTimer),this.autoPauseTimer=null),this.mediaRecorder.ondataavailable=null,this.mediaRecorder.state==="recording"&&this.mediaRecorder.stop(),this.mediaStream&&(this.mediaStream.getTracks().forEach(s=>s.stop()),this.mediaStream=null)}catch(s){throw this.toRecordingError(s,"Failed to cancel audio recording",{stage:"cancel"})}}destroy(){try{this.cancel(),this.mediaRecorder&&(this.mediaRecorder=null),this.mediaStream&&(this.mediaStream.getTracks().forEach(s=>s.stop()),this.mediaStream=null)}catch(s){throw this.toRecordingError(s,"Failed to destroy audio resources",{stage:"destroy"})}}}return qa.AudioManager=a,qa}var ap;function sp(){if(ap)return Ha;ap=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.MessageManager=void 0;const n=su(),a=m_(),i=lo(),s=g_(),u=Bn();class l{connection=null;callbacks=null;fileManager=null;audioManager=null;constructor(f,d){this.connection=f||null,this.callbacks=d||null}handleFileUploadProcess({files:f,message:d,url:h}){this.fileManager||(this.fileManager=new a.Filemanager);let y;if(f&&f.length>0)this.fileManager.setFilesForUpload(f,d),y={ev:n.SOCKET_EVENTS.CHAT,ct:n.SOCKET_CONTENT_TYPES.FILE,_id:Date.now().toString(),ts:Date.now(),data:{extension:this.fileManager.getPendingFileState().format}};else if(h){const b=this.fileManager.getPendingFileState().message;y={ev:n.SOCKET_EVENTS.CHAT,ct:n.SOCKET_CONTENT_TYPES.FILE,_id:Date.now().toString(),ts:Date.now(),data:{url:h,...b&&{text:b}}},this.fileManager?.clearPendingFilesState()}return y}sendSocketMessage({message:f,files:d,audio:h,url:y,tool_declined:b,tool_id:_,initial_prompts:m}){const C=this.assertConnection("sendSocketChatMessage");let S;if(d&&d.length>0||y&&y.trim()!==""?S=this.handleFileUploadProcess({files:d,message:f,url:y}):f?S={ev:n.SOCKET_EVENTS.CHAT,ct:n.SOCKET_CONTENT_TYPES.TEXT,_id:Date.now().toString(),ts:Date.now(),data:{text:f,...b&&{tool_declined:b},..._&&{tool_id:_},...m&&{initial_prompts:m}}}:h&&h?.audio&&h?.format&&(console.log("obj",Object.keys(h||{})),S={ev:n.SOCKET_EVENTS.STREAM,ct:n.SOCKET_CONTENT_TYPES.AUDIO,_id:Date.now().toString(),ts:Date.now(),data:{audio:h?.audio,format:h?.format}}),!S){const x=new u.MessageError("No message to send",{context:{stage:"sendSocketChatMessage"}});throw this.emitError(x),x}C.sendMessage(S)}handleIncomingSocketChatMessage(f){const d=this.assertConnection("handleIncomingSocketChatMessage");switch(f.ct){case n.SOCKET_CONTENT_TYPES.FILE:{f?.data?.urls&&f.data.urls?.length>0&&this.fileManager?.uploadFilesToPresignedUrl(f.data.urls).then(()=>{this.sendSocketMessage({url:f.data.urls?.[0]})}).catch(h=>{const y=this.toFileError(h,"Failed to upload files to presigned URL",{stage:"handleIncomingSocketChatMessage",urls:f.data?.urls?.length});this.emitError(y)});break}case n.SOCKET_CONTENT_TYPES.TEXT:if(f.data.text&&f.data.text.trim()===""&&f._id){const h={data:{text:f.data.text},messageId:f._id,timestamp:f.ts};d.emit(i.SYNAPSE_REALTIME_EVENTS.MESSAGE_CHUNK,h)}break;case n.SOCKET_CONTENT_TYPES.TOOL_CALL:if(f?.data?.tool_id&&f._id){const h={data:{...f.data},messageId:f._id,timestamp:f.ts};d.emit(i.SYNAPSE_REALTIME_EVENTS.TOOL_CALL,h)}break;case n.SOCKET_CONTENT_TYPES.INLINE_TEXT:if(f?.data?.text){const h={data:{text:f.data.text},messageId:f._id,timestamp:f.ts};d.emit(i.SYNAPSE_REALTIME_EVENTS.INLINE_TEXT,h)}break}}handleIncomingSocketStreamMessage(f){const d=this.assertConnection("handleIncomingSocketStreamMessage");switch(f.ct){case n.SOCKET_CONTENT_TYPES.TEXT:if(f?.data?.progress_msg){const _={data:{text:f.data.progress_msg},messageId:f._id,timestamp:f.ts};d.emit(i.SYNAPSE_REALTIME_EVENTS.PROGRESS_MESSAGE,_);return}if(f?.data?.text){const _={data:{text:f.data.text},messageId:f._id,timestamp:f.ts};d.emit(i.SYNAPSE_REALTIME_EVENTS.MESSAGE_CHUNK,_)}break;case n.SOCKET_CONTENT_TYPES.TIPS:if(f?.data?.tips){const _={data:{tips:f.data.tips},messageId:f._id,timestamp:f.ts};d.emit(i.SYNAPSE_REALTIME_EVENTS.TIPS_MESSAGE,_);return}break;case n.SOCKET_CONTENT_TYPES.TOOL_CALL:if(f?.data?.tool_id&&f._id){const _={data:{...f.data},messageId:f._id,timestamp:f.ts};d.emit(i.SYNAPSE_REALTIME_EVENTS.TOOL_CALL,_);return}break;case n.SOCKET_CONTENT_TYPES.TOOL_START:const h={data:f?.data,messageId:f._id||Date.now().toString()};d.emit(i.SYNAPSE_REALTIME_EVENTS.TOOL_START,h);break;case n.SOCKET_CONTENT_TYPES.TOOL_END:const y={data:f?.data,messageId:f._id||Date.now().toString()};d.emit(i.SYNAPSE_REALTIME_EVENTS.TOOL_END,y);break;default:const b=new u.MessageError(`Unsupported content type ${f?.ct}`,{context:{stage:"handleIncomingSocketStreamMessage",contentType:f.ct}});throw this.emitError(b),b}}handleDisconnect(f){this.connection?.emit?.(i.SYNAPSE_REALTIME_EVENTS.DISCONNECTED,f)}handleIncomingSocketEndOfStreamMessage(f){this.assertConnection("handleIncomingSocketEndOfStreamMessage").emit(i.SYNAPSE_REALTIME_EVENTS.END_OF_STREAM)}handleIncomingSocketErrorMessage(f){const d=this.assertConnection("handleIncomingSocketErrorMessage");switch(f.code){case i.SYNAPSE_REALTIME_ERROR_CODES.SESSION_EXPIRED:d.emit(i.SYNAPSE_REALTIME_RESERVED_EVENTS.SESSION_EXPIRED);break;default:const h=new u.MessageError(f.msg||"Socket error received",{context:{stage:"handleIncomingSocketErrorMessage",errorCode:f.code}});d.emit(i.SYNAPSE_REALTIME_EVENTS.ERROR,h),this.emitError(h)}}sendSocketAuthMessage(f){const d=this.assertConnection("sendSocketAuthMessage"),h={ev:n.SOCKET_EVENTS.AUTH,_id:Date.now().toString(),ts:Date.now(),data:{token:f}};d.sendMessage(h)}sendSocketPingMessage(){const f=this.assertConnection("sendSocketPingMessage"),d={ev:n.SOCKET_EVENTS.PING,_id:Date.now().toString(),ts:Date.now()};f.sendMessage(d)}async startRecording({onChunks:f,onError:d}){if(!f){const h=new u.RecordingError("onChunks is required",{context:{stage:"startRecording"},hint:"onChunks is required"});throw this.emitError(h),h}this.assertConnection("startRecording"),this.audioManager||(this.audioManager=new s.AudioManager);try{await this.audioManager.start(f,h=>{const y=this.toRecordingError(h,"Failed to start audio recording",{stage:"startRecording"});d?.(y),this.emitError(y)})}catch(h){const y=this.toRecordingError(h,"Failed to start audio recording",{stage:"startRecording"});throw d?.(y),this.emitError(y),y}}endRecordingWithSocket(){if(!this.audioManager){const f=new u.RecordingError("Audio manager not set. Call startRecording() first.",{context:{stage:"stopRecording"}});throw this.emitError(f),f}try{this.audioManager.stop()}catch(f){const d=this.toRecordingError(f,"Failed to stop audio recording",{stage:"stopRecording"});throw this.emitError(d),d}}sendSocketPongMessage(){const f=this.assertConnection("sendSocketPongMessage"),d={ev:n.SOCKET_EVENTS.PONG,_id:Date.now().toString(),ts:Date.now()};f.sendMessage(d)}handleConnectionEstablished(){this.connection?.handleConnected(),this.connection?.emit(i.SYNAPSE_REALTIME_EVENTS.CONNECTED)}cleanupMessageServerState(){this.fileManager&&(this.fileManager.clearPendingFilesState(),this.fileManager=null),this.audioManager&&(this.audioManager.destroy(),this.audioManager=null)}emitError(f){this.callbacks?.onError?.(f)}toFileError(f,d,h,y){return(0,u.normalizeError)(f,u.FileError,d,{context:h,hint:y})}toRecordingError(f,d,h,y){return(0,u.normalizeError)(f,u.RecordingError,d,{context:h,hint:y})}assertConnection(f){if(!this.connection){const d=new u.ConnectionError("Connection not set. Please ensure the connection is established before calling this method.",{context:{stage:f}});throw this.emitError(d),d}return this.connection}}return Ha.MessageManager=l,Ha}var Ga={},op;function lp(){if(op)return Ga;op=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.ErrorUtils=void 0;const n=Bn();class a{static isAPIError(s){return s instanceof n.APIError}static isNetworkError(s){return s instanceof n.APIError&&(s.status===0||s.status===void 0)}static isTimeoutError(s){return s instanceof n.APIConnectionTimeoutError}static isAuthError(s){return s instanceof n.UnauthorizedError||s instanceof n.PermissionDeniedError}static isClientError(s){return s instanceof n.APIError&&s.status!==void 0&&s.status>=400&&s.status<500}static isServerError(s){return s instanceof n.APIError&&s.status!==void 0&&s.status>=500}static getUserFriendlyMessage(s){return a.isNetworkError(s)?"Unable to connect to the server. Please check your internet connection.":a.isTimeoutError(s)?"Request timed out. Please try again.":a.isAuthError(s)?"Authentication failed. Please log in again.":a.isServerError(s)?"Server error occurred. Please try again later.":a.isAPIError(s)||s instanceof Error?s.message:"An unexpected error occurred."}static getErrorDetails(s){return a.isAPIError(s)?{type:s.name,message:s.message,code:s.code,status:s.status,timestamp:s.timestamp,stack:s.stack,context:s.context,hint:s.hint}:s instanceof n.SynapseError?{type:s.name,message:s.message,code:s.code,timestamp:s.timestamp,stack:s.stack,context:s.context,hint:s.hint}:s instanceof Error?{type:s.name,message:s.message,stack:s.stack}:{type:"Unknown",message:String(s)}}}return Ga.ErrorUtils=a,Ga}var up;function y_(){if(up)return Ma;up=1,Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.SynapseSDK=void 0;const n=Fh(),a=h_(),i=$h(),s=sp(),u=lo(),l=lp(),c=Bn(),f=su();class d{connection=null;messageManager;resourceManager;sessionConfig=null;config;connectionType;constructor(y){this.config={...y,environment:y.environment||"production"},this.connectionType=y.connectionType||n.ConnectionType.SOCKET;const b=(0,a.getConfig)(this.config?.environment).BASE_API_URL;this.resourceManager=new i.ResourceManager({agentId:this.config.agentId,serverUrl:b})}async startSession(y){try{const b=await this.manageSession(y);return await this.initializeConnection(b),this.setupEventHandlers(),b}catch(b){const _=l.ErrorUtils.getUserFriendlyMessage(b),m=l.ErrorUtils.getErrorDetails(b),C=this.toSessionError(b,_||"Failed to start session",{stage:"startSession",details:m},"Check network connectivity or refresh credentials before retrying.");throw this.emitError(C),C}}async sendMessage({message:y,files:b,audio:_,tool_declined:m,tool_id:C,initial_prompts:S}){if(!this.connection){const x=new c.ConnectionError("Connection not established. Session may not be initialized.",{context:{stage:"sendChatMessage"},hint:"Call startSession() and wait for connection before sending messages."});throw this.emitError(x),x}switch(this.connectionType){case n.ConnectionType.SOCKET:this.messageManager.sendSocketMessage({message:y,files:b,audio:_,...m&&{tool_declined:m},...C&&{tool_id:C},...S?.length&&{initial_prompts:S}});break;default:const x=new c.ConnectionError("Unsupported connection type",{context:{stage:"sendChatMessage",connectionType:this.connectionType}});throw this.emitError(x),x}}on(y,b){this.connection?.on(y,b)}off(y,b){this.connection?.off(y,b)}getSessionConfig(){if(!this.sessionConfig?.session_id||!this.sessionConfig?.session_token)throw new c.SessionError("Session ID or token not found",{context:{stage:"getSessionConfig"},hint:"Ensure the session API returns both identifiers."});return this.sessionConfig}async callTool(y,b){if(!this.connection){const _=new c.ConnectionError("Connection not established. Session may not be initialized.",{context:{stage:"callTool"},hint:"Call startSession() before attempting to call tool."});throw this.emitError(_),_}if(!this.sessionConfig?.session_id){const _=new c.SessionError("Session ID not found",{context:{stage:"callTool"},hint:"Call startSession() before attempting to call tool."});throw this.emitError(_),_}switch(this.connectionType){case n.ConnectionType.SOCKET:try{const m=await this.resourceManager.callTool(this.sessionConfig.session_id,y,b);if(m.err)throw new c.APIError(m.err.msg,500,m.err);return m}catch(m){if(m instanceof c.APIError&&m?.status===401)return await this.handleSessionExpiry(),await this.callTool(y,b);throw m}default:const _=new c.ConnectionError("Unsupported connection type",{context:{stage:"callTool",connectionType:this.connectionType}});throw this.emitError(_),_}}async startRecording({onChunks:y,onError:b}){if(!this.connection){const _=new c.ConnectionError("Connection not established. Session may not be initialized.",{context:{stage:"sendAudio"},hint:"Call startSession() before attempting to send audio."});throw this.emitError(_),_}switch(this.connectionType){case n.ConnectionType.SOCKET:try{await this.messageManager.startRecording({onChunks:y,onError:b})}catch(m){throw m}break;default:const _=new c.ConnectionError("Unsupported connection type",{context:{stage:"sendAudio",connectionType:this.connectionType}});throw this.emitError(_),_}}endRecording(){if(!this.connection){const y=new c.ConnectionError("Connection not established. Session may not be initialized.",{context:{stage:"endRecording"},hint:"Call startRecording() before attempting to stop recording."});throw this.emitError(y),y}switch(this.connectionType){case n.ConnectionType.SOCKET:this.messageManager.endRecordingWithSocket();break;default:const y=new c.ConnectionError("Unsupported connection type",{context:{stage:"endRecording",connectionType:this.connectionType}});throw this.emitError(y),y}}isConnected(){return this.connection?.isConnected()??!1}endSession(){this.connection&&(this.connection.close(),this.connection=null),this.messageManager&&this.messageManager.cleanupMessageServerState()}emitError(y){this.config.callbacks?.onError?.(y)}toSessionError(y,b,_,m){return(0,c.normalizeError)(y,c.SessionError,b,{context:_,hint:m})}async initializeConnection(y){if(this.connection&&(this.connection.close(),this.connection=null),!y.session_id||!y.session_token)throw new c.SessionError("Session ID or token not found",{context:{stage:"initializeConnection"},hint:"Ensure the session API returns both identifiers."});this.sessionConfig=y;const b=(0,a.getConfig)(this.config?.environment).WEBSOCKET_URL,_=(this.config.connectionType==="socket",n.ConnectionType.SOCKET);this.connection=await n.ConnectionFactory.createConnection(_,{serverUrl:b,auth:{sessionId:y.session_id,sessionToken:y.session_token},agentId:this.config.agentId,userId:this.config.userId,overrides:this.config.overrides}),this.messageManager=new s.MessageManager(this.connection,this.config?.callbacks)}async manageSession(y){try{if(!y?.session_id)return this.createNewSession();const b=await this.resourceManager.validateSession(y.session_id);return b.active?y:b.expired?this.refreshSession(y.session_id,y.session_token):this.createNewSession()}catch(b){if(b instanceof c.APIError){const _=b.status;if(_===404||_===500)return this.createNewSession()}throw this.toSessionError(b,"Failed to resolve session",{stage:"resolveSession"})}}async refreshSession(y,b){try{return await this.resourceManager.refreshSession(y,b)}catch(_){if(_ instanceof c.APIError){this.emitError(_);const m=_.status;if(m===404||m===500)return this.createNewSession()}throw this.toSessionError(_,"Failed to refresh session",{stage:"refreshSession",sessionId:y})}}async createNewSession(){return await this.resourceManager.createSession(this.config.userId||Date.now().toString())}setupEventHandlers(){if(this.connection){switch(this.connectionType){case n.ConnectionType.SOCKET:this.connection.onOpen(()=>{this.onSocketConnectionOpen()}),this.connection.onMessage(y=>{this.onIncomingSocketMessage(y)}),this.connection.onError(y=>{this.onSocketConnectionError(y)}),this.connection.on(u.SYNAPSE_REALTIME_RESERVED_EVENTS.SESSION_EXPIRED,()=>{this.handleSessionExpiry()});break;default:throw new c.ConnectionError("Unsupported connection type",{context:{stage:"setupEventHandlers",connectionType:this.connectionType},hint:"Use ConnectionType.SOCKET or provide a custom handler."})}this.connection.onDisconnect(y=>{this.messageManager.handleDisconnect(y)})}}onSocketConnectionError(y){this.connection?.emit(u.SYNAPSE_REALTIME_EVENTS.ERROR,y);const b=this.toConnectionError(y,"WebSocket connection error",{stage:"onSocketConnectionError"},"Verify network connectivity or attempt to reconnect.");this.emitError(b)}onSocketConnectionOpen(){if(!this.sessionConfig?.session_token){const y=new c.SessionError("Session token not set. Call startSession() first.",{context:{stage:"onSocketConnectionOpen"},hint:"Ensure startSession() completes successfully before socket opens."});throw this.emitError(y),y}this.messageManager.sendSocketAuthMessage(this.sessionConfig.session_token)}onIncomingSocketMessage(y){switch(y.ev){case f.SOCKET_EVENTS.CHAT:this.messageManager.handleIncomingSocketChatMessage(y);break;case f.SOCKET_EVENTS.CONNECTION_ESTABLISHED:this.messageManager.handleConnectionEstablished();break;case f.SOCKET_EVENTS.STREAM:this.messageManager.handleIncomingSocketStreamMessage(y);break;case f.SOCKET_EVENTS.END_OF_STREAM:this.messageManager.handleIncomingSocketEndOfStreamMessage(y);break;case f.SOCKET_EVENTS.PING:this.messageManager.sendSocketPongMessage();break;case f.SOCKET_EVENTS.PONG:this.messageManager.sendSocketPingMessage();break;case f.SOCKET_EVENTS.SYNC:break;case f.SOCKET_EVENTS.ERROR:this.messageManager.handleIncomingSocketErrorMessage(y);break;default:const b=new c.MessageError("Unsupported message type",{context:{stage:"onIncomingSocketMessage",event:y.ev??"unknown"},hint:"Ensure the server is sending supported socket events."});this.emitError(b);return}}async handleSessionExpiry(){try{if(this.endSession(),!this.sessionConfig?.session_id||!this.sessionConfig?.session_token){const b=new c.SessionError("Session ID or token not found",{context:{stage:"handleSessionExpiry"}});throw this.emitError(b),b}const y=await this.refreshSession(this.sessionConfig.session_id,this.sessionConfig.session_token);if(!y.session_id||!y.session_token)throw new c.SessionError("Session refresh failed",{context:{stage:"handleSessionExpiry"}});this.sessionConfig.session_id=y.session_id,this.sessionConfig.session_token=y.session_token,await this.initializeConnection(y),this.setupEventHandlers(),this.config.callbacks?.onSessionRefreshed?.(y)}catch(y){const b=this.toSessionError(y,"Session expired",{stage:"handleSessionExpiry"});this.emitError(b)}}toConnectionError(y,b,_,m){return(0,c.normalizeError)(y,c.ConnectionError,b,{context:_,hint:m})}}return Ma.SynapseSDK=d,Ma}var lu={},cp;function b_(){return cp||(cp=1,Object.defineProperty(lu,"__esModule",{value:!0})),lu}var Va={},fp;function v_(){return fp||(fp=1,Object.defineProperty(Va,"__esModule",{value:!0}),Va.USER_FEEDBACK=void 0,Va.USER_FEEDBACK={LIKE:"LIKE",DISLIKE:"DISLIKE",NONE:"NONE"}),Va}var uu={},dp;function __(){return dp||(dp=1,Object.defineProperty(uu,"__esModule",{value:!0})),uu}var Ya={},hp;function S_(){return hp||(hp=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.ErrorType=void 0,Ya.ErrorType={NETWORK_ERROR:"NETWORK_ERROR",TIMEOUT_ERROR:"TIMEOUT_ERROR",API_ERROR:"API_ERROR",RATE_LIMIT_ERROR:"RATE_LIMIT_ERROR",SERVER_ERROR:"SERVER_ERROR",PARSE_ERROR:"PARSE_ERROR",UNKNOWN_ERROR:"UNKNOWN_ERROR"}),Ya}var cu={},pp;function E_(){return pp||(pp=1,Object.defineProperty(cu,"__esModule",{value:!0})),cu}var mp;function w_(){return mp||(mp=1,(function(n){var a=ni&&ni.__createBinding||(Object.create?(function(x,w,k,N){N===void 0&&(N=k);var j=Object.getOwnPropertyDescriptor(w,k);(!j||("get"in j?!w.__esModule:j.writable||j.configurable))&&(j={enumerable:!0,get:function(){return w[k]}}),Object.defineProperty(x,N,j)}):(function(x,w,k,N){N===void 0&&(N=k),x[N]=w[k]})),i=ni&&ni.__exportStar||function(x,w){for(var k in x)k!=="default"&&!Object.prototype.hasOwnProperty.call(w,k)&&a(w,x,k)};Object.defineProperty(n,"__esModule",{value:!0}),n.SYNAPSE_MESSAGE_TYPES=n.ErrorUtils=n.ErrorType=n.SynapseErrorCode=n.InternalServerError=n.RateLimitError=n.MethodNotAllowedError=n.NotFoundError=n.PermissionDeniedError=n.UnauthorizedError=n.BadRequestError=n.APIConnectionTimeoutError=n.APIUserAbortError=n.APIError=n.SynapseError=n.HttpClient=n.MessageManager=n.ToolCall=n.Session=n.ResourceManager=n.ConnectionType=n.ConnectionFactory=n.WebSocketConnection=n.BaseConnection=n.SynapseSDK=void 0;var s=y_();Object.defineProperty(n,"SynapseSDK",{enumerable:!0,get:function(){return s.SynapseSDK}});var u=Ih();Object.defineProperty(n,"BaseConnection",{enumerable:!0,get:function(){return u.BaseConnection}});var l=Bh();Object.defineProperty(n,"WebSocketConnection",{enumerable:!0,get:function(){return l.WebSocketConnection}});var c=Fh();Object.defineProperty(n,"ConnectionFactory",{enumerable:!0,get:function(){return c.ConnectionFactory}}),Object.defineProperty(n,"ConnectionType",{enumerable:!0,get:function(){return c.ConnectionType}}),i(ru(),n);var f=$h();Object.defineProperty(n,"ResourceManager",{enumerable:!0,get:function(){return f.ResourceManager}}),i(b_(),n);var d=Zh();Object.defineProperty(n,"Session",{enumerable:!0,get:function(){return d.Session}}),i(v_(),n);var h=Wh();Object.defineProperty(n,"ToolCall",{enumerable:!0,get:function(){return h.ToolCall}}),i(Kh(),n);var y=sp();Object.defineProperty(n,"MessageManager",{enumerable:!0,get:function(){return y.MessageManager}}),i(lo(),n),i(__(),n);var b=qh();Object.defineProperty(n,"HttpClient",{enumerable:!0,get:function(){return b.HttpClient}});var _=Bn();Object.defineProperty(n,"SynapseError",{enumerable:!0,get:function(){return _.SynapseError}}),Object.defineProperty(n,"APIError",{enumerable:!0,get:function(){return _.APIError}}),Object.defineProperty(n,"APIUserAbortError",{enumerable:!0,get:function(){return _.APIUserAbortError}}),Object.defineProperty(n,"APIConnectionTimeoutError",{enumerable:!0,get:function(){return _.APIConnectionTimeoutError}}),Object.defineProperty(n,"BadRequestError",{enumerable:!0,get:function(){return _.BadRequestError}}),Object.defineProperty(n,"UnauthorizedError",{enumerable:!0,get:function(){return _.UnauthorizedError}}),Object.defineProperty(n,"PermissionDeniedError",{enumerable:!0,get:function(){return _.PermissionDeniedError}}),Object.defineProperty(n,"NotFoundError",{enumerable:!0,get:function(){return _.NotFoundError}}),Object.defineProperty(n,"MethodNotAllowedError",{enumerable:!0,get:function(){return _.MethodNotAllowedError}}),Object.defineProperty(n,"RateLimitError",{enumerable:!0,get:function(){return _.RateLimitError}}),Object.defineProperty(n,"InternalServerError",{enumerable:!0,get:function(){return _.InternalServerError}}),Object.defineProperty(n,"SynapseErrorCode",{enumerable:!0,get:function(){return _.SynapseErrorCode}});var m=S_();Object.defineProperty(n,"ErrorType",{enumerable:!0,get:function(){return m.ErrorType}});var C=lp();Object.defineProperty(n,"ErrorUtils",{enumerable:!0,get:function(){return C.ErrorUtils}}),i(E_(),n);var S=lo();Object.defineProperty(n,"SYNAPSE_MESSAGE_TYPES",{enumerable:!0,get:function(){return S.SYNAPSE_MESSAGE_TYPES}})})(ni)),ni}var Mi=w_();const gp=n=>{let a;const i=new Set,s=(h,y)=>{const b=typeof h=="function"?h(a):h;if(!Object.is(b,a)){const _=a;a=y??(typeof b!="object"||b===null)?b:Object.assign({},a,b),i.forEach(m=>m(a,_))}},u=()=>a,f={setState:s,getState:u,getInitialState:()=>d,subscribe:h=>(i.add(h),()=>i.delete(h))},d=a=n(s,u,f);return f},x_=(n=>n?gp(n):gp),C_=n=>n;function k_(n,a=C_){const i=ka.useSyncExternalStore(n.subscribe,ka.useCallback(()=>a(n.getState()),[n,a]),ka.useCallback(()=>a(n.getInitialState()),[n,a]));return ka.useDebugValue(i),i}const T_=n=>{const a=x_(n),i=s=>k_(a,s);return Object.assign(i,a),i},A_=(n=>T_);function yp(n,a){let i;try{i=n()}catch{return}return{getItem:u=>{var l;const c=d=>d===null?null:JSON.parse(d,void 0),f=(l=i.getItem(u))!=null?l:null;return f instanceof Promise?f.then(c):c(f)},setItem:(u,l)=>i.setItem(u,JSON.stringify(l,void 0)),removeItem:u=>i.removeItem(u)}}const fu=n=>a=>{try{const i=n(a);return i instanceof Promise?i:{then(s){return fu(s)(i)},catch(s){return this}}}catch(i){return{then(s){return this},catch(s){return fu(s)(i)}}}},R_=(n,a)=>(i,s,u)=>{let l={storage:yp(()=>localStorage),partialize:S=>S,version:0,merge:(S,x)=>({...x,...S}),...a},c=!1;const f=new Set,d=new Set;let h=l.storage;if(!h)return n((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),i(...S)},s,u);const y=()=>{const S=l.partialize({...s()});return h.setItem(l.name,{state:S,version:l.version})},b=u.setState;u.setState=(S,x)=>(b(S,x),y());const _=n((...S)=>(i(...S),y()),s,u);u.getInitialState=()=>_;let m;const C=()=>{var S,x;if(!h)return;c=!1,f.forEach(k=>{var N;return k((N=s())!=null?N:_)});const w=((x=l.onRehydrateStorage)==null?void 0:x.call(l,(S=s())!=null?S:_))||void 0;return fu(h.getItem.bind(h))(l.name).then(k=>{if(k)if(typeof k.version=="number"&&k.version!==l.version){if(l.migrate){const N=l.migrate(k.state,k.version);return N instanceof Promise?N.then(j=>[!0,j]):[!0,N]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,k.state];return[!1,void 0]}).then(k=>{var N;const[j,D]=k;if(m=l.merge(D,(N=s())!=null?N:_),i(m,!0),j)return y()}).then(()=>{w?.(m,void 0),m=s(),c=!0,d.forEach(k=>k(m))}).catch(k=>{w?.(void 0,k)})};return u.persist={setOptions:S=>{l={...l,...S},S.storage&&(h=S.storage)},clearStorage:()=>{h?.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>C(),hasHydrated:()=>c,onHydrate:S=>(f.add(S),()=>{f.delete(S)}),onFinishHydration:S=>(d.add(S),()=>{d.delete(S)})},l.skipHydration||C(),m||_},Un={USER:"user",ASSISTANT:"assistant"};var Kt=(n=>(n.IDLE="idle",n.LISTENING="listening",n.ERROR="error",n.PROCESSING="processing",n.TRANSCRIBING="transcribing",n))(Kt||{});const N_={sessionId:"",sessionToken:"",isStreaming:!1,recordingStatus:Kt.IDLE,isWaitingForResponse:!1,error:null,isTimeoutError:!1,startNewConnection:!1,showRetryButton:!1,chats:{},inlineText:null,isRefreshingSession:!1,ConnectionStatus:Mi.ConnectionStatus.CONNECTING,streamingTimeoutId:null,responseTimeoutId:null,lastStreamingActivity:null,progressMessage:null},si=A_()(R_((n,a)=>({sessionId:"",setSessionId:i=>n({sessionId:i}),sessionToken:"",setSessionToken:i=>n({sessionToken:i}),initialMessage:null,setInitialMessage:i=>n({initialMessage:i}),agentId:"",setAgentId:i=>n({agentId:i}),connectionStatus:Mi.ConnectionStatus.CONNECTING,setConnectionStatus:i=>n({connectionStatus:i}),isStreaming:!1,setIsStreaming:i=>n({isStreaming:i}),isWaitingForResponse:!1,setIsWaitingForResponse:i=>n({isWaitingForResponse:i}),progressMessage:null,setProgressMessage:i=>n({progressMessage:i}),recordingStatus:Kt.IDLE,setRecordingStatus:i=>n({recordingStatus:i}),startNewConnection:!1,setStartNewConnection:i=>n({startNewConnection:i}),inlineText:null,setInlineText:i=>n({inlineText:i}),isBotIconAnimating:!1,setIsBotIconAnimating:i=>n({isBotIconAnimating:i}),chats:{},addMessageToSession:(i,s)=>{n(u=>({chats:{...u.chats,[i]:[...u.chats[i]||[],s]}}))},updateMessageInSession:(i,s,u)=>n(l=>({chats:{...l.chats,[i]:(l.chats[i]||[]).map(c=>c.id===s?{...c,...u}:c)}})),getMessagesForSession:i=>a().chats[i]||[],clearMessagesForSession:i=>n(s=>({chats:{...s.chats,[i]:[]}})),clearAllChats:()=>n({chats:{}}),error:null,setError:i=>n({error:i}),clearError:()=>n({error:null,isTimeoutError:!1,showRetryButton:!1,startNewConnection:!1}),showRetryButton:!1,setShowRetryButton:i=>n({showRetryButton:i}),isTimeoutError:!1,setTimeoutError:i=>n({isTimeoutError:i}),clearSession:async()=>{n(N_),console.log("Clearing session"),await localStorage.removeItem("med-assist-store")},streamingTimeoutId:null,setStreamingTimeoutId:i=>n({streamingTimeoutId:i}),clearStreamingTimeout:()=>{const i=a();i.streamingTimeoutId&&(clearTimeout(i.streamingTimeoutId),n({streamingTimeoutId:null}))},responseTimeoutId:null,setResponseTimeoutId:i=>n({responseTimeoutId:i}),clearResponseTimeout:()=>{const i=a();i.responseTimeoutId&&(clearTimeout(i.responseTimeoutId),n({responseTimeoutId:null}))},lastStreamingActivity:null,setLastStreamingActivity:i=>n({lastStreamingActivity:i})}),{name:"med-assist-store",storage:yp(()=>localStorage),partialize:n=>({agentId:n.agentId,chats:n.chats,sessionId:n.sessionId,sessionToken:n.sessionToken,initialMessage:n.initialMessage,connectionStatus:n.connectionStatus})}));function O_({onClose:n,title:a,iconUrl:i,startNewConversation:s}){const u=si(f=>f.connectionStatus),c=(()=>{switch(u){case Mi.ConnectionStatus.CONNECTED:return{dotColor:"bg-green-500",text:"Connected",textColor:"text-green-600"};case Mi.ConnectionStatus.CONNECTING:return{dotColor:"bg-amber-500",text:"Connecting",textColor:"text-amber-600"};case Mi.ConnectionStatus.NOT_CONNECTED:return{dotColor:"bg-red-500",text:"Not Connected",textColor:"text-red-600"};default:return{dotColor:"bg-gray-400",text:"Not Connected",textColor:"text-gray-600"}}})();return H.jsx("div",{className:"bg-lavender-100/95 backdrop-blur-md shadow-lg border-b border-lavender-200/60 px-6 py-2",children:H.jsxs("div",{className:"flex items-center justify-between",children:[H.jsxs("div",{className:"flex items-center gap-3",children:[H.jsxs("div",{className:"relative flex-shrink-0",children:[H.jsx(Oa,{className:"w-12 h-12 bg-gradient-to-br from-lavender-400 to-lavender-500 flex-shrink-0 shadow-md ring-0",children:H.jsx(za,{className:"text-white font-bold text-lg bg-transparent",children:i?H.jsx("img",{src:i,alt:"Bot Icon",className:"w-12 h-12 rounded-full object-cover"}):H.jsx("span",{className:"text-white font-bold text-lg bg-transparent",children:"MC"})})}),H.jsx("div",{className:Ze("absolute bottom-0 right-0 w-3.5 h-3.5 rounded-full border-2 border-white shadow-sm",c.dotColor,u===Mi.ConnectionStatus.CONNECTING&&"animate-pulse")})]}),H.jsxs("div",{className:"flex flex-col",children:[H.jsx("p",{className:"text-lg font-semibold text-slate-900",children:a||"Health Assist"}),H.jsx("div",{className:"flex items-center gap-1.5",children:H.jsx("span",{className:Ze("text-xs font-medium",c.textColor),children:c.text})})]})]}),H.jsxs("div",{className:"flex items-center gap-2",children:[H.jsx(Ot,{type:"button",variant:"ghost",size:"icon",title:"Start New Chat",onClick:s,className:"h-8 w-8 text-slate-600 hover:text-slate-900 hover:bg-white/60 active:bg-white/80 rounded-xl transition-all duration-200",children:H.jsx(Z1,{className:"w-8 h-8"})}),H.jsx(Ot,{onClick:n,type:"button",variant:"ghost",size:"icon",title:"Close",className:"h-8 w-8 text-slate-600 hover:text-slate-900 hover:bg-white/60 active:bg-white/80 rounded-xl transition-all duration-200",children:H.jsx(Wl,{className:"w-8 h-8"})})]})]})})}const z_=$.lazy(()=>Promise.resolve().then(()=>dS));function M_({isOpen:n,onClose:a,iconUrl:i,onStartNewSession:s,children:u,title:l,chatComposer:c}){const[f,d]=$.useState(!1),h=$.useRef(null);$.useEffect(()=>{const _=()=>{const m=window?.innerWidth??0,C=navigator?.userAgent?.toLowerCase()??"",S=m<768||/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(C);d(S)};return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]),$.useEffect(()=>{if(!n||!f||!h.current)return;const _=h.current;let m=null,C=null;if(window.visualViewport){const S=()=>{if(_&&window.visualViewport){const k=window.visualViewport.height,N=window.visualViewport.offsetTop;m=requestAnimationFrame(()=>{_.style.transition="none",_.style.top=`${N}px`,_.style.left="0",_.style.right="0",_.style.bottom="auto",_.style.width="100vw",_.style.height=`${k}px`,_.style.maxHeight=`${k}px`,_.style.minHeight=`${k}px`,C&&clearTimeout(C),C=setTimeout(()=>{_.style.transition=""},100)})}},x=()=>{S()},w=()=>{if(_&&window.visualViewport){const k=window.visualViewport.offsetTop;m=requestAnimationFrame(()=>{_.style.transition="none",_.style.top=`${k}px`,setTimeout(()=>{_.style.transition=""},50)})}};return window.visualViewport.addEventListener("resize",x),window.visualViewport.addEventListener("scroll",w),S(),()=>{m&&cancelAnimationFrame(m),C&&clearTimeout(C),window.visualViewport?.removeEventListener("resize",x),window.visualViewport?.removeEventListener("scroll",w)}}else{const S=()=>{_&&(_.style.transition="none",_.style.top="0",_.style.left="0",_.style.right="0",_.style.bottom="auto",_.style.width="100vw",_.style.height="100svh",_.style.maxHeight="100svh",setTimeout(()=>{_.style.transition=""},100))};return window.addEventListener("resize",S),S(),()=>{window.removeEventListener("resize",S)}}},[n,f]),$.useEffect(()=>{if(n){const _=document.body.style.overflow,m=document.body.style.paddingRight,C=document.documentElement.style.overflow,S=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",S>0&&!f&&(document.body.style.paddingRight=`${S}px`),()=>{document.body.style.overflow=_,document.body.style.paddingRight=m,document.documentElement.style.overflow=C}}},[n,f]);const y=Ze("synapse-chat-widget-container","fixed m-0 p-0","box-border",f?"":"transition-all duration-300",f?"w-screen h-[100svh]":"bottom-4 right-4 w-96 h-[600px]","z-[2147483647]",n?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none scale-95"),b=Ze("w-full h-full",f?"bg-white":"bg-white/90 backdrop-blur-2xl","shadow-2xl","flex flex-col","overflow-hidden","border border-white/50 ring-1 ring-white/60",f?"rounded-none":"rounded-3xl");return H.jsxs("div",{ref:h,className:y,style:{margin:0,padding:0,border:"none",outline:"none",position:"fixed",zIndex:2147483647,fontSize:"16px",lineHeight:"2.5",userSelect:"auto",...f&&{top:0,left:0,right:0,bottom:0,width:"100vw",maxHeight:"100svh",height:"100svh",minHeight:"100svh",backgroundColor:"white"}},children:[H.jsx("style",{children:`
|
|
3
|
+
`+ze+e+je}var K=!1;function W(e,t){if(!e||K)return"";K=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(fe){var ue=fe}Reflect.construct(e,[],ye)}else{try{ye.call()}catch(fe){ue=fe}e.call(ye.prototype)}}else{try{throw Error()}catch(fe){ue=fe}(ye=e())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(fe){if(fe&&ue&&typeof fe.stack=="string")return[fe.stack,ue.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=a.DetermineComponentFrameRoot(),x=p[0],R=p[1];if(x&&R){var G=x.split(`
|
|
4
|
+
`),oe=R.split(`
|
|
5
|
+
`);for(d=a=0;a<G.length&&!G[a].includes("DetermineComponentFrameRoot");)a++;for(;d<oe.length&&!oe[d].includes("DetermineComponentFrameRoot");)d++;if(a===G.length||d===oe.length)for(a=G.length-1,d=oe.length-1;1<=a&&0<=d&&G[a]!==oe[d];)d--;for(;1<=a&&0<=d;a--,d--)if(G[a]!==oe[d]){if(a!==1||d!==1)do if(a--,d--,0>d||G[a]!==oe[d]){var me=`
|
|
6
|
+
`+G[a].replace(" at new "," at ");return e.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",e.displayName)),me}while(1<=a&&0<=d);break}}}finally{K=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?S(r):""}function U(e,t){switch(e.tag){case 26:case 27:case 5:return S(e.type);case 16:return S("Lazy");case 13:return e.child!==t&&t!==null?S("Suspense Fallback"):S("Suspense");case 19:return S("SuspenseList");case 0:case 15:return W(e.type,!1);case 11:return W(e.type.render,!1);case 1:return W(e.type,!0);case 31:return S("Activity");default:return""}}function j(e){try{var t="",r=null;do t+=U(e,r),r=e,e=e.return;while(e);return t}catch(a){return`
|
|
7
|
+
Error generating stack: `+a.message+`
|
|
8
|
+
`+a.stack}}var X=Object.prototype.hasOwnProperty,he=n.unstable_scheduleCallback,pe=n.unstable_cancelCallback,le=n.unstable_shouldYield,Ee=n.unstable_requestPaint,_e=n.unstable_now,Se=n.unstable_getCurrentPriorityLevel,te=n.unstable_ImmediatePriority,be=n.unstable_UserBlockingPriority,Ce=n.unstable_NormalPriority,Ie=n.unstable_LowPriority,Je=n.unstable_IdlePriority,pt=n.log,qt=n.unstable_setDisableYieldValue,Xe=null,gt=null;function Ot(e){if(typeof pt=="function"&&qt(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(Xe,e)}catch{}}var Ze=Math.clz32?Math.clz32:zu,Cn=Math.log,nn=Math.LN2;function zu(e){return e>>>=0,e===0?32:31-(Cn(e)/nn|0)|0}var xi=256,Xr=262144,jn=4194304;function hn(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 $l(e,t,r){var a=e.pendingLanes;if(a===0)return 0;var d=0,p=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var R=a&134217727;return R!==0?(a=R&~p,a!==0?d=hn(a):(x&=R,x!==0?d=hn(x):r||(r=R&~e,r!==0&&(d=hn(r))))):(R=a&~p,R!==0?d=hn(R):x!==0?d=hn(x):r||(r=a&~e,r!==0&&(d=hn(r)))),d===0?0:t!==0&&t!==d&&(t&p)===0&&(p=d&-d,r=t&-t,p>=r||p===32&&(r&4194048)!==0)?t:d}function Ua(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ww(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 Op(){var e=jn;return jn<<=1,(jn&62914560)===0&&(jn=4194304),e}function Mu(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ha(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $w(e,t,r,a,d,p){var x=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var R=e.entanglements,G=e.expirationTimes,oe=e.hiddenUpdates;for(r=x&~r;0<r;){var me=31-Ze(r),ye=1<<me;R[me]=0,G[me]=-1;var ue=oe[me];if(ue!==null)for(oe[me]=null,me=0;me<ue.length;me++){var fe=ue[me];fe!==null&&(fe.lane&=-536870913)}r&=~ye}a!==0&&zp(e,a,0),p!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=p&~(x&~t))}function zp(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Ze(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|r&261930}function Mp(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var a=31-Ze(r),d=1<<a;d&t|e[a]&t&&(e[a]|=t),r&=~d}}function Dp(e,t){var r=t&-t;return r=(r&42)!==0?1:Du(r),(r&(e.suspendedLanes|t))!==0?0:r}function Du(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 ju(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function jp(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:Sb(e.type))}function Lp(e,t){var r=Q.p;try{return Q.p=e,t()}finally{Q.p=r}}var pr=Math.random().toString(36).slice(2),Dt="__reactFiber$"+pr,Xt="__reactProps$"+pr,_i="__reactContainer$"+pr,Lu="__reactEvents$"+pr,e2="__reactListeners$"+pr,t2="__reactHandles$"+pr,Ip="__reactResources$"+pr,qa="__reactMarker$"+pr;function Iu(e){delete e[Dt],delete e[Xt],delete e[Lu],delete e[e2],delete e[t2]}function wi(e){var t=e[Dt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[_i]||r[Dt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=ib(e);e!==null;){if(r=e[Dt])return r;e=ib(e)}return t}e=r,r=e.parentNode}return null}function Ci(e){if(e=e[Dt]||e[_i]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ti(e){var t=e[Ip];return t||(t=e[Ip]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function zt(e){e[qa]=!0}var Bp=new Set,Up={};function Zr(e,t){Ai(e,t),Ai(e+"Capture",t)}function Ai(e,t){for(Up[e]=t,e=0;e<t.length;e++)Bp.add(t[e])}var n2=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]*$"),Hp={},qp={};function r2(e){return X.call(qp,e)?!0:X.call(Hp,e)?!1:n2.test(e)?qp[e]=!0:(Hp[e]=!0,!1)}function eo(e,t,r){if(r2(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function to(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function Yn(e,t,r,a){if(a===null)e.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+a)}}function mn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function i2(e,t,r){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var d=a.get,p=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(x){r=""+x,p.call(this,x)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(x){r=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bu(e){if(!e._valueTracker){var t=Pp(e)?"checked":"value";e._valueTracker=i2(e,t,""+e[t])}}function Fp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),a="";return e&&(a=Pp(e)?e.checked?"true":"false":e.value),e=a,e!==r?(t.setValue(e),!0):!1}function no(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 a2=/[\n"\\]/g;function pn(e){return e.replace(a2,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Uu(e,t,r,a,d,p,x,R){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+mn(t)):e.value!==""+mn(t)&&(e.value=""+mn(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Hu(e,x,mn(t)):r!=null?Hu(e,x,mn(r)):a!=null&&e.removeAttribute("value"),d==null&&p!=null&&(e.defaultChecked=!!p),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+mn(R):e.removeAttribute("name")}function Yp(e,t,r,a,d,p,x,R){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),t!=null||r!=null){if(!(p!=="submit"&&p!=="reset"||t!=null)){Bu(e);return}r=r!=null?""+mn(r):"",t=t!=null?""+mn(t):r,R||t===e.value||(e.value=t),e.defaultValue=t}a=a??d,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=R?e.checked:!!a,e.defaultChecked=!!a,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Bu(e)}function Hu(e,t,r){t==="number"&&no(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function ki(e,t,r,a){if(e=e.options,t){t={};for(var d=0;d<r.length;d++)t["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=t.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&a&&(e[r].defaultSelected=!0)}else{for(r=""+mn(r),t=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,a&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Vp(e,t,r){if(t!=null&&(t=""+mn(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+mn(r):""}function Gp(e,t,r,a){if(t==null){if(a!=null){if(r!=null)throw Error(o(92));if(V(a)){if(1<a.length)throw Error(o(93));a=a[0]}r=a}r==null&&(r=""),t=r}r=mn(t),e.defaultValue=r,a=e.textContent,a===r&&a!==""&&a!==null&&(e.value=a),Bu(e)}function Ni(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var l2=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 Xp(e,t,r){var a=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,r):typeof r!="number"||r===0||l2.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function Zp(e,t,r){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,r!=null){for(var a in r)!r.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var d in t)a=t[d],t.hasOwnProperty(d)&&r[d]!==a&&Xp(e,d,a)}else for(var p in t)t.hasOwnProperty(p)&&Xp(e,p,t[p])}function qu(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 o2=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"]]),s2=/^[\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 ro(e){return s2.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Vn(){}var Pu=null;function Fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ri=null,Oi=null;function Kp(e){var t=Ci(e);if(t&&(e=t.stateNode)){var r=e[Xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Uu(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+pn(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var a=r[t];if(a!==e&&a.form===e.form){var d=a[Xt]||null;if(!d)throw Error(o(90));Uu(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<r.length;t++)a=r[t],a.form===e.form&&Fp(a)}break e;case"textarea":Vp(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&ki(e,!!r.multiple,t,!1)}}}var Yu=!1;function Qp(e,t,r){if(Yu)return e(t,r);Yu=!0;try{var a=e(t);return a}finally{if(Yu=!1,(Ri!==null||Oi!==null)&&(Vo(),Ri&&(t=Ri,e=Oi,Oi=Ri=null,Kp(t),e)))for(t=0;t<e.length;t++)Kp(e[t])}}function Fa(e,t){var r=e.stateNode;if(r===null)return null;var a=r[Xt]||null;if(a===null)return null;r=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(o(231,t,typeof r));return r}var Gn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vu=!1;if(Gn)try{var Ya={};Object.defineProperty(Ya,"passive",{get:function(){Vu=!0}}),window.addEventListener("test",Ya,Ya),window.removeEventListener("test",Ya,Ya)}catch{Vu=!1}var gr=null,Gu=null,io=null;function Jp(){if(io)return io;var e,t=Gu,r=t.length,a,d="value"in gr?gr.value:gr.textContent,p=d.length;for(e=0;e<r&&t[e]===d[e];e++);var x=r-e;for(a=1;a<=x&&t[r-a]===d[p-a];a++);return io=d.slice(e,1<a?1-a:void 0)}function ao(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 lo(){return!0}function Wp(){return!1}function Zt(e){function t(r,a,d,p,x){this._reactName=r,this._targetInst=d,this.type=a,this.nativeEvent=p,this.target=x,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(r=e[R],this[R]=r?r(p):p[R]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?lo:Wp,this.isPropagationStopped=Wp,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=lo)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=lo)},persist:function(){},isPersistent:lo}),t}var Kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oo=Zt(Kr),Va=y({},Kr,{view:0,detail:0}),u2=Zt(Va),Xu,Zu,Ga,so=y({},Va,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qu,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!==Ga&&(Ga&&e.type==="mousemove"?(Xu=e.screenX-Ga.screenX,Zu=e.screenY-Ga.screenY):Zu=Xu=0,Ga=e),Xu)},movementY:function(e){return"movementY"in e?e.movementY:Zu}}),$p=Zt(so),c2=y({},so,{dataTransfer:0}),f2=Zt(c2),d2=y({},Va,{relatedTarget:0}),Ku=Zt(d2),h2=y({},Kr,{animationName:0,elapsedTime:0,pseudoElement:0}),m2=Zt(h2),p2=y({},Kr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),g2=Zt(p2),y2=y({},Kr,{data:0}),eg=Zt(y2),b2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},v2={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"},S2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function E2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=S2[e])?!!t[e]:!1}function Qu(){return E2}var x2=y({},Va,{key:function(e){if(e.key){var t=b2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ao(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?v2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qu,charCode:function(e){return e.type==="keypress"?ao(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ao(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_2=Zt(x2),w2=y({},so,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tg=Zt(w2),C2=y({},Va,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qu}),T2=Zt(C2),A2=y({},Kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),k2=Zt(A2),N2=y({},so,{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}),R2=Zt(N2),O2=y({},Kr,{newState:0,oldState:0}),z2=Zt(O2),M2=[9,13,27,32],Ju=Gn&&"CompositionEvent"in window,Xa=null;Gn&&"documentMode"in document&&(Xa=document.documentMode);var D2=Gn&&"TextEvent"in window&&!Xa,ng=Gn&&(!Ju||Xa&&8<Xa&&11>=Xa),rg=" ",ig=!1;function ag(e,t){switch(e){case"keyup":return M2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zi=!1;function j2(e,t){switch(e){case"compositionend":return lg(t);case"keypress":return t.which!==32?null:(ig=!0,rg);case"textInput":return e=t.data,e===rg&&ig?null:e;default:return null}}function L2(e,t){if(zi)return e==="compositionend"||!Ju&&ag(e,t)?(e=Jp(),io=Gu=gr=null,zi=!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 ng&&t.locale!=="ko"?null:t.data;default:return null}}var I2={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 og(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!I2[e.type]:t==="textarea"}function sg(e,t,r,a){Ri?Oi?Oi.push(a):Oi=[a]:Ri=a,t=Wo(t,"onChange"),0<t.length&&(r=new oo("onChange","change",null,r,a),e.push({event:r,listeners:t}))}var Za=null,Ka=null;function B2(e){Y0(e,0)}function uo(e){var t=Pa(e);if(Fp(t))return e}function ug(e,t){if(e==="change")return t}var cg=!1;if(Gn){var Wu;if(Gn){var $u="oninput"in document;if(!$u){var fg=document.createElement("div");fg.setAttribute("oninput","return;"),$u=typeof fg.oninput=="function"}Wu=$u}else Wu=!1;cg=Wu&&(!document.documentMode||9<document.documentMode)}function dg(){Za&&(Za.detachEvent("onpropertychange",hg),Ka=Za=null)}function hg(e){if(e.propertyName==="value"&&uo(Ka)){var t=[];sg(t,Ka,e,Fu(e)),Qp(B2,t)}}function U2(e,t,r){e==="focusin"?(dg(),Za=t,Ka=r,Za.attachEvent("onpropertychange",hg)):e==="focusout"&&dg()}function H2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return uo(Ka)}function q2(e,t){if(e==="click")return uo(t)}function P2(e,t){if(e==="input"||e==="change")return uo(t)}function F2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rn=typeof Object.is=="function"?Object.is:F2;function Qa(e,t){if(rn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var d=r[a];if(!X.call(t,d)||!rn(e[d],t[d]))return!1}return!0}function mg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pg(e,t){var r=mg(e);e=0;for(var a;r;){if(r.nodeType===3){if(a=e+r.textContent.length,e<=t&&a>=t)return{node:r,offset:t-e};e=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=mg(r)}}function gg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=no(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=no(e.document)}return t}function ec(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 Y2=Gn&&"documentMode"in document&&11>=document.documentMode,Mi=null,tc=null,Ja=null,nc=!1;function bg(e,t,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;nc||Mi==null||Mi!==no(a)||(a=Mi,"selectionStart"in a&&ec(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ja&&Qa(Ja,a)||(Ja=a,a=Wo(tc,"onSelect"),0<a.length&&(t=new oo("onSelect","select",null,t,r),e.push({event:t,listeners:a}),t.target=Mi)))}function Qr(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Di={animationend:Qr("Animation","AnimationEnd"),animationiteration:Qr("Animation","AnimationIteration"),animationstart:Qr("Animation","AnimationStart"),transitionrun:Qr("Transition","TransitionRun"),transitionstart:Qr("Transition","TransitionStart"),transitioncancel:Qr("Transition","TransitionCancel"),transitionend:Qr("Transition","TransitionEnd")},rc={},vg={};Gn&&(vg=document.createElement("div").style,"AnimationEvent"in window||(delete Di.animationend.animation,delete Di.animationiteration.animation,delete Di.animationstart.animation),"TransitionEvent"in window||delete Di.transitionend.transition);function Jr(e){if(rc[e])return rc[e];if(!Di[e])return e;var t=Di[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in vg)return rc[e]=t[r];return e}var Sg=Jr("animationend"),Eg=Jr("animationiteration"),xg=Jr("animationstart"),V2=Jr("transitionrun"),G2=Jr("transitionstart"),X2=Jr("transitioncancel"),_g=Jr("transitionend"),wg=new Map,ic="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(" ");ic.push("scrollEnd");function Tn(e,t){wg.set(e,t),Zr(t,[e])}var co=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}},gn=[],ji=0,ac=0;function fo(){for(var e=ji,t=ac=ji=0;t<e;){var r=gn[t];gn[t++]=null;var a=gn[t];gn[t++]=null;var d=gn[t];gn[t++]=null;var p=gn[t];if(gn[t++]=null,a!==null&&d!==null){var x=a.pending;x===null?d.next=d:(d.next=x.next,x.next=d),a.pending=d}p!==0&&Cg(r,d,p)}}function ho(e,t,r,a){gn[ji++]=e,gn[ji++]=t,gn[ji++]=r,gn[ji++]=a,ac|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function lc(e,t,r,a){return ho(e,t,r,a),mo(e)}function Wr(e,t){return ho(e,null,null,t),mo(e)}function Cg(e,t,r){e.lanes|=r;var a=e.alternate;a!==null&&(a.lanes|=r);for(var d=!1,p=e.return;p!==null;)p.childLanes|=r,a=p.alternate,a!==null&&(a.childLanes|=r),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(d=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,d&&t!==null&&(d=31-Ze(r),e=p.hiddenUpdates,a=e[d],a===null?e[d]=[t]:a.push(t),t.lane=r|536870912),p):null}function mo(e){if(50<vl)throw vl=0,gf=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Li={};function Z2(e,t,r,a){this.tag=e,this.key=r,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function an(e,t,r,a){return new Z2(e,t,r,a)}function oc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xn(e,t){var r=e.alternate;return r===null?(r=an(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Tg(e,t){e.flags&=65011714;var r=e.alternate;return r===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=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function po(e,t,r,a,d,p){var x=0;if(a=e,typeof e=="function")oc(e)&&(x=1);else if(typeof e=="string")x=$C(e,r,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case F:return e=an(31,r,t,d),e.elementType=F,e.lanes=p,e;case E:return $r(r.children,d,p,t);case T:x=8,d|=24;break;case _:return e=an(12,r,t,d|2),e.elementType=_,e.lanes=p,e;case H:return e=an(13,r,t,d),e.elementType=H,e.lanes=p,e;case M:return e=an(19,r,t,d),e.elementType=M,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case k:x=10;break e;case A:x=9;break e;case q:x=11;break e;case I:x=14;break e;case Y:x=16,a=null;break e}x=29,r=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=an(x,r,t,d),t.elementType=e,t.type=a,t.lanes=p,t}function $r(e,t,r,a){return e=an(7,e,a,t),e.lanes=r,e}function sc(e,t,r){return e=an(6,e,null,t),e.lanes=r,e}function Ag(e){var t=an(18,null,null,0);return t.stateNode=e,t}function uc(e,t,r){return t=an(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var kg=new WeakMap;function yn(e,t){if(typeof e=="object"&&e!==null){var r=kg.get(e);return r!==void 0?r:(t={value:e,source:t,stack:j(t)},kg.set(e,t),t)}return{value:e,source:t,stack:j(t)}}var Ii=[],Bi=0,go=null,Wa=0,bn=[],vn=0,yr=null,Ln=1,In="";function Zn(e,t){Ii[Bi++]=Wa,Ii[Bi++]=go,go=e,Wa=t}function Ng(e,t,r){bn[vn++]=Ln,bn[vn++]=In,bn[vn++]=yr,yr=e;var a=Ln;e=In;var d=32-Ze(a)-1;a&=~(1<<d),r+=1;var p=32-Ze(t)+d;if(30<p){var x=d-d%5;p=(a&(1<<x)-1).toString(32),a>>=x,d-=x,Ln=1<<32-Ze(t)+d|r<<d|a,In=p+e}else Ln=1<<p|r<<d|a,In=e}function cc(e){e.return!==null&&(Zn(e,1),Ng(e,1,0))}function fc(e){for(;e===go;)go=Ii[--Bi],Ii[Bi]=null,Wa=Ii[--Bi],Ii[Bi]=null;for(;e===yr;)yr=bn[--vn],bn[vn]=null,In=bn[--vn],bn[vn]=null,Ln=bn[--vn],bn[vn]=null}function Rg(e,t){bn[vn++]=Ln,bn[vn++]=In,bn[vn++]=yr,Ln=t.id,In=t.overflow,yr=e}var jt=null,ht=null,et=!1,br=null,Sn=!1,dc=Error(o(519));function vr(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw $a(yn(t,e)),dc}function Og(e){var t=e.stateNode,r=e.type,a=e.memoizedProps;switch(t[Dt]=e,t[Xt]=a,r){case"dialog":Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":case"embed":Qe("load",t);break;case"video":case"audio":for(r=0;r<El.length;r++)Qe(El[r],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),Yp(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Qe("invalid",t);break;case"textarea":Qe("invalid",t),Gp(t,a.value,a.defaultValue,a.children)}r=a.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||a.suppressHydrationWarning===!0||Z0(t.textContent,r)?(a.popover!=null&&(Qe("beforetoggle",t),Qe("toggle",t)),a.onScroll!=null&&Qe("scroll",t),a.onScrollEnd!=null&&Qe("scrollend",t),a.onClick!=null&&(t.onclick=Vn),t=!0):t=!1,t||vr(e,!0)}function zg(e){for(jt=e.return;jt;)switch(jt.tag){case 5:case 31:case 13:Sn=!1;return;case 27:case 3:Sn=!0;return;default:jt=jt.return}}function Ui(e){if(e!==jt)return!1;if(!et)return zg(e),et=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Of(e.type,e.memoizedProps)),r=!r),r&&ht&&vr(e),zg(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ht=rb(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ht=rb(e)}else t===27?(t=ht,Mr(e.type)?(e=Lf,Lf=null,ht=e):ht=t):ht=jt?xn(e.stateNode.nextSibling):null;return!0}function ei(){ht=jt=null,et=!1}function hc(){var e=br;return e!==null&&(Wt===null?Wt=e:Wt.push.apply(Wt,e),br=null),e}function $a(e){br===null?br=[e]:br.push(e)}var mc=N(null),ti=null,Kn=null;function Sr(e,t,r){z(mc,t._currentValue),t._currentValue=r}function Qn(e){e._currentValue=mc.current,B(mc)}function pc(e,t,r){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===r)break;e=e.return}}function gc(e,t,r,a){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var p=d.dependencies;if(p!==null){var x=d.child;p=p.firstContext;e:for(;p!==null;){var R=p;p=d;for(var G=0;G<t.length;G++)if(R.context===t[G]){p.lanes|=r,R=p.alternate,R!==null&&(R.lanes|=r),pc(p.return,r,e),a||(x=null);break e}p=R.next}}else if(d.tag===18){if(x=d.return,x===null)throw Error(o(341));x.lanes|=r,p=x.alternate,p!==null&&(p.lanes|=r),pc(x,r,e),x=null}else x=d.child;if(x!==null)x.return=d;else for(x=d;x!==null;){if(x===e){x=null;break}if(d=x.sibling,d!==null){d.return=x.return,x=d;break}x=x.return}d=x}}function Hi(e,t,r,a){e=null;for(var d=t,p=!1;d!==null;){if(!p){if((d.flags&524288)!==0)p=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var x=d.alternate;if(x===null)throw Error(o(387));if(x=x.memoizedProps,x!==null){var R=d.type;rn(d.pendingProps.value,x.value)||(e!==null?e.push(R):e=[R])}}else if(d===Te.current){if(x=d.alternate,x===null)throw Error(o(387));x.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Tl):e=[Tl])}d=d.return}e!==null&&gc(t,e,r,a),t.flags|=262144}function yo(e){for(e=e.firstContext;e!==null;){if(!rn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ni(e){ti=e,Kn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Lt(e){return Mg(ti,e)}function bo(e,t){return ti===null&&ni(e),Mg(e,t)}function Mg(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},Kn===null){if(e===null)throw Error(o(308));Kn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Kn=Kn.next=t;return r}var K2=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},Q2=n.unstable_scheduleCallback,J2=n.unstable_NormalPriority,_t={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yc(){return{controller:new K2,data:new Map,refCount:0}}function el(e){e.refCount--,e.refCount===0&&Q2(J2,function(){e.controller.abort()})}var tl=null,bc=0,qi=0,Pi=null;function W2(e,t){if(tl===null){var r=tl=[];bc=0,qi=xf(),Pi={status:"pending",value:void 0,then:function(a){r.push(a)}}}return bc++,t.then(Dg,Dg),t}function Dg(){if(--bc===0&&tl!==null){Pi!==null&&(Pi.status="fulfilled");var e=tl;tl=null,qi=0,Pi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function $2(e,t){var r=[],a={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var d=0;d<r.length;d++)(0,r[d])(t)},function(d){for(a.status="rejected",a.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),a}var jg=Z.S;Z.S=function(e,t){b0=_e(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&W2(e,t),jg!==null&&jg(e,t)};var ri=N(null);function vc(){var e=ri.current;return e!==null?e:ct.pooledCache}function vo(e,t){t===null?z(ri,ri.current):z(ri,t.pool)}function Lg(){var e=vc();return e===null?null:{parent:_t._currentValue,pool:e}}var Fi=Error(o(460)),Sc=Error(o(474)),So=Error(o(542)),Eo={then:function(){}};function Ig(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Bg(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(Vn,Vn),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hg(e),e;default:if(typeof t.status=="string")t.then(Vn,Vn);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=a}},function(a){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hg(e),e}throw ai=t,Fi}}function ii(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(ai=r,Fi):r}}var ai=null;function Ug(){if(ai===null)throw Error(o(459));var e=ai;return ai=null,e}function Hg(e){if(e===Fi||e===So)throw Error(o(483))}var Yi=null,nl=0;function xo(e){var t=nl;return nl+=1,Yi===null&&(Yi=[]),Bg(Yi,e,t)}function rl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function _o(e,t){throw t.$$typeof===v?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function qg(e){function t(ee,J){if(e){var ae=ee.deletions;ae===null?(ee.deletions=[J],ee.flags|=16):ae.push(J)}}function r(ee,J){if(!e)return null;for(;J!==null;)t(ee,J),J=J.sibling;return null}function a(ee){for(var J=new Map;ee!==null;)ee.key!==null?J.set(ee.key,ee):J.set(ee.index,ee),ee=ee.sibling;return J}function d(ee,J){return ee=Xn(ee,J),ee.index=0,ee.sibling=null,ee}function p(ee,J,ae){return ee.index=ae,e?(ae=ee.alternate,ae!==null?(ae=ae.index,ae<J?(ee.flags|=67108866,J):ae):(ee.flags|=67108866,J)):(ee.flags|=1048576,J)}function x(ee){return e&&ee.alternate===null&&(ee.flags|=67108866),ee}function R(ee,J,ae,ge){return J===null||J.tag!==6?(J=sc(ae,ee.mode,ge),J.return=ee,J):(J=d(J,ae),J.return=ee,J)}function G(ee,J,ae,ge){var De=ae.type;return De===E?me(ee,J,ae.props.children,ge,ae.key):J!==null&&(J.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Y&&ii(De)===J.type)?(J=d(J,ae.props),rl(J,ae),J.return=ee,J):(J=po(ae.type,ae.key,ae.props,null,ee.mode,ge),rl(J,ae),J.return=ee,J)}function oe(ee,J,ae,ge){return J===null||J.tag!==4||J.stateNode.containerInfo!==ae.containerInfo||J.stateNode.implementation!==ae.implementation?(J=uc(ae,ee.mode,ge),J.return=ee,J):(J=d(J,ae.children||[]),J.return=ee,J)}function me(ee,J,ae,ge,De){return J===null||J.tag!==7?(J=$r(ae,ee.mode,ge,De),J.return=ee,J):(J=d(J,ae),J.return=ee,J)}function ye(ee,J,ae){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=sc(""+J,ee.mode,ae),J.return=ee,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return ae=po(J.type,J.key,J.props,null,ee.mode,ae),rl(ae,J),ae.return=ee,ae;case w:return J=uc(J,ee.mode,ae),J.return=ee,J;case Y:return J=ii(J),ye(ee,J,ae)}if(V(J)||D(J))return J=$r(J,ee.mode,ae,null),J.return=ee,J;if(typeof J.then=="function")return ye(ee,xo(J),ae);if(J.$$typeof===k)return ye(ee,bo(ee,J),ae);_o(ee,J)}return null}function ue(ee,J,ae,ge){var De=J!==null?J.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return De!==null?null:R(ee,J,""+ae,ge);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case b:return ae.key===De?G(ee,J,ae,ge):null;case w:return ae.key===De?oe(ee,J,ae,ge):null;case Y:return ae=ii(ae),ue(ee,J,ae,ge)}if(V(ae)||D(ae))return De!==null?null:me(ee,J,ae,ge,null);if(typeof ae.then=="function")return ue(ee,J,xo(ae),ge);if(ae.$$typeof===k)return ue(ee,J,bo(ee,ae),ge);_o(ee,ae)}return null}function fe(ee,J,ae,ge,De){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ee=ee.get(ae)||null,R(J,ee,""+ge,De);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case b:return ee=ee.get(ge.key===null?ae:ge.key)||null,G(J,ee,ge,De);case w:return ee=ee.get(ge.key===null?ae:ge.key)||null,oe(J,ee,ge,De);case Y:return ge=ii(ge),fe(ee,J,ae,ge,De)}if(V(ge)||D(ge))return ee=ee.get(ae)||null,me(J,ee,ge,De,null);if(typeof ge.then=="function")return fe(ee,J,ae,xo(ge),De);if(ge.$$typeof===k)return fe(ee,J,ae,bo(J,ge),De);_o(J,ge)}return null}function Ne(ee,J,ae,ge){for(var De=null,tt=null,Me=J,Fe=J=0,$e=null;Me!==null&&Fe<ae.length;Fe++){Me.index>Fe?($e=Me,Me=null):$e=Me.sibling;var nt=ue(ee,Me,ae[Fe],ge);if(nt===null){Me===null&&(Me=$e);break}e&&Me&&nt.alternate===null&&t(ee,Me),J=p(nt,J,Fe),tt===null?De=nt:tt.sibling=nt,tt=nt,Me=$e}if(Fe===ae.length)return r(ee,Me),et&&Zn(ee,Fe),De;if(Me===null){for(;Fe<ae.length;Fe++)Me=ye(ee,ae[Fe],ge),Me!==null&&(J=p(Me,J,Fe),tt===null?De=Me:tt.sibling=Me,tt=Me);return et&&Zn(ee,Fe),De}for(Me=a(Me);Fe<ae.length;Fe++)$e=fe(Me,ee,Fe,ae[Fe],ge),$e!==null&&(e&&$e.alternate!==null&&Me.delete($e.key===null?Fe:$e.key),J=p($e,J,Fe),tt===null?De=$e:tt.sibling=$e,tt=$e);return e&&Me.forEach(function(Br){return t(ee,Br)}),et&&Zn(ee,Fe),De}function Le(ee,J,ae,ge){if(ae==null)throw Error(o(151));for(var De=null,tt=null,Me=J,Fe=J=0,$e=null,nt=ae.next();Me!==null&&!nt.done;Fe++,nt=ae.next()){Me.index>Fe?($e=Me,Me=null):$e=Me.sibling;var Br=ue(ee,Me,nt.value,ge);if(Br===null){Me===null&&(Me=$e);break}e&&Me&&Br.alternate===null&&t(ee,Me),J=p(Br,J,Fe),tt===null?De=Br:tt.sibling=Br,tt=Br,Me=$e}if(nt.done)return r(ee,Me),et&&Zn(ee,Fe),De;if(Me===null){for(;!nt.done;Fe++,nt=ae.next())nt=ye(ee,nt.value,ge),nt!==null&&(J=p(nt,J,Fe),tt===null?De=nt:tt.sibling=nt,tt=nt);return et&&Zn(ee,Fe),De}for(Me=a(Me);!nt.done;Fe++,nt=ae.next())nt=fe(Me,ee,Fe,nt.value,ge),nt!==null&&(e&&nt.alternate!==null&&Me.delete(nt.key===null?Fe:nt.key),J=p(nt,J,Fe),tt===null?De=nt:tt.sibling=nt,tt=nt);return e&&Me.forEach(function(cT){return t(ee,cT)}),et&&Zn(ee,Fe),De}function ut(ee,J,ae,ge){if(typeof ae=="object"&&ae!==null&&ae.type===E&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case b:e:{for(var De=ae.key;J!==null;){if(J.key===De){if(De=ae.type,De===E){if(J.tag===7){r(ee,J.sibling),ge=d(J,ae.props.children),ge.return=ee,ee=ge;break e}}else if(J.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Y&&ii(De)===J.type){r(ee,J.sibling),ge=d(J,ae.props),rl(ge,ae),ge.return=ee,ee=ge;break e}r(ee,J);break}else t(ee,J);J=J.sibling}ae.type===E?(ge=$r(ae.props.children,ee.mode,ge,ae.key),ge.return=ee,ee=ge):(ge=po(ae.type,ae.key,ae.props,null,ee.mode,ge),rl(ge,ae),ge.return=ee,ee=ge)}return x(ee);case w:e:{for(De=ae.key;J!==null;){if(J.key===De)if(J.tag===4&&J.stateNode.containerInfo===ae.containerInfo&&J.stateNode.implementation===ae.implementation){r(ee,J.sibling),ge=d(J,ae.children||[]),ge.return=ee,ee=ge;break e}else{r(ee,J);break}else t(ee,J);J=J.sibling}ge=uc(ae,ee.mode,ge),ge.return=ee,ee=ge}return x(ee);case Y:return ae=ii(ae),ut(ee,J,ae,ge)}if(V(ae))return Ne(ee,J,ae,ge);if(D(ae)){if(De=D(ae),typeof De!="function")throw Error(o(150));return ae=De.call(ae),Le(ee,J,ae,ge)}if(typeof ae.then=="function")return ut(ee,J,xo(ae),ge);if(ae.$$typeof===k)return ut(ee,J,bo(ee,ae),ge);_o(ee,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,J!==null&&J.tag===6?(r(ee,J.sibling),ge=d(J,ae),ge.return=ee,ee=ge):(r(ee,J),ge=sc(ae,ee.mode,ge),ge.return=ee,ee=ge),x(ee)):r(ee,J)}return function(ee,J,ae,ge){try{nl=0;var De=ut(ee,J,ae,ge);return Yi=null,De}catch(Me){if(Me===Fi||Me===So)throw Me;var tt=an(29,Me,null,ee.mode);return tt.lanes=ge,tt.return=ee,tt}finally{}}}var li=qg(!0),Pg=qg(!1),Er=!1;function Ec(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xc(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 xr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _r(e,t,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(it&2)!==0){var d=a.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),a.pending=t,t=mo(e),Cg(e,null,r),t}return ho(e,a,t,r),mo(e)}function il(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,Mp(e,r)}}function _c(e,t){var r=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var d=null,p=null;if(r=r.firstBaseUpdate,r!==null){do{var x={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};p===null?d=p=x:p=p.next=x,r=r.next}while(r!==null);p===null?d=p=t:p=p.next=t}else d=p=t;r={baseState:a.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:a.shared,callbacks:a.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var wc=!1;function al(){if(wc){var e=Pi;if(e!==null)throw e}}function ll(e,t,r,a){wc=!1;var d=e.updateQueue;Er=!1;var p=d.firstBaseUpdate,x=d.lastBaseUpdate,R=d.shared.pending;if(R!==null){d.shared.pending=null;var G=R,oe=G.next;G.next=null,x===null?p=oe:x.next=oe,x=G;var me=e.alternate;me!==null&&(me=me.updateQueue,R=me.lastBaseUpdate,R!==x&&(R===null?me.firstBaseUpdate=oe:R.next=oe,me.lastBaseUpdate=G))}if(p!==null){var ye=d.baseState;x=0,me=oe=G=null,R=p;do{var ue=R.lane&-536870913,fe=ue!==R.lane;if(fe?(We&ue)===ue:(a&ue)===ue){ue!==0&&ue===qi&&(wc=!0),me!==null&&(me=me.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Ne=e,Le=R;ue=t;var ut=r;switch(Le.tag){case 1:if(Ne=Le.payload,typeof Ne=="function"){ye=Ne.call(ut,ye,ue);break e}ye=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Le.payload,ue=typeof Ne=="function"?Ne.call(ut,ye,ue):Ne,ue==null)break e;ye=y({},ye,ue);break e;case 2:Er=!0}}ue=R.callback,ue!==null&&(e.flags|=64,fe&&(e.flags|=8192),fe=d.callbacks,fe===null?d.callbacks=[ue]:fe.push(ue))}else fe={lane:ue,tag:R.tag,payload:R.payload,callback:R.callback,next:null},me===null?(oe=me=fe,G=ye):me=me.next=fe,x|=ue;if(R=R.next,R===null){if(R=d.shared.pending,R===null)break;fe=R,R=fe.next,fe.next=null,d.lastBaseUpdate=fe,d.shared.pending=null}}while(!0);me===null&&(G=ye),d.baseState=G,d.firstBaseUpdate=oe,d.lastBaseUpdate=me,p===null&&(d.shared.lanes=0),kr|=x,e.lanes=x,e.memoizedState=ye}}function Fg(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Yg(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Fg(r[e],t)}var Vi=N(null),wo=N(0);function Vg(e,t){e=ar,z(wo,e),z(Vi,t),ar=e|t.baseLanes}function Cc(){z(wo,ar),z(Vi,Vi.current)}function Tc(){ar=wo.current,B(Vi),B(wo)}var ln=N(null),En=null;function wr(e){var t=e.alternate;z(St,St.current&1),z(ln,e),En===null&&(t===null||Vi.current!==null||t.memoizedState!==null)&&(En=e)}function Ac(e){z(St,St.current),z(ln,e),En===null&&(En=e)}function Gg(e){e.tag===22?(z(St,St.current),z(ln,e),En===null&&(En=e)):Cr()}function Cr(){z(St,St.current),z(ln,ln.current)}function on(e){B(ln),En===e&&(En=null),B(St)}var St=N(0);function Co(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Df(r)||jf(r)))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 Jn=0,qe=null,ot=null,wt=null,To=!1,Gi=!1,oi=!1,Ao=0,ol=0,Xi=null,eC=0;function bt(){throw Error(o(321))}function kc(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!rn(e[r],t[r]))return!1;return!0}function Nc(e,t,r,a,d,p){return Jn=p,qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Z.H=e===null||e.memoizedState===null?Ny:Yc,oi=!1,p=r(a,d),oi=!1,Gi&&(p=Zg(t,r,a,d)),Xg(e),p}function Xg(e){Z.H=cl;var t=ot!==null&&ot.next!==null;if(Jn=0,wt=ot=qe=null,To=!1,ol=0,Xi=null,t)throw Error(o(300));e===null||Ct||(e=e.dependencies,e!==null&&yo(e)&&(Ct=!0))}function Zg(e,t,r,a){qe=e;var d=0;do{if(Gi&&(Xi=null),ol=0,Gi=!1,25<=d)throw Error(o(301));if(d+=1,wt=ot=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}Z.H=Ry,p=t(r,a)}while(Gi);return p}function tC(){var e=Z.H,t=e.useState()[0];return t=typeof t.then=="function"?sl(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(qe.flags|=1024),t}function Rc(){var e=Ao!==0;return Ao=0,e}function Oc(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function zc(e){if(To){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}To=!1}Jn=0,wt=ot=qe=null,Gi=!1,ol=Ao=0,Xi=null}function Pt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?qe.memoizedState=wt=e:wt=wt.next=e,wt}function Et(){if(ot===null){var e=qe.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=wt===null?qe.memoizedState:wt.next;if(t!==null)wt=t,ot=e;else{if(e===null)throw qe.alternate===null?Error(o(467)):Error(o(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},wt===null?qe.memoizedState=wt=e:wt=wt.next=e}return wt}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function sl(e){var t=ol;return ol+=1,Xi===null&&(Xi=[]),e=Bg(Xi,e,t),t=qe,(wt===null?t.memoizedState:wt.next)===null&&(t=t.alternate,Z.H=t===null||t.memoizedState===null?Ny:Yc),e}function No(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return sl(e);if(e.$$typeof===k)return Lt(e)}throw Error(o(438,String(e)))}function Mc(e){var t=null,r=qe.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var a=qe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=ko(),qe.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),a=0;a<e;a++)r[a]=$;return t.index++,r}function Wn(e,t){return typeof t=="function"?t(e):t}function Ro(e){var t=Et();return Dc(t,ot,e)}function Dc(e,t,r){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=r;var d=e.baseQueue,p=a.pending;if(p!==null){if(d!==null){var x=d.next;d.next=p.next,p.next=x}t.baseQueue=d=p,a.pending=null}if(p=e.baseState,d===null)e.memoizedState=p;else{t=d.next;var R=x=null,G=null,oe=t,me=!1;do{var ye=oe.lane&-536870913;if(ye!==oe.lane?(We&ye)===ye:(Jn&ye)===ye){var ue=oe.revertLane;if(ue===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),ye===qi&&(me=!0);else if((Jn&ue)===ue){oe=oe.next,ue===qi&&(me=!0);continue}else ye={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},G===null?(R=G=ye,x=p):G=G.next=ye,qe.lanes|=ue,kr|=ue;ye=oe.action,oi&&r(p,ye),p=oe.hasEagerState?oe.eagerState:r(p,ye)}else ue={lane:ye,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},G===null?(R=G=ue,x=p):G=G.next=ue,qe.lanes|=ye,kr|=ye;oe=oe.next}while(oe!==null&&oe!==t);if(G===null?x=p:G.next=R,!rn(p,e.memoizedState)&&(Ct=!0,me&&(r=Pi,r!==null)))throw r;e.memoizedState=p,e.baseState=x,e.baseQueue=G,a.lastRenderedState=p}return d===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function jc(e){var t=Et(),r=t.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=e;var a=r.dispatch,d=r.pending,p=t.memoizedState;if(d!==null){r.pending=null;var x=d=d.next;do p=e(p,x.action),x=x.next;while(x!==d);rn(p,t.memoizedState)||(Ct=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),r.lastRenderedState=p}return[p,a]}function Kg(e,t,r){var a=qe,d=Et(),p=et;if(p){if(r===void 0)throw Error(o(407));r=r()}else r=t();var x=!rn((ot||d).memoizedState,r);if(x&&(d.memoizedState=r,Ct=!0),d=d.queue,Bc(Wg.bind(null,a,d,e),[e]),d.getSnapshot!==t||x||wt!==null&&wt.memoizedState.tag&1){if(a.flags|=2048,Zi(9,{destroy:void 0},Jg.bind(null,a,d,r,t),null),ct===null)throw Error(o(349));p||(Jn&127)!==0||Qg(a,t,r)}return r}function Qg(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=qe.updateQueue,t===null?(t=ko(),qe.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Jg(e,t,r,a){t.value=r,t.getSnapshot=a,$g(t)&&ey(e)}function Wg(e,t,r){return r(function(){$g(t)&&ey(e)})}function $g(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!rn(e,r)}catch{return!0}}function ey(e){var t=Wr(e,2);t!==null&&$t(t,e,2)}function Lc(e){var t=Pt();if(typeof e=="function"){var r=e;if(e=r(),oi){Ot(!0);try{r()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:e},t}function ty(e,t,r,a){return e.baseState=r,Dc(e,ot,typeof a=="function"?a:Wn)}function nC(e,t,r,a,d){if(Mo(e))throw Error(o(485));if(e=t.action,e!==null){var p={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){p.listeners.push(x)}};Z.T!==null?r(!0):p.isTransition=!1,a(p),r=t.pending,r===null?(p.next=t.pending=p,ny(t,p)):(p.next=r.next,t.pending=r.next=p)}}function ny(e,t){var r=t.action,a=t.payload,d=e.state;if(t.isTransition){var p=Z.T,x={};Z.T=x;try{var R=r(d,a),G=Z.S;G!==null&&G(x,R),ry(e,t,R)}catch(oe){Ic(e,t,oe)}finally{p!==null&&x.types!==null&&(p.types=x.types),Z.T=p}}else try{p=r(d,a),ry(e,t,p)}catch(oe){Ic(e,t,oe)}}function ry(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(a){iy(e,t,a)},function(a){return Ic(e,t,a)}):iy(e,t,r)}function iy(e,t,r){t.status="fulfilled",t.value=r,ay(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,ny(e,r)))}function Ic(e,t,r){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=r,ay(t),t=t.next;while(t!==a)}e.action=null}function ay(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ly(e,t){return t}function oy(e,t){if(et){var r=ct.formState;if(r!==null){e:{var a=qe;if(et){if(ht){t:{for(var d=ht,p=Sn;d.nodeType!==8;){if(!p){d=null;break t}if(d=xn(d.nextSibling),d===null){d=null;break t}}p=d.data,d=p==="F!"||p==="F"?d:null}if(d){ht=xn(d.nextSibling),a=d.data==="F!";break e}}vr(a)}a=!1}a&&(t=r[0])}}return r=Pt(),r.memoizedState=r.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ly,lastRenderedState:t},r.queue=a,r=Ty.bind(null,qe,a),a.dispatch=r,a=Lc(!1),p=Fc.bind(null,qe,!1,a.queue),a=Pt(),d={state:t,dispatch:null,action:e,pending:null},a.queue=d,r=nC.bind(null,qe,d,p,r),d.dispatch=r,a.memoizedState=e,[t,r,!1]}function sy(e){var t=Et();return uy(t,ot,e)}function uy(e,t,r){if(t=Dc(e,t,ly)[0],e=Ro(Wn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=sl(t)}catch(x){throw x===Fi?So:x}else a=t;t=Et();var d=t.queue,p=d.dispatch;return r!==t.memoizedState&&(qe.flags|=2048,Zi(9,{destroy:void 0},rC.bind(null,d,r),null)),[a,p,e]}function rC(e,t){e.action=t}function cy(e){var t=Et(),r=ot;if(r!==null)return uy(t,r,e);Et(),t=t.memoizedState,r=Et();var a=r.queue.dispatch;return r.memoizedState=e,[t,a,!1]}function Zi(e,t,r,a){return e={tag:e,create:r,deps:a,inst:t,next:null},t=qe.updateQueue,t===null&&(t=ko(),qe.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(a=r.next,r.next=e,e.next=a,t.lastEffect=e),e}function fy(){return Et().memoizedState}function Oo(e,t,r,a){var d=Pt();qe.flags|=e,d.memoizedState=Zi(1|t,{destroy:void 0},r,a===void 0?null:a)}function zo(e,t,r,a){var d=Et();a=a===void 0?null:a;var p=d.memoizedState.inst;ot!==null&&a!==null&&kc(a,ot.memoizedState.deps)?d.memoizedState=Zi(t,p,r,a):(qe.flags|=e,d.memoizedState=Zi(1|t,p,r,a))}function dy(e,t){Oo(8390656,8,e,t)}function Bc(e,t){zo(2048,8,e,t)}function iC(e){qe.flags|=4;var t=qe.updateQueue;if(t===null)t=ko(),qe.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function hy(e){var t=Et().memoizedState;return iC({ref:t,nextImpl:e}),function(){if((it&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function my(e,t){return zo(4,2,e,t)}function py(e,t){return zo(4,4,e,t)}function gy(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yy(e,t,r){r=r!=null?r.concat([e]):null,zo(4,4,gy.bind(null,t,e),r)}function Uc(){}function by(e,t){var r=Et();t=t===void 0?null:t;var a=r.memoizedState;return t!==null&&kc(t,a[1])?a[0]:(r.memoizedState=[e,t],e)}function vy(e,t){var r=Et();t=t===void 0?null:t;var a=r.memoizedState;if(t!==null&&kc(t,a[1]))return a[0];if(a=e(),oi){Ot(!0);try{e()}finally{Ot(!1)}}return r.memoizedState=[a,t],a}function Hc(e,t,r){return r===void 0||(Jn&1073741824)!==0&&(We&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=S0(),qe.lanes|=e,kr|=e,r)}function Sy(e,t,r,a){return rn(r,t)?r:Vi.current!==null?(e=Hc(e,r,a),rn(e,t)||(Ct=!0),e):(Jn&42)===0||(Jn&1073741824)!==0&&(We&261930)===0?(Ct=!0,e.memoizedState=r):(e=S0(),qe.lanes|=e,kr|=e,t)}function Ey(e,t,r,a,d){var p=Q.p;Q.p=p!==0&&8>p?p:8;var x=Z.T,R={};Z.T=R,Fc(e,!1,t,r);try{var G=d(),oe=Z.S;if(oe!==null&&oe(R,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var me=$2(G,a);ul(e,t,me,cn(e))}else ul(e,t,a,cn(e))}catch(ye){ul(e,t,{then:function(){},status:"rejected",reason:ye},cn())}finally{Q.p=p,x!==null&&R.types!==null&&(x.types=R.types),Z.T=x}}function aC(){}function qc(e,t,r,a){if(e.tag!==5)throw Error(o(476));var d=xy(e).queue;Ey(e,d,t,se,r===null?aC:function(){return _y(e),r(a)})}function xy(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:se},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function _y(e){var t=xy(e);t.next===null&&(t=e.alternate.memoizedState),ul(e,t.next.queue,{},cn())}function Pc(){return Lt(Tl)}function wy(){return Et().memoizedState}function Cy(){return Et().memoizedState}function lC(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=cn();e=xr(r);var a=_r(t,e,r);a!==null&&($t(a,t,r),il(a,t,r)),t={cache:yc()},e.payload=t;return}t=t.return}}function oC(e,t,r){var a=cn();r={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Mo(e)?Ay(t,r):(r=lc(e,t,r,a),r!==null&&($t(r,e,a),ky(r,t,a)))}function Ty(e,t,r){var a=cn();ul(e,t,r,a)}function ul(e,t,r,a){var d={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Mo(e))Ay(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var x=t.lastRenderedState,R=p(x,r);if(d.hasEagerState=!0,d.eagerState=R,rn(R,x))return ho(e,t,d,0),ct===null&&fo(),!1}catch{}finally{}if(r=lc(e,t,d,a),r!==null)return $t(r,e,a),ky(r,t,a),!0}return!1}function Fc(e,t,r,a){if(a={lane:2,revertLane:xf(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Mo(e)){if(t)throw Error(o(479))}else t=lc(e,r,a,2),t!==null&&$t(t,e,2)}function Mo(e){var t=e.alternate;return e===qe||t!==null&&t===qe}function Ay(e,t){Gi=To=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function ky(e,t,r){if((r&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,Mp(e,r)}}var cl={readContext:Lt,use:No,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt};cl.useEffectEvent=bt;var Ny={readContext:Lt,use:No,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:dy,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,Oo(4194308,4,gy.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Oo(4194308,4,e,t)},useInsertionEffect:function(e,t){Oo(4,2,e,t)},useMemo:function(e,t){var r=Pt();t=t===void 0?null:t;var a=e();if(oi){Ot(!0);try{e()}finally{Ot(!1)}}return r.memoizedState=[a,t],a},useReducer:function(e,t,r){var a=Pt();if(r!==void 0){var d=r(t);if(oi){Ot(!0);try{r(t)}finally{Ot(!1)}}}else d=t;return a.memoizedState=a.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},a.queue=e,e=e.dispatch=oC.bind(null,qe,e),[a.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:function(e){e=Lc(e);var t=e.queue,r=Ty.bind(null,qe,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:Uc,useDeferredValue:function(e,t){var r=Pt();return Hc(r,e,t)},useTransition:function(){var e=Lc(!1);return e=Ey.bind(null,qe,e.queue,!0,!1),Pt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var a=qe,d=Pt();if(et){if(r===void 0)throw Error(o(407));r=r()}else{if(r=t(),ct===null)throw Error(o(349));(We&127)!==0||Qg(a,t,r)}d.memoizedState=r;var p={value:r,getSnapshot:t};return d.queue=p,dy(Wg.bind(null,a,p,e),[e]),a.flags|=2048,Zi(9,{destroy:void 0},Jg.bind(null,a,p,r,t),null),r},useId:function(){var e=Pt(),t=ct.identifierPrefix;if(et){var r=In,a=Ln;r=(a&~(1<<32-Ze(a)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Ao++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=eC++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Pc,useFormState:oy,useActionState:oy,useOptimistic:function(e){var t=Pt();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=Fc.bind(null,qe,!0,r),r.dispatch=t,[e,t]},useMemoCache:Mc,useCacheRefresh:function(){return Pt().memoizedState=lC.bind(null,qe)},useEffectEvent:function(e){var t=Pt(),r={impl:e};return t.memoizedState=r,function(){if((it&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}},Yc={readContext:Lt,use:No,useCallback:by,useContext:Lt,useEffect:Bc,useImperativeHandle:yy,useInsertionEffect:my,useLayoutEffect:py,useMemo:vy,useReducer:Ro,useRef:fy,useState:function(){return Ro(Wn)},useDebugValue:Uc,useDeferredValue:function(e,t){var r=Et();return Sy(r,ot.memoizedState,e,t)},useTransition:function(){var e=Ro(Wn)[0],t=Et().memoizedState;return[typeof e=="boolean"?e:sl(e),t]},useSyncExternalStore:Kg,useId:wy,useHostTransitionStatus:Pc,useFormState:sy,useActionState:sy,useOptimistic:function(e,t){var r=Et();return ty(r,ot,e,t)},useMemoCache:Mc,useCacheRefresh:Cy};Yc.useEffectEvent=hy;var Ry={readContext:Lt,use:No,useCallback:by,useContext:Lt,useEffect:Bc,useImperativeHandle:yy,useInsertionEffect:my,useLayoutEffect:py,useMemo:vy,useReducer:jc,useRef:fy,useState:function(){return jc(Wn)},useDebugValue:Uc,useDeferredValue:function(e,t){var r=Et();return ot===null?Hc(r,e,t):Sy(r,ot.memoizedState,e,t)},useTransition:function(){var e=jc(Wn)[0],t=Et().memoizedState;return[typeof e=="boolean"?e:sl(e),t]},useSyncExternalStore:Kg,useId:wy,useHostTransitionStatus:Pc,useFormState:cy,useActionState:cy,useOptimistic:function(e,t){var r=Et();return ot!==null?ty(r,ot,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Mc,useCacheRefresh:Cy};Ry.useEffectEvent=hy;function Vc(e,t,r,a){t=e.memoizedState,r=r(a,t),r=r==null?t:y({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Gc={enqueueSetState:function(e,t,r){e=e._reactInternals;var a=cn(),d=xr(a);d.payload=t,r!=null&&(d.callback=r),t=_r(e,d,a),t!==null&&($t(t,e,a),il(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var a=cn(),d=xr(a);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=_r(e,d,a),t!==null&&($t(t,e,a),il(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=cn(),a=xr(r);a.tag=2,t!=null&&(a.callback=t),t=_r(e,a,r),t!==null&&($t(t,e,r),il(t,e,r))}};function Oy(e,t,r,a,d,p,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,p,x):t.prototype&&t.prototype.isPureReactComponent?!Qa(r,a)||!Qa(d,p):!0}function zy(e,t,r,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,a),t.state!==e&&Gc.enqueueReplaceState(t,t.state,null)}function si(e,t){var r=t;if("ref"in t){r={};for(var a in t)a!=="ref"&&(r[a]=t[a])}if(e=e.defaultProps){r===t&&(r=y({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function My(e){co(e)}function Dy(e){}function jy(e){co(e)}function Do(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Ly(e,t,r){try{var a=e.onCaughtError;a(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Xc(e,t,r){return r=xr(r),r.tag=3,r.payload={element:null},r.callback=function(){Do(e,t)},r}function Iy(e){return e=xr(e),e.tag=3,e}function By(e,t,r,a){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var p=a.value;e.payload=function(){return d(p)},e.callback=function(){Ly(t,r,a)}}var x=r.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Ly(t,r,a),typeof d!="function"&&(Nr===null?Nr=new Set([this]):Nr.add(this));var R=a.stack;this.componentDidCatch(a.value,{componentStack:R!==null?R:""})})}function sC(e,t,r,a,d){if(r.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=r.alternate,t!==null&&Hi(t,r,d,!0),r=ln.current,r!==null){switch(r.tag){case 31:case 13:return En===null?Go():r.alternate===null&&vt===0&&(vt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,a===Eo?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([a]):t.add(a),vf(e,a,d)),!1;case 22:return r.flags|=65536,a===Eo?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([a]):r.add(a)),vf(e,a,d)),!1}throw Error(o(435,r.tag))}return vf(e,a,d),Go(),!1}if(et)return t=ln.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,a!==dc&&(e=Error(o(422),{cause:a}),$a(yn(e,r)))):(a!==dc&&(t=Error(o(423),{cause:a}),$a(yn(t,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,a=yn(a,r),d=Xc(e.stateNode,a,d),_c(e,d),vt!==4&&(vt=2)),!1;var p=Error(o(520),{cause:a});if(p=yn(p,r),bl===null?bl=[p]:bl.push(p),vt!==4&&(vt=2),t===null)return!0;a=yn(a,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=Xc(r.stateNode,a,e),_c(r,e),!1;case 1:if(t=r.type,p=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Nr===null||!Nr.has(p))))return r.flags|=65536,d&=-d,r.lanes|=d,d=Iy(d),By(d,e,r,a),_c(r,d),!1}r=r.return}while(r!==null);return!1}var Zc=Error(o(461)),Ct=!1;function It(e,t,r,a){t.child=e===null?Pg(t,null,r,a):li(t,e.child,r,a)}function Uy(e,t,r,a,d){r=r.render;var p=t.ref;if("ref"in a){var x={};for(var R in a)R!=="ref"&&(x[R]=a[R])}else x=a;return ni(t),a=Nc(e,t,r,x,p,d),R=Rc(),e!==null&&!Ct?(Oc(e,t,d),$n(e,t,d)):(et&&R&&cc(t),t.flags|=1,It(e,t,a,d),t.child)}function Hy(e,t,r,a,d){if(e===null){var p=r.type;return typeof p=="function"&&!oc(p)&&p.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=p,qy(e,t,p,a,d)):(e=po(r.type,null,a,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,!nf(e,d)){var x=p.memoizedProps;if(r=r.compare,r=r!==null?r:Qa,r(x,a)&&e.ref===t.ref)return $n(e,t,d)}return t.flags|=1,e=Xn(p,a),e.ref=t.ref,e.return=t,t.child=e}function qy(e,t,r,a,d){if(e!==null){var p=e.memoizedProps;if(Qa(p,a)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=a=p,nf(e,d))(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,$n(e,t,d)}return Kc(e,t,r,a,d)}function Py(e,t,r,a){var d=a.children,p=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(p=p!==null?p.baseLanes|r:r,e!==null){for(a=t.child=e.child,d=0;a!==null;)d=d|a.lanes|a.childLanes,a=a.sibling;a=d&~p}else a=0,t.child=null;return Fy(e,t,p,r,a)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&vo(t,p!==null?p.cachePool:null),p!==null?Vg(t,p):Cc(),Gg(t);else return a=t.lanes=536870912,Fy(e,t,p!==null?p.baseLanes|r:r,r,a)}else p!==null?(vo(t,p.cachePool),Vg(t,p),Cr(),t.memoizedState=null):(e!==null&&vo(t,null),Cc(),Cr());return It(e,t,d,r),t.child}function fl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Fy(e,t,r,a,d){var p=vc();return p=p===null?null:{parent:_t._currentValue,pool:p},t.memoizedState={baseLanes:r,cachePool:p},e!==null&&vo(t,null),Cc(),Gg(t),e!==null&&Hi(e,t,a,!0),t.childLanes=d,null}function jo(e,t){return t=Io({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Yy(e,t,r){return li(t,e.child,null,r),e=jo(t,t.pendingProps),e.flags|=2,on(t),t.memoizedState=null,e}function uC(e,t,r){var a=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(et){if(a.mode==="hidden")return e=jo(t,a),t.lanes=536870912,fl(null,e);if(Ac(t),(e=ht)?(e=nb(e,Sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yr!==null?{id:Ln,overflow:In}:null,retryLane:536870912,hydrationErrors:null},r=Ag(e),r.return=t,t.child=r,jt=t,ht=null)):e=null,e===null)throw vr(t);return t.lanes=536870912,null}return jo(t,a)}var p=e.memoizedState;if(p!==null){var x=p.dehydrated;if(Ac(t),d)if(t.flags&256)t.flags&=-257,t=Yy(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ct||Hi(e,t,r,!1),d=(r&e.childLanes)!==0,Ct||d){if(a=ct,a!==null&&(x=Dp(a,r),x!==0&&x!==p.retryLane))throw p.retryLane=x,Wr(e,x),$t(a,e,x),Zc;Go(),t=Yy(e,t,r)}else e=p.treeContext,ht=xn(x.nextSibling),jt=t,et=!0,br=null,Sn=!1,e!==null&&Rg(t,e),t=jo(t,a),t.flags|=4096;return t}return e=Xn(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Lo(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(o(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function Kc(e,t,r,a,d){return ni(t),r=Nc(e,t,r,a,void 0,d),a=Rc(),e!==null&&!Ct?(Oc(e,t,d),$n(e,t,d)):(et&&a&&cc(t),t.flags|=1,It(e,t,r,d),t.child)}function Vy(e,t,r,a,d,p){return ni(t),t.updateQueue=null,r=Zg(t,a,r,d),Xg(e),a=Rc(),e!==null&&!Ct?(Oc(e,t,p),$n(e,t,p)):(et&&a&&cc(t),t.flags|=1,It(e,t,r,p),t.child)}function Gy(e,t,r,a,d){if(ni(t),t.stateNode===null){var p=Li,x=r.contextType;typeof x=="object"&&x!==null&&(p=Lt(x)),p=new r(a,p),t.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Gc,t.stateNode=p,p._reactInternals=t,p=t.stateNode,p.props=a,p.state=t.memoizedState,p.refs={},Ec(t),x=r.contextType,p.context=typeof x=="object"&&x!==null?Lt(x):Li,p.state=t.memoizedState,x=r.getDerivedStateFromProps,typeof x=="function"&&(Vc(t,r,x,a),p.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(x=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),x!==p.state&&Gc.enqueueReplaceState(p,p.state,null),ll(t,a,p,d),al(),p.state=t.memoizedState),typeof p.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){p=t.stateNode;var R=t.memoizedProps,G=si(r,R);p.props=G;var oe=p.context,me=r.contextType;x=Li,typeof me=="object"&&me!==null&&(x=Lt(me));var ye=r.getDerivedStateFromProps;me=typeof ye=="function"||typeof p.getSnapshotBeforeUpdate=="function",R=t.pendingProps!==R,me||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(R||oe!==x)&&zy(t,p,a,x),Er=!1;var ue=t.memoizedState;p.state=ue,ll(t,a,p,d),al(),oe=t.memoizedState,R||ue!==oe||Er?(typeof ye=="function"&&(Vc(t,r,ye,a),oe=t.memoizedState),(G=Er||Oy(t,r,G,a,ue,oe,x))?(me||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=oe),p.props=a,p.state=oe,p.context=x,a=G):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{p=t.stateNode,xc(e,t),x=t.memoizedProps,me=si(r,x),p.props=me,ye=t.pendingProps,ue=p.context,oe=r.contextType,G=Li,typeof oe=="object"&&oe!==null&&(G=Lt(oe)),R=r.getDerivedStateFromProps,(oe=typeof R=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(x!==ye||ue!==G)&&zy(t,p,a,G),Er=!1,ue=t.memoizedState,p.state=ue,ll(t,a,p,d),al();var fe=t.memoizedState;x!==ye||ue!==fe||Er||e!==null&&e.dependencies!==null&&yo(e.dependencies)?(typeof R=="function"&&(Vc(t,r,R,a),fe=t.memoizedState),(me=Er||Oy(t,r,me,a,ue,fe,G)||e!==null&&e.dependencies!==null&&yo(e.dependencies))?(oe||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(a,fe,G),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(a,fe,G)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||x===e.memoizedProps&&ue===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ue===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=fe),p.props=a,p.state=fe,p.context=G,a=me):(typeof p.componentDidUpdate!="function"||x===e.memoizedProps&&ue===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ue===e.memoizedState||(t.flags|=1024),a=!1)}return p=a,Lo(e,t),a=(t.flags&128)!==0,p||a?(p=t.stateNode,r=a&&typeof r.getDerivedStateFromError!="function"?null:p.render(),t.flags|=1,e!==null&&a?(t.child=li(t,e.child,null,d),t.child=li(t,null,r,d)):It(e,t,r,d),t.memoizedState=p.state,e=t.child):e=$n(e,t,d),e}function Xy(e,t,r,a){return ei(),t.flags|=256,It(e,t,r,a),t.child}var Qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:Lg()}}function Wc(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=un),e}function Zy(e,t,r){var a=t.pendingProps,d=!1,p=(t.flags&128)!==0,x;if((x=p)||(x=e!==null&&e.memoizedState===null?!1:(St.current&2)!==0),x&&(d=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(et){if(d?wr(t):Cr(),(e=ht)?(e=nb(e,Sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yr!==null?{id:Ln,overflow:In}:null,retryLane:536870912,hydrationErrors:null},r=Ag(e),r.return=t,t.child=r,jt=t,ht=null)):e=null,e===null)throw vr(t);return jf(e)?t.lanes=32:t.lanes=536870912,null}var R=a.children;return a=a.fallback,d?(Cr(),d=t.mode,R=Io({mode:"hidden",children:R},d),a=$r(a,d,r,null),R.return=t,a.return=t,R.sibling=a,t.child=R,a=t.child,a.memoizedState=Jc(r),a.childLanes=Wc(e,x,r),t.memoizedState=Qc,fl(null,a)):(wr(t),$c(t,R))}var G=e.memoizedState;if(G!==null&&(R=G.dehydrated,R!==null)){if(p)t.flags&256?(wr(t),t.flags&=-257,t=ef(e,t,r)):t.memoizedState!==null?(Cr(),t.child=e.child,t.flags|=128,t=null):(Cr(),R=a.fallback,d=t.mode,a=Io({mode:"visible",children:a.children},d),R=$r(R,d,r,null),R.flags|=2,a.return=t,R.return=t,a.sibling=R,t.child=a,li(t,e.child,null,r),a=t.child,a.memoizedState=Jc(r),a.childLanes=Wc(e,x,r),t.memoizedState=Qc,t=fl(null,a));else if(wr(t),jf(R)){if(x=R.nextSibling&&R.nextSibling.dataset,x)var oe=x.dgst;x=oe,a=Error(o(419)),a.stack="",a.digest=x,$a({value:a,source:null,stack:null}),t=ef(e,t,r)}else if(Ct||Hi(e,t,r,!1),x=(r&e.childLanes)!==0,Ct||x){if(x=ct,x!==null&&(a=Dp(x,r),a!==0&&a!==G.retryLane))throw G.retryLane=a,Wr(e,a),$t(x,e,a),Zc;Df(R)||Go(),t=ef(e,t,r)}else Df(R)?(t.flags|=192,t.child=e.child,t=null):(e=G.treeContext,ht=xn(R.nextSibling),jt=t,et=!0,br=null,Sn=!1,e!==null&&Rg(t,e),t=$c(t,a.children),t.flags|=4096);return t}return d?(Cr(),R=a.fallback,d=t.mode,G=e.child,oe=G.sibling,a=Xn(G,{mode:"hidden",children:a.children}),a.subtreeFlags=G.subtreeFlags&65011712,oe!==null?R=Xn(oe,R):(R=$r(R,d,r,null),R.flags|=2),R.return=t,a.return=t,a.sibling=R,t.child=a,fl(null,a),a=t.child,R=e.child.memoizedState,R===null?R=Jc(r):(d=R.cachePool,d!==null?(G=_t._currentValue,d=d.parent!==G?{parent:G,pool:G}:d):d=Lg(),R={baseLanes:R.baseLanes|r,cachePool:d}),a.memoizedState=R,a.childLanes=Wc(e,x,r),t.memoizedState=Qc,fl(e.child,a)):(wr(t),r=e.child,e=r.sibling,r=Xn(r,{mode:"visible",children:a.children}),r.return=t,r.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=r,t.memoizedState=null,r)}function $c(e,t){return t=Io({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Io(e,t){return e=an(22,e,null,t),e.lanes=0,e}function ef(e,t,r){return li(t,e.child,null,r),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ky(e,t,r){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),pc(e.return,t,r)}function tf(e,t,r,a,d,p){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:d,treeForkCount:p}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=a,x.tail=r,x.tailMode=d,x.treeForkCount=p)}function Qy(e,t,r){var a=t.pendingProps,d=a.revealOrder,p=a.tail;a=a.children;var x=St.current,R=(x&2)!==0;if(R?(x=x&1|2,t.flags|=128):x&=1,z(St,x),It(e,t,a,r),a=et?Wa:0,!R&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ky(e,r,t);else if(e.tag===19)Ky(e,r,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(d){case"forwards":for(r=t.child,d=null;r!==null;)e=r.alternate,e!==null&&Co(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=t.child,t.child=null):(d=r.sibling,r.sibling=null),tf(t,!1,d,r,p,a);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Co(e)===null){t.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}tf(t,!0,r,null,p,a);break;case"together":tf(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function $n(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),kr|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(Hi(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,r=Xn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Xn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function nf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&yo(e)))}function cC(e,t,r){switch(t.tag){case 3:ke(t,t.stateNode.containerInfo),Sr(t,_t,e.memoizedState.cache),ei();break;case 27:case 5:He(t);break;case 4:ke(t,t.stateNode.containerInfo);break;case 10:Sr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ac(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(wr(t),t.flags|=128,null):(r&t.child.childLanes)!==0?Zy(e,t,r):(wr(t),e=$n(e,t,r),e!==null?e.sibling:null);wr(t);break;case 19:var d=(e.flags&128)!==0;if(a=(r&t.childLanes)!==0,a||(Hi(e,t,r,!1),a=(r&t.childLanes)!==0),d){if(a)return Qy(e,t,r);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),z(St,St.current),a)break;return null;case 22:return t.lanes=0,Py(e,t,r,t.pendingProps);case 24:Sr(t,_t,e.memoizedState.cache)}return $n(e,t,r)}function Jy(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ct=!0;else{if(!nf(e,r)&&(t.flags&128)===0)return Ct=!1,cC(e,t,r);Ct=(e.flags&131072)!==0}else Ct=!1,et&&(t.flags&1048576)!==0&&Ng(t,Wa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ii(t.elementType),t.type=e,typeof e=="function")oc(e)?(a=si(e,a),t.tag=1,t=Gy(null,t,e,a,r)):(t.tag=0,t=Kc(null,t,e,a,r));else{if(e!=null){var d=e.$$typeof;if(d===q){t.tag=11,t=Uy(null,t,e,a,r);break e}else if(d===I){t.tag=14,t=Hy(null,t,e,a,r);break e}}throw t=C(e)||e,Error(o(306,t,""))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,r);case 1:return a=t.type,d=si(a,t.pendingProps),Gy(e,t,a,d,r);case 3:e:{if(ke(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var p=t.memoizedState;d=p.element,xc(e,t),ll(t,a,null,r);var x=t.memoizedState;if(a=x.cache,Sr(t,_t,a),a!==p.cache&&gc(t,[_t],r,!0),al(),a=x.element,p.isDehydrated)if(p={element:a,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){t=Xy(e,t,a,r);break e}else if(a!==d){d=yn(Error(o(424)),t),$a(d),t=Xy(e,t,a,r);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(ht=xn(e.firstChild),jt=t,et=!0,br=null,Sn=!0,r=Pg(t,null,a,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ei(),a===d){t=$n(e,t,r);break e}It(e,t,a,r)}t=t.child}return t;case 26:return Lo(e,t),e===null?(r=sb(t.type,null,t.pendingProps,null))?t.memoizedState=r:et||(r=t.type,e=t.pendingProps,a=$o(we.current).createElement(r),a[Dt]=t,a[Xt]=e,Bt(a,r,e),zt(a),t.stateNode=a):t.memoizedState=sb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return He(t),e===null&&et&&(a=t.stateNode=ab(t.type,t.pendingProps,we.current),jt=t,Sn=!0,d=ht,Mr(t.type)?(Lf=d,ht=xn(a.firstChild)):ht=d),It(e,t,t.pendingProps.children,r),Lo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&et&&((d=a=ht)&&(a=HC(a,t.type,t.pendingProps,Sn),a!==null?(t.stateNode=a,jt=t,ht=xn(a.firstChild),Sn=!1,d=!0):d=!1),d||vr(t)),He(t),d=t.type,p=t.pendingProps,x=e!==null?e.memoizedProps:null,a=p.children,Of(d,p)?a=null:x!==null&&Of(d,x)&&(t.flags|=32),t.memoizedState!==null&&(d=Nc(e,t,tC,null,null,r),Tl._currentValue=d),Lo(e,t),It(e,t,a,r),t.child;case 6:return e===null&&et&&((e=r=ht)&&(r=qC(r,t.pendingProps,Sn),r!==null?(t.stateNode=r,jt=t,ht=null,e=!0):e=!1),e||vr(t)),null;case 13:return Zy(e,t,r);case 4:return ke(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=li(t,null,a,r):It(e,t,a,r),t.child;case 11:return Uy(e,t,t.type,t.pendingProps,r);case 7:return It(e,t,t.pendingProps,r),t.child;case 8:return It(e,t,t.pendingProps.children,r),t.child;case 12:return It(e,t,t.pendingProps.children,r),t.child;case 10:return a=t.pendingProps,Sr(t,t.type,a.value),It(e,t,a.children,r),t.child;case 9:return d=t.type._context,a=t.pendingProps.children,ni(t),d=Lt(d),a=a(d),t.flags|=1,It(e,t,a,r),t.child;case 14:return Hy(e,t,t.type,t.pendingProps,r);case 15:return qy(e,t,t.type,t.pendingProps,r);case 19:return Qy(e,t,r);case 31:return uC(e,t,r);case 22:return Py(e,t,r,t.pendingProps);case 24:return ni(t),a=Lt(_t),e===null?(d=vc(),d===null&&(d=ct,p=yc(),d.pooledCache=p,p.refCount++,p!==null&&(d.pooledCacheLanes|=r),d=p),t.memoizedState={parent:a,cache:d},Ec(t),Sr(t,_t,d)):((e.lanes&r)!==0&&(xc(e,t),ll(t,null,null,r),al()),d=e.memoizedState,p=t.memoizedState,d.parent!==a?(d={parent:a,cache:a},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),Sr(t,_t,a)):(a=p.cache,Sr(t,_t,a),a!==d.cache&&gc(t,[_t],r,!0))),It(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function er(e){e.flags|=4}function rf(e,t,r,a,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(w0())e.flags|=8192;else throw ai=Eo,Sc}else e.flags&=-16777217}function Wy(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!hb(t))if(w0())e.flags|=8192;else throw ai=Eo,Sc}function Bo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Op():536870912,e.lanes|=t,Wi|=t)}function dl(e,t){if(!et)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,a=0;if(t)for(var d=e.child;d!==null;)r|=d.lanes|d.childLanes,a|=d.subtreeFlags&65011712,a|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)r|=d.lanes|d.childLanes,a|=d.subtreeFlags,a|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=a,e.childLanes=r,t}function fC(e,t,r){var a=t.pendingProps;switch(fc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return mt(t),null;case 3:return r=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Qn(_t),Ae(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ui(t)?er(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,hc())),mt(t),null;case 26:var d=t.type,p=t.memoizedState;return e===null?(er(t),p!==null?(mt(t),Wy(t,p)):(mt(t),rf(t,d,null,a,r))):p?p!==e.memoizedState?(er(t),mt(t),Wy(t,p)):(mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&er(t),mt(t),rf(t,d,e,a,r)),null;case 27:if(ve(t),r=we.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&er(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return mt(t),null}e=re.current,Ui(t)?Og(t):(e=ab(d,a,r),t.stateNode=e,er(t))}return mt(t),null;case 5:if(ve(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&er(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return mt(t),null}if(p=re.current,Ui(t))Og(t);else{var x=$o(we.current);switch(p){case 1:p=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:p=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":p=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":p=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":p=x.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof a.is=="string"?x.createElement("select",{is:a.is}):x.createElement("select"),a.multiple?p.multiple=!0:a.size&&(p.size=a.size);break;default:p=typeof a.is=="string"?x.createElement(d,{is:a.is}):x.createElement(d)}}p[Dt]=t,p[Xt]=a;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)p.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=p;e:switch(Bt(p,d,a),d){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&er(t)}}return mt(t),rf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&er(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=we.current,Ui(t)){if(e=t.stateNode,r=t.memoizedProps,a=null,d=jt,d!==null)switch(d.tag){case 27:case 5:a=d.memoizedProps}e[Dt]=t,e=!!(e.nodeValue===r||a!==null&&a.suppressHydrationWarning===!0||Z0(e.nodeValue,r)),e||vr(t,!0)}else e=$o(e).createTextNode(a),e[Dt]=t,t.stateNode=e}return mt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ui(t),r!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Dt]=t}else ei(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),e=!1}else r=hc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(on(t),t):(on(t),null);if((t.flags&128)!==0)throw Error(o(558))}return mt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Ui(t),a!==null&&a.dehydrated!==null){if(e===null){if(!d)throw Error(o(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));d[Dt]=t}else ei(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),d=!1}else d=hc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(on(t),t):(on(t),null)}return on(t),(t.flags&128)!==0?(t.lanes=r,t):(r=a!==null,e=e!==null&&e.memoizedState!==null,r&&(a=t.child,d=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(d=a.alternate.memoizedState.cachePool.pool),p=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(p=a.memoizedState.cachePool.pool),p!==d&&(a.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),Bo(t,t.updateQueue),mt(t),null);case 4:return Ae(),e===null&&Tf(t.stateNode.containerInfo),mt(t),null;case 10:return Qn(t.type),mt(t),null;case 19:if(B(St),a=t.memoizedState,a===null)return mt(t),null;if(d=(t.flags&128)!==0,p=a.rendering,p===null)if(d)dl(a,!1);else{if(vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=Co(e),p!==null){for(t.flags|=128,dl(a,!1),e=p.updateQueue,t.updateQueue=e,Bo(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Tg(r,e),r=r.sibling;return z(St,St.current&1|2),et&&Zn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&_e()>Fo&&(t.flags|=128,d=!0,dl(a,!1),t.lanes=4194304)}else{if(!d)if(e=Co(p),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,Bo(t,e),dl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!p.alternate&&!et)return mt(t),null}else 2*_e()-a.renderingStartTime>Fo&&r!==536870912&&(t.flags|=128,d=!0,dl(a,!1),t.lanes=4194304);a.isBackwards?(p.sibling=t.child,t.child=p):(e=a.last,e!==null?e.sibling=p:t.child=p,a.last=p)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=_e(),e.sibling=null,r=St.current,z(St,d?r&1|2:r&1),et&&Zn(t,a.treeForkCount),e):(mt(t),null);case 22:case 23:return on(t),Tc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(r&536870912)!==0&&(t.flags&128)===0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),r=t.updateQueue,r!==null&&Bo(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==r&&(t.flags|=2048),e!==null&&B(ri),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qn(_t),mt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function dC(e,t){switch(fc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qn(_t),Ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(on(t),t.alternate===null)throw Error(o(340));ei()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(on(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ei()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(St),null;case 4:return Ae(),null;case 10:return Qn(t.type),null;case 22:case 23:return on(t),Tc(),e!==null&&B(ri),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qn(_t),null;case 25:return null;default:return null}}function $y(e,t){switch(fc(t),t.tag){case 3:Qn(_t),Ae();break;case 26:case 27:case 5:ve(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&on(t);break;case 13:on(t);break;case 19:B(St);break;case 10:Qn(t.type);break;case 22:case 23:on(t),Tc(),e!==null&&B(ri);break;case 24:Qn(_t)}}function hl(e,t){try{var r=t.updateQueue,a=r!==null?r.lastEffect:null;if(a!==null){var d=a.next;r=d;do{if((r.tag&e)===e){a=void 0;var p=r.create,x=r.inst;a=p(),x.destroy=a}r=r.next}while(r!==d)}}catch(R){lt(t,t.return,R)}}function Tr(e,t,r){try{var a=t.updateQueue,d=a!==null?a.lastEffect:null;if(d!==null){var p=d.next;a=p;do{if((a.tag&e)===e){var x=a.inst,R=x.destroy;if(R!==void 0){x.destroy=void 0,d=t;var G=r,oe=R;try{oe()}catch(me){lt(d,G,me)}}}a=a.next}while(a!==p)}}catch(me){lt(t,t.return,me)}}function e0(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{Yg(t,r)}catch(a){lt(e,e.return,a)}}}function t0(e,t,r){r.props=si(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(a){lt(e,t,a)}}function ml(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof r=="function"?e.refCleanup=r(a):r.current=a}}catch(d){lt(e,t,d)}}function Bn(e,t){var r=e.ref,a=e.refCleanup;if(r!==null)if(typeof a=="function")try{a()}catch(d){lt(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(d){lt(e,t,d)}else r.current=null}function n0(e){var t=e.type,r=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&a.focus();break e;case"img":r.src?a.src=r.src:r.srcSet&&(a.srcset=r.srcSet)}}catch(d){lt(e,e.return,d)}}function af(e,t,r){try{var a=e.stateNode;DC(a,e.type,r,t),a[Xt]=t}catch(d){lt(e,e.return,d)}}function r0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mr(e.type)||e.tag===4}function lf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||r0(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&&Mr(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 of(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Vn));else if(a!==4&&(a===27&&Mr(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(of(e,t,r),e=e.sibling;e!==null;)of(e,t,r),e=e.sibling}function Uo(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(a!==4&&(a===27&&Mr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Uo(e,t,r),e=e.sibling;e!==null;)Uo(e,t,r),e=e.sibling}function i0(e){var t=e.stateNode,r=e.memoizedProps;try{for(var a=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);Bt(t,a,r),t[Dt]=e,t[Xt]=r}catch(p){lt(e,e.return,p)}}var tr=!1,Tt=!1,sf=!1,a0=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function hC(e,t){if(e=e.containerInfo,Nf=ls,e=yg(e),ec(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var d=a.anchorOffset,p=a.focusNode;a=a.focusOffset;try{r.nodeType,p.nodeType}catch{r=null;break e}var x=0,R=-1,G=-1,oe=0,me=0,ye=e,ue=null;t:for(;;){for(var fe;ye!==r||d!==0&&ye.nodeType!==3||(R=x+d),ye!==p||a!==0&&ye.nodeType!==3||(G=x+a),ye.nodeType===3&&(x+=ye.nodeValue.length),(fe=ye.firstChild)!==null;)ue=ye,ye=fe;for(;;){if(ye===e)break t;if(ue===r&&++oe===d&&(R=x),ue===p&&++me===a&&(G=x),(fe=ye.nextSibling)!==null)break;ye=ue,ue=ye.parentNode}ye=fe}r=R===-1||G===-1?null:{start:R,end:G}}else r=null}r=r||{start:0,end:0}}else r=null;for(Rf={focusedElem:e,selectionRange:r},ls=!1,Mt=t;Mt!==null;)if(t=Mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Mt=e;else for(;Mt!==null;){switch(t=Mt,p=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(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,r=t,d=p.memoizedProps,p=p.memoizedState,a=r.stateNode;try{var Ne=si(r.type,d);e=a.getSnapshotBeforeUpdate(Ne,p),a.__reactInternalSnapshotBeforeUpdate=e}catch(Le){lt(r,r.return,Le)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)Mf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Mf(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Mt=e;break}Mt=t.return}}function l0(e,t,r){var a=r.flags;switch(r.tag){case 0:case 11:case 15:rr(e,r),a&4&&hl(5,r);break;case 1:if(rr(e,r),a&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(x){lt(r,r.return,x)}else{var d=si(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){lt(r,r.return,x)}}a&64&&e0(r),a&512&&ml(r,r.return);break;case 3:if(rr(e,r),a&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{Yg(e,t)}catch(x){lt(r,r.return,x)}}break;case 27:t===null&&a&4&&i0(r);case 26:case 5:rr(e,r),t===null&&a&4&&n0(r),a&512&&ml(r,r.return);break;case 12:rr(e,r);break;case 31:rr(e,r),a&4&&u0(e,r);break;case 13:rr(e,r),a&4&&c0(e,r),a&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=xC.bind(null,r),PC(e,r))));break;case 22:if(a=r.memoizedState!==null||tr,!a){t=t!==null&&t.memoizedState!==null||Tt,d=tr;var p=Tt;tr=a,(Tt=t)&&!p?ir(e,r,(r.subtreeFlags&8772)!==0):rr(e,r),tr=d,Tt=p}break;case 30:break;default:rr(e,r)}}function o0(e){var t=e.alternate;t!==null&&(e.alternate=null,o0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Iu(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 yt=null,Kt=!1;function nr(e,t,r){for(r=r.child;r!==null;)s0(e,t,r),r=r.sibling}function s0(e,t,r){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(Xe,r)}catch{}switch(r.tag){case 26:Tt||Bn(r,t),nr(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Tt||Bn(r,t);var a=yt,d=Kt;Mr(r.type)&&(yt=r.stateNode,Kt=!1),nr(e,t,r),_l(r.stateNode),yt=a,Kt=d;break;case 5:Tt||Bn(r,t);case 6:if(a=yt,d=Kt,yt=null,nr(e,t,r),yt=a,Kt=d,yt!==null)if(Kt)try{(yt.nodeType===9?yt.body:yt.nodeName==="HTML"?yt.ownerDocument.body:yt).removeChild(r.stateNode)}catch(p){lt(r,t,p)}else try{yt.removeChild(r.stateNode)}catch(p){lt(r,t,p)}break;case 18:yt!==null&&(Kt?(e=yt,eb(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),la(e)):eb(yt,r.stateNode));break;case 4:a=yt,d=Kt,yt=r.stateNode.containerInfo,Kt=!0,nr(e,t,r),yt=a,Kt=d;break;case 0:case 11:case 14:case 15:Tr(2,r,t),Tt||Tr(4,r,t),nr(e,t,r);break;case 1:Tt||(Bn(r,t),a=r.stateNode,typeof a.componentWillUnmount=="function"&&t0(r,t,a)),nr(e,t,r);break;case 21:nr(e,t,r);break;case 22:Tt=(a=Tt)||r.memoizedState!==null,nr(e,t,r),Tt=a;break;default:nr(e,t,r)}}function u0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{la(e)}catch(r){lt(t,t.return,r)}}}function c0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{la(e)}catch(r){lt(t,t.return,r)}}function mC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new a0),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new a0),t;default:throw Error(o(435,e.tag))}}function Ho(e,t){var r=mC(e);t.forEach(function(a){if(!r.has(a)){r.add(a);var d=_C.bind(null,e,a);a.then(d,d)}})}function Qt(e,t){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var d=r[a],p=e,x=t,R=x;e:for(;R!==null;){switch(R.tag){case 27:if(Mr(R.type)){yt=R.stateNode,Kt=!1;break e}break;case 5:yt=R.stateNode,Kt=!1;break e;case 3:case 4:yt=R.stateNode.containerInfo,Kt=!0;break e}R=R.return}if(yt===null)throw Error(o(160));s0(p,x,d),yt=null,Kt=!1,p=d.alternate,p!==null&&(p.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)f0(t,e),t=t.sibling}var An=null;function f0(e,t){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Qt(t,e),Jt(e),a&4&&(Tr(3,e,e.return),hl(3,e),Tr(5,e,e.return));break;case 1:Qt(t,e),Jt(e),a&512&&(Tt||r===null||Bn(r,r.return)),a&64&&tr&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?a:r.concat(a))));break;case 26:var d=An;if(Qt(t,e),Jt(e),a&512&&(Tt||r===null||Bn(r,r.return)),a&4){var p=r!==null?r.memoizedState:null;if(a=e.memoizedState,r===null)if(a===null)if(e.stateNode===null){e:{a=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(a){case"title":p=d.getElementsByTagName("title")[0],(!p||p[qa]||p[Dt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=d.createElement(a),d.head.insertBefore(p,d.querySelector("head > title"))),Bt(p,a,r),p[Dt]=e,zt(p),a=p;break e;case"link":var x=fb("link","href",d).get(a+(r.href||""));if(x){for(var R=0;R<x.length;R++)if(p=x[R],p.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&p.getAttribute("rel")===(r.rel==null?null:r.rel)&&p.getAttribute("title")===(r.title==null?null:r.title)&&p.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){x.splice(R,1);break t}}p=d.createElement(a),Bt(p,a,r),d.head.appendChild(p);break;case"meta":if(x=fb("meta","content",d).get(a+(r.content||""))){for(R=0;R<x.length;R++)if(p=x[R],p.getAttribute("content")===(r.content==null?null:""+r.content)&&p.getAttribute("name")===(r.name==null?null:r.name)&&p.getAttribute("property")===(r.property==null?null:r.property)&&p.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&p.getAttribute("charset")===(r.charSet==null?null:r.charSet)){x.splice(R,1);break t}}p=d.createElement(a),Bt(p,a,r),d.head.appendChild(p);break;default:throw Error(o(468,a))}p[Dt]=e,zt(p),a=p}e.stateNode=a}else db(d,e.type,e.stateNode);else e.stateNode=cb(d,a,e.memoizedProps);else p!==a?(p===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):p.count--,a===null?db(d,e.type,e.stateNode):cb(d,a,e.memoizedProps)):a===null&&e.stateNode!==null&&af(e,e.memoizedProps,r.memoizedProps)}break;case 27:Qt(t,e),Jt(e),a&512&&(Tt||r===null||Bn(r,r.return)),r!==null&&a&4&&af(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Qt(t,e),Jt(e),a&512&&(Tt||r===null||Bn(r,r.return)),e.flags&32){d=e.stateNode;try{Ni(d,"")}catch(Ne){lt(e,e.return,Ne)}}a&4&&e.stateNode!=null&&(d=e.memoizedProps,af(e,d,r!==null?r.memoizedProps:d)),a&1024&&(sf=!0);break;case 6:if(Qt(t,e),Jt(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,r=e.stateNode;try{r.nodeValue=a}catch(Ne){lt(e,e.return,Ne)}}break;case 3:if(ns=null,d=An,An=es(t.containerInfo),Qt(t,e),An=d,Jt(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{la(t.containerInfo)}catch(Ne){lt(e,e.return,Ne)}sf&&(sf=!1,d0(e));break;case 4:a=An,An=es(e.stateNode.containerInfo),Qt(t,e),Jt(e),An=a;break;case 12:Qt(t,e),Jt(e);break;case 31:Qt(t,e),Jt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ho(e,a)));break;case 13:Qt(t,e),Jt(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Po=_e()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ho(e,a)));break;case 22:d=e.memoizedState!==null;var G=r!==null&&r.memoizedState!==null,oe=tr,me=Tt;if(tr=oe||d,Tt=me||G,Qt(t,e),Tt=me,tr=oe,Jt(e),a&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(r===null||G||tr||Tt||ui(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){G=r=t;try{if(p=G.stateNode,d)x=p.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{R=G.stateNode;var ye=G.memoizedProps.style,ue=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;R.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Ne){lt(G,G.return,Ne)}}}else if(t.tag===6){if(r===null){G=t;try{G.stateNode.nodeValue=d?"":G.memoizedProps}catch(Ne){lt(G,G.return,Ne)}}}else if(t.tag===18){if(r===null){G=t;try{var fe=G.stateNode;d?tb(fe,!0):tb(G.stateNode,!1)}catch(Ne){lt(G,G.return,Ne)}}}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;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(r=a.retryQueue,r!==null&&(a.retryQueue=null,Ho(e,r))));break;case 19:Qt(t,e),Jt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ho(e,a)));break;case 30:break;case 21:break;default:Qt(t,e),Jt(e)}}function Jt(e){var t=e.flags;if(t&2){try{for(var r,a=e.return;a!==null;){if(r0(a)){r=a;break}a=a.return}if(r==null)throw Error(o(160));switch(r.tag){case 27:var d=r.stateNode,p=lf(e);Uo(e,p,d);break;case 5:var x=r.stateNode;r.flags&32&&(Ni(x,""),r.flags&=-33);var R=lf(e);Uo(e,R,x);break;case 3:case 4:var G=r.stateNode.containerInfo,oe=lf(e);of(e,oe,G);break;default:throw Error(o(161))}}catch(me){lt(e,e.return,me)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function d0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;d0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function rr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)l0(e,t.alternate,t),t=t.sibling}function ui(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Tr(4,t,t.return),ui(t);break;case 1:Bn(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&t0(t,t.return,r),ui(t);break;case 27:_l(t.stateNode);case 26:case 5:Bn(t,t.return),ui(t);break;case 22:t.memoizedState===null&&ui(t);break;case 30:ui(t);break;default:ui(t)}e=e.sibling}}function ir(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,d=e,p=t,x=p.flags;switch(p.tag){case 0:case 11:case 15:ir(d,p,r),hl(4,p);break;case 1:if(ir(d,p,r),a=p,d=a.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(oe){lt(a,a.return,oe)}if(a=p,d=a.updateQueue,d!==null){var R=a.stateNode;try{var G=d.shared.hiddenCallbacks;if(G!==null)for(d.shared.hiddenCallbacks=null,d=0;d<G.length;d++)Fg(G[d],R)}catch(oe){lt(a,a.return,oe)}}r&&x&64&&e0(p),ml(p,p.return);break;case 27:i0(p);case 26:case 5:ir(d,p,r),r&&a===null&&x&4&&n0(p),ml(p,p.return);break;case 12:ir(d,p,r);break;case 31:ir(d,p,r),r&&x&4&&u0(d,p);break;case 13:ir(d,p,r),r&&x&4&&c0(d,p);break;case 22:p.memoizedState===null&&ir(d,p,r),ml(p,p.return);break;case 30:break;default:ir(d,p,r)}t=t.sibling}}function uf(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&el(r))}function cf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&el(e))}function kn(e,t,r,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)h0(e,t,r,a),t=t.sibling}function h0(e,t,r,a){var d=t.flags;switch(t.tag){case 0:case 11:case 15:kn(e,t,r,a),d&2048&&hl(9,t);break;case 1:kn(e,t,r,a);break;case 3:kn(e,t,r,a),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&el(e)));break;case 12:if(d&2048){kn(e,t,r,a),e=t.stateNode;try{var p=t.memoizedProps,x=p.id,R=p.onPostCommit;typeof R=="function"&&R(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){lt(t,t.return,G)}}else kn(e,t,r,a);break;case 31:kn(e,t,r,a);break;case 13:kn(e,t,r,a);break;case 23:break;case 22:p=t.stateNode,x=t.alternate,t.memoizedState!==null?p._visibility&2?kn(e,t,r,a):pl(e,t):p._visibility&2?kn(e,t,r,a):(p._visibility|=2,Ki(e,t,r,a,(t.subtreeFlags&10256)!==0||!1)),d&2048&&uf(x,t);break;case 24:kn(e,t,r,a),d&2048&&cf(t.alternate,t);break;default:kn(e,t,r,a)}}function Ki(e,t,r,a,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var p=e,x=t,R=r,G=a,oe=x.flags;switch(x.tag){case 0:case 11:case 15:Ki(p,x,R,G,d),hl(8,x);break;case 23:break;case 22:var me=x.stateNode;x.memoizedState!==null?me._visibility&2?Ki(p,x,R,G,d):pl(p,x):(me._visibility|=2,Ki(p,x,R,G,d)),d&&oe&2048&&uf(x.alternate,x);break;case 24:Ki(p,x,R,G,d),d&&oe&2048&&cf(x.alternate,x);break;default:Ki(p,x,R,G,d)}t=t.sibling}}function pl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,a=t,d=a.flags;switch(a.tag){case 22:pl(r,a),d&2048&&uf(a.alternate,a);break;case 24:pl(r,a),d&2048&&cf(a.alternate,a);break;default:pl(r,a)}t=t.sibling}}var gl=8192;function Qi(e,t,r){if(e.subtreeFlags&gl)for(e=e.child;e!==null;)m0(e,t,r),e=e.sibling}function m0(e,t,r){switch(e.tag){case 26:Qi(e,t,r),e.flags&gl&&e.memoizedState!==null&&eT(r,An,e.memoizedState,e.memoizedProps);break;case 5:Qi(e,t,r);break;case 3:case 4:var a=An;An=es(e.stateNode.containerInfo),Qi(e,t,r),An=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=gl,gl=16777216,Qi(e,t,r),gl=a):Qi(e,t,r));break;default:Qi(e,t,r)}}function p0(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 yl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var a=t[r];Mt=a,y0(a,e)}p0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)g0(e),e=e.sibling}function g0(e){switch(e.tag){case 0:case 11:case 15:yl(e),e.flags&2048&&Tr(9,e,e.return);break;case 3:yl(e);break;case 12:yl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,qo(e)):yl(e);break;default:yl(e)}}function qo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var a=t[r];Mt=a,y0(a,e)}p0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tr(8,t,t.return),qo(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,qo(t));break;default:qo(t)}e=e.sibling}}function y0(e,t){for(;Mt!==null;){var r=Mt;switch(r.tag){case 0:case 11:case 15:Tr(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var a=r.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:el(r.memoizedState.cache)}if(a=r.child,a!==null)a.return=r,Mt=a;else e:for(r=e;Mt!==null;){a=Mt;var d=a.sibling,p=a.return;if(o0(a),a===r){Mt=null;break e}if(d!==null){d.return=p,Mt=d;break e}Mt=p}}}var pC={getCacheForType:function(e){var t=Lt(_t),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return Lt(_t).controller.signal}},gC=typeof WeakMap=="function"?WeakMap:Map,it=0,ct=null,Ke=null,We=0,at=0,sn=null,Ar=!1,Ji=!1,ff=!1,ar=0,vt=0,kr=0,ci=0,df=0,un=0,Wi=0,bl=null,Wt=null,hf=!1,Po=0,b0=0,Fo=1/0,Yo=null,Nr=null,Nt=0,Rr=null,$i=null,lr=0,mf=0,pf=null,v0=null,vl=0,gf=null;function cn(){return(it&2)!==0&&We!==0?We&-We:Z.T!==null?xf():jp()}function S0(){if(un===0)if((We&536870912)===0||et){var e=Xr;Xr<<=1,(Xr&3932160)===0&&(Xr=262144),un=e}else un=536870912;return e=ln.current,e!==null&&(e.flags|=32),un}function $t(e,t,r){(e===ct&&(at===2||at===9)||e.cancelPendingCommit!==null)&&(ea(e,0),Or(e,We,un,!1)),Ha(e,r),((it&2)===0||e!==ct)&&(e===ct&&((it&2)===0&&(ci|=r),vt===4&&Or(e,We,un,!1)),Un(e))}function E0(e,t,r){if((it&6)!==0)throw Error(o(327));var a=!r&&(t&127)===0&&(t&e.expiredLanes)===0||Ua(e,t),d=a?vC(e,t):bf(e,t,!0),p=a;do{if(d===0){Ji&&!a&&Or(e,t,0,!1);break}else{if(r=e.current.alternate,p&&!yC(r)){d=bf(e,t,!1),p=!1;continue}if(d===2){if(p=t,e.errorRecoveryDisabledLanes&p)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var R=e;d=bl;var G=R.current.memoizedState.isDehydrated;if(G&&(ea(R,x).flags|=256),x=bf(R,x,!1),x!==2){if(ff&&!G){R.errorRecoveryDisabledLanes|=p,ci|=p,d=4;break e}p=Wt,Wt=d,p!==null&&(Wt===null?Wt=p:Wt.push.apply(Wt,p))}d=x}if(p=!1,d!==2)continue}}if(d===1){ea(e,0),Or(e,t,0,!0);break}e:{switch(a=e,p=d,p){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Or(a,t,un,!Ar);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(d=Po+300-_e(),10<d)){if(Or(a,t,un,!Ar),$l(a,0,!0)!==0)break e;lr=t,a.timeoutHandle=W0(x0.bind(null,a,r,Wt,Yo,hf,t,un,ci,Wi,Ar,p,"Throttled",-0,0),d);break e}x0(a,r,Wt,Yo,hf,t,un,ci,Wi,Ar,p,null,-0,0)}}break}while(!0);Un(e)}function x0(e,t,r,a,d,p,x,R,G,oe,me,ye,ue,fe){if(e.timeoutHandle=-1,ye=t.subtreeFlags,ye&8192||(ye&16785408)===16785408){ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vn},m0(t,p,ye);var Ne=(p&62914560)===p?Po-_e():(p&4194048)===p?b0-_e():0;if(Ne=tT(ye,Ne),Ne!==null){lr=p,e.cancelPendingCommit=Ne(R0.bind(null,e,t,p,r,a,d,x,R,G,me,ye,null,ue,fe)),Or(e,p,x,!oe);return}}R0(e,t,p,r,a,d,x,R,G)}function yC(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var a=0;a<r.length;a++){var d=r[a],p=d.getSnapshot;d=d.value;try{if(!rn(p(),d))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Or(e,t,r,a){t&=~df,t&=~ci,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var d=t;0<d;){var p=31-Ze(d),x=1<<p;a[p]=-1,d&=~x}r!==0&&zp(e,r,t)}function Vo(){return(it&6)===0?(Sl(0),!1):!0}function yf(){if(Ke!==null){if(at===0)var e=Ke.return;else e=Ke,Kn=ti=null,zc(e),Yi=null,nl=0,e=Ke;for(;e!==null;)$y(e.alternate,e),e=e.return;Ke=null}}function ea(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,IC(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),lr=0,yf(),ct=e,Ke=r=Xn(e.current,null),We=t,at=0,sn=null,Ar=!1,Ji=Ua(e,t),ff=!1,Wi=un=df=ci=kr=vt=0,Wt=bl=null,hf=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var d=31-Ze(a),p=1<<d;t|=e[d],a&=~p}return ar=t,fo(),r}function _0(e,t){qe=null,Z.H=cl,t===Fi||t===So?(t=Ug(),at=3):t===Sc?(t=Ug(),at=4):at=t===Zc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,sn=t,Ke===null&&(vt=1,Do(e,yn(t,e.current)))}function w0(){var e=ln.current;return e===null?!0:(We&4194048)===We?En===null:(We&62914560)===We||(We&536870912)!==0?e===En:!1}function C0(){var e=Z.H;return Z.H=cl,e===null?cl:e}function T0(){var e=Z.A;return Z.A=pC,e}function Go(){vt=4,Ar||(We&4194048)!==We&&ln.current!==null||(Ji=!0),(kr&134217727)===0&&(ci&134217727)===0||ct===null||Or(ct,We,un,!1)}function bf(e,t,r){var a=it;it|=2;var d=C0(),p=T0();(ct!==e||We!==t)&&(Yo=null,ea(e,t)),t=!1;var x=vt;e:do try{if(at!==0&&Ke!==null){var R=Ke,G=sn;switch(at){case 8:yf(),x=6;break e;case 3:case 2:case 9:case 6:ln.current===null&&(t=!0);var oe=at;if(at=0,sn=null,ta(e,R,G,oe),r&&Ji){x=0;break e}break;default:oe=at,at=0,sn=null,ta(e,R,G,oe)}}bC(),x=vt;break}catch(me){_0(e,me)}while(!0);return t&&e.shellSuspendCounter++,Kn=ti=null,it=a,Z.H=d,Z.A=p,Ke===null&&(ct=null,We=0,fo()),x}function bC(){for(;Ke!==null;)A0(Ke)}function vC(e,t){var r=it;it|=2;var a=C0(),d=T0();ct!==e||We!==t?(Yo=null,Fo=_e()+500,ea(e,t)):Ji=Ua(e,t);e:do try{if(at!==0&&Ke!==null){t=Ke;var p=sn;t:switch(at){case 1:at=0,sn=null,ta(e,t,p,1);break;case 2:case 9:if(Ig(p)){at=0,sn=null,k0(t);break}t=function(){at!==2&&at!==9||ct!==e||(at=7),Un(e)},p.then(t,t);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:Ig(p)?(at=0,sn=null,k0(t)):(at=0,sn=null,ta(e,t,p,7));break;case 5:var x=null;switch(Ke.tag){case 26:x=Ke.memoizedState;case 5:case 27:var R=Ke;if(x?hb(x):R.stateNode.complete){at=0,sn=null;var G=R.sibling;if(G!==null)Ke=G;else{var oe=R.return;oe!==null?(Ke=oe,Xo(oe)):Ke=null}break t}}at=0,sn=null,ta(e,t,p,5);break;case 6:at=0,sn=null,ta(e,t,p,6);break;case 8:yf(),vt=6;break e;default:throw Error(o(462))}}SC();break}catch(me){_0(e,me)}while(!0);return Kn=ti=null,Z.H=a,Z.A=d,it=r,Ke!==null?0:(ct=null,We=0,fo(),vt)}function SC(){for(;Ke!==null&&!le();)A0(Ke)}function A0(e){var t=Jy(e.alternate,e,ar);e.memoizedProps=e.pendingProps,t===null?Xo(e):Ke=t}function k0(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=Vy(r,t,t.pendingProps,t.type,void 0,We);break;case 11:t=Vy(r,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:zc(t);default:$y(r,t),t=Ke=Tg(t,ar),t=Jy(r,t,ar)}e.memoizedProps=e.pendingProps,t===null?Xo(e):Ke=t}function ta(e,t,r,a){Kn=ti=null,zc(t),Yi=null,nl=0;var d=t.return;try{if(sC(e,d,t,r,We)){vt=1,Do(e,yn(r,e.current)),Ke=null;return}}catch(p){if(d!==null)throw Ke=d,p;vt=1,Do(e,yn(r,e.current)),Ke=null;return}t.flags&32768?(et||a===1?e=!0:Ji||(We&536870912)!==0?e=!1:(Ar=e=!0,(a===2||a===9||a===3||a===6)&&(a=ln.current,a!==null&&a.tag===13&&(a.flags|=16384))),N0(t,e)):Xo(t)}function Xo(e){var t=e;do{if((t.flags&32768)!==0){N0(t,Ar);return}e=t.return;var r=fC(t.alternate,t,ar);if(r!==null){Ke=r;return}if(t=t.sibling,t!==null){Ke=t;return}Ke=t=e}while(t!==null);vt===0&&(vt=5)}function N0(e,t){do{var r=dC(e.alternate,e);if(r!==null){r.flags&=32767,Ke=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){Ke=e;return}Ke=e=r}while(e!==null);vt=6,Ke=null}function R0(e,t,r,a,d,p,x,R,G){e.cancelPendingCommit=null;do Zo();while(Nt!==0);if((it&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(p=t.lanes|t.childLanes,p|=ac,$w(e,r,p,x,R,G),e===ct&&(Ke=ct=null,We=0),$i=t,Rr=e,lr=r,mf=p,pf=d,v0=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,wC(Ce,function(){return j0(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=Z.T,Z.T=null,d=Q.p,Q.p=2,x=it,it|=4;try{hC(e,t,r)}finally{it=x,Q.p=d,Z.T=a}}Nt=1,O0(),z0(),M0()}}function O0(){if(Nt===1){Nt=0;var e=Rr,t=$i,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=Z.T,Z.T=null;var a=Q.p;Q.p=2;var d=it;it|=4;try{f0(t,e);var p=Rf,x=yg(e.containerInfo),R=p.focusedElem,G=p.selectionRange;if(x!==R&&R&&R.ownerDocument&&gg(R.ownerDocument.documentElement,R)){if(G!==null&&ec(R)){var oe=G.start,me=G.end;if(me===void 0&&(me=oe),"selectionStart"in R)R.selectionStart=oe,R.selectionEnd=Math.min(me,R.value.length);else{var ye=R.ownerDocument||document,ue=ye&&ye.defaultView||window;if(ue.getSelection){var fe=ue.getSelection(),Ne=R.textContent.length,Le=Math.min(G.start,Ne),ut=G.end===void 0?Le:Math.min(G.end,Ne);!fe.extend&&Le>ut&&(x=ut,ut=Le,Le=x);var ee=pg(R,Le),J=pg(R,ut);if(ee&&J&&(fe.rangeCount!==1||fe.anchorNode!==ee.node||fe.anchorOffset!==ee.offset||fe.focusNode!==J.node||fe.focusOffset!==J.offset)){var ae=ye.createRange();ae.setStart(ee.node,ee.offset),fe.removeAllRanges(),Le>ut?(fe.addRange(ae),fe.extend(J.node,J.offset)):(ae.setEnd(J.node,J.offset),fe.addRange(ae))}}}}for(ye=[],fe=R;fe=fe.parentNode;)fe.nodeType===1&&ye.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ye.length;R++){var ge=ye[R];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}ls=!!Nf,Rf=Nf=null}finally{it=d,Q.p=a,Z.T=r}}e.current=t,Nt=2}}function z0(){if(Nt===2){Nt=0;var e=Rr,t=$i,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=Z.T,Z.T=null;var a=Q.p;Q.p=2;var d=it;it|=4;try{l0(e,t.alternate,t)}finally{it=d,Q.p=a,Z.T=r}}Nt=3}}function M0(){if(Nt===4||Nt===3){Nt=0,Ee();var e=Rr,t=$i,r=lr,a=v0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nt=5:(Nt=0,$i=Rr=null,D0(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Nr=null),ju(r),t=t.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(Xe,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=Z.T,d=Q.p,Q.p=2,Z.T=null;try{for(var p=e.onRecoverableError,x=0;x<a.length;x++){var R=a[x];p(R.value,{componentStack:R.stack})}}finally{Z.T=t,Q.p=d}}(lr&3)!==0&&Zo(),Un(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===gf?vl++:(vl=0,gf=e):vl=0,Sl(0)}}function D0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,el(t)))}function Zo(){return O0(),z0(),M0(),j0()}function j0(){if(Nt!==5)return!1;var e=Rr,t=mf;mf=0;var r=ju(lr),a=Z.T,d=Q.p;try{Q.p=32>r?32:r,Z.T=null,r=pf,pf=null;var p=Rr,x=lr;if(Nt=0,$i=Rr=null,lr=0,(it&6)!==0)throw Error(o(331));var R=it;if(it|=4,g0(p.current),h0(p,p.current,x,r),it=R,Sl(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(Xe,p)}catch{}return!0}finally{Q.p=d,Z.T=a,D0(e,t)}}function L0(e,t,r){t=yn(r,t),t=Xc(e.stateNode,t,2),e=_r(e,t,2),e!==null&&(Ha(e,2),Un(e))}function lt(e,t,r){if(e.tag===3)L0(e,e,r);else for(;t!==null;){if(t.tag===3){L0(t,e,r);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Nr===null||!Nr.has(a))){e=yn(r,e),r=Iy(2),a=_r(t,r,2),a!==null&&(By(r,a,t,e),Ha(a,2),Un(a));break}}t=t.return}}function vf(e,t,r){var a=e.pingCache;if(a===null){a=e.pingCache=new gC;var d=new Set;a.set(t,d)}else d=a.get(t),d===void 0&&(d=new Set,a.set(t,d));d.has(r)||(ff=!0,d.add(r),e=EC.bind(null,e,t,r),t.then(e,e))}function EC(e,t,r){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,ct===e&&(We&r)===r&&(vt===4||vt===3&&(We&62914560)===We&&300>_e()-Po?(it&2)===0&&ea(e,0):df|=r,Wi===We&&(Wi=0)),Un(e)}function I0(e,t){t===0&&(t=Op()),e=Wr(e,t),e!==null&&(Ha(e,t),Un(e))}function xC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),I0(e,r)}function _C(e,t){var r=0;switch(e.tag){case 31:case 13:var a=e.stateNode,d=e.memoizedState;d!==null&&(r=d.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),I0(e,r)}function wC(e,t){return he(e,t)}var Ko=null,na=null,Sf=!1,Qo=!1,Ef=!1,zr=0;function Un(e){e!==na&&e.next===null&&(na===null?Ko=na=e:na=na.next=e),Qo=!0,Sf||(Sf=!0,TC())}function Sl(e,t){if(!Ef&&Qo){Ef=!0;do for(var r=!1,a=Ko;a!==null;){if(e!==0){var d=a.pendingLanes;if(d===0)var p=0;else{var x=a.suspendedLanes,R=a.pingedLanes;p=(1<<31-Ze(42|e)+1)-1,p&=d&~(x&~R),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(r=!0,q0(a,p))}else p=We,p=$l(a,a===ct?p:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(p&3)===0||Ua(a,p)||(r=!0,q0(a,p));a=a.next}while(r);Ef=!1}}function CC(){B0()}function B0(){Qo=Sf=!1;var e=0;zr!==0&&LC()&&(e=zr);for(var t=_e(),r=null,a=Ko;a!==null;){var d=a.next,p=U0(a,t);p===0?(a.next=null,r===null?Ko=d:r.next=d,d===null&&(na=r)):(r=a,(e!==0||(p&3)!==0)&&(Qo=!0)),a=d}Nt!==0&&Nt!==5||Sl(e),zr!==0&&(zr=0)}function U0(e,t){for(var r=e.suspendedLanes,a=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var x=31-Ze(p),R=1<<x,G=d[x];G===-1?((R&r)===0||(R&a)!==0)&&(d[x]=Ww(R,t)):G<=t&&(e.expiredLanes|=R),p&=~R}if(t=ct,r=We,r=$l(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,r===0||e===t&&(at===2||at===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&pe(a),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Ua(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(a!==null&&pe(a),ju(r)){case 2:case 8:r=be;break;case 32:r=Ce;break;case 268435456:r=Je;break;default:r=Ce}return a=H0.bind(null,e),r=he(r,a),e.callbackPriority=t,e.callbackNode=r,t}return a!==null&&a!==null&&pe(a),e.callbackPriority=2,e.callbackNode=null,2}function H0(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Zo()&&e.callbackNode!==r)return null;var a=We;return a=$l(e,e===ct?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(E0(e,a,t),U0(e,_e()),e.callbackNode!=null&&e.callbackNode===r?H0.bind(null,e):null)}function q0(e,t){if(Zo())return null;E0(e,t,!0)}function TC(){BC(function(){(it&6)!==0?he(te,CC):B0()})}function xf(){if(zr===0){var e=qi;e===0&&(e=xi,xi<<=1,(xi&261888)===0&&(xi=256)),zr=e}return zr}function P0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ro(""+e)}function F0(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function AC(e,t,r,a,d){if(t==="submit"&&r&&r.stateNode===d){var p=P0((d[Xt]||null).action),x=a.submitter;x&&(t=(t=x[Xt]||null)?P0(t.formAction):x.getAttribute("formAction"),t!==null&&(p=t,x=null));var R=new oo("action","action",null,a,d);e.push({event:R,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(zr!==0){var G=x?F0(d,x):new FormData(d);qc(r,{pending:!0,data:G,method:d.method,action:p},null,G)}}else typeof p=="function"&&(R.preventDefault(),G=x?F0(d,x):new FormData(d),qc(r,{pending:!0,data:G,method:d.method,action:p},p,G))},currentTarget:d}]})}}for(var _f=0;_f<ic.length;_f++){var wf=ic[_f],kC=wf.toLowerCase(),NC=wf[0].toUpperCase()+wf.slice(1);Tn(kC,"on"+NC)}Tn(Sg,"onAnimationEnd"),Tn(Eg,"onAnimationIteration"),Tn(xg,"onAnimationStart"),Tn("dblclick","onDoubleClick"),Tn("focusin","onFocus"),Tn("focusout","onBlur"),Tn(V2,"onTransitionRun"),Tn(G2,"onTransitionStart"),Tn(X2,"onTransitionCancel"),Tn(_g,"onTransitionEnd"),Ai("onMouseEnter",["mouseout","mouseover"]),Ai("onMouseLeave",["mouseout","mouseover"]),Ai("onPointerEnter",["pointerout","pointerover"]),Ai("onPointerLeave",["pointerout","pointerover"]),Zr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var El="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(" "),RC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(El));function Y0(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var a=e[r],d=a.event;a=a.listeners;e:{var p=void 0;if(t)for(var x=a.length-1;0<=x;x--){var R=a[x],G=R.instance,oe=R.currentTarget;if(R=R.listener,G!==p&&d.isPropagationStopped())break e;p=R,d.currentTarget=oe;try{p(d)}catch(me){co(me)}d.currentTarget=null,p=G}else for(x=0;x<a.length;x++){if(R=a[x],G=R.instance,oe=R.currentTarget,R=R.listener,G!==p&&d.isPropagationStopped())break e;p=R,d.currentTarget=oe;try{p(d)}catch(me){co(me)}d.currentTarget=null,p=G}}}}function Qe(e,t){var r=t[Lu];r===void 0&&(r=t[Lu]=new Set);var a=e+"__bubble";r.has(a)||(V0(t,e,2,!1),r.add(a))}function Cf(e,t,r){var a=0;t&&(a|=4),V0(r,e,a,t)}var Jo="_reactListening"+Math.random().toString(36).slice(2);function Tf(e){if(!e[Jo]){e[Jo]=!0,Bp.forEach(function(r){r!=="selectionchange"&&(RC.has(r)||Cf(r,!1,e),Cf(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jo]||(t[Jo]=!0,Cf("selectionchange",!1,t))}}function V0(e,t,r,a){switch(Sb(t)){case 2:var d=iT;break;case 8:d=aT;break;default:d=qf}r=d.bind(null,t,r,e),d=void 0,!Vu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),a?d!==void 0?e.addEventListener(t,r,{capture:!0,passive:d}):e.addEventListener(t,r,!0):d!==void 0?e.addEventListener(t,r,{passive:d}):e.addEventListener(t,r,!1)}function Af(e,t,r,a,d){var p=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var x=a.tag;if(x===3||x===4){var R=a.stateNode.containerInfo;if(R===d)break;if(x===4)for(x=a.return;x!==null;){var G=x.tag;if((G===3||G===4)&&x.stateNode.containerInfo===d)return;x=x.return}for(;R!==null;){if(x=wi(R),x===null)return;if(G=x.tag,G===5||G===6||G===26||G===27){a=p=x;continue e}R=R.parentNode}}a=a.return}Qp(function(){var oe=p,me=Fu(r),ye=[];e:{var ue=wg.get(e);if(ue!==void 0){var fe=oo,Ne=e;switch(e){case"keypress":if(ao(r)===0)break e;case"keydown":case"keyup":fe=_2;break;case"focusin":Ne="focus",fe=Ku;break;case"focusout":Ne="blur",fe=Ku;break;case"beforeblur":case"afterblur":fe=Ku;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=$p;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=f2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=T2;break;case Sg:case Eg:case xg:fe=m2;break;case _g:fe=k2;break;case"scroll":case"scrollend":fe=u2;break;case"wheel":fe=R2;break;case"copy":case"cut":case"paste":fe=g2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=tg;break;case"toggle":case"beforetoggle":fe=z2}var Le=(t&4)!==0,ut=!Le&&(e==="scroll"||e==="scrollend"),ee=Le?ue!==null?ue+"Capture":null:ue;Le=[];for(var J=oe,ae;J!==null;){var ge=J;if(ae=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||ae===null||ee===null||(ge=Fa(J,ee),ge!=null&&Le.push(xl(J,ge,ae))),ut)break;J=J.return}0<Le.length&&(ue=new fe(ue,Ne,null,r,me),ye.push({event:ue,listeners:Le}))}}if((t&7)===0){e:{if(ue=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",ue&&r!==Pu&&(Ne=r.relatedTarget||r.fromElement)&&(wi(Ne)||Ne[_i]))break e;if((fe||ue)&&(ue=me.window===me?me:(ue=me.ownerDocument)?ue.defaultView||ue.parentWindow:window,fe?(Ne=r.relatedTarget||r.toElement,fe=oe,Ne=Ne?wi(Ne):null,Ne!==null&&(ut=s(Ne),Le=Ne.tag,Ne!==ut||Le!==5&&Le!==27&&Le!==6)&&(Ne=null)):(fe=null,Ne=oe),fe!==Ne)){if(Le=$p,ge="onMouseLeave",ee="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(Le=tg,ge="onPointerLeave",ee="onPointerEnter",J="pointer"),ut=fe==null?ue:Pa(fe),ae=Ne==null?ue:Pa(Ne),ue=new Le(ge,J+"leave",fe,r,me),ue.target=ut,ue.relatedTarget=ae,ge=null,wi(me)===oe&&(Le=new Le(ee,J+"enter",Ne,r,me),Le.target=ae,Le.relatedTarget=ut,ge=Le),ut=ge,fe&&Ne)t:{for(Le=OC,ee=fe,J=Ne,ae=0,ge=ee;ge;ge=Le(ge))ae++;ge=0;for(var De=J;De;De=Le(De))ge++;for(;0<ae-ge;)ee=Le(ee),ae--;for(;0<ge-ae;)J=Le(J),ge--;for(;ae--;){if(ee===J||J!==null&&ee===J.alternate){Le=ee;break t}ee=Le(ee),J=Le(J)}Le=null}else Le=null;fe!==null&&G0(ye,ue,fe,Le,!1),Ne!==null&&ut!==null&&G0(ye,ut,Ne,Le,!0)}}e:{if(ue=oe?Pa(oe):window,fe=ue.nodeName&&ue.nodeName.toLowerCase(),fe==="select"||fe==="input"&&ue.type==="file")var tt=ug;else if(og(ue))if(cg)tt=P2;else{tt=H2;var Me=U2}else fe=ue.nodeName,!fe||fe.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?oe&&qu(oe.elementType)&&(tt=ug):tt=q2;if(tt&&(tt=tt(e,oe))){sg(ye,tt,r,me);break e}Me&&Me(e,ue,oe),e==="focusout"&&oe&&ue.type==="number"&&oe.memoizedProps.value!=null&&Hu(ue,"number",ue.value)}switch(Me=oe?Pa(oe):window,e){case"focusin":(og(Me)||Me.contentEditable==="true")&&(Mi=Me,tc=oe,Ja=null);break;case"focusout":Ja=tc=Mi=null;break;case"mousedown":nc=!0;break;case"contextmenu":case"mouseup":case"dragend":nc=!1,bg(ye,r,me);break;case"selectionchange":if(Y2)break;case"keydown":case"keyup":bg(ye,r,me)}var Fe;if(Ju)e:{switch(e){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else zi?ag(e,r)&&($e="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&($e="onCompositionStart");$e&&(ng&&r.locale!=="ko"&&(zi||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&zi&&(Fe=Jp()):(gr=me,Gu="value"in gr?gr.value:gr.textContent,zi=!0)),Me=Wo(oe,$e),0<Me.length&&($e=new eg($e,e,null,r,me),ye.push({event:$e,listeners:Me}),Fe?$e.data=Fe:(Fe=lg(r),Fe!==null&&($e.data=Fe)))),(Fe=D2?j2(e,r):L2(e,r))&&($e=Wo(oe,"onBeforeInput"),0<$e.length&&(Me=new eg("onBeforeInput","beforeinput",null,r,me),ye.push({event:Me,listeners:$e}),Me.data=Fe)),AC(ye,e,oe,r,me)}Y0(ye,t)})}function xl(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Wo(e,t){for(var r=t+"Capture",a=[];e!==null;){var d=e,p=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||p===null||(d=Fa(e,r),d!=null&&a.unshift(xl(e,d,p)),d=Fa(e,t),d!=null&&a.push(xl(e,d,p))),e.tag===3)return a;e=e.return}return[]}function OC(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function G0(e,t,r,a,d){for(var p=t._reactName,x=[];r!==null&&r!==a;){var R=r,G=R.alternate,oe=R.stateNode;if(R=R.tag,G!==null&&G===a)break;R!==5&&R!==26&&R!==27||oe===null||(G=oe,d?(oe=Fa(r,p),oe!=null&&x.unshift(xl(r,oe,G))):d||(oe=Fa(r,p),oe!=null&&x.push(xl(r,oe,G)))),r=r.return}x.length!==0&&e.push({event:t,listeners:x})}var zC=/\r\n?/g,MC=/\u0000|\uFFFD/g;function X0(e){return(typeof e=="string"?e:""+e).replace(zC,`
|
|
9
|
+
`).replace(MC,"")}function Z0(e,t){return t=X0(t),X0(e)===t}function st(e,t,r,a,d,p){switch(r){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ni(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ni(e,""+a);break;case"className":to(e,"class",a);break;case"tabIndex":to(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":to(e,r,a);break;case"style":Zp(e,a,p);break;case"data":if(t!=="object"){to(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(r);break}a=ro(""+a),e.setAttribute(r,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(r,"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 p=="function"&&(r==="formAction"?(t!=="input"&&st(e,t,"name",d.name,d,null),st(e,t,"formEncType",d.formEncType,d,null),st(e,t,"formMethod",d.formMethod,d,null),st(e,t,"formTarget",d.formTarget,d,null)):(st(e,t,"encType",d.encType,d,null),st(e,t,"method",d.method,d,null),st(e,t,"target",d.target,d,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(r);break}a=ro(""+a),e.setAttribute(r,a);break;case"onClick":a!=null&&(e.onclick=Vn);break;case"onScroll":a!=null&&Qe("scroll",e);break;case"onScrollEnd":a!=null&&Qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(r=a.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}r=ro(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(r,""+a):e.removeAttribute(r);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":a===!0?e.setAttribute(r,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(r,a):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(r,a):e.removeAttribute(r);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(r):e.setAttribute(r,a);break;case"popover":Qe("beforetoggle",e),Qe("toggle",e),eo(e,"popover",a);break;case"xlinkActuate":Yn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Yn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Yn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Yn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Yn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Yn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":eo(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=o2.get(r)||r,eo(e,r,a))}}function kf(e,t,r,a,d,p){switch(r){case"style":Zp(e,a,p);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(r=a.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"children":typeof a=="string"?Ni(e,a):(typeof a=="number"||typeof a=="bigint")&&Ni(e,""+a);break;case"onScroll":a!=null&&Qe("scroll",e);break;case"onScrollEnd":a!=null&&Qe("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Vn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Up.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),t=r.slice(2,d?r.length-7:void 0),p=e[Xt]||null,p=p!=null?p[r]:null,typeof p=="function"&&e.removeEventListener(t,p,d),typeof a=="function")){typeof p!="function"&&p!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,a,d);break e}r in e?e[r]=a:a===!0?e.setAttribute(r,""):eo(e,r,a)}}}function Bt(e,t,r){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 a=!1,d=!1,p;for(p in r)if(r.hasOwnProperty(p)){var x=r[p];if(x!=null)switch(p){case"src":a=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:st(e,t,p,x,r,null)}}d&&st(e,t,"srcSet",r.srcSet,r,null),a&&st(e,t,"src",r.src,r,null);return;case"input":Qe("invalid",e);var R=p=x=d=null,G=null,oe=null;for(a in r)if(r.hasOwnProperty(a)){var me=r[a];if(me!=null)switch(a){case"name":d=me;break;case"type":x=me;break;case"checked":G=me;break;case"defaultChecked":oe=me;break;case"value":p=me;break;case"defaultValue":R=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(o(137,t));break;default:st(e,t,a,me,r,null)}}Yp(e,p,R,G,oe,x,d,!1);return;case"select":Qe("invalid",e),a=x=p=null;for(d in r)if(r.hasOwnProperty(d)&&(R=r[d],R!=null))switch(d){case"value":p=R;break;case"defaultValue":x=R;break;case"multiple":a=R;default:st(e,t,d,R,r,null)}t=p,r=x,e.multiple=!!a,t!=null?ki(e,!!a,t,!1):r!=null&&ki(e,!!a,r,!0);return;case"textarea":Qe("invalid",e),p=d=a=null;for(x in r)if(r.hasOwnProperty(x)&&(R=r[x],R!=null))switch(x){case"value":a=R;break;case"defaultValue":d=R;break;case"children":p=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(o(91));break;default:st(e,t,x,R,r,null)}Gp(e,a,d,p);return;case"option":for(G in r)if(r.hasOwnProperty(G)&&(a=r[G],a!=null))switch(G){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:st(e,t,G,a,r,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(a=0;a<El.length;a++)Qe(El[a],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(oe in r)if(r.hasOwnProperty(oe)&&(a=r[oe],a!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:st(e,t,oe,a,r,null)}return;default:if(qu(t)){for(me in r)r.hasOwnProperty(me)&&(a=r[me],a!==void 0&&kf(e,t,me,a,r,void 0));return}}for(R in r)r.hasOwnProperty(R)&&(a=r[R],a!=null&&st(e,t,R,a,r,null))}function DC(e,t,r,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,p=null,x=null,R=null,G=null,oe=null,me=null;for(fe in r){var ye=r[fe];if(r.hasOwnProperty(fe)&&ye!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":G=ye;default:a.hasOwnProperty(fe)||st(e,t,fe,null,a,ye)}}for(var ue in a){var fe=a[ue];if(ye=r[ue],a.hasOwnProperty(ue)&&(fe!=null||ye!=null))switch(ue){case"type":p=fe;break;case"name":d=fe;break;case"checked":oe=fe;break;case"defaultChecked":me=fe;break;case"value":x=fe;break;case"defaultValue":R=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(o(137,t));break;default:fe!==ye&&st(e,t,ue,fe,a,ye)}}Uu(e,x,R,G,oe,me,p,d);return;case"select":fe=x=R=ue=null;for(p in r)if(G=r[p],r.hasOwnProperty(p)&&G!=null)switch(p){case"value":break;case"multiple":fe=G;default:a.hasOwnProperty(p)||st(e,t,p,null,a,G)}for(d in a)if(p=a[d],G=r[d],a.hasOwnProperty(d)&&(p!=null||G!=null))switch(d){case"value":ue=p;break;case"defaultValue":R=p;break;case"multiple":x=p;default:p!==G&&st(e,t,d,p,a,G)}t=R,r=x,a=fe,ue!=null?ki(e,!!r,ue,!1):!!a!=!!r&&(t!=null?ki(e,!!r,t,!0):ki(e,!!r,r?[]:"",!1));return;case"textarea":fe=ue=null;for(R in r)if(d=r[R],r.hasOwnProperty(R)&&d!=null&&!a.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:st(e,t,R,null,a,d)}for(x in a)if(d=a[x],p=r[x],a.hasOwnProperty(x)&&(d!=null||p!=null))switch(x){case"value":ue=d;break;case"defaultValue":fe=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==p&&st(e,t,x,d,a,p)}Vp(e,ue,fe);return;case"option":for(var Ne in r)if(ue=r[Ne],r.hasOwnProperty(Ne)&&ue!=null&&!a.hasOwnProperty(Ne))switch(Ne){case"selected":e.selected=!1;break;default:st(e,t,Ne,null,a,ue)}for(G in a)if(ue=a[G],fe=r[G],a.hasOwnProperty(G)&&ue!==fe&&(ue!=null||fe!=null))switch(G){case"selected":e.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:st(e,t,G,ue,a,fe)}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 Le in r)ue=r[Le],r.hasOwnProperty(Le)&&ue!=null&&!a.hasOwnProperty(Le)&&st(e,t,Le,null,a,ue);for(oe in a)if(ue=a[oe],fe=r[oe],a.hasOwnProperty(oe)&&ue!==fe&&(ue!=null||fe!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(o(137,t));break;default:st(e,t,oe,ue,a,fe)}return;default:if(qu(t)){for(var ut in r)ue=r[ut],r.hasOwnProperty(ut)&&ue!==void 0&&!a.hasOwnProperty(ut)&&kf(e,t,ut,void 0,a,ue);for(me in a)ue=a[me],fe=r[me],!a.hasOwnProperty(me)||ue===fe||ue===void 0&&fe===void 0||kf(e,t,me,ue,a,fe);return}}for(var ee in r)ue=r[ee],r.hasOwnProperty(ee)&&ue!=null&&!a.hasOwnProperty(ee)&&st(e,t,ee,null,a,ue);for(ye in a)ue=a[ye],fe=r[ye],!a.hasOwnProperty(ye)||ue===fe||ue==null&&fe==null||st(e,t,ye,ue,a,fe)}function K0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jC(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,r=performance.getEntriesByType("resource"),a=0;a<r.length;a++){var d=r[a],p=d.transferSize,x=d.initiatorType,R=d.duration;if(p&&R&&K0(x)){for(x=0,R=d.responseEnd,a+=1;a<r.length;a++){var G=r[a],oe=G.startTime;if(oe>R)break;var me=G.transferSize,ye=G.initiatorType;me&&K0(ye)&&(G=G.responseEnd,x+=me*(G<R?1:(R-oe)/(G-oe)))}if(--a,t+=8*(p+x)/(d.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 Nf=null,Rf=null;function $o(e){return e.nodeType===9?e:e.ownerDocument}function Q0(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 J0(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 Of(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 zf=null;function LC(){var e=window.event;return e&&e.type==="popstate"?e===zf?!1:(zf=e,!0):(zf=null,!1)}var W0=typeof setTimeout=="function"?setTimeout:void 0,IC=typeof clearTimeout=="function"?clearTimeout:void 0,$0=typeof Promise=="function"?Promise:void 0,BC=typeof queueMicrotask=="function"?queueMicrotask:typeof $0<"u"?function(e){return $0.resolve(null).then(e).catch(UC)}:W0;function UC(e){setTimeout(function(){throw e})}function Mr(e){return e==="head"}function eb(e,t){var r=t,a=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(a===0){e.removeChild(d),la(t);return}a--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")a++;else if(r==="html")_l(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,_l(r);for(var p=r.firstChild;p;){var x=p.nextSibling,R=p.nodeName;p[qa]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&p.rel.toLowerCase()==="stylesheet"||r.removeChild(p),p=x}}else r==="body"&&_l(e.ownerDocument.body);r=d}while(r);la(t)}function tb(e,t){var r=e;e=0;do{var a=r.nextSibling;if(r.nodeType===1?t?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(t?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=a}while(r)}function Mf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Mf(r),Iu(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function HC(e,t,r,a){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[qa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var p=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=xn(e.nextSibling),e===null)break}return null}function qC(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=xn(e.nextSibling),e===null))return null;return e}function nb(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=xn(e.nextSibling),e===null))return null;return e}function Df(e){return e.data==="$?"||e.data==="$~"}function jf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function PC(e,t){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||r.readyState!=="loading")t();else{var a=function(){t(),r.removeEventListener("DOMContentLoaded",a)};r.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function xn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Lf=null;function rb(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return xn(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function ib(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(t===0)return e;t--}else r!=="/$"&&r!=="/&"||t++}e=e.previousSibling}return null}function ab(e,t,r){switch(t=$o(r),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function _l(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Iu(e)}var _n=new Map,lb=new Set;function es(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var or=Q.d;Q.d={f:FC,r:YC,D:VC,C:GC,L:XC,m:ZC,X:QC,S:KC,M:JC};function FC(){var e=or.f(),t=Vo();return e||t}function YC(e){var t=Ci(e);t!==null&&t.tag===5&&t.type==="form"?_y(t):or.r(e)}var ra=typeof document>"u"?null:document;function ob(e,t,r){var a=ra;if(a&&typeof t=="string"&&t){var d=pn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),lb.has(d)||(lb.add(d),e={rel:e,crossOrigin:r,href:t},a.querySelector(d)===null&&(t=a.createElement("link"),Bt(t,"link",e),zt(t),a.head.appendChild(t)))}}function VC(e){or.D(e),ob("dns-prefetch",e,null)}function GC(e,t){or.C(e,t),ob("preconnect",e,t)}function XC(e,t,r){or.L(e,t,r);var a=ra;if(a&&e&&t){var d='link[rel="preload"][as="'+pn(t)+'"]';t==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+pn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+pn(r.imageSizes)+'"]')):d+='[href="'+pn(e)+'"]';var p=d;switch(t){case"style":p=ia(e);break;case"script":p=aa(e)}_n.has(p)||(e=y({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),_n.set(p,e),a.querySelector(d)!==null||t==="style"&&a.querySelector(wl(p))||t==="script"&&a.querySelector(Cl(p))||(t=a.createElement("link"),Bt(t,"link",e),zt(t),a.head.appendChild(t)))}}function ZC(e,t){or.m(e,t);var r=ra;if(r&&e){var a=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+pn(a)+'"][href="'+pn(e)+'"]',p=d;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=aa(e)}if(!_n.has(p)&&(e=y({rel:"modulepreload",href:e},t),_n.set(p,e),r.querySelector(d)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Cl(p)))return}a=r.createElement("link"),Bt(a,"link",e),zt(a),r.head.appendChild(a)}}}function KC(e,t,r){or.S(e,t,r);var a=ra;if(a&&e){var d=Ti(a).hoistableStyles,p=ia(e);t=t||"default";var x=d.get(p);if(!x){var R={loading:0,preload:null};if(x=a.querySelector(wl(p)))R.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},r),(r=_n.get(p))&&If(e,r);var G=x=a.createElement("link");zt(G),Bt(G,"link",e),G._p=new Promise(function(oe,me){G.onload=oe,G.onerror=me}),G.addEventListener("load",function(){R.loading|=1}),G.addEventListener("error",function(){R.loading|=2}),R.loading|=4,ts(x,t,a)}x={type:"stylesheet",instance:x,count:1,state:R},d.set(p,x)}}}function QC(e,t){or.X(e,t);var r=ra;if(r&&e){var a=Ti(r).hoistableScripts,d=aa(e),p=a.get(d);p||(p=r.querySelector(Cl(d)),p||(e=y({src:e,async:!0},t),(t=_n.get(d))&&Bf(e,t),p=r.createElement("script"),zt(p),Bt(p,"link",e),r.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},a.set(d,p))}}function JC(e,t){or.M(e,t);var r=ra;if(r&&e){var a=Ti(r).hoistableScripts,d=aa(e),p=a.get(d);p||(p=r.querySelector(Cl(d)),p||(e=y({src:e,async:!0,type:"module"},t),(t=_n.get(d))&&Bf(e,t),p=r.createElement("script"),zt(p),Bt(p,"link",e),r.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},a.set(d,p))}}function sb(e,t,r,a){var d=(d=we.current)?es(d):null;if(!d)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=ia(r.href),r=Ti(d).hoistableStyles,a=r.get(t),a||(a={type:"style",instance:null,count:0,state:null},r.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=ia(r.href);var p=Ti(d).hoistableStyles,x=p.get(e);if(x||(d=d.ownerDocument||d,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,x),(p=d.querySelector(wl(e)))&&!p._p&&(x.instance=p,x.state.loading=5),_n.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},_n.set(e,r),p||WC(d,e,r,x.state))),t&&a===null)throw Error(o(528,""));return x}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=aa(r),r=Ti(d).hoistableScripts,a=r.get(t),a||(a={type:"script",instance:null,count:0,state:null},r.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ia(e){return'href="'+pn(e)+'"'}function wl(e){return'link[rel="stylesheet"]['+e+"]"}function ub(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function WC(e,t,r,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Bt(t,"link",r),zt(t),e.head.appendChild(t))}function aa(e){return'[src="'+pn(e)+'"]'}function Cl(e){return"script[async]"+e}function cb(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+pn(r.href)+'"]');if(a)return t.instance=a,zt(a),a;var d=y({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),zt(a),Bt(a,"style",d),ts(a,r.precedence,e),t.instance=a;case"stylesheet":d=ia(r.href);var p=e.querySelector(wl(d));if(p)return t.state.loading|=4,t.instance=p,zt(p),p;a=ub(r),(d=_n.get(d))&&If(a,d),p=(e.ownerDocument||e).createElement("link"),zt(p);var x=p;return x._p=new Promise(function(R,G){x.onload=R,x.onerror=G}),Bt(p,"link",a),t.state.loading|=4,ts(p,r.precedence,e),t.instance=p;case"script":return p=aa(r.src),(d=e.querySelector(Cl(p)))?(t.instance=d,zt(d),d):(a=r,(d=_n.get(p))&&(a=y({},r),Bf(a,d)),e=e.ownerDocument||e,d=e.createElement("script"),zt(d),Bt(d,"link",a),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,ts(a,r.precedence,e));return t.instance}function ts(e,t,r){for(var a=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=a.length?a[a.length-1]:null,p=d,x=0;x<a.length;x++){var R=a[x];if(R.dataset.precedence===t)p=R;else if(p!==d)break}p?p.parentNode.insertBefore(e,p.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function If(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Bf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ns=null;function fb(e,t,r){if(ns===null){var a=new Map,d=ns=new Map;d.set(r,a)}else d=ns,a=d.get(r),a||(a=new Map,d.set(r,a));if(a.has(e))return a;for(a.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var p=r[d];if(!(p[qa]||p[Dt]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var x=p.getAttribute(t)||"";x=e+x;var R=a.get(x);R?R.push(p):a.set(x,[p])}}return a}function db(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function $C(e,t,r){if(r===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 hb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function eT(e,t,r,a){if(r.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=ia(a.href),p=t.querySelector(wl(d));if(p){t=p._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=rs.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=p,zt(p);return}p=t.ownerDocument||t,a=ub(a),(d=_n.get(d))&&If(a,d),p=p.createElement("link"),zt(p);var x=p;x._p=new Promise(function(R,G){x.onload=R,x.onerror=G}),Bt(p,"link",a),r.instance=p}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=rs.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var Uf=0;function tT(e,t){return e.stylesheets&&e.count===0&&as(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var a=setTimeout(function(){if(e.stylesheets&&as(e,e.stylesheets),e.unsuspend){var p=e.unsuspend;e.unsuspend=null,p()}},6e4+t);0<e.imgBytes&&Uf===0&&(Uf=62500*jC());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&as(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>Uf?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(d)}}:null}function rs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)as(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var is=null;function as(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,is=new Map,t.forEach(nT,e),is=null,rs.call(e))}function nT(e,t){if(!(t.state.loading&4)){var r=is.get(e);if(r)var a=r.get(null);else{r=new Map,is.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<d.length;p++){var x=d[p];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(r.set(x.dataset.precedence,x),a=x)}a&&r.set(null,a)}d=t.instance,x=d.getAttribute("data-precedence"),p=r.get(x)||a,p===a&&r.set(null,d),r.set(x,d),this.count++,a=rs.bind(this),d.addEventListener("load",a),d.addEventListener("error",a),p?p.parentNode.insertBefore(d,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Tl={$$typeof:k,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function rT(e,t,r,a,d,p,x,R,G){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=Mu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mu(0),this.hiddenUpdates=Mu(null),this.identifierPrefix=a,this.onUncaughtError=d,this.onCaughtError=p,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function mb(e,t,r,a,d,p,x,R,G,oe,me,ye){return e=new rT(e,t,r,x,G,oe,me,ye,R),t=1,p===!0&&(t|=24),p=an(3,null,null,t),e.current=p,p.stateNode=e,t=yc(),t.refCount++,e.pooledCache=t,t.refCount++,p.memoizedState={element:a,isDehydrated:r,cache:t},Ec(p),e}function pb(e){return e?(e=Li,e):Li}function gb(e,t,r,a,d,p){d=pb(d),a.context===null?a.context=d:a.pendingContext=d,a=xr(t),a.payload={element:r},p=p===void 0?null:p,p!==null&&(a.callback=p),r=_r(e,a,t),r!==null&&($t(r,e,t),il(r,e,t))}function yb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Hf(e,t){yb(e,t),(e=e.alternate)&&yb(e,t)}function bb(e){if(e.tag===13||e.tag===31){var t=Wr(e,67108864);t!==null&&$t(t,e,67108864),Hf(e,67108864)}}function vb(e){if(e.tag===13||e.tag===31){var t=cn();t=Du(t);var r=Wr(e,t);r!==null&&$t(r,e,t),Hf(e,t)}}var ls=!0;function iT(e,t,r,a){var d=Z.T;Z.T=null;var p=Q.p;try{Q.p=2,qf(e,t,r,a)}finally{Q.p=p,Z.T=d}}function aT(e,t,r,a){var d=Z.T;Z.T=null;var p=Q.p;try{Q.p=8,qf(e,t,r,a)}finally{Q.p=p,Z.T=d}}function qf(e,t,r,a){if(ls){var d=Pf(a);if(d===null)Af(e,t,a,os,r),Eb(e,a);else if(oT(d,e,t,r,a))a.stopPropagation();else if(Eb(e,a),t&4&&-1<lT.indexOf(e)){for(;d!==null;){var p=Ci(d);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var x=hn(p.pendingLanes);if(x!==0){var R=p;for(R.pendingLanes|=2,R.entangledLanes|=2;x;){var G=1<<31-Ze(x);R.entanglements[1]|=G,x&=~G}Un(p),(it&6)===0&&(Fo=_e()+500,Sl(0))}}break;case 31:case 13:R=Wr(p,2),R!==null&&$t(R,p,2),Vo(),Hf(p,2)}if(p=Pf(a),p===null&&Af(e,t,a,os,r),p===d)break;d=p}d!==null&&a.stopPropagation()}else Af(e,t,a,null,r)}}function Pf(e){return e=Fu(e),Ff(e)}var os=null;function Ff(e){if(os=null,e=wi(e),e!==null){var t=s(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=c(t),e!==null)return e;e=null}else if(r===31){if(e=f(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return os=e,null}function Sb(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(Se()){case te:return 2;case be:return 8;case Ce:case Ie:return 32;case Je:return 268435456;default:return 32}default:return 32}}var Yf=!1,Dr=null,jr=null,Lr=null,Al=new Map,kl=new Map,Ir=[],lT="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 Eb(e,t){switch(e){case"focusin":case"focusout":Dr=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":Lr=null;break;case"pointerover":case"pointerout":Al.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":kl.delete(t.pointerId)}}function Nl(e,t,r,a,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:r,eventSystemFlags:a,nativeEvent:p,targetContainers:[d]},t!==null&&(t=Ci(t),t!==null&&bb(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function oT(e,t,r,a,d){switch(t){case"focusin":return Dr=Nl(Dr,e,t,r,a,d),!0;case"dragenter":return jr=Nl(jr,e,t,r,a,d),!0;case"mouseover":return Lr=Nl(Lr,e,t,r,a,d),!0;case"pointerover":var p=d.pointerId;return Al.set(p,Nl(Al.get(p)||null,e,t,r,a,d)),!0;case"gotpointercapture":return p=d.pointerId,kl.set(p,Nl(kl.get(p)||null,e,t,r,a,d)),!0}return!1}function xb(e){var t=wi(e.target);if(t!==null){var r=s(t);if(r!==null){if(t=r.tag,t===13){if(t=c(r),t!==null){e.blockedOn=t,Lp(e.priority,function(){vb(r)});return}}else if(t===31){if(t=f(r),t!==null){e.blockedOn=t,Lp(e.priority,function(){vb(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ss(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Pf(e.nativeEvent);if(r===null){r=e.nativeEvent;var a=new r.constructor(r.type,r);Pu=a,r.target.dispatchEvent(a),Pu=null}else return t=Ci(r),t!==null&&bb(t),e.blockedOn=r,!1;t.shift()}return!0}function _b(e,t,r){ss(e)&&r.delete(t)}function sT(){Yf=!1,Dr!==null&&ss(Dr)&&(Dr=null),jr!==null&&ss(jr)&&(jr=null),Lr!==null&&ss(Lr)&&(Lr=null),Al.forEach(_b),kl.forEach(_b)}function us(e,t){e.blockedOn===t&&(e.blockedOn=null,Yf||(Yf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,sT)))}var cs=null;function wb(e){cs!==e&&(cs=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){cs===e&&(cs=null);for(var t=0;t<e.length;t+=3){var r=e[t],a=e[t+1],d=e[t+2];if(typeof a!="function"){if(Ff(a||r)===null)continue;break}var p=Ci(r);p!==null&&(e.splice(t,3),t-=3,qc(p,{pending:!0,data:d,method:r.method,action:a},a,d))}}))}function la(e){function t(G){return us(G,e)}Dr!==null&&us(Dr,e),jr!==null&&us(jr,e),Lr!==null&&us(Lr,e),Al.forEach(t),kl.forEach(t);for(var r=0;r<Ir.length;r++){var a=Ir[r];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ir.length&&(r=Ir[0],r.blockedOn===null);)xb(r),r.blockedOn===null&&Ir.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(a=0;a<r.length;a+=3){var d=r[a],p=r[a+1],x=d[Xt]||null;if(typeof p=="function")x||wb(r);else if(x){var R=null;if(p&&p.hasAttribute("formAction")){if(d=p,x=p[Xt]||null)R=x.formAction;else if(Ff(d)!==null)continue}else R=x.action;typeof R=="function"?r[a+1]=R:(r.splice(a,3),a-=3),wb(r)}}}function Cb(){function e(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(x){return d=x})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),a||setTimeout(r,20)}function r(){if(!a&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(r,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function Vf(e){this._internalRoot=e}fs.prototype.render=Vf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var r=t.current,a=cn();gb(r,a,e,t,null,null)},fs.prototype.unmount=Vf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gb(e.current,2,null,e,null,null),Vo(),t[_i]=null}};function fs(e){this._internalRoot=e}fs.prototype.unstable_scheduleHydration=function(e){if(e){var t=jp();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Ir.length&&t!==0&&t<Ir[r].priority;r++);Ir.splice(r,0,e),r===0&&xb(e)}};var Tb=l.version;if(Tb!=="19.2.0")throw Error(o(527,Tb,"19.2.0"));Q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var uT={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ds=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ds.isDisabled&&ds.supportsFiber)try{Xe=ds.inject(uT),gt=ds}catch{}}return ua.createRoot=function(e,t){if(!u(e))throw Error(o(299));var r=!1,a="",d=My,p=Dy,x=jy;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(p=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=mb(e,1,!1,null,null,r,a,null,d,p,x,Cb),e[_i]=t.current,Tf(e),new Vf(t)},ua.hydrateRoot=function(e,t,r){if(!u(e))throw Error(o(299));var a=!1,d="",p=My,x=Dy,R=jy,G=null;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(x=r.onCaughtError),r.onRecoverableError!==void 0&&(R=r.onRecoverableError),r.formState!==void 0&&(G=r.formState)),t=mb(e,1,!0,t,r??null,a,d,G,p,x,R,Cb),t.context=pb(null),r=t.current,a=cn(),a=Du(a),d=xr(a),d.callback=null,_r(r,d,a),r=a,t.current.lanes=r,Ha(t,r),Un(t),e[_i]=t.current,Tf(e),new fs(t)},ua.version="19.2.0",ua}var rd;function jb(){if(rd)return ys.exports;rd=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch{}}return n(),ys.exports=Db(),ys.exports}var Lb=jb();td();function id(n,l){if(typeof n=="function")return n(l);n!=null&&(n.current=l)}function Es(...n){return l=>{let i=!1;const o=n.map(u=>{const s=id(u,l);return!i&&typeof s=="function"&&(i=!0),s});if(i)return()=>{for(let u=0;u<o.length;u++){const s=o[u];typeof s=="function"?s():id(n[u],null)}}}}function Hn(...n){return P.useCallback(Es(...n),n)}function Ib(n){const l=Bb(n),i=P.forwardRef((o,u)=>{const{children:s,...c}=o,f=P.Children.toArray(s),m=f.find(Hb);if(m){const h=m.props.children,g=f.map(y=>y===m?P.Children.count(h)>1?P.Children.only(null):P.isValidElement(h)?h.props.children:null:y);return O.jsx(l,{...c,ref:u,children:P.isValidElement(h)?P.cloneElement(h,void 0,g):null})}return O.jsx(l,{...c,ref:u,children:s})});return i.displayName=`${n}.Slot`,i}function Bb(n){const l=P.forwardRef((i,o)=>{const{children:u,...s}=i;if(P.isValidElement(u)){const c=Pb(u),f=qb(s,u.props);return u.type!==P.Fragment&&(f.ref=o?Es(o,c):c),P.cloneElement(u,f)}return P.Children.count(u)>1?P.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var Ub=Symbol("radix.slottable");function Hb(n){return P.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===Ub}function qb(n,l){const i={...l};for(const o in l){const u=n[o],s=l[o];/^on[A-Z]/.test(o)?u&&s?i[o]=(...f)=>{const m=s(...f);return u(...f),m}:u&&(i[o]=u):o==="style"?i[o]={...u,...s}:o==="className"&&(i[o]=[u,s].filter(Boolean).join(" "))}return{...n,...i}}function Pb(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,i=l&&"isReactWarning"in l&&l.isReactWarning;return i?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,i=l&&"isReactWarning"in l&&l.isReactWarning,i?n.props.ref:n.props.ref||n.ref)}var Fb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sr=Fb.reduce((n,l)=>{const i=Ib(`Primitive.${l}`),o=P.forwardRef((u,s)=>{const{asChild:c,...f}=u,m=c?i:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(m,{...f,ref:s})});return o.displayName=`Primitive.${l}`,{...n,[l]:o}},{}),ur=globalThis?.document?P.useLayoutEffect:()=>{};function Yb(n,l){return P.useReducer((i,o)=>l[i][o]??i,n)}var fi=n=>{const{present:l,children:i}=n,o=Vb(l),u=typeof i=="function"?i({present:o.isPresent}):P.Children.only(i),s=Hn(o.ref,Gb(u));return typeof i=="function"||o.isPresent?P.cloneElement(u,{ref:s}):null};fi.displayName="Presence";function Vb(n){const[l,i]=P.useState(),o=P.useRef(null),u=P.useRef(n),s=P.useRef("none"),c=n?"mounted":"unmounted",[f,m]=Yb(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const h=zl(o.current);s.current=f==="mounted"?h:"none"},[f]),ur(()=>{const h=o.current,g=u.current;if(g!==n){const v=s.current,b=zl(h);n?m("MOUNT"):b==="none"||h?.display==="none"?m("UNMOUNT"):m(g&&v!==b?"ANIMATION_OUT":"UNMOUNT"),u.current=n}},[n,m]),ur(()=>{if(l){let h;const g=l.ownerDocument.defaultView??window,y=b=>{const E=zl(o.current).includes(CSS.escape(b.animationName));if(b.target===l&&E&&(m("ANIMATION_END"),!u.current)){const T=l.style.animationFillMode;l.style.animationFillMode="forwards",h=g.setTimeout(()=>{l.style.animationFillMode==="forwards"&&(l.style.animationFillMode=T)})}},v=b=>{b.target===l&&(s.current=zl(o.current))};return l.addEventListener("animationstart",v),l.addEventListener("animationcancel",y),l.addEventListener("animationend",y),()=>{g.clearTimeout(h),l.removeEventListener("animationstart",v),l.removeEventListener("animationcancel",y),l.removeEventListener("animationend",y)}}else m("ANIMATION_END")},[l,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:P.useCallback(h=>{o.current=h?getComputedStyle(h):null,i(h)},[])}}function zl(n){return n?.animationName||"none"}function Gb(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,i=l&&"isReactWarning"in l&&l.isReactWarning;return i?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,i=l&&"isReactWarning"in l&&l.isReactWarning,i?n.props.ref:n.props.ref||n.ref)}function ad(n,l=[]){let i=[];function o(s,c){const f=P.createContext(c),m=i.length;i=[...i,c];const h=y=>{const{scope:v,children:b,...w}=y,E=v?.[n]?.[m]||f,T=P.useMemo(()=>w,Object.values(w));return O.jsx(E.Provider,{value:T,children:b})};h.displayName=s+"Provider";function g(y,v){const b=v?.[n]?.[m]||f,w=P.useContext(b);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${y}\` must be used within \`${s}\``)}return[h,g]}const u=()=>{const s=i.map(c=>P.createContext(c));return function(f){const m=f?.[n]||s;return P.useMemo(()=>({[`__scope${n}`]:{...f,[n]:m}}),[f,m])}};return u.scopeName=n,[o,Xb(u,...l)]}function Xb(...n){const l=n[0];if(n.length===1)return l;const i=()=>{const o=n.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(s){const c=o.reduce((f,{useScope:m,scopeName:h})=>{const y=m(s)[`__scope${h}`];return{...f,...y}},{});return P.useMemo(()=>({[`__scope${l.scopeName}`]:c}),[c])}};return i.scopeName=l.scopeName,i}function cr(n){const l=P.useRef(n);return P.useEffect(()=>{l.current=n}),P.useMemo(()=>(...i)=>l.current?.(...i),[])}var Zb=P.createContext(void 0);function Kb(n){const l=P.useContext(Zb);return n||l||"ltr"}function Qb(n,[l,i]){return Math.min(i,Math.max(l,n))}function qn(n,l,{checkForDefaultPrevented:i=!0}={}){return function(u){if(n?.(u),i===!1||!u.defaultPrevented)return l?.(u)}}function Jb(n,l){return P.useReducer((i,o)=>l[i][o]??i,n)}var xs="ScrollArea",[ld]=ad(xs),[Wb,fn]=ld(xs),od=P.forwardRef((n,l)=>{const{__scopeScrollArea:i,type:o="hover",dir:u,scrollHideDelay:s=600,...c}=n,[f,m]=P.useState(null),[h,g]=P.useState(null),[y,v]=P.useState(null),[b,w]=P.useState(null),[E,T]=P.useState(null),[_,A]=P.useState(0),[k,q]=P.useState(0),[H,M]=P.useState(!1),[I,Y]=P.useState(!1),F=Hn(l,ie=>m(ie)),$=Kb(u);return O.jsx(Wb,{scope:i,type:o,dir:$,scrollHideDelay:s,scrollArea:f,viewport:h,onViewportChange:g,content:y,onContentChange:v,scrollbarX:b,onScrollbarXChange:w,scrollbarXEnabled:H,onScrollbarXEnabledChange:M,scrollbarY:E,onScrollbarYChange:T,scrollbarYEnabled:I,onScrollbarYEnabledChange:Y,onCornerWidthChange:A,onCornerHeightChange:q,children:O.jsx(sr.div,{dir:$,...c,ref:F,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":k+"px",...n.style}})})});od.displayName=xs;var sd="ScrollAreaViewport",ud=P.forwardRef((n,l)=>{const{__scopeScrollArea:i,children:o,nonce:u,...s}=n,c=fn(sd,i),f=P.useRef(null),m=Hn(l,f,c.onViewportChange);return O.jsxs(O.Fragment,{children:[O.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),O.jsx(sr.div,{"data-radix-scroll-area-viewport":"",...s,ref:m,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...n.style},children:O.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});ud.displayName=sd;var Nn="ScrollAreaScrollbar",_s=P.forwardRef((n,l)=>{const{forceMount:i,...o}=n,u=fn(Nn,n.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=u,f=n.orientation==="horizontal";return P.useEffect(()=>(f?s(!0):c(!0),()=>{f?s(!1):c(!1)}),[f,s,c]),u.type==="hover"?O.jsx($b,{...o,ref:l,forceMount:i}):u.type==="scroll"?O.jsx(ev,{...o,ref:l,forceMount:i}):u.type==="auto"?O.jsx(cd,{...o,ref:l,forceMount:i}):u.type==="always"?O.jsx(ws,{...o,ref:l}):null});_s.displayName=Nn;var $b=P.forwardRef((n,l)=>{const{forceMount:i,...o}=n,u=fn(Nn,n.__scopeScrollArea),[s,c]=P.useState(!1);return P.useEffect(()=>{const f=u.scrollArea;let m=0;if(f){const h=()=>{window.clearTimeout(m),c(!0)},g=()=>{m=window.setTimeout(()=>c(!1),u.scrollHideDelay)};return f.addEventListener("pointerenter",h),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(m),f.removeEventListener("pointerenter",h),f.removeEventListener("pointerleave",g)}}},[u.scrollArea,u.scrollHideDelay]),O.jsx(fi,{present:i||s,children:O.jsx(cd,{"data-state":s?"visible":"hidden",...o,ref:l})})}),ev=P.forwardRef((n,l)=>{const{forceMount:i,...o}=n,u=fn(Nn,n.__scopeScrollArea),s=n.orientation==="horizontal",c=Ll(()=>m("SCROLL_END"),100),[f,m]=Jb("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return P.useEffect(()=>{if(f==="idle"){const h=window.setTimeout(()=>m("HIDE"),u.scrollHideDelay);return()=>window.clearTimeout(h)}},[f,u.scrollHideDelay,m]),P.useEffect(()=>{const h=u.viewport,g=s?"scrollLeft":"scrollTop";if(h){let y=h[g];const v=()=>{const b=h[g];y!==b&&(m("SCROLL"),c()),y=b};return h.addEventListener("scroll",v),()=>h.removeEventListener("scroll",v)}},[u.viewport,s,m,c]),O.jsx(fi,{present:i||f!=="hidden",children:O.jsx(ws,{"data-state":f==="hidden"?"hidden":"visible",...o,ref:l,onPointerEnter:qn(n.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:qn(n.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),cd=P.forwardRef((n,l)=>{const i=fn(Nn,n.__scopeScrollArea),{forceMount:o,...u}=n,[s,c]=P.useState(!1),f=n.orientation==="horizontal",m=Ll(()=>{if(i.viewport){const h=i.viewport.offsetWidth<i.viewport.scrollWidth,g=i.viewport.offsetHeight<i.viewport.scrollHeight;c(f?h:g)}},10);return di(i.viewport,m),di(i.content,m),O.jsx(fi,{present:o||s,children:O.jsx(ws,{"data-state":s?"visible":"hidden",...u,ref:l})})}),ws=P.forwardRef((n,l)=>{const{orientation:i="vertical",...o}=n,u=fn(Nn,n.__scopeScrollArea),s=P.useRef(null),c=P.useRef(0),[f,m]=P.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=pd(f.viewport,f.content),g={...o,sizes:f,onSizesChange:m,hasThumb:h>0&&h<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:v=>c.current=v};function y(v,b){return lv(v,c.current,f,b)}return i==="horizontal"?O.jsx(tv,{...g,ref:l,onThumbPositionChange:()=>{if(u.viewport&&s.current){const v=u.viewport.scrollLeft,b=gd(v,f,u.dir);s.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:v=>{u.viewport&&(u.viewport.scrollLeft=v)},onDragScroll:v=>{u.viewport&&(u.viewport.scrollLeft=y(v,u.dir))}}):i==="vertical"?O.jsx(nv,{...g,ref:l,onThumbPositionChange:()=>{if(u.viewport&&s.current){const v=u.viewport.scrollTop,b=gd(v,f);s.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:v=>{u.viewport&&(u.viewport.scrollTop=v)},onDragScroll:v=>{u.viewport&&(u.viewport.scrollTop=y(v))}}):null}),tv=P.forwardRef((n,l)=>{const{sizes:i,onSizesChange:o,...u}=n,s=fn(Nn,n.__scopeScrollArea),[c,f]=P.useState(),m=P.useRef(null),h=Hn(l,m,s.onScrollbarXChange);return P.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),O.jsx(dd,{"data-orientation":"horizontal",...u,ref:h,sizes:i,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":jl(i)+"px",...n.style},onThumbPointerDown:g=>n.onThumbPointerDown(g.x),onDragScroll:g=>n.onDragScroll(g.x),onWheelScroll:(g,y)=>{if(s.viewport){const v=s.viewport.scrollLeft+g.deltaX;n.onWheelScroll(v),bd(v,y)&&g.preventDefault()}},onResize:()=>{m.current&&s.viewport&&c&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:Dl(c.paddingLeft),paddingEnd:Dl(c.paddingRight)}})}})}),nv=P.forwardRef((n,l)=>{const{sizes:i,onSizesChange:o,...u}=n,s=fn(Nn,n.__scopeScrollArea),[c,f]=P.useState(),m=P.useRef(null),h=Hn(l,m,s.onScrollbarYChange);return P.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),O.jsx(dd,{"data-orientation":"vertical",...u,ref:h,sizes:i,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":jl(i)+"px",...n.style},onThumbPointerDown:g=>n.onThumbPointerDown(g.y),onDragScroll:g=>n.onDragScroll(g.y),onWheelScroll:(g,y)=>{if(s.viewport){const v=s.viewport.scrollTop+g.deltaY;n.onWheelScroll(v),bd(v,y)&&g.preventDefault()}},onResize:()=>{m.current&&s.viewport&&c&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:Dl(c.paddingTop),paddingEnd:Dl(c.paddingBottom)}})}})}),[rv,fd]=ld(Nn),dd=P.forwardRef((n,l)=>{const{__scopeScrollArea:i,sizes:o,hasThumb:u,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:f,onThumbPositionChange:m,onDragScroll:h,onWheelScroll:g,onResize:y,...v}=n,b=fn(Nn,i),[w,E]=P.useState(null),T=Hn(l,F=>E(F)),_=P.useRef(null),A=P.useRef(""),k=b.viewport,q=o.content-o.viewport,H=cr(g),M=cr(m),I=Ll(y,10);function Y(F){if(_.current){const $=F.clientX-_.current.left,ie=F.clientY-_.current.top;h({x:$,y:ie})}}return P.useEffect(()=>{const F=$=>{const ie=$.target;w?.contains(ie)&&H($,q)};return document.addEventListener("wheel",F,{passive:!1}),()=>document.removeEventListener("wheel",F,{passive:!1})},[k,w,q,H]),P.useEffect(M,[o,M]),di(w,I),di(b.content,I),O.jsx(rv,{scope:i,scrollbar:w,hasThumb:u,onThumbChange:cr(s),onThumbPointerUp:cr(c),onThumbPositionChange:M,onThumbPointerDown:cr(f),children:O.jsx(sr.div,{...v,ref:T,style:{position:"absolute",...v.style},onPointerDown:qn(n.onPointerDown,F=>{F.button===0&&(F.target.setPointerCapture(F.pointerId),_.current=w.getBoundingClientRect(),A.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),Y(F))}),onPointerMove:qn(n.onPointerMove,Y),onPointerUp:qn(n.onPointerUp,F=>{const $=F.target;$.hasPointerCapture(F.pointerId)&&$.releasePointerCapture(F.pointerId),document.body.style.webkitUserSelect=A.current,b.viewport&&(b.viewport.style.scrollBehavior=""),_.current=null})})})}),Ml="ScrollAreaThumb",hd=P.forwardRef((n,l)=>{const{forceMount:i,...o}=n,u=fd(Ml,n.__scopeScrollArea);return O.jsx(fi,{present:i||u.hasThumb,children:O.jsx(iv,{ref:l,...o})})}),iv=P.forwardRef((n,l)=>{const{__scopeScrollArea:i,style:o,...u}=n,s=fn(Ml,i),c=fd(Ml,i),{onThumbPositionChange:f}=c,m=Hn(l,y=>c.onThumbChange(y)),h=P.useRef(void 0),g=Ll(()=>{h.current&&(h.current(),h.current=void 0)},100);return P.useEffect(()=>{const y=s.viewport;if(y){const v=()=>{if(g(),!h.current){const b=ov(y,f);h.current=b,f()}};return f(),y.addEventListener("scroll",v),()=>y.removeEventListener("scroll",v)}},[s.viewport,g,f]),O.jsx(sr.div,{"data-state":c.hasThumb?"visible":"hidden",...u,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:qn(n.onPointerDownCapture,y=>{const b=y.target.getBoundingClientRect(),w=y.clientX-b.left,E=y.clientY-b.top;c.onThumbPointerDown({x:w,y:E})}),onPointerUp:qn(n.onPointerUp,c.onThumbPointerUp)})});hd.displayName=Ml;var Cs="ScrollAreaCorner",md=P.forwardRef((n,l)=>{const i=fn(Cs,n.__scopeScrollArea),o=!!(i.scrollbarX&&i.scrollbarY);return i.type!=="scroll"&&o?O.jsx(av,{...n,ref:l}):null});md.displayName=Cs;var av=P.forwardRef((n,l)=>{const{__scopeScrollArea:i,...o}=n,u=fn(Cs,i),[s,c]=P.useState(0),[f,m]=P.useState(0),h=!!(s&&f);return di(u.scrollbarX,()=>{const g=u.scrollbarX?.offsetHeight||0;u.onCornerHeightChange(g),m(g)}),di(u.scrollbarY,()=>{const g=u.scrollbarY?.offsetWidth||0;u.onCornerWidthChange(g),c(g)}),h?O.jsx(sr.div,{...o,ref:l,style:{width:s,height:f,position:"absolute",right:u.dir==="ltr"?0:void 0,left:u.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Dl(n){return n?parseInt(n,10):0}function pd(n,l){const i=n/l;return isNaN(i)?0:i}function jl(n){const l=pd(n.viewport,n.content),i=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,o=(n.scrollbar.size-i)*l;return Math.max(o,18)}function lv(n,l,i,o="ltr"){const u=jl(i),s=u/2,c=l||s,f=u-c,m=i.scrollbar.paddingStart+c,h=i.scrollbar.size-i.scrollbar.paddingEnd-f,g=i.content-i.viewport,y=o==="ltr"?[0,g]:[g*-1,0];return yd([m,h],y)(n)}function gd(n,l,i="ltr"){const o=jl(l),u=l.scrollbar.paddingStart+l.scrollbar.paddingEnd,s=l.scrollbar.size-u,c=l.content-l.viewport,f=s-o,m=i==="ltr"?[0,c]:[c*-1,0],h=Qb(n,m);return yd([0,c],[0,f])(h)}function yd(n,l){return i=>{if(n[0]===n[1]||l[0]===l[1])return l[0];const o=(l[1]-l[0])/(n[1]-n[0]);return l[0]+o*(i-n[0])}}function bd(n,l){return n>0&&n<l}var ov=(n,l=()=>{})=>{let i={left:n.scrollLeft,top:n.scrollTop},o=0;return(function u(){const s={left:n.scrollLeft,top:n.scrollTop},c=i.left!==s.left,f=i.top!==s.top;(c||f)&&l(),i=s,o=window.requestAnimationFrame(u)})(),()=>window.cancelAnimationFrame(o)};function Ll(n,l){const i=cr(n),o=P.useRef(0);return P.useEffect(()=>()=>window.clearTimeout(o.current),[]),P.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(i,l)},[i,l])}function di(n,l){const i=cr(l);ur(()=>{let o=0;if(n){const u=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(i)});return u.observe(n),()=>{window.cancelAnimationFrame(o),u.unobserve(n)}}},[n,i])}var vd=od,sv=ud,uv=md;function Sd(n){var l,i,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(l=0;l<u;l++)n[l]&&(i=Sd(n[l]))&&(o&&(o+=" "),o+=i)}else for(i in n)n[i]&&(o&&(o+=" "),o+=i);return o}function Ed(){for(var n,l,i=0,o="",u=arguments.length;i<u;i++)(n=arguments[i])&&(l=Sd(n))&&(o&&(o+=" "),o+=l);return o}const cv=(n,l)=>{const i=new Array(n.length+l.length);for(let o=0;o<n.length;o++)i[o]=n[o];for(let o=0;o<l.length;o++)i[n.length+o]=l[o];return i},fv=(n,l)=>({classGroupId:n,validator:l}),xd=(n=new Map,l=null,i)=>({nextPart:n,validators:l,classGroupId:i}),Il="-",_d=[],dv="arbitrary..",hv=n=>{const l=pv(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return mv(c);const f=c.split(Il),m=f[0]===""&&f.length>1?1:0;return wd(f,m,l)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=o[c],h=i[c];return m?h?cv(h,m):m:h||_d}return i[c]||_d}}},wd=(n,l,i)=>{if(n.length-l===0)return i.classGroupId;const u=n[l],s=i.nextPart.get(u);if(s){const h=wd(n,l+1,s);if(h)return h}const c=i.validators;if(c===null)return;const f=l===0?n.join(Il):n.slice(l).join(Il),m=c.length;for(let h=0;h<m;h++){const g=c[h];if(g.validator(f))return g.classGroupId}},mv=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const l=n.slice(1,-1),i=l.indexOf(":"),o=l.slice(0,i);return o?dv+o:void 0})(),pv=n=>{const{theme:l,classGroups:i}=n;return gv(i,l)},gv=(n,l)=>{const i=xd();for(const o in n){const u=n[o];Ts(u,i,o,l)}return i},Ts=(n,l,i,o)=>{const u=n.length;for(let s=0;s<u;s++){const c=n[s];yv(c,l,i,o)}},yv=(n,l,i,o)=>{if(typeof n=="string"){bv(n,l,i);return}if(typeof n=="function"){vv(n,l,i,o);return}Sv(n,l,i,o)},bv=(n,l,i)=>{const o=n===""?l:Cd(l,n);o.classGroupId=i},vv=(n,l,i,o)=>{if(Ev(n)){Ts(n(o),l,i,o);return}l.validators===null&&(l.validators=[]),l.validators.push(fv(i,n))},Sv=(n,l,i,o)=>{const u=Object.entries(n),s=u.length;for(let c=0;c<s;c++){const[f,m]=u[c];Ts(m,Cd(l,f),i,o)}},Cd=(n,l)=>{let i=n;const o=l.split(Il),u=o.length;for(let s=0;s<u;s++){const c=o[s];let f=i.nextPart.get(c);f||(f=xd(),i.nextPart.set(c,f)),i=f}return i},Ev=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,xv=n=>{if(n<1)return{get:()=>{},set:()=>{}};let l=0,i=Object.create(null),o=Object.create(null);const u=(s,c)=>{i[s]=c,l++,l>n&&(l=0,o=i,i=Object.create(null))};return{get(s){let c=i[s];if(c!==void 0)return c;if((c=o[s])!==void 0)return u(s,c),c},set(s,c){s in i?i[s]=c:u(s,c)}}},As="!",Td=":",_v=[],Ad=(n,l,i,o,u)=>({modifiers:n,hasImportantModifier:l,baseClassName:i,maybePostfixModifierPosition:o,isExternal:u}),wv=n=>{const{prefix:l,experimentalParseClassName:i}=n;let o=u=>{const s=[];let c=0,f=0,m=0,h;const g=u.length;for(let E=0;E<g;E++){const T=u[E];if(c===0&&f===0){if(T===Td){s.push(u.slice(m,E)),m=E+1;continue}if(T==="/"){h=E;continue}}T==="["?c++:T==="]"?c--:T==="("?f++:T===")"&&f--}const y=s.length===0?u:u.slice(m);let v=y,b=!1;y.endsWith(As)?(v=y.slice(0,-1),b=!0):y.startsWith(As)&&(v=y.slice(1),b=!0);const w=h&&h>m?h-m:void 0;return Ad(s,b,v,w)};if(l){const u=l+Td,s=o;o=c=>c.startsWith(u)?s(c.slice(u.length)):Ad(_v,!1,c,void 0,!0)}if(i){const u=o;o=s=>i({className:s,parseClassName:u})}return o},Cv=n=>{const l=new Map;return n.orderSensitiveModifiers.forEach((i,o)=>{l.set(i,1e6+o)}),i=>{const o=[];let u=[];for(let s=0;s<i.length;s++){const c=i[s],f=c[0]==="[",m=l.has(c);f||m?(u.length>0&&(u.sort(),o.push(...u),u=[]),o.push(c)):u.push(c)}return u.length>0&&(u.sort(),o.push(...u)),o}},Tv=n=>({cache:xv(n.cacheSize),parseClassName:wv(n),sortModifiers:Cv(n),...hv(n)}),Av=/\s+/,kv=(n,l)=>{const{parseClassName:i,getClassGroupId:o,getConflictingClassGroupIds:u,sortModifiers:s}=l,c=[],f=n.trim().split(Av);let m="";for(let h=f.length-1;h>=0;h-=1){const g=f[h],{isExternal:y,modifiers:v,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:E}=i(g);if(y){m=g+(m.length>0?" "+m:m);continue}let T=!!E,_=o(T?w.substring(0,E):w);if(!_){if(!T){m=g+(m.length>0?" "+m:m);continue}if(_=o(w),!_){m=g+(m.length>0?" "+m:m);continue}T=!1}const A=v.length===0?"":v.length===1?v[0]:s(v).join(":"),k=b?A+As:A,q=k+_;if(c.indexOf(q)>-1)continue;c.push(q);const H=u(_,T);for(let M=0;M<H.length;++M){const I=H[M];c.push(k+I)}m=g+(m.length>0?" "+m:m)}return m},Nv=(...n)=>{let l=0,i,o,u="";for(;l<n.length;)(i=n[l++])&&(o=kd(i))&&(u&&(u+=" "),u+=o);return u},kd=n=>{if(typeof n=="string")return n;let l,i="";for(let o=0;o<n.length;o++)n[o]&&(l=kd(n[o]))&&(i&&(i+=" "),i+=l);return i},Rv=(n,...l)=>{let i,o,u,s;const c=m=>{const h=l.reduce((g,y)=>y(g),n());return i=Tv(h),o=i.cache.get,u=i.cache.set,s=f,f(m)},f=m=>{const h=o(m);if(h)return h;const g=kv(m,i);return u(m,g),g};return s=c,(...m)=>s(Nv(...m))},Ov=[],At=n=>{const l=i=>i[n]||Ov;return l.isThemeGetter=!0,l},Nd=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rd=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zv=/^\d+\/\d+$/,Mv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Lv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Iv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hi=n=>zv.test(n),Ve=n=>!!n&&!Number.isNaN(Number(n)),fr=n=>!!n&&Number.isInteger(Number(n)),ks=n=>n.endsWith("%")&&Ve(n.slice(0,-1)),Pn=n=>Mv.test(n),Bv=()=>!0,Uv=n=>Dv.test(n)&&!jv.test(n),Od=()=>!1,Hv=n=>Lv.test(n),qv=n=>Iv.test(n),Pv=n=>!Re(n)&&!Oe(n),Fv=n=>mi(n,Ld,Od),Re=n=>Nd.test(n),Ur=n=>mi(n,Id,Uv),Ns=n=>mi(n,Zv,Ve),zd=n=>mi(n,Dd,Od),Yv=n=>mi(n,jd,qv),Bl=n=>mi(n,Bd,Hv),Oe=n=>Rd.test(n),ca=n=>pi(n,Id),Vv=n=>pi(n,Kv),Md=n=>pi(n,Dd),Gv=n=>pi(n,Ld),Xv=n=>pi(n,jd),Ul=n=>pi(n,Bd,!0),mi=(n,l,i)=>{const o=Nd.exec(n);return o?o[1]?l(o[1]):i(o[2]):!1},pi=(n,l,i=!1)=>{const o=Rd.exec(n);return o?o[1]?l(o[1]):i:!1},Dd=n=>n==="position"||n==="percentage",jd=n=>n==="image"||n==="url",Ld=n=>n==="length"||n==="size"||n==="bg-size",Id=n=>n==="length",Zv=n=>n==="number",Kv=n=>n==="family-name",Bd=n=>n==="shadow",Qv=Rv(()=>{const n=At("color"),l=At("font"),i=At("text"),o=At("font-weight"),u=At("tracking"),s=At("leading"),c=At("breakpoint"),f=At("container"),m=At("spacing"),h=At("radius"),g=At("shadow"),y=At("inset-shadow"),v=At("text-shadow"),b=At("drop-shadow"),w=At("blur"),E=At("perspective"),T=At("aspect"),_=At("ease"),A=At("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],H=()=>[...q(),Oe,Re],M=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],Y=()=>[Oe,Re,m],F=()=>[hi,"full","auto",...Y()],$=()=>[fr,"none","subgrid",Oe,Re],ie=()=>["auto",{span:["full",fr,Oe,Re]},fr,Oe,Re],D=()=>[fr,"auto",Oe,Re],ne=()=>["auto","min","max","fr",Oe,Re],C=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...Y()],Q=()=>[hi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Y()],se=()=>[n,Oe,Re],de=()=>[...q(),Md,zd,{position:[Oe,Re]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",Gv,Fv,{size:[Oe,Re]}],B=()=>[ks,ca,Ur],z=()=>["","none","full",h,Oe,Re],re=()=>["",Ve,ca,Ur],ce=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Te=()=>[Ve,ks,Md,zd],ke=()=>["","none",w,Oe,Re],Ae=()=>["none",Ve,Oe,Re],He=()=>["none",Ve,Oe,Re],ve=()=>[Ve,Oe,Re],ze=()=>[hi,"full",...Y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pn],breakpoint:[Pn],color:[Bv],container:[Pn],"drop-shadow":[Pn],ease:["in","out","in-out"],font:[Pv],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pn],shadow:[Pn],spacing:["px",Ve],text:[Pn],"text-shadow":[Pn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",hi,Re,Oe,T]}],container:["container"],columns:[{columns:[Ve,Re,Oe,f]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:H()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[fr,"auto",Oe,Re]}],basis:[{basis:[hi,"full","auto",f,...Y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ve,hi,"auto","initial","none",Re]}],grow:[{grow:["",Ve,Oe,Re]}],shrink:[{shrink:["",Ve,Oe,Re]}],order:[{order:[fr,"first","last","none",Oe,Re]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:Y()}],"gap-x":[{"gap-x":Y()}],"gap-y":[{"gap-y":Y()}],"justify-content":[{justify:[...C(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...C()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":C()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:Y()}],px:[{px:Y()}],py:[{py:Y()}],ps:[{ps:Y()}],pe:[{pe:Y()}],pt:[{pt:Y()}],pr:[{pr:Y()}],pb:[{pb:Y()}],pl:[{pl:Y()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":Y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Y()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],w:[{w:[f,"screen",...Q()]}],"min-w":[{"min-w":[f,"screen","none",...Q()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",i,ca,Ur]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Oe,Ns]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ks,Re]}],"font-family":[{font:[Vv,Re,l]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[u,Oe,Re]}],"line-clamp":[{"line-clamp":[Ve,"none",Oe,Ns]}],leading:[{leading:[s,...Y()]}],"list-image":[{"list-image":["none",Oe,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oe,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:se()}],"text-color":[{text:se()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ve,"from-font","auto",Oe,Ur]}],"text-decoration-color":[{decoration:se()}],"underline-offset":[{"underline-offset":[Ve,"auto",Oe,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe,Re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Oe,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:de()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},fr,Oe,Re],radial:["",Oe,Re],conic:[fr,Oe,Re]},Xv,Yv]}],"bg-color":[{bg:se()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:se()}],"gradient-via":[{via:se()}],"gradient-to":[{to:se()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:se()}],"border-color-x":[{"border-x":se()}],"border-color-y":[{"border-y":se()}],"border-color-s":[{"border-s":se()}],"border-color-e":[{"border-e":se()}],"border-color-t":[{"border-t":se()}],"border-color-r":[{"border-r":se()}],"border-color-b":[{"border-b":se()}],"border-color-l":[{"border-l":se()}],"divide-color":[{divide:se()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ve,Oe,Re]}],"outline-w":[{outline:["",Ve,ca,Ur]}],"outline-color":[{outline:se()}],shadow:[{shadow:["","none",g,Ul,Bl]}],"shadow-color":[{shadow:se()}],"inset-shadow":[{"inset-shadow":["none",y,Ul,Bl]}],"inset-shadow-color":[{"inset-shadow":se()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:se()}],"ring-offset-w":[{"ring-offset":[Ve,Ur]}],"ring-offset-color":[{"ring-offset":se()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":se()}],"text-shadow":[{"text-shadow":["none",v,Ul,Bl]}],"text-shadow-color":[{"text-shadow":se()}],opacity:[{opacity:[Ve,Oe,Re]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ve]}],"mask-image-linear-from-pos":[{"mask-linear-from":Te()}],"mask-image-linear-to-pos":[{"mask-linear-to":Te()}],"mask-image-linear-from-color":[{"mask-linear-from":se()}],"mask-image-linear-to-color":[{"mask-linear-to":se()}],"mask-image-t-from-pos":[{"mask-t-from":Te()}],"mask-image-t-to-pos":[{"mask-t-to":Te()}],"mask-image-t-from-color":[{"mask-t-from":se()}],"mask-image-t-to-color":[{"mask-t-to":se()}],"mask-image-r-from-pos":[{"mask-r-from":Te()}],"mask-image-r-to-pos":[{"mask-r-to":Te()}],"mask-image-r-from-color":[{"mask-r-from":se()}],"mask-image-r-to-color":[{"mask-r-to":se()}],"mask-image-b-from-pos":[{"mask-b-from":Te()}],"mask-image-b-to-pos":[{"mask-b-to":Te()}],"mask-image-b-from-color":[{"mask-b-from":se()}],"mask-image-b-to-color":[{"mask-b-to":se()}],"mask-image-l-from-pos":[{"mask-l-from":Te()}],"mask-image-l-to-pos":[{"mask-l-to":Te()}],"mask-image-l-from-color":[{"mask-l-from":se()}],"mask-image-l-to-color":[{"mask-l-to":se()}],"mask-image-x-from-pos":[{"mask-x-from":Te()}],"mask-image-x-to-pos":[{"mask-x-to":Te()}],"mask-image-x-from-color":[{"mask-x-from":se()}],"mask-image-x-to-color":[{"mask-x-to":se()}],"mask-image-y-from-pos":[{"mask-y-from":Te()}],"mask-image-y-to-pos":[{"mask-y-to":Te()}],"mask-image-y-from-color":[{"mask-y-from":se()}],"mask-image-y-to-color":[{"mask-y-to":se()}],"mask-image-radial":[{"mask-radial":[Oe,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":Te()}],"mask-image-radial-to-pos":[{"mask-radial-to":Te()}],"mask-image-radial-from-color":[{"mask-radial-from":se()}],"mask-image-radial-to-color":[{"mask-radial-to":se()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":q()}],"mask-image-conic-pos":[{"mask-conic":[Ve]}],"mask-image-conic-from-pos":[{"mask-conic-from":Te()}],"mask-image-conic-to-pos":[{"mask-conic-to":Te()}],"mask-image-conic-from-color":[{"mask-conic-from":se()}],"mask-image-conic-to-color":[{"mask-conic-to":se()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:de()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oe,Re]}],filter:[{filter:["","none",Oe,Re]}],blur:[{blur:ke()}],brightness:[{brightness:[Ve,Oe,Re]}],contrast:[{contrast:[Ve,Oe,Re]}],"drop-shadow":[{"drop-shadow":["","none",b,Ul,Bl]}],"drop-shadow-color":[{"drop-shadow":se()}],grayscale:[{grayscale:["",Ve,Oe,Re]}],"hue-rotate":[{"hue-rotate":[Ve,Oe,Re]}],invert:[{invert:["",Ve,Oe,Re]}],saturate:[{saturate:[Ve,Oe,Re]}],sepia:[{sepia:["",Ve,Oe,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",Oe,Re]}],"backdrop-blur":[{"backdrop-blur":ke()}],"backdrop-brightness":[{"backdrop-brightness":[Ve,Oe,Re]}],"backdrop-contrast":[{"backdrop-contrast":[Ve,Oe,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ve,Oe,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ve,Oe,Re]}],"backdrop-invert":[{"backdrop-invert":["",Ve,Oe,Re]}],"backdrop-opacity":[{"backdrop-opacity":[Ve,Oe,Re]}],"backdrop-saturate":[{"backdrop-saturate":[Ve,Oe,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",Ve,Oe,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Y()}],"border-spacing-x":[{"border-spacing-x":Y()}],"border-spacing-y":[{"border-spacing-y":Y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Oe,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ve,"initial",Oe,Re]}],ease:[{ease:["linear","initial",_,Oe,Re]}],delay:[{delay:[Ve,Oe,Re]}],animate:[{animate:["none",A,Oe,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,Oe,Re]}],"perspective-origin":[{"perspective-origin":H()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:He()}],"scale-x":[{"scale-x":He()}],"scale-y":[{"scale-y":He()}],"scale-z":[{"scale-z":He()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[Oe,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:H()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],accent:[{accent:se()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:se()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Oe,Re]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Oe,Re]}],fill:[{fill:["none",...se()]}],"stroke-w":[{stroke:[Ve,ca,Ur,Ns]}],stroke:[{stroke:["none",...se()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ye(...n){return Qv(Ed(n))}function fa(n){if(!n&&n!==0)return"";const l=n instanceof Date?n:new Date(typeof n=="number"?n:Number(n)||n);return Number.isNaN(l.getTime())?"":l.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}const Jv=n=>new Promise(l=>setTimeout(l,n)),Ud=P.forwardRef(({className:n,children:l,...i},o)=>O.jsxs(vd,{ref:o,className:Ye("relative overflow-hidden",n),...i,children:[O.jsx(sv,{className:"h-full w-full rounded-[inherit]",children:l}),O.jsx(Hd,{}),O.jsx(uv,{})]}));Ud.displayName=vd.displayName;const Hd=P.forwardRef(({className:n,orientation:l="vertical",...i},o)=>O.jsx(_s,{ref:o,orientation:l,className:Ye("flex touch-none select-none transition-colors",l==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",l==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...i,children:O.jsx(hd,{className:"relative flex-1 rounded-full bg-border"})}));Hd.displayName=_s.displayName;var Wv=Symbol.for("react.lazy"),Hl=Qf[" use ".trim().toString()];function $v(n){return typeof n=="object"&&n!==null&&"then"in n}function qd(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===Wv&&"_payload"in n&&$v(n._payload)}function Pd(n){const l=tS(n),i=P.forwardRef((o,u)=>{let{children:s,...c}=o;qd(s)&&typeof Hl=="function"&&(s=Hl(s._payload));const f=P.Children.toArray(s),m=f.find(rS);if(m){const h=m.props.children,g=f.map(y=>y===m?P.Children.count(h)>1?P.Children.only(null):P.isValidElement(h)?h.props.children:null:y);return O.jsx(l,{...c,ref:u,children:P.isValidElement(h)?P.cloneElement(h,void 0,g):null})}return O.jsx(l,{...c,ref:u,children:s})});return i.displayName=`${n}.Slot`,i}var eS=Pd("Slot");function tS(n){const l=P.forwardRef((i,o)=>{let{children:u,...s}=i;if(qd(u)&&typeof Hl=="function"&&(u=Hl(u._payload)),P.isValidElement(u)){const c=aS(u),f=iS(s,u.props);return u.type!==P.Fragment&&(f.ref=o?Es(o,c):c),P.cloneElement(u,f)}return P.Children.count(u)>1?P.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var nS=Symbol("radix.slottable");function rS(n){return P.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===nS}function iS(n,l){const i={...l};for(const o in l){const u=n[o],s=l[o];/^on[A-Z]/.test(o)?u&&s?i[o]=(...f)=>{const m=s(...f);return u(...f),m}:u&&(i[o]=u):o==="style"?i[o]={...u,...s}:o==="className"&&(i[o]=[u,s].filter(Boolean).join(" "))}return{...n,...i}}function aS(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,i=l&&"isReactWarning"in l&&l.isReactWarning;return i?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,i=l&&"isReactWarning"in l&&l.isReactWarning,i?n.props.ref:n.props.ref||n.ref)}const Fd=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Yd=Ed,lS=((n,l)=>i=>{var o;if(l?.variants==null)return Yd(n,i?.class,i?.className);const{variants:u,defaultVariants:s}=l,c=Object.keys(u).map(h=>{const g=i?.[h],y=s?.[h];if(g===null)return null;const v=Fd(g)||Fd(y);return u[h][v]}),f=i&&Object.entries(i).reduce((h,g)=>{let[y,v]=g;return v===void 0||(h[y]=v),h},{}),m=l==null||(o=l.compoundVariants)===null||o===void 0?void 0:o.reduce((h,g)=>{let{class:y,className:v,...b}=g;return Object.entries(b).every(w=>{let[E,T]=w;return Array.isArray(T)?T.includes({...s,...f}[E]):{...s,...f}[E]===T})?[...h,y,v]:h},[]);return Yd(n,c,m,i?.class,i?.className)})("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),kt=P.forwardRef(({className:n,variant:l,size:i,asChild:o=!1,...u},s)=>{const c=o?eS:"button";return O.jsx(c,{className:Ye(lS({variant:l,size:i,className:n})),ref:s,...u})});kt.displayName="Button";const oS=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sS=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,i,o)=>o?o.toUpperCase():i.toLowerCase()),Vd=n=>{const l=sS(n);return l.charAt(0).toUpperCase()+l.slice(1)},Gd=(...n)=>n.filter((l,i,o)=>!!l&&l.trim()!==""&&o.indexOf(l)===i).join(" ").trim(),uS=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0};var cS={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"};const fS=P.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:u="",children:s,iconNode:c,...f},m)=>P.createElement("svg",{ref:m,...cS,width:l,height:l,stroke:n,strokeWidth:o?Number(i)*24/Number(l):i,className:Gd("lucide",u),...!s&&!uS(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,g])=>P.createElement(h,g)),...Array.isArray(s)?s:[s]]));const Rt=(n,l)=>{const i=P.forwardRef(({className:o,...u},s)=>P.createElement(fS,{ref:s,iconNode:l,className:Gd(`lucide-${oS(Vd(n))}`,`lucide-${n}`,o),...u}));return i.displayName=Vd(n),i};const dS=Rt("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Xd=Rt("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const Zd=Rt("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]]);const hS=Rt("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const Kd=Rt("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Rs=Rt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const mS=Rt("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const pS=Rt("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const gS=Rt("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const yS=Rt("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const bS=Rt("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);const Qd=Rt("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const vS=Rt("message-square-plus",[["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"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]);const SS=Rt("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);const ES=Rt("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);const xS=Rt("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"}]]);const _S=Rt("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const Os=Rt("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),da=P.forwardRef(({className:n,...l},i)=>O.jsx("div",{ref:i,className:Ye("rounded-xl border bg-card text-card-foreground shadow",n),...l}));da.displayName="Card";const Jd=P.forwardRef(({className:n,...l},i)=>O.jsx("div",{ref:i,className:Ye("flex flex-col space-y-1.5 p-6",n),...l}));Jd.displayName="CardHeader";const wS=P.forwardRef(({className:n,...l},i)=>O.jsx("div",{ref:i,className:Ye("font-semibold leading-none tracking-tight",n),...l}));wS.displayName="CardTitle";const CS=P.forwardRef(({className:n,...l},i)=>O.jsx("div",{ref:i,className:Ye("text-sm text-muted-foreground",n),...l}));CS.displayName="CardDescription";const Wd=P.forwardRef(({className:n,...l},i)=>O.jsx("div",{ref:i,className:Ye("p-6 pt-0",n),...l}));Wd.displayName="CardContent";const TS=P.forwardRef(({className:n,...l},i)=>O.jsx("div",{ref:i,className:Ye("flex items-center p-6 pt-0",n),...l}));TS.displayName="CardFooter";function AS(n,l=[]){let i=[];function o(s,c){const f=P.createContext(c);f.displayName=s+"Context";const m=i.length;i=[...i,c];const h=y=>{const{scope:v,children:b,...w}=y,E=v?.[n]?.[m]||f,T=P.useMemo(()=>w,Object.values(w));return O.jsx(E.Provider,{value:T,children:b})};h.displayName=s+"Provider";function g(y,v){const b=v?.[n]?.[m]||f,w=P.useContext(b);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${y}\` must be used within \`${s}\``)}return[h,g]}const u=()=>{const s=i.map(c=>P.createContext(c));return function(f){const m=f?.[n]||s;return P.useMemo(()=>({[`__scope${n}`]:{...f,[n]:m}}),[f,m])}};return u.scopeName=n,[o,kS(u,...l)]}function kS(...n){const l=n[0];if(n.length===1)return l;const i=()=>{const o=n.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(s){const c=o.reduce((f,{useScope:m,scopeName:h})=>{const y=m(s)[`__scope${h}`];return{...f,...y}},{});return P.useMemo(()=>({[`__scope${l.scopeName}`]:c}),[c])}};return i.scopeName=l.scopeName,i}var NS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zs=NS.reduce((n,l)=>{const i=Pd(`Primitive.${l}`),o=P.forwardRef((u,s)=>{const{asChild:c,...f}=u,m=c?i:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(m,{...f,ref:s})});return o.displayName=`Primitive.${l}`,{...n,[l]:o}},{}),Ms={exports:{}},Ds={};var $d;function RS(){if($d)return Ds;$d=1;var n=Ol();function l(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var i=typeof Object.is=="function"?Object.is:l,o=n.useState,u=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function f(y,v){var b=v(),w=o({inst:{value:b,getSnapshot:v}}),E=w[0].inst,T=w[1];return s(function(){E.value=b,E.getSnapshot=v,m(E)&&T({inst:E})},[y,b,v]),u(function(){return m(E)&&T({inst:E}),y(function(){m(E)&&T({inst:E})})},[y]),c(b),b}function m(y){var v=y.getSnapshot;y=y.value;try{var b=v();return!i(y,b)}catch{return!0}}function h(y,v){return v()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return Ds.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:g,Ds}var eh;function OS(){return eh||(eh=1,Ms.exports=RS()),Ms.exports}var zS=OS();function MS(){return zS.useSyncExternalStore(DS,()=>!0,()=>!1)}function DS(){return()=>{}}var js="Avatar",[jS]=AS(js),[LS,th]=jS(js),nh=P.forwardRef((n,l)=>{const{__scopeAvatar:i,...o}=n,[u,s]=P.useState("idle");return O.jsx(LS,{scope:i,imageLoadingStatus:u,onImageLoadingStatusChange:s,children:O.jsx(zs.span,{...o,ref:l})})});nh.displayName=js;var rh="AvatarImage",ih=P.forwardRef((n,l)=>{const{__scopeAvatar:i,src:o,onLoadingStatusChange:u=()=>{},...s}=n,c=th(rh,i),f=IS(o,s),m=cr(h=>{u(h),c.onImageLoadingStatusChange(h)});return ur(()=>{f!=="idle"&&m(f)},[f,m]),f==="loaded"?O.jsx(zs.img,{...s,ref:l,src:o}):null});ih.displayName=rh;var ah="AvatarFallback",lh=P.forwardRef((n,l)=>{const{__scopeAvatar:i,delayMs:o,...u}=n,s=th(ah,i),[c,f]=P.useState(o===void 0);return P.useEffect(()=>{if(o!==void 0){const m=window.setTimeout(()=>f(!0),o);return()=>window.clearTimeout(m)}},[o]),c&&s.imageLoadingStatus!=="loaded"?O.jsx(zs.span,{...u,ref:l}):null});lh.displayName=ah;function oh(n,l){return n?l?(n.src!==l&&(n.src=l),n.complete&&n.naturalWidth>0?"loaded":"loading"):"error":"idle"}function IS(n,{referrerPolicy:l,crossOrigin:i}){const o=MS(),u=P.useRef(null),s=o?(u.current||(u.current=new window.Image),u.current):null,[c,f]=P.useState(()=>oh(s,n));return ur(()=>{f(oh(s,n))},[s,n]),ur(()=>{const m=y=>()=>{f(y)};if(!s)return;const h=m("loaded"),g=m("error");return s.addEventListener("load",h),s.addEventListener("error",g),l&&(s.referrerPolicy=l),typeof i=="string"&&(s.crossOrigin=i),()=>{s.removeEventListener("load",h),s.removeEventListener("error",g)}},[s,i,l]),c}var sh=nh,uh=ih,ch=lh;const ha=P.forwardRef(({className:n,...l},i)=>O.jsx(sh,{ref:i,className:Ye("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",n),...l}));ha.displayName=sh.displayName;const fh=P.forwardRef(({className:n,...l},i)=>O.jsx(uh,{ref:i,className:Ye("aspect-square h-full w-full",n),...l}));fh.displayName=uh.displayName;const ma=P.forwardRef(({className:n,...l},i)=>O.jsx(ch,{ref:i,className:Ye("flex h-full w-full items-center justify-center rounded-full bg-muted",n),...l}));ma.displayName=ch.displayName;var Hr={},pa={},Ls={},ga={},ya={},ba={},dh;function BS(){if(dh)return ba;dh=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.EventEmitter=void 0;let n=class{eventListeners=new Map;on(i,o){const u=this.eventListeners.get(i)||new Set;u.add(o),this.eventListeners.set(i,u)}off(i,o){const u=this.eventListeners.get(i);u&&(u.delete(o),u.size===0&&this.eventListeners.delete(i))}emit(i,...o){const u=this.eventListeners.get(i);u&&u.forEach(s=>s(...o))}};return ba.EventEmitter=n,ba}var qr={},hh;function Is(){return hh||(hh=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.DisconnectionReason=qr.ConnectionStatus=void 0,qr.ConnectionStatus={CONNECTING:"connecting",CONNECTED:"connected",NOT_CONNECTED:"not_connected"},qr.DisconnectionReason={CLIENT_CLOSED:"client_closed",SERVER_CLOSED:"server_closed",CONNECTION_ERROR:"connection_error",AUTHENTICATION_ERROR:"authentication_error",MAX_RECONNECT_ATTEMPTS:"max_reconnect_attempts",TIMEOUT:"timeout",NETWORK_ERROR:"network_error"}),qr}var mh;function ph(){if(mh)return ya;mh=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.BaseConnection=void 0;const n=BS(),l=Is();let i=class{status=l.ConnectionStatus.CONNECTING;queue=[];eventEmitter=new n.EventEmitter;disconnectionDetails=null;onErrorCallback=null;onDisconnectCallback=null;onMessageCallback=null;onOpenCallback=null;onStatusChangeCallback=null;getStatus(){return this.status}onOpen(u){this.onOpenCallback=u}onMessage(u){if(this.onMessageCallback=u,this.queue.length>0){const s=[...this.queue];this.queue.length=0,queueMicrotask(()=>{s.forEach(c=>{this.onMessageCallback?.(c)})})}}onDisconnect(u){this.onDisconnectCallback=u;const s=this.disconnectionDetails;s&&queueMicrotask(()=>{this.onDisconnectCallback?.(s)})}onError(u){this.onErrorCallback=u}on(u,s){this.eventEmitter.on(u,s)}off(u,s){this.eventEmitter.off(u,s)}emit(u,...s){this.eventEmitter.emit(u,...s)}onStatusChange(u){this.onStatusChangeCallback=u,queueMicrotask(()=>{u(this.status)})}disconnect(u){this.disconnectionDetails||(this.disconnectionDetails=u,this.updateStatus(l.ConnectionStatus.NOT_CONNECTED),this.onDisconnectCallback?.(u))}handleMessage(u){this.onMessageCallback?this.onMessageCallback(u):this.queue.push(u)}updateStatus(u){this.status!==u&&(this.status=u,this.onStatusChangeCallback?.(u))}};return ya.BaseConnection=i,ya}var Bs={},gh;function Rn(){return gh||(gh=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ValidationError=n.ConfigurationError=n.StoreError=n.MessageError=n.SessionError=n.FileError=n.RecordingError=n.ConnectionError=n.InternalServerError=n.RateLimitError=n.MethodNotAllowedError=n.NotFoundError=n.PermissionDeniedError=n.UnauthorizedError=n.BadRequestError=n.APIConnectionTimeoutError=n.APIUserAbortError=n.APIError=n.SynapseError=n.SynapseErrorCode=void 0,n.normalizeError=q,n.SynapseErrorCode={API:"API_ERROR",CONNECTION:"CONNECTION_ERROR",RECORDING:"RECORDING_ERROR",FILE:"FILE_ERROR",SESSION:"SESSION_ERROR",MESSAGE:"MESSAGE_ERROR",STORE:"STORE_ERROR",CONFIGURATION:"CONFIGURATION_ERROR",VALIDATION:"VALIDATION_ERROR",AUTH:"AUTH_ERROR",UNKNOWN:"UNKNOWN_ERROR"};class l extends Error{code;timestamp;cause;context;hint;displayMessage;constructor(M,I=n.SynapseErrorCode.UNKNOWN,Y={}){super(M),this.name="SynapseError",this.code=I,this.timestamp=new Date,this.cause=Y.cause,this.context=Y.context,this.hint=Y.hint,this.displayMessage=Y.displayMessage||Y?.hint||M,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}n.SynapseError=l;class i extends l{status;error;headers;constructor(M,I,Y,F){const $=i.makeMessage(I,Y,M);super($,n.SynapseErrorCode.API,{cause:Y,context:{status:I,hasBody:!!Y},hint:I&&I>=500?"Retry the request or contact support if the issue persists.":void 0,displayMessage:M||"Something went wrong"}),this.name="APIError",this.status=I,this.error=Y,this.headers=F}static makeMessage(M,I,Y){const F=I instanceof Error?I.message:Y;return M&&F?`HTTP ${M}: ${F}`:M?`${M} status code (no body)`:F||"(no status code or body)"}static generate(M,I,Y,F){if(!M)return new o({message:Y});const $=I?.error,ie=$&&typeof $=="object"&&!Array.isArray($)?$:void 0;switch(M){case 400:return new s(Y||"Bad Request",M,ie,F);case 401:return new c(Y||"Unauthorized",M,ie,F);case 403:return new f(Y||"Permission Denied",M,ie,F);case 404:return new m(Y||"Not Found",M,ie,F);case 405:return new h(Y||"Method Not Allowed",M,ie,F);case 429:return new g(Y||"Rate Limit Exceeded",M,ie,F);case 500:return new y(Y||"Internal Server Error",M,ie,F);default:return new i(Y||"API Error",M,ie,F)}}}n.APIError=i;class o extends i{constructor({message:M}={}){super(M||"Request was aborted.",void 0,void 0,void 0),this.name="APIUserAbortError"}}n.APIUserAbortError=o;class u extends i{constructor({message:M}={}){super(M||"Request timed out.",void 0,void 0,void 0),this.name="APIConnectionTimeoutError"}}n.APIConnectionTimeoutError=u;class s extends i{constructor(M,I,Y,F){super(M,I,Y,F),this.name="BadRequestError"}}n.BadRequestError=s;class c extends i{constructor(M,I,Y,F){super(M,I,Y,F),this.name="UnauthorizedError"}}n.UnauthorizedError=c;class f extends i{constructor(M,I,Y,F){super(M,I,Y,F),this.name="PermissionDeniedError"}}n.PermissionDeniedError=f;class m extends i{constructor(M,I,Y,F){super(M,I,Y,F),this.name="NotFoundError"}}n.NotFoundError=m;class h extends i{constructor(M,I,Y,F){super(M,I,Y,F),this.name="MethodNotAllowedError"}}n.MethodNotAllowedError=h;class g extends i{constructor(M,I,Y,F){super(M,I,Y,F),this.name="RateLimitError"}}n.RateLimitError=g;class y extends i{constructor(M,I,Y,F){super(M,I,Y,F),this.name="InternalServerError"}}n.InternalServerError=y;class v extends l{constructor(M,I={}){super(M,n.SynapseErrorCode.CONNECTION,I),this.name="ConnectionError"}}n.ConnectionError=v;class b extends l{constructor(M,I={}){super(M,n.SynapseErrorCode.RECORDING,I),this.name="RecordingError"}}n.RecordingError=b;class w extends l{constructor(M,I={}){super(M,n.SynapseErrorCode.FILE,I),this.name="FileError"}}n.FileError=w;class E extends l{constructor(M,I={}){super(M,n.SynapseErrorCode.SESSION,I),this.name="SessionError"}}n.SessionError=E;class T extends l{constructor(M,I={}){super(M,n.SynapseErrorCode.MESSAGE,I),this.name="MessageError"}}n.MessageError=T;class _ extends l{constructor(M,I={}){super(M,n.SynapseErrorCode.STORE,I),this.name="StoreError"}}n.StoreError=_;class A extends l{constructor(M,I={}){super(M,n.SynapseErrorCode.CONFIGURATION,I),this.name="ConfigurationError"}}n.ConfigurationError=A;class k extends l{constructor(M,I={}){super(M,n.SynapseErrorCode.VALIDATION,I),this.name="ValidationError"}}n.ValidationError=k;function q(H,M,I,Y={}){if(H instanceof M)return H;const F={...Y,context:{...H instanceof l?H.context:void 0,...Y.context},hint:Y.hint??(H instanceof l?H.hint:void 0),cause:Y.cause??H};if(H instanceof l)return new M(H.message,F);const $=H instanceof Error&&H.message?H.message:I;return new M($,F)}})(Bs)),Bs}var yh;function bh(){if(yh)return ga;yh=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.WebSocketConnection=void 0;const n=ph(),l=Is(),i=Rn();class o extends n.BaseConnection{conversationId;socket=null;config;reconnectCount=0;constructor(s){super(),this.config={...s,reconnect:s.reconnect||!0,reconnectAttempts:s.reconnectAttempts||3,reconnectDelay:s.reconnectDelay||1e3},this.conversationId=s.auth.sessionId,this.connect()}connect(){try{this.updateStatus(l.ConnectionStatus.CONNECTING);const s=this.buildConnectionUrl();this.socket=new WebSocket(s),this.socket.onopen=this.handleOpen.bind(this),this.socket.onmessage=this.handleSocketMessage.bind(this),this.socket.onerror=this.handleError.bind(this),this.socket.onclose=this.handleClose.bind(this)}catch(s){const c=(0,i.normalizeError)(s,i.ConnectionError,"Failed to establish WebSocket connection",{context:{stage:"connect"}});this.onErrorCallback?.(c),this.disconnect({reason:l.DisconnectionReason.CONNECTION_ERROR,message:c.message,timestamp:new Date})}}buildConnectionUrl(){const s=new URL(this.config.serverUrl);return s.pathname=`/reloaded/ws/med-assist/session/${this.config.auth.sessionId}/`,s.toString()}handleOpen(){this.onOpenCallback?.()}handleSocketMessage(s){try{const c=JSON.parse(s.data);this.handleMessage(c)}catch(c){const f=(0,i.normalizeError)(c,i.MessageError,"Failed to parse incoming WebSocket message",{context:{stage:"handleSocketMessage"}});this.onErrorCallback?.(f)}}handleError(s){const c=new i.ConnectionError("WebSocket error",{context:{stage:"handleError"},cause:s});this.onErrorCallback?.(c)}handleClose(s){const c=s.wasClean,f=s.code,m=s.reason;let h,g;f===1e3?(h=l.DisconnectionReason.CLIENT_CLOSED,g="Connection closed normally"):f===1001||f===1006?(h=l.DisconnectionReason.NETWORK_ERROR,g="Network connection lost"):f===4001?(h=l.DisconnectionReason.AUTHENTICATION_ERROR,g="Authentication failed"):c?(h=l.DisconnectionReason.SERVER_CLOSED,g=m||"Server closed connection"):(h=l.DisconnectionReason.CONNECTION_ERROR,g=m||"Connection closed unexpectedly"),this.config.reconnect&&h!==l.DisconnectionReason.AUTHENTICATION_ERROR&&h!==l.DisconnectionReason.CLIENT_CLOSED&&this.reconnectCount<(this.config.reconnectAttempts||3)?(this.reconnectCount++,setTimeout(()=>{this.connect()},this.config.reconnectDelay||1e3)):this.disconnect({reason:h,message:g,code:f,timestamp:new Date})}sendMessage(s){if(!this.socket||this.socket.readyState!==WebSocket.OPEN)throw new i.ConnectionError("Cannot send message: connection not open",{context:{stage:"sendMessage",readyState:this.socket?.readyState},hint:"Ensure the WebSocket is open before sending messages."});try{this.socket.send(JSON.stringify(s))}catch(c){const f=(0,i.normalizeError)(c,i.ConnectionError,"Failed to send WebSocket message",{context:{stage:"sendMessage"}});throw this.onErrorCallback?.(f),f}}close(){this.socket&&(this.updateStatus(l.ConnectionStatus.NOT_CONNECTED),this.socket.close(1e3,"Client closed connection"),this.socket=null)}isConnected(){return this.socket?.readyState===WebSocket.OPEN}handleConnected(){this.updateStatus(l.ConnectionStatus.CONNECTED),this.reconnectCount=0}}return ga.WebSocketConnection=o,ga}var vh;function Sh(){return vh||(vh=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ConnectionFactory=n.ConnectionType=void 0;const l=bh(),i=Rn();n.ConnectionType={SOCKET:"socket"};class o{static async createConnection(s,c){switch(s){case n.ConnectionType.SOCKET:return new l.WebSocketConnection(c);default:throw new i.ConnectionError(`Unsupported connection type: ${s}`,{context:{type:s}})}}}n.ConnectionFactory=o})(Ls)),Ls}var Pr={},Eh;function US(){if(Eh)return Pr;Eh=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.SYNAPSE_TOOL_NAME=Pr.getConfig=void 0;const n={WEBSOCKET_URL:"wss://matrix-ws.eka.care/reloaded",BASE_API_URL:"https://matrix.eka.care/reloaded"},l={WEBSOCKET_URL:"wss://matrix-ws.dev.eka.care/reloaded",BASE_API_URL:"https://matrix.dev.eka.care/reloaded"},i={WEBSOCKET_URL:"wss://matrix-ws.dev.eka.care",BASE_API_URL:"https://matrix.dev.eka.care"},o=(s="production")=>s==="development"?l:s==="production"?n:s==="staging"?i:n;Pr.getConfig=o;var u;return(function(s){s.MOBILE_VERIFICATION="mobile_verification",s.AVAILABILITY_DATES="availability_dates",s.AVAILABILITY_SLOTS="availability_slots",s.DOCTOR_DETAILS="doctor_details",s.GET_LOCATION="get_location"})(u||(Pr.SYNAPSE_TOOL_NAME=u={})),Pr}var va={},Sa={},xh;function _h(){if(xh)return Sa;xh=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.HttpClient=void 0;const n=Rn();let l=class{baseUrl;headers;timeout;maxRetries;constructor(o){this.baseUrl=o.baseUrl.replace(/\/$/,""),this.timeout=o.timeout||3e4,this.maxRetries=o.maxRetries||3,this.headers={"Content-Type":"application/json",...o.headers},o.authorization&&(this.headers.Authorization=o.authorization)}async request(o,u,s){const c=s?.retries??this.maxRetries;let f;for(let m=0;m<=c;m++)try{const h=this.buildUrl(u,s?.params),g=await fetch(h,{method:o,headers:{...this.headers,...s?.headers},body:s?.body?JSON.stringify(s.body):void 0,signal:AbortSignal.timeout(this.timeout)});return g.ok||await this.handleError(g),g.json()}catch(h){if(f=h,m===c||!(h instanceof TypeError&&h.message==="Failed to fetch"||h instanceof DOMException&&h.name==="AbortError"||h instanceof SyntaxError))break;const y=Math.pow(2,m)*100;await new Promise(v=>setTimeout(v,y))}throw f?f instanceof TypeError&&f.message==="Failed to fetch"?new n.APIError("Network error: Unable to connect to the server. Please check your internet connection.",0,{type:"NETWORK_ERROR",originalError:f.message}):f instanceof DOMException&&f.name==="AbortError"?new n.APIConnectionTimeoutError({message:`Request timed out after ${this.timeout}ms`}):f instanceof SyntaxError?new n.APIError("Invalid response format from server",502,{type:"PARSE_ERROR",originalError:f.message}):f instanceof n.APIError?f:new n.APIError(`Request failed: ${f.message||"Unknown error"}`,500,{type:"UNKNOWN_ERROR",originalError:f}):new n.APIError("Unknown error occurred",500,{type:"UNKNOWN_ERROR"})}async get(o,u,s){return this.request("GET",o,{params:u,...s})}async post(o,u,s){return this.request("POST",o,{body:u,...s})}async put(o,u,s){return this.request("PUT",o,{body:u,...s})}async delete(o,u){return this.request("DELETE",o,{...u})}async patch(o,u,s){return this.request("PATCH",o,{body:u,...s})}buildUrl(o,u){let s=`${this.baseUrl}${o}`;if(u){const c=new URLSearchParams(u).toString();s+=`?${c}`}return s}async handleError(o){let u,s;try{s=await o.json(),u=s.message||s?.msg||o.statusText}catch{u=o.statusText}throw n.APIError.generate(o.status,s,u,o.headers)}};return Sa.HttpClient=l,Sa}var Ea={},xa={},wh;function Ch(){if(wh)return xa;wh=1,Object.defineProperty(xa,"__esModule",{value:!0}),xa.BaseResource=void 0;let n=class{client;constructor(i){this.client=i}async get(i,o,u){return this.client.get(i,o,u)}async post(i,o,u){return this.client.post(i,o,u)}async put(i,o,u){return this.client.put(i,o,u)}async delete(i,o){return this.client.delete(i,o)}async patch(i,o,u){return this.client.patch(i,o,u)}buildPath(i,o){let u=i;for(const[s,c]of Object.entries(o))u=u.replace(`:${s}`,encodeURIComponent(c));return u}};return xa.BaseResource=n,xa}var Th;function Ah(){if(Th)return Ea;Th=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.Session=void 0;const n=Ch();let l=class extends n.BaseResource{basePath="/med-assist/session";async create(o){return this.post(this.basePath,{user_id:o})}async retrieve(o){return this.get(`${this.basePath}/${o}`)}async refresh(o,u){return this.get(`${this.basePath}/${o}/refresh`,void 0,{headers:{"x-sess-token":u}})}async feedback(o,u,s,c){return this.patch(`${this.basePath}/${o}/${u}`,{feedback:s,feedback_reason:c})}};return Ea.Session=l,Ea}var _a={},Fn={},kh;function Nh(){if(kh)return Fn;kh=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.SYNAPSE_TOOL_CALLBACK_NAME=Fn.SYNAPSE_COMPONENTS=Fn.SYNAPSE_TOOL_NAME=void 0;var n;(function(i){i.MOBILE_VERIFICATION="mobile_verification",i.AVAILABILITY_DATES="availability_dates",i.AVAILABILITY_SLOTS="availability_slots",i.DOCTOR_DETAILS="doctor_details",i.GET_LOCATION="get_location"})(n||(Fn.SYNAPSE_TOOL_NAME=n={})),Fn.SYNAPSE_COMPONENTS={MOBILE_VERIFICATION:"mobile_verification",PILL:"pills",MULTI:"multi",DOCTOR_CARD:"doctor_card"};var l;return(function(i){i.AVAILABILITY_DATES="tool_callback_availability_dates",i.AVAILABILITY_SLOTS="tool_callback_availability_slots",i.MOBILE_VERIFICATION="tool_callback_mobile_verification",i.DOCTOR_DETAILS="tool_callback_doctor_details"})(l||(Fn.SYNAPSE_TOOL_CALLBACK_NAME=l={})),Fn}var Rh;function Oh(){if(Rh)return _a;Rh=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.ToolCall=void 0;const n=Ch(),l=Nh();let i=class extends n.BaseResource{basePath="/med-assist/api-call-tool";async callTool(u,s,c){return s===l.SYNAPSE_TOOL_NAME.GET_LOCATION?this.requestLocation():this.post(`${this.basePath}?session_id=${u}&tool_name=${s}`,{tool_params:c})}async requestLocation(){return new Promise((u,s)=>{if(typeof navigator>"u"||!navigator.geolocation){s({code:500,message:"Geolocation is not supported by this browser",status:500,type:"GEOLOCATION_ERROR",originalError:new Error("Geolocation is not supported by this browser")});return}navigator.geolocation.getCurrentPosition(c=>{u({latitude:c.coords.latitude,longitude:c.coords.longitude,accuracy:c.coords?.accuracy??void 0})},c=>{s({code:c.code,message:c.message,status:500,type:"GEOLOCATION_ERROR",originalError:c})},{timeout:1e4,maximumAge:0,enableHighAccuracy:!0})})}};return _a.ToolCall=i,_a}var zh;function Mh(){if(zh)return va;zh=1,Object.defineProperty(va,"__esModule",{value:!0}),va.ResourceManager=void 0;const n=_h(),l=Ah(),i=Rn(),o=Oh();class u{resourceConfig;httpClient;session;toolCall=null;constructor(c){this.resourceConfig=c,this.httpClient=new n.HttpClient({baseUrl:this.resourceConfig.serverUrl,headers:{"X-agent-id":this.resourceConfig.agentId}}),this.session=new l.Session(this.httpClient)}async createSession(c){try{const f=await this.session.create(c);if(!f?.session_id||!f?.session_token)throw new i.APIError("Failed to start session.",500,void 0,void 0);return f}catch(f){throw f instanceof i.APIError?f:new i.APIError("Failed to start session.",500,void 0,void 0)}}async validateSession(c){try{const f=await this.session.retrieve(c);return f.msg&&f.msg==="Session Active"?{expired:!1,active:!0}:{expired:!0,active:!1}}catch(f){if(f instanceof i.APIError)switch(f.status){case 404:return{expired:!1,active:!1};case 500:return{expired:!1,active:!1};case 401:return{expired:!0,active:!1};default:return{expired:!1,active:!1}}throw new i.APIError("Failed to validate session.",500,void 0,void 0)}}async refreshSession(c,f){return await this.session.refresh(c,f)}async sendFeedback(c,f,m,h){return await this.session.feedback(c,f,m,h)}async callTool(c,f,m){return this.toolCall||(this.toolCall=new o.ToolCall(this.httpClient)),await this.toolCall.callTool(c,f,m)}}return va.ResourceManager=u,va}var wa={},Us={},Dh;function Hs(){return Dh||(Dh=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.MULTI_SELECT_ADDITIONAL_OPTION=n.SOCKET_EVENTS=n.SOCKET_CONTENT_TYPES=void 0,n.IsValidSocketMesssage=l,n.SOCKET_CONTENT_TYPES={TEXT:"text",AUDIO:"audio",FILE:"file",TOOL_CALL:"tool",TIPS:"tips",INLINE_TEXT:"inline_text",TOOL_START:"tool_start",TOOL_END:"tool_end"},n.SOCKET_EVENTS={PING:"ping",PONG:"pong",CHAT:"chat",STREAM:"stream",AUTH:"auth",END_OF_STREAM:"eos",SYNC:"sync",ERROR:"err",CONNECTION_ESTABLISHED:"conn"},n.MULTI_SELECT_ADDITIONAL_OPTION={NOTA:"none_of_the_above",AOTA:"all_of_the_above"};function l(i){return[n.SOCKET_EVENTS.PING,n.SOCKET_EVENTS.PONG,n.SOCKET_EVENTS.ERROR,n.SOCKET_EVENTS.SYNC,n.SOCKET_EVENTS.CONNECTION_ESTABLISHED,n.SOCKET_EVENTS.CHAT,n.SOCKET_EVENTS.STREAM,n.SOCKET_EVENTS.END_OF_STREAM].includes(i.ev)}})(Us)),Us}var Fr={};function ql(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qs={exports:{}};var jh;function HS(){return jh||(jh=1,(function(n,l){(function(i){n.exports=i()})(function(){return(function i(o,u,s){function c(h,g){if(!u[h]){if(!o[h]){var y=typeof ql=="function"&&ql;if(!g&&y)return y(h,!0);if(f)return f(h,!0);var v=new Error("Cannot find module '"+h+"'");throw v.code="MODULE_NOT_FOUND",v}var b=u[h]={exports:{}};o[h][0].call(b.exports,function(w){var E=o[h][1][w];return c(E||w)},b,b.exports,i,o,u,s)}return u[h].exports}for(var f=typeof ql=="function"&&ql,m=0;m<s.length;m++)c(s[m]);return c})({1:[function(i,o,u){var s=i("./utils"),c=i("./support"),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";u.encode=function(m){for(var h,g,y,v,b,w,E,T=[],_=0,A=m.length,k=A,q=s.getTypeOf(m)!=="string";_<m.length;)k=A-_,y=q?(h=m[_++],g=_<A?m[_++]:0,_<A?m[_++]:0):(h=m.charCodeAt(_++),g=_<A?m.charCodeAt(_++):0,_<A?m.charCodeAt(_++):0),v=h>>2,b=(3&h)<<4|g>>4,w=1<k?(15&g)<<2|y>>6:64,E=2<k?63&y:64,T.push(f.charAt(v)+f.charAt(b)+f.charAt(w)+f.charAt(E));return T.join("")},u.decode=function(m){var h,g,y,v,b,w,E=0,T=0,_="data:";if(m.substr(0,_.length)===_)throw new Error("Invalid base64 input, it looks like a data url.");var A,k=3*(m=m.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(m.charAt(m.length-1)===f.charAt(64)&&k--,m.charAt(m.length-2)===f.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(A=c.uint8array?new Uint8Array(0|k):new Array(0|k);E<m.length;)h=f.indexOf(m.charAt(E++))<<2|(v=f.indexOf(m.charAt(E++)))>>4,g=(15&v)<<4|(b=f.indexOf(m.charAt(E++)))>>2,y=(3&b)<<6|(w=f.indexOf(m.charAt(E++))),A[T++]=h,b!==64&&(A[T++]=g),w!==64&&(A[T++]=y);return A}},{"./support":30,"./utils":32}],2:[function(i,o,u){var s=i("./external"),c=i("./stream/DataWorker"),f=i("./stream/Crc32Probe"),m=i("./stream/DataLengthProbe");function h(g,y,v,b,w){this.compressedSize=g,this.uncompressedSize=y,this.crc32=v,this.compression=b,this.compressedContent=w}h.prototype={getContentWorker:function(){var g=new c(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new m("data_length")),y=this;return g.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),g},getCompressedWorker:function(){return new c(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},h.createWorkerFrom=function(g,y,v){return g.pipe(new f).pipe(new m("uncompressedSize")).pipe(y.compressWorker(v)).pipe(new m("compressedSize")).withStreamInfo("compression",y)},o.exports=h},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,o,u){var s=i("./stream/GenericWorker");u.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},u.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,o,u){var s=i("./utils"),c=(function(){for(var f,m=[],h=0;h<256;h++){f=h;for(var g=0;g<8;g++)f=1&f?3988292384^f>>>1:f>>>1;m[h]=f}return m})();o.exports=function(f,m){return f!==void 0&&f.length?s.getTypeOf(f)!=="string"?(function(h,g,y,v){var b=c,w=v+y;h^=-1;for(var E=v;E<w;E++)h=h>>>8^b[255&(h^g[E])];return-1^h})(0|m,f,f.length,0):(function(h,g,y,v){var b=c,w=v+y;h^=-1;for(var E=v;E<w;E++)h=h>>>8^b[255&(h^g.charCodeAt(E))];return-1^h})(0|m,f,f.length,0):0}},{"./utils":32}],5:[function(i,o,u){u.base64=!1,u.binary=!1,u.dir=!1,u.createFolders=!0,u.date=null,u.compression=null,u.compressionOptions=null,u.comment=null,u.unixPermissions=null,u.dosPermissions=null},{}],6:[function(i,o,u){var s=null;s=typeof Promise<"u"?Promise:i("lie"),o.exports={Promise:s}},{lie:37}],7:[function(i,o,u){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",c=i("pako"),f=i("./utils"),m=i("./stream/GenericWorker"),h=s?"uint8array":"array";function g(y,v){m.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=v,this.meta={}}u.magic="\b\0",f.inherits(g,m),g.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(f.transformTo(h,y.data),!1)},g.prototype.flush=function(){m.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},g.prototype.cleanUp=function(){m.prototype.cleanUp.call(this),this._pako=null},g.prototype._createPako=function(){this._pako=new c[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(v){y.push({data:v,meta:y.meta})}},u.compressWorker=function(y){return new g("Deflate",y)},u.uncompressWorker=function(){return new g("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,o,u){function s(b,w){var E,T="";for(E=0;E<w;E++)T+=String.fromCharCode(255&b),b>>>=8;return T}function c(b,w,E,T,_,A){var k,q,H=b.file,M=b.compression,I=A!==h.utf8encode,Y=f.transformTo("string",A(H.name)),F=f.transformTo("string",h.utf8encode(H.name)),$=H.comment,ie=f.transformTo("string",A($)),D=f.transformTo("string",h.utf8encode($)),ne=F.length!==H.name.length,C=D.length!==$.length,V="",Z="",Q="",se=H.dir,de=H.date,L={crc32:0,compressedSize:0,uncompressedSize:0};w&&!E||(L.crc32=b.crc32,L.compressedSize=b.compressedSize,L.uncompressedSize=b.uncompressedSize);var N=0;w&&(N|=8),I||!ne&&!C||(N|=2048);var B=0,z=0;se&&(B|=16),_==="UNIX"?(z=798,B|=(function(ce,we){var Te=ce;return ce||(Te=we?16893:33204),(65535&Te)<<16})(H.unixPermissions,se)):(z=20,B|=(function(ce){return 63&(ce||0)})(H.dosPermissions)),k=de.getUTCHours(),k<<=6,k|=de.getUTCMinutes(),k<<=5,k|=de.getUTCSeconds()/2,q=de.getUTCFullYear()-1980,q<<=4,q|=de.getUTCMonth()+1,q<<=5,q|=de.getUTCDate(),ne&&(Z=s(1,1)+s(g(Y),4)+F,V+="up"+s(Z.length,2)+Z),C&&(Q=s(1,1)+s(g(ie),4)+D,V+="uc"+s(Q.length,2)+Q);var re="";return re+=`
|
|
10
|
+
\0`,re+=s(N,2),re+=M.magic,re+=s(k,2),re+=s(q,2),re+=s(L.crc32,4),re+=s(L.compressedSize,4),re+=s(L.uncompressedSize,4),re+=s(Y.length,2),re+=s(V.length,2),{fileRecord:y.LOCAL_FILE_HEADER+re+Y+V,dirRecord:y.CENTRAL_FILE_HEADER+s(z,2)+re+s(ie.length,2)+"\0\0\0\0"+s(B,4)+s(T,4)+Y+V+ie}}var f=i("../utils"),m=i("../stream/GenericWorker"),h=i("../utf8"),g=i("../crc32"),y=i("../signature");function v(b,w,E,T){m.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=w,this.zipPlatform=E,this.encodeFileName=T,this.streamFiles=b,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}f.inherits(v,m),v.prototype.push=function(b){var w=b.meta.percent||0,E=this.entriesCount,T=this._sources.length;this.accumulate?this.contentBuffer.push(b):(this.bytesWritten+=b.data.length,m.prototype.push.call(this,{data:b.data,meta:{currentFile:this.currentFile,percent:E?(w+100*(E-T-1))/E:100}}))},v.prototype.openedSource=function(b){this.currentSourceOffset=this.bytesWritten,this.currentFile=b.file.name;var w=this.streamFiles&&!b.file.dir;if(w){var E=c(b,w,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:E.fileRecord,meta:{percent:0}})}else this.accumulate=!0},v.prototype.closedSource=function(b){this.accumulate=!1;var w=this.streamFiles&&!b.file.dir,E=c(b,w,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(E.dirRecord),w)this.push({data:(function(T){return y.DATA_DESCRIPTOR+s(T.crc32,4)+s(T.compressedSize,4)+s(T.uncompressedSize,4)})(b),meta:{percent:100}});else for(this.push({data:E.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},v.prototype.flush=function(){for(var b=this.bytesWritten,w=0;w<this.dirRecords.length;w++)this.push({data:this.dirRecords[w],meta:{percent:100}});var E=this.bytesWritten-b,T=(function(_,A,k,q,H){var M=f.transformTo("string",H(q));return y.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(_,2)+s(_,2)+s(A,4)+s(k,4)+s(M.length,2)+M})(this.dirRecords.length,E,b,this.zipComment,this.encodeFileName);this.push({data:T,meta:{percent:100}})},v.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},v.prototype.registerPrevious=function(b){this._sources.push(b);var w=this;return b.on("data",function(E){w.processChunk(E)}),b.on("end",function(){w.closedSource(w.previous.streamInfo),w._sources.length?w.prepareNextSource():w.end()}),b.on("error",function(E){w.error(E)}),this},v.prototype.resume=function(){return!!m.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},v.prototype.error=function(b){var w=this._sources;if(!m.prototype.error.call(this,b))return!1;for(var E=0;E<w.length;E++)try{w[E].error(b)}catch{}return!0},v.prototype.lock=function(){m.prototype.lock.call(this);for(var b=this._sources,w=0;w<b.length;w++)b[w].lock()},o.exports=v},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(i,o,u){var s=i("../compressions"),c=i("./ZipFileWorker");u.generateWorker=function(f,m,h){var g=new c(m.streamFiles,h,m.platform,m.encodeFileName),y=0;try{f.forEach(function(v,b){y++;var w=(function(A,k){var q=A||k,H=s[q];if(!H)throw new Error(q+" is not a valid compression method !");return H})(b.options.compression,m.compression),E=b.options.compressionOptions||m.compressionOptions||{},T=b.dir,_=b.date;b._compressWorker(w,E).withStreamInfo("file",{name:v,dir:T,date:_,comment:b.comment||"",unixPermissions:b.unixPermissions,dosPermissions:b.dosPermissions}).pipe(g)}),g.entriesCount=y}catch(v){g.error(v)}return g}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(i,o,u){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var c=new s;for(var f in this)typeof this[f]!="function"&&(c[f]=this[f]);return c}}(s.prototype=i("./object")).loadAsync=i("./load"),s.support=i("./support"),s.defaults=i("./defaults"),s.version="3.10.1",s.loadAsync=function(c,f){return new s().loadAsync(c,f)},s.external=i("./external"),o.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(i,o,u){var s=i("./utils"),c=i("./external"),f=i("./utf8"),m=i("./zipEntries"),h=i("./stream/Crc32Probe"),g=i("./nodejsUtils");function y(v){return new c.Promise(function(b,w){var E=v.decompressed.getContentWorker().pipe(new h);E.on("error",function(T){w(T)}).on("end",function(){E.streamInfo.crc32!==v.decompressed.crc32?w(new Error("Corrupted zip : CRC32 mismatch")):b()}).resume()})}o.exports=function(v,b){var w=this;return b=s.extend(b||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:f.utf8decode}),g.isNode&&g.isStream(v)?c.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",v,!0,b.optimizedBinaryString,b.base64).then(function(E){var T=new m(b);return T.load(E),T}).then(function(E){var T=[c.Promise.resolve(E)],_=E.files;if(b.checkCRC32)for(var A=0;A<_.length;A++)T.push(y(_[A]));return c.Promise.all(T)}).then(function(E){for(var T=E.shift(),_=T.files,A=0;A<_.length;A++){var k=_[A],q=k.fileNameStr,H=s.resolve(k.fileNameStr);w.file(H,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:b.createFolders}),k.dir||(w.file(H).unsafeOriginalName=q)}return T.zipComment.length&&(w.comment=T.zipComment),w})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(i,o,u){var s=i("../utils"),c=i("../stream/GenericWorker");function f(m,h){c.call(this,"Nodejs stream input adapter for "+m),this._upstreamEnded=!1,this._bindStream(h)}s.inherits(f,c),f.prototype._bindStream=function(m){var h=this;(this._stream=m).pause(),m.on("data",function(g){h.push({data:g,meta:{percent:0}})}).on("error",function(g){h.isPaused?this.generatedError=g:h.error(g)}).on("end",function(){h.isPaused?h._upstreamEnded=!0:h.end()})},f.prototype.pause=function(){return!!c.prototype.pause.call(this)&&(this._stream.pause(),!0)},f.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},o.exports=f},{"../stream/GenericWorker":28,"../utils":32}],13:[function(i,o,u){var s=i("readable-stream").Readable;function c(f,m,h){s.call(this,m),this._helper=f;var g=this;f.on("data",function(y,v){g.push(y)||g._helper.pause(),h&&h(v)}).on("error",function(y){g.emit("error",y)}).on("end",function(){g.push(null)})}i("../utils").inherits(c,s),c.prototype._read=function(){this._helper.resume()},o.exports=c},{"../utils":32,"readable-stream":16}],14:[function(i,o,u){o.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,c){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,c);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,c)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var c=new Buffer(s);return c.fill(0),c},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(i,o,u){function s(H,M,I){var Y,F=f.getTypeOf(M),$=f.extend(I||{},g);$.date=$.date||new Date,$.compression!==null&&($.compression=$.compression.toUpperCase()),typeof $.unixPermissions=="string"&&($.unixPermissions=parseInt($.unixPermissions,8)),$.unixPermissions&&16384&$.unixPermissions&&($.dir=!0),$.dosPermissions&&16&$.dosPermissions&&($.dir=!0),$.dir&&(H=_(H)),$.createFolders&&(Y=T(H))&&A.call(this,Y,!0);var ie=F==="string"&&$.binary===!1&&$.base64===!1;I&&I.binary!==void 0||($.binary=!ie),(M instanceof y&&M.uncompressedSize===0||$.dir||!M||M.length===0)&&($.base64=!1,$.binary=!0,M="",$.compression="STORE",F="string");var D=null;D=M instanceof y||M instanceof m?M:w.isNode&&w.isStream(M)?new E(H,M):f.prepareContent(H,M,$.binary,$.optimizedBinaryString,$.base64);var ne=new v(H,D,$);this.files[H]=ne}var c=i("./utf8"),f=i("./utils"),m=i("./stream/GenericWorker"),h=i("./stream/StreamHelper"),g=i("./defaults"),y=i("./compressedObject"),v=i("./zipObject"),b=i("./generate"),w=i("./nodejsUtils"),E=i("./nodejs/NodejsStreamInputAdapter"),T=function(H){H.slice(-1)==="/"&&(H=H.substring(0,H.length-1));var M=H.lastIndexOf("/");return 0<M?H.substring(0,M):""},_=function(H){return H.slice(-1)!=="/"&&(H+="/"),H},A=function(H,M){return M=M!==void 0?M:g.createFolders,H=_(H),this.files[H]||s.call(this,H,null,{dir:!0,createFolders:M}),this.files[H]};function k(H){return Object.prototype.toString.call(H)==="[object RegExp]"}var q={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(H){var M,I,Y;for(M in this.files)Y=this.files[M],(I=M.slice(this.root.length,M.length))&&M.slice(0,this.root.length)===this.root&&H(I,Y)},filter:function(H){var M=[];return this.forEach(function(I,Y){H(I,Y)&&M.push(Y)}),M},file:function(H,M,I){if(arguments.length!==1)return H=this.root+H,s.call(this,H,M,I),this;if(k(H)){var Y=H;return this.filter(function($,ie){return!ie.dir&&Y.test($)})}var F=this.files[this.root+H];return F&&!F.dir?F:null},folder:function(H){if(!H)return this;if(k(H))return this.filter(function(F,$){return $.dir&&H.test(F)});var M=this.root+H,I=A.call(this,M),Y=this.clone();return Y.root=I.name,Y},remove:function(H){H=this.root+H;var M=this.files[H];if(M||(H.slice(-1)!=="/"&&(H+="/"),M=this.files[H]),M&&!M.dir)delete this.files[H];else for(var I=this.filter(function(F,$){return $.name.slice(0,H.length)===H}),Y=0;Y<I.length;Y++)delete this.files[I[Y].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(H){var M,I={};try{if((I=f.extend(H||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:c.utf8encode})).type=I.type.toLowerCase(),I.compression=I.compression.toUpperCase(),I.type==="binarystring"&&(I.type="string"),!I.type)throw new Error("No output type specified.");f.checkSupport(I.type),I.platform!=="darwin"&&I.platform!=="freebsd"&&I.platform!=="linux"&&I.platform!=="sunos"||(I.platform="UNIX"),I.platform==="win32"&&(I.platform="DOS");var Y=I.comment||this.comment||"";M=b.generateWorker(this,I,Y)}catch(F){(M=new m("error")).error(F)}return new h(M,I.type||"string",I.mimeType)},generateAsync:function(H,M){return this.generateInternalStream(H).accumulate(M)},generateNodeStream:function(H,M){return(H=H||{}).type||(H.type="nodebuffer"),this.generateInternalStream(H).toNodejsStream(M)}};o.exports=q},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(i,o,u){o.exports=i("stream")},{stream:void 0}],17:[function(i,o,u){var s=i("./DataReader");function c(f){s.call(this,f);for(var m=0;m<this.data.length;m++)f[m]=255&f[m]}i("../utils").inherits(c,s),c.prototype.byteAt=function(f){return this.data[this.zero+f]},c.prototype.lastIndexOfSignature=function(f){for(var m=f.charCodeAt(0),h=f.charCodeAt(1),g=f.charCodeAt(2),y=f.charCodeAt(3),v=this.length-4;0<=v;--v)if(this.data[v]===m&&this.data[v+1]===h&&this.data[v+2]===g&&this.data[v+3]===y)return v-this.zero;return-1},c.prototype.readAndCheckSignature=function(f){var m=f.charCodeAt(0),h=f.charCodeAt(1),g=f.charCodeAt(2),y=f.charCodeAt(3),v=this.readData(4);return m===v[0]&&h===v[1]&&g===v[2]&&y===v[3]},c.prototype.readData=function(f){if(this.checkOffset(f),f===0)return[];var m=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,m},o.exports=c},{"../utils":32,"./DataReader":18}],18:[function(i,o,u){var s=i("../utils");function c(f){this.data=f,this.length=f.length,this.index=0,this.zero=0}c.prototype={checkOffset:function(f){this.checkIndex(this.index+f)},checkIndex:function(f){if(this.length<this.zero+f||f<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+f+"). Corrupted zip ?")},setIndex:function(f){this.checkIndex(f),this.index=f},skip:function(f){this.setIndex(this.index+f)},byteAt:function(){},readInt:function(f){var m,h=0;for(this.checkOffset(f),m=this.index+f-1;m>=this.index;m--)h=(h<<8)+this.byteAt(m);return this.index+=f,h},readString:function(f){return s.transformTo("string",this.readData(f))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var f=this.readInt(4);return new Date(Date.UTC(1980+(f>>25&127),(f>>21&15)-1,f>>16&31,f>>11&31,f>>5&63,(31&f)<<1))}},o.exports=c},{"../utils":32}],19:[function(i,o,u){var s=i("./Uint8ArrayReader");function c(f){s.call(this,f)}i("../utils").inherits(c,s),c.prototype.readData=function(f){this.checkOffset(f);var m=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,m},o.exports=c},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(i,o,u){var s=i("./DataReader");function c(f){s.call(this,f)}i("../utils").inherits(c,s),c.prototype.byteAt=function(f){return this.data.charCodeAt(this.zero+f)},c.prototype.lastIndexOfSignature=function(f){return this.data.lastIndexOf(f)-this.zero},c.prototype.readAndCheckSignature=function(f){return f===this.readData(4)},c.prototype.readData=function(f){this.checkOffset(f);var m=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,m},o.exports=c},{"../utils":32,"./DataReader":18}],21:[function(i,o,u){var s=i("./ArrayReader");function c(f){s.call(this,f)}i("../utils").inherits(c,s),c.prototype.readData=function(f){if(this.checkOffset(f),f===0)return new Uint8Array(0);var m=this.data.subarray(this.zero+this.index,this.zero+this.index+f);return this.index+=f,m},o.exports=c},{"../utils":32,"./ArrayReader":17}],22:[function(i,o,u){var s=i("../utils"),c=i("../support"),f=i("./ArrayReader"),m=i("./StringReader"),h=i("./NodeBufferReader"),g=i("./Uint8ArrayReader");o.exports=function(y){var v=s.getTypeOf(y);return s.checkSupport(v),v!=="string"||c.uint8array?v==="nodebuffer"?new h(y):c.uint8array?new g(s.transformTo("uint8array",y)):new f(s.transformTo("array",y)):new m(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(i,o,u){u.LOCAL_FILE_HEADER="PK",u.CENTRAL_FILE_HEADER="PK",u.CENTRAL_DIRECTORY_END="PK",u.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",u.ZIP64_CENTRAL_DIRECTORY_END="PK",u.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(i,o,u){var s=i("./GenericWorker"),c=i("../utils");function f(m){s.call(this,"ConvertWorker to "+m),this.destType=m}c.inherits(f,s),f.prototype.processChunk=function(m){this.push({data:c.transformTo(this.destType,m.data),meta:m.meta})},o.exports=f},{"../utils":32,"./GenericWorker":28}],25:[function(i,o,u){var s=i("./GenericWorker"),c=i("../crc32");function f(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}i("../utils").inherits(f,s),f.prototype.processChunk=function(m){this.streamInfo.crc32=c(m.data,this.streamInfo.crc32||0),this.push(m)},o.exports=f},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(i,o,u){var s=i("../utils"),c=i("./GenericWorker");function f(m){c.call(this,"DataLengthProbe for "+m),this.propName=m,this.withStreamInfo(m,0)}s.inherits(f,c),f.prototype.processChunk=function(m){if(m){var h=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=h+m.data.length}c.prototype.processChunk.call(this,m)},o.exports=f},{"../utils":32,"./GenericWorker":28}],27:[function(i,o,u){var s=i("../utils"),c=i("./GenericWorker");function f(m){c.call(this,"DataWorker");var h=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,m.then(function(g){h.dataIsReady=!0,h.data=g,h.max=g&&g.length||0,h.type=s.getTypeOf(g),h.isPaused||h._tickAndRepeat()},function(g){h.error(g)})}s.inherits(f,c),f.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this.data=null},f.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},f.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},f.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var m=null,h=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":m=this.data.substring(this.index,h);break;case"uint8array":m=this.data.subarray(this.index,h);break;case"array":case"nodebuffer":m=this.data.slice(this.index,h)}return this.index=h,this.push({data:m,meta:{percent:this.max?this.index/this.max*100:0}})},o.exports=f},{"../utils":32,"./GenericWorker":28}],28:[function(i,o,u){function s(c){this.name=c||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(c){this.emit("data",c)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(c){this.emit("error",c)}return!0},error:function(c){return!this.isFinished&&(this.isPaused?this.generatedError=c:(this.isFinished=!0,this.emit("error",c),this.previous&&this.previous.error(c),this.cleanUp()),!0)},on:function(c,f){return this._listeners[c].push(f),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(c,f){if(this._listeners[c])for(var m=0;m<this._listeners[c].length;m++)this._listeners[c][m].call(this,f)},pipe:function(c){return c.registerPrevious(this)},registerPrevious:function(c){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=c.streamInfo,this.mergeStreamInfo(),this.previous=c;var f=this;return c.on("data",function(m){f.processChunk(m)}),c.on("end",function(){f.end()}),c.on("error",function(m){f.error(m)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var c=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),c=!0),this.previous&&this.previous.resume(),!c},flush:function(){},processChunk:function(c){this.push(c)},withStreamInfo:function(c,f){return this.extraStreamInfo[c]=f,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var c in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,c)&&(this.streamInfo[c]=this.extraStreamInfo[c])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var c="Worker "+this.name;return this.previous?this.previous+" -> "+c:c}},o.exports=s},{}],29:[function(i,o,u){var s=i("../utils"),c=i("./ConvertWorker"),f=i("./GenericWorker"),m=i("../base64"),h=i("../support"),g=i("../external"),y=null;if(h.nodestream)try{y=i("../nodejs/NodejsStreamOutputAdapter")}catch{}function v(w,E){return new g.Promise(function(T,_){var A=[],k=w._internalType,q=w._outputType,H=w._mimeType;w.on("data",function(M,I){A.push(M),E&&E(I)}).on("error",function(M){A=[],_(M)}).on("end",function(){try{var M=(function(I,Y,F){switch(I){case"blob":return s.newBlob(s.transformTo("arraybuffer",Y),F);case"base64":return m.encode(Y);default:return s.transformTo(I,Y)}})(q,(function(I,Y){var F,$=0,ie=null,D=0;for(F=0;F<Y.length;F++)D+=Y[F].length;switch(I){case"string":return Y.join("");case"array":return Array.prototype.concat.apply([],Y);case"uint8array":for(ie=new Uint8Array(D),F=0;F<Y.length;F++)ie.set(Y[F],$),$+=Y[F].length;return ie;case"nodebuffer":return Buffer.concat(Y);default:throw new Error("concat : unsupported type '"+I+"'")}})(k,A),H);T(M)}catch(I){_(I)}A=[]}).resume()})}function b(w,E,T){var _=E;switch(E){case"blob":case"arraybuffer":_="uint8array";break;case"base64":_="string"}try{this._internalType=_,this._outputType=E,this._mimeType=T,s.checkSupport(_),this._worker=w.pipe(new c(_)),w.lock()}catch(A){this._worker=new f("error"),this._worker.error(A)}}b.prototype={accumulate:function(w){return v(this,w)},on:function(w,E){var T=this;return w==="data"?this._worker.on(w,function(_){E.call(T,_.data,_.meta)}):this._worker.on(w,function(){s.delay(E,arguments,T)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(w){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new y(this,{objectMode:this._outputType!=="nodebuffer"},w)}},o.exports=b},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(i,o,u){if(u.base64=!0,u.array=!0,u.string=!0,u.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",u.nodebuffer=typeof Buffer<"u",u.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")u.blob=!1;else{var s=new ArrayBuffer(0);try{u.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var c=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);c.append(s),u.blob=c.getBlob("application/zip").size===0}catch{u.blob=!1}}}try{u.nodestream=!!i("readable-stream").Readable}catch{u.nodestream=!1}},{"readable-stream":16}],31:[function(i,o,u){for(var s=i("./utils"),c=i("./support"),f=i("./nodejsUtils"),m=i("./stream/GenericWorker"),h=new Array(256),g=0;g<256;g++)h[g]=252<=g?6:248<=g?5:240<=g?4:224<=g?3:192<=g?2:1;h[254]=h[254]=1;function y(){m.call(this,"utf-8 decode"),this.leftOver=null}function v(){m.call(this,"utf-8 encode")}u.utf8encode=function(b){return c.nodebuffer?f.newBufferFrom(b,"utf-8"):(function(w){var E,T,_,A,k,q=w.length,H=0;for(A=0;A<q;A++)(64512&(T=w.charCodeAt(A)))==55296&&A+1<q&&(64512&(_=w.charCodeAt(A+1)))==56320&&(T=65536+(T-55296<<10)+(_-56320),A++),H+=T<128?1:T<2048?2:T<65536?3:4;for(E=c.uint8array?new Uint8Array(H):new Array(H),A=k=0;k<H;A++)(64512&(T=w.charCodeAt(A)))==55296&&A+1<q&&(64512&(_=w.charCodeAt(A+1)))==56320&&(T=65536+(T-55296<<10)+(_-56320),A++),T<128?E[k++]=T:(T<2048?E[k++]=192|T>>>6:(T<65536?E[k++]=224|T>>>12:(E[k++]=240|T>>>18,E[k++]=128|T>>>12&63),E[k++]=128|T>>>6&63),E[k++]=128|63&T);return E})(b)},u.utf8decode=function(b){return c.nodebuffer?s.transformTo("nodebuffer",b).toString("utf-8"):(function(w){var E,T,_,A,k=w.length,q=new Array(2*k);for(E=T=0;E<k;)if((_=w[E++])<128)q[T++]=_;else if(4<(A=h[_]))q[T++]=65533,E+=A-1;else{for(_&=A===2?31:A===3?15:7;1<A&&E<k;)_=_<<6|63&w[E++],A--;1<A?q[T++]=65533:_<65536?q[T++]=_:(_-=65536,q[T++]=55296|_>>10&1023,q[T++]=56320|1023&_)}return q.length!==T&&(q.subarray?q=q.subarray(0,T):q.length=T),s.applyFromCharCode(q)})(b=s.transformTo(c.uint8array?"uint8array":"array",b))},s.inherits(y,m),y.prototype.processChunk=function(b){var w=s.transformTo(c.uint8array?"uint8array":"array",b.data);if(this.leftOver&&this.leftOver.length){if(c.uint8array){var E=w;(w=new Uint8Array(E.length+this.leftOver.length)).set(this.leftOver,0),w.set(E,this.leftOver.length)}else w=this.leftOver.concat(w);this.leftOver=null}var T=(function(A,k){var q;for((k=k||A.length)>A.length&&(k=A.length),q=k-1;0<=q&&(192&A[q])==128;)q--;return q<0||q===0?k:q+h[A[q]]>k?q:k})(w),_=w;T!==w.length&&(c.uint8array?(_=w.subarray(0,T),this.leftOver=w.subarray(T,w.length)):(_=w.slice(0,T),this.leftOver=w.slice(T,w.length))),this.push({data:u.utf8decode(_),meta:b.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:u.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},u.Utf8DecodeWorker=y,s.inherits(v,m),v.prototype.processChunk=function(b){this.push({data:u.utf8encode(b.data),meta:b.meta})},u.Utf8EncodeWorker=v},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(i,o,u){var s=i("./support"),c=i("./base64"),f=i("./nodejsUtils"),m=i("./external");function h(E){return E}function g(E,T){for(var _=0;_<E.length;++_)T[_]=255&E.charCodeAt(_);return T}i("setimmediate"),u.newBlob=function(E,T){u.checkSupport("blob");try{return new Blob([E],{type:T})}catch{try{var _=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return _.append(E),_.getBlob(T)}catch{throw new Error("Bug : can't construct the Blob.")}}};var y={stringifyByChunk:function(E,T,_){var A=[],k=0,q=E.length;if(q<=_)return String.fromCharCode.apply(null,E);for(;k<q;)T==="array"||T==="nodebuffer"?A.push(String.fromCharCode.apply(null,E.slice(k,Math.min(k+_,q)))):A.push(String.fromCharCode.apply(null,E.subarray(k,Math.min(k+_,q)))),k+=_;return A.join("")},stringifyByChar:function(E){for(var T="",_=0;_<E.length;_++)T+=String.fromCharCode(E[_]);return T},applyCanBeUsed:{uint8array:(function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,f.allocBuffer(1)).length===1}catch{return!1}})()}};function v(E){var T=65536,_=u.getTypeOf(E),A=!0;if(_==="uint8array"?A=y.applyCanBeUsed.uint8array:_==="nodebuffer"&&(A=y.applyCanBeUsed.nodebuffer),A)for(;1<T;)try{return y.stringifyByChunk(E,_,T)}catch{T=Math.floor(T/2)}return y.stringifyByChar(E)}function b(E,T){for(var _=0;_<E.length;_++)T[_]=E[_];return T}u.applyFromCharCode=v;var w={};w.string={string:h,array:function(E){return g(E,new Array(E.length))},arraybuffer:function(E){return w.string.uint8array(E).buffer},uint8array:function(E){return g(E,new Uint8Array(E.length))},nodebuffer:function(E){return g(E,f.allocBuffer(E.length))}},w.array={string:v,array:h,arraybuffer:function(E){return new Uint8Array(E).buffer},uint8array:function(E){return new Uint8Array(E)},nodebuffer:function(E){return f.newBufferFrom(E)}},w.arraybuffer={string:function(E){return v(new Uint8Array(E))},array:function(E){return b(new Uint8Array(E),new Array(E.byteLength))},arraybuffer:h,uint8array:function(E){return new Uint8Array(E)},nodebuffer:function(E){return f.newBufferFrom(new Uint8Array(E))}},w.uint8array={string:v,array:function(E){return b(E,new Array(E.length))},arraybuffer:function(E){return E.buffer},uint8array:h,nodebuffer:function(E){return f.newBufferFrom(E)}},w.nodebuffer={string:v,array:function(E){return b(E,new Array(E.length))},arraybuffer:function(E){return w.nodebuffer.uint8array(E).buffer},uint8array:function(E){return b(E,new Uint8Array(E.length))},nodebuffer:h},u.transformTo=function(E,T){if(T=T||"",!E)return T;u.checkSupport(E);var _=u.getTypeOf(T);return w[_][E](T)},u.resolve=function(E){for(var T=E.split("/"),_=[],A=0;A<T.length;A++){var k=T[A];k==="."||k===""&&A!==0&&A!==T.length-1||(k===".."?_.pop():_.push(k))}return _.join("/")},u.getTypeOf=function(E){return typeof E=="string"?"string":Object.prototype.toString.call(E)==="[object Array]"?"array":s.nodebuffer&&f.isBuffer(E)?"nodebuffer":s.uint8array&&E instanceof Uint8Array?"uint8array":s.arraybuffer&&E instanceof ArrayBuffer?"arraybuffer":void 0},u.checkSupport=function(E){if(!s[E.toLowerCase()])throw new Error(E+" is not supported by this platform")},u.MAX_VALUE_16BITS=65535,u.MAX_VALUE_32BITS=-1,u.pretty=function(E){var T,_,A="";for(_=0;_<(E||"").length;_++)A+="\\x"+((T=E.charCodeAt(_))<16?"0":"")+T.toString(16).toUpperCase();return A},u.delay=function(E,T,_){setImmediate(function(){E.apply(_||null,T||[])})},u.inherits=function(E,T){function _(){}_.prototype=T.prototype,E.prototype=new _},u.extend=function(){var E,T,_={};for(E=0;E<arguments.length;E++)for(T in arguments[E])Object.prototype.hasOwnProperty.call(arguments[E],T)&&_[T]===void 0&&(_[T]=arguments[E][T]);return _},u.prepareContent=function(E,T,_,A,k){return m.Promise.resolve(T).then(function(q){return s.blob&&(q instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(q))!==-1)&&typeof FileReader<"u"?new m.Promise(function(H,M){var I=new FileReader;I.onload=function(Y){H(Y.target.result)},I.onerror=function(Y){M(Y.target.error)},I.readAsArrayBuffer(q)}):q}).then(function(q){var H=u.getTypeOf(q);return H?(H==="arraybuffer"?q=u.transformTo("uint8array",q):H==="string"&&(k?q=c.decode(q):_&&A!==!0&&(q=(function(M){return g(M,s.uint8array?new Uint8Array(M.length):new Array(M.length))})(q))),q):m.Promise.reject(new Error("Can't read the data of '"+E+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(i,o,u){var s=i("./reader/readerFor"),c=i("./utils"),f=i("./signature"),m=i("./zipEntry"),h=i("./support");function g(y){this.files=[],this.loadOptions=y}g.prototype={checkSignature:function(y){if(!this.reader.readAndCheckSignature(y)){this.reader.index-=4;var v=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+c.pretty(v)+", expected "+c.pretty(y)+")")}},isSignature:function(y,v){var b=this.reader.index;this.reader.setIndex(y);var w=this.reader.readString(4)===v;return this.reader.setIndex(b),w},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var y=this.reader.readData(this.zipCommentLength),v=h.uint8array?"uint8array":"array",b=c.transformTo(v,y);this.zipComment=this.loadOptions.decodeFileName(b)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var y,v,b,w=this.zip64EndOfCentralSize-44;0<w;)y=this.reader.readInt(2),v=this.reader.readInt(4),b=this.reader.readData(v),this.zip64ExtensibleData[y]={id:y,length:v,value:b}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var y,v;for(y=0;y<this.files.length;y++)v=this.files[y],this.reader.setIndex(v.localHeaderOffset),this.checkSignature(f.LOCAL_FILE_HEADER),v.readLocalPart(this.reader),v.handleUTF8(),v.processAttributes()},readCentralDir:function(){var y;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(f.CENTRAL_FILE_HEADER);)(y=new m({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(y);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var y=this.reader.lastIndexOfSignature(f.CENTRAL_DIRECTORY_END);if(y<0)throw this.isSignature(0,f.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(y);var v=y;if(this.checkSignature(f.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===c.MAX_VALUE_16BITS||this.diskWithCentralDirStart===c.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===c.MAX_VALUE_16BITS||this.centralDirRecords===c.MAX_VALUE_16BITS||this.centralDirSize===c.MAX_VALUE_32BITS||this.centralDirOffset===c.MAX_VALUE_32BITS){if(this.zip64=!0,(y=this.reader.lastIndexOfSignature(f.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(y),this.checkSignature(f.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,f.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(f.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(f.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var b=this.centralDirOffset+this.centralDirSize;this.zip64&&(b+=20,b+=12+this.zip64EndOfCentralSize);var w=v-b;if(0<w)this.isSignature(v,f.CENTRAL_FILE_HEADER)||(this.reader.zero=w);else if(w<0)throw new Error("Corrupted zip: missing "+Math.abs(w)+" bytes.")},prepareReader:function(y){this.reader=s(y)},load:function(y){this.prepareReader(y),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},o.exports=g},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(i,o,u){var s=i("./reader/readerFor"),c=i("./utils"),f=i("./compressedObject"),m=i("./crc32"),h=i("./utf8"),g=i("./compressions"),y=i("./support");function v(b,w){this.options=b,this.loadOptions=w}v.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(b){var w,E;if(b.skip(22),this.fileNameLength=b.readInt(2),E=b.readInt(2),this.fileName=b.readData(this.fileNameLength),b.skip(E),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((w=(function(T){for(var _ in g)if(Object.prototype.hasOwnProperty.call(g,_)&&g[_].magic===T)return g[_];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+c.pretty(this.compressionMethod)+" unknown (inner file : "+c.transformTo("string",this.fileName)+")");this.decompressed=new f(this.compressedSize,this.uncompressedSize,this.crc32,w,b.readData(this.compressedSize))},readCentralPart:function(b){this.versionMadeBy=b.readInt(2),b.skip(2),this.bitFlag=b.readInt(2),this.compressionMethod=b.readString(2),this.date=b.readDate(),this.crc32=b.readInt(4),this.compressedSize=b.readInt(4),this.uncompressedSize=b.readInt(4);var w=b.readInt(2);if(this.extraFieldsLength=b.readInt(2),this.fileCommentLength=b.readInt(2),this.diskNumberStart=b.readInt(2),this.internalFileAttributes=b.readInt(2),this.externalFileAttributes=b.readInt(4),this.localHeaderOffset=b.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");b.skip(w),this.readExtraFields(b),this.parseZIP64ExtraField(b),this.fileComment=b.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var b=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),b==0&&(this.dosPermissions=63&this.externalFileAttributes),b==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var b=s(this.extraFields[1].value);this.uncompressedSize===c.MAX_VALUE_32BITS&&(this.uncompressedSize=b.readInt(8)),this.compressedSize===c.MAX_VALUE_32BITS&&(this.compressedSize=b.readInt(8)),this.localHeaderOffset===c.MAX_VALUE_32BITS&&(this.localHeaderOffset=b.readInt(8)),this.diskNumberStart===c.MAX_VALUE_32BITS&&(this.diskNumberStart=b.readInt(4))}},readExtraFields:function(b){var w,E,T,_=b.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});b.index+4<_;)w=b.readInt(2),E=b.readInt(2),T=b.readData(E),this.extraFields[w]={id:w,length:E,value:T};b.setIndex(_)},handleUTF8:function(){var b=y.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=h.utf8decode(this.fileName),this.fileCommentStr=h.utf8decode(this.fileComment);else{var w=this.findExtraFieldUnicodePath();if(w!==null)this.fileNameStr=w;else{var E=c.transformTo(b,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(E)}var T=this.findExtraFieldUnicodeComment();if(T!==null)this.fileCommentStr=T;else{var _=c.transformTo(b,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(_)}}},findExtraFieldUnicodePath:function(){var b=this.extraFields[28789];if(b){var w=s(b.value);return w.readInt(1)!==1||m(this.fileName)!==w.readInt(4)?null:h.utf8decode(w.readData(b.length-5))}return null},findExtraFieldUnicodeComment:function(){var b=this.extraFields[25461];if(b){var w=s(b.value);return w.readInt(1)!==1||m(this.fileComment)!==w.readInt(4)?null:h.utf8decode(w.readData(b.length-5))}return null}},o.exports=v},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(i,o,u){function s(w,E,T){this.name=w,this.dir=T.dir,this.date=T.date,this.comment=T.comment,this.unixPermissions=T.unixPermissions,this.dosPermissions=T.dosPermissions,this._data=E,this._dataBinary=T.binary,this.options={compression:T.compression,compressionOptions:T.compressionOptions}}var c=i("./stream/StreamHelper"),f=i("./stream/DataWorker"),m=i("./utf8"),h=i("./compressedObject"),g=i("./stream/GenericWorker");s.prototype={internalStream:function(w){var E=null,T="string";try{if(!w)throw new Error("No output type specified.");var _=(T=w.toLowerCase())==="string"||T==="text";T!=="binarystring"&&T!=="text"||(T="string"),E=this._decompressWorker();var A=!this._dataBinary;A&&!_&&(E=E.pipe(new m.Utf8EncodeWorker)),!A&&_&&(E=E.pipe(new m.Utf8DecodeWorker))}catch(k){(E=new g("error")).error(k)}return new c(E,T,"")},async:function(w,E){return this.internalStream(w).accumulate(E)},nodeStream:function(w,E){return this.internalStream(w||"nodebuffer").toNodejsStream(E)},_compressWorker:function(w,E){if(this._data instanceof h&&this._data.compression.magic===w.magic)return this._data.getCompressedWorker();var T=this._decompressWorker();return this._dataBinary||(T=T.pipe(new m.Utf8EncodeWorker)),h.createWorkerFrom(T,w,E)},_decompressWorker:function(){return this._data instanceof h?this._data.getContentWorker():this._data instanceof g?this._data:new f(this._data)}};for(var y=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],v=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},b=0;b<y.length;b++)s.prototype[y[b]]=v;o.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(i,o,u){(function(s){var c,f,m=s.MutationObserver||s.WebKitMutationObserver;if(m){var h=0,g=new m(w),y=s.document.createTextNode("");g.observe(y,{characterData:!0}),c=function(){y.data=h=++h%2}}else if(s.setImmediate||s.MessageChannel===void 0)c="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var E=s.document.createElement("script");E.onreadystatechange=function(){w(),E.onreadystatechange=null,E.parentNode.removeChild(E),E=null},s.document.documentElement.appendChild(E)}:function(){setTimeout(w,0)};else{var v=new s.MessageChannel;v.port1.onmessage=w,c=function(){v.port2.postMessage(0)}}var b=[];function w(){var E,T;f=!0;for(var _=b.length;_;){for(T=b,b=[],E=-1;++E<_;)T[E]();_=b.length}f=!1}o.exports=function(E){b.push(E)!==1||f||c()}}).call(this,typeof Rl<"u"?Rl:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(i,o,u){var s=i("immediate");function c(){}var f={},m=["REJECTED"],h=["FULFILLED"],g=["PENDING"];function y(_){if(typeof _!="function")throw new TypeError("resolver must be a function");this.state=g,this.queue=[],this.outcome=void 0,_!==c&&E(this,_)}function v(_,A,k){this.promise=_,typeof A=="function"&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function b(_,A,k){s(function(){var q;try{q=A(k)}catch(H){return f.reject(_,H)}q===_?f.reject(_,new TypeError("Cannot resolve promise with itself")):f.resolve(_,q)})}function w(_){var A=_&&_.then;if(_&&(typeof _=="object"||typeof _=="function")&&typeof A=="function")return function(){A.apply(_,arguments)}}function E(_,A){var k=!1;function q(I){k||(k=!0,f.reject(_,I))}function H(I){k||(k=!0,f.resolve(_,I))}var M=T(function(){A(H,q)});M.status==="error"&&q(M.value)}function T(_,A){var k={};try{k.value=_(A),k.status="success"}catch(q){k.status="error",k.value=q}return k}(o.exports=y).prototype.finally=function(_){if(typeof _!="function")return this;var A=this.constructor;return this.then(function(k){return A.resolve(_()).then(function(){return k})},function(k){return A.resolve(_()).then(function(){throw k})})},y.prototype.catch=function(_){return this.then(null,_)},y.prototype.then=function(_,A){if(typeof _!="function"&&this.state===h||typeof A!="function"&&this.state===m)return this;var k=new this.constructor(c);return this.state!==g?b(k,this.state===h?_:A,this.outcome):this.queue.push(new v(k,_,A)),k},v.prototype.callFulfilled=function(_){f.resolve(this.promise,_)},v.prototype.otherCallFulfilled=function(_){b(this.promise,this.onFulfilled,_)},v.prototype.callRejected=function(_){f.reject(this.promise,_)},v.prototype.otherCallRejected=function(_){b(this.promise,this.onRejected,_)},f.resolve=function(_,A){var k=T(w,A);if(k.status==="error")return f.reject(_,k.value);var q=k.value;if(q)E(_,q);else{_.state=h,_.outcome=A;for(var H=-1,M=_.queue.length;++H<M;)_.queue[H].callFulfilled(A)}return _},f.reject=function(_,A){_.state=m,_.outcome=A;for(var k=-1,q=_.queue.length;++k<q;)_.queue[k].callRejected(A);return _},y.resolve=function(_){return _ instanceof this?_:f.resolve(new this(c),_)},y.reject=function(_){var A=new this(c);return f.reject(A,_)},y.all=function(_){var A=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=_.length,q=!1;if(!k)return this.resolve([]);for(var H=new Array(k),M=0,I=-1,Y=new this(c);++I<k;)F(_[I],I);return Y;function F($,ie){A.resolve($).then(function(D){H[ie]=D,++M!==k||q||(q=!0,f.resolve(Y,H))},function(D){q||(q=!0,f.reject(Y,D))})}},y.race=function(_){var A=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=_.length,q=!1;if(!k)return this.resolve([]);for(var H=-1,M=new this(c);++H<k;)I=_[H],A.resolve(I).then(function(Y){q||(q=!0,f.resolve(M,Y))},function(Y){q||(q=!0,f.reject(M,Y))});var I;return M}},{immediate:36}],38:[function(i,o,u){var s={};(0,i("./lib/utils/common").assign)(s,i("./lib/deflate"),i("./lib/inflate"),i("./lib/zlib/constants")),o.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(i,o,u){var s=i("./zlib/deflate"),c=i("./utils/common"),f=i("./utils/strings"),m=i("./zlib/messages"),h=i("./zlib/zstream"),g=Object.prototype.toString,y=0,v=-1,b=0,w=8;function E(_){if(!(this instanceof E))return new E(_);this.options=c.assign({level:v,method:w,chunkSize:16384,windowBits:15,memLevel:8,strategy:b,to:""},_||{});var A=this.options;A.raw&&0<A.windowBits?A.windowBits=-A.windowBits:A.gzip&&0<A.windowBits&&A.windowBits<16&&(A.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var k=s.deflateInit2(this.strm,A.level,A.method,A.windowBits,A.memLevel,A.strategy);if(k!==y)throw new Error(m[k]);if(A.header&&s.deflateSetHeader(this.strm,A.header),A.dictionary){var q;if(q=typeof A.dictionary=="string"?f.string2buf(A.dictionary):g.call(A.dictionary)==="[object ArrayBuffer]"?new Uint8Array(A.dictionary):A.dictionary,(k=s.deflateSetDictionary(this.strm,q))!==y)throw new Error(m[k]);this._dict_set=!0}}function T(_,A){var k=new E(A);if(k.push(_,!0),k.err)throw k.msg||m[k.err];return k.result}E.prototype.push=function(_,A){var k,q,H=this.strm,M=this.options.chunkSize;if(this.ended)return!1;q=A===~~A?A:A===!0?4:0,typeof _=="string"?H.input=f.string2buf(_):g.call(_)==="[object ArrayBuffer]"?H.input=new Uint8Array(_):H.input=_,H.next_in=0,H.avail_in=H.input.length;do{if(H.avail_out===0&&(H.output=new c.Buf8(M),H.next_out=0,H.avail_out=M),(k=s.deflate(H,q))!==1&&k!==y)return this.onEnd(k),!(this.ended=!0);H.avail_out!==0&&(H.avail_in!==0||q!==4&&q!==2)||(this.options.to==="string"?this.onData(f.buf2binstring(c.shrinkBuf(H.output,H.next_out))):this.onData(c.shrinkBuf(H.output,H.next_out)))}while((0<H.avail_in||H.avail_out===0)&&k!==1);return q===4?(k=s.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===y):q!==2||(this.onEnd(y),!(H.avail_out=0))},E.prototype.onData=function(_){this.chunks.push(_)},E.prototype.onEnd=function(_){_===y&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg},u.Deflate=E,u.deflate=T,u.deflateRaw=function(_,A){return(A=A||{}).raw=!0,T(_,A)},u.gzip=function(_,A){return(A=A||{}).gzip=!0,T(_,A)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(i,o,u){var s=i("./zlib/inflate"),c=i("./utils/common"),f=i("./utils/strings"),m=i("./zlib/constants"),h=i("./zlib/messages"),g=i("./zlib/zstream"),y=i("./zlib/gzheader"),v=Object.prototype.toString;function b(E){if(!(this instanceof b))return new b(E);this.options=c.assign({chunkSize:16384,windowBits:0,to:""},E||{});var T=this.options;T.raw&&0<=T.windowBits&&T.windowBits<16&&(T.windowBits=-T.windowBits,T.windowBits===0&&(T.windowBits=-15)),!(0<=T.windowBits&&T.windowBits<16)||E&&E.windowBits||(T.windowBits+=32),15<T.windowBits&&T.windowBits<48&&(15&T.windowBits)==0&&(T.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new g,this.strm.avail_out=0;var _=s.inflateInit2(this.strm,T.windowBits);if(_!==m.Z_OK)throw new Error(h[_]);this.header=new y,s.inflateGetHeader(this.strm,this.header)}function w(E,T){var _=new b(T);if(_.push(E,!0),_.err)throw _.msg||h[_.err];return _.result}b.prototype.push=function(E,T){var _,A,k,q,H,M,I=this.strm,Y=this.options.chunkSize,F=this.options.dictionary,$=!1;if(this.ended)return!1;A=T===~~T?T:T===!0?m.Z_FINISH:m.Z_NO_FLUSH,typeof E=="string"?I.input=f.binstring2buf(E):v.call(E)==="[object ArrayBuffer]"?I.input=new Uint8Array(E):I.input=E,I.next_in=0,I.avail_in=I.input.length;do{if(I.avail_out===0&&(I.output=new c.Buf8(Y),I.next_out=0,I.avail_out=Y),(_=s.inflate(I,m.Z_NO_FLUSH))===m.Z_NEED_DICT&&F&&(M=typeof F=="string"?f.string2buf(F):v.call(F)==="[object ArrayBuffer]"?new Uint8Array(F):F,_=s.inflateSetDictionary(this.strm,M)),_===m.Z_BUF_ERROR&&$===!0&&(_=m.Z_OK,$=!1),_!==m.Z_STREAM_END&&_!==m.Z_OK)return this.onEnd(_),!(this.ended=!0);I.next_out&&(I.avail_out!==0&&_!==m.Z_STREAM_END&&(I.avail_in!==0||A!==m.Z_FINISH&&A!==m.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=f.utf8border(I.output,I.next_out),q=I.next_out-k,H=f.buf2string(I.output,k),I.next_out=q,I.avail_out=Y-q,q&&c.arraySet(I.output,I.output,k,q,0),this.onData(H)):this.onData(c.shrinkBuf(I.output,I.next_out)))),I.avail_in===0&&I.avail_out===0&&($=!0)}while((0<I.avail_in||I.avail_out===0)&&_!==m.Z_STREAM_END);return _===m.Z_STREAM_END&&(A=m.Z_FINISH),A===m.Z_FINISH?(_=s.inflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===m.Z_OK):A!==m.Z_SYNC_FLUSH||(this.onEnd(m.Z_OK),!(I.avail_out=0))},b.prototype.onData=function(E){this.chunks.push(E)},b.prototype.onEnd=function(E){E===m.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=E,this.msg=this.strm.msg},u.Inflate=b,u.inflate=w,u.inflateRaw=function(E,T){return(T=T||{}).raw=!0,w(E,T)},u.ungzip=w},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(i,o,u){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";u.assign=function(m){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var g=h.shift();if(g){if(typeof g!="object")throw new TypeError(g+"must be non-object");for(var y in g)g.hasOwnProperty(y)&&(m[y]=g[y])}}return m},u.shrinkBuf=function(m,h){return m.length===h?m:m.subarray?m.subarray(0,h):(m.length=h,m)};var c={arraySet:function(m,h,g,y,v){if(h.subarray&&m.subarray)m.set(h.subarray(g,g+y),v);else for(var b=0;b<y;b++)m[v+b]=h[g+b]},flattenChunks:function(m){var h,g,y,v,b,w;for(h=y=0,g=m.length;h<g;h++)y+=m[h].length;for(w=new Uint8Array(y),h=v=0,g=m.length;h<g;h++)b=m[h],w.set(b,v),v+=b.length;return w}},f={arraySet:function(m,h,g,y,v){for(var b=0;b<y;b++)m[v+b]=h[g+b]},flattenChunks:function(m){return[].concat.apply([],m)}};u.setTyped=function(m){m?(u.Buf8=Uint8Array,u.Buf16=Uint16Array,u.Buf32=Int32Array,u.assign(u,c)):(u.Buf8=Array,u.Buf16=Array,u.Buf32=Array,u.assign(u,f))},u.setTyped(s)},{}],42:[function(i,o,u){var s=i("./common"),c=!0,f=!0;try{String.fromCharCode.apply(null,[0])}catch{c=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{f=!1}for(var m=new s.Buf8(256),h=0;h<256;h++)m[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;function g(y,v){if(v<65537&&(y.subarray&&f||!y.subarray&&c))return String.fromCharCode.apply(null,s.shrinkBuf(y,v));for(var b="",w=0;w<v;w++)b+=String.fromCharCode(y[w]);return b}m[254]=m[254]=1,u.string2buf=function(y){var v,b,w,E,T,_=y.length,A=0;for(E=0;E<_;E++)(64512&(b=y.charCodeAt(E)))==55296&&E+1<_&&(64512&(w=y.charCodeAt(E+1)))==56320&&(b=65536+(b-55296<<10)+(w-56320),E++),A+=b<128?1:b<2048?2:b<65536?3:4;for(v=new s.Buf8(A),E=T=0;T<A;E++)(64512&(b=y.charCodeAt(E)))==55296&&E+1<_&&(64512&(w=y.charCodeAt(E+1)))==56320&&(b=65536+(b-55296<<10)+(w-56320),E++),b<128?v[T++]=b:(b<2048?v[T++]=192|b>>>6:(b<65536?v[T++]=224|b>>>12:(v[T++]=240|b>>>18,v[T++]=128|b>>>12&63),v[T++]=128|b>>>6&63),v[T++]=128|63&b);return v},u.buf2binstring=function(y){return g(y,y.length)},u.binstring2buf=function(y){for(var v=new s.Buf8(y.length),b=0,w=v.length;b<w;b++)v[b]=y.charCodeAt(b);return v},u.buf2string=function(y,v){var b,w,E,T,_=v||y.length,A=new Array(2*_);for(b=w=0;b<_;)if((E=y[b++])<128)A[w++]=E;else if(4<(T=m[E]))A[w++]=65533,b+=T-1;else{for(E&=T===2?31:T===3?15:7;1<T&&b<_;)E=E<<6|63&y[b++],T--;1<T?A[w++]=65533:E<65536?A[w++]=E:(E-=65536,A[w++]=55296|E>>10&1023,A[w++]=56320|1023&E)}return g(A,w)},u.utf8border=function(y,v){var b;for((v=v||y.length)>y.length&&(v=y.length),b=v-1;0<=b&&(192&y[b])==128;)b--;return b<0||b===0?v:b+m[y[b]]>v?b:v}},{"./common":41}],43:[function(i,o,u){o.exports=function(s,c,f,m){for(var h=65535&s|0,g=s>>>16&65535|0,y=0;f!==0;){for(f-=y=2e3<f?2e3:f;g=g+(h=h+c[m++]|0)|0,--y;);h%=65521,g%=65521}return h|g<<16|0}},{}],44:[function(i,o,u){o.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(i,o,u){var s=(function(){for(var c,f=[],m=0;m<256;m++){c=m;for(var h=0;h<8;h++)c=1&c?3988292384^c>>>1:c>>>1;f[m]=c}return f})();o.exports=function(c,f,m,h){var g=s,y=h+m;c^=-1;for(var v=h;v<y;v++)c=c>>>8^g[255&(c^f[v])];return-1^c}},{}],46:[function(i,o,u){var s,c=i("../utils/common"),f=i("./trees"),m=i("./adler32"),h=i("./crc32"),g=i("./messages"),y=0,v=4,b=0,w=-2,E=-1,T=4,_=2,A=8,k=9,q=286,H=30,M=19,I=2*q+1,Y=15,F=3,$=258,ie=$+F+1,D=42,ne=113,C=1,V=2,Z=3,Q=4;function se(S,K){return S.msg=g[K],K}function de(S){return(S<<1)-(4<S?9:0)}function L(S){for(var K=S.length;0<=--K;)S[K]=0}function N(S){var K=S.state,W=K.pending;W>S.avail_out&&(W=S.avail_out),W!==0&&(c.arraySet(S.output,K.pending_buf,K.pending_out,W,S.next_out),S.next_out+=W,K.pending_out+=W,S.total_out+=W,S.avail_out-=W,K.pending-=W,K.pending===0&&(K.pending_out=0))}function B(S,K){f._tr_flush_block(S,0<=S.block_start?S.block_start:-1,S.strstart-S.block_start,K),S.block_start=S.strstart,N(S.strm)}function z(S,K){S.pending_buf[S.pending++]=K}function re(S,K){S.pending_buf[S.pending++]=K>>>8&255,S.pending_buf[S.pending++]=255&K}function ce(S,K){var W,U,j=S.max_chain_length,X=S.strstart,he=S.prev_length,pe=S.nice_match,le=S.strstart>S.w_size-ie?S.strstart-(S.w_size-ie):0,Ee=S.window,_e=S.w_mask,Se=S.prev,te=S.strstart+$,be=Ee[X+he-1],Ce=Ee[X+he];S.prev_length>=S.good_match&&(j>>=2),pe>S.lookahead&&(pe=S.lookahead);do if(Ee[(W=K)+he]===Ce&&Ee[W+he-1]===be&&Ee[W]===Ee[X]&&Ee[++W]===Ee[X+1]){X+=2,W++;do;while(Ee[++X]===Ee[++W]&&Ee[++X]===Ee[++W]&&Ee[++X]===Ee[++W]&&Ee[++X]===Ee[++W]&&Ee[++X]===Ee[++W]&&Ee[++X]===Ee[++W]&&Ee[++X]===Ee[++W]&&Ee[++X]===Ee[++W]&&X<te);if(U=$-(te-X),X=te-$,he<U){if(S.match_start=K,pe<=(he=U))break;be=Ee[X+he-1],Ce=Ee[X+he]}}while((K=Se[K&_e])>le&&--j!=0);return he<=S.lookahead?he:S.lookahead}function we(S){var K,W,U,j,X,he,pe,le,Ee,_e,Se=S.w_size;do{if(j=S.window_size-S.lookahead-S.strstart,S.strstart>=Se+(Se-ie)){for(c.arraySet(S.window,S.window,Se,Se,0),S.match_start-=Se,S.strstart-=Se,S.block_start-=Se,K=W=S.hash_size;U=S.head[--K],S.head[K]=Se<=U?U-Se:0,--W;);for(K=W=Se;U=S.prev[--K],S.prev[K]=Se<=U?U-Se:0,--W;);j+=Se}if(S.strm.avail_in===0)break;if(he=S.strm,pe=S.window,le=S.strstart+S.lookahead,Ee=j,_e=void 0,_e=he.avail_in,Ee<_e&&(_e=Ee),W=_e===0?0:(he.avail_in-=_e,c.arraySet(pe,he.input,he.next_in,_e,le),he.state.wrap===1?he.adler=m(he.adler,pe,_e,le):he.state.wrap===2&&(he.adler=h(he.adler,pe,_e,le)),he.next_in+=_e,he.total_in+=_e,_e),S.lookahead+=W,S.lookahead+S.insert>=F)for(X=S.strstart-S.insert,S.ins_h=S.window[X],S.ins_h=(S.ins_h<<S.hash_shift^S.window[X+1])&S.hash_mask;S.insert&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[X+F-1])&S.hash_mask,S.prev[X&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=X,X++,S.insert--,!(S.lookahead+S.insert<F)););}while(S.lookahead<ie&&S.strm.avail_in!==0)}function Te(S,K){for(var W,U;;){if(S.lookahead<ie){if(we(S),S.lookahead<ie&&K===y)return C;if(S.lookahead===0)break}if(W=0,S.lookahead>=F&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+F-1])&S.hash_mask,W=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),W!==0&&S.strstart-W<=S.w_size-ie&&(S.match_length=ce(S,W)),S.match_length>=F)if(U=f._tr_tally(S,S.strstart-S.match_start,S.match_length-F),S.lookahead-=S.match_length,S.match_length<=S.max_lazy_match&&S.lookahead>=F){for(S.match_length--;S.strstart++,S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+F-1])&S.hash_mask,W=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart,--S.match_length!=0;);S.strstart++}else S.strstart+=S.match_length,S.match_length=0,S.ins_h=S.window[S.strstart],S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+1])&S.hash_mask;else U=f._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++;if(U&&(B(S,!1),S.strm.avail_out===0))return C}return S.insert=S.strstart<F-1?S.strstart:F-1,K===v?(B(S,!0),S.strm.avail_out===0?Z:Q):S.last_lit&&(B(S,!1),S.strm.avail_out===0)?C:V}function ke(S,K){for(var W,U,j;;){if(S.lookahead<ie){if(we(S),S.lookahead<ie&&K===y)return C;if(S.lookahead===0)break}if(W=0,S.lookahead>=F&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+F-1])&S.hash_mask,W=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),S.prev_length=S.match_length,S.prev_match=S.match_start,S.match_length=F-1,W!==0&&S.prev_length<S.max_lazy_match&&S.strstart-W<=S.w_size-ie&&(S.match_length=ce(S,W),S.match_length<=5&&(S.strategy===1||S.match_length===F&&4096<S.strstart-S.match_start)&&(S.match_length=F-1)),S.prev_length>=F&&S.match_length<=S.prev_length){for(j=S.strstart+S.lookahead-F,U=f._tr_tally(S,S.strstart-1-S.prev_match,S.prev_length-F),S.lookahead-=S.prev_length-1,S.prev_length-=2;++S.strstart<=j&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+F-1])&S.hash_mask,W=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),--S.prev_length!=0;);if(S.match_available=0,S.match_length=F-1,S.strstart++,U&&(B(S,!1),S.strm.avail_out===0))return C}else if(S.match_available){if((U=f._tr_tally(S,0,S.window[S.strstart-1]))&&B(S,!1),S.strstart++,S.lookahead--,S.strm.avail_out===0)return C}else S.match_available=1,S.strstart++,S.lookahead--}return S.match_available&&(U=f._tr_tally(S,0,S.window[S.strstart-1]),S.match_available=0),S.insert=S.strstart<F-1?S.strstart:F-1,K===v?(B(S,!0),S.strm.avail_out===0?Z:Q):S.last_lit&&(B(S,!1),S.strm.avail_out===0)?C:V}function Ae(S,K,W,U,j){this.good_length=S,this.max_lazy=K,this.nice_length=W,this.max_chain=U,this.func=j}function He(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=A,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new c.Buf16(2*I),this.dyn_dtree=new c.Buf16(2*(2*H+1)),this.bl_tree=new c.Buf16(2*(2*M+1)),L(this.dyn_ltree),L(this.dyn_dtree),L(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new c.Buf16(Y+1),this.heap=new c.Buf16(2*q+1),L(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new c.Buf16(2*q+1),L(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ve(S){var K;return S&&S.state?(S.total_in=S.total_out=0,S.data_type=_,(K=S.state).pending=0,K.pending_out=0,K.wrap<0&&(K.wrap=-K.wrap),K.status=K.wrap?D:ne,S.adler=K.wrap===2?0:1,K.last_flush=y,f._tr_init(K),b):se(S,w)}function ze(S){var K=ve(S);return K===b&&(function(W){W.window_size=2*W.w_size,L(W.head),W.max_lazy_match=s[W.level].max_lazy,W.good_match=s[W.level].good_length,W.nice_match=s[W.level].nice_length,W.max_chain_length=s[W.level].max_chain,W.strstart=0,W.block_start=0,W.lookahead=0,W.insert=0,W.match_length=W.prev_length=F-1,W.match_available=0,W.ins_h=0})(S.state),K}function je(S,K,W,U,j,X){if(!S)return w;var he=1;if(K===E&&(K=6),U<0?(he=0,U=-U):15<U&&(he=2,U-=16),j<1||k<j||W!==A||U<8||15<U||K<0||9<K||X<0||T<X)return se(S,w);U===8&&(U=9);var pe=new He;return(S.state=pe).strm=S,pe.wrap=he,pe.gzhead=null,pe.w_bits=U,pe.w_size=1<<pe.w_bits,pe.w_mask=pe.w_size-1,pe.hash_bits=j+7,pe.hash_size=1<<pe.hash_bits,pe.hash_mask=pe.hash_size-1,pe.hash_shift=~~((pe.hash_bits+F-1)/F),pe.window=new c.Buf8(2*pe.w_size),pe.head=new c.Buf16(pe.hash_size),pe.prev=new c.Buf16(pe.w_size),pe.lit_bufsize=1<<j+6,pe.pending_buf_size=4*pe.lit_bufsize,pe.pending_buf=new c.Buf8(pe.pending_buf_size),pe.d_buf=1*pe.lit_bufsize,pe.l_buf=3*pe.lit_bufsize,pe.level=K,pe.strategy=X,pe.method=W,ze(S)}s=[new Ae(0,0,0,0,function(S,K){var W=65535;for(W>S.pending_buf_size-5&&(W=S.pending_buf_size-5);;){if(S.lookahead<=1){if(we(S),S.lookahead===0&&K===y)return C;if(S.lookahead===0)break}S.strstart+=S.lookahead,S.lookahead=0;var U=S.block_start+W;if((S.strstart===0||S.strstart>=U)&&(S.lookahead=S.strstart-U,S.strstart=U,B(S,!1),S.strm.avail_out===0)||S.strstart-S.block_start>=S.w_size-ie&&(B(S,!1),S.strm.avail_out===0))return C}return S.insert=0,K===v?(B(S,!0),S.strm.avail_out===0?Z:Q):(S.strstart>S.block_start&&(B(S,!1),S.strm.avail_out),C)}),new Ae(4,4,8,4,Te),new Ae(4,5,16,8,Te),new Ae(4,6,32,32,Te),new Ae(4,4,16,16,ke),new Ae(8,16,32,32,ke),new Ae(8,16,128,128,ke),new Ae(8,32,128,256,ke),new Ae(32,128,258,1024,ke),new Ae(32,258,258,4096,ke)],u.deflateInit=function(S,K){return je(S,K,A,15,8,0)},u.deflateInit2=je,u.deflateReset=ze,u.deflateResetKeep=ve,u.deflateSetHeader=function(S,K){return S&&S.state?S.state.wrap!==2?w:(S.state.gzhead=K,b):w},u.deflate=function(S,K){var W,U,j,X;if(!S||!S.state||5<K||K<0)return S?se(S,w):w;if(U=S.state,!S.output||!S.input&&S.avail_in!==0||U.status===666&&K!==v)return se(S,S.avail_out===0?-5:w);if(U.strm=S,W=U.last_flush,U.last_flush=K,U.status===D)if(U.wrap===2)S.adler=0,z(U,31),z(U,139),z(U,8),U.gzhead?(z(U,(U.gzhead.text?1:0)+(U.gzhead.hcrc?2:0)+(U.gzhead.extra?4:0)+(U.gzhead.name?8:0)+(U.gzhead.comment?16:0)),z(U,255&U.gzhead.time),z(U,U.gzhead.time>>8&255),z(U,U.gzhead.time>>16&255),z(U,U.gzhead.time>>24&255),z(U,U.level===9?2:2<=U.strategy||U.level<2?4:0),z(U,255&U.gzhead.os),U.gzhead.extra&&U.gzhead.extra.length&&(z(U,255&U.gzhead.extra.length),z(U,U.gzhead.extra.length>>8&255)),U.gzhead.hcrc&&(S.adler=h(S.adler,U.pending_buf,U.pending,0)),U.gzindex=0,U.status=69):(z(U,0),z(U,0),z(U,0),z(U,0),z(U,0),z(U,U.level===9?2:2<=U.strategy||U.level<2?4:0),z(U,3),U.status=ne);else{var he=A+(U.w_bits-8<<4)<<8;he|=(2<=U.strategy||U.level<2?0:U.level<6?1:U.level===6?2:3)<<6,U.strstart!==0&&(he|=32),he+=31-he%31,U.status=ne,re(U,he),U.strstart!==0&&(re(U,S.adler>>>16),re(U,65535&S.adler)),S.adler=1}if(U.status===69)if(U.gzhead.extra){for(j=U.pending;U.gzindex<(65535&U.gzhead.extra.length)&&(U.pending!==U.pending_buf_size||(U.gzhead.hcrc&&U.pending>j&&(S.adler=h(S.adler,U.pending_buf,U.pending-j,j)),N(S),j=U.pending,U.pending!==U.pending_buf_size));)z(U,255&U.gzhead.extra[U.gzindex]),U.gzindex++;U.gzhead.hcrc&&U.pending>j&&(S.adler=h(S.adler,U.pending_buf,U.pending-j,j)),U.gzindex===U.gzhead.extra.length&&(U.gzindex=0,U.status=73)}else U.status=73;if(U.status===73)if(U.gzhead.name){j=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>j&&(S.adler=h(S.adler,U.pending_buf,U.pending-j,j)),N(S),j=U.pending,U.pending===U.pending_buf_size)){X=1;break}X=U.gzindex<U.gzhead.name.length?255&U.gzhead.name.charCodeAt(U.gzindex++):0,z(U,X)}while(X!==0);U.gzhead.hcrc&&U.pending>j&&(S.adler=h(S.adler,U.pending_buf,U.pending-j,j)),X===0&&(U.gzindex=0,U.status=91)}else U.status=91;if(U.status===91)if(U.gzhead.comment){j=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>j&&(S.adler=h(S.adler,U.pending_buf,U.pending-j,j)),N(S),j=U.pending,U.pending===U.pending_buf_size)){X=1;break}X=U.gzindex<U.gzhead.comment.length?255&U.gzhead.comment.charCodeAt(U.gzindex++):0,z(U,X)}while(X!==0);U.gzhead.hcrc&&U.pending>j&&(S.adler=h(S.adler,U.pending_buf,U.pending-j,j)),X===0&&(U.status=103)}else U.status=103;if(U.status===103&&(U.gzhead.hcrc?(U.pending+2>U.pending_buf_size&&N(S),U.pending+2<=U.pending_buf_size&&(z(U,255&S.adler),z(U,S.adler>>8&255),S.adler=0,U.status=ne)):U.status=ne),U.pending!==0){if(N(S),S.avail_out===0)return U.last_flush=-1,b}else if(S.avail_in===0&&de(K)<=de(W)&&K!==v)return se(S,-5);if(U.status===666&&S.avail_in!==0)return se(S,-5);if(S.avail_in!==0||U.lookahead!==0||K!==y&&U.status!==666){var pe=U.strategy===2?(function(le,Ee){for(var _e;;){if(le.lookahead===0&&(we(le),le.lookahead===0)){if(Ee===y)return C;break}if(le.match_length=0,_e=f._tr_tally(le,0,le.window[le.strstart]),le.lookahead--,le.strstart++,_e&&(B(le,!1),le.strm.avail_out===0))return C}return le.insert=0,Ee===v?(B(le,!0),le.strm.avail_out===0?Z:Q):le.last_lit&&(B(le,!1),le.strm.avail_out===0)?C:V})(U,K):U.strategy===3?(function(le,Ee){for(var _e,Se,te,be,Ce=le.window;;){if(le.lookahead<=$){if(we(le),le.lookahead<=$&&Ee===y)return C;if(le.lookahead===0)break}if(le.match_length=0,le.lookahead>=F&&0<le.strstart&&(Se=Ce[te=le.strstart-1])===Ce[++te]&&Se===Ce[++te]&&Se===Ce[++te]){be=le.strstart+$;do;while(Se===Ce[++te]&&Se===Ce[++te]&&Se===Ce[++te]&&Se===Ce[++te]&&Se===Ce[++te]&&Se===Ce[++te]&&Se===Ce[++te]&&Se===Ce[++te]&&te<be);le.match_length=$-(be-te),le.match_length>le.lookahead&&(le.match_length=le.lookahead)}if(le.match_length>=F?(_e=f._tr_tally(le,1,le.match_length-F),le.lookahead-=le.match_length,le.strstart+=le.match_length,le.match_length=0):(_e=f._tr_tally(le,0,le.window[le.strstart]),le.lookahead--,le.strstart++),_e&&(B(le,!1),le.strm.avail_out===0))return C}return le.insert=0,Ee===v?(B(le,!0),le.strm.avail_out===0?Z:Q):le.last_lit&&(B(le,!1),le.strm.avail_out===0)?C:V})(U,K):s[U.level].func(U,K);if(pe!==Z&&pe!==Q||(U.status=666),pe===C||pe===Z)return S.avail_out===0&&(U.last_flush=-1),b;if(pe===V&&(K===1?f._tr_align(U):K!==5&&(f._tr_stored_block(U,0,0,!1),K===3&&(L(U.head),U.lookahead===0&&(U.strstart=0,U.block_start=0,U.insert=0))),N(S),S.avail_out===0))return U.last_flush=-1,b}return K!==v?b:U.wrap<=0?1:(U.wrap===2?(z(U,255&S.adler),z(U,S.adler>>8&255),z(U,S.adler>>16&255),z(U,S.adler>>24&255),z(U,255&S.total_in),z(U,S.total_in>>8&255),z(U,S.total_in>>16&255),z(U,S.total_in>>24&255)):(re(U,S.adler>>>16),re(U,65535&S.adler)),N(S),0<U.wrap&&(U.wrap=-U.wrap),U.pending!==0?b:1)},u.deflateEnd=function(S){var K;return S&&S.state?(K=S.state.status)!==D&&K!==69&&K!==73&&K!==91&&K!==103&&K!==ne&&K!==666?se(S,w):(S.state=null,K===ne?se(S,-3):b):w},u.deflateSetDictionary=function(S,K){var W,U,j,X,he,pe,le,Ee,_e=K.length;if(!S||!S.state||(X=(W=S.state).wrap)===2||X===1&&W.status!==D||W.lookahead)return w;for(X===1&&(S.adler=m(S.adler,K,_e,0)),W.wrap=0,_e>=W.w_size&&(X===0&&(L(W.head),W.strstart=0,W.block_start=0,W.insert=0),Ee=new c.Buf8(W.w_size),c.arraySet(Ee,K,_e-W.w_size,W.w_size,0),K=Ee,_e=W.w_size),he=S.avail_in,pe=S.next_in,le=S.input,S.avail_in=_e,S.next_in=0,S.input=K,we(W);W.lookahead>=F;){for(U=W.strstart,j=W.lookahead-(F-1);W.ins_h=(W.ins_h<<W.hash_shift^W.window[U+F-1])&W.hash_mask,W.prev[U&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=U,U++,--j;);W.strstart=U,W.lookahead=F-1,we(W)}return W.strstart+=W.lookahead,W.block_start=W.strstart,W.insert=W.lookahead,W.lookahead=0,W.match_length=W.prev_length=F-1,W.match_available=0,S.next_in=pe,S.input=le,S.avail_in=he,W.wrap=X,b},u.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(i,o,u){o.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(i,o,u){o.exports=function(s,c){var f,m,h,g,y,v,b,w,E,T,_,A,k,q,H,M,I,Y,F,$,ie,D,ne,C,V;f=s.state,m=s.next_in,C=s.input,h=m+(s.avail_in-5),g=s.next_out,V=s.output,y=g-(c-s.avail_out),v=g+(s.avail_out-257),b=f.dmax,w=f.wsize,E=f.whave,T=f.wnext,_=f.window,A=f.hold,k=f.bits,q=f.lencode,H=f.distcode,M=(1<<f.lenbits)-1,I=(1<<f.distbits)-1;e:do{k<15&&(A+=C[m++]<<k,k+=8,A+=C[m++]<<k,k+=8),Y=q[A&M];t:for(;;){if(A>>>=F=Y>>>24,k-=F,(F=Y>>>16&255)===0)V[g++]=65535&Y;else{if(!(16&F)){if((64&F)==0){Y=q[(65535&Y)+(A&(1<<F)-1)];continue t}if(32&F){f.mode=12;break e}s.msg="invalid literal/length code",f.mode=30;break e}$=65535&Y,(F&=15)&&(k<F&&(A+=C[m++]<<k,k+=8),$+=A&(1<<F)-1,A>>>=F,k-=F),k<15&&(A+=C[m++]<<k,k+=8,A+=C[m++]<<k,k+=8),Y=H[A&I];n:for(;;){if(A>>>=F=Y>>>24,k-=F,!(16&(F=Y>>>16&255))){if((64&F)==0){Y=H[(65535&Y)+(A&(1<<F)-1)];continue n}s.msg="invalid distance code",f.mode=30;break e}if(ie=65535&Y,k<(F&=15)&&(A+=C[m++]<<k,(k+=8)<F&&(A+=C[m++]<<k,k+=8)),b<(ie+=A&(1<<F)-1)){s.msg="invalid distance too far back",f.mode=30;break e}if(A>>>=F,k-=F,(F=g-y)<ie){if(E<(F=ie-F)&&f.sane){s.msg="invalid distance too far back",f.mode=30;break e}if(ne=_,(D=0)===T){if(D+=w-F,F<$){for($-=F;V[g++]=_[D++],--F;);D=g-ie,ne=V}}else if(T<F){if(D+=w+T-F,(F-=T)<$){for($-=F;V[g++]=_[D++],--F;);if(D=0,T<$){for($-=F=T;V[g++]=_[D++],--F;);D=g-ie,ne=V}}}else if(D+=T-F,F<$){for($-=F;V[g++]=_[D++],--F;);D=g-ie,ne=V}for(;2<$;)V[g++]=ne[D++],V[g++]=ne[D++],V[g++]=ne[D++],$-=3;$&&(V[g++]=ne[D++],1<$&&(V[g++]=ne[D++]))}else{for(D=g-ie;V[g++]=V[D++],V[g++]=V[D++],V[g++]=V[D++],2<($-=3););$&&(V[g++]=V[D++],1<$&&(V[g++]=V[D++]))}break}}break}}while(m<h&&g<v);m-=$=k>>3,A&=(1<<(k-=$<<3))-1,s.next_in=m,s.next_out=g,s.avail_in=m<h?h-m+5:5-(m-h),s.avail_out=g<v?v-g+257:257-(g-v),f.hold=A,f.bits=k}},{}],49:[function(i,o,u){var s=i("../utils/common"),c=i("./adler32"),f=i("./crc32"),m=i("./inffast"),h=i("./inftrees"),g=1,y=2,v=0,b=-2,w=1,E=852,T=592;function _(D){return(D>>>24&255)+(D>>>8&65280)+((65280&D)<<8)+((255&D)<<24)}function A(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(D){var ne;return D&&D.state?(ne=D.state,D.total_in=D.total_out=ne.total=0,D.msg="",ne.wrap&&(D.adler=1&ne.wrap),ne.mode=w,ne.last=0,ne.havedict=0,ne.dmax=32768,ne.head=null,ne.hold=0,ne.bits=0,ne.lencode=ne.lendyn=new s.Buf32(E),ne.distcode=ne.distdyn=new s.Buf32(T),ne.sane=1,ne.back=-1,v):b}function q(D){var ne;return D&&D.state?((ne=D.state).wsize=0,ne.whave=0,ne.wnext=0,k(D)):b}function H(D,ne){var C,V;return D&&D.state?(V=D.state,ne<0?(C=0,ne=-ne):(C=1+(ne>>4),ne<48&&(ne&=15)),ne&&(ne<8||15<ne)?b:(V.window!==null&&V.wbits!==ne&&(V.window=null),V.wrap=C,V.wbits=ne,q(D))):b}function M(D,ne){var C,V;return D?(V=new A,(D.state=V).window=null,(C=H(D,ne))!==v&&(D.state=null),C):b}var I,Y,F=!0;function $(D){if(F){var ne;for(I=new s.Buf32(512),Y=new s.Buf32(32),ne=0;ne<144;)D.lens[ne++]=8;for(;ne<256;)D.lens[ne++]=9;for(;ne<280;)D.lens[ne++]=7;for(;ne<288;)D.lens[ne++]=8;for(h(g,D.lens,0,288,I,0,D.work,{bits:9}),ne=0;ne<32;)D.lens[ne++]=5;h(y,D.lens,0,32,Y,0,D.work,{bits:5}),F=!1}D.lencode=I,D.lenbits=9,D.distcode=Y,D.distbits=5}function ie(D,ne,C,V){var Z,Q=D.state;return Q.window===null&&(Q.wsize=1<<Q.wbits,Q.wnext=0,Q.whave=0,Q.window=new s.Buf8(Q.wsize)),V>=Q.wsize?(s.arraySet(Q.window,ne,C-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize):(V<(Z=Q.wsize-Q.wnext)&&(Z=V),s.arraySet(Q.window,ne,C-V,Z,Q.wnext),(V-=Z)?(s.arraySet(Q.window,ne,C-V,V,0),Q.wnext=V,Q.whave=Q.wsize):(Q.wnext+=Z,Q.wnext===Q.wsize&&(Q.wnext=0),Q.whave<Q.wsize&&(Q.whave+=Z))),0}u.inflateReset=q,u.inflateReset2=H,u.inflateResetKeep=k,u.inflateInit=function(D){return M(D,15)},u.inflateInit2=M,u.inflate=function(D,ne){var C,V,Z,Q,se,de,L,N,B,z,re,ce,we,Te,ke,Ae,He,ve,ze,je,S,K,W,U,j=0,X=new s.Buf8(4),he=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!D||!D.state||!D.output||!D.input&&D.avail_in!==0)return b;(C=D.state).mode===12&&(C.mode=13),se=D.next_out,Z=D.output,L=D.avail_out,Q=D.next_in,V=D.input,de=D.avail_in,N=C.hold,B=C.bits,z=de,re=L,K=v;e:for(;;)switch(C.mode){case w:if(C.wrap===0){C.mode=13;break}for(;B<16;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}if(2&C.wrap&&N===35615){X[C.check=0]=255&N,X[1]=N>>>8&255,C.check=f(C.check,X,2,0),B=N=0,C.mode=2;break}if(C.flags=0,C.head&&(C.head.done=!1),!(1&C.wrap)||(((255&N)<<8)+(N>>8))%31){D.msg="incorrect header check",C.mode=30;break}if((15&N)!=8){D.msg="unknown compression method",C.mode=30;break}if(B-=4,S=8+(15&(N>>>=4)),C.wbits===0)C.wbits=S;else if(S>C.wbits){D.msg="invalid window size",C.mode=30;break}C.dmax=1<<S,D.adler=C.check=1,C.mode=512&N?10:12,B=N=0;break;case 2:for(;B<16;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}if(C.flags=N,(255&C.flags)!=8){D.msg="unknown compression method",C.mode=30;break}if(57344&C.flags){D.msg="unknown header flags set",C.mode=30;break}C.head&&(C.head.text=N>>8&1),512&C.flags&&(X[0]=255&N,X[1]=N>>>8&255,C.check=f(C.check,X,2,0)),B=N=0,C.mode=3;case 3:for(;B<32;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}C.head&&(C.head.time=N),512&C.flags&&(X[0]=255&N,X[1]=N>>>8&255,X[2]=N>>>16&255,X[3]=N>>>24&255,C.check=f(C.check,X,4,0)),B=N=0,C.mode=4;case 4:for(;B<16;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}C.head&&(C.head.xflags=255&N,C.head.os=N>>8),512&C.flags&&(X[0]=255&N,X[1]=N>>>8&255,C.check=f(C.check,X,2,0)),B=N=0,C.mode=5;case 5:if(1024&C.flags){for(;B<16;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}C.length=N,C.head&&(C.head.extra_len=N),512&C.flags&&(X[0]=255&N,X[1]=N>>>8&255,C.check=f(C.check,X,2,0)),B=N=0}else C.head&&(C.head.extra=null);C.mode=6;case 6:if(1024&C.flags&&(de<(ce=C.length)&&(ce=de),ce&&(C.head&&(S=C.head.extra_len-C.length,C.head.extra||(C.head.extra=new Array(C.head.extra_len)),s.arraySet(C.head.extra,V,Q,ce,S)),512&C.flags&&(C.check=f(C.check,V,ce,Q)),de-=ce,Q+=ce,C.length-=ce),C.length))break e;C.length=0,C.mode=7;case 7:if(2048&C.flags){if(de===0)break e;for(ce=0;S=V[Q+ce++],C.head&&S&&C.length<65536&&(C.head.name+=String.fromCharCode(S)),S&&ce<de;);if(512&C.flags&&(C.check=f(C.check,V,ce,Q)),de-=ce,Q+=ce,S)break e}else C.head&&(C.head.name=null);C.length=0,C.mode=8;case 8:if(4096&C.flags){if(de===0)break e;for(ce=0;S=V[Q+ce++],C.head&&S&&C.length<65536&&(C.head.comment+=String.fromCharCode(S)),S&&ce<de;);if(512&C.flags&&(C.check=f(C.check,V,ce,Q)),de-=ce,Q+=ce,S)break e}else C.head&&(C.head.comment=null);C.mode=9;case 9:if(512&C.flags){for(;B<16;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}if(N!==(65535&C.check)){D.msg="header crc mismatch",C.mode=30;break}B=N=0}C.head&&(C.head.hcrc=C.flags>>9&1,C.head.done=!0),D.adler=C.check=0,C.mode=12;break;case 10:for(;B<32;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}D.adler=C.check=_(N),B=N=0,C.mode=11;case 11:if(C.havedict===0)return D.next_out=se,D.avail_out=L,D.next_in=Q,D.avail_in=de,C.hold=N,C.bits=B,2;D.adler=C.check=1,C.mode=12;case 12:if(ne===5||ne===6)break e;case 13:if(C.last){N>>>=7&B,B-=7&B,C.mode=27;break}for(;B<3;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}switch(C.last=1&N,B-=1,3&(N>>>=1)){case 0:C.mode=14;break;case 1:if($(C),C.mode=20,ne!==6)break;N>>>=2,B-=2;break e;case 2:C.mode=17;break;case 3:D.msg="invalid block type",C.mode=30}N>>>=2,B-=2;break;case 14:for(N>>>=7&B,B-=7&B;B<32;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}if((65535&N)!=(N>>>16^65535)){D.msg="invalid stored block lengths",C.mode=30;break}if(C.length=65535&N,B=N=0,C.mode=15,ne===6)break e;case 15:C.mode=16;case 16:if(ce=C.length){if(de<ce&&(ce=de),L<ce&&(ce=L),ce===0)break e;s.arraySet(Z,V,Q,ce,se),de-=ce,Q+=ce,L-=ce,se+=ce,C.length-=ce;break}C.mode=12;break;case 17:for(;B<14;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}if(C.nlen=257+(31&N),N>>>=5,B-=5,C.ndist=1+(31&N),N>>>=5,B-=5,C.ncode=4+(15&N),N>>>=4,B-=4,286<C.nlen||30<C.ndist){D.msg="too many length or distance symbols",C.mode=30;break}C.have=0,C.mode=18;case 18:for(;C.have<C.ncode;){for(;B<3;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}C.lens[he[C.have++]]=7&N,N>>>=3,B-=3}for(;C.have<19;)C.lens[he[C.have++]]=0;if(C.lencode=C.lendyn,C.lenbits=7,W={bits:C.lenbits},K=h(0,C.lens,0,19,C.lencode,0,C.work,W),C.lenbits=W.bits,K){D.msg="invalid code lengths set",C.mode=30;break}C.have=0,C.mode=19;case 19:for(;C.have<C.nlen+C.ndist;){for(;Ae=(j=C.lencode[N&(1<<C.lenbits)-1])>>>16&255,He=65535&j,!((ke=j>>>24)<=B);){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}if(He<16)N>>>=ke,B-=ke,C.lens[C.have++]=He;else{if(He===16){for(U=ke+2;B<U;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}if(N>>>=ke,B-=ke,C.have===0){D.msg="invalid bit length repeat",C.mode=30;break}S=C.lens[C.have-1],ce=3+(3&N),N>>>=2,B-=2}else if(He===17){for(U=ke+3;B<U;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}B-=ke,S=0,ce=3+(7&(N>>>=ke)),N>>>=3,B-=3}else{for(U=ke+7;B<U;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}B-=ke,S=0,ce=11+(127&(N>>>=ke)),N>>>=7,B-=7}if(C.have+ce>C.nlen+C.ndist){D.msg="invalid bit length repeat",C.mode=30;break}for(;ce--;)C.lens[C.have++]=S}}if(C.mode===30)break;if(C.lens[256]===0){D.msg="invalid code -- missing end-of-block",C.mode=30;break}if(C.lenbits=9,W={bits:C.lenbits},K=h(g,C.lens,0,C.nlen,C.lencode,0,C.work,W),C.lenbits=W.bits,K){D.msg="invalid literal/lengths set",C.mode=30;break}if(C.distbits=6,C.distcode=C.distdyn,W={bits:C.distbits},K=h(y,C.lens,C.nlen,C.ndist,C.distcode,0,C.work,W),C.distbits=W.bits,K){D.msg="invalid distances set",C.mode=30;break}if(C.mode=20,ne===6)break e;case 20:C.mode=21;case 21:if(6<=de&&258<=L){D.next_out=se,D.avail_out=L,D.next_in=Q,D.avail_in=de,C.hold=N,C.bits=B,m(D,re),se=D.next_out,Z=D.output,L=D.avail_out,Q=D.next_in,V=D.input,de=D.avail_in,N=C.hold,B=C.bits,C.mode===12&&(C.back=-1);break}for(C.back=0;Ae=(j=C.lencode[N&(1<<C.lenbits)-1])>>>16&255,He=65535&j,!((ke=j>>>24)<=B);){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}if(Ae&&(240&Ae)==0){for(ve=ke,ze=Ae,je=He;Ae=(j=C.lencode[je+((N&(1<<ve+ze)-1)>>ve)])>>>16&255,He=65535&j,!(ve+(ke=j>>>24)<=B);){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}N>>>=ve,B-=ve,C.back+=ve}if(N>>>=ke,B-=ke,C.back+=ke,C.length=He,Ae===0){C.mode=26;break}if(32&Ae){C.back=-1,C.mode=12;break}if(64&Ae){D.msg="invalid literal/length code",C.mode=30;break}C.extra=15&Ae,C.mode=22;case 22:if(C.extra){for(U=C.extra;B<U;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}C.length+=N&(1<<C.extra)-1,N>>>=C.extra,B-=C.extra,C.back+=C.extra}C.was=C.length,C.mode=23;case 23:for(;Ae=(j=C.distcode[N&(1<<C.distbits)-1])>>>16&255,He=65535&j,!((ke=j>>>24)<=B);){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}if((240&Ae)==0){for(ve=ke,ze=Ae,je=He;Ae=(j=C.distcode[je+((N&(1<<ve+ze)-1)>>ve)])>>>16&255,He=65535&j,!(ve+(ke=j>>>24)<=B);){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}N>>>=ve,B-=ve,C.back+=ve}if(N>>>=ke,B-=ke,C.back+=ke,64&Ae){D.msg="invalid distance code",C.mode=30;break}C.offset=He,C.extra=15&Ae,C.mode=24;case 24:if(C.extra){for(U=C.extra;B<U;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}C.offset+=N&(1<<C.extra)-1,N>>>=C.extra,B-=C.extra,C.back+=C.extra}if(C.offset>C.dmax){D.msg="invalid distance too far back",C.mode=30;break}C.mode=25;case 25:if(L===0)break e;if(ce=re-L,C.offset>ce){if((ce=C.offset-ce)>C.whave&&C.sane){D.msg="invalid distance too far back",C.mode=30;break}we=ce>C.wnext?(ce-=C.wnext,C.wsize-ce):C.wnext-ce,ce>C.length&&(ce=C.length),Te=C.window}else Te=Z,we=se-C.offset,ce=C.length;for(L<ce&&(ce=L),L-=ce,C.length-=ce;Z[se++]=Te[we++],--ce;);C.length===0&&(C.mode=21);break;case 26:if(L===0)break e;Z[se++]=C.length,L--,C.mode=21;break;case 27:if(C.wrap){for(;B<32;){if(de===0)break e;de--,N|=V[Q++]<<B,B+=8}if(re-=L,D.total_out+=re,C.total+=re,re&&(D.adler=C.check=C.flags?f(C.check,Z,re,se-re):c(C.check,Z,re,se-re)),re=L,(C.flags?N:_(N))!==C.check){D.msg="incorrect data check",C.mode=30;break}B=N=0}C.mode=28;case 28:if(C.wrap&&C.flags){for(;B<32;){if(de===0)break e;de--,N+=V[Q++]<<B,B+=8}if(N!==(4294967295&C.total)){D.msg="incorrect length check",C.mode=30;break}B=N=0}C.mode=29;case 29:K=1;break e;case 30:K=-3;break e;case 31:return-4;case 32:default:return b}return D.next_out=se,D.avail_out=L,D.next_in=Q,D.avail_in=de,C.hold=N,C.bits=B,(C.wsize||re!==D.avail_out&&C.mode<30&&(C.mode<27||ne!==4))&&ie(D,D.output,D.next_out,re-D.avail_out)?(C.mode=31,-4):(z-=D.avail_in,re-=D.avail_out,D.total_in+=z,D.total_out+=re,C.total+=re,C.wrap&&re&&(D.adler=C.check=C.flags?f(C.check,Z,re,D.next_out-re):c(C.check,Z,re,D.next_out-re)),D.data_type=C.bits+(C.last?64:0)+(C.mode===12?128:0)+(C.mode===20||C.mode===15?256:0),(z==0&&re===0||ne===4)&&K===v&&(K=-5),K)},u.inflateEnd=function(D){if(!D||!D.state)return b;var ne=D.state;return ne.window&&(ne.window=null),D.state=null,v},u.inflateGetHeader=function(D,ne){var C;return D&&D.state?(2&(C=D.state).wrap)==0?b:((C.head=ne).done=!1,v):b},u.inflateSetDictionary=function(D,ne){var C,V=ne.length;return D&&D.state?(C=D.state).wrap!==0&&C.mode!==11?b:C.mode===11&&c(1,ne,V,0)!==C.check?-3:ie(D,ne,V,V)?(C.mode=31,-4):(C.havedict=1,v):b},u.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(i,o,u){var s=i("../utils/common"),c=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],m=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],h=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];o.exports=function(g,y,v,b,w,E,T,_){var A,k,q,H,M,I,Y,F,$,ie=_.bits,D=0,ne=0,C=0,V=0,Z=0,Q=0,se=0,de=0,L=0,N=0,B=null,z=0,re=new s.Buf16(16),ce=new s.Buf16(16),we=null,Te=0;for(D=0;D<=15;D++)re[D]=0;for(ne=0;ne<b;ne++)re[y[v+ne]]++;for(Z=ie,V=15;1<=V&&re[V]===0;V--);if(V<Z&&(Z=V),V===0)return w[E++]=20971520,w[E++]=20971520,_.bits=1,0;for(C=1;C<V&&re[C]===0;C++);for(Z<C&&(Z=C),D=de=1;D<=15;D++)if(de<<=1,(de-=re[D])<0)return-1;if(0<de&&(g===0||V!==1))return-1;for(ce[1]=0,D=1;D<15;D++)ce[D+1]=ce[D]+re[D];for(ne=0;ne<b;ne++)y[v+ne]!==0&&(T[ce[y[v+ne]]++]=ne);if(I=g===0?(B=we=T,19):g===1?(B=c,z-=257,we=f,Te-=257,256):(B=m,we=h,-1),D=C,M=E,se=ne=N=0,q=-1,H=(L=1<<(Q=Z))-1,g===1&&852<L||g===2&&592<L)return 1;for(;;){for(Y=D-se,$=T[ne]<I?(F=0,T[ne]):T[ne]>I?(F=we[Te+T[ne]],B[z+T[ne]]):(F=96,0),A=1<<D-se,C=k=1<<Q;w[M+(N>>se)+(k-=A)]=Y<<24|F<<16|$|0,k!==0;);for(A=1<<D-1;N&A;)A>>=1;if(A!==0?(N&=A-1,N+=A):N=0,ne++,--re[D]==0){if(D===V)break;D=y[v+T[ne]]}if(Z<D&&(N&H)!==q){for(se===0&&(se=Z),M+=C,de=1<<(Q=D-se);Q+se<V&&!((de-=re[Q+se])<=0);)Q++,de<<=1;if(L+=1<<Q,g===1&&852<L||g===2&&592<L)return 1;w[q=N&H]=Z<<24|Q<<16|M-E|0}}return N!==0&&(w[M+N]=D-se<<24|4194304|0),_.bits=Z,0}},{"../utils/common":41}],51:[function(i,o,u){o.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(i,o,u){var s=i("../utils/common"),c=0,f=1;function m(j){for(var X=j.length;0<=--X;)j[X]=0}var h=0,g=29,y=256,v=y+1+g,b=30,w=19,E=2*v+1,T=15,_=16,A=7,k=256,q=16,H=17,M=18,I=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Y=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],$=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ie=new Array(2*(v+2));m(ie);var D=new Array(2*b);m(D);var ne=new Array(512);m(ne);var C=new Array(256);m(C);var V=new Array(g);m(V);var Z,Q,se,de=new Array(b);function L(j,X,he,pe,le){this.static_tree=j,this.extra_bits=X,this.extra_base=he,this.elems=pe,this.max_length=le,this.has_stree=j&&j.length}function N(j,X){this.dyn_tree=j,this.max_code=0,this.stat_desc=X}function B(j){return j<256?ne[j]:ne[256+(j>>>7)]}function z(j,X){j.pending_buf[j.pending++]=255&X,j.pending_buf[j.pending++]=X>>>8&255}function re(j,X,he){j.bi_valid>_-he?(j.bi_buf|=X<<j.bi_valid&65535,z(j,j.bi_buf),j.bi_buf=X>>_-j.bi_valid,j.bi_valid+=he-_):(j.bi_buf|=X<<j.bi_valid&65535,j.bi_valid+=he)}function ce(j,X,he){re(j,he[2*X],he[2*X+1])}function we(j,X){for(var he=0;he|=1&j,j>>>=1,he<<=1,0<--X;);return he>>>1}function Te(j,X,he){var pe,le,Ee=new Array(T+1),_e=0;for(pe=1;pe<=T;pe++)Ee[pe]=_e=_e+he[pe-1]<<1;for(le=0;le<=X;le++){var Se=j[2*le+1];Se!==0&&(j[2*le]=we(Ee[Se]++,Se))}}function ke(j){var X;for(X=0;X<v;X++)j.dyn_ltree[2*X]=0;for(X=0;X<b;X++)j.dyn_dtree[2*X]=0;for(X=0;X<w;X++)j.bl_tree[2*X]=0;j.dyn_ltree[2*k]=1,j.opt_len=j.static_len=0,j.last_lit=j.matches=0}function Ae(j){8<j.bi_valid?z(j,j.bi_buf):0<j.bi_valid&&(j.pending_buf[j.pending++]=j.bi_buf),j.bi_buf=0,j.bi_valid=0}function He(j,X,he,pe){var le=2*X,Ee=2*he;return j[le]<j[Ee]||j[le]===j[Ee]&&pe[X]<=pe[he]}function ve(j,X,he){for(var pe=j.heap[he],le=he<<1;le<=j.heap_len&&(le<j.heap_len&&He(X,j.heap[le+1],j.heap[le],j.depth)&&le++,!He(X,pe,j.heap[le],j.depth));)j.heap[he]=j.heap[le],he=le,le<<=1;j.heap[he]=pe}function ze(j,X,he){var pe,le,Ee,_e,Se=0;if(j.last_lit!==0)for(;pe=j.pending_buf[j.d_buf+2*Se]<<8|j.pending_buf[j.d_buf+2*Se+1],le=j.pending_buf[j.l_buf+Se],Se++,pe===0?ce(j,le,X):(ce(j,(Ee=C[le])+y+1,X),(_e=I[Ee])!==0&&re(j,le-=V[Ee],_e),ce(j,Ee=B(--pe),he),(_e=Y[Ee])!==0&&re(j,pe-=de[Ee],_e)),Se<j.last_lit;);ce(j,k,X)}function je(j,X){var he,pe,le,Ee=X.dyn_tree,_e=X.stat_desc.static_tree,Se=X.stat_desc.has_stree,te=X.stat_desc.elems,be=-1;for(j.heap_len=0,j.heap_max=E,he=0;he<te;he++)Ee[2*he]!==0?(j.heap[++j.heap_len]=be=he,j.depth[he]=0):Ee[2*he+1]=0;for(;j.heap_len<2;)Ee[2*(le=j.heap[++j.heap_len]=be<2?++be:0)]=1,j.depth[le]=0,j.opt_len--,Se&&(j.static_len-=_e[2*le+1]);for(X.max_code=be,he=j.heap_len>>1;1<=he;he--)ve(j,Ee,he);for(le=te;he=j.heap[1],j.heap[1]=j.heap[j.heap_len--],ve(j,Ee,1),pe=j.heap[1],j.heap[--j.heap_max]=he,j.heap[--j.heap_max]=pe,Ee[2*le]=Ee[2*he]+Ee[2*pe],j.depth[le]=(j.depth[he]>=j.depth[pe]?j.depth[he]:j.depth[pe])+1,Ee[2*he+1]=Ee[2*pe+1]=le,j.heap[1]=le++,ve(j,Ee,1),2<=j.heap_len;);j.heap[--j.heap_max]=j.heap[1],(function(Ce,Ie){var Je,pt,qt,Xe,gt,Ot,Ze=Ie.dyn_tree,Cn=Ie.max_code,nn=Ie.stat_desc.static_tree,zu=Ie.stat_desc.has_stree,xi=Ie.stat_desc.extra_bits,Xr=Ie.stat_desc.extra_base,jn=Ie.stat_desc.max_length,hn=0;for(Xe=0;Xe<=T;Xe++)Ce.bl_count[Xe]=0;for(Ze[2*Ce.heap[Ce.heap_max]+1]=0,Je=Ce.heap_max+1;Je<E;Je++)jn<(Xe=Ze[2*Ze[2*(pt=Ce.heap[Je])+1]+1]+1)&&(Xe=jn,hn++),Ze[2*pt+1]=Xe,Cn<pt||(Ce.bl_count[Xe]++,gt=0,Xr<=pt&&(gt=xi[pt-Xr]),Ot=Ze[2*pt],Ce.opt_len+=Ot*(Xe+gt),zu&&(Ce.static_len+=Ot*(nn[2*pt+1]+gt)));if(hn!==0){do{for(Xe=jn-1;Ce.bl_count[Xe]===0;)Xe--;Ce.bl_count[Xe]--,Ce.bl_count[Xe+1]+=2,Ce.bl_count[jn]--,hn-=2}while(0<hn);for(Xe=jn;Xe!==0;Xe--)for(pt=Ce.bl_count[Xe];pt!==0;)Cn<(qt=Ce.heap[--Je])||(Ze[2*qt+1]!==Xe&&(Ce.opt_len+=(Xe-Ze[2*qt+1])*Ze[2*qt],Ze[2*qt+1]=Xe),pt--)}})(j,X),Te(Ee,be,j.bl_count)}function S(j,X,he){var pe,le,Ee=-1,_e=X[1],Se=0,te=7,be=4;for(_e===0&&(te=138,be=3),X[2*(he+1)+1]=65535,pe=0;pe<=he;pe++)le=_e,_e=X[2*(pe+1)+1],++Se<te&&le===_e||(Se<be?j.bl_tree[2*le]+=Se:le!==0?(le!==Ee&&j.bl_tree[2*le]++,j.bl_tree[2*q]++):Se<=10?j.bl_tree[2*H]++:j.bl_tree[2*M]++,Ee=le,be=(Se=0)===_e?(te=138,3):le===_e?(te=6,3):(te=7,4))}function K(j,X,he){var pe,le,Ee=-1,_e=X[1],Se=0,te=7,be=4;for(_e===0&&(te=138,be=3),pe=0;pe<=he;pe++)if(le=_e,_e=X[2*(pe+1)+1],!(++Se<te&&le===_e)){if(Se<be)for(;ce(j,le,j.bl_tree),--Se!=0;);else le!==0?(le!==Ee&&(ce(j,le,j.bl_tree),Se--),ce(j,q,j.bl_tree),re(j,Se-3,2)):Se<=10?(ce(j,H,j.bl_tree),re(j,Se-3,3)):(ce(j,M,j.bl_tree),re(j,Se-11,7));Ee=le,be=(Se=0)===_e?(te=138,3):le===_e?(te=6,3):(te=7,4)}}m(de);var W=!1;function U(j,X,he,pe){re(j,(h<<1)+(pe?1:0),3),(function(le,Ee,_e,Se){Ae(le),z(le,_e),z(le,~_e),s.arraySet(le.pending_buf,le.window,Ee,_e,le.pending),le.pending+=_e})(j,X,he)}u._tr_init=function(j){W||((function(){var X,he,pe,le,Ee,_e=new Array(T+1);for(le=pe=0;le<g-1;le++)for(V[le]=pe,X=0;X<1<<I[le];X++)C[pe++]=le;for(C[pe-1]=le,le=Ee=0;le<16;le++)for(de[le]=Ee,X=0;X<1<<Y[le];X++)ne[Ee++]=le;for(Ee>>=7;le<b;le++)for(de[le]=Ee<<7,X=0;X<1<<Y[le]-7;X++)ne[256+Ee++]=le;for(he=0;he<=T;he++)_e[he]=0;for(X=0;X<=143;)ie[2*X+1]=8,X++,_e[8]++;for(;X<=255;)ie[2*X+1]=9,X++,_e[9]++;for(;X<=279;)ie[2*X+1]=7,X++,_e[7]++;for(;X<=287;)ie[2*X+1]=8,X++,_e[8]++;for(Te(ie,v+1,_e),X=0;X<b;X++)D[2*X+1]=5,D[2*X]=we(X,5);Z=new L(ie,I,y+1,v,T),Q=new L(D,Y,0,b,T),se=new L(new Array(0),F,0,w,A)})(),W=!0),j.l_desc=new N(j.dyn_ltree,Z),j.d_desc=new N(j.dyn_dtree,Q),j.bl_desc=new N(j.bl_tree,se),j.bi_buf=0,j.bi_valid=0,ke(j)},u._tr_stored_block=U,u._tr_flush_block=function(j,X,he,pe){var le,Ee,_e=0;0<j.level?(j.strm.data_type===2&&(j.strm.data_type=(function(Se){var te,be=4093624447;for(te=0;te<=31;te++,be>>>=1)if(1&be&&Se.dyn_ltree[2*te]!==0)return c;if(Se.dyn_ltree[18]!==0||Se.dyn_ltree[20]!==0||Se.dyn_ltree[26]!==0)return f;for(te=32;te<y;te++)if(Se.dyn_ltree[2*te]!==0)return f;return c})(j)),je(j,j.l_desc),je(j,j.d_desc),_e=(function(Se){var te;for(S(Se,Se.dyn_ltree,Se.l_desc.max_code),S(Se,Se.dyn_dtree,Se.d_desc.max_code),je(Se,Se.bl_desc),te=w-1;3<=te&&Se.bl_tree[2*$[te]+1]===0;te--);return Se.opt_len+=3*(te+1)+5+5+4,te})(j),le=j.opt_len+3+7>>>3,(Ee=j.static_len+3+7>>>3)<=le&&(le=Ee)):le=Ee=he+5,he+4<=le&&X!==-1?U(j,X,he,pe):j.strategy===4||Ee===le?(re(j,2+(pe?1:0),3),ze(j,ie,D)):(re(j,4+(pe?1:0),3),(function(Se,te,be,Ce){var Ie;for(re(Se,te-257,5),re(Se,be-1,5),re(Se,Ce-4,4),Ie=0;Ie<Ce;Ie++)re(Se,Se.bl_tree[2*$[Ie]+1],3);K(Se,Se.dyn_ltree,te-1),K(Se,Se.dyn_dtree,be-1)})(j,j.l_desc.max_code+1,j.d_desc.max_code+1,_e+1),ze(j,j.dyn_ltree,j.dyn_dtree)),ke(j),pe&&Ae(j)},u._tr_tally=function(j,X,he){return j.pending_buf[j.d_buf+2*j.last_lit]=X>>>8&255,j.pending_buf[j.d_buf+2*j.last_lit+1]=255&X,j.pending_buf[j.l_buf+j.last_lit]=255&he,j.last_lit++,X===0?j.dyn_ltree[2*he]++:(j.matches++,X--,j.dyn_ltree[2*(C[he]+y+1)]++,j.dyn_dtree[2*B(X)]++),j.last_lit===j.lit_bufsize-1},u._tr_align=function(j){re(j,2,3),ce(j,k,ie),(function(X){X.bi_valid===16?(z(X,X.bi_buf),X.bi_buf=0,X.bi_valid=0):8<=X.bi_valid&&(X.pending_buf[X.pending++]=255&X.bi_buf,X.bi_buf>>=8,X.bi_valid-=8)})(j)}},{"../utils/common":41}],53:[function(i,o,u){o.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(i,o,u){(function(s){(function(c,f){if(!c.setImmediate){var m,h,g,y,v=1,b={},w=!1,E=c.document,T=Object.getPrototypeOf&&Object.getPrototypeOf(c);T=T&&T.setTimeout?T:c,m={}.toString.call(c.process)==="[object process]"?function(q){process.nextTick(function(){A(q)})}:(function(){if(c.postMessage&&!c.importScripts){var q=!0,H=c.onmessage;return c.onmessage=function(){q=!1},c.postMessage("","*"),c.onmessage=H,q}})()?(y="setImmediate$"+Math.random()+"$",c.addEventListener?c.addEventListener("message",k,!1):c.attachEvent("onmessage",k),function(q){c.postMessage(y+q,"*")}):c.MessageChannel?((g=new MessageChannel).port1.onmessage=function(q){A(q.data)},function(q){g.port2.postMessage(q)}):E&&"onreadystatechange"in E.createElement("script")?(h=E.documentElement,function(q){var H=E.createElement("script");H.onreadystatechange=function(){A(q),H.onreadystatechange=null,h.removeChild(H),H=null},h.appendChild(H)}):function(q){setTimeout(A,0,q)},T.setImmediate=function(q){typeof q!="function"&&(q=new Function(""+q));for(var H=new Array(arguments.length-1),M=0;M<H.length;M++)H[M]=arguments[M+1];var I={callback:q,args:H};return b[v]=I,m(v),v++},T.clearImmediate=_}function _(q){delete b[q]}function A(q){if(w)setTimeout(A,0,q);else{var H=b[q];if(H){w=!0;try{(function(M){var I=M.callback,Y=M.args;switch(Y.length){case 0:I();break;case 1:I(Y[0]);break;case 2:I(Y[0],Y[1]);break;case 3:I(Y[0],Y[1],Y[2]);break;default:I.apply(f,Y)}})(H)}finally{_(q),w=!1}}}}function k(q){q.source===c&&typeof q.data=="string"&&q.data.indexOf(y)===0&&A(+q.data.slice(y.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof Rl<"u"?Rl:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(qs)),qs.exports}var Lh;function qS(){if(Lh)return Fr;Lh=1;var n=Fr&&Fr.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.Filemanager=void 0;const l=n(HS()),i=Rn();class o{pendingFiles=[];pendingMessage="";pendingFormat="";setFilesForUpload(s,c){this.pendingFiles.length>0&&this.clearPendingFilesState();const f=s.filter(m=>this.validateFileType(m));if(f.length===0)throw new i.FileError("No valid files provided",{context:{stage:"setFilesForUpload"}});this.pendingFiles=f,c&&c.trim()&&(this.pendingMessage=c),this.pendingFormat=f.length>1?"zip":f?.[0]?.type?.split("/")?.[1]||"unknown"}getPendingFileState(){return{files:this.pendingFiles,message:this.pendingMessage||"",format:this.pendingFormat||""}}async uploadFilesToPresignedUrl(s){let c=0;const f=s.filter(m=>m&&m.trim());try{if(f.length===0)throw new i.FileError("No valid presigned URLs provided",{context:{stage:"uploadFilesToPresignedUrl"}});let m,h;if(this.shouldZipFiles()){const g=await this.zipFiles(),y=this.getUploadFileName();m=this.blobToFile(g,y),h="application/zip"}else m=this.pendingFiles?.[0],h=m.type;for(let g=0;g<f.length;g++){const y=f[g],v=await fetch(y,{method:"PUT",body:m,headers:{"Content-Type":h,"x-ms-blob-type":"BlockBlob"}});if(!v.ok)throw new i.FileError(`Failed to upload ${m.name} to URL ${g+1}: ${v.status} ${v.statusText}`,{context:{stage:"uploadFilesToPresignedUrl",status:v.status,url:y}});c++}return f[0]}catch(m){if(c>0)return f[0];throw(0,i.normalizeError)(m,i.FileError,"Failed to upload files to presigned URL",{context:{stage:"uploadFilesToPresignedUrl"}})}}async zipFiles(){const s=new l.default;return this.pendingFiles.forEach(f=>{s.file(f.name,f)}),await s.generateAsync({type:"blob"})}blobToFile(s,c){return new File([s],c,{type:s.type})}shouldZipFiles(){return this.pendingFiles.length>1}getUploadFileName(){return this.shouldZipFiles()?`uploaded_files_${Date.now()}.zip`:this.pendingFiles[0]?.name||"file"}validateFileType(s){return["application/pdf","image/jpeg","image/png","image/jpg","image/tiff","text/plain","text/markdown","image/heif","image/heic","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(s.type)}clearPendingFilesState(){this.pendingFiles=[],this.pendingMessage="",this.pendingFormat=""}}return Fr.Filemanager=o,Fr}var wn={},Ih;function Pl(){if(Ih)return wn;Ih=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.SYNAPSE_REALTIME_RESERVED_EVENTS=wn.SYNAPSE_REALTIME_ERROR_CODES=wn.SYNAPSE_REALTIME_EVENTS=wn.SYNAPSE_MESSAGE_TYPES=void 0;const n=Hs();return wn.SYNAPSE_MESSAGE_TYPES=n.SOCKET_CONTENT_TYPES,wn.SYNAPSE_REALTIME_EVENTS={CONNECTED:"connected",DISCONNECTED:"disconnected",PROGRESS_MESSAGE:"progress_message",MESSAGE_CHUNK:"message_chunk",TIPS_MESSAGE:"tips_message",END_OF_STREAM:"end_of_stream",ERROR:"error",TOOL_CALL:"tool_call",INLINE_TEXT:"inline_text",TOOL_START:"tool_start",TOOL_END:"tool_end"},wn.SYNAPSE_REALTIME_ERROR_CODES={SESSION_INACTIVE:"session_not_found",SESSION_EXPIRED:"session_expired",INVALID_EVENT:"invalid_event",INVALID_CONTENT_TYPE:"invalid_content",PARSING_ERROR:"parsing",FILE_UPLOAD_INPROGRESS:"file_upload_inprogress",TIMEOUT:"timeout",SERVER_ERROR:"server_error",SESSION_TOKEN_MISMATCH:"session_token_mismatch"},wn.SYNAPSE_REALTIME_RESERVED_EVENTS={SESSION_EXPIRED:"session_expired"},wn}var Ca={},Bh;function PS(){if(Bh)return Ca;Bh=1,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.AudioManager=void 0;const n=Rn();class l{mediaRecorder=null;mediaStream=null;recordingStartTime=0;autoPauseTimer=null;config;onAudioData=null;onAudioError=null;suppressCallbacks=!1;constructor(o={}){this.config={mimeType:"audio/webm;codecs=opus",audioBitsPerSecond:128e3,maxRecordingDuration:9e5,autoPauseEnabled:!0,...o}}async checkCurrentPermissionState(){const o=await navigator.permissions.query({name:"microphone"});if(o.state==="denied")throw new n.RecordingError("Microphone permission denied",{context:{permissionState:o.state},hint:"Ensure the browser has microphone access enabled for this site."});return o.state}async start(o,u){try{if(!navigator.mediaDevices)throw new n.RecordingError("Media devices API is not available. This usually means the page is not served over HTTPS or there are browser restrictions.",{context:{feature:"mediaDevices"},hint:"Serve the app over HTTPS and verify browser/device microphone support.",displayMessage:"Microphone access is unavailable."});if(!window.MediaRecorder)throw new n.RecordingError("MediaRecorder is not supported in this browser",{context:{feature:"MediaRecorder"},hint:"Use a browser that supports the MediaRecorder API.",displayMessage:"Microphone access is unavailable."});const s=["audio/mp3","audio/ogg;codecs=opus","audio/mp4","audio/ogg","audio/wav"].filter(c=>MediaRecorder.isTypeSupported(c));if(s.length===0)throw new n.RecordingError("No supported audio formats found in this browser",{context:{requestedTypes:s},hint:"Verify codec support or adjust the requested MIME types.",displayMessage:"Microphone access is unavailable."});if(this.config.mimeType=s[0],await this.checkCurrentPermissionState(),this.onAudioData=o,this.onAudioError=u??null,this.suppressCallbacks=!1,this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1,sampleRate:44100,channelCount:1}}),this.mediaRecorder=new MediaRecorder(this.mediaStream,{mimeType:this.config.mimeType,audioBitsPerSecond:this.config.audioBitsPerSecond}),this.mediaRecorder.state!=="inactive")throw new n.RecordingError("MediaRecorder is in an invalid state for start()",{context:{recorderState:this.mediaRecorder.state},displayMessage:"Failed to start recording"});this.setupMediaRecorderEvents(),this.mediaRecorder.start(),this.recordingStartTime=Date.now(),this.config.autoPauseEnabled&&this.setupAutoPauseTimer()}catch(s){throw this.toRecordingError(s,"Failed to start audio recording",{stage:"start"})}}async processAudioChunk(o){try{const u=await this.blobToBase64(o),s=Date.now();if(!this.onAudioData)return;const c={audio:u,format:this.config.mimeType,duration:this.recordingStartTime>0?s-this.recordingStartTime:0,timestamp:this.recordingStartTime>0?this.recordingStartTime:s};this.onAudioData(c)}catch(u){this.handleError(u,{stage:"process_audio_chunk"})}}toRecordingError(o,u,s){if(o instanceof n.RecordingError)return o;if(o instanceof n.SynapseError)return new n.RecordingError(o.message,{cause:o,context:{...o.context,...s},hint:o.hint});const c=o instanceof Error&&o.message?o.message:u;return new n.RecordingError(c,{cause:o,context:s})}handleError(o,u){const s=this.toRecordingError(o,"Unexpected recording error",u);if(this.onAudioError)try{this.onAudioError(s)}catch{}}setupAutoPauseTimer(){this.autoPauseTimer&&clearTimeout(this.autoPauseTimer),this.autoPauseTimer=setTimeout(()=>{this.stop()},this.config.maxRecordingDuration)}setupMediaRecorderEvents(){this.mediaRecorder&&(this.mediaRecorder.ondataavailable=o=>{this.suppressCallbacks||o.data.size<=0||this.processAudioChunk(o.data).catch(u=>this.handleError(u,{stage:"media_recorder_ondataavailable",hasData:o.data.size>0}))},this.mediaRecorder.onstop=async()=>{this.recordingStartTime=0},this.mediaRecorder.onerror=o=>{this.handleError(o.error instanceof Error?o.error:new Error("MediaRecorder encountered an unknown error"),{stage:"media_recorder_onerror"})},this.mediaRecorder.onstart=()=>{this.mediaRecorder})}blobToBase64(o){return new Promise((u,s)=>{const c=new FileReader;c.onload=()=>{if(typeof c.result=="string"){const f=c.result.split(",")[1];u(f)}else s(new n.RecordingError("Failed to convert blob to base64",{context:{stage:"blob_to_base64"}}))},c.onerror=()=>s(new n.RecordingError("FileReader error while converting audio chunk to base64",{cause:c.error??void 0,context:{stage:"blob_to_base64"}})),c.readAsDataURL(o)})}stop(){if(this.mediaRecorder)try{this.autoPauseTimer&&(clearTimeout(this.autoPauseTimer),this.autoPauseTimer=null),this.mediaRecorder.state==="recording"&&this.mediaRecorder.stop(),this.mediaStream&&(this.mediaStream.getTracks().forEach(o=>o.stop()),this.mediaStream=null)}catch(o){throw this.toRecordingError(o,"Failed to stop audio recording",{stage:"stop"})}}cancel(){if(this.mediaRecorder)try{this.suppressCallbacks=!0,this.autoPauseTimer&&(clearTimeout(this.autoPauseTimer),this.autoPauseTimer=null),this.mediaRecorder.ondataavailable=null,this.mediaRecorder.state==="recording"&&this.mediaRecorder.stop(),this.mediaStream&&(this.mediaStream.getTracks().forEach(o=>o.stop()),this.mediaStream=null)}catch(o){throw this.toRecordingError(o,"Failed to cancel audio recording",{stage:"cancel"})}}destroy(){try{this.cancel(),this.mediaRecorder&&(this.mediaRecorder=null),this.mediaStream&&(this.mediaStream.getTracks().forEach(o=>o.stop()),this.mediaStream=null)}catch(o){throw this.toRecordingError(o,"Failed to destroy audio resources",{stage:"destroy"})}}}return Ca.AudioManager=l,Ca}var Uh;function Hh(){if(Uh)return wa;Uh=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.MessageManager=void 0;const n=Hs(),l=qS(),i=Pl(),o=PS(),u=Rn();let s=class{connection=null;callbacks=null;fileManager=null;audioManager=null;constructor(f,m){this.connection=f||null,this.callbacks=m||null}handleFileUploadProcess({files:f,message:m,url:h}){this.fileManager||(this.fileManager=new l.Filemanager);let g;if(f&&f.length>0)this.fileManager.setFilesForUpload(f,m),g={ev:n.SOCKET_EVENTS.CHAT,ct:n.SOCKET_CONTENT_TYPES.FILE,_id:Date.now().toString(),ts:Date.now(),data:{extension:this.fileManager.getPendingFileState().format}};else if(h){const y=this.fileManager.getPendingFileState().message;g={ev:n.SOCKET_EVENTS.CHAT,ct:n.SOCKET_CONTENT_TYPES.FILE,_id:Date.now().toString(),ts:Date.now(),data:{url:h,...y&&{text:y}}},this.fileManager?.clearPendingFilesState()}return g}sendSocketMessage({message:f,files:m,audio:h,url:g,tool_declined:y,tool_id:v,initial_prompts:b}){const w=this.assertConnection("sendSocketChatMessage");let E;if(m&&m.length>0||g&&g.trim()!==""?E=this.handleFileUploadProcess({files:m,message:f,url:g}):f?E={ev:n.SOCKET_EVENTS.CHAT,ct:n.SOCKET_CONTENT_TYPES.TEXT,_id:Date.now().toString(),ts:Date.now(),data:{text:f,...y&&{tool_declined:y},...v&&{tool_id:v},...b&&{initial_prompts:b}}}:h&&h?.audio&&h?.format&&(E={ev:n.SOCKET_EVENTS.STREAM,ct:n.SOCKET_CONTENT_TYPES.AUDIO,_id:Date.now().toString(),ts:Date.now(),data:{audio:h?.audio,format:h?.format}}),!E){const T=new u.MessageError("No message to send",{context:{stage:"sendSocketChatMessage"}});throw this.emitError(T),T}w.sendMessage(E)}handleIncomingSocketChatMessage(f){const m=this.assertConnection("handleIncomingSocketChatMessage");switch(f.ct){case n.SOCKET_CONTENT_TYPES.FILE:{f?.data?.urls&&f.data.urls?.length>0&&this.fileManager?.uploadFilesToPresignedUrl(f.data.urls).then(()=>{this.sendSocketMessage({url:f.data.urls?.[0]})}).catch(h=>{const g=this.toFileError(h,"Failed to upload files to presigned URL",{stage:"handleIncomingSocketChatMessage",urls:f.data?.urls?.length});this.emitError(g)});break}case n.SOCKET_CONTENT_TYPES.TEXT:if(f.data.text&&f.data.text.trim()===""&&f._id){const h={data:{text:f.data.text},messageId:f._id,timestamp:f.ts};m.emit(i.SYNAPSE_REALTIME_EVENTS.MESSAGE_CHUNK,h)}break;case n.SOCKET_CONTENT_TYPES.TOOL_CALL:if(f?.data?.tool_id&&f._id){const h={data:{...f.data},messageId:f._id,timestamp:f.ts};m.emit(i.SYNAPSE_REALTIME_EVENTS.TOOL_CALL,h)}break;case n.SOCKET_CONTENT_TYPES.INLINE_TEXT:if(f?.data?.text){const h={data:{text:f.data.text},messageId:f._id,timestamp:f.ts};m.emit(i.SYNAPSE_REALTIME_EVENTS.INLINE_TEXT,h)}break}}handleIncomingSocketStreamMessage(f){const m=this.assertConnection("handleIncomingSocketStreamMessage");switch(f.ct){case n.SOCKET_CONTENT_TYPES.TEXT:if(f?.data?.progress_msg){const v={data:{text:f.data.progress_msg},messageId:f._id,timestamp:f.ts};m.emit(i.SYNAPSE_REALTIME_EVENTS.PROGRESS_MESSAGE,v);return}if(f?.data?.text){const v={data:{text:f.data.text},messageId:f._id,timestamp:f.ts};m.emit(i.SYNAPSE_REALTIME_EVENTS.MESSAGE_CHUNK,v)}break;case n.SOCKET_CONTENT_TYPES.TIPS:if(f?.data?.tips){const v={data:{tips:f.data.tips},messageId:f._id,timestamp:f.ts};m.emit(i.SYNAPSE_REALTIME_EVENTS.TIPS_MESSAGE,v);return}break;case n.SOCKET_CONTENT_TYPES.TOOL_CALL:if(f?.data?.tool_id&&f._id){const v={data:{...f.data},messageId:f._id,timestamp:f.ts};m.emit(i.SYNAPSE_REALTIME_EVENTS.TOOL_CALL,v);return}break;case n.SOCKET_CONTENT_TYPES.TOOL_START:const h={data:f?.data,messageId:f._id||Date.now().toString()};m.emit(i.SYNAPSE_REALTIME_EVENTS.TOOL_START,h);break;case n.SOCKET_CONTENT_TYPES.TOOL_END:const g={data:f?.data,messageId:f._id||Date.now().toString()};m.emit(i.SYNAPSE_REALTIME_EVENTS.TOOL_END,g);break;default:const y=new u.MessageError(`Unsupported content type ${f?.ct}`,{context:{stage:"handleIncomingSocketStreamMessage",contentType:f.ct}});throw this.emitError(y),y}}handleDisconnect(f){this.connection?.emit?.(i.SYNAPSE_REALTIME_EVENTS.DISCONNECTED,f)}handleIncomingSocketEndOfStreamMessage(f){this.assertConnection("handleIncomingSocketEndOfStreamMessage").emit(i.SYNAPSE_REALTIME_EVENTS.END_OF_STREAM)}handleIncomingSocketErrorMessage(f){const m=this.assertConnection("handleIncomingSocketErrorMessage");switch(f.code){case i.SYNAPSE_REALTIME_ERROR_CODES.SESSION_EXPIRED:m.emit(i.SYNAPSE_REALTIME_RESERVED_EVENTS.SESSION_EXPIRED);break;default:const h=new u.MessageError(f.msg||"Socket error received",{context:{stage:"handleIncomingSocketErrorMessage",errorCode:f.code}});m.emit(i.SYNAPSE_REALTIME_EVENTS.ERROR,h),this.emitError(h)}}sendSocketAuthMessage(f){const m=this.assertConnection("sendSocketAuthMessage"),h={ev:n.SOCKET_EVENTS.AUTH,_id:Date.now().toString(),ts:Date.now(),data:{token:f}};m.sendMessage(h)}sendSocketPingMessage(){const f=this.assertConnection("sendSocketPingMessage"),m={ev:n.SOCKET_EVENTS.PING,_id:Date.now().toString(),ts:Date.now()};f.sendMessage(m)}async startRecording({onChunks:f,onError:m}){if(!f){const h=new u.RecordingError("onChunks is required",{context:{stage:"startRecording"},hint:"onChunks is required"});throw this.emitError(h),h}this.assertConnection("startRecording"),this.audioManager||(this.audioManager=new o.AudioManager);try{await this.audioManager.start(f,h=>{const g=this.toRecordingError(h,"Failed to start audio recording",{stage:"startRecording"});m?.(g),this.emitError(g)})}catch(h){const g=this.toRecordingError(h,"Failed to start audio recording",{stage:"startRecording"});throw m?.(g),this.emitError(g),g}}endRecordingWithSocket(){if(!this.audioManager){const f=new u.RecordingError("Audio manager not set. Call startRecording() first.",{context:{stage:"stopRecording"}});throw this.emitError(f),f}try{this.audioManager.stop()}catch(f){const m=this.toRecordingError(f,"Failed to stop audio recording",{stage:"stopRecording"});throw this.emitError(m),m}}sendSocketPongMessage(){const f=this.assertConnection("sendSocketPongMessage"),m={ev:n.SOCKET_EVENTS.PONG,_id:Date.now().toString(),ts:Date.now()};f.sendMessage(m)}handleConnectionEstablished(){this.connection?.handleConnected(),this.connection?.emit(i.SYNAPSE_REALTIME_EVENTS.CONNECTED)}cleanupMessageServerState(){this.fileManager&&(this.fileManager.clearPendingFilesState(),this.fileManager=null),this.audioManager&&(this.audioManager.destroy(),this.audioManager=null)}emitError(f){this.callbacks?.onError?.(f)}toFileError(f,m,h,g){return(0,u.normalizeError)(f,u.FileError,m,{context:h,hint:g})}toRecordingError(f,m,h,g){return(0,u.normalizeError)(f,u.RecordingError,m,{context:h,hint:g})}assertConnection(f){if(!this.connection){const m=new u.ConnectionError("Connection not set. Please ensure the connection is established before calling this method.",{context:{stage:f}});throw this.emitError(m),m}return this.connection}};return wa.MessageManager=s,wa}var Ta={},qh;function Ph(){if(qh)return Ta;qh=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.ErrorUtils=void 0;const n=Rn();class l{static isAPIError(o){return o instanceof n.APIError}static isNetworkError(o){return o instanceof n.APIError&&(o.status===0||o.status===void 0)}static isTimeoutError(o){return o instanceof n.APIConnectionTimeoutError}static isAuthError(o){return o instanceof n.UnauthorizedError||o instanceof n.PermissionDeniedError}static isClientError(o){return o instanceof n.APIError&&o.status!==void 0&&o.status>=400&&o.status<500}static isServerError(o){return o instanceof n.APIError&&o.status!==void 0&&o.status>=500}static getUserFriendlyMessage(o){return l.isNetworkError(o)?"Unable to connect to the server. Please check your internet connection.":l.isTimeoutError(o)?"Request timed out. Please try again.":l.isAuthError(o)?"Authentication failed. Please log in again.":l.isServerError(o)?"Server error occurred. Please try again later.":l.isAPIError(o)||o instanceof Error?o.message:"An unexpected error occurred."}static getErrorDetails(o){return l.isAPIError(o)?{type:o.name,message:o.message,code:o.code,status:o.status,timestamp:o.timestamp,stack:o.stack,context:o.context,hint:o.hint}:o instanceof n.SynapseError?{type:o.name,message:o.message,code:o.code,timestamp:o.timestamp,stack:o.stack,context:o.context,hint:o.hint}:o instanceof Error?{type:o.name,message:o.message,stack:o.stack}:{type:"Unknown",message:String(o)}}}return Ta.ErrorUtils=l,Ta}var Fh;function FS(){if(Fh)return pa;Fh=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.SynapseSDK=void 0;const n=Sh(),l=US(),i=Mh(),o=Hh(),u=Pl(),s=Ph(),c=Rn(),f=Hs();class m{connection=null;messageManager;resourceManager;sessionConfig=null;config;connectionType;constructor(g){this.config={...g,environment:g.environment||"production"},this.connectionType=g.connectionType||n.ConnectionType.SOCKET;const y=(0,l.getConfig)(this.config?.environment).BASE_API_URL;this.resourceManager=new i.ResourceManager({agentId:this.config.agentId,serverUrl:y})}async startSession(g){try{const y=await this.manageSession(g);return await this.initializeConnection(y),this.setupEventHandlers(),y}catch(y){const v=s.ErrorUtils.getUserFriendlyMessage(y),b=s.ErrorUtils.getErrorDetails(y),w=this.toSessionError(y,v||"Failed to start session",{stage:"startSession",details:b},"Check network connectivity or refresh credentials before retrying.");throw this.emitError(w),w}}async sendMessage({message:g,files:y,audio:v,tool_declined:b,tool_id:w,initial_prompts:E}){if(!this.connection){const T=new c.ConnectionError("Connection not established. Session may not be initialized.",{context:{stage:"sendChatMessage"},hint:"Call startSession() and wait for connection before sending messages."});throw this.emitError(T),T}switch(this.connectionType){case n.ConnectionType.SOCKET:this.messageManager.sendSocketMessage({message:g,files:y,audio:v,...b&&{tool_declined:b},...w&&{tool_id:w},...E?.length&&{initial_prompts:E}});break;default:const T=new c.ConnectionError("Unsupported connection type",{context:{stage:"sendChatMessage",connectionType:this.connectionType}});throw this.emitError(T),T}}on(g,y){this.connection?.on(g,y)}off(g,y){this.connection?.off(g,y)}getSessionConfig(){if(!this.sessionConfig?.session_id||!this.sessionConfig?.session_token)throw new c.SessionError("Session ID or token not found",{context:{stage:"getSessionConfig"},hint:"Ensure the session API returns both identifiers."});return this.sessionConfig}async callTool(g,y){if(!this.connection){const v=new c.ConnectionError("Connection not established. Session may not be initialized.",{context:{stage:"callTool"},hint:"Call startSession() before attempting to call tool."});throw this.emitError(v),v}if(!this.sessionConfig?.session_id){const v=new c.SessionError("Session ID not found",{context:{stage:"callTool"},hint:"Call startSession() before attempting to call tool."});throw this.emitError(v),v}switch(this.connectionType){case n.ConnectionType.SOCKET:try{const b=await this.resourceManager.callTool(this.sessionConfig.session_id,g,y);if(b.err)throw new c.APIError(b.err.msg,500,b.err);return b}catch(b){if(b instanceof c.APIError&&b?.status===401)return await this.handleSessionExpiry(),await this.callTool(g,y);throw b}default:const v=new c.ConnectionError("Unsupported connection type",{context:{stage:"callTool",connectionType:this.connectionType}});throw this.emitError(v),v}}async startRecording({onChunks:g,onError:y}){if(!this.connection){const v=new c.ConnectionError("Connection not established. Session may not be initialized.",{context:{stage:"sendAudio"},hint:"Call startSession() before attempting to send audio."});throw this.emitError(v),v}switch(this.connectionType){case n.ConnectionType.SOCKET:try{await this.messageManager.startRecording({onChunks:g,onError:y})}catch(b){throw b}break;default:const v=new c.ConnectionError("Unsupported connection type",{context:{stage:"sendAudio",connectionType:this.connectionType}});throw this.emitError(v),v}}endRecording(){if(!this.connection){const g=new c.ConnectionError("Connection not established. Session may not be initialized.",{context:{stage:"endRecording"},hint:"Call startRecording() before attempting to stop recording."});throw this.emitError(g),g}switch(this.connectionType){case n.ConnectionType.SOCKET:this.messageManager.endRecordingWithSocket();break;default:const g=new c.ConnectionError("Unsupported connection type",{context:{stage:"endRecording",connectionType:this.connectionType}});throw this.emitError(g),g}}isConnected(){return this.connection?.isConnected()??!1}endSession(){this.connection&&(this.connection.close(),this.connection=null),this.messageManager&&this.messageManager.cleanupMessageServerState()}emitError(g){this.config.callbacks?.onError?.(g)}toSessionError(g,y,v,b){return(0,c.normalizeError)(g,c.SessionError,y,{context:v,hint:b})}async initializeConnection(g){if(this.connection&&(this.connection.close(),this.connection=null),!g.session_id||!g.session_token)throw new c.SessionError("Session ID or token not found",{context:{stage:"initializeConnection"},hint:"Ensure the session API returns both identifiers."});this.sessionConfig=g;const y=(0,l.getConfig)(this.config?.environment).WEBSOCKET_URL,v=(this.config.connectionType==="socket",n.ConnectionType.SOCKET);this.connection=await n.ConnectionFactory.createConnection(v,{serverUrl:y,auth:{sessionId:g.session_id,sessionToken:g.session_token},agentId:this.config.agentId,userId:this.config.userId,overrides:this.config.overrides}),this.messageManager=new o.MessageManager(this.connection,this.config?.callbacks)}async manageSession(g){try{if(!g?.session_id)return this.createNewSession();const y=await this.resourceManager.validateSession(g.session_id);return y.active?g:y.expired?this.refreshSession(g.session_id,g.session_token):this.createNewSession()}catch(y){if(y instanceof c.APIError){const v=y.status;if(v===404||v===500)return this.createNewSession()}throw this.toSessionError(y,"Failed to resolve session",{stage:"resolveSession"})}}async refreshSession(g,y){try{return await this.resourceManager.refreshSession(g,y)}catch(v){if(v instanceof c.APIError){this.emitError(v);const b=v.status;if(b===404||b===500)return this.createNewSession()}throw this.toSessionError(v,"Failed to refresh session",{stage:"refreshSession",sessionId:g})}}async createNewSession(){return await this.resourceManager.createSession(this.config.userId||Date.now().toString())}setupEventHandlers(){if(this.connection){switch(this.connectionType){case n.ConnectionType.SOCKET:this.connection.onOpen(()=>{this.onSocketConnectionOpen()}),this.connection.onMessage(g=>{this.onIncomingSocketMessage(g)}),this.connection.onError(g=>{this.onSocketConnectionError(g)}),this.connection.on(u.SYNAPSE_REALTIME_RESERVED_EVENTS.SESSION_EXPIRED,()=>{this.handleSessionExpiry()});break;default:throw new c.ConnectionError("Unsupported connection type",{context:{stage:"setupEventHandlers",connectionType:this.connectionType},hint:"Use ConnectionType.SOCKET or provide a custom handler."})}this.connection.onDisconnect(g=>{this.messageManager.handleDisconnect(g)})}}onSocketConnectionError(g){this.connection?.emit(u.SYNAPSE_REALTIME_EVENTS.ERROR,g);const y=this.toConnectionError(g,"WebSocket connection error",{stage:"onSocketConnectionError"},"Verify network connectivity or attempt to reconnect.");this.emitError(y)}onSocketConnectionOpen(){if(!this.sessionConfig?.session_token){const g=new c.SessionError("Session token not set. Call startSession() first.",{context:{stage:"onSocketConnectionOpen"},hint:"Ensure startSession() completes successfully before socket opens."});throw this.emitError(g),g}this.messageManager.sendSocketAuthMessage(this.sessionConfig.session_token)}onIncomingSocketMessage(g){switch(g.ev){case f.SOCKET_EVENTS.CHAT:this.messageManager.handleIncomingSocketChatMessage(g);break;case f.SOCKET_EVENTS.CONNECTION_ESTABLISHED:this.messageManager.handleConnectionEstablished();break;case f.SOCKET_EVENTS.STREAM:this.messageManager.handleIncomingSocketStreamMessage(g);break;case f.SOCKET_EVENTS.END_OF_STREAM:this.messageManager.handleIncomingSocketEndOfStreamMessage(g);break;case f.SOCKET_EVENTS.PING:this.messageManager.sendSocketPongMessage();break;case f.SOCKET_EVENTS.PONG:this.messageManager.sendSocketPingMessage();break;case f.SOCKET_EVENTS.SYNC:break;case f.SOCKET_EVENTS.ERROR:this.messageManager.handleIncomingSocketErrorMessage(g);break;default:const y=new c.MessageError("Unsupported message type",{context:{stage:"onIncomingSocketMessage",event:g.ev??"unknown"},hint:"Ensure the server is sending supported socket events."});this.emitError(y);return}}async handleSessionExpiry(){try{if(this.endSession(),!this.sessionConfig?.session_id||!this.sessionConfig?.session_token){const y=new c.SessionError("Session ID or token not found",{context:{stage:"handleSessionExpiry"}});throw this.emitError(y),y}const g=await this.refreshSession(this.sessionConfig.session_id,this.sessionConfig.session_token);if(!g.session_id||!g.session_token)throw new c.SessionError("Session refresh failed",{context:{stage:"handleSessionExpiry"}});this.sessionConfig.session_id=g.session_id,this.sessionConfig.session_token=g.session_token,await this.initializeConnection(g),this.setupEventHandlers(),this.config.callbacks?.onSessionRefreshed?.(g)}catch(g){const y=this.toSessionError(g,"Session expired",{stage:"handleSessionExpiry"});this.emitError(y)}}toConnectionError(g,y,v,b){return(0,c.normalizeError)(g,c.ConnectionError,y,{context:v,hint:b})}}return pa.SynapseSDK=m,pa}var Ps={},Yh;function YS(){return Yh||(Yh=1,Object.defineProperty(Ps,"__esModule",{value:!0})),Ps}var Aa={},Vh;function VS(){return Vh||(Vh=1,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.USER_FEEDBACK=void 0,Aa.USER_FEEDBACK={LIKE:"LIKE",DISLIKE:"DISLIKE",NONE:"NONE"}),Aa}var Fs={},Gh;function GS(){return Gh||(Gh=1,Object.defineProperty(Fs,"__esModule",{value:!0})),Fs}var ka={},Xh;function XS(){return Xh||(Xh=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.ErrorType=void 0,ka.ErrorType={NETWORK_ERROR:"NETWORK_ERROR",TIMEOUT_ERROR:"TIMEOUT_ERROR",API_ERROR:"API_ERROR",RATE_LIMIT_ERROR:"RATE_LIMIT_ERROR",SERVER_ERROR:"SERVER_ERROR",PARSE_ERROR:"PARSE_ERROR",UNKNOWN_ERROR:"UNKNOWN_ERROR"}),ka}var Ys={},Zh;function ZS(){return Zh||(Zh=1,Object.defineProperty(Ys,"__esModule",{value:!0})),Ys}var Kh;function KS(){return Kh||(Kh=1,(function(n){var l=Hr&&Hr.__createBinding||(Object.create?(function(T,_,A,k){k===void 0&&(k=A);var q=Object.getOwnPropertyDescriptor(_,A);(!q||("get"in q?!_.__esModule:q.writable||q.configurable))&&(q={enumerable:!0,get:function(){return _[A]}}),Object.defineProperty(T,k,q)}):(function(T,_,A,k){k===void 0&&(k=A),T[k]=_[A]})),i=Hr&&Hr.__exportStar||function(T,_){for(var A in T)A!=="default"&&!Object.prototype.hasOwnProperty.call(_,A)&&l(_,T,A)};Object.defineProperty(n,"__esModule",{value:!0}),n.SYNAPSE_MESSAGE_TYPES=n.ErrorUtils=n.ErrorType=n.SynapseErrorCode=n.InternalServerError=n.RateLimitError=n.MethodNotAllowedError=n.NotFoundError=n.PermissionDeniedError=n.UnauthorizedError=n.BadRequestError=n.APIConnectionTimeoutError=n.APIUserAbortError=n.APIError=n.SynapseError=n.HttpClient=n.MessageManager=n.ToolCall=n.Session=n.ResourceManager=n.ConnectionType=n.ConnectionFactory=n.WebSocketConnection=n.BaseConnection=n.SynapseSDK=void 0;var o=FS();Object.defineProperty(n,"SynapseSDK",{enumerable:!0,get:function(){return o.SynapseSDK}});var u=ph();Object.defineProperty(n,"BaseConnection",{enumerable:!0,get:function(){return u.BaseConnection}});var s=bh();Object.defineProperty(n,"WebSocketConnection",{enumerable:!0,get:function(){return s.WebSocketConnection}});var c=Sh();Object.defineProperty(n,"ConnectionFactory",{enumerable:!0,get:function(){return c.ConnectionFactory}}),Object.defineProperty(n,"ConnectionType",{enumerable:!0,get:function(){return c.ConnectionType}}),i(Is(),n);var f=Mh();Object.defineProperty(n,"ResourceManager",{enumerable:!0,get:function(){return f.ResourceManager}}),i(YS(),n);var m=Ah();Object.defineProperty(n,"Session",{enumerable:!0,get:function(){return m.Session}}),i(VS(),n);var h=Oh();Object.defineProperty(n,"ToolCall",{enumerable:!0,get:function(){return h.ToolCall}}),i(Nh(),n);var g=Hh();Object.defineProperty(n,"MessageManager",{enumerable:!0,get:function(){return g.MessageManager}}),i(Pl(),n),i(GS(),n);var y=_h();Object.defineProperty(n,"HttpClient",{enumerable:!0,get:function(){return y.HttpClient}});var v=Rn();Object.defineProperty(n,"SynapseError",{enumerable:!0,get:function(){return v.SynapseError}}),Object.defineProperty(n,"APIError",{enumerable:!0,get:function(){return v.APIError}}),Object.defineProperty(n,"APIUserAbortError",{enumerable:!0,get:function(){return v.APIUserAbortError}}),Object.defineProperty(n,"APIConnectionTimeoutError",{enumerable:!0,get:function(){return v.APIConnectionTimeoutError}}),Object.defineProperty(n,"BadRequestError",{enumerable:!0,get:function(){return v.BadRequestError}}),Object.defineProperty(n,"UnauthorizedError",{enumerable:!0,get:function(){return v.UnauthorizedError}}),Object.defineProperty(n,"PermissionDeniedError",{enumerable:!0,get:function(){return v.PermissionDeniedError}}),Object.defineProperty(n,"NotFoundError",{enumerable:!0,get:function(){return v.NotFoundError}}),Object.defineProperty(n,"MethodNotAllowedError",{enumerable:!0,get:function(){return v.MethodNotAllowedError}}),Object.defineProperty(n,"RateLimitError",{enumerable:!0,get:function(){return v.RateLimitError}}),Object.defineProperty(n,"InternalServerError",{enumerable:!0,get:function(){return v.InternalServerError}}),Object.defineProperty(n,"SynapseErrorCode",{enumerable:!0,get:function(){return v.SynapseErrorCode}});var b=XS();Object.defineProperty(n,"ErrorType",{enumerable:!0,get:function(){return b.ErrorType}});var w=Ph();Object.defineProperty(n,"ErrorUtils",{enumerable:!0,get:function(){return w.ErrorUtils}}),i(ZS(),n);var E=Pl();Object.defineProperty(n,"SYNAPSE_MESSAGE_TYPES",{enumerable:!0,get:function(){return E.SYNAPSE_MESSAGE_TYPES}})})(Hr)),Hr}var Ge=KS();const Qh=n=>{let l;const i=new Set,o=(h,g)=>{const y=typeof h=="function"?h(l):h;if(!Object.is(y,l)){const v=l;l=g??(typeof y!="object"||y===null)?y:Object.assign({},l,y),i.forEach(b=>b(l,v))}},u=()=>l,f={setState:o,getState:u,getInitialState:()=>m,subscribe:h=>(i.add(h),()=>i.delete(h))},m=l=n(o,u,f);return f},QS=(n=>n?Qh(n):Qh),JS=n=>n;function WS(n,l=JS){const i=sa.useSyncExternalStore(n.subscribe,sa.useCallback(()=>l(n.getState()),[n,l]),sa.useCallback(()=>l(n.getInitialState()),[n,l]));return sa.useDebugValue(i),i}const $S=n=>{const l=QS(n),i=o=>WS(l,o);return Object.assign(i,l),i},e1=(n=>$S);function Jh(n,l){let i;try{i=n()}catch{return}return{getItem:u=>{var s;const c=m=>m===null?null:JSON.parse(m,void 0),f=(s=i.getItem(u))!=null?s:null;return f instanceof Promise?f.then(c):c(f)},setItem:(u,s)=>i.setItem(u,JSON.stringify(s,void 0)),removeItem:u=>i.removeItem(u)}}const Vs=n=>l=>{try{const i=n(l);return i instanceof Promise?i:{then(o){return Vs(o)(i)},catch(o){return this}}}catch(i){return{then(o){return this},catch(o){return Vs(o)(i)}}}},t1=(n,l)=>(i,o,u)=>{let s={storage:Jh(()=>localStorage),partialize:E=>E,version:0,merge:(E,T)=>({...T,...E}),...l},c=!1;const f=new Set,m=new Set;let h=s.storage;if(!h)return n((...E)=>{i(...E)},o,u);const g=()=>{const E=s.partialize({...o()});return h.setItem(s.name,{state:E,version:s.version})},y=u.setState;u.setState=(E,T)=>(y(E,T),g());const v=n((...E)=>(i(...E),g()),o,u);u.getInitialState=()=>v;let b;const w=()=>{var E,T;if(!h)return;c=!1,f.forEach(A=>{var k;return A((k=o())!=null?k:v)});const _=((T=s.onRehydrateStorage)==null?void 0:T.call(s,(E=o())!=null?E:v))||void 0;return Vs(h.getItem.bind(h))(s.name).then(A=>{if(A)if(typeof A.version=="number"&&A.version!==s.version){if(s.migrate){const k=s.migrate(A.state,A.version);return k instanceof Promise?k.then(q=>[!0,q]):[!0,k]}}else return[!1,A.state];return[!1,void 0]}).then(A=>{var k;const[q,H]=A;if(b=s.merge(H,(k=o())!=null?k:v),i(b,!0),q)return g()}).then(()=>{_?.(b,void 0),b=o(),c=!0,m.forEach(A=>A(b))}).catch(A=>{_?.(void 0,A)})};return u.persist={setOptions:E=>{s={...s,...E},E.storage&&(h=E.storage)},clearStorage:()=>{h?.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>w(),hasHydrated:()=>c,onHydrate:E=>(f.add(E),()=>{f.delete(E)}),onFinishHydration:E=>(m.add(E),()=>{m.delete(E)})},s.skipHydration||w(),b||v},On={USER:"user",ASSISTANT:"assistant"};var Ft=(n=>(n.IDLE="idle",n.LISTENING="listening",n.ERROR="error",n.PROCESSING="processing",n.TRANSCRIBING="transcribing",n))(Ft||{});const n1={sessionId:"",sessionToken:"",isStreaming:!1,recordingStatus:Ft.IDLE,isWaitingForResponse:!1,error:null,isTimeoutError:!1,startNewConnection:!1,showRetryButton:!1,chats:{},inlineText:null,isRefreshingSession:!1,ConnectionStatus:Ge.ConnectionStatus.CONNECTING,streamingTimeoutId:null,responseTimeoutId:null,lastStreamingActivity:null,progressMessage:null},Yr=e1()(t1((n,l)=>({sessionId:"",setSessionId:i=>n({sessionId:i}),sessionToken:"",setSessionToken:i=>n({sessionToken:i}),initialMessage:null,setInitialMessage:i=>n({initialMessage:i}),agentId:"",setAgentId:i=>n({agentId:i}),connectionStatus:Ge.ConnectionStatus.CONNECTING,setConnectionStatus:i=>n({connectionStatus:i}),isStreaming:!1,setIsStreaming:i=>n({isStreaming:i}),isWaitingForResponse:!1,setIsWaitingForResponse:i=>n({isWaitingForResponse:i}),progressMessage:null,setProgressMessage:i=>n({progressMessage:i}),recordingStatus:Ft.IDLE,setRecordingStatus:i=>n({recordingStatus:i}),startNewConnection:!1,setStartNewConnection:i=>n({startNewConnection:i}),inlineText:null,setInlineText:i=>n({inlineText:i}),isBotIconAnimating:!1,setIsBotIconAnimating:i=>n({isBotIconAnimating:i}),chats:{},addMessageToSession:(i,o)=>{n(u=>({chats:{...u.chats,[i]:[...u.chats[i]||[],o]}}))},updateMessageInSession:(i,o,u)=>n(s=>({chats:{...s.chats,[i]:(s.chats[i]||[]).map(c=>c.id===o?{...c,...u}:c)}})),getMessagesForSession:i=>l().chats[i]||[],clearMessagesForSession:i=>n(o=>({chats:{...o.chats,[i]:[]}})),clearAllChats:()=>n({chats:{}}),error:null,setError:i=>n({error:i}),clearError:()=>n({error:null,isTimeoutError:!1,showRetryButton:!1,startNewConnection:!1}),showRetryButton:!1,setShowRetryButton:i=>n({showRetryButton:i}),isTimeoutError:!1,setTimeoutError:i=>n({isTimeoutError:i}),clearSession:async()=>{n(n1),await localStorage.removeItem("med-assist-store")},streamingTimeoutId:null,setStreamingTimeoutId:i=>n({streamingTimeoutId:i}),clearStreamingTimeout:()=>{const i=l();i.streamingTimeoutId&&(clearTimeout(i.streamingTimeoutId),n({streamingTimeoutId:null}))},responseTimeoutId:null,setResponseTimeoutId:i=>n({responseTimeoutId:i}),clearResponseTimeout:()=>{const i=l();i.responseTimeoutId&&(clearTimeout(i.responseTimeoutId),n({responseTimeoutId:null}))},lastStreamingActivity:null,setLastStreamingActivity:i=>n({lastStreamingActivity:i})}),{name:"med-assist-store",storage:Jh(()=>localStorage),partialize:n=>({agentId:n.agentId,chats:n.chats,sessionId:n.sessionId,sessionToken:n.sessionToken,initialMessage:n.initialMessage,connectionStatus:n.connectionStatus})}));function r1({onClose:n,title:l,iconUrl:i,startNewConversation:o}){const u=Yr(f=>f.connectionStatus),c=(()=>{switch(u){case Ge.ConnectionStatus.CONNECTED:return{dotColor:"bg-green-500",text:"Connected",textColor:"text-green-600"};case Ge.ConnectionStatus.CONNECTING:return{dotColor:"bg-amber-500",text:"Connecting",textColor:"text-amber-600"};case Ge.ConnectionStatus.NOT_CONNECTED:return{dotColor:"bg-red-500",text:"Not Connected",textColor:"text-red-600"};default:return{dotColor:"bg-gray-400",text:"Not Connected",textColor:"text-gray-600"}}})();return O.jsx("div",{className:"bg-lavender-100/95 backdrop-blur-md shadow-lg border-b border-lavender-200/60 px-6 py-2",children:O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsxs("div",{className:"relative flex-shrink-0",children:[O.jsx(ha,{className:"w-12 h-12 bg-gradient-to-br from-lavender-400 to-lavender-500 flex-shrink-0 shadow-md ring-0",children:O.jsx(ma,{className:"text-white font-bold text-lg bg-transparent",children:i?O.jsx("img",{src:i,alt:"Bot Icon",className:"w-12 h-12 rounded-full object-cover"}):O.jsx("span",{className:"text-white font-bold text-lg bg-transparent",children:"MC"})})}),O.jsx("div",{className:Ye("absolute bottom-0 right-0 w-3.5 h-3.5 rounded-full border-2 border-white shadow-sm",c.dotColor,u===Ge.ConnectionStatus.CONNECTING&&"animate-pulse")})]}),O.jsxs("div",{className:"flex flex-col",children:[O.jsx("p",{className:"text-lg font-semibold text-slate-900",children:l||"Health Assist"}),O.jsx("div",{className:"flex items-center gap-1.5",children:O.jsx("span",{className:Ye("text-xs font-medium",c.textColor),children:c.text})})]})]}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(kt,{type:"button",variant:"ghost",size:"icon",title:"Start New Chat",onClick:o,className:"h-8 w-8 text-slate-600 hover:text-slate-900 hover:bg-white/60 active:bg-white/80 rounded-xl transition-all duration-200",children:O.jsx(vS,{className:"w-8 h-8"})}),O.jsx(kt,{onClick:n,type:"button",variant:"ghost",size:"icon",title:"Close",className:"h-8 w-8 text-slate-600 hover:text-slate-900 hover:bg-white/60 active:bg-white/80 rounded-xl transition-all duration-200",children:O.jsx(Os,{className:"w-8 h-8"})})]})]})})}const i1=P.lazy(()=>Promise.resolve().then(()=>m1));function a1({isOpen:n,onClose:l,iconUrl:i,onStartNewSession:o,children:u,title:s,sessionId:c,chatComposer:f,environment:m}){const[h,g]=P.useState(!1),y=P.useRef(null);P.useEffect(()=>{const w=()=>{const E=window?.innerWidth??0,T=navigator?.userAgent?.toLowerCase()??"",_=E<768||/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(T);g(_)};return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]),P.useEffect(()=>{if(!n||!h||!y.current)return;const w=y.current;let E=null,T=null;if(window.visualViewport){const _=()=>{if(w&&window.visualViewport){const q=window.visualViewport.height,H=window.visualViewport.offsetTop;E=requestAnimationFrame(()=>{w.style.transition="none",w.style.top=`${H}px`,w.style.left="0",w.style.right="0",w.style.bottom="auto",w.style.width="100vw",w.style.height=`${q}px`,w.style.maxHeight=`${q}px`,w.style.minHeight=`${q}px`,T&&clearTimeout(T),T=setTimeout(()=>{w.style.transition=""},100)})}},A=()=>{_()},k=()=>{if(w&&window.visualViewport){const q=window.visualViewport.offsetTop;E=requestAnimationFrame(()=>{w.style.transition="none",w.style.top=`${q}px`,setTimeout(()=>{w.style.transition=""},50)})}};return window.visualViewport.addEventListener("resize",A),window.visualViewport.addEventListener("scroll",k),_(),()=>{E&&cancelAnimationFrame(E),T&&clearTimeout(T),window.visualViewport?.removeEventListener("resize",A),window.visualViewport?.removeEventListener("scroll",k)}}else{const _=()=>{w&&(w.style.transition="none",w.style.top="0",w.style.left="0",w.style.right="0",w.style.bottom="auto",w.style.width="100vw",w.style.height="100svh",w.style.maxHeight="100svh",setTimeout(()=>{w.style.transition=""},100))};return window.addEventListener("resize",_),_(),()=>{window.removeEventListener("resize",_)}}},[n,h]),P.useEffect(()=>{if(n){const w=document.body.style.overflow,E=document.body.style.paddingRight,T=document.documentElement.style.overflow,_=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",_>0&&!h&&(document.body.style.paddingRight=`${_}px`),()=>{document.body.style.overflow=w,document.body.style.paddingRight=E,document.documentElement.style.overflow=T}}},[n,h]);const v=Ye("synapse-chat-widget-container","fixed m-0 p-0","box-border",h?"":"transition-all duration-300",h?"w-screen h-[100svh]":"bottom-4 right-4 w-96 h-[600px]","z-[2147483647]",n?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none scale-95"),b=Ye("w-full h-full",h?"bg-white":"bg-white/90 backdrop-blur-2xl","shadow-2xl","flex flex-col","overflow-hidden","border border-white/50 ring-1 ring-white/60",h?"rounded-none":"rounded-3xl");return O.jsxs("div",{ref:y,className:v,style:{margin:0,padding:0,border:"none",outline:"none",position:"fixed",zIndex:2147483647,fontSize:"16px",lineHeight:"2.5",userSelect:"auto",...h&&{top:0,left:0,right:0,bottom:0,width:"100vw",maxHeight:"100svh",height:"100svh",minHeight:"100svh",backgroundColor:"white"}},children:[O.jsx("style",{children:`
|
|
11
11
|
/* Isolate widget from host website styles */
|
|
12
12
|
.synapse-chat-widget-container,
|
|
13
13
|
.synapse-chat-widget-container *,
|
|
@@ -40,19 +40,18 @@ Error generating stack: `+o.message+`
|
|
|
40
40
|
max-height: 100svh;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
`}),H.jsxs(Na,{className:b,children:[H.jsx("div",{className:"flex-shrink-0 sticky top-0 z-50",children:H.jsx(O_,{onClose:a,title:l,iconUrl:i,startNewConversation:s})}),H.jsx("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col",children:u}),c&&H.jsx("div",{className:"flex-shrink-0 sticky bottom-0 z-50",children:H.jsx($.Suspense,{fallback:null,children:H.jsx(z_,{value:c.value,onChange:c.onChange,onSend:c.onSend,onFileChange:c.onFileChange,onRecording:c.onRecording,isRecording:c.isRecording,hasAttachment:c.hasAttachment,attachmentFiles:c.attachmentFiles,isDisabled:c.isDisabled,isMobile:f,placeholder:c.placeholder,recordingStatus:c.recordingStatus})})})]})]})}class D_{eventListeners=new Map;on(a,i){const s=this.eventListeners.get(a)||new Set;s.add(i),this.eventListeners.set(a,s)}off(a,i){const s=this.eventListeners.get(a);s&&(s.delete(i),s.size===0&&this.eventListeners.delete(a))}emit(a,...i){const s=this.eventListeners.get(a);s&&s.forEach(u=>u(...i))}}const _n={CONNECTING:"connecting",CONNECTED:"connected",NOT_CONNECTED:"not_connected"},Cr={CLIENT_CLOSED:"client_closed",SERVER_CLOSED:"server_closed",CONNECTION_ERROR:"connection_error",AUTHENTICATION_ERROR:"authentication_error",NETWORK_ERROR:"network_error"};class I_{status=_n.CONNECTING;queue=[];eventEmitter=new D_;disconnectionDetails=null;onErrorCallback=null;onDisconnectCallback=null;onMessageCallback=null;onOpenCallback=null;onStatusChangeCallback=null;getStatus(){return this.status}onOpen(a){this.onOpenCallback=a}onMessage(a){if(this.onMessageCallback=a,this.queue.length>0){const i=[...this.queue];this.queue.length=0,queueMicrotask(()=>{i.forEach(s=>{this.onMessageCallback?.(s)})})}}onDisconnect(a){this.onDisconnectCallback=a;const i=this.disconnectionDetails;i&&queueMicrotask(()=>{this.onDisconnectCallback?.(i)})}onError(a){this.onErrorCallback=a}on(a,i){this.eventEmitter.on(a,i)}off(a,i){this.eventEmitter.off(a,i)}emit(a,...i){this.eventEmitter.emit(a,...i)}onStatusChange(a){this.onStatusChangeCallback=a,queueMicrotask(()=>{a(this.status)})}disconnect(a){this.disconnectionDetails||(this.disconnectionDetails=a,this.updateStatus(_n.NOT_CONNECTED),this.onDisconnectCallback?.(a))}handleMessage(a){this.onMessageCallback?this.onMessageCallback(a):this.queue.push(a)}updateStatus(a){this.status!==a&&(this.status=a,this.onStatusChangeCallback?.(a))}}const Jn={API:"API_ERROR",CONNECTION:"CONNECTION_ERROR",RECORDING:"RECORDING_ERROR",FILE:"FILE_ERROR",SESSION:"SESSION_ERROR",MESSAGE:"MESSAGE_ERROR",UNKNOWN:"UNKNOWN_ERROR"};class Sn extends Error{code;timestamp;cause;context;hint;displayMessage;constructor(a,i=Jn.UNKNOWN,s={}){super(a),this.name="SynapseError",this.code=i,this.timestamp=new Date,this.cause=s.cause,this.context=s.context,this.hint=s.hint,this.displayMessage=s.displayMessage||s?.hint||a,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class rt extends Sn{status;error;headers;constructor(a,i,s,u){const l=rt.makeMessage(i,s,a);super(l,Jn.API,{cause:s,context:{status:i,hasBody:!!s},hint:i&&i>=500?"Retry the request or contact support if the issue persists.":void 0,displayMessage:a||"Something went wrong"}),this.name="APIError",this.status=i,this.error=s,this.headers=u}static makeMessage(a,i,s){const u=i instanceof Error?i.message:s;return a&&u?`HTTP ${a}: ${u}`:a?`${a} status code (no body)`:u||"(no status code or body)"}static generate(a,i,s,u){if(!a)return new j_({message:s});const l=i?.error,c=l&&typeof l=="object"&&!Array.isArray(l)?l:void 0;switch(a){case 400:return new L_(s||"Bad Request",a,c,u);case 401:return new vp(s||"Unauthorized",a,c,u);case 403:return new _p(s||"Permission Denied",a,c,u);case 404:return new B_(s||"Not Found",a,c,u);case 405:return new U_(s||"Method Not Allowed",a,c,u);case 429:return new F_(s||"Rate Limit Exceeded",a,c,u);case 500:return new P_(s||"Internal Server Error",a,c,u);default:return new rt(s||"API Error",a,c,u)}}}class j_ extends rt{constructor({message:a}={}){super(a||"Request was aborted.",void 0,void 0,void 0),this.name="APIUserAbortError"}}class bp extends rt{constructor({message:a}={}){super(a||"Request timed out.",void 0,void 0,void 0),this.name="APIConnectionTimeoutError"}}class L_ extends rt{constructor(a,i,s,u){super(a,i,s,u),this.name="BadRequestError"}}class vp extends rt{constructor(a,i,s,u){super(a,i,s,u),this.name="UnauthorizedError"}}class _p extends rt{constructor(a,i,s,u){super(a,i,s,u),this.name="PermissionDeniedError"}}class B_ extends rt{constructor(a,i,s,u){super(a,i,s,u),this.name="NotFoundError"}}class U_ extends rt{constructor(a,i,s,u){super(a,i,s,u),this.name="MethodNotAllowedError"}}class F_ extends rt{constructor(a,i,s,u){super(a,i,s,u),this.name="RateLimitError"}}class P_ extends rt{constructor(a,i,s,u){super(a,i,s,u),this.name="InternalServerError"}}class qt extends Sn{constructor(a,i={}){super(a,Jn.CONNECTION,i),this.name="ConnectionError"}}class ln extends Sn{constructor(a,i={}){super(a,Jn.RECORDING,i),this.name="RecordingError"}}class Za extends Sn{constructor(a,i={}){super(a,Jn.FILE,i),this.name="FileError"}}class oi extends Sn{constructor(a,i={}){super(a,Jn.SESSION,i),this.name="SessionError"}}class Xa extends Sn{constructor(a,i={}){super(a,Jn.MESSAGE,i),this.name="MessageError"}}function kr(n,a,i,s={}){if(n instanceof a)return n;const u={...s,context:{...n instanceof Sn?n.context:void 0,...s.context},hint:s.hint??(n instanceof Sn?n.hint:void 0),cause:s.cause??n};if(n instanceof Sn)return new a(n.message,u);const l=n instanceof Error&&n.message?n.message:i;return new a(l,u)}class H_ extends I_{conversationId;socket=null;config;reconnectCount=0;constructor(a){super(),this.config={...a,reconnect:a.reconnect||!0,reconnectAttempts:a.reconnectAttempts||3,reconnectDelay:a.reconnectDelay||1e3},this.conversationId=a.auth.sessionId,this.connect()}connect(){try{this.updateStatus(_n.CONNECTING);const a=this.buildConnectionUrl();this.socket=new WebSocket(a),this.socket.onopen=this.handleOpen.bind(this),this.socket.onmessage=this.handleSocketMessage.bind(this),this.socket.onerror=this.handleError.bind(this),this.socket.onclose=this.handleClose.bind(this)}catch(a){const i=kr(a,qt,"Failed to establish WebSocket connection",{context:{stage:"connect"}});this.onErrorCallback?.(i),this.disconnect({reason:Cr.CONNECTION_ERROR,message:i.message,timestamp:new Date})}}buildConnectionUrl(){const a=new URL(this.config.serverUrl);return a.pathname=`/reloaded/ws/med-assist/session/${this.config.auth.sessionId}/`,a.toString()}handleOpen(){this.onOpenCallback?.()}handleSocketMessage(a){try{const i=JSON.parse(a.data);this.handleMessage(i)}catch(i){const s=kr(i,Xa,"Failed to parse incoming WebSocket message",{context:{stage:"handleSocketMessage"}});this.onErrorCallback?.(s)}}handleError(a){const i=new qt("WebSocket error",{context:{stage:"handleError"},cause:a});this.onErrorCallback?.(i)}handleClose(a){const i=a.wasClean,s=a.code,u=a.reason;let l,c;s===1e3?(l=Cr.CLIENT_CLOSED,c="Connection closed normally"):s===1001||s===1006?(l=Cr.NETWORK_ERROR,c="Network connection lost"):s===4001?(l=Cr.AUTHENTICATION_ERROR,c="Authentication failed"):i?(l=Cr.SERVER_CLOSED,c=u||"Server closed connection"):(l=Cr.CONNECTION_ERROR,c=u||"Connection closed unexpectedly"),this.config.reconnect&&l!==Cr.AUTHENTICATION_ERROR&&l!==Cr.CLIENT_CLOSED&&this.reconnectCount<(this.config.reconnectAttempts||3)?(this.reconnectCount++,setTimeout(()=>{this.connect()},this.config.reconnectDelay||1e3)):this.disconnect({reason:l,message:c,code:s,timestamp:new Date})}sendMessage(a){if(!this.socket||this.socket.readyState!==WebSocket.OPEN)throw new qt("Cannot send message: connection not open",{context:{stage:"sendMessage",readyState:this.socket?.readyState},hint:"Ensure the WebSocket is open before sending messages."});try{this.socket.send(JSON.stringify(a))}catch(i){const s=kr(i,qt,"Failed to send WebSocket message",{context:{stage:"sendMessage"}});throw this.onErrorCallback?.(s),s}}close(){this.socket&&(this.updateStatus(_n.NOT_CONNECTED),this.socket.close(1e3,"Client closed connection"),this.socket=null)}isConnected(){return this.socket?.readyState===WebSocket.OPEN}handleConnected(){this.updateStatus(_n.CONNECTED),this.reconnectCount=0}}const $n={SOCKET:"socket"};class q_{static async createConnection(a,i){switch(a){case $n.SOCKET:return new H_(i);default:throw new qt(`Unsupported connection type: ${a}`,{context:{type:a}})}}}const Sp={WEBSOCKET_URL:"ws://7d122fab59fd.ngrok-free.app/reloaded",BASE_API_URL:"https://7d122fab59fd.ngrok-free.app/reloaded"},G_={WEBSOCKET_URL:"wss://matrix-ws.dev.eka.care/reloaded",BASE_API_URL:"https://matrix.dev.eka.care/reloaded"},V_={WEBSOCKET_URL:"wss://matrix-ws.dev.eka.care",BASE_API_URL:"https://matrix.dev.eka.care"},Ep=(n="production")=>n==="development"?G_:n==="production"?Sp:n==="staging"?V_:Sp;class Y_{baseUrl;headers;timeout;maxRetries;constructor(a){this.baseUrl=a.baseUrl.replace(/\/$/,""),this.timeout=a.timeout||3e4,this.maxRetries=a.maxRetries||3,this.headers={"Content-Type":"application/json",...a.headers},a.authorization&&(this.headers.Authorization=a.authorization)}async request(a,i,s){const u=s?.retries??this.maxRetries;let l;for(let c=0;c<=u;c++)try{const f=this.buildUrl(i,s?.params),d=await fetch(f,{method:a,headers:{...this.headers,...s?.headers},body:s?.body?JSON.stringify(s.body):void 0,signal:AbortSignal.timeout(this.timeout)});return d.ok||await this.handleError(d),d.json()}catch(f){if(l=f,c===u||!(f instanceof TypeError&&f.message==="Failed to fetch"||f instanceof DOMException&&f.name==="AbortError"||f instanceof SyntaxError))break;const h=Math.pow(2,c)*100;await new Promise(y=>setTimeout(y,h))}throw l?l instanceof TypeError&&l.message==="Failed to fetch"?new rt("Network error: Unable to connect to the server. Please check your internet connection.",0,{type:"NETWORK_ERROR",originalError:l.message}):l instanceof DOMException&&l.name==="AbortError"?new bp({message:`Request timed out after ${this.timeout}ms`}):l instanceof SyntaxError?new rt("Invalid response format from server",502,{type:"PARSE_ERROR",originalError:l.message}):l instanceof rt?l:new rt(`Request failed: ${l.message||"Unknown error"}`,500,{type:"UNKNOWN_ERROR",originalError:l}):new rt("Unknown error occurred",500,{type:"UNKNOWN_ERROR"})}async get(a,i,s){return this.request("GET",a,{params:i,...s})}async post(a,i,s){return this.request("POST",a,{body:i,...s})}async put(a,i,s){return this.request("PUT",a,{body:i,...s})}async delete(a,i){return this.request("DELETE",a,{...i})}async patch(a,i,s){return this.request("PATCH",a,{body:i,...s})}buildUrl(a,i){let s=`${this.baseUrl}${a}`;if(i){const u=new URLSearchParams(i).toString();s+=`?${u}`}return s}async handleError(a){let i,s;try{s=await a.json(),i=s.message||s?.msg||a.statusText}catch{i=a.statusText}throw rt.generate(a.status,s,i,a.headers)}}class wp{client;constructor(a){this.client=a}async get(a,i,s){return this.client.get(a,i,s)}async post(a,i,s){return this.client.post(a,i,s)}async put(a,i,s){return this.client.put(a,i,s)}async delete(a,i){return this.client.delete(a,i)}async patch(a,i,s){return this.client.patch(a,i,s)}buildPath(a,i){let s=a;for(const[u,l]of Object.entries(i))s=s.replace(`:${u}`,encodeURIComponent(l));return s}}class Z_ extends wp{basePath="/med-assist/session";async create(a){return this.post(this.basePath,{user_id:a})}async retrieve(a){return this.get(`${this.basePath}/${a}`)}async refresh(a,i){return this.get(`${this.basePath}/${a}/refresh`,void 0,{headers:{"x-sess-token":i}})}async feedback(a,i,s,u){return this.patch(`${this.basePath}/${a}/${i}`,{feedback:s,feedback_reason:u})}}var li=(n=>(n.MOBILE_VERIFICATION="mobile_verification",n.AVAILABILITY_DATES="availability_dates",n.AVAILABILITY_SLOTS="availability_slots",n.DOCTOR_DETAILS="doctor_details",n.GET_LOCATION="get_location",n))(li||{});const uo={PILL:"pills",MULTI:"multi",DOCTOR_CARD:"doctor_card"};var Di=(n=>(n.AVAILABILITY_DATES="tool_callback_availability_dates",n.AVAILABILITY_SLOTS="tool_callback_availability_slots",n.MOBILE_VERIFICATION="tool_callback_mobile_verification",n.DOCTOR_DETAILS="tool_callback_doctor_details",n))(Di||{});class X_ extends wp{basePath="/med-assist/api-call-tool";async callTool(a,i,s){return i===li.GET_LOCATION?this.requestLocation():this.post(`${this.basePath}?session_id=${a}&tool_name=${i}`,{tool_params:s})}async requestLocation(){return new Promise((a,i)=>{if(typeof navigator>"u"||!navigator.geolocation){i({code:500,message:"Geolocation is not supported by this browser",status:500,type:"GEOLOCATION_ERROR",originalError:new Error("Geolocation is not supported by this browser")});return}navigator.geolocation.getCurrentPosition(s=>{a({latitude:s.coords.latitude,longitude:s.coords.longitude,accuracy:s.coords?.accuracy??void 0})},s=>{i({code:s.code,message:s.message,status:500,type:"GEOLOCATION_ERROR",originalError:s})},{timeout:1e4,maximumAge:0,enableHighAccuracy:!0})})}}class K_{resourceConfig;httpClient;session;toolCall=null;constructor(a){this.resourceConfig=a,this.httpClient=new Y_({baseUrl:this.resourceConfig.serverUrl,headers:{"X-agent-id":this.resourceConfig.agentId}}),this.session=new Z_(this.httpClient)}async createSession(a){try{const i=await this.session.create(a);if(!i?.session_id||!i?.session_token)throw new rt("Failed to start session.",500,void 0,void 0);return i}catch(i){throw i instanceof rt?i:new rt("Failed to start session.",500,void 0,void 0)}}async validateSession(a){try{const i=await this.session.retrieve(a);return i.msg&&i.msg==="Session Active"?{expired:!1,active:!0}:{expired:!0,active:!1}}catch(i){if(i instanceof rt)switch(i.status){case 404:return{expired:!1,active:!1};case 500:return{expired:!1,active:!1};case 401:return{expired:!0,active:!1};default:return{expired:!1,active:!1}}throw new rt("Failed to validate session.",500,void 0,void 0)}}async refreshSession(a,i){return await this.session.refresh(a,i)}async sendFeedback(a,i,s,u){return await this.session.feedback(a,i,s,u)}async callTool(a,i,s){return this.toolCall||(this.toolCall=new X_(this.httpClient)),await this.toolCall.callTool(a,i,s)}}const un={TEXT:"text",AUDIO:"audio",FILE:"file",TOOL_CALL:"tool",TIPS:"tips",INLINE_TEXT:"inline_text",TOOL_START:"tool_start",TOOL_END:"tool_end"},Yt={PING:"ping",PONG:"pong",CHAT:"chat",STREAM:"stream",AUTH:"auth",END_OF_STREAM:"eos",SYNC:"sync",ERROR:"err",CONNECTION_ESTABLISHED:"conn"};var du={exports:{}};var xp;function Q_(){return xp||(xp=1,(function(n,a){(function(i){n.exports=i()})(function(){return(function i(s,u,l){function c(h,y){if(!u[h]){if(!s[h]){var b=typeof xr=="function"&&xr;if(!y&&b)return b(h,!0);if(f)return f(h,!0);var _=new Error("Cannot find module '"+h+"'");throw _.code="MODULE_NOT_FOUND",_}var m=u[h]={exports:{}};s[h][0].call(m.exports,function(C){var S=s[h][1][C];return c(S||C)},m,m.exports,i,s,u,l)}return u[h].exports}for(var f=typeof xr=="function"&&xr,d=0;d<l.length;d++)c(l[d]);return c})({1:[function(i,s,u){var l=i("./utils"),c=i("./support"),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";u.encode=function(d){for(var h,y,b,_,m,C,S,x=[],w=0,k=d.length,N=k,j=l.getTypeOf(d)!=="string";w<d.length;)N=k-w,b=j?(h=d[w++],y=w<k?d[w++]:0,w<k?d[w++]:0):(h=d.charCodeAt(w++),y=w<k?d.charCodeAt(w++):0,w<k?d.charCodeAt(w++):0),_=h>>2,m=(3&h)<<4|y>>4,C=1<N?(15&y)<<2|b>>6:64,S=2<N?63&b:64,x.push(f.charAt(_)+f.charAt(m)+f.charAt(C)+f.charAt(S));return x.join("")},u.decode=function(d){var h,y,b,_,m,C,S=0,x=0,w="data:";if(d.substr(0,w.length)===w)throw new Error("Invalid base64 input, it looks like a data url.");var k,N=3*(d=d.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(d.charAt(d.length-1)===f.charAt(64)&&N--,d.charAt(d.length-2)===f.charAt(64)&&N--,N%1!=0)throw new Error("Invalid base64 input, bad content length.");for(k=c.uint8array?new Uint8Array(0|N):new Array(0|N);S<d.length;)h=f.indexOf(d.charAt(S++))<<2|(_=f.indexOf(d.charAt(S++)))>>4,y=(15&_)<<4|(m=f.indexOf(d.charAt(S++)))>>2,b=(3&m)<<6|(C=f.indexOf(d.charAt(S++))),k[x++]=h,m!==64&&(k[x++]=y),C!==64&&(k[x++]=b);return k}},{"./support":30,"./utils":32}],2:[function(i,s,u){var l=i("./external"),c=i("./stream/DataWorker"),f=i("./stream/Crc32Probe"),d=i("./stream/DataLengthProbe");function h(y,b,_,m,C){this.compressedSize=y,this.uncompressedSize=b,this.crc32=_,this.compression=m,this.compressedContent=C}h.prototype={getContentWorker:function(){var y=new c(l.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new d("data_length")),b=this;return y.on("end",function(){if(this.streamInfo.data_length!==b.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),y},getCompressedWorker:function(){return new c(l.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},h.createWorkerFrom=function(y,b,_){return y.pipe(new f).pipe(new d("uncompressedSize")).pipe(b.compressWorker(_)).pipe(new d("compressedSize")).withStreamInfo("compression",b)},s.exports=h},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,s,u){var l=i("./stream/GenericWorker");u.STORE={magic:"\0\0",compressWorker:function(){return new l("STORE compression")},uncompressWorker:function(){return new l("STORE decompression")}},u.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,s,u){var l=i("./utils"),c=(function(){for(var f,d=[],h=0;h<256;h++){f=h;for(var y=0;y<8;y++)f=1&f?3988292384^f>>>1:f>>>1;d[h]=f}return d})();s.exports=function(f,d){return f!==void 0&&f.length?l.getTypeOf(f)!=="string"?(function(h,y,b,_){var m=c,C=_+b;h^=-1;for(var S=_;S<C;S++)h=h>>>8^m[255&(h^y[S])];return-1^h})(0|d,f,f.length,0):(function(h,y,b,_){var m=c,C=_+b;h^=-1;for(var S=_;S<C;S++)h=h>>>8^m[255&(h^y.charCodeAt(S))];return-1^h})(0|d,f,f.length,0):0}},{"./utils":32}],5:[function(i,s,u){u.base64=!1,u.binary=!1,u.dir=!1,u.createFolders=!0,u.date=null,u.compression=null,u.compressionOptions=null,u.comment=null,u.unixPermissions=null,u.dosPermissions=null},{}],6:[function(i,s,u){var l=null;l=typeof Promise<"u"?Promise:i("lie"),s.exports={Promise:l}},{lie:37}],7:[function(i,s,u){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",c=i("pako"),f=i("./utils"),d=i("./stream/GenericWorker"),h=l?"uint8array":"array";function y(b,_){d.call(this,"FlateWorker/"+b),this._pako=null,this._pakoAction=b,this._pakoOptions=_,this.meta={}}u.magic="\b\0",f.inherits(y,d),y.prototype.processChunk=function(b){this.meta=b.meta,this._pako===null&&this._createPako(),this._pako.push(f.transformTo(h,b.data),!1)},y.prototype.flush=function(){d.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new c[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var b=this;this._pako.onData=function(_){b.push({data:_,meta:b.meta})}},u.compressWorker=function(b){return new y("Deflate",b)},u.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,s,u){function l(m,C){var S,x="";for(S=0;S<C;S++)x+=String.fromCharCode(255&m),m>>>=8;return x}function c(m,C,S,x,w,k){var N,j,D=m.file,M=m.compression,L=k!==h.utf8encode,V=f.transformTo("string",k(D.name)),F=f.transformTo("string",h.utf8encode(D.name)),W=D.comment,oe=f.transformTo("string",k(W)),R=f.transformTo("string",h.utf8encode(W)),Q=F.length!==D.name.length,E=R.length!==W.length,G="",J="",K="",ue=D.dir,re=D.date,q={crc32:0,compressedSize:0,uncompressedSize:0};C&&!S||(q.crc32=m.crc32,q.compressedSize=m.compressedSize,q.uncompressedSize=m.uncompressedSize);var z=0;C&&(z|=8),L||!Q&&!E||(z|=2048);var I=0,B=0;ue&&(I|=16),w==="UNIX"?(B=798,I|=(function(ae,xe){var Te=ae;return ae||(Te=xe?16893:33204),(65535&Te)<<16})(D.unixPermissions,ue)):(B=20,I|=(function(ae){return 63&(ae||0)})(D.dosPermissions)),N=re.getUTCHours(),N<<=6,N|=re.getUTCMinutes(),N<<=5,N|=re.getUTCSeconds()/2,j=re.getUTCFullYear()-1980,j<<=4,j|=re.getUTCMonth()+1,j<<=5,j|=re.getUTCDate(),Q&&(J=l(1,1)+l(y(V),4)+F,G+="up"+l(J.length,2)+J),E&&(K=l(1,1)+l(y(oe),4)+R,G+="uc"+l(K.length,2)+K);var te="";return te+=`
|
|
44
|
-
\0`,te+=l(z,2),te+=M.magic,te+=l(N,2),te+=l(j,2),te+=l(q.crc32,4),te+=l(q.compressedSize,4),te+=l(q.uncompressedSize,4),te+=l(V.length,2),te+=l(G.length,2),{fileRecord:b.LOCAL_FILE_HEADER+te+V+G,dirRecord:b.CENTRAL_FILE_HEADER+l(B,2)+te+l(oe.length,2)+"\0\0\0\0"+l(I,4)+l(x,4)+V+G+oe}}var f=i("../utils"),d=i("../stream/GenericWorker"),h=i("../utf8"),y=i("../crc32"),b=i("../signature");function _(m,C,S,x){d.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=C,this.zipPlatform=S,this.encodeFileName=x,this.streamFiles=m,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}f.inherits(_,d),_.prototype.push=function(m){var C=m.meta.percent||0,S=this.entriesCount,x=this._sources.length;this.accumulate?this.contentBuffer.push(m):(this.bytesWritten+=m.data.length,d.prototype.push.call(this,{data:m.data,meta:{currentFile:this.currentFile,percent:S?(C+100*(S-x-1))/S:100}}))},_.prototype.openedSource=function(m){this.currentSourceOffset=this.bytesWritten,this.currentFile=m.file.name;var C=this.streamFiles&&!m.file.dir;if(C){var S=c(m,C,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:S.fileRecord,meta:{percent:0}})}else this.accumulate=!0},_.prototype.closedSource=function(m){this.accumulate=!1;var C=this.streamFiles&&!m.file.dir,S=c(m,C,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(S.dirRecord),C)this.push({data:(function(x){return b.DATA_DESCRIPTOR+l(x.crc32,4)+l(x.compressedSize,4)+l(x.uncompressedSize,4)})(m),meta:{percent:100}});else for(this.push({data:S.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},_.prototype.flush=function(){for(var m=this.bytesWritten,C=0;C<this.dirRecords.length;C++)this.push({data:this.dirRecords[C],meta:{percent:100}});var S=this.bytesWritten-m,x=(function(w,k,N,j,D){var M=f.transformTo("string",D(j));return b.CENTRAL_DIRECTORY_END+"\0\0\0\0"+l(w,2)+l(w,2)+l(k,4)+l(N,4)+l(M.length,2)+M})(this.dirRecords.length,S,m,this.zipComment,this.encodeFileName);this.push({data:x,meta:{percent:100}})},_.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},_.prototype.registerPrevious=function(m){this._sources.push(m);var C=this;return m.on("data",function(S){C.processChunk(S)}),m.on("end",function(){C.closedSource(C.previous.streamInfo),C._sources.length?C.prepareNextSource():C.end()}),m.on("error",function(S){C.error(S)}),this},_.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},_.prototype.error=function(m){var C=this._sources;if(!d.prototype.error.call(this,m))return!1;for(var S=0;S<C.length;S++)try{C[S].error(m)}catch{}return!0},_.prototype.lock=function(){d.prototype.lock.call(this);for(var m=this._sources,C=0;C<m.length;C++)m[C].lock()},s.exports=_},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(i,s,u){var l=i("../compressions"),c=i("./ZipFileWorker");u.generateWorker=function(f,d,h){var y=new c(d.streamFiles,h,d.platform,d.encodeFileName),b=0;try{f.forEach(function(_,m){b++;var C=(function(k,N){var j=k||N,D=l[j];if(!D)throw new Error(j+" is not a valid compression method !");return D})(m.options.compression,d.compression),S=m.options.compressionOptions||d.compressionOptions||{},x=m.dir,w=m.date;m._compressWorker(C,S).withStreamInfo("file",{name:_,dir:x,date:w,comment:m.comment||"",unixPermissions:m.unixPermissions,dosPermissions:m.dosPermissions}).pipe(y)}),y.entriesCount=b}catch(_){y.error(_)}return y}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(i,s,u){function l(){if(!(this instanceof l))return new l;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var c=new l;for(var f in this)typeof this[f]!="function"&&(c[f]=this[f]);return c}}(l.prototype=i("./object")).loadAsync=i("./load"),l.support=i("./support"),l.defaults=i("./defaults"),l.version="3.10.1",l.loadAsync=function(c,f){return new l().loadAsync(c,f)},l.external=i("./external"),s.exports=l},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(i,s,u){var l=i("./utils"),c=i("./external"),f=i("./utf8"),d=i("./zipEntries"),h=i("./stream/Crc32Probe"),y=i("./nodejsUtils");function b(_){return new c.Promise(function(m,C){var S=_.decompressed.getContentWorker().pipe(new h);S.on("error",function(x){C(x)}).on("end",function(){S.streamInfo.crc32!==_.decompressed.crc32?C(new Error("Corrupted zip : CRC32 mismatch")):m()}).resume()})}s.exports=function(_,m){var C=this;return m=l.extend(m||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:f.utf8decode}),y.isNode&&y.isStream(_)?c.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):l.prepareContent("the loaded zip file",_,!0,m.optimizedBinaryString,m.base64).then(function(S){var x=new d(m);return x.load(S),x}).then(function(S){var x=[c.Promise.resolve(S)],w=S.files;if(m.checkCRC32)for(var k=0;k<w.length;k++)x.push(b(w[k]));return c.Promise.all(x)}).then(function(S){for(var x=S.shift(),w=x.files,k=0;k<w.length;k++){var N=w[k],j=N.fileNameStr,D=l.resolve(N.fileNameStr);C.file(D,N.decompressed,{binary:!0,optimizedBinaryString:!0,date:N.date,dir:N.dir,comment:N.fileCommentStr.length?N.fileCommentStr:null,unixPermissions:N.unixPermissions,dosPermissions:N.dosPermissions,createFolders:m.createFolders}),N.dir||(C.file(D).unsafeOriginalName=j)}return x.zipComment.length&&(C.comment=x.zipComment),C})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(i,s,u){var l=i("../utils"),c=i("../stream/GenericWorker");function f(d,h){c.call(this,"Nodejs stream input adapter for "+d),this._upstreamEnded=!1,this._bindStream(h)}l.inherits(f,c),f.prototype._bindStream=function(d){var h=this;(this._stream=d).pause(),d.on("data",function(y){h.push({data:y,meta:{percent:0}})}).on("error",function(y){h.isPaused?this.generatedError=y:h.error(y)}).on("end",function(){h.isPaused?h._upstreamEnded=!0:h.end()})},f.prototype.pause=function(){return!!c.prototype.pause.call(this)&&(this._stream.pause(),!0)},f.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},s.exports=f},{"../stream/GenericWorker":28,"../utils":32}],13:[function(i,s,u){var l=i("readable-stream").Readable;function c(f,d,h){l.call(this,d),this._helper=f;var y=this;f.on("data",function(b,_){y.push(b)||y._helper.pause(),h&&h(_)}).on("error",function(b){y.emit("error",b)}).on("end",function(){y.push(null)})}i("../utils").inherits(c,l),c.prototype._read=function(){this._helper.resume()},s.exports=c},{"../utils":32,"readable-stream":16}],14:[function(i,s,u){s.exports={isNode:typeof Buffer<"u",newBufferFrom:function(l,c){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(l,c);if(typeof l=="number")throw new Error('The "data" argument must not be a number');return new Buffer(l,c)},allocBuffer:function(l){if(Buffer.alloc)return Buffer.alloc(l);var c=new Buffer(l);return c.fill(0),c},isBuffer:function(l){return Buffer.isBuffer(l)},isStream:function(l){return l&&typeof l.on=="function"&&typeof l.pause=="function"&&typeof l.resume=="function"}}},{}],15:[function(i,s,u){function l(D,M,L){var V,F=f.getTypeOf(M),W=f.extend(L||{},y);W.date=W.date||new Date,W.compression!==null&&(W.compression=W.compression.toUpperCase()),typeof W.unixPermissions=="string"&&(W.unixPermissions=parseInt(W.unixPermissions,8)),W.unixPermissions&&16384&W.unixPermissions&&(W.dir=!0),W.dosPermissions&&16&W.dosPermissions&&(W.dir=!0),W.dir&&(D=w(D)),W.createFolders&&(V=x(D))&&k.call(this,V,!0);var oe=F==="string"&&W.binary===!1&&W.base64===!1;L&&L.binary!==void 0||(W.binary=!oe),(M instanceof b&&M.uncompressedSize===0||W.dir||!M||M.length===0)&&(W.base64=!1,W.binary=!0,M="",W.compression="STORE",F="string");var R=null;R=M instanceof b||M instanceof d?M:C.isNode&&C.isStream(M)?new S(D,M):f.prepareContent(D,M,W.binary,W.optimizedBinaryString,W.base64);var Q=new _(D,R,W);this.files[D]=Q}var c=i("./utf8"),f=i("./utils"),d=i("./stream/GenericWorker"),h=i("./stream/StreamHelper"),y=i("./defaults"),b=i("./compressedObject"),_=i("./zipObject"),m=i("./generate"),C=i("./nodejsUtils"),S=i("./nodejs/NodejsStreamInputAdapter"),x=function(D){D.slice(-1)==="/"&&(D=D.substring(0,D.length-1));var M=D.lastIndexOf("/");return 0<M?D.substring(0,M):""},w=function(D){return D.slice(-1)!=="/"&&(D+="/"),D},k=function(D,M){return M=M!==void 0?M:y.createFolders,D=w(D),this.files[D]||l.call(this,D,null,{dir:!0,createFolders:M}),this.files[D]};function N(D){return Object.prototype.toString.call(D)==="[object RegExp]"}var j={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(D){var M,L,V;for(M in this.files)V=this.files[M],(L=M.slice(this.root.length,M.length))&&M.slice(0,this.root.length)===this.root&&D(L,V)},filter:function(D){var M=[];return this.forEach(function(L,V){D(L,V)&&M.push(V)}),M},file:function(D,M,L){if(arguments.length!==1)return D=this.root+D,l.call(this,D,M,L),this;if(N(D)){var V=D;return this.filter(function(W,oe){return!oe.dir&&V.test(W)})}var F=this.files[this.root+D];return F&&!F.dir?F:null},folder:function(D){if(!D)return this;if(N(D))return this.filter(function(F,W){return W.dir&&D.test(F)});var M=this.root+D,L=k.call(this,M),V=this.clone();return V.root=L.name,V},remove:function(D){D=this.root+D;var M=this.files[D];if(M||(D.slice(-1)!=="/"&&(D+="/"),M=this.files[D]),M&&!M.dir)delete this.files[D];else for(var L=this.filter(function(F,W){return W.name.slice(0,D.length)===D}),V=0;V<L.length;V++)delete this.files[L[V].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(D){var M,L={};try{if((L=f.extend(D||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:c.utf8encode})).type=L.type.toLowerCase(),L.compression=L.compression.toUpperCase(),L.type==="binarystring"&&(L.type="string"),!L.type)throw new Error("No output type specified.");f.checkSupport(L.type),L.platform!=="darwin"&&L.platform!=="freebsd"&&L.platform!=="linux"&&L.platform!=="sunos"||(L.platform="UNIX"),L.platform==="win32"&&(L.platform="DOS");var V=L.comment||this.comment||"";M=m.generateWorker(this,L,V)}catch(F){(M=new d("error")).error(F)}return new h(M,L.type||"string",L.mimeType)},generateAsync:function(D,M){return this.generateInternalStream(D).accumulate(M)},generateNodeStream:function(D,M){return(D=D||{}).type||(D.type="nodebuffer"),this.generateInternalStream(D).toNodejsStream(M)}};s.exports=j},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(i,s,u){s.exports=i("stream")},{stream:void 0}],17:[function(i,s,u){var l=i("./DataReader");function c(f){l.call(this,f);for(var d=0;d<this.data.length;d++)f[d]=255&f[d]}i("../utils").inherits(c,l),c.prototype.byteAt=function(f){return this.data[this.zero+f]},c.prototype.lastIndexOfSignature=function(f){for(var d=f.charCodeAt(0),h=f.charCodeAt(1),y=f.charCodeAt(2),b=f.charCodeAt(3),_=this.length-4;0<=_;--_)if(this.data[_]===d&&this.data[_+1]===h&&this.data[_+2]===y&&this.data[_+3]===b)return _-this.zero;return-1},c.prototype.readAndCheckSignature=function(f){var d=f.charCodeAt(0),h=f.charCodeAt(1),y=f.charCodeAt(2),b=f.charCodeAt(3),_=this.readData(4);return d===_[0]&&h===_[1]&&y===_[2]&&b===_[3]},c.prototype.readData=function(f){if(this.checkOffset(f),f===0)return[];var d=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,d},s.exports=c},{"../utils":32,"./DataReader":18}],18:[function(i,s,u){var l=i("../utils");function c(f){this.data=f,this.length=f.length,this.index=0,this.zero=0}c.prototype={checkOffset:function(f){this.checkIndex(this.index+f)},checkIndex:function(f){if(this.length<this.zero+f||f<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+f+"). Corrupted zip ?")},setIndex:function(f){this.checkIndex(f),this.index=f},skip:function(f){this.setIndex(this.index+f)},byteAt:function(){},readInt:function(f){var d,h=0;for(this.checkOffset(f),d=this.index+f-1;d>=this.index;d--)h=(h<<8)+this.byteAt(d);return this.index+=f,h},readString:function(f){return l.transformTo("string",this.readData(f))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var f=this.readInt(4);return new Date(Date.UTC(1980+(f>>25&127),(f>>21&15)-1,f>>16&31,f>>11&31,f>>5&63,(31&f)<<1))}},s.exports=c},{"../utils":32}],19:[function(i,s,u){var l=i("./Uint8ArrayReader");function c(f){l.call(this,f)}i("../utils").inherits(c,l),c.prototype.readData=function(f){this.checkOffset(f);var d=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,d},s.exports=c},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(i,s,u){var l=i("./DataReader");function c(f){l.call(this,f)}i("../utils").inherits(c,l),c.prototype.byteAt=function(f){return this.data.charCodeAt(this.zero+f)},c.prototype.lastIndexOfSignature=function(f){return this.data.lastIndexOf(f)-this.zero},c.prototype.readAndCheckSignature=function(f){return f===this.readData(4)},c.prototype.readData=function(f){this.checkOffset(f);var d=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,d},s.exports=c},{"../utils":32,"./DataReader":18}],21:[function(i,s,u){var l=i("./ArrayReader");function c(f){l.call(this,f)}i("../utils").inherits(c,l),c.prototype.readData=function(f){if(this.checkOffset(f),f===0)return new Uint8Array(0);var d=this.data.subarray(this.zero+this.index,this.zero+this.index+f);return this.index+=f,d},s.exports=c},{"../utils":32,"./ArrayReader":17}],22:[function(i,s,u){var l=i("../utils"),c=i("../support"),f=i("./ArrayReader"),d=i("./StringReader"),h=i("./NodeBufferReader"),y=i("./Uint8ArrayReader");s.exports=function(b){var _=l.getTypeOf(b);return l.checkSupport(_),_!=="string"||c.uint8array?_==="nodebuffer"?new h(b):c.uint8array?new y(l.transformTo("uint8array",b)):new f(l.transformTo("array",b)):new d(b)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(i,s,u){u.LOCAL_FILE_HEADER="PK",u.CENTRAL_FILE_HEADER="PK",u.CENTRAL_DIRECTORY_END="PK",u.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",u.ZIP64_CENTRAL_DIRECTORY_END="PK",u.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(i,s,u){var l=i("./GenericWorker"),c=i("../utils");function f(d){l.call(this,"ConvertWorker to "+d),this.destType=d}c.inherits(f,l),f.prototype.processChunk=function(d){this.push({data:c.transformTo(this.destType,d.data),meta:d.meta})},s.exports=f},{"../utils":32,"./GenericWorker":28}],25:[function(i,s,u){var l=i("./GenericWorker"),c=i("../crc32");function f(){l.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}i("../utils").inherits(f,l),f.prototype.processChunk=function(d){this.streamInfo.crc32=c(d.data,this.streamInfo.crc32||0),this.push(d)},s.exports=f},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(i,s,u){var l=i("../utils"),c=i("./GenericWorker");function f(d){c.call(this,"DataLengthProbe for "+d),this.propName=d,this.withStreamInfo(d,0)}l.inherits(f,c),f.prototype.processChunk=function(d){if(d){var h=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=h+d.data.length}c.prototype.processChunk.call(this,d)},s.exports=f},{"../utils":32,"./GenericWorker":28}],27:[function(i,s,u){var l=i("../utils"),c=i("./GenericWorker");function f(d){c.call(this,"DataWorker");var h=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,d.then(function(y){h.dataIsReady=!0,h.data=y,h.max=y&&y.length||0,h.type=l.getTypeOf(y),h.isPaused||h._tickAndRepeat()},function(y){h.error(y)})}l.inherits(f,c),f.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this.data=null},f.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,l.delay(this._tickAndRepeat,[],this)),!0)},f.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(l.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},f.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var d=null,h=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":d=this.data.substring(this.index,h);break;case"uint8array":d=this.data.subarray(this.index,h);break;case"array":case"nodebuffer":d=this.data.slice(this.index,h)}return this.index=h,this.push({data:d,meta:{percent:this.max?this.index/this.max*100:0}})},s.exports=f},{"../utils":32,"./GenericWorker":28}],28:[function(i,s,u){function l(c){this.name=c||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}l.prototype={push:function(c){this.emit("data",c)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(c){this.emit("error",c)}return!0},error:function(c){return!this.isFinished&&(this.isPaused?this.generatedError=c:(this.isFinished=!0,this.emit("error",c),this.previous&&this.previous.error(c),this.cleanUp()),!0)},on:function(c,f){return this._listeners[c].push(f),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(c,f){if(this._listeners[c])for(var d=0;d<this._listeners[c].length;d++)this._listeners[c][d].call(this,f)},pipe:function(c){return c.registerPrevious(this)},registerPrevious:function(c){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=c.streamInfo,this.mergeStreamInfo(),this.previous=c;var f=this;return c.on("data",function(d){f.processChunk(d)}),c.on("end",function(){f.end()}),c.on("error",function(d){f.error(d)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var c=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),c=!0),this.previous&&this.previous.resume(),!c},flush:function(){},processChunk:function(c){this.push(c)},withStreamInfo:function(c,f){return this.extraStreamInfo[c]=f,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var c in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,c)&&(this.streamInfo[c]=this.extraStreamInfo[c])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var c="Worker "+this.name;return this.previous?this.previous+" -> "+c:c}},s.exports=l},{}],29:[function(i,s,u){var l=i("../utils"),c=i("./ConvertWorker"),f=i("./GenericWorker"),d=i("../base64"),h=i("../support"),y=i("../external"),b=null;if(h.nodestream)try{b=i("../nodejs/NodejsStreamOutputAdapter")}catch{}function _(C,S){return new y.Promise(function(x,w){var k=[],N=C._internalType,j=C._outputType,D=C._mimeType;C.on("data",function(M,L){k.push(M),S&&S(L)}).on("error",function(M){k=[],w(M)}).on("end",function(){try{var M=(function(L,V,F){switch(L){case"blob":return l.newBlob(l.transformTo("arraybuffer",V),F);case"base64":return d.encode(V);default:return l.transformTo(L,V)}})(j,(function(L,V){var F,W=0,oe=null,R=0;for(F=0;F<V.length;F++)R+=V[F].length;switch(L){case"string":return V.join("");case"array":return Array.prototype.concat.apply([],V);case"uint8array":for(oe=new Uint8Array(R),F=0;F<V.length;F++)oe.set(V[F],W),W+=V[F].length;return oe;case"nodebuffer":return Buffer.concat(V);default:throw new Error("concat : unsupported type '"+L+"'")}})(N,k),D);x(M)}catch(L){w(L)}k=[]}).resume()})}function m(C,S,x){var w=S;switch(S){case"blob":case"arraybuffer":w="uint8array";break;case"base64":w="string"}try{this._internalType=w,this._outputType=S,this._mimeType=x,l.checkSupport(w),this._worker=C.pipe(new c(w)),C.lock()}catch(k){this._worker=new f("error"),this._worker.error(k)}}m.prototype={accumulate:function(C){return _(this,C)},on:function(C,S){var x=this;return C==="data"?this._worker.on(C,function(w){S.call(x,w.data,w.meta)}):this._worker.on(C,function(){l.delay(S,arguments,x)}),this},resume:function(){return l.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(C){if(l.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new b(this,{objectMode:this._outputType!=="nodebuffer"},C)}},s.exports=m},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(i,s,u){if(u.base64=!0,u.array=!0,u.string=!0,u.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",u.nodebuffer=typeof Buffer<"u",u.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")u.blob=!1;else{var l=new ArrayBuffer(0);try{u.blob=new Blob([l],{type:"application/zip"}).size===0}catch{try{var c=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);c.append(l),u.blob=c.getBlob("application/zip").size===0}catch{u.blob=!1}}}try{u.nodestream=!!i("readable-stream").Readable}catch{u.nodestream=!1}},{"readable-stream":16}],31:[function(i,s,u){for(var l=i("./utils"),c=i("./support"),f=i("./nodejsUtils"),d=i("./stream/GenericWorker"),h=new Array(256),y=0;y<256;y++)h[y]=252<=y?6:248<=y?5:240<=y?4:224<=y?3:192<=y?2:1;h[254]=h[254]=1;function b(){d.call(this,"utf-8 decode"),this.leftOver=null}function _(){d.call(this,"utf-8 encode")}u.utf8encode=function(m){return c.nodebuffer?f.newBufferFrom(m,"utf-8"):(function(C){var S,x,w,k,N,j=C.length,D=0;for(k=0;k<j;k++)(64512&(x=C.charCodeAt(k)))==55296&&k+1<j&&(64512&(w=C.charCodeAt(k+1)))==56320&&(x=65536+(x-55296<<10)+(w-56320),k++),D+=x<128?1:x<2048?2:x<65536?3:4;for(S=c.uint8array?new Uint8Array(D):new Array(D),k=N=0;N<D;k++)(64512&(x=C.charCodeAt(k)))==55296&&k+1<j&&(64512&(w=C.charCodeAt(k+1)))==56320&&(x=65536+(x-55296<<10)+(w-56320),k++),x<128?S[N++]=x:(x<2048?S[N++]=192|x>>>6:(x<65536?S[N++]=224|x>>>12:(S[N++]=240|x>>>18,S[N++]=128|x>>>12&63),S[N++]=128|x>>>6&63),S[N++]=128|63&x);return S})(m)},u.utf8decode=function(m){return c.nodebuffer?l.transformTo("nodebuffer",m).toString("utf-8"):(function(C){var S,x,w,k,N=C.length,j=new Array(2*N);for(S=x=0;S<N;)if((w=C[S++])<128)j[x++]=w;else if(4<(k=h[w]))j[x++]=65533,S+=k-1;else{for(w&=k===2?31:k===3?15:7;1<k&&S<N;)w=w<<6|63&C[S++],k--;1<k?j[x++]=65533:w<65536?j[x++]=w:(w-=65536,j[x++]=55296|w>>10&1023,j[x++]=56320|1023&w)}return j.length!==x&&(j.subarray?j=j.subarray(0,x):j.length=x),l.applyFromCharCode(j)})(m=l.transformTo(c.uint8array?"uint8array":"array",m))},l.inherits(b,d),b.prototype.processChunk=function(m){var C=l.transformTo(c.uint8array?"uint8array":"array",m.data);if(this.leftOver&&this.leftOver.length){if(c.uint8array){var S=C;(C=new Uint8Array(S.length+this.leftOver.length)).set(this.leftOver,0),C.set(S,this.leftOver.length)}else C=this.leftOver.concat(C);this.leftOver=null}var x=(function(k,N){var j;for((N=N||k.length)>k.length&&(N=k.length),j=N-1;0<=j&&(192&k[j])==128;)j--;return j<0||j===0?N:j+h[k[j]]>N?j:N})(C),w=C;x!==C.length&&(c.uint8array?(w=C.subarray(0,x),this.leftOver=C.subarray(x,C.length)):(w=C.slice(0,x),this.leftOver=C.slice(x,C.length))),this.push({data:u.utf8decode(w),meta:m.meta})},b.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:u.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},u.Utf8DecodeWorker=b,l.inherits(_,d),_.prototype.processChunk=function(m){this.push({data:u.utf8encode(m.data),meta:m.meta})},u.Utf8EncodeWorker=_},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(i,s,u){var l=i("./support"),c=i("./base64"),f=i("./nodejsUtils"),d=i("./external");function h(S){return S}function y(S,x){for(var w=0;w<S.length;++w)x[w]=255&S.charCodeAt(w);return x}i("setimmediate"),u.newBlob=function(S,x){u.checkSupport("blob");try{return new Blob([S],{type:x})}catch{try{var w=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return w.append(S),w.getBlob(x)}catch{throw new Error("Bug : can't construct the Blob.")}}};var b={stringifyByChunk:function(S,x,w){var k=[],N=0,j=S.length;if(j<=w)return String.fromCharCode.apply(null,S);for(;N<j;)x==="array"||x==="nodebuffer"?k.push(String.fromCharCode.apply(null,S.slice(N,Math.min(N+w,j)))):k.push(String.fromCharCode.apply(null,S.subarray(N,Math.min(N+w,j)))),N+=w;return k.join("")},stringifyByChar:function(S){for(var x="",w=0;w<S.length;w++)x+=String.fromCharCode(S[w]);return x},applyCanBeUsed:{uint8array:(function(){try{return l.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return l.nodebuffer&&String.fromCharCode.apply(null,f.allocBuffer(1)).length===1}catch{return!1}})()}};function _(S){var x=65536,w=u.getTypeOf(S),k=!0;if(w==="uint8array"?k=b.applyCanBeUsed.uint8array:w==="nodebuffer"&&(k=b.applyCanBeUsed.nodebuffer),k)for(;1<x;)try{return b.stringifyByChunk(S,w,x)}catch{x=Math.floor(x/2)}return b.stringifyByChar(S)}function m(S,x){for(var w=0;w<S.length;w++)x[w]=S[w];return x}u.applyFromCharCode=_;var C={};C.string={string:h,array:function(S){return y(S,new Array(S.length))},arraybuffer:function(S){return C.string.uint8array(S).buffer},uint8array:function(S){return y(S,new Uint8Array(S.length))},nodebuffer:function(S){return y(S,f.allocBuffer(S.length))}},C.array={string:_,array:h,arraybuffer:function(S){return new Uint8Array(S).buffer},uint8array:function(S){return new Uint8Array(S)},nodebuffer:function(S){return f.newBufferFrom(S)}},C.arraybuffer={string:function(S){return _(new Uint8Array(S))},array:function(S){return m(new Uint8Array(S),new Array(S.byteLength))},arraybuffer:h,uint8array:function(S){return new Uint8Array(S)},nodebuffer:function(S){return f.newBufferFrom(new Uint8Array(S))}},C.uint8array={string:_,array:function(S){return m(S,new Array(S.length))},arraybuffer:function(S){return S.buffer},uint8array:h,nodebuffer:function(S){return f.newBufferFrom(S)}},C.nodebuffer={string:_,array:function(S){return m(S,new Array(S.length))},arraybuffer:function(S){return C.nodebuffer.uint8array(S).buffer},uint8array:function(S){return m(S,new Uint8Array(S.length))},nodebuffer:h},u.transformTo=function(S,x){if(x=x||"",!S)return x;u.checkSupport(S);var w=u.getTypeOf(x);return C[w][S](x)},u.resolve=function(S){for(var x=S.split("/"),w=[],k=0;k<x.length;k++){var N=x[k];N==="."||N===""&&k!==0&&k!==x.length-1||(N===".."?w.pop():w.push(N))}return w.join("/")},u.getTypeOf=function(S){return typeof S=="string"?"string":Object.prototype.toString.call(S)==="[object Array]"?"array":l.nodebuffer&&f.isBuffer(S)?"nodebuffer":l.uint8array&&S instanceof Uint8Array?"uint8array":l.arraybuffer&&S instanceof ArrayBuffer?"arraybuffer":void 0},u.checkSupport=function(S){if(!l[S.toLowerCase()])throw new Error(S+" is not supported by this platform")},u.MAX_VALUE_16BITS=65535,u.MAX_VALUE_32BITS=-1,u.pretty=function(S){var x,w,k="";for(w=0;w<(S||"").length;w++)k+="\\x"+((x=S.charCodeAt(w))<16?"0":"")+x.toString(16).toUpperCase();return k},u.delay=function(S,x,w){setImmediate(function(){S.apply(w||null,x||[])})},u.inherits=function(S,x){function w(){}w.prototype=x.prototype,S.prototype=new w},u.extend=function(){var S,x,w={};for(S=0;S<arguments.length;S++)for(x in arguments[S])Object.prototype.hasOwnProperty.call(arguments[S],x)&&w[x]===void 0&&(w[x]=arguments[S][x]);return w},u.prepareContent=function(S,x,w,k,N){return d.Promise.resolve(x).then(function(j){return l.blob&&(j instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(j))!==-1)&&typeof FileReader<"u"?new d.Promise(function(D,M){var L=new FileReader;L.onload=function(V){D(V.target.result)},L.onerror=function(V){M(V.target.error)},L.readAsArrayBuffer(j)}):j}).then(function(j){var D=u.getTypeOf(j);return D?(D==="arraybuffer"?j=u.transformTo("uint8array",j):D==="string"&&(N?j=c.decode(j):w&&k!==!0&&(j=(function(M){return y(M,l.uint8array?new Uint8Array(M.length):new Array(M.length))})(j))),j):d.Promise.reject(new Error("Can't read the data of '"+S+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(i,s,u){var l=i("./reader/readerFor"),c=i("./utils"),f=i("./signature"),d=i("./zipEntry"),h=i("./support");function y(b){this.files=[],this.loadOptions=b}y.prototype={checkSignature:function(b){if(!this.reader.readAndCheckSignature(b)){this.reader.index-=4;var _=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+c.pretty(_)+", expected "+c.pretty(b)+")")}},isSignature:function(b,_){var m=this.reader.index;this.reader.setIndex(b);var C=this.reader.readString(4)===_;return this.reader.setIndex(m),C},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var b=this.reader.readData(this.zipCommentLength),_=h.uint8array?"uint8array":"array",m=c.transformTo(_,b);this.zipComment=this.loadOptions.decodeFileName(m)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var b,_,m,C=this.zip64EndOfCentralSize-44;0<C;)b=this.reader.readInt(2),_=this.reader.readInt(4),m=this.reader.readData(_),this.zip64ExtensibleData[b]={id:b,length:_,value:m}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var b,_;for(b=0;b<this.files.length;b++)_=this.files[b],this.reader.setIndex(_.localHeaderOffset),this.checkSignature(f.LOCAL_FILE_HEADER),_.readLocalPart(this.reader),_.handleUTF8(),_.processAttributes()},readCentralDir:function(){var b;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(f.CENTRAL_FILE_HEADER);)(b=new d({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(b);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var b=this.reader.lastIndexOfSignature(f.CENTRAL_DIRECTORY_END);if(b<0)throw this.isSignature(0,f.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(b);var _=b;if(this.checkSignature(f.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===c.MAX_VALUE_16BITS||this.diskWithCentralDirStart===c.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===c.MAX_VALUE_16BITS||this.centralDirRecords===c.MAX_VALUE_16BITS||this.centralDirSize===c.MAX_VALUE_32BITS||this.centralDirOffset===c.MAX_VALUE_32BITS){if(this.zip64=!0,(b=this.reader.lastIndexOfSignature(f.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(b),this.checkSignature(f.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,f.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(f.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(f.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var m=this.centralDirOffset+this.centralDirSize;this.zip64&&(m+=20,m+=12+this.zip64EndOfCentralSize);var C=_-m;if(0<C)this.isSignature(_,f.CENTRAL_FILE_HEADER)||(this.reader.zero=C);else if(C<0)throw new Error("Corrupted zip: missing "+Math.abs(C)+" bytes.")},prepareReader:function(b){this.reader=l(b)},load:function(b){this.prepareReader(b),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},s.exports=y},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(i,s,u){var l=i("./reader/readerFor"),c=i("./utils"),f=i("./compressedObject"),d=i("./crc32"),h=i("./utf8"),y=i("./compressions"),b=i("./support");function _(m,C){this.options=m,this.loadOptions=C}_.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(m){var C,S;if(m.skip(22),this.fileNameLength=m.readInt(2),S=m.readInt(2),this.fileName=m.readData(this.fileNameLength),m.skip(S),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((C=(function(x){for(var w in y)if(Object.prototype.hasOwnProperty.call(y,w)&&y[w].magic===x)return y[w];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+c.pretty(this.compressionMethod)+" unknown (inner file : "+c.transformTo("string",this.fileName)+")");this.decompressed=new f(this.compressedSize,this.uncompressedSize,this.crc32,C,m.readData(this.compressedSize))},readCentralPart:function(m){this.versionMadeBy=m.readInt(2),m.skip(2),this.bitFlag=m.readInt(2),this.compressionMethod=m.readString(2),this.date=m.readDate(),this.crc32=m.readInt(4),this.compressedSize=m.readInt(4),this.uncompressedSize=m.readInt(4);var C=m.readInt(2);if(this.extraFieldsLength=m.readInt(2),this.fileCommentLength=m.readInt(2),this.diskNumberStart=m.readInt(2),this.internalFileAttributes=m.readInt(2),this.externalFileAttributes=m.readInt(4),this.localHeaderOffset=m.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");m.skip(C),this.readExtraFields(m),this.parseZIP64ExtraField(m),this.fileComment=m.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var m=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),m==0&&(this.dosPermissions=63&this.externalFileAttributes),m==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var m=l(this.extraFields[1].value);this.uncompressedSize===c.MAX_VALUE_32BITS&&(this.uncompressedSize=m.readInt(8)),this.compressedSize===c.MAX_VALUE_32BITS&&(this.compressedSize=m.readInt(8)),this.localHeaderOffset===c.MAX_VALUE_32BITS&&(this.localHeaderOffset=m.readInt(8)),this.diskNumberStart===c.MAX_VALUE_32BITS&&(this.diskNumberStart=m.readInt(4))}},readExtraFields:function(m){var C,S,x,w=m.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});m.index+4<w;)C=m.readInt(2),S=m.readInt(2),x=m.readData(S),this.extraFields[C]={id:C,length:S,value:x};m.setIndex(w)},handleUTF8:function(){var m=b.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=h.utf8decode(this.fileName),this.fileCommentStr=h.utf8decode(this.fileComment);else{var C=this.findExtraFieldUnicodePath();if(C!==null)this.fileNameStr=C;else{var S=c.transformTo(m,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(S)}var x=this.findExtraFieldUnicodeComment();if(x!==null)this.fileCommentStr=x;else{var w=c.transformTo(m,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(w)}}},findExtraFieldUnicodePath:function(){var m=this.extraFields[28789];if(m){var C=l(m.value);return C.readInt(1)!==1||d(this.fileName)!==C.readInt(4)?null:h.utf8decode(C.readData(m.length-5))}return null},findExtraFieldUnicodeComment:function(){var m=this.extraFields[25461];if(m){var C=l(m.value);return C.readInt(1)!==1||d(this.fileComment)!==C.readInt(4)?null:h.utf8decode(C.readData(m.length-5))}return null}},s.exports=_},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(i,s,u){function l(C,S,x){this.name=C,this.dir=x.dir,this.date=x.date,this.comment=x.comment,this.unixPermissions=x.unixPermissions,this.dosPermissions=x.dosPermissions,this._data=S,this._dataBinary=x.binary,this.options={compression:x.compression,compressionOptions:x.compressionOptions}}var c=i("./stream/StreamHelper"),f=i("./stream/DataWorker"),d=i("./utf8"),h=i("./compressedObject"),y=i("./stream/GenericWorker");l.prototype={internalStream:function(C){var S=null,x="string";try{if(!C)throw new Error("No output type specified.");var w=(x=C.toLowerCase())==="string"||x==="text";x!=="binarystring"&&x!=="text"||(x="string"),S=this._decompressWorker();var k=!this._dataBinary;k&&!w&&(S=S.pipe(new d.Utf8EncodeWorker)),!k&&w&&(S=S.pipe(new d.Utf8DecodeWorker))}catch(N){(S=new y("error")).error(N)}return new c(S,x,"")},async:function(C,S){return this.internalStream(C).accumulate(S)},nodeStream:function(C,S){return this.internalStream(C||"nodebuffer").toNodejsStream(S)},_compressWorker:function(C,S){if(this._data instanceof h&&this._data.compression.magic===C.magic)return this._data.getCompressedWorker();var x=this._decompressWorker();return this._dataBinary||(x=x.pipe(new d.Utf8EncodeWorker)),h.createWorkerFrom(x,C,S)},_decompressWorker:function(){return this._data instanceof h?this._data.getContentWorker():this._data instanceof y?this._data:new f(this._data)}};for(var b=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],_=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},m=0;m<b.length;m++)l.prototype[b[m]]=_;s.exports=l},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(i,s,u){(function(l){var c,f,d=l.MutationObserver||l.WebKitMutationObserver;if(d){var h=0,y=new d(C),b=l.document.createTextNode("");y.observe(b,{characterData:!0}),c=function(){b.data=h=++h%2}}else if(l.setImmediate||l.MessageChannel===void 0)c="document"in l&&"onreadystatechange"in l.document.createElement("script")?function(){var S=l.document.createElement("script");S.onreadystatechange=function(){C(),S.onreadystatechange=null,S.parentNode.removeChild(S),S=null},l.document.documentElement.appendChild(S)}:function(){setTimeout(C,0)};else{var _=new l.MessageChannel;_.port1.onmessage=C,c=function(){_.port2.postMessage(0)}}var m=[];function C(){var S,x;f=!0;for(var w=m.length;w;){for(x=m,m=[],S=-1;++S<w;)x[S]();w=m.length}f=!1}s.exports=function(S){m.push(S)!==1||f||c()}}).call(this,typeof vr<"u"?vr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(i,s,u){var l=i("immediate");function c(){}var f={},d=["REJECTED"],h=["FULFILLED"],y=["PENDING"];function b(w){if(typeof w!="function")throw new TypeError("resolver must be a function");this.state=y,this.queue=[],this.outcome=void 0,w!==c&&S(this,w)}function _(w,k,N){this.promise=w,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof N=="function"&&(this.onRejected=N,this.callRejected=this.otherCallRejected)}function m(w,k,N){l(function(){var j;try{j=k(N)}catch(D){return f.reject(w,D)}j===w?f.reject(w,new TypeError("Cannot resolve promise with itself")):f.resolve(w,j)})}function C(w){var k=w&&w.then;if(w&&(typeof w=="object"||typeof w=="function")&&typeof k=="function")return function(){k.apply(w,arguments)}}function S(w,k){var N=!1;function j(L){N||(N=!0,f.reject(w,L))}function D(L){N||(N=!0,f.resolve(w,L))}var M=x(function(){k(D,j)});M.status==="error"&&j(M.value)}function x(w,k){var N={};try{N.value=w(k),N.status="success"}catch(j){N.status="error",N.value=j}return N}(s.exports=b).prototype.finally=function(w){if(typeof w!="function")return this;var k=this.constructor;return this.then(function(N){return k.resolve(w()).then(function(){return N})},function(N){return k.resolve(w()).then(function(){throw N})})},b.prototype.catch=function(w){return this.then(null,w)},b.prototype.then=function(w,k){if(typeof w!="function"&&this.state===h||typeof k!="function"&&this.state===d)return this;var N=new this.constructor(c);return this.state!==y?m(N,this.state===h?w:k,this.outcome):this.queue.push(new _(N,w,k)),N},_.prototype.callFulfilled=function(w){f.resolve(this.promise,w)},_.prototype.otherCallFulfilled=function(w){m(this.promise,this.onFulfilled,w)},_.prototype.callRejected=function(w){f.reject(this.promise,w)},_.prototype.otherCallRejected=function(w){m(this.promise,this.onRejected,w)},f.resolve=function(w,k){var N=x(C,k);if(N.status==="error")return f.reject(w,N.value);var j=N.value;if(j)S(w,j);else{w.state=h,w.outcome=k;for(var D=-1,M=w.queue.length;++D<M;)w.queue[D].callFulfilled(k)}return w},f.reject=function(w,k){w.state=d,w.outcome=k;for(var N=-1,j=w.queue.length;++N<j;)w.queue[N].callRejected(k);return w},b.resolve=function(w){return w instanceof this?w:f.resolve(new this(c),w)},b.reject=function(w){var k=new this(c);return f.reject(k,w)},b.all=function(w){var k=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var N=w.length,j=!1;if(!N)return this.resolve([]);for(var D=new Array(N),M=0,L=-1,V=new this(c);++L<N;)F(w[L],L);return V;function F(W,oe){k.resolve(W).then(function(R){D[oe]=R,++M!==N||j||(j=!0,f.resolve(V,D))},function(R){j||(j=!0,f.reject(V,R))})}},b.race=function(w){var k=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var N=w.length,j=!1;if(!N)return this.resolve([]);for(var D=-1,M=new this(c);++D<N;)L=w[D],k.resolve(L).then(function(V){j||(j=!0,f.resolve(M,V))},function(V){j||(j=!0,f.reject(M,V))});var L;return M}},{immediate:36}],38:[function(i,s,u){var l={};(0,i("./lib/utils/common").assign)(l,i("./lib/deflate"),i("./lib/inflate"),i("./lib/zlib/constants")),s.exports=l},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(i,s,u){var l=i("./zlib/deflate"),c=i("./utils/common"),f=i("./utils/strings"),d=i("./zlib/messages"),h=i("./zlib/zstream"),y=Object.prototype.toString,b=0,_=-1,m=0,C=8;function S(w){if(!(this instanceof S))return new S(w);this.options=c.assign({level:_,method:C,chunkSize:16384,windowBits:15,memLevel:8,strategy:m,to:""},w||{});var k=this.options;k.raw&&0<k.windowBits?k.windowBits=-k.windowBits:k.gzip&&0<k.windowBits&&k.windowBits<16&&(k.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var N=l.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(N!==b)throw new Error(d[N]);if(k.header&&l.deflateSetHeader(this.strm,k.header),k.dictionary){var j;if(j=typeof k.dictionary=="string"?f.string2buf(k.dictionary):y.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(N=l.deflateSetDictionary(this.strm,j))!==b)throw new Error(d[N]);this._dict_set=!0}}function x(w,k){var N=new S(k);if(N.push(w,!0),N.err)throw N.msg||d[N.err];return N.result}S.prototype.push=function(w,k){var N,j,D=this.strm,M=this.options.chunkSize;if(this.ended)return!1;j=k===~~k?k:k===!0?4:0,typeof w=="string"?D.input=f.string2buf(w):y.call(w)==="[object ArrayBuffer]"?D.input=new Uint8Array(w):D.input=w,D.next_in=0,D.avail_in=D.input.length;do{if(D.avail_out===0&&(D.output=new c.Buf8(M),D.next_out=0,D.avail_out=M),(N=l.deflate(D,j))!==1&&N!==b)return this.onEnd(N),!(this.ended=!0);D.avail_out!==0&&(D.avail_in!==0||j!==4&&j!==2)||(this.options.to==="string"?this.onData(f.buf2binstring(c.shrinkBuf(D.output,D.next_out))):this.onData(c.shrinkBuf(D.output,D.next_out)))}while((0<D.avail_in||D.avail_out===0)&&N!==1);return j===4?(N=l.deflateEnd(this.strm),this.onEnd(N),this.ended=!0,N===b):j!==2||(this.onEnd(b),!(D.avail_out=0))},S.prototype.onData=function(w){this.chunks.push(w)},S.prototype.onEnd=function(w){w===b&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=w,this.msg=this.strm.msg},u.Deflate=S,u.deflate=x,u.deflateRaw=function(w,k){return(k=k||{}).raw=!0,x(w,k)},u.gzip=function(w,k){return(k=k||{}).gzip=!0,x(w,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(i,s,u){var l=i("./zlib/inflate"),c=i("./utils/common"),f=i("./utils/strings"),d=i("./zlib/constants"),h=i("./zlib/messages"),y=i("./zlib/zstream"),b=i("./zlib/gzheader"),_=Object.prototype.toString;function m(S){if(!(this instanceof m))return new m(S);this.options=c.assign({chunkSize:16384,windowBits:0,to:""},S||{});var x=this.options;x.raw&&0<=x.windowBits&&x.windowBits<16&&(x.windowBits=-x.windowBits,x.windowBits===0&&(x.windowBits=-15)),!(0<=x.windowBits&&x.windowBits<16)||S&&S.windowBits||(x.windowBits+=32),15<x.windowBits&&x.windowBits<48&&(15&x.windowBits)==0&&(x.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new y,this.strm.avail_out=0;var w=l.inflateInit2(this.strm,x.windowBits);if(w!==d.Z_OK)throw new Error(h[w]);this.header=new b,l.inflateGetHeader(this.strm,this.header)}function C(S,x){var w=new m(x);if(w.push(S,!0),w.err)throw w.msg||h[w.err];return w.result}m.prototype.push=function(S,x){var w,k,N,j,D,M,L=this.strm,V=this.options.chunkSize,F=this.options.dictionary,W=!1;if(this.ended)return!1;k=x===~~x?x:x===!0?d.Z_FINISH:d.Z_NO_FLUSH,typeof S=="string"?L.input=f.binstring2buf(S):_.call(S)==="[object ArrayBuffer]"?L.input=new Uint8Array(S):L.input=S,L.next_in=0,L.avail_in=L.input.length;do{if(L.avail_out===0&&(L.output=new c.Buf8(V),L.next_out=0,L.avail_out=V),(w=l.inflate(L,d.Z_NO_FLUSH))===d.Z_NEED_DICT&&F&&(M=typeof F=="string"?f.string2buf(F):_.call(F)==="[object ArrayBuffer]"?new Uint8Array(F):F,w=l.inflateSetDictionary(this.strm,M)),w===d.Z_BUF_ERROR&&W===!0&&(w=d.Z_OK,W=!1),w!==d.Z_STREAM_END&&w!==d.Z_OK)return this.onEnd(w),!(this.ended=!0);L.next_out&&(L.avail_out!==0&&w!==d.Z_STREAM_END&&(L.avail_in!==0||k!==d.Z_FINISH&&k!==d.Z_SYNC_FLUSH)||(this.options.to==="string"?(N=f.utf8border(L.output,L.next_out),j=L.next_out-N,D=f.buf2string(L.output,N),L.next_out=j,L.avail_out=V-j,j&&c.arraySet(L.output,L.output,N,j,0),this.onData(D)):this.onData(c.shrinkBuf(L.output,L.next_out)))),L.avail_in===0&&L.avail_out===0&&(W=!0)}while((0<L.avail_in||L.avail_out===0)&&w!==d.Z_STREAM_END);return w===d.Z_STREAM_END&&(k=d.Z_FINISH),k===d.Z_FINISH?(w=l.inflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===d.Z_OK):k!==d.Z_SYNC_FLUSH||(this.onEnd(d.Z_OK),!(L.avail_out=0))},m.prototype.onData=function(S){this.chunks.push(S)},m.prototype.onEnd=function(S){S===d.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=S,this.msg=this.strm.msg},u.Inflate=m,u.inflate=C,u.inflateRaw=function(S,x){return(x=x||{}).raw=!0,C(S,x)},u.ungzip=C},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(i,s,u){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";u.assign=function(d){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var y=h.shift();if(y){if(typeof y!="object")throw new TypeError(y+"must be non-object");for(var b in y)y.hasOwnProperty(b)&&(d[b]=y[b])}}return d},u.shrinkBuf=function(d,h){return d.length===h?d:d.subarray?d.subarray(0,h):(d.length=h,d)};var c={arraySet:function(d,h,y,b,_){if(h.subarray&&d.subarray)d.set(h.subarray(y,y+b),_);else for(var m=0;m<b;m++)d[_+m]=h[y+m]},flattenChunks:function(d){var h,y,b,_,m,C;for(h=b=0,y=d.length;h<y;h++)b+=d[h].length;for(C=new Uint8Array(b),h=_=0,y=d.length;h<y;h++)m=d[h],C.set(m,_),_+=m.length;return C}},f={arraySet:function(d,h,y,b,_){for(var m=0;m<b;m++)d[_+m]=h[y+m]},flattenChunks:function(d){return[].concat.apply([],d)}};u.setTyped=function(d){d?(u.Buf8=Uint8Array,u.Buf16=Uint16Array,u.Buf32=Int32Array,u.assign(u,c)):(u.Buf8=Array,u.Buf16=Array,u.Buf32=Array,u.assign(u,f))},u.setTyped(l)},{}],42:[function(i,s,u){var l=i("./common"),c=!0,f=!0;try{String.fromCharCode.apply(null,[0])}catch{c=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{f=!1}for(var d=new l.Buf8(256),h=0;h<256;h++)d[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;function y(b,_){if(_<65537&&(b.subarray&&f||!b.subarray&&c))return String.fromCharCode.apply(null,l.shrinkBuf(b,_));for(var m="",C=0;C<_;C++)m+=String.fromCharCode(b[C]);return m}d[254]=d[254]=1,u.string2buf=function(b){var _,m,C,S,x,w=b.length,k=0;for(S=0;S<w;S++)(64512&(m=b.charCodeAt(S)))==55296&&S+1<w&&(64512&(C=b.charCodeAt(S+1)))==56320&&(m=65536+(m-55296<<10)+(C-56320),S++),k+=m<128?1:m<2048?2:m<65536?3:4;for(_=new l.Buf8(k),S=x=0;x<k;S++)(64512&(m=b.charCodeAt(S)))==55296&&S+1<w&&(64512&(C=b.charCodeAt(S+1)))==56320&&(m=65536+(m-55296<<10)+(C-56320),S++),m<128?_[x++]=m:(m<2048?_[x++]=192|m>>>6:(m<65536?_[x++]=224|m>>>12:(_[x++]=240|m>>>18,_[x++]=128|m>>>12&63),_[x++]=128|m>>>6&63),_[x++]=128|63&m);return _},u.buf2binstring=function(b){return y(b,b.length)},u.binstring2buf=function(b){for(var _=new l.Buf8(b.length),m=0,C=_.length;m<C;m++)_[m]=b.charCodeAt(m);return _},u.buf2string=function(b,_){var m,C,S,x,w=_||b.length,k=new Array(2*w);for(m=C=0;m<w;)if((S=b[m++])<128)k[C++]=S;else if(4<(x=d[S]))k[C++]=65533,m+=x-1;else{for(S&=x===2?31:x===3?15:7;1<x&&m<w;)S=S<<6|63&b[m++],x--;1<x?k[C++]=65533:S<65536?k[C++]=S:(S-=65536,k[C++]=55296|S>>10&1023,k[C++]=56320|1023&S)}return y(k,C)},u.utf8border=function(b,_){var m;for((_=_||b.length)>b.length&&(_=b.length),m=_-1;0<=m&&(192&b[m])==128;)m--;return m<0||m===0?_:m+d[b[m]]>_?m:_}},{"./common":41}],43:[function(i,s,u){s.exports=function(l,c,f,d){for(var h=65535&l|0,y=l>>>16&65535|0,b=0;f!==0;){for(f-=b=2e3<f?2e3:f;y=y+(h=h+c[d++]|0)|0,--b;);h%=65521,y%=65521}return h|y<<16|0}},{}],44:[function(i,s,u){s.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(i,s,u){var l=(function(){for(var c,f=[],d=0;d<256;d++){c=d;for(var h=0;h<8;h++)c=1&c?3988292384^c>>>1:c>>>1;f[d]=c}return f})();s.exports=function(c,f,d,h){var y=l,b=h+d;c^=-1;for(var _=h;_<b;_++)c=c>>>8^y[255&(c^f[_])];return-1^c}},{}],46:[function(i,s,u){var l,c=i("../utils/common"),f=i("./trees"),d=i("./adler32"),h=i("./crc32"),y=i("./messages"),b=0,_=4,m=0,C=-2,S=-1,x=4,w=2,k=8,N=9,j=286,D=30,M=19,L=2*j+1,V=15,F=3,W=258,oe=W+F+1,R=42,Q=113,E=1,G=2,J=3,K=4;function ue(g,Y){return g.msg=y[Y],Y}function re(g){return(g<<1)-(4<g?9:0)}function q(g){for(var Y=g.length;0<=--Y;)g[Y]=0}function z(g){var Y=g.state,Z=Y.pending;Z>g.avail_out&&(Z=g.avail_out),Z!==0&&(c.arraySet(g.output,Y.pending_buf,Y.pending_out,Z,g.next_out),g.next_out+=Z,Y.pending_out+=Z,g.total_out+=Z,g.avail_out-=Z,Y.pending-=Z,Y.pending===0&&(Y.pending_out=0))}function I(g,Y){f._tr_flush_block(g,0<=g.block_start?g.block_start:-1,g.strstart-g.block_start,Y),g.block_start=g.strstart,z(g.strm)}function B(g,Y){g.pending_buf[g.pending++]=Y}function te(g,Y){g.pending_buf[g.pending++]=Y>>>8&255,g.pending_buf[g.pending++]=255&Y}function ae(g,Y){var Z,A,T=g.max_chain_length,U=g.strstart,ee=g.prev_length,se=g.nice_match,X=g.strstart>g.w_size-oe?g.strstart-(g.w_size-oe):0,ce=g.window,pe=g.w_mask,de=g.prev,ie=g.strstart+W,be=ce[U+ee-1],Ee=ce[U+ee];g.prev_length>=g.good_match&&(T>>=2),se>g.lookahead&&(se=g.lookahead);do if(ce[(Z=Y)+ee]===Ee&&ce[Z+ee-1]===be&&ce[Z]===ce[U]&&ce[++Z]===ce[U+1]){U+=2,Z++;do;while(ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&ce[++U]===ce[++Z]&&U<ie);if(A=W-(ie-U),U=ie-W,ee<A){if(g.match_start=Y,se<=(ee=A))break;be=ce[U+ee-1],Ee=ce[U+ee]}}while((Y=de[Y&pe])>X&&--T!=0);return ee<=g.lookahead?ee:g.lookahead}function xe(g){var Y,Z,A,T,U,ee,se,X,ce,pe,de=g.w_size;do{if(T=g.window_size-g.lookahead-g.strstart,g.strstart>=de+(de-oe)){for(c.arraySet(g.window,g.window,de,de,0),g.match_start-=de,g.strstart-=de,g.block_start-=de,Y=Z=g.hash_size;A=g.head[--Y],g.head[Y]=de<=A?A-de:0,--Z;);for(Y=Z=de;A=g.prev[--Y],g.prev[Y]=de<=A?A-de:0,--Z;);T+=de}if(g.strm.avail_in===0)break;if(ee=g.strm,se=g.window,X=g.strstart+g.lookahead,ce=T,pe=void 0,pe=ee.avail_in,ce<pe&&(pe=ce),Z=pe===0?0:(ee.avail_in-=pe,c.arraySet(se,ee.input,ee.next_in,pe,X),ee.state.wrap===1?ee.adler=d(ee.adler,se,pe,X):ee.state.wrap===2&&(ee.adler=h(ee.adler,se,pe,X)),ee.next_in+=pe,ee.total_in+=pe,pe),g.lookahead+=Z,g.lookahead+g.insert>=F)for(U=g.strstart-g.insert,g.ins_h=g.window[U],g.ins_h=(g.ins_h<<g.hash_shift^g.window[U+1])&g.hash_mask;g.insert&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[U+F-1])&g.hash_mask,g.prev[U&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=U,U++,g.insert--,!(g.lookahead+g.insert<F)););}while(g.lookahead<oe&&g.strm.avail_in!==0)}function Te(g,Y){for(var Z,A;;){if(g.lookahead<oe){if(xe(g),g.lookahead<oe&&Y===b)return E;if(g.lookahead===0)break}if(Z=0,g.lookahead>=F&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+F-1])&g.hash_mask,Z=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart),Z!==0&&g.strstart-Z<=g.w_size-oe&&(g.match_length=ae(g,Z)),g.match_length>=F)if(A=f._tr_tally(g,g.strstart-g.match_start,g.match_length-F),g.lookahead-=g.match_length,g.match_length<=g.max_lazy_match&&g.lookahead>=F){for(g.match_length--;g.strstart++,g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+F-1])&g.hash_mask,Z=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart,--g.match_length!=0;);g.strstart++}else g.strstart+=g.match_length,g.match_length=0,g.ins_h=g.window[g.strstart],g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+1])&g.hash_mask;else A=f._tr_tally(g,0,g.window[g.strstart]),g.lookahead--,g.strstart++;if(A&&(I(g,!1),g.strm.avail_out===0))return E}return g.insert=g.strstart<F-1?g.strstart:F-1,Y===_?(I(g,!0),g.strm.avail_out===0?J:K):g.last_lit&&(I(g,!1),g.strm.avail_out===0)?E:G}function Ce(g,Y){for(var Z,A,T;;){if(g.lookahead<oe){if(xe(g),g.lookahead<oe&&Y===b)return E;if(g.lookahead===0)break}if(Z=0,g.lookahead>=F&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+F-1])&g.hash_mask,Z=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart),g.prev_length=g.match_length,g.prev_match=g.match_start,g.match_length=F-1,Z!==0&&g.prev_length<g.max_lazy_match&&g.strstart-Z<=g.w_size-oe&&(g.match_length=ae(g,Z),g.match_length<=5&&(g.strategy===1||g.match_length===F&&4096<g.strstart-g.match_start)&&(g.match_length=F-1)),g.prev_length>=F&&g.match_length<=g.prev_length){for(T=g.strstart+g.lookahead-F,A=f._tr_tally(g,g.strstart-1-g.prev_match,g.prev_length-F),g.lookahead-=g.prev_length-1,g.prev_length-=2;++g.strstart<=T&&(g.ins_h=(g.ins_h<<g.hash_shift^g.window[g.strstart+F-1])&g.hash_mask,Z=g.prev[g.strstart&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=g.strstart),--g.prev_length!=0;);if(g.match_available=0,g.match_length=F-1,g.strstart++,A&&(I(g,!1),g.strm.avail_out===0))return E}else if(g.match_available){if((A=f._tr_tally(g,0,g.window[g.strstart-1]))&&I(g,!1),g.strstart++,g.lookahead--,g.strm.avail_out===0)return E}else g.match_available=1,g.strstart++,g.lookahead--}return g.match_available&&(A=f._tr_tally(g,0,g.window[g.strstart-1]),g.match_available=0),g.insert=g.strstart<F-1?g.strstart:F-1,Y===_?(I(g,!0),g.strm.avail_out===0?J:K):g.last_lit&&(I(g,!1),g.strm.avail_out===0)?E:G}function ke(g,Y,Z,A,T){this.good_length=g,this.max_lazy=Y,this.nice_length=Z,this.max_chain=A,this.func=T}function je(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=k,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new c.Buf16(2*L),this.dyn_dtree=new c.Buf16(2*(2*D+1)),this.bl_tree=new c.Buf16(2*(2*M+1)),q(this.dyn_ltree),q(this.dyn_dtree),q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new c.Buf16(V+1),this.heap=new c.Buf16(2*j+1),q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new c.Buf16(2*j+1),q(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function _e(g){var Y;return g&&g.state?(g.total_in=g.total_out=0,g.data_type=w,(Y=g.state).pending=0,Y.pending_out=0,Y.wrap<0&&(Y.wrap=-Y.wrap),Y.status=Y.wrap?R:Q,g.adler=Y.wrap===2?0:1,Y.last_flush=b,f._tr_init(Y),m):ue(g,C)}function Re(g){var Y=_e(g);return Y===m&&(function(Z){Z.window_size=2*Z.w_size,q(Z.head),Z.max_lazy_match=l[Z.level].max_lazy,Z.good_match=l[Z.level].good_length,Z.nice_match=l[Z.level].nice_length,Z.max_chain_length=l[Z.level].max_chain,Z.strstart=0,Z.block_start=0,Z.lookahead=0,Z.insert=0,Z.match_length=Z.prev_length=F-1,Z.match_available=0,Z.ins_h=0})(g.state),Y}function Ne(g,Y,Z,A,T,U){if(!g)return C;var ee=1;if(Y===S&&(Y=6),A<0?(ee=0,A=-A):15<A&&(ee=2,A-=16),T<1||N<T||Z!==k||A<8||15<A||Y<0||9<Y||U<0||x<U)return ue(g,C);A===8&&(A=9);var se=new je;return(g.state=se).strm=g,se.wrap=ee,se.gzhead=null,se.w_bits=A,se.w_size=1<<se.w_bits,se.w_mask=se.w_size-1,se.hash_bits=T+7,se.hash_size=1<<se.hash_bits,se.hash_mask=se.hash_size-1,se.hash_shift=~~((se.hash_bits+F-1)/F),se.window=new c.Buf8(2*se.w_size),se.head=new c.Buf16(se.hash_size),se.prev=new c.Buf16(se.w_size),se.lit_bufsize=1<<T+6,se.pending_buf_size=4*se.lit_bufsize,se.pending_buf=new c.Buf8(se.pending_buf_size),se.d_buf=1*se.lit_bufsize,se.l_buf=3*se.lit_bufsize,se.level=Y,se.strategy=U,se.method=Z,Re(g)}l=[new ke(0,0,0,0,function(g,Y){var Z=65535;for(Z>g.pending_buf_size-5&&(Z=g.pending_buf_size-5);;){if(g.lookahead<=1){if(xe(g),g.lookahead===0&&Y===b)return E;if(g.lookahead===0)break}g.strstart+=g.lookahead,g.lookahead=0;var A=g.block_start+Z;if((g.strstart===0||g.strstart>=A)&&(g.lookahead=g.strstart-A,g.strstart=A,I(g,!1),g.strm.avail_out===0)||g.strstart-g.block_start>=g.w_size-oe&&(I(g,!1),g.strm.avail_out===0))return E}return g.insert=0,Y===_?(I(g,!0),g.strm.avail_out===0?J:K):(g.strstart>g.block_start&&(I(g,!1),g.strm.avail_out),E)}),new ke(4,4,8,4,Te),new ke(4,5,16,8,Te),new ke(4,6,32,32,Te),new ke(4,4,16,16,Ce),new ke(8,16,32,32,Ce),new ke(8,16,128,128,Ce),new ke(8,32,128,256,Ce),new ke(32,128,258,1024,Ce),new ke(32,258,258,4096,Ce)],u.deflateInit=function(g,Y){return Ne(g,Y,k,15,8,0)},u.deflateInit2=Ne,u.deflateReset=Re,u.deflateResetKeep=_e,u.deflateSetHeader=function(g,Y){return g&&g.state?g.state.wrap!==2?C:(g.state.gzhead=Y,m):C},u.deflate=function(g,Y){var Z,A,T,U;if(!g||!g.state||5<Y||Y<0)return g?ue(g,C):C;if(A=g.state,!g.output||!g.input&&g.avail_in!==0||A.status===666&&Y!==_)return ue(g,g.avail_out===0?-5:C);if(A.strm=g,Z=A.last_flush,A.last_flush=Y,A.status===R)if(A.wrap===2)g.adler=0,B(A,31),B(A,139),B(A,8),A.gzhead?(B(A,(A.gzhead.text?1:0)+(A.gzhead.hcrc?2:0)+(A.gzhead.extra?4:0)+(A.gzhead.name?8:0)+(A.gzhead.comment?16:0)),B(A,255&A.gzhead.time),B(A,A.gzhead.time>>8&255),B(A,A.gzhead.time>>16&255),B(A,A.gzhead.time>>24&255),B(A,A.level===9?2:2<=A.strategy||A.level<2?4:0),B(A,255&A.gzhead.os),A.gzhead.extra&&A.gzhead.extra.length&&(B(A,255&A.gzhead.extra.length),B(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(g.adler=h(g.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=69):(B(A,0),B(A,0),B(A,0),B(A,0),B(A,0),B(A,A.level===9?2:2<=A.strategy||A.level<2?4:0),B(A,3),A.status=Q);else{var ee=k+(A.w_bits-8<<4)<<8;ee|=(2<=A.strategy||A.level<2?0:A.level<6?1:A.level===6?2:3)<<6,A.strstart!==0&&(ee|=32),ee+=31-ee%31,A.status=Q,te(A,ee),A.strstart!==0&&(te(A,g.adler>>>16),te(A,65535&g.adler)),g.adler=1}if(A.status===69)if(A.gzhead.extra){for(T=A.pending;A.gzindex<(65535&A.gzhead.extra.length)&&(A.pending!==A.pending_buf_size||(A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),z(g),T=A.pending,A.pending!==A.pending_buf_size));)B(A,255&A.gzhead.extra[A.gzindex]),A.gzindex++;A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),A.gzindex===A.gzhead.extra.length&&(A.gzindex=0,A.status=73)}else A.status=73;if(A.status===73)if(A.gzhead.name){T=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),z(g),T=A.pending,A.pending===A.pending_buf_size)){U=1;break}U=A.gzindex<A.gzhead.name.length?255&A.gzhead.name.charCodeAt(A.gzindex++):0,B(A,U)}while(U!==0);A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),U===0&&(A.gzindex=0,A.status=91)}else A.status=91;if(A.status===91)if(A.gzhead.comment){T=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),z(g),T=A.pending,A.pending===A.pending_buf_size)){U=1;break}U=A.gzindex<A.gzhead.comment.length?255&A.gzhead.comment.charCodeAt(A.gzindex++):0,B(A,U)}while(U!==0);A.gzhead.hcrc&&A.pending>T&&(g.adler=h(g.adler,A.pending_buf,A.pending-T,T)),U===0&&(A.status=103)}else A.status=103;if(A.status===103&&(A.gzhead.hcrc?(A.pending+2>A.pending_buf_size&&z(g),A.pending+2<=A.pending_buf_size&&(B(A,255&g.adler),B(A,g.adler>>8&255),g.adler=0,A.status=Q)):A.status=Q),A.pending!==0){if(z(g),g.avail_out===0)return A.last_flush=-1,m}else if(g.avail_in===0&&re(Y)<=re(Z)&&Y!==_)return ue(g,-5);if(A.status===666&&g.avail_in!==0)return ue(g,-5);if(g.avail_in!==0||A.lookahead!==0||Y!==b&&A.status!==666){var se=A.strategy===2?(function(X,ce){for(var pe;;){if(X.lookahead===0&&(xe(X),X.lookahead===0)){if(ce===b)return E;break}if(X.match_length=0,pe=f._tr_tally(X,0,X.window[X.strstart]),X.lookahead--,X.strstart++,pe&&(I(X,!1),X.strm.avail_out===0))return E}return X.insert=0,ce===_?(I(X,!0),X.strm.avail_out===0?J:K):X.last_lit&&(I(X,!1),X.strm.avail_out===0)?E:G})(A,Y):A.strategy===3?(function(X,ce){for(var pe,de,ie,be,Ee=X.window;;){if(X.lookahead<=W){if(xe(X),X.lookahead<=W&&ce===b)return E;if(X.lookahead===0)break}if(X.match_length=0,X.lookahead>=F&&0<X.strstart&&(de=Ee[ie=X.strstart-1])===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]){be=X.strstart+W;do;while(de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&de===Ee[++ie]&&ie<be);X.match_length=W-(be-ie),X.match_length>X.lookahead&&(X.match_length=X.lookahead)}if(X.match_length>=F?(pe=f._tr_tally(X,1,X.match_length-F),X.lookahead-=X.match_length,X.strstart+=X.match_length,X.match_length=0):(pe=f._tr_tally(X,0,X.window[X.strstart]),X.lookahead--,X.strstart++),pe&&(I(X,!1),X.strm.avail_out===0))return E}return X.insert=0,ce===_?(I(X,!0),X.strm.avail_out===0?J:K):X.last_lit&&(I(X,!1),X.strm.avail_out===0)?E:G})(A,Y):l[A.level].func(A,Y);if(se!==J&&se!==K||(A.status=666),se===E||se===J)return g.avail_out===0&&(A.last_flush=-1),m;if(se===G&&(Y===1?f._tr_align(A):Y!==5&&(f._tr_stored_block(A,0,0,!1),Y===3&&(q(A.head),A.lookahead===0&&(A.strstart=0,A.block_start=0,A.insert=0))),z(g),g.avail_out===0))return A.last_flush=-1,m}return Y!==_?m:A.wrap<=0?1:(A.wrap===2?(B(A,255&g.adler),B(A,g.adler>>8&255),B(A,g.adler>>16&255),B(A,g.adler>>24&255),B(A,255&g.total_in),B(A,g.total_in>>8&255),B(A,g.total_in>>16&255),B(A,g.total_in>>24&255)):(te(A,g.adler>>>16),te(A,65535&g.adler)),z(g),0<A.wrap&&(A.wrap=-A.wrap),A.pending!==0?m:1)},u.deflateEnd=function(g){var Y;return g&&g.state?(Y=g.state.status)!==R&&Y!==69&&Y!==73&&Y!==91&&Y!==103&&Y!==Q&&Y!==666?ue(g,C):(g.state=null,Y===Q?ue(g,-3):m):C},u.deflateSetDictionary=function(g,Y){var Z,A,T,U,ee,se,X,ce,pe=Y.length;if(!g||!g.state||(U=(Z=g.state).wrap)===2||U===1&&Z.status!==R||Z.lookahead)return C;for(U===1&&(g.adler=d(g.adler,Y,pe,0)),Z.wrap=0,pe>=Z.w_size&&(U===0&&(q(Z.head),Z.strstart=0,Z.block_start=0,Z.insert=0),ce=new c.Buf8(Z.w_size),c.arraySet(ce,Y,pe-Z.w_size,Z.w_size,0),Y=ce,pe=Z.w_size),ee=g.avail_in,se=g.next_in,X=g.input,g.avail_in=pe,g.next_in=0,g.input=Y,xe(Z);Z.lookahead>=F;){for(A=Z.strstart,T=Z.lookahead-(F-1);Z.ins_h=(Z.ins_h<<Z.hash_shift^Z.window[A+F-1])&Z.hash_mask,Z.prev[A&Z.w_mask]=Z.head[Z.ins_h],Z.head[Z.ins_h]=A,A++,--T;);Z.strstart=A,Z.lookahead=F-1,xe(Z)}return Z.strstart+=Z.lookahead,Z.block_start=Z.strstart,Z.insert=Z.lookahead,Z.lookahead=0,Z.match_length=Z.prev_length=F-1,Z.match_available=0,g.next_in=se,g.input=X,g.avail_in=ee,Z.wrap=U,m},u.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(i,s,u){s.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(i,s,u){s.exports=function(l,c){var f,d,h,y,b,_,m,C,S,x,w,k,N,j,D,M,L,V,F,W,oe,R,Q,E,G;f=l.state,d=l.next_in,E=l.input,h=d+(l.avail_in-5),y=l.next_out,G=l.output,b=y-(c-l.avail_out),_=y+(l.avail_out-257),m=f.dmax,C=f.wsize,S=f.whave,x=f.wnext,w=f.window,k=f.hold,N=f.bits,j=f.lencode,D=f.distcode,M=(1<<f.lenbits)-1,L=(1<<f.distbits)-1;e:do{N<15&&(k+=E[d++]<<N,N+=8,k+=E[d++]<<N,N+=8),V=j[k&M];t:for(;;){if(k>>>=F=V>>>24,N-=F,(F=V>>>16&255)===0)G[y++]=65535&V;else{if(!(16&F)){if((64&F)==0){V=j[(65535&V)+(k&(1<<F)-1)];continue t}if(32&F){f.mode=12;break e}l.msg="invalid literal/length code",f.mode=30;break e}W=65535&V,(F&=15)&&(N<F&&(k+=E[d++]<<N,N+=8),W+=k&(1<<F)-1,k>>>=F,N-=F),N<15&&(k+=E[d++]<<N,N+=8,k+=E[d++]<<N,N+=8),V=D[k&L];n:for(;;){if(k>>>=F=V>>>24,N-=F,!(16&(F=V>>>16&255))){if((64&F)==0){V=D[(65535&V)+(k&(1<<F)-1)];continue n}l.msg="invalid distance code",f.mode=30;break e}if(oe=65535&V,N<(F&=15)&&(k+=E[d++]<<N,(N+=8)<F&&(k+=E[d++]<<N,N+=8)),m<(oe+=k&(1<<F)-1)){l.msg="invalid distance too far back",f.mode=30;break e}if(k>>>=F,N-=F,(F=y-b)<oe){if(S<(F=oe-F)&&f.sane){l.msg="invalid distance too far back",f.mode=30;break e}if(Q=w,(R=0)===x){if(R+=C-F,F<W){for(W-=F;G[y++]=w[R++],--F;);R=y-oe,Q=G}}else if(x<F){if(R+=C+x-F,(F-=x)<W){for(W-=F;G[y++]=w[R++],--F;);if(R=0,x<W){for(W-=F=x;G[y++]=w[R++],--F;);R=y-oe,Q=G}}}else if(R+=x-F,F<W){for(W-=F;G[y++]=w[R++],--F;);R=y-oe,Q=G}for(;2<W;)G[y++]=Q[R++],G[y++]=Q[R++],G[y++]=Q[R++],W-=3;W&&(G[y++]=Q[R++],1<W&&(G[y++]=Q[R++]))}else{for(R=y-oe;G[y++]=G[R++],G[y++]=G[R++],G[y++]=G[R++],2<(W-=3););W&&(G[y++]=G[R++],1<W&&(G[y++]=G[R++]))}break}}break}}while(d<h&&y<_);d-=W=N>>3,k&=(1<<(N-=W<<3))-1,l.next_in=d,l.next_out=y,l.avail_in=d<h?h-d+5:5-(d-h),l.avail_out=y<_?_-y+257:257-(y-_),f.hold=k,f.bits=N}},{}],49:[function(i,s,u){var l=i("../utils/common"),c=i("./adler32"),f=i("./crc32"),d=i("./inffast"),h=i("./inftrees"),y=1,b=2,_=0,m=-2,C=1,S=852,x=592;function w(R){return(R>>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function k(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new l.Buf16(320),this.work=new l.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function N(R){var Q;return R&&R.state?(Q=R.state,R.total_in=R.total_out=Q.total=0,R.msg="",Q.wrap&&(R.adler=1&Q.wrap),Q.mode=C,Q.last=0,Q.havedict=0,Q.dmax=32768,Q.head=null,Q.hold=0,Q.bits=0,Q.lencode=Q.lendyn=new l.Buf32(S),Q.distcode=Q.distdyn=new l.Buf32(x),Q.sane=1,Q.back=-1,_):m}function j(R){var Q;return R&&R.state?((Q=R.state).wsize=0,Q.whave=0,Q.wnext=0,N(R)):m}function D(R,Q){var E,G;return R&&R.state?(G=R.state,Q<0?(E=0,Q=-Q):(E=1+(Q>>4),Q<48&&(Q&=15)),Q&&(Q<8||15<Q)?m:(G.window!==null&&G.wbits!==Q&&(G.window=null),G.wrap=E,G.wbits=Q,j(R))):m}function M(R,Q){var E,G;return R?(G=new k,(R.state=G).window=null,(E=D(R,Q))!==_&&(R.state=null),E):m}var L,V,F=!0;function W(R){if(F){var Q;for(L=new l.Buf32(512),V=new l.Buf32(32),Q=0;Q<144;)R.lens[Q++]=8;for(;Q<256;)R.lens[Q++]=9;for(;Q<280;)R.lens[Q++]=7;for(;Q<288;)R.lens[Q++]=8;for(h(y,R.lens,0,288,L,0,R.work,{bits:9}),Q=0;Q<32;)R.lens[Q++]=5;h(b,R.lens,0,32,V,0,R.work,{bits:5}),F=!1}R.lencode=L,R.lenbits=9,R.distcode=V,R.distbits=5}function oe(R,Q,E,G){var J,K=R.state;return K.window===null&&(K.wsize=1<<K.wbits,K.wnext=0,K.whave=0,K.window=new l.Buf8(K.wsize)),G>=K.wsize?(l.arraySet(K.window,Q,E-K.wsize,K.wsize,0),K.wnext=0,K.whave=K.wsize):(G<(J=K.wsize-K.wnext)&&(J=G),l.arraySet(K.window,Q,E-G,J,K.wnext),(G-=J)?(l.arraySet(K.window,Q,E-G,G,0),K.wnext=G,K.whave=K.wsize):(K.wnext+=J,K.wnext===K.wsize&&(K.wnext=0),K.whave<K.wsize&&(K.whave+=J))),0}u.inflateReset=j,u.inflateReset2=D,u.inflateResetKeep=N,u.inflateInit=function(R){return M(R,15)},u.inflateInit2=M,u.inflate=function(R,Q){var E,G,J,K,ue,re,q,z,I,B,te,ae,xe,Te,Ce,ke,je,_e,Re,Ne,g,Y,Z,A,T=0,U=new l.Buf8(4),ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!R||!R.state||!R.output||!R.input&&R.avail_in!==0)return m;(E=R.state).mode===12&&(E.mode=13),ue=R.next_out,J=R.output,q=R.avail_out,K=R.next_in,G=R.input,re=R.avail_in,z=E.hold,I=E.bits,B=re,te=q,Y=_;e:for(;;)switch(E.mode){case C:if(E.wrap===0){E.mode=13;break}for(;I<16;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(2&E.wrap&&z===35615){U[E.check=0]=255&z,U[1]=z>>>8&255,E.check=f(E.check,U,2,0),I=z=0,E.mode=2;break}if(E.flags=0,E.head&&(E.head.done=!1),!(1&E.wrap)||(((255&z)<<8)+(z>>8))%31){R.msg="incorrect header check",E.mode=30;break}if((15&z)!=8){R.msg="unknown compression method",E.mode=30;break}if(I-=4,g=8+(15&(z>>>=4)),E.wbits===0)E.wbits=g;else if(g>E.wbits){R.msg="invalid window size",E.mode=30;break}E.dmax=1<<g,R.adler=E.check=1,E.mode=512&z?10:12,I=z=0;break;case 2:for(;I<16;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(E.flags=z,(255&E.flags)!=8){R.msg="unknown compression method",E.mode=30;break}if(57344&E.flags){R.msg="unknown header flags set",E.mode=30;break}E.head&&(E.head.text=z>>8&1),512&E.flags&&(U[0]=255&z,U[1]=z>>>8&255,E.check=f(E.check,U,2,0)),I=z=0,E.mode=3;case 3:for(;I<32;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.head&&(E.head.time=z),512&E.flags&&(U[0]=255&z,U[1]=z>>>8&255,U[2]=z>>>16&255,U[3]=z>>>24&255,E.check=f(E.check,U,4,0)),I=z=0,E.mode=4;case 4:for(;I<16;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.head&&(E.head.xflags=255&z,E.head.os=z>>8),512&E.flags&&(U[0]=255&z,U[1]=z>>>8&255,E.check=f(E.check,U,2,0)),I=z=0,E.mode=5;case 5:if(1024&E.flags){for(;I<16;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.length=z,E.head&&(E.head.extra_len=z),512&E.flags&&(U[0]=255&z,U[1]=z>>>8&255,E.check=f(E.check,U,2,0)),I=z=0}else E.head&&(E.head.extra=null);E.mode=6;case 6:if(1024&E.flags&&(re<(ae=E.length)&&(ae=re),ae&&(E.head&&(g=E.head.extra_len-E.length,E.head.extra||(E.head.extra=new Array(E.head.extra_len)),l.arraySet(E.head.extra,G,K,ae,g)),512&E.flags&&(E.check=f(E.check,G,ae,K)),re-=ae,K+=ae,E.length-=ae),E.length))break e;E.length=0,E.mode=7;case 7:if(2048&E.flags){if(re===0)break e;for(ae=0;g=G[K+ae++],E.head&&g&&E.length<65536&&(E.head.name+=String.fromCharCode(g)),g&&ae<re;);if(512&E.flags&&(E.check=f(E.check,G,ae,K)),re-=ae,K+=ae,g)break e}else E.head&&(E.head.name=null);E.length=0,E.mode=8;case 8:if(4096&E.flags){if(re===0)break e;for(ae=0;g=G[K+ae++],E.head&&g&&E.length<65536&&(E.head.comment+=String.fromCharCode(g)),g&&ae<re;);if(512&E.flags&&(E.check=f(E.check,G,ae,K)),re-=ae,K+=ae,g)break e}else E.head&&(E.head.comment=null);E.mode=9;case 9:if(512&E.flags){for(;I<16;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(z!==(65535&E.check)){R.msg="header crc mismatch",E.mode=30;break}I=z=0}E.head&&(E.head.hcrc=E.flags>>9&1,E.head.done=!0),R.adler=E.check=0,E.mode=12;break;case 10:for(;I<32;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}R.adler=E.check=w(z),I=z=0,E.mode=11;case 11:if(E.havedict===0)return R.next_out=ue,R.avail_out=q,R.next_in=K,R.avail_in=re,E.hold=z,E.bits=I,2;R.adler=E.check=1,E.mode=12;case 12:if(Q===5||Q===6)break e;case 13:if(E.last){z>>>=7&I,I-=7&I,E.mode=27;break}for(;I<3;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}switch(E.last=1&z,I-=1,3&(z>>>=1)){case 0:E.mode=14;break;case 1:if(W(E),E.mode=20,Q!==6)break;z>>>=2,I-=2;break e;case 2:E.mode=17;break;case 3:R.msg="invalid block type",E.mode=30}z>>>=2,I-=2;break;case 14:for(z>>>=7&I,I-=7&I;I<32;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if((65535&z)!=(z>>>16^65535)){R.msg="invalid stored block lengths",E.mode=30;break}if(E.length=65535&z,I=z=0,E.mode=15,Q===6)break e;case 15:E.mode=16;case 16:if(ae=E.length){if(re<ae&&(ae=re),q<ae&&(ae=q),ae===0)break e;l.arraySet(J,G,K,ae,ue),re-=ae,K+=ae,q-=ae,ue+=ae,E.length-=ae;break}E.mode=12;break;case 17:for(;I<14;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(E.nlen=257+(31&z),z>>>=5,I-=5,E.ndist=1+(31&z),z>>>=5,I-=5,E.ncode=4+(15&z),z>>>=4,I-=4,286<E.nlen||30<E.ndist){R.msg="too many length or distance symbols",E.mode=30;break}E.have=0,E.mode=18;case 18:for(;E.have<E.ncode;){for(;I<3;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.lens[ee[E.have++]]=7&z,z>>>=3,I-=3}for(;E.have<19;)E.lens[ee[E.have++]]=0;if(E.lencode=E.lendyn,E.lenbits=7,Z={bits:E.lenbits},Y=h(0,E.lens,0,19,E.lencode,0,E.work,Z),E.lenbits=Z.bits,Y){R.msg="invalid code lengths set",E.mode=30;break}E.have=0,E.mode=19;case 19:for(;E.have<E.nlen+E.ndist;){for(;ke=(T=E.lencode[z&(1<<E.lenbits)-1])>>>16&255,je=65535&T,!((Ce=T>>>24)<=I);){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(je<16)z>>>=Ce,I-=Ce,E.lens[E.have++]=je;else{if(je===16){for(A=Ce+2;I<A;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(z>>>=Ce,I-=Ce,E.have===0){R.msg="invalid bit length repeat",E.mode=30;break}g=E.lens[E.have-1],ae=3+(3&z),z>>>=2,I-=2}else if(je===17){for(A=Ce+3;I<A;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}I-=Ce,g=0,ae=3+(7&(z>>>=Ce)),z>>>=3,I-=3}else{for(A=Ce+7;I<A;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}I-=Ce,g=0,ae=11+(127&(z>>>=Ce)),z>>>=7,I-=7}if(E.have+ae>E.nlen+E.ndist){R.msg="invalid bit length repeat",E.mode=30;break}for(;ae--;)E.lens[E.have++]=g}}if(E.mode===30)break;if(E.lens[256]===0){R.msg="invalid code -- missing end-of-block",E.mode=30;break}if(E.lenbits=9,Z={bits:E.lenbits},Y=h(y,E.lens,0,E.nlen,E.lencode,0,E.work,Z),E.lenbits=Z.bits,Y){R.msg="invalid literal/lengths set",E.mode=30;break}if(E.distbits=6,E.distcode=E.distdyn,Z={bits:E.distbits},Y=h(b,E.lens,E.nlen,E.ndist,E.distcode,0,E.work,Z),E.distbits=Z.bits,Y){R.msg="invalid distances set",E.mode=30;break}if(E.mode=20,Q===6)break e;case 20:E.mode=21;case 21:if(6<=re&&258<=q){R.next_out=ue,R.avail_out=q,R.next_in=K,R.avail_in=re,E.hold=z,E.bits=I,d(R,te),ue=R.next_out,J=R.output,q=R.avail_out,K=R.next_in,G=R.input,re=R.avail_in,z=E.hold,I=E.bits,E.mode===12&&(E.back=-1);break}for(E.back=0;ke=(T=E.lencode[z&(1<<E.lenbits)-1])>>>16&255,je=65535&T,!((Ce=T>>>24)<=I);){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(ke&&(240&ke)==0){for(_e=Ce,Re=ke,Ne=je;ke=(T=E.lencode[Ne+((z&(1<<_e+Re)-1)>>_e)])>>>16&255,je=65535&T,!(_e+(Ce=T>>>24)<=I);){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}z>>>=_e,I-=_e,E.back+=_e}if(z>>>=Ce,I-=Ce,E.back+=Ce,E.length=je,ke===0){E.mode=26;break}if(32&ke){E.back=-1,E.mode=12;break}if(64&ke){R.msg="invalid literal/length code",E.mode=30;break}E.extra=15&ke,E.mode=22;case 22:if(E.extra){for(A=E.extra;I<A;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.length+=z&(1<<E.extra)-1,z>>>=E.extra,I-=E.extra,E.back+=E.extra}E.was=E.length,E.mode=23;case 23:for(;ke=(T=E.distcode[z&(1<<E.distbits)-1])>>>16&255,je=65535&T,!((Ce=T>>>24)<=I);){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if((240&ke)==0){for(_e=Ce,Re=ke,Ne=je;ke=(T=E.distcode[Ne+((z&(1<<_e+Re)-1)>>_e)])>>>16&255,je=65535&T,!(_e+(Ce=T>>>24)<=I);){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}z>>>=_e,I-=_e,E.back+=_e}if(z>>>=Ce,I-=Ce,E.back+=Ce,64&ke){R.msg="invalid distance code",E.mode=30;break}E.offset=je,E.extra=15&ke,E.mode=24;case 24:if(E.extra){for(A=E.extra;I<A;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}E.offset+=z&(1<<E.extra)-1,z>>>=E.extra,I-=E.extra,E.back+=E.extra}if(E.offset>E.dmax){R.msg="invalid distance too far back",E.mode=30;break}E.mode=25;case 25:if(q===0)break e;if(ae=te-q,E.offset>ae){if((ae=E.offset-ae)>E.whave&&E.sane){R.msg="invalid distance too far back",E.mode=30;break}xe=ae>E.wnext?(ae-=E.wnext,E.wsize-ae):E.wnext-ae,ae>E.length&&(ae=E.length),Te=E.window}else Te=J,xe=ue-E.offset,ae=E.length;for(q<ae&&(ae=q),q-=ae,E.length-=ae;J[ue++]=Te[xe++],--ae;);E.length===0&&(E.mode=21);break;case 26:if(q===0)break e;J[ue++]=E.length,q--,E.mode=21;break;case 27:if(E.wrap){for(;I<32;){if(re===0)break e;re--,z|=G[K++]<<I,I+=8}if(te-=q,R.total_out+=te,E.total+=te,te&&(R.adler=E.check=E.flags?f(E.check,J,te,ue-te):c(E.check,J,te,ue-te)),te=q,(E.flags?z:w(z))!==E.check){R.msg="incorrect data check",E.mode=30;break}I=z=0}E.mode=28;case 28:if(E.wrap&&E.flags){for(;I<32;){if(re===0)break e;re--,z+=G[K++]<<I,I+=8}if(z!==(4294967295&E.total)){R.msg="incorrect length check",E.mode=30;break}I=z=0}E.mode=29;case 29:Y=1;break e;case 30:Y=-3;break e;case 31:return-4;case 32:default:return m}return R.next_out=ue,R.avail_out=q,R.next_in=K,R.avail_in=re,E.hold=z,E.bits=I,(E.wsize||te!==R.avail_out&&E.mode<30&&(E.mode<27||Q!==4))&&oe(R,R.output,R.next_out,te-R.avail_out)?(E.mode=31,-4):(B-=R.avail_in,te-=R.avail_out,R.total_in+=B,R.total_out+=te,E.total+=te,E.wrap&&te&&(R.adler=E.check=E.flags?f(E.check,J,te,R.next_out-te):c(E.check,J,te,R.next_out-te)),R.data_type=E.bits+(E.last?64:0)+(E.mode===12?128:0)+(E.mode===20||E.mode===15?256:0),(B==0&&te===0||Q===4)&&Y===_&&(Y=-5),Y)},u.inflateEnd=function(R){if(!R||!R.state)return m;var Q=R.state;return Q.window&&(Q.window=null),R.state=null,_},u.inflateGetHeader=function(R,Q){var E;return R&&R.state?(2&(E=R.state).wrap)==0?m:((E.head=Q).done=!1,_):m},u.inflateSetDictionary=function(R,Q){var E,G=Q.length;return R&&R.state?(E=R.state).wrap!==0&&E.mode!==11?m:E.mode===11&&c(1,Q,G,0)!==E.check?-3:oe(R,Q,G,G)?(E.mode=31,-4):(E.havedict=1,_):m},u.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(i,s,u){var l=i("../utils/common"),c=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],d=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],h=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];s.exports=function(y,b,_,m,C,S,x,w){var k,N,j,D,M,L,V,F,W,oe=w.bits,R=0,Q=0,E=0,G=0,J=0,K=0,ue=0,re=0,q=0,z=0,I=null,B=0,te=new l.Buf16(16),ae=new l.Buf16(16),xe=null,Te=0;for(R=0;R<=15;R++)te[R]=0;for(Q=0;Q<m;Q++)te[b[_+Q]]++;for(J=oe,G=15;1<=G&&te[G]===0;G--);if(G<J&&(J=G),G===0)return C[S++]=20971520,C[S++]=20971520,w.bits=1,0;for(E=1;E<G&&te[E]===0;E++);for(J<E&&(J=E),R=re=1;R<=15;R++)if(re<<=1,(re-=te[R])<0)return-1;if(0<re&&(y===0||G!==1))return-1;for(ae[1]=0,R=1;R<15;R++)ae[R+1]=ae[R]+te[R];for(Q=0;Q<m;Q++)b[_+Q]!==0&&(x[ae[b[_+Q]]++]=Q);if(L=y===0?(I=xe=x,19):y===1?(I=c,B-=257,xe=f,Te-=257,256):(I=d,xe=h,-1),R=E,M=S,ue=Q=z=0,j=-1,D=(q=1<<(K=J))-1,y===1&&852<q||y===2&&592<q)return 1;for(;;){for(V=R-ue,W=x[Q]<L?(F=0,x[Q]):x[Q]>L?(F=xe[Te+x[Q]],I[B+x[Q]]):(F=96,0),k=1<<R-ue,E=N=1<<K;C[M+(z>>ue)+(N-=k)]=V<<24|F<<16|W|0,N!==0;);for(k=1<<R-1;z&k;)k>>=1;if(k!==0?(z&=k-1,z+=k):z=0,Q++,--te[R]==0){if(R===G)break;R=b[_+x[Q]]}if(J<R&&(z&D)!==j){for(ue===0&&(ue=J),M+=E,re=1<<(K=R-ue);K+ue<G&&!((re-=te[K+ue])<=0);)K++,re<<=1;if(q+=1<<K,y===1&&852<q||y===2&&592<q)return 1;C[j=z&D]=J<<24|K<<16|M-S|0}}return z!==0&&(C[M+z]=R-ue<<24|4194304|0),w.bits=J,0}},{"../utils/common":41}],51:[function(i,s,u){s.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(i,s,u){var l=i("../utils/common"),c=0,f=1;function d(T){for(var U=T.length;0<=--U;)T[U]=0}var h=0,y=29,b=256,_=b+1+y,m=30,C=19,S=2*_+1,x=15,w=16,k=7,N=256,j=16,D=17,M=18,L=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],W=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],oe=new Array(2*(_+2));d(oe);var R=new Array(2*m);d(R);var Q=new Array(512);d(Q);var E=new Array(256);d(E);var G=new Array(y);d(G);var J,K,ue,re=new Array(m);function q(T,U,ee,se,X){this.static_tree=T,this.extra_bits=U,this.extra_base=ee,this.elems=se,this.max_length=X,this.has_stree=T&&T.length}function z(T,U){this.dyn_tree=T,this.max_code=0,this.stat_desc=U}function I(T){return T<256?Q[T]:Q[256+(T>>>7)]}function B(T,U){T.pending_buf[T.pending++]=255&U,T.pending_buf[T.pending++]=U>>>8&255}function te(T,U,ee){T.bi_valid>w-ee?(T.bi_buf|=U<<T.bi_valid&65535,B(T,T.bi_buf),T.bi_buf=U>>w-T.bi_valid,T.bi_valid+=ee-w):(T.bi_buf|=U<<T.bi_valid&65535,T.bi_valid+=ee)}function ae(T,U,ee){te(T,ee[2*U],ee[2*U+1])}function xe(T,U){for(var ee=0;ee|=1&T,T>>>=1,ee<<=1,0<--U;);return ee>>>1}function Te(T,U,ee){var se,X,ce=new Array(x+1),pe=0;for(se=1;se<=x;se++)ce[se]=pe=pe+ee[se-1]<<1;for(X=0;X<=U;X++){var de=T[2*X+1];de!==0&&(T[2*X]=xe(ce[de]++,de))}}function Ce(T){var U;for(U=0;U<_;U++)T.dyn_ltree[2*U]=0;for(U=0;U<m;U++)T.dyn_dtree[2*U]=0;for(U=0;U<C;U++)T.bl_tree[2*U]=0;T.dyn_ltree[2*N]=1,T.opt_len=T.static_len=0,T.last_lit=T.matches=0}function ke(T){8<T.bi_valid?B(T,T.bi_buf):0<T.bi_valid&&(T.pending_buf[T.pending++]=T.bi_buf),T.bi_buf=0,T.bi_valid=0}function je(T,U,ee,se){var X=2*U,ce=2*ee;return T[X]<T[ce]||T[X]===T[ce]&&se[U]<=se[ee]}function _e(T,U,ee){for(var se=T.heap[ee],X=ee<<1;X<=T.heap_len&&(X<T.heap_len&&je(U,T.heap[X+1],T.heap[X],T.depth)&&X++,!je(U,se,T.heap[X],T.depth));)T.heap[ee]=T.heap[X],ee=X,X<<=1;T.heap[ee]=se}function Re(T,U,ee){var se,X,ce,pe,de=0;if(T.last_lit!==0)for(;se=T.pending_buf[T.d_buf+2*de]<<8|T.pending_buf[T.d_buf+2*de+1],X=T.pending_buf[T.l_buf+de],de++,se===0?ae(T,X,U):(ae(T,(ce=E[X])+b+1,U),(pe=L[ce])!==0&&te(T,X-=G[ce],pe),ae(T,ce=I(--se),ee),(pe=V[ce])!==0&&te(T,se-=re[ce],pe)),de<T.last_lit;);ae(T,N,U)}function Ne(T,U){var ee,se,X,ce=U.dyn_tree,pe=U.stat_desc.static_tree,de=U.stat_desc.has_stree,ie=U.stat_desc.elems,be=-1;for(T.heap_len=0,T.heap_max=S,ee=0;ee<ie;ee++)ce[2*ee]!==0?(T.heap[++T.heap_len]=be=ee,T.depth[ee]=0):ce[2*ee+1]=0;for(;T.heap_len<2;)ce[2*(X=T.heap[++T.heap_len]=be<2?++be:0)]=1,T.depth[X]=0,T.opt_len--,de&&(T.static_len-=pe[2*X+1]);for(U.max_code=be,ee=T.heap_len>>1;1<=ee;ee--)_e(T,ce,ee);for(X=ie;ee=T.heap[1],T.heap[1]=T.heap[T.heap_len--],_e(T,ce,1),se=T.heap[1],T.heap[--T.heap_max]=ee,T.heap[--T.heap_max]=se,ce[2*X]=ce[2*ee]+ce[2*se],T.depth[X]=(T.depth[ee]>=T.depth[se]?T.depth[ee]:T.depth[se])+1,ce[2*ee+1]=ce[2*se+1]=X,T.heap[1]=X++,_e(T,ce,1),2<=T.heap_len;);T.heap[--T.heap_max]=T.heap[1],(function(Ee,De){var qe,$e,Et,Le,st,vt,Pe=De.dyn_tree,$t=De.max_code,Zt=De.stat_desc.static_tree,as=De.stat_desc.has_stree,Nr=De.stat_desc.extra_bits,qn=De.stat_desc.extra_base,Vt=De.stat_desc.max_length,jt=0;for(Le=0;Le<=x;Le++)Ee.bl_count[Le]=0;for(Pe[2*Ee.heap[Ee.heap_max]+1]=0,qe=Ee.heap_max+1;qe<S;qe++)Vt<(Le=Pe[2*Pe[2*($e=Ee.heap[qe])+1]+1]+1)&&(Le=Vt,jt++),Pe[2*$e+1]=Le,$t<$e||(Ee.bl_count[Le]++,st=0,qn<=$e&&(st=Nr[$e-qn]),vt=Pe[2*$e],Ee.opt_len+=vt*(Le+st),as&&(Ee.static_len+=vt*(Zt[2*$e+1]+st)));if(jt!==0){do{for(Le=Vt-1;Ee.bl_count[Le]===0;)Le--;Ee.bl_count[Le]--,Ee.bl_count[Le+1]+=2,Ee.bl_count[Vt]--,jt-=2}while(0<jt);for(Le=Vt;Le!==0;Le--)for($e=Ee.bl_count[Le];$e!==0;)$t<(Et=Ee.heap[--qe])||(Pe[2*Et+1]!==Le&&(Ee.opt_len+=(Le-Pe[2*Et+1])*Pe[2*Et],Pe[2*Et+1]=Le),$e--)}})(T,U),Te(ce,be,T.bl_count)}function g(T,U,ee){var se,X,ce=-1,pe=U[1],de=0,ie=7,be=4;for(pe===0&&(ie=138,be=3),U[2*(ee+1)+1]=65535,se=0;se<=ee;se++)X=pe,pe=U[2*(se+1)+1],++de<ie&&X===pe||(de<be?T.bl_tree[2*X]+=de:X!==0?(X!==ce&&T.bl_tree[2*X]++,T.bl_tree[2*j]++):de<=10?T.bl_tree[2*D]++:T.bl_tree[2*M]++,ce=X,be=(de=0)===pe?(ie=138,3):X===pe?(ie=6,3):(ie=7,4))}function Y(T,U,ee){var se,X,ce=-1,pe=U[1],de=0,ie=7,be=4;for(pe===0&&(ie=138,be=3),se=0;se<=ee;se++)if(X=pe,pe=U[2*(se+1)+1],!(++de<ie&&X===pe)){if(de<be)for(;ae(T,X,T.bl_tree),--de!=0;);else X!==0?(X!==ce&&(ae(T,X,T.bl_tree),de--),ae(T,j,T.bl_tree),te(T,de-3,2)):de<=10?(ae(T,D,T.bl_tree),te(T,de-3,3)):(ae(T,M,T.bl_tree),te(T,de-11,7));ce=X,be=(de=0)===pe?(ie=138,3):X===pe?(ie=6,3):(ie=7,4)}}d(re);var Z=!1;function A(T,U,ee,se){te(T,(h<<1)+(se?1:0),3),(function(X,ce,pe,de){ke(X),B(X,pe),B(X,~pe),l.arraySet(X.pending_buf,X.window,ce,pe,X.pending),X.pending+=pe})(T,U,ee)}u._tr_init=function(T){Z||((function(){var U,ee,se,X,ce,pe=new Array(x+1);for(X=se=0;X<y-1;X++)for(G[X]=se,U=0;U<1<<L[X];U++)E[se++]=X;for(E[se-1]=X,X=ce=0;X<16;X++)for(re[X]=ce,U=0;U<1<<V[X];U++)Q[ce++]=X;for(ce>>=7;X<m;X++)for(re[X]=ce<<7,U=0;U<1<<V[X]-7;U++)Q[256+ce++]=X;for(ee=0;ee<=x;ee++)pe[ee]=0;for(U=0;U<=143;)oe[2*U+1]=8,U++,pe[8]++;for(;U<=255;)oe[2*U+1]=9,U++,pe[9]++;for(;U<=279;)oe[2*U+1]=7,U++,pe[7]++;for(;U<=287;)oe[2*U+1]=8,U++,pe[8]++;for(Te(oe,_+1,pe),U=0;U<m;U++)R[2*U+1]=5,R[2*U]=xe(U,5);J=new q(oe,L,b+1,_,x),K=new q(R,V,0,m,x),ue=new q(new Array(0),F,0,C,k)})(),Z=!0),T.l_desc=new z(T.dyn_ltree,J),T.d_desc=new z(T.dyn_dtree,K),T.bl_desc=new z(T.bl_tree,ue),T.bi_buf=0,T.bi_valid=0,Ce(T)},u._tr_stored_block=A,u._tr_flush_block=function(T,U,ee,se){var X,ce,pe=0;0<T.level?(T.strm.data_type===2&&(T.strm.data_type=(function(de){var ie,be=4093624447;for(ie=0;ie<=31;ie++,be>>>=1)if(1&be&&de.dyn_ltree[2*ie]!==0)return c;if(de.dyn_ltree[18]!==0||de.dyn_ltree[20]!==0||de.dyn_ltree[26]!==0)return f;for(ie=32;ie<b;ie++)if(de.dyn_ltree[2*ie]!==0)return f;return c})(T)),Ne(T,T.l_desc),Ne(T,T.d_desc),pe=(function(de){var ie;for(g(de,de.dyn_ltree,de.l_desc.max_code),g(de,de.dyn_dtree,de.d_desc.max_code),Ne(de,de.bl_desc),ie=C-1;3<=ie&&de.bl_tree[2*W[ie]+1]===0;ie--);return de.opt_len+=3*(ie+1)+5+5+4,ie})(T),X=T.opt_len+3+7>>>3,(ce=T.static_len+3+7>>>3)<=X&&(X=ce)):X=ce=ee+5,ee+4<=X&&U!==-1?A(T,U,ee,se):T.strategy===4||ce===X?(te(T,2+(se?1:0),3),Re(T,oe,R)):(te(T,4+(se?1:0),3),(function(de,ie,be,Ee){var De;for(te(de,ie-257,5),te(de,be-1,5),te(de,Ee-4,4),De=0;De<Ee;De++)te(de,de.bl_tree[2*W[De]+1],3);Y(de,de.dyn_ltree,ie-1),Y(de,de.dyn_dtree,be-1)})(T,T.l_desc.max_code+1,T.d_desc.max_code+1,pe+1),Re(T,T.dyn_ltree,T.dyn_dtree)),Ce(T),se&&ke(T)},u._tr_tally=function(T,U,ee){return T.pending_buf[T.d_buf+2*T.last_lit]=U>>>8&255,T.pending_buf[T.d_buf+2*T.last_lit+1]=255&U,T.pending_buf[T.l_buf+T.last_lit]=255&ee,T.last_lit++,U===0?T.dyn_ltree[2*ee]++:(T.matches++,U--,T.dyn_ltree[2*(E[ee]+b+1)]++,T.dyn_dtree[2*I(U)]++),T.last_lit===T.lit_bufsize-1},u._tr_align=function(T){te(T,2,3),ae(T,N,oe),(function(U){U.bi_valid===16?(B(U,U.bi_buf),U.bi_buf=0,U.bi_valid=0):8<=U.bi_valid&&(U.pending_buf[U.pending++]=255&U.bi_buf,U.bi_buf>>=8,U.bi_valid-=8)})(T)}},{"../utils/common":41}],53:[function(i,s,u){s.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(i,s,u){(function(l){(function(c,f){if(!c.setImmediate){var d,h,y,b,_=1,m={},C=!1,S=c.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(c);x=x&&x.setTimeout?x:c,d={}.toString.call(c.process)==="[object process]"?function(j){process.nextTick(function(){k(j)})}:(function(){if(c.postMessage&&!c.importScripts){var j=!0,D=c.onmessage;return c.onmessage=function(){j=!1},c.postMessage("","*"),c.onmessage=D,j}})()?(b="setImmediate$"+Math.random()+"$",c.addEventListener?c.addEventListener("message",N,!1):c.attachEvent("onmessage",N),function(j){c.postMessage(b+j,"*")}):c.MessageChannel?((y=new MessageChannel).port1.onmessage=function(j){k(j.data)},function(j){y.port2.postMessage(j)}):S&&"onreadystatechange"in S.createElement("script")?(h=S.documentElement,function(j){var D=S.createElement("script");D.onreadystatechange=function(){k(j),D.onreadystatechange=null,h.removeChild(D),D=null},h.appendChild(D)}):function(j){setTimeout(k,0,j)},x.setImmediate=function(j){typeof j!="function"&&(j=new Function(""+j));for(var D=new Array(arguments.length-1),M=0;M<D.length;M++)D[M]=arguments[M+1];var L={callback:j,args:D};return m[_]=L,d(_),_++},x.clearImmediate=w}function w(j){delete m[j]}function k(j){if(C)setTimeout(k,0,j);else{var D=m[j];if(D){C=!0;try{(function(M){var L=M.callback,V=M.args;switch(V.length){case 0:L();break;case 1:L(V[0]);break;case 2:L(V[0],V[1]);break;case 3:L(V[0],V[1],V[2]);break;default:L.apply(f,V)}})(D)}finally{w(j),C=!1}}}}function N(j){j.source===c&&typeof j.data=="string"&&j.data.indexOf(b)===0&&k(+j.data.slice(b.length))}})(typeof self>"u"?l===void 0?this:l:self)}).call(this,typeof vr<"u"?vr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(du)),du.exports}var W_=Q_();const J_=Ws(W_);class $_{pendingFiles=[];pendingMessage="";pendingFormat="";setFilesForUpload(a,i){this.pendingFiles.length>0&&this.clearPendingFilesState();const s=a.filter(u=>this.validateFileType(u));if(s.length===0)throw new Za("No valid files provided",{context:{stage:"setFilesForUpload"}});this.pendingFiles=s,i&&i.trim()&&(this.pendingMessage=i),this.pendingFormat=s.length>1?"zip":s?.[0]?.type?.split("/")?.[1]||"unknown"}getPendingFileState(){return{files:this.pendingFiles,message:this.pendingMessage||"",format:this.pendingFormat||""}}async uploadFilesToPresignedUrl(a){let i=0;const s=a.filter(u=>u&&u.trim());try{if(s.length===0)throw new Za("No valid presigned URLs provided",{context:{stage:"uploadFilesToPresignedUrl"}});let u,l;if(this.shouldZipFiles()){const c=await this.zipFiles(),f=this.getUploadFileName();u=this.blobToFile(c,f),l="application/zip"}else u=this.pendingFiles?.[0],l=u.type;for(let c=0;c<s.length;c++){const f=s[c],d=await fetch(f,{method:"PUT",body:u,headers:{"Content-Type":l,"x-ms-blob-type":"BlockBlob"}});if(!d.ok)throw new Za(`Failed to upload ${u.name} to URL ${c+1}: ${d.status} ${d.statusText}`,{context:{stage:"uploadFilesToPresignedUrl",status:d.status,url:f}});i++}return s[0]}catch(u){if(i>0)return s[0];throw kr(u,Za,"Failed to upload files to presigned URL",{context:{stage:"uploadFilesToPresignedUrl"}})}}async zipFiles(){const a=new J_;return this.pendingFiles.forEach(s=>{a.file(s.name,s)}),await a.generateAsync({type:"blob"})}blobToFile(a,i){return new File([a],i,{type:a.type})}shouldZipFiles(){return this.pendingFiles.length>1}getUploadFileName(){return this.shouldZipFiles()?`uploaded_files_${Date.now()}.zip`:this.pendingFiles[0]?.name||"file"}validateFileType(a){return["application/pdf","image/jpeg","image/png","image/jpg","image/tiff","text/plain","text/markdown","image/heif","image/heic","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(a.type)}clearPendingFilesState(){this.pendingFiles=[],this.pendingMessage="",this.pendingFormat=""}}const bt={CONNECTED:"connected",DISCONNECTED:"disconnected",PROGRESS_MESSAGE:"progress_message",MESSAGE_CHUNK:"message_chunk",TIPS_MESSAGE:"tips_message",END_OF_STREAM:"end_of_stream",ERROR:"error",TOOL_CALL:"tool_call",INLINE_TEXT:"inline_text",TOOL_START:"tool_start",TOOL_END:"tool_end"},eS={SESSION_EXPIRED:"session_expired"},Cp={SESSION_EXPIRED:"session_expired"};class tS{mediaRecorder=null;mediaStream=null;recordingStartTime=0;autoPauseTimer=null;config;onAudioData=null;onAudioError=null;suppressCallbacks=!1;constructor(a={}){this.config={mimeType:"audio/webm;codecs=opus",audioBitsPerSecond:128e3,maxRecordingDuration:9e5,autoPauseEnabled:!0,...a}}async checkCurrentPermissionState(){const a=await navigator.permissions.query({name:"microphone"});if(a.state==="denied")throw new ln("Microphone permission denied",{context:{permissionState:a.state},hint:"Ensure the browser has microphone access enabled for this site."});return a.state}async start(a,i){try{if(!navigator.mediaDevices)throw new ln("Media devices API is not available. This usually means the page is not served over HTTPS or there are browser restrictions.",{context:{feature:"mediaDevices"},hint:"Serve the app over HTTPS and verify browser/device microphone support.",displayMessage:"Microphone access is unavailable."});if(!window.MediaRecorder)throw new ln("MediaRecorder is not supported in this browser",{context:{feature:"MediaRecorder"},hint:"Use a browser that supports the MediaRecorder API.",displayMessage:"Microphone access is unavailable."});const s=["audio/mp3","audio/ogg;codecs=opus","audio/mp4","audio/ogg","audio/wav"].filter(u=>MediaRecorder.isTypeSupported(u));if(s.length===0)throw new ln("No supported audio formats found in this browser",{context:{requestedTypes:s},hint:"Verify codec support or adjust the requested MIME types.",displayMessage:"Microphone access is unavailable."});if(this.config.mimeType=s[0],await this.checkCurrentPermissionState(),this.onAudioData=a,this.onAudioError=i??null,this.suppressCallbacks=!1,this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1,sampleRate:44100,channelCount:1}}),this.mediaRecorder=new MediaRecorder(this.mediaStream,{mimeType:this.config.mimeType,audioBitsPerSecond:this.config.audioBitsPerSecond}),this.mediaRecorder.state!=="inactive")throw new ln("MediaRecorder is in an invalid state for start()",{context:{recorderState:this.mediaRecorder.state},displayMessage:"Failed to start recording"});this.setupMediaRecorderEvents(),this.mediaRecorder.start(),this.recordingStartTime=Date.now(),this.config.autoPauseEnabled&&this.setupAutoPauseTimer()}catch(s){throw this.toRecordingError(s,"Failed to start audio recording",{stage:"start"})}}async processAudioChunk(a){try{const i=await this.blobToBase64(a),s=Date.now();if(!this.onAudioData)return;const u={audio:i,format:this.config.mimeType,duration:this.recordingStartTime>0?s-this.recordingStartTime:0,timestamp:this.recordingStartTime>0?this.recordingStartTime:s};this.onAudioData(u)}catch(i){this.handleError(i,{stage:"process_audio_chunk"})}}toRecordingError(a,i,s){if(a instanceof ln)return a;if(a instanceof Sn)return new ln(a.message,{cause:a,context:{...a.context,...s},hint:a.hint});const u=a instanceof Error&&a.message?a.message:i;return new ln(u,{cause:a,context:s})}handleError(a,i){const s=this.toRecordingError(a,"Unexpected recording error",i);if(this.onAudioError)try{this.onAudioError(s)}catch(u){console.error("Audio error callback failed:",u)}else console.error("AudioManager error:",s)}setupAutoPauseTimer(){this.autoPauseTimer&&clearTimeout(this.autoPauseTimer),this.autoPauseTimer=setTimeout(()=>{console.log("Auto-pause timer triggered after 15 minutes"),this.stop()},this.config.maxRecordingDuration)}setupMediaRecorderEvents(){this.mediaRecorder&&(this.mediaRecorder.ondataavailable=a=>{this.suppressCallbacks||a.data.size<=0||this.processAudioChunk(a.data).catch(i=>this.handleError(i,{stage:"media_recorder_ondataavailable",hasData:a.data.size>0}))},this.mediaRecorder.onstop=async()=>{this.recordingStartTime=0},this.mediaRecorder.onerror=a=>{this.handleError(a.error instanceof Error?a.error:new Error("MediaRecorder encountered an unknown error"),{stage:"media_recorder_onerror"})},this.mediaRecorder.onstart=()=>{console.log("MediaRecorder started recording"),this.mediaRecorder&&(console.log("MediaRecorder state:",this.mediaRecorder.state),console.log("MediaRecorder MIME type:",this.mediaRecorder.mimeType))})}blobToBase64(a){return new Promise((i,s)=>{const u=new FileReader;u.onload=()=>{if(typeof u.result=="string"){const l=u.result.split(",")[1];i(l)}else s(new ln("Failed to convert blob to base64",{context:{stage:"blob_to_base64"}}))},u.onerror=()=>s(new ln("FileReader error while converting audio chunk to base64",{cause:u.error??void 0,context:{stage:"blob_to_base64"}})),u.readAsDataURL(a)})}stop(){if(this.mediaRecorder)try{this.autoPauseTimer&&(clearTimeout(this.autoPauseTimer),this.autoPauseTimer=null),this.mediaRecorder.state==="recording"&&this.mediaRecorder.stop(),this.mediaStream&&(this.mediaStream.getTracks().forEach(a=>a.stop()),this.mediaStream=null),console.log("Audio recording stopped manually")}catch(a){throw this.toRecordingError(a,"Failed to stop audio recording",{stage:"stop"})}}cancel(){if(this.mediaRecorder)try{this.suppressCallbacks=!0,this.autoPauseTimer&&(clearTimeout(this.autoPauseTimer),this.autoPauseTimer=null),this.mediaRecorder.ondataavailable=null,this.mediaRecorder.state==="recording"&&this.mediaRecorder.stop(),this.mediaStream&&(this.mediaStream.getTracks().forEach(a=>a.stop()),this.mediaStream=null)}catch(a){throw this.toRecordingError(a,"Failed to cancel audio recording",{stage:"cancel"})}}destroy(){try{this.cancel(),this.mediaRecorder&&(this.mediaRecorder=null),this.mediaStream&&(this.mediaStream.getTracks().forEach(a=>a.stop()),this.mediaStream=null)}catch(a){throw this.toRecordingError(a,"Failed to destroy audio resources",{stage:"destroy"})}}}class nS{connection=null;callbacks=null;fileManager=null;audioManager=null;constructor(a,i){this.connection=a||null,this.callbacks=i||null}handleFileUploadProcess({files:a,message:i,url:s}){this.fileManager||(this.fileManager=new $_);let u;if(a&&a.length>0)this.fileManager.setFilesForUpload(a,i),u={ev:Yt.CHAT,ct:un.FILE,_id:Date.now().toString(),ts:Date.now(),data:{extension:this.fileManager.getPendingFileState().format}};else if(s){const l=this.fileManager.getPendingFileState().message;u={ev:Yt.CHAT,ct:un.FILE,_id:Date.now().toString(),ts:Date.now(),data:{url:s,...l&&{text:l}}},this.fileManager?.clearPendingFilesState()}return u}sendSocketMessage({message:a,files:i,audio:s,url:u,tool_declined:l,tool_id:c,initial_prompts:f}){const d=this.assertConnection("sendSocketChatMessage");let h;if(i&&i.length>0||u&&u.trim()!==""?h=this.handleFileUploadProcess({files:i,message:a,url:u}):a?h={ev:Yt.CHAT,ct:un.TEXT,_id:Date.now().toString(),ts:Date.now(),data:{text:a,...l&&{tool_declined:l},...c&&{tool_id:c},...f&&{initial_prompts:f}}}:s&&s?.audio&&s?.format&&(console.log("obj",Object.keys(s||{})),h={ev:Yt.STREAM,ct:un.AUDIO,_id:Date.now().toString(),ts:Date.now(),data:{audio:s?.audio,format:s?.format}}),!h){const y=new Xa("No message to send",{context:{stage:"sendSocketChatMessage"}});throw this.emitError(y),y}d.sendMessage(h)}handleIncomingSocketChatMessage(a){const i=this.assertConnection("handleIncomingSocketChatMessage");switch(a.ct){case un.FILE:{a?.data?.urls&&a.data.urls?.length>0&&this.fileManager?.uploadFilesToPresignedUrl(a.data.urls).then(()=>{this.sendSocketMessage({url:a.data.urls?.[0]})}).catch(s=>{const u=this.toFileError(s,"Failed to upload files to presigned URL",{stage:"handleIncomingSocketChatMessage",urls:a.data?.urls?.length});this.emitError(u)});break}case un.TEXT:if(a.data.text&&a.data.text.trim()===""&&a._id){const s={data:{text:a.data.text},messageId:a._id,timestamp:a.ts};i.emit(bt.MESSAGE_CHUNK,s)}break;case un.TOOL_CALL:if(a?.data?.tool_id&&a._id){const s={data:{...a.data},messageId:a._id,timestamp:a.ts};i.emit(bt.TOOL_CALL,s)}break;case un.INLINE_TEXT:if(a?.data?.text){const s={data:{text:a.data.text},messageId:a._id,timestamp:a.ts};i.emit(bt.INLINE_TEXT,s)}break}}handleIncomingSocketStreamMessage(a){const i=this.assertConnection("handleIncomingSocketStreamMessage");switch(a.ct){case un.TEXT:if(a?.data?.progress_msg){const c={data:{text:a.data.progress_msg},messageId:a._id,timestamp:a.ts};i.emit(bt.PROGRESS_MESSAGE,c);return}if(a?.data?.text){const c={data:{text:a.data.text},messageId:a._id,timestamp:a.ts};i.emit(bt.MESSAGE_CHUNK,c)}break;case un.TIPS:if(a?.data?.tips){const c={data:{tips:a.data.tips},messageId:a._id,timestamp:a.ts};i.emit(bt.TIPS_MESSAGE,c);return}break;case un.TOOL_CALL:if(a?.data?.tool_id&&a._id){const c={data:{...a.data},messageId:a._id,timestamp:a.ts};i.emit(bt.TOOL_CALL,c);return}break;case un.TOOL_START:const s={data:a?.data,messageId:a._id||Date.now().toString()};i.emit(bt.TOOL_START,s);break;case un.TOOL_END:const u={data:a?.data,messageId:a._id||Date.now().toString()};i.emit(bt.TOOL_END,u);break;default:const l=new Xa(`Unsupported content type ${a?.ct}`,{context:{stage:"handleIncomingSocketStreamMessage",contentType:a.ct}});throw this.emitError(l),l}}handleDisconnect(a){this.connection?.emit?.(bt.DISCONNECTED,a)}handleIncomingSocketEndOfStreamMessage(a){this.assertConnection("handleIncomingSocketEndOfStreamMessage").emit(bt.END_OF_STREAM)}handleIncomingSocketErrorMessage(a){const i=this.assertConnection("handleIncomingSocketErrorMessage");switch(a.code){case eS.SESSION_EXPIRED:i.emit(Cp.SESSION_EXPIRED);break;default:const s=new Xa(a.msg||"Socket error received",{context:{stage:"handleIncomingSocketErrorMessage",errorCode:a.code}});i.emit(bt.ERROR,s),this.emitError(s)}}sendSocketAuthMessage(a){const i=this.assertConnection("sendSocketAuthMessage"),s={ev:Yt.AUTH,_id:Date.now().toString(),ts:Date.now(),data:{token:a}};i.sendMessage(s)}sendSocketPingMessage(){const a=this.assertConnection("sendSocketPingMessage"),i={ev:Yt.PING,_id:Date.now().toString(),ts:Date.now()};a.sendMessage(i)}async startRecording({onChunks:a,onError:i}){if(!a){const s=new ln("onChunks is required",{context:{stage:"startRecording"},hint:"onChunks is required"});throw this.emitError(s),s}this.assertConnection("startRecording"),this.audioManager||(this.audioManager=new tS);try{await this.audioManager.start(a,s=>{const u=this.toRecordingError(s,"Failed to start audio recording",{stage:"startRecording"});i?.(u),this.emitError(u)})}catch(s){const u=this.toRecordingError(s,"Failed to start audio recording",{stage:"startRecording"});throw i?.(u),this.emitError(u),u}}endRecordingWithSocket(){if(!this.audioManager){const a=new ln("Audio manager not set. Call startRecording() first.",{context:{stage:"stopRecording"}});throw this.emitError(a),a}try{this.audioManager.stop()}catch(a){const i=this.toRecordingError(a,"Failed to stop audio recording",{stage:"stopRecording"});throw this.emitError(i),i}}sendSocketPongMessage(){const a=this.assertConnection("sendSocketPongMessage"),i={ev:Yt.PONG,_id:Date.now().toString(),ts:Date.now()};a.sendMessage(i)}handleConnectionEstablished(){this.connection?.handleConnected(),this.connection?.emit(bt.CONNECTED)}cleanupMessageServerState(){this.fileManager&&(this.fileManager.clearPendingFilesState(),this.fileManager=null),this.audioManager&&(this.audioManager.destroy(),this.audioManager=null)}emitError(a){this.callbacks?.onError?.(a)}toFileError(a,i,s,u){return kr(a,Za,i,{context:s,hint:u})}toRecordingError(a,i,s,u){return kr(a,ln,i,{context:s,hint:u})}assertConnection(a){if(!this.connection){const i=new qt("Connection not set. Please ensure the connection is established before calling this method.",{context:{stage:a}});throw this.emitError(i),i}return this.connection}}class er{static isAPIError(a){return a instanceof rt}static isNetworkError(a){return a instanceof rt&&(a.status===0||a.status===void 0)}static isTimeoutError(a){return a instanceof bp}static isAuthError(a){return a instanceof vp||a instanceof _p}static isClientError(a){return a instanceof rt&&a.status!==void 0&&a.status>=400&&a.status<500}static isServerError(a){return a instanceof rt&&a.status!==void 0&&a.status>=500}static getUserFriendlyMessage(a){return er.isNetworkError(a)?"Unable to connect to the server. Please check your internet connection.":er.isTimeoutError(a)?"Request timed out. Please try again.":er.isAuthError(a)?"Authentication failed. Please log in again.":er.isServerError(a)?"Server error occurred. Please try again later.":er.isAPIError(a)||a instanceof Error?a.message:"An unexpected error occurred."}static getErrorDetails(a){return er.isAPIError(a)?{type:a.name,message:a.message,code:a.code,status:a.status,timestamp:a.timestamp,stack:a.stack,context:a.context,hint:a.hint}:a instanceof Sn?{type:a.name,message:a.message,code:a.code,timestamp:a.timestamp,stack:a.stack,context:a.context,hint:a.hint}:a instanceof Error?{type:a.name,message:a.message,stack:a.stack}:{type:"Unknown",message:String(a)}}}class rS{connection=null;messageManager;resourceManager;sessionConfig=null;config;connectionType;constructor(a){this.config={...a,environment:a.environment||"production"},this.connectionType=a.connectionType||$n.SOCKET;const i=Ep(this.config?.environment).BASE_API_URL;this.resourceManager=new K_({agentId:this.config.agentId,serverUrl:i})}async startSession(a){try{const i=await this.manageSession(a);return await this.initializeConnection(i),this.setupEventHandlers(),i}catch(i){const s=er.getUserFriendlyMessage(i),u=er.getErrorDetails(i),l=this.toSessionError(i,s||"Failed to start session",{stage:"startSession",details:u},"Check network connectivity or refresh credentials before retrying.");throw this.emitError(l),l}}async sendMessage({message:a,files:i,audio:s,tool_declined:u,tool_id:l,initial_prompts:c}){if(!this.connection){const f=new qt("Connection not established. Session may not be initialized.",{context:{stage:"sendChatMessage"},hint:"Call startSession() and wait for connection before sending messages."});throw this.emitError(f),f}switch(this.connectionType){case $n.SOCKET:this.messageManager.sendSocketMessage({message:a,files:i,audio:s,...u&&{tool_declined:u},...l&&{tool_id:l},...c?.length&&{initial_prompts:c}});break;default:const f=new qt("Unsupported connection type",{context:{stage:"sendChatMessage",connectionType:this.connectionType}});throw this.emitError(f),f}}on(a,i){this.connection?.on(a,i)}off(a,i){this.connection?.off(a,i)}getSessionConfig(){if(!this.sessionConfig?.session_id||!this.sessionConfig?.session_token)throw new oi("Session ID or token not found",{context:{stage:"getSessionConfig"},hint:"Ensure the session API returns both identifiers."});return this.sessionConfig}async callTool(a,i){if(!this.connection){const s=new qt("Connection not established. Session may not be initialized.",{context:{stage:"callTool"},hint:"Call startSession() before attempting to call tool."});throw this.emitError(s),s}if(!this.sessionConfig?.session_id){const s=new oi("Session ID not found",{context:{stage:"callTool"},hint:"Call startSession() before attempting to call tool."});throw this.emitError(s),s}switch(this.connectionType){case $n.SOCKET:try{const u=await this.resourceManager.callTool(this.sessionConfig.session_id,a,i);if(u.err)throw new rt(u.err.msg,500,u.err);return u}catch(u){if(u instanceof rt&&u?.status===401)return await this.handleSessionExpiry(),await this.callTool(a,i);throw u}default:const s=new qt("Unsupported connection type",{context:{stage:"callTool",connectionType:this.connectionType}});throw this.emitError(s),s}}async startRecording({onChunks:a,onError:i}){if(!this.connection){const s=new qt("Connection not established. Session may not be initialized.",{context:{stage:"sendAudio"},hint:"Call startSession() before attempting to send audio."});throw this.emitError(s),s}switch(this.connectionType){case $n.SOCKET:try{await this.messageManager.startRecording({onChunks:a,onError:i})}catch(u){throw u}break;default:const s=new qt("Unsupported connection type",{context:{stage:"sendAudio",connectionType:this.connectionType}});throw this.emitError(s),s}}endRecording(){if(!this.connection){const a=new qt("Connection not established. Session may not be initialized.",{context:{stage:"endRecording"},hint:"Call startRecording() before attempting to stop recording."});throw this.emitError(a),a}switch(this.connectionType){case $n.SOCKET:this.messageManager.endRecordingWithSocket();break;default:const a=new qt("Unsupported connection type",{context:{stage:"endRecording",connectionType:this.connectionType}});throw this.emitError(a),a}}isConnected(){return this.connection?.isConnected()??!1}endSession(){this.connection&&(this.connection.close(),this.connection=null),this.messageManager&&this.messageManager.cleanupMessageServerState()}emitError(a){this.config.callbacks?.onError?.(a)}toSessionError(a,i,s,u){return kr(a,oi,i,{context:s,hint:u})}async initializeConnection(a){if(this.connection&&(this.connection.close(),this.connection=null),!a.session_id||!a.session_token)throw new oi("Session ID or token not found",{context:{stage:"initializeConnection"},hint:"Ensure the session API returns both identifiers."});this.sessionConfig=a;const i=Ep(this.config?.environment).WEBSOCKET_URL,s=(this.config.connectionType==="socket",$n.SOCKET);this.connection=await q_.createConnection(s,{serverUrl:i,auth:{sessionId:a.session_id,sessionToken:a.session_token},agentId:this.config.agentId,userId:this.config.userId,overrides:this.config.overrides}),this.messageManager=new nS(this.connection,this.config?.callbacks)}async manageSession(a){try{if(!a?.session_id)return this.createNewSession();const i=await this.resourceManager.validateSession(a.session_id);return i.active?a:i.expired?this.refreshSession(a.session_id,a.session_token):this.createNewSession()}catch(i){if(i instanceof rt){const s=i.status;if(s===404||s===500)return this.createNewSession()}throw this.toSessionError(i,"Failed to resolve session",{stage:"resolveSession"})}}async refreshSession(a,i){try{return await this.resourceManager.refreshSession(a,i)}catch(s){if(s instanceof rt){this.emitError(s);const u=s.status;if(u===404||u===500)return this.createNewSession()}throw this.toSessionError(s,"Failed to refresh session",{stage:"refreshSession",sessionId:a})}}async createNewSession(){return await this.resourceManager.createSession(this.config.userId||Date.now().toString())}setupEventHandlers(){if(this.connection){switch(this.connectionType){case $n.SOCKET:this.connection.onOpen(()=>{this.onSocketConnectionOpen()}),this.connection.onMessage(a=>{this.onIncomingSocketMessage(a)}),this.connection.onError(a=>{this.onSocketConnectionError(a)}),this.connection.on(Cp.SESSION_EXPIRED,()=>{this.handleSessionExpiry()});break;default:throw new qt("Unsupported connection type",{context:{stage:"setupEventHandlers",connectionType:this.connectionType},hint:"Use ConnectionType.SOCKET or provide a custom handler."})}this.connection.onDisconnect(a=>{this.messageManager.handleDisconnect(a)})}}onSocketConnectionError(a){this.connection?.emit(bt.ERROR,a);const i=this.toConnectionError(a,"WebSocket connection error",{stage:"onSocketConnectionError"},"Verify network connectivity or attempt to reconnect.");this.emitError(i)}onSocketConnectionOpen(){if(!this.sessionConfig?.session_token){const a=new oi("Session token not set. Call startSession() first.",{context:{stage:"onSocketConnectionOpen"},hint:"Ensure startSession() completes successfully before socket opens."});throw this.emitError(a),a}this.messageManager.sendSocketAuthMessage(this.sessionConfig.session_token)}onIncomingSocketMessage(a){switch(a.ev){case Yt.CHAT:this.messageManager.handleIncomingSocketChatMessage(a);break;case Yt.CONNECTION_ESTABLISHED:this.messageManager.handleConnectionEstablished();break;case Yt.STREAM:this.messageManager.handleIncomingSocketStreamMessage(a);break;case Yt.END_OF_STREAM:this.messageManager.handleIncomingSocketEndOfStreamMessage(a);break;case Yt.PING:this.messageManager.sendSocketPongMessage();break;case Yt.PONG:this.messageManager.sendSocketPingMessage();break;case Yt.SYNC:break;case Yt.ERROR:this.messageManager.handleIncomingSocketErrorMessage(a);break;default:const i=new Xa("Unsupported message type",{context:{stage:"onIncomingSocketMessage",event:a.ev??"unknown"},hint:"Ensure the server is sending supported socket events."});this.emitError(i);return}}async handleSessionExpiry(){try{if(this.endSession(),!this.sessionConfig?.session_id||!this.sessionConfig?.session_token){const i=new oi("Session ID or token not found",{context:{stage:"handleSessionExpiry"}});throw this.emitError(i),i}const a=await this.refreshSession(this.sessionConfig.session_id,this.sessionConfig.session_token);if(!a.session_id||!a.session_token)throw new oi("Session refresh failed",{context:{stage:"handleSessionExpiry"}});this.sessionConfig.session_id=a.session_id,this.sessionConfig.session_token=a.session_token,await this.initializeConnection(a),this.setupEventHandlers(),this.config.callbacks?.onSessionRefreshed?.(a)}catch(a){const i=this.toSessionError(a,"Session expired",{stage:"handleSessionExpiry"});this.emitError(i)}}toConnectionError(a,i,s,u){return kr(a,qt,i,{context:s,hint:u})}}function kp(){const[n,a]=$.useState(typeof navigator<"u"?navigator.onLine:!0);return $.useEffect(()=>{const i=()=>a(!0),s=()=>a(!1);return window.addEventListener("online",i),window.addEventListener("offline",s),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",s)}},[]),{isOnline:n}}const iS=({environment:n,userId:a,onInlineText:i})=>{const[s,u]=$.useState([]),[l,c]=$.useState(!1),[f,d]=$.useState(0),[h,y]=$.useState(!1),[b,_]=$.useState([]),m=$.useRef(null),C=$.useRef(null),{isOnline:S}=kp(),{agentId:x,setSessionId:w,setSessionToken:k,sessionId:N,sessionToken:j,setError:D,setConnectionStatus:M,setShowRetryButton:L,setStartNewConnection:V,setIsStreaming:F,setIsWaitingForResponse:W,isStreaming:oe,initialMessage:R,isWaitingForResponse:Q,setProgressMessage:E,setRecordingStatus:G,clearSession:J,addMessageToSession:K,getMessagesForSession:ue,updateMessageInSession:re,setInitialMessage:q}=si();$.useEffect(()=>{S?h?I()&&(M(_n.CONNECTED),te()):M(_n.CONNECTING):M(_n.NOT_CONNECTED)},[S,h]),$.useEffect(()=>{if(N){const g=ue(N)||[];u(g),_([])}},[N]),$.useEffect(()=>{if(y(!1),!x){console.warn("useChat: Agent ID is required but not provided");return}const g=new rS({agentId:x,environment:n,userId:a,callbacks:{onError:Y=>{if(console.error("useChat: Error thrown from SDK",Y),Y instanceof Sn)switch(Y.code){case Jn.SESSION:M(_n.NOT_CONNECTED),L(!0);break;case Jn.RECORDING:D({title:"Recording failed",description:Y?.displayMessage||"Please try again later"});break;default:console.error("useChat: Error from SDK",Y.code),D({title:"Something went wrong",description:"Please try again later"}),L(!0);break}},onSessionRefreshed:Y=>{Y?.session_id&&Y?.session_token&&(w(Y.session_id),k(Y.session_token))}}});return m.current=g,y(!0),()=>{y(!1),m.current?.endSession(),m.current=null,C.current&&(clearTimeout(C.current),C.current=null)}},[x,n,a]),$.useEffect(()=>{const g=s[s.length-1];!g?.role||!N||(g?.role===Un.USER?K(N,g):!oe&&!g.isStored&&(u(Y=>{const Z=[...Y];return Z[Z.length-1]={...g,isStored:!0},Z}),K(N,{...g,isStored:!0})))},[s,oe]),$.useEffect(()=>{const g=s[s.length-1];return()=>{g&&!g?.isStored&&N&&K(N,{...g,isStored:!0})}},[]),$.useEffect(()=>(C.current&&(clearTimeout(C.current),C.current=null),Q&&!oe?C.current=setTimeout(()=>{W(!1),C.current=null},3e4):oe&&C.current&&(clearTimeout(C.current),C.current=null),()=>{C.current&&(clearTimeout(C.current),C.current=null)}),[Q,oe,W]);const z=async(g=!1)=>{try{if(!m.current){console.error("SynapseSDK instance not initialized. Make sure agentId is set."),D({title:"SDK not initialized",description:"Please ensure agentId is configured"}),c(!1);return}c(!0);let Y;g?(await J(),te(),Y=await m.current.startSession()):Y=await m.current.startSession({session_id:N||"",session_token:j||""}),Y?.session_id&&Y?.session_token?(w(Y.session_id),k(Y.session_token),Y?.initial_message?.text&&Y?.initial_message?.suggestions?.length&&q(Y.initial_message)):console.warn("useChat: Session response missing session_id or session_token",Y),ae()}catch(Y){console.error("useChat: Error starting session",Y),D({title:"Something Went wrong!",description:"Please try again later."}),c(!1);return}finally{c(!1)}},I=()=>m.current?.isConnected()??!1,B=()=>{console.log("called end session"),m.current?.endSession()},te=()=>{d(0),L(!1),V(!1),D(null)},ae=()=>{m.current?.on(bt.MESSAGE_CHUNK,g=>{const Y=g;if(Y.data?.text&&Y.messageId){oe||(W(!1),F(!0));const Z=Y.data.text,A=Y.messageId,T=Y.timestamp;u(U=>{const ee=U[U.length-1];if(ee&&ee.id===A&&ee.role===Un.ASSISTANT){const se=[...U];return se[se.length-1]={...ee,content:ee.content+Z},se}else return[...U,{id:A,content:Z,role:Un.ASSISTANT,timestamp:Ra(T??Date.now()),isStored:!1}]})}else console.warn("Condition failed - missing text or messageId",{hasText:!!Y.data?.text,hasMessageId:!!Y.messageId})}),m.current?.on(bt.END_OF_STREAM,()=>{F(!1),E(null)}),m.current?.on(bt.CONNECTED,()=>{te(),M(_n.CONNECTED)}),m.current?.on(bt.TOOL_CALL,g=>{const Y=g;if(!Y?.messageId||!Y?.data||!Y?.data?.details?.component){console.warn("Tool escalation event missing messageId or data",Y);return}const Z=Y.messageId,A=Y.timestamp??Date.now();u(T=>{const U=T[T.length-1];if(U.id===Z&&U.role===Un.ASSISTANT){const ee=[...T],se={...U,toolEscalationData:{...Y.data,isResponded:!1},isResponseFromTool:!0};return ee[T.length-1]=se,re(N,Z,se),ee}else{const ee={id:Z,content:Y.data?.text||"",role:Un.ASSISTANT,toolEscalationData:{...Y.data,isResponded:!1},isResponseFromTool:!0,timestamp:Ra(A),isStored:!1};return[...T,ee]}})}),m.current?.on(bt.DISCONNECTED,g=>{console.log("disconnect details",g,f),M(_n.NOT_CONNECTED),f<2?(console.log("retry attempt",f),d(Y=>Y+1),L(!0)):(console.log("set start new connection"),V(!0))}),m.current?.on(bt.ERROR,g=>{console.error("error",g),L(!0)}),m.current?.on(bt.INLINE_TEXT,g=>{const Y=g;Y?.data?.text&&i&&(G(Kt.IDLE),i?.(Y.data.text)),F(!1),W(!1),E(null)}),m.current?.on(bt.PROGRESS_MESSAGE,g=>{const Y=g;Y.data?.text&&(W(!1),E(Y.data.text))})},xe=async({message:g,messageId:Y,files:Z,audio:A,toolCalled:T})=>{if(!I()||Z&&Z.length<0&&g?.trim()===""&&!A?.audio)return;D(null);const U=s.length==2&&b.length==2?b:null;if(g||Z&&Z.length>0||A?.audio){const ee=s.length-1,se=ee>=0?s[ee]:null,X=se?se?.isResponseFromTool||se.role===Un.ASSISTANT&&se.toolEscalationData:null;await m.current?.sendMessage({message:g,files:Z,audio:A,...U&&{initial_prompts:U},...X&&!T?{tool_declined:!0,tool_id:se?.toolEscalationData?.tool_id||""}:{}}),u(ce=>{const pe=[...ce],de=pe.length-1;return X&&de>=0&&pe[de].toolEscalationData&&(pe[de]={...pe[de],toolEscalationData:{...pe[de].toolEscalationData,tool_id:null,isResponded:!0}},re(N,pe[ee].id||Date.now().toString(),pe[ee])),[...pe,{id:Y||Date.now().toString(),content:g||"",files:Z||[],role:Un.USER,timestamp:Ra(Date.now()),isStored:!0}]}),W(!0)}};return{sendMessage:xe,startSession:z,incomingMessages:s,loading:l,endSession:B,isReady:h,startRecording:async()=>{if(!I())throw new Error("Not connected to the server");try{await m.current?.startRecording({onChunks:async g=>{G(Kt.PROCESSING),await xe({audio:g}),G(Kt.TRANSCRIBING)},onError(g){G(Kt.IDLE),console.error("error",g)}}),G(Kt.LISTENING)}catch(g){throw G(Kt.IDLE),g}},stopRecording:()=>{I()&&m.current?.endRecording()},handleRetry:async()=>{if(!I())te(),await z(!1);else{const g=s[s.length-1];g&&g.role===Un.USER&&m.current?.sendMessage({message:g.content,files:g.files||[],messageId:g.id})}},isValidFile:g=>{const Y=g.type.toLowerCase(),A=g.name.toLowerCase().split(".").pop()||"";return Y&&["application/pdf","image/jpeg","image/jpg","image/png","image/heic","image/heif","application/vnd.openxmlformats-officedocument.wordprocessingml.document","image/tiff","text/plain","text/markdown"].some(U=>Y.includes(U))?!0:!Y||Y===""?["pdf","jpg","jpeg","png","heic","docx","tiff","txt","md"].includes(A):!1},handleStartNewConnection:async()=>{te(),await J(),await z(!0)},callTool:async(g,Y)=>{try{if(!I())throw new Error("Not connected to the server");const Z=await m.current?.callTool(g,Y);if(!Z)throw new Error("Failed to call tool");return Z}catch(Z){throw Z}},handleInitialTaskClick:async g=>{if(!R?.suggestions.length||!g)return;const Y=R.suggestions.find(Z=>Z.value===g);if(!Y||!Y.response){await xe({message:g});return}u(Z=>[...Z,{id:Date.now().toString(),content:g,role:Un.USER,timestamp:Ra(Date.now()),isStored:!0}]),W(!0),await C1(1e3),W(!1),u(Z=>[...Z,{id:Date.now().toString(),content:Y.response||"Please try again",role:Un.ASSISTANT,timestamp:Ra(Date.now()),isStored:!1}]),_([{role:"user",text:g},{role:"assistant",text:Y.response}])}}},aS=$.lazy(()=>Promise.resolve().then(()=>G2)),sS=$.lazy(()=>Promise.resolve().then(()=>Z2)),oS=$.lazy(()=>Promise.resolve().then(()=>K2).then(n=>({default:n.ConnectionStatus})));function lS({isOpen:n,agentId:a,config:i}){const[s,u]=$.useState(""),[l,c]=$.useState(!1),[f,d]=$.useState(!1),[h,y]=$.useState([]),b=$.useRef(!1),_=$.useRef(null),m=$.useRef(null),[C,S]=$.useState(!1),x=$.useRef(0),{setAgentId:w,startNewConnection:k,showRetryButton:N,clearError:j,error:D,connectionStatus:M,recordingStatus:L,isWaitingForResponse:V,isStreaming:F,setError:W,initialMessage:oe}=si(),{incomingMessages:R,loading:Q,sendMessage:E,startSession:G,isReady:J,startRecording:K,stopRecording:ue,handleRetry:re,handleStartNewConnection:q,isValidFile:z,callTool:I,handleInitialTaskClick:B}=iS({environment:"production",onInlineText:A=>{u(T=>T+A)}});$.useEffect(()=>{if(!a){console.error("Agent ID is required");return}w(a),n&&J&&!b.current&&(b.current=!0,G(!1))},[n,J,a]);const te=()=>_.current?.querySelector("[data-radix-scroll-area-viewport]")||null,ae=()=>{const A=te();A&&(A.scrollTo({top:A.scrollHeight,behavior:"smooth"}),S(!1))},xe=()=>{const A=te();return A?A.scrollHeight-A.scrollTop-A.clientHeight<50:!0};$.useEffect(()=>{R.length>x.current&&(setTimeout(()=>{ae()},100),x.current=R.length)},[R.length]),$.useEffect(()=>{const A=te();if(!A)return;const T=()=>{S(!xe())},U=()=>{T()},ee=new MutationObserver(()=>{T()});return ee.observe(A,{childList:!0,subtree:!0}),A.addEventListener("scroll",U),T(),()=>{ee.disconnect(),A.removeEventListener("scroll",U)}},[R.length]);const Te=R.length>0,Ce=M===_n.CONNECTED,ke=Q||!Ce||V||F,je=Q||!Ce,_e=$.useMemo(()=>L===Kt.IDLE?null:L===Kt.LISTENING?"Listening...":L===Kt.PROCESSING?"Processing...":L===Kt.TRANSCRIBING?"Transcribing...":null,[L]),Re=je?"Connecting...":_e||(V||F?"Please wait for the response...":"Ask me anything…"),Ne=async()=>{if(!ke&&(s.trim()||l||f)){const A=Date.now().toString();h.length>0?(await E({files:h,message:s.trim(),messageId:A}),y([]),d(!1)):s.trim()&&await E({message:s,messageId:A}),u(""),c(!1),d(!1),setTimeout(()=>{ae()},100)}},g=async A=>{A&&await B(A)},Y=A=>{if(A&&A.length>0){const T=A.filter(U=>z(U)?!0:(W({title:`File type not supported: ${U.name}`,description:"Only PDF, images (JPG, JPEG, PNG, HEIC), documents (DOCX, TIFF), and text files (TXT, MD) are allowed."}),!1));if(T?.length>0)A=T;else return}y(T=>(d((T?.length??0)+(A?.length??0)>0),[...T,...A]))},Z=async()=>{if(l)await ue(),c(!1);else{if(ke)return;try{await K(),c(!0)}catch{console.log("error from catch")}}};return H.jsx(M_,{isOpen:n,onClose:i.onClose,title:i.title,iconUrl:i.iconUrl,onStartNewSession:()=>G(!0),chatComposer:{value:s,onChange:u,onSend:Ne,onFileChange:Y,onRecording:Z,isRecording:l,hasAttachment:f,attachmentFiles:h,isDisabled:ke,placeholder:Re,recordingStatus:L},children:!Q&&H.jsx($.Suspense,{fallback:H.jsx(uS,{}),children:H.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-white backdrop-blur-2xl relative",children:[H.jsx(ah,{ref:_,className:"flex-1 min-h-0",children:H.jsxs("div",{className:Ze("transition-all duration-300",Te?"p-4 space-y-3":"p-6 space-y-6"),children:[!Te&&oe?.text?H.jsx(sS,{tasks:oe.suggestions,initialPrompt:oe.text,onTaskClick:g,disabled:ke}):H.jsx(aS,{messages:R,onSendMessage:E,iconUrl:i.iconUrl,callTool:I}),H.jsx("div",{ref:m})]})}),C&&H.jsx("div",{className:"absolute bottom-20 left-1/2 transform -translate-x-1/2 z-10",children:H.jsx(Ot,{onClick:ae,size:"icon",className:"h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-lg border border-lavender-200/60 hover:bg-white hover:shadow-xl transition-all duration-200",children:H.jsx(Ql,{className:"w-5 h-5 text-slate-700"})})}),H.jsx(oS,{className:"mt-2",onRetry:re,onStartNewSession:q,showRetryButton:N,startNewConnection:k,clearError:j,error:D,isConnected:Ce})]})})})}function uS(){return H.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-white backdrop-blur-2xl animate-pulse",children:[H.jsxs("div",{className:"flex-1 p-6 space-y-4",children:[H.jsx("div",{className:"h-16 bg-gray-100 rounded-2xl"}),H.jsx("div",{className:"h-16 bg-gray-100 rounded-2xl"}),H.jsx("div",{className:"h-16 bg-gray-100 rounded-2xl"})]}),H.jsx("div",{className:"h-24 border-t border-gray-100 bg-gray-50"})]})}function cS({agentId:n,config:a}){const[i,s]=$.useState(!1);$.useEffect(()=>{s(!0)},[]);const u=()=>{s(!1),a?.onClose?.()};return H.jsx(lS,{isOpen:i,agentId:n,config:{...a,environment:a.environment??"production",onClose:u,title:a.title??"Medi Clinic"}})}const Tp=(n,a,i)=>{cv.createRoot(n).render(H.jsx($.StrictMode,{children:H.jsx(cS,{agentId:a,config:i||{}})}))};typeof window<"u"&&(window.renderMedAssist=Tp);const Ap=$.forwardRef(({className:n,...a},i)=>H.jsx("textarea",{className:Ze("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:i,...a}));Ap.displayName="Textarea";function fS({value:n,onChange:a,onSend:i,onFileChange:s,onRecording:u,isRecording:l,hasAttachment:c,attachmentFiles:f,isDisabled:d,placeholder:h,isMobile:y,recordingStatus:b}){const _=$.useRef(null),m=$.useRef(null),C=n.trim().length>0||c,S=(d||b!==Kt.IDLE)&&!l,x=Ze("rounded-full transition-all duration-200 ",l?"bg-gradient-to-r from-rose-400 via-lavender-500 to-indigo-500 text-white ring-2 ring-white/60 animate-pulse shadow-[0_0_20px_rgba(139,92,246,0.45)]":S?"text-lavender-300 cursor-not-allowed shadow-none":"text-lavender-600 hover:bg-gray-100"),w=M=>{const L=Array.from(M.target.files||[]);L.length>0&&s(L)},k=()=>{d||_.current?.click()},N=M=>{M.key==="Enter"&&!M.shiftKey&&C&&!d&&(M.preventDefault(),i())},j=M=>{M.style.height="auto",M.style.overflow="hidden";const L=M.scrollHeight,V=40,F=120,W=Math.max(V,Math.min(L,F));M.style.height=W+"px",L>F?M.style.overflow="auto":M.style.overflow="hidden"},D=M=>{j(M.currentTarget)};return $.useEffect(()=>{m.current&&j(m.current)},[n]),$.useEffect(()=>{!d&&!y&&m.current?.focus()},[d]),H.jsxs("div",{className:"border-t border-white/20 bg-white/70 backdrop-blur-xl p-4",children:[H.jsx("input",{ref:_,type:"file",multiple:!0,accept:"image/jpeg, image/png, image/jpg, image/tiff, application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/plain, text/markdown, image/heif, image/heic",className:"hidden",onChange:w,disabled:d,title:"Attach file","aria-label":"Attach file"}),H.jsxs("div",{className:Ze("flex items-center gap-2 bg-white/70 backdrop-blur rounded-xl px-4 py-2 shadow-md focus-within:border-lavender-100/50 focus-within:ring-2 focus-within:ring-lavender-400/50 transition-all",l||c?"ring-2 ring-lavender-200/40":"ring-2 ring-lavender-300/40 backdrop-blur-xl",d&&"opacity-60"),children:[c&&f.length>0&&H.jsxs("span",{className:"text-xs text-lavender-600 mr-2",children:[f.length," file(s)"]}),H.jsx(Ap,{ref:m,onInput:D,placeholder:h,value:n,onChange:M=>a(M.target.value),rows:1,maxLength:1e3,autoFocus:!d,style:{wordBreak:"break-word",overflowWrap:"anywhere",minHeight:"40px",maxHeight:"120px",fontSize:window.innerWidth<=768?"16px":"14px"},onKeyPress:N,disabled:d,title:"Enter your message",className:"flex-1 border-0 outline-none focus-visible:ring-0 focus-visible:ring-offset-0 text-sm !placeholder:text-gray-400 bg-transparent disabled:cursor-not-allowed rounded-none break-words overflow-wrap-anywhere whitespace-pre-wrap"}),H.jsx(Ot,{type:"button",variant:"ghost",size:"icon",onClick:k,disabled:d,className:`rounded-full transition-all ${c?"bg-lavender-200/30 text-lavender-600 hover:bg-lavender-200/40":"hover:bg-gray-100 text-lavender-600 hover:text-gray-700"}`,title:"Attach file",children:H.jsx(K1,{className:"w-5 h-5"})}),l?H.jsx(Ot,{type:"button",variant:"ghost",size:"icon",onClick:u,className:"rounded-full bg-gradient-to-r from-red-400 to-rose-500 text-white hover:from-red-500 hover:to-rose-600 shadow-lg transition-all duration-200 hover:scale-105 active:scale-95",title:"Stop recording",children:H.jsx(W1,{className:"w-4 h-4"})}):H.jsx(Ot,{type:"button",variant:"ghost",size:"icon",onClick:u,disabled:S,className:x,title:"Start recording",children:H.jsx(X1,{className:"w-5 h-5"})}),C&&!d&&H.jsx(Ot,{type:"button",size:"icon",onClick:i,className:"h-10 w-10 bg-gradient-to-r from-lavender-400 to-lavender-500 hover:from-lavender-500 hover:to-lavender-600 rounded-full text-white transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95",children:H.jsx(Q1,{className:"w-4 h-4"})})]})]})}const dS=Object.freeze(Object.defineProperty({__proto__:null,default:fS},Symbol.toStringTag,{value:"Module"}));function NT(){}function OT(){}function hS(n,a){const i={};return(n[n.length-1]===""?[...n,""]:n).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const pS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gS={};function Rp(n,a){return(gS.jsx?mS:pS).test(n)}const yS=/[ \t\n\f\r]/g;function bS(n){return typeof n=="object"?n.type==="text"?Np(n.value):!1:Np(n)}function Np(n){return n.replace(yS,"")===""}class Ka{constructor(a,i,s){this.normal=i,this.property=a,s&&(this.space=s)}}Ka.prototype.normal={},Ka.prototype.property={},Ka.prototype.space=void 0;function Op(n,a){const i={},s={};for(const u of n)Object.assign(i,u.property),Object.assign(s,u.normal);return new Ka(i,s,a)}function hu(n){return n.toLowerCase()}class Qt{constructor(a,i){this.attribute=i,this.property=a}}Qt.prototype.attribute="",Qt.prototype.booleanish=!1,Qt.prototype.boolean=!1,Qt.prototype.commaOrSpaceSeparated=!1,Qt.prototype.commaSeparated=!1,Qt.prototype.defined=!1,Qt.prototype.mustUseProperty=!1,Qt.prototype.number=!1,Qt.prototype.overloadedBoolean=!1,Qt.prototype.property="",Qt.prototype.spaceSeparated=!1,Qt.prototype.space=void 0;let vS=0;const Ve=ui(),Ct=ui(),pu=ui(),Ae=ui(),ht=ui(),Ii=ui(),cn=ui();function ui(){return 2**++vS}const mu=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Ct,commaOrSpaceSeparated:cn,commaSeparated:Ii,number:Ae,overloadedBoolean:pu,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),gu=Object.keys(mu);class yu extends Qt{constructor(a,i,s,u){let l=-1;if(super(a,i),zp(this,"space",u),typeof s=="number")for(;++l<gu.length;){const c=gu[l];zp(this,gu[l],(s&mu[c])===mu[c])}}}yu.prototype.defined=!0;function zp(n,a,i){i&&(n[a]=i)}function ji(n){const a={},i={};for(const[s,u]of Object.entries(n.properties)){const l=new yu(s,n.transform(n.attributes||{},s),u,n.space);n.mustUseProperty&&n.mustUseProperty.includes(s)&&(l.mustUseProperty=!0),a[s]=l,i[hu(s)]=s,i[hu(l.attribute)]=s}return new Ka(a,i,n.space)}const Mp=ji({properties:{ariaActiveDescendant:null,ariaAtomic:Ct,ariaAutoComplete:null,ariaBusy:Ct,ariaChecked:Ct,ariaColCount:Ae,ariaColIndex:Ae,ariaColSpan:Ae,ariaControls:ht,ariaCurrent:null,ariaDescribedBy:ht,ariaDetails:null,ariaDisabled:Ct,ariaDropEffect:ht,ariaErrorMessage:null,ariaExpanded:Ct,ariaFlowTo:ht,ariaGrabbed:Ct,ariaHasPopup:null,ariaHidden:Ct,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ht,ariaLevel:Ae,ariaLive:null,ariaModal:Ct,ariaMultiLine:Ct,ariaMultiSelectable:Ct,ariaOrientation:null,ariaOwns:ht,ariaPlaceholder:null,ariaPosInSet:Ae,ariaPressed:Ct,ariaReadOnly:Ct,ariaRelevant:null,ariaRequired:Ct,ariaRoleDescription:ht,ariaRowCount:Ae,ariaRowIndex:Ae,ariaRowSpan:Ae,ariaSelected:Ct,ariaSetSize:Ae,ariaSort:null,ariaValueMax:Ae,ariaValueMin:Ae,ariaValueNow:Ae,ariaValueText:null,role:null},transform(n,a){return a==="role"?a:"aria-"+a.slice(4).toLowerCase()}});function Dp(n,a){return a in n?n[a]:a}function Ip(n,a){return Dp(n,a.toLowerCase())}const _S=ji({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ii,acceptCharset:ht,accessKey:ht,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:ht,autoFocus:Ve,autoPlay:Ve,blocking:ht,capture:null,charSet:null,checked:Ve,cite:null,className:ht,cols:Ae,colSpan:null,content:null,contentEditable:Ct,controls:Ve,controlsList:ht,coords:Ae|Ii,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:pu,draggable:Ct,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:ht,height:Ae,hidden:pu,high:Ae,href:null,hrefLang:null,htmlFor:ht,httpEquiv:ht,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:ht,itemRef:ht,itemScope:Ve,itemType:ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:Ae,manifest:null,max:null,maxLength:Ae,media:null,method:null,min:null,minLength:Ae,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ve,optimum:Ae,pattern:null,ping:ht,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:ht,required:Ve,reversed:Ve,rows:Ae,rowSpan:Ae,sandbox:ht,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:Ae,sizes:null,slot:null,span:Ae,spellCheck:Ct,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ae,step:null,style:null,tabIndex:Ae,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Ct,width:Ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ht,axis:null,background:null,bgColor:null,border:Ae,borderColor:null,bottomMargin:Ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:Ae,leftMargin:Ae,link:null,longDesc:null,lowSrc:null,marginHeight:Ae,marginWidth:Ae,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:Ae,rules:null,scheme:null,scrolling:Ct,standby:null,summary:null,text:null,topMargin:Ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:Ae,security:null,unselectable:null},space:"html",transform:Ip}),SS=ji({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:cn,accentHeight:Ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ae,amplitude:Ae,arabicForm:null,ascent:Ae,attributeName:null,attributeType:null,azimuth:Ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ae,by:null,calcMode:null,capHeight:Ae,className:ht,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ae,diffuseConstant:Ae,direction:null,display:null,dur:null,divisor:Ae,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ae,enableBackground:null,end:null,event:null,exponent:Ae,externalResourcesRequired:null,fill:null,fillOpacity:Ae,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ii,g2:Ii,glyphName:Ii,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ae,horizOriginX:Ae,horizOriginY:Ae,id:null,ideographic:Ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ae,k:Ae,k1:Ae,k2:Ae,k3:Ae,k4:Ae,kernelMatrix:cn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ae,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ae,overlineThickness:Ae,paintOrder:null,panose1:null,path:null,pathLength:Ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ae,pointsAtY:Ae,pointsAtZ:Ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cn,rev:cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cn,requiredFeatures:cn,requiredFonts:cn,requiredFormats:cn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ae,specularExponent:Ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ae,strikethroughThickness:Ae,string:null,stroke:null,strokeDashArray:cn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ae,strokeOpacity:Ae,strokeWidth:null,style:null,surfaceScale:Ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cn,tabIndex:Ae,tableValues:null,target:null,targetX:Ae,targetY:Ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ae,underlineThickness:Ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ae,values:null,vAlphabetic:Ae,vMathematical:Ae,vectorEffect:null,vHanging:Ae,vIdeographic:Ae,version:null,vertAdvY:Ae,vertOriginX:Ae,vertOriginY:Ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Dp}),jp=ji({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,a){return"xlink:"+a.slice(5).toLowerCase()}}),Lp=ji({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ip}),Bp=ji({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,a){return"xml:"+a.slice(3).toLowerCase()}}),ES={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},wS=/[A-Z]/g,Up=/-[a-z]/g,xS=/^data[-\w.:]+$/i;function CS(n,a){const i=hu(a);let s=a,u=Qt;if(i in n.normal)return n.property[n.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&xS.test(a)){if(a.charAt(4)==="-"){const l=a.slice(5).replace(Up,TS);s="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=a.slice(4);if(!Up.test(l)){let c=l.replace(wS,kS);c.charAt(0)!=="-"&&(c="-"+c),a="data"+c}}u=yu}return new u(s,a)}function kS(n){return"-"+n.toLowerCase()}function TS(n){return n.charAt(1).toUpperCase()}const AS=Op([Mp,_S,jp,Lp,Bp],"html"),bu=Op([Mp,SS,jp,Lp,Bp],"svg");function RS(n){return n.join(" ").trim()}var Li={},vu,Fp;function NS(){if(Fp)return vu;Fp=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,a=/\n/g,i=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,d=`
|
|
45
|
-
`,h="/",y="*",b="",_="comment",m="declaration";function C(x,w){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];w=w||{};var k=1,N=1;function j(E){var G=E.match(a);G&&(k+=G.length);var J=E.lastIndexOf(d);N=~J?E.length-J:N+E.length}function D(){var E={line:k,column:N};return function(G){return G.position=new M(E),F(),G}}function M(E){this.start=E,this.end={line:k,column:N},this.source=w.source}M.prototype.content=x;function L(E){var G=new Error(w.source+":"+k+":"+N+": "+E);if(G.reason=E,G.filename=w.source,G.line=k,G.column=N,G.source=x,!w.silent)throw G}function V(E){var G=E.exec(x);if(G){var J=G[0];return j(J),x=x.slice(J.length),G}}function F(){V(i)}function W(E){var G;for(E=E||[];G=oe();)G!==!1&&E.push(G);return E}function oe(){var E=D();if(!(h!=x.charAt(0)||y!=x.charAt(1))){for(var G=2;b!=x.charAt(G)&&(y!=x.charAt(G)||h!=x.charAt(G+1));)++G;if(G+=2,b===x.charAt(G-1))return L("End of comment missing");var J=x.slice(2,G-2);return N+=2,j(J),x=x.slice(G),N+=2,E({type:_,comment:J})}}function R(){var E=D(),G=V(s);if(G){if(oe(),!V(u))return L("property missing ':'");var J=V(l),K=E({type:m,property:S(G[0].replace(n,b)),value:J?S(J[0].replace(n,b)):b});return V(c),K}}function Q(){var E=[];W(E);for(var G;G=R();)G!==!1&&(E.push(G),W(E));return E}return F(),Q()}function S(x){return x?x.replace(f,b):b}return vu=C,vu}var Pp;function OS(){if(Pp)return Li;Pp=1;var n=Li&&Li.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=i;const a=n(NS());function i(s,u){let l=null;if(!s||typeof s!="string")return l;const c=(0,a.default)(s),f=typeof u=="function";return c.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:y}=d;f?u(h,y,d):y&&(l=l||{},l[h]=y)}),l}return Li}var Qa={},Hp;function zS(){if(Hp)return Qa;Hp=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,a=/-([a-z])/g,i=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,l=function(h){return!h||i.test(h)||n.test(h)},c=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},d=function(h,y){return y===void 0&&(y={}),l(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(u,f):h=h.replace(s,f),h.replace(a,c))};return Qa.camelCase=d,Qa}var Wa,qp;function MS(){if(qp)return Wa;qp=1;var n=Wa&&Wa.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},a=n(OS()),i=zS();function s(u,l){var c={};return!u||typeof u!="string"||(0,a.default)(u,function(f,d){f&&d&&(c[(0,i.camelCase)(f,l)]=d)}),c}return s.default=s,Wa=s,Wa}var DS=MS();const IS=Ws(DS),Gp=Vp("end"),_u=Vp("start");function Vp(n){return a;function a(i){const s=i&&i.position&&i.position[n]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function jS(n){const a=_u(n),i=Gp(n);if(a&&i)return{start:a,end:i}}function Ja(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Yp(n.position):"start"in n||"end"in n?Yp(n):"line"in n||"column"in n?Su(n):""}function Su(n){return Zp(n&&n.line)+":"+Zp(n&&n.column)}function Yp(n){return Su(n&&n.start)+"-"+Su(n&&n.end)}function Zp(n){return n&&typeof n=="number"?n:1}class Gt extends Error{constructor(a,i,s){super(),typeof i=="string"&&(s=i,i=void 0);let u="",l={},c=!1;if(i&&("line"in i&&"column"in i?l={place:i}:"start"in i&&"end"in i?l={place:i}:"type"in i?l={ancestors:[i],place:i.position}:l={...i}),typeof a=="string"?u=a:!l.cause&&a&&(c=!0,u=a.message,l.cause=a),!l.ruleId&&!l.source&&typeof s=="string"){const d=s.indexOf(":");d===-1?l.ruleId=s:(l.source=s.slice(0,d),l.ruleId=s.slice(d+1))}if(!l.place&&l.ancestors&&l.ancestors){const d=l.ancestors[l.ancestors.length-1];d&&(l.place=d.position)}const f=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=f?f.line:void 0,this.name=Ja(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=c&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Gt.prototype.file="",Gt.prototype.name="",Gt.prototype.reason="",Gt.prototype.message="",Gt.prototype.stack="",Gt.prototype.column=void 0,Gt.prototype.line=void 0,Gt.prototype.ancestors=void 0,Gt.prototype.cause=void 0,Gt.prototype.fatal=void 0,Gt.prototype.place=void 0,Gt.prototype.ruleId=void 0,Gt.prototype.source=void 0;const Eu={}.hasOwnProperty,LS=new Map,BS=/[A-Z]/g,US=new Set(["table","tbody","thead","tfoot","tr"]),FS=new Set(["td","th"]),Xp="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PS(n,a){if(!a||a.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=a.filePath||void 0;let s;if(a.development){if(typeof a.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=KS(i,a.jsxDEV)}else{if(typeof a.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof a.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=XS(i,a.jsx,a.jsxs)}const u={Fragment:a.Fragment,ancestors:[],components:a.components||{},create:s,elementAttributeNameCase:a.elementAttributeNameCase||"react",evaluater:a.createEvaluater?a.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:a.ignoreInvalidStyle||!1,passKeys:a.passKeys!==!1,passNode:a.passNode||!1,schema:a.space==="svg"?bu:AS,stylePropertyNameCase:a.stylePropertyNameCase||"dom",tableCellAlignToStyle:a.tableCellAlignToStyle!==!1},l=Kp(u,n,void 0);return l&&typeof l!="string"?l:u.create(n,u.Fragment,{children:l||void 0},void 0)}function Kp(n,a,i){if(a.type==="element")return HS(n,a,i);if(a.type==="mdxFlowExpression"||a.type==="mdxTextExpression")return qS(n,a);if(a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement")return VS(n,a,i);if(a.type==="mdxjsEsm")return GS(n,a);if(a.type==="root")return YS(n,a,i);if(a.type==="text")return ZS(n,a)}function HS(n,a,i){const s=n.schema;let u=s;a.tagName.toLowerCase()==="svg"&&s.space==="html"&&(u=bu,n.schema=u),n.ancestors.push(a);const l=Wp(n,a.tagName,!1),c=QS(n,a);let f=xu(n,a);return US.has(a.tagName)&&(f=f.filter(function(d){return typeof d=="string"?!bS(d):!0})),Qp(n,c,l,a),wu(c,f),n.ancestors.pop(),n.schema=s,n.create(a,l,c,i)}function qS(n,a){if(a.data&&a.data.estree&&n.evaluater){const s=a.data.estree.body[0];return s.type,n.evaluater.evaluateExpression(s.expression)}$a(n,a.position)}function GS(n,a){if(a.data&&a.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(a.data.estree);$a(n,a.position)}function VS(n,a,i){const s=n.schema;let u=s;a.name==="svg"&&s.space==="html"&&(u=bu,n.schema=u),n.ancestors.push(a);const l=a.name===null?n.Fragment:Wp(n,a.name,!0),c=WS(n,a),f=xu(n,a);return Qp(n,c,l,a),wu(c,f),n.ancestors.pop(),n.schema=s,n.create(a,l,c,i)}function YS(n,a,i){const s={};return wu(s,xu(n,a)),n.create(a,n.Fragment,s,i)}function ZS(n,a){return a.value}function Qp(n,a,i,s){typeof i!="string"&&i!==n.Fragment&&n.passNode&&(a.node=s)}function wu(n,a){if(a.length>0){const i=a.length>1?a:a[0];i&&(n.children=i)}}function XS(n,a,i){return s;function s(u,l,c,f){const h=Array.isArray(c.children)?i:a;return f?h(l,c,f):h(l,c)}}function KS(n,a){return i;function i(s,u,l,c){const f=Array.isArray(l.children),d=_u(s);return a(u,l,c,f,{columnNumber:d?d.column-1:void 0,fileName:n,lineNumber:d?d.line:void 0},void 0)}}function QS(n,a){const i={};let s,u;for(u in a.properties)if(u!=="children"&&Eu.call(a.properties,u)){const l=JS(n,u,a.properties[u]);if(l){const[c,f]=l;n.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&FS.has(a.tagName)?s=f:i[c]=f}}if(s){const l=i.style||(i.style={});l[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return i}function WS(n,a){const i={};for(const s of a.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&n.evaluater){const l=s.data.estree.body[0];l.type;const c=l.expression;c.type;const f=c.properties[0];f.type,Object.assign(i,n.evaluater.evaluateExpression(f.argument))}else $a(n,a.position);else{const u=s.name;let l;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&n.evaluater){const f=s.value.data.estree.body[0];f.type,l=n.evaluater.evaluateExpression(f.expression)}else $a(n,a.position);else l=s.value===null?!0:s.value;i[u]=l}return i}function xu(n,a){const i=[];let s=-1;const u=n.passKeys?new Map:LS;for(;++s<a.children.length;){const l=a.children[s];let c;if(n.passKeys){const d=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(d){const h=u.get(d)||0;c=d+"-"+h,u.set(d,h+1)}}const f=Kp(n,l,c);f!==void 0&&i.push(f)}return i}function JS(n,a,i){const s=CS(n.schema,a);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=s.commaSeparated?hS(i):RS(i)),s.property==="style"){let u=typeof i=="object"?i:$S(n,String(i));return n.stylePropertyNameCase==="css"&&(u=eE(u)),["style",u]}return[n.elementAttributeNameCase==="react"&&s.space?ES[s.property]||s.property:s.attribute,i]}}function $S(n,a){try{return IS(a,{reactCompat:!0})}catch(i){if(n.ignoreInvalidStyle)return{};const s=i,u=new Gt("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=n.filePath||void 0,u.url=Xp+"#cannot-parse-style-attribute",u}}function Wp(n,a,i){let s;if(!i)s={type:"Literal",value:a};else if(a.includes(".")){const u=a.split(".");let l=-1,c;for(;++l<u.length;){const f=Rp(u[l])?{type:"Identifier",name:u[l]}:{type:"Literal",value:u[l]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(l&&f.type==="Literal"),optional:!1}:f}s=c}else s=Rp(a)&&!/^[a-z]/.test(a)?{type:"Identifier",name:a}:{type:"Literal",value:a};if(s.type==="Literal"){const u=s.value;return Eu.call(n.components,u)?n.components[u]:u}if(n.evaluater)return n.evaluater.evaluateExpression(s);$a(n)}function $a(n,a){const i=new Gt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:a,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=n.filePath||void 0,i.url=Xp+"#cannot-handle-mdx-estrees-without-createevaluater",i}function eE(n){const a={};let i;for(i in n)Eu.call(n,i)&&(a[tE(i)]=n[i]);return a}function tE(n){let a=n.replace(BS,nE);return a.slice(0,3)==="ms-"&&(a="-"+a),a}function nE(n){return"-"+n.toLowerCase()}const Cu={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},rE={};function iE(n,a){const i=rE,s=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,u=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return Jp(n,s,u)}function Jp(n,a,i){if(aE(n)){if("value"in n)return n.type==="html"&&!i?"":n.value;if(a&&"alt"in n&&n.alt)return n.alt;if("children"in n)return $p(n.children,a,i)}return Array.isArray(n)?$p(n,a,i):""}function $p(n,a,i){const s=[];let u=-1;for(;++u<n.length;)s[u]=Jp(n[u],a,i);return s.join("")}function aE(n){return!!(n&&typeof n=="object")}const em=document.createElement("i");function ku(n){const a="&"+n+";";em.innerHTML=a;const i=em.textContent;return i.charCodeAt(i.length-1)===59&&n!=="semi"||i===a?!1:i}function Fn(n,a,i,s){const u=n.length;let l=0,c;if(a<0?a=-a>u?0:u+a:a=a>u?u:a,i=i>0?i:0,s.length<1e4)c=Array.from(s),c.unshift(a,i),n.splice(...c);else for(i&&n.splice(a,i);l<s.length;)c=s.slice(l,l+1e4),c.unshift(a,0),n.splice(...c),l+=1e4,a+=1e4}function En(n,a){return n.length>0?(Fn(n,n.length,0,a),n):a}const tm={}.hasOwnProperty;function sE(n){const a={};let i=-1;for(;++i<n.length;)oE(a,n[i]);return a}function oE(n,a){let i;for(i in a){const u=(tm.call(n,i)?n[i]:void 0)||(n[i]={}),l=a[i];let c;if(l)for(c in l){tm.call(u,c)||(u[c]=[]);const f=l[c];lE(u[c],Array.isArray(f)?f:f?[f]:[])}}}function lE(n,a){let i=-1;const s=[];for(;++i<a.length;)(a[i].add==="after"?n:s).push(a[i]);Fn(n,0,0,s)}function nm(n,a){const i=Number.parseInt(n,a);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Bi(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pn=Tr(/[A-Za-z]/),fn=Tr(/[\dA-Za-z]/),uE=Tr(/[#-'*+\--9=?A-Z^-~]/);function Tu(n){return n!==null&&(n<32||n===127)}const Au=Tr(/\d/),cE=Tr(/[\dA-Fa-f]/),fE=Tr(/[!-/:-@[-`{-~]/);function Fe(n){return n!==null&&n<-2}function Wt(n){return n!==null&&(n<0||n===32)}function it(n){return n===-2||n===-1||n===32}const dE=Tr(new RegExp("\\p{P}|\\p{S}","u")),hE=Tr(/\s/);function Tr(n){return a;function a(i){return i!==null&&i>-1&&n.test(String.fromCharCode(i))}}function Ui(n){const a=[];let i=-1,s=0,u=0;for(;++i<n.length;){const l=n.charCodeAt(i);let c="";if(l===37&&fn(n.charCodeAt(i+1))&&fn(n.charCodeAt(i+2)))u=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(c=String.fromCharCode(l));else if(l>55295&&l<57344){const f=n.charCodeAt(i+1);l<56320&&f>56319&&f<57344?(c=String.fromCharCode(l,f),u=1):c="�"}else c=String.fromCharCode(l);c&&(a.push(n.slice(s,i),encodeURIComponent(c)),s=i+u+1,c=""),u&&(i+=u,u=0)}return a.join("")+n.slice(s)}function pt(n,a,i,s){const u=s?s-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(d){return it(d)?(n.enter(i),f(d)):a(d)}function f(d){return it(d)&&l++<u?(n.consume(d),f):(n.exit(i),a(d))}}const pE={tokenize:mE};function mE(n){const a=n.attempt(this.parser.constructs.contentInitial,s,u);let i;return a;function s(f){if(f===null){n.consume(f);return}return n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),pt(n,a,"linePrefix")}function u(f){return n.enter("paragraph"),l(f)}function l(f){const d=n.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=d),i=d,c(f)}function c(f){if(f===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(f);return}return Fe(f)?(n.consume(f),n.exit("chunkText"),l):(n.consume(f),c)}}const gE={tokenize:yE},rm={tokenize:bE};function yE(n){const a=this,i=[];let s=0,u,l,c;return f;function f(N){if(s<i.length){const j=i[s];return a.containerState=j[1],n.attempt(j[0].continuation,d,h)(N)}return h(N)}function d(N){if(s++,a.containerState._closeFlow){a.containerState._closeFlow=void 0,u&&k();const j=a.events.length;let D=j,M;for(;D--;)if(a.events[D][0]==="exit"&&a.events[D][1].type==="chunkFlow"){M=a.events[D][1].end;break}w(s);let L=j;for(;L<a.events.length;)a.events[L][1].end={...M},L++;return Fn(a.events,D+1,0,a.events.slice(j)),a.events.length=L,h(N)}return f(N)}function h(N){if(s===i.length){if(!u)return _(N);if(u.currentConstruct&&u.currentConstruct.concrete)return C(N);a.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return a.containerState={},n.check(rm,y,b)(N)}function y(N){return u&&k(),w(s),_(N)}function b(N){return a.parser.lazy[a.now().line]=s!==i.length,c=a.now().offset,C(N)}function _(N){return a.containerState={},n.attempt(rm,m,C)(N)}function m(N){return s++,i.push([a.currentConstruct,a.containerState]),_(N)}function C(N){if(N===null){u&&k(),w(0),n.consume(N);return}return u=u||a.parser.flow(a.now()),n.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:l}),S(N)}function S(N){if(N===null){x(n.exit("chunkFlow"),!0),w(0),n.consume(N);return}return Fe(N)?(n.consume(N),x(n.exit("chunkFlow")),s=0,a.interrupt=void 0,f):(n.consume(N),S)}function x(N,j){const D=a.sliceStream(N);if(j&&D.push(null),N.previous=l,l&&(l.next=N),l=N,u.defineSkip(N.start),u.write(D),a.parser.lazy[N.start.line]){let M=u.events.length;for(;M--;)if(u.events[M][1].start.offset<c&&(!u.events[M][1].end||u.events[M][1].end.offset>c))return;const L=a.events.length;let V=L,F,W;for(;V--;)if(a.events[V][0]==="exit"&&a.events[V][1].type==="chunkFlow"){if(F){W=a.events[V][1].end;break}F=!0}for(w(s),M=L;M<a.events.length;)a.events[M][1].end={...W},M++;Fn(a.events,V+1,0,a.events.slice(L)),a.events.length=M}}function w(N){let j=i.length;for(;j-- >N;){const D=i[j];a.containerState=D[1],D[0].exit.call(a,n)}i.length=N}function k(){u.write([null]),l=void 0,u=void 0,a.containerState._closeFlow=void 0}}function bE(n,a,i){return pt(n,n.attempt(this.parser.constructs.document,a,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function im(n){if(n===null||Wt(n)||hE(n))return 1;if(dE(n))return 2}function Ru(n,a,i){const s=[];let u=-1;for(;++u<n.length;){const l=n[u].resolveAll;l&&!s.includes(l)&&(a=l(a,i),s.push(l))}return a}const Nu={name:"attention",resolveAll:vE,tokenize:_E};function vE(n,a){let i=-1,s,u,l,c,f,d,h,y;for(;++i<n.length;)if(n[i][0]==="enter"&&n[i][1].type==="attentionSequence"&&n[i][1]._close){for(s=i;s--;)if(n[s][0]==="exit"&&n[s][1].type==="attentionSequence"&&n[s][1]._open&&a.sliceSerialize(n[s][1]).charCodeAt(0)===a.sliceSerialize(n[i][1]).charCodeAt(0)){if((n[s][1]._close||n[i][1]._open)&&(n[i][1].end.offset-n[i][1].start.offset)%3&&!((n[s][1].end.offset-n[s][1].start.offset+n[i][1].end.offset-n[i][1].start.offset)%3))continue;d=n[s][1].end.offset-n[s][1].start.offset>1&&n[i][1].end.offset-n[i][1].start.offset>1?2:1;const b={...n[s][1].end},_={...n[i][1].start};am(b,-d),am(_,d),c={type:d>1?"strongSequence":"emphasisSequence",start:b,end:{...n[s][1].end}},f={type:d>1?"strongSequence":"emphasisSequence",start:{...n[i][1].start},end:_},l={type:d>1?"strongText":"emphasisText",start:{...n[s][1].end},end:{...n[i][1].start}},u={type:d>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},n[s][1].end={...c.start},n[i][1].start={...f.end},h=[],n[s][1].end.offset-n[s][1].start.offset&&(h=En(h,[["enter",n[s][1],a],["exit",n[s][1],a]])),h=En(h,[["enter",u,a],["enter",c,a],["exit",c,a],["enter",l,a]]),h=En(h,Ru(a.parser.constructs.insideSpan.null,n.slice(s+1,i),a)),h=En(h,[["exit",l,a],["enter",f,a],["exit",f,a],["exit",u,a]]),n[i][1].end.offset-n[i][1].start.offset?(y=2,h=En(h,[["enter",n[i][1],a],["exit",n[i][1],a]])):y=0,Fn(n,s-1,i-s+3,h),i=s+h.length-y-2;break}}for(i=-1;++i<n.length;)n[i][1].type==="attentionSequence"&&(n[i][1].type="data");return n}function _E(n,a){const i=this.parser.constructs.attentionMarkers.null,s=this.previous,u=im(s);let l;return c;function c(d){return l=d,n.enter("attentionSequence"),f(d)}function f(d){if(d===l)return n.consume(d),f;const h=n.exit("attentionSequence"),y=im(d),b=!y||y===2&&u||i.includes(d),_=!u||u===2&&y||i.includes(s);return h._open=!!(l===42?b:b&&(u||!_)),h._close=!!(l===42?_:_&&(y||!b)),a(d)}}function am(n,a){n.column+=a,n.offset+=a,n._bufferIndex+=a}const SE={name:"autolink",tokenize:EE};function EE(n,a,i){let s=0;return u;function u(m){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(m),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),l}function l(m){return Pn(m)?(n.consume(m),c):m===64?i(m):h(m)}function c(m){return m===43||m===45||m===46||fn(m)?(s=1,f(m)):h(m)}function f(m){return m===58?(n.consume(m),s=0,d):(m===43||m===45||m===46||fn(m))&&s++<32?(n.consume(m),f):(s=0,h(m))}function d(m){return m===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(m),n.exit("autolinkMarker"),n.exit("autolink"),a):m===null||m===32||m===60||Tu(m)?i(m):(n.consume(m),d)}function h(m){return m===64?(n.consume(m),y):uE(m)?(n.consume(m),h):i(m)}function y(m){return fn(m)?b(m):i(m)}function b(m){return m===46?(n.consume(m),s=0,y):m===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(m),n.exit("autolinkMarker"),n.exit("autolink"),a):_(m)}function _(m){if((m===45||fn(m))&&s++<63){const C=m===45?_:b;return n.consume(m),C}return i(m)}}const co={partial:!0,tokenize:wE};function wE(n,a,i){return s;function s(l){return it(l)?pt(n,u,"linePrefix")(l):u(l)}function u(l){return l===null||Fe(l)?a(l):i(l)}}const sm={continuation:{tokenize:CE},exit:kE,name:"blockQuote",tokenize:xE};function xE(n,a,i){const s=this;return u;function u(c){if(c===62){const f=s.containerState;return f.open||(n.enter("blockQuote",{_container:!0}),f.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(c),n.exit("blockQuoteMarker"),l}return i(c)}function l(c){return it(c)?(n.enter("blockQuotePrefixWhitespace"),n.consume(c),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),a):(n.exit("blockQuotePrefix"),a(c))}}function CE(n,a,i){const s=this;return u;function u(c){return it(c)?pt(n,l,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return n.attempt(sm,a,i)(c)}}function kE(n){n.exit("blockQuote")}const om={name:"characterEscape",tokenize:TE};function TE(n,a,i){return s;function s(l){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(l),n.exit("escapeMarker"),u}function u(l){return fE(l)?(n.enter("characterEscapeValue"),n.consume(l),n.exit("characterEscapeValue"),n.exit("characterEscape"),a):i(l)}}const lm={name:"characterReference",tokenize:AE};function AE(n,a,i){const s=this;let u=0,l,c;return f;function f(b){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(b),n.exit("characterReferenceMarker"),d}function d(b){return b===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(b),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),l=31,c=fn,y(b))}function h(b){return b===88||b===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(b),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),l=6,c=cE,y):(n.enter("characterReferenceValue"),l=7,c=Au,y(b))}function y(b){if(b===59&&u){const _=n.exit("characterReferenceValue");return c===fn&&!ku(s.sliceSerialize(_))?i(b):(n.enter("characterReferenceMarker"),n.consume(b),n.exit("characterReferenceMarker"),n.exit("characterReference"),a)}return c(b)&&u++<l?(n.consume(b),y):i(b)}}const um={partial:!0,tokenize:NE},cm={concrete:!0,name:"codeFenced",tokenize:RE};function RE(n,a,i){const s=this,u={partial:!0,tokenize:D};let l=0,c=0,f;return d;function d(M){return h(M)}function h(M){const L=s.events[s.events.length-1];return l=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,f=M,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),y(M)}function y(M){return M===f?(c++,n.consume(M),y):c<3?i(M):(n.exit("codeFencedFenceSequence"),it(M)?pt(n,b,"whitespace")(M):b(M))}function b(M){return M===null||Fe(M)?(n.exit("codeFencedFence"),s.interrupt?a(M):n.check(um,S,j)(M)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),_(M))}function _(M){return M===null||Fe(M)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),b(M)):it(M)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),pt(n,m,"whitespace")(M)):M===96&&M===f?i(M):(n.consume(M),_)}function m(M){return M===null||Fe(M)?b(M):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),C(M))}function C(M){return M===null||Fe(M)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),b(M)):M===96&&M===f?i(M):(n.consume(M),C)}function S(M){return n.attempt(u,j,x)(M)}function x(M){return n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),w}function w(M){return l>0&&it(M)?pt(n,k,"linePrefix",l+1)(M):k(M)}function k(M){return M===null||Fe(M)?n.check(um,S,j)(M):(n.enter("codeFlowValue"),N(M))}function N(M){return M===null||Fe(M)?(n.exit("codeFlowValue"),k(M)):(n.consume(M),N)}function j(M){return n.exit("codeFenced"),a(M)}function D(M,L,V){let F=0;return W;function W(G){return M.enter("lineEnding"),M.consume(G),M.exit("lineEnding"),oe}function oe(G){return M.enter("codeFencedFence"),it(G)?pt(M,R,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):R(G)}function R(G){return G===f?(M.enter("codeFencedFenceSequence"),Q(G)):V(G)}function Q(G){return G===f?(F++,M.consume(G),Q):F>=c?(M.exit("codeFencedFenceSequence"),it(G)?pt(M,E,"whitespace")(G):E(G)):V(G)}function E(G){return G===null||Fe(G)?(M.exit("codeFencedFence"),L(G)):V(G)}}}function NE(n,a,i){const s=this;return u;function u(c){return c===null?i(c):(n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),l)}function l(c){return s.parser.lazy[s.now().line]?i(c):a(c)}}const Ou={name:"codeIndented",tokenize:zE},OE={partial:!0,tokenize:ME};function zE(n,a,i){const s=this;return u;function u(h){return n.enter("codeIndented"),pt(n,l,"linePrefix",5)(h)}function l(h){const y=s.events[s.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(h):i(h)}function c(h){return h===null?d(h):Fe(h)?n.attempt(OE,c,d)(h):(n.enter("codeFlowValue"),f(h))}function f(h){return h===null||Fe(h)?(n.exit("codeFlowValue"),c(h)):(n.consume(h),f)}function d(h){return n.exit("codeIndented"),a(h)}}function ME(n,a,i){const s=this;return u;function u(c){return s.parser.lazy[s.now().line]?i(c):Fe(c)?(n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),u):pt(n,l,"linePrefix",5)(c)}function l(c){const f=s.events[s.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(c):Fe(c)?u(c):i(c)}}const DE={name:"codeText",previous:jE,resolve:IE,tokenize:LE};function IE(n){let a=n.length-4,i=3,s,u;if((n[i][1].type==="lineEnding"||n[i][1].type==="space")&&(n[a][1].type==="lineEnding"||n[a][1].type==="space")){for(s=i;++s<a;)if(n[s][1].type==="codeTextData"){n[i][1].type="codeTextPadding",n[a][1].type="codeTextPadding",i+=2,a-=2;break}}for(s=i-1,a++;++s<=a;)u===void 0?s!==a&&n[s][1].type!=="lineEnding"&&(u=s):(s===a||n[s][1].type==="lineEnding")&&(n[u][1].type="codeTextData",s!==u+2&&(n[u][1].end=n[s-1][1].end,n.splice(u+2,s-u-2),a-=s-u-2,s=u+2),u=void 0);return n}function jE(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LE(n,a,i){let s=0,u,l;return c;function c(b){return n.enter("codeText"),n.enter("codeTextSequence"),f(b)}function f(b){return b===96?(n.consume(b),s++,f):(n.exit("codeTextSequence"),d(b))}function d(b){return b===null?i(b):b===32?(n.enter("space"),n.consume(b),n.exit("space"),d):b===96?(l=n.enter("codeTextSequence"),u=0,y(b)):Fe(b)?(n.enter("lineEnding"),n.consume(b),n.exit("lineEnding"),d):(n.enter("codeTextData"),h(b))}function h(b){return b===null||b===32||b===96||Fe(b)?(n.exit("codeTextData"),d(b)):(n.consume(b),h)}function y(b){return b===96?(n.consume(b),u++,y):u===s?(n.exit("codeTextSequence"),n.exit("codeText"),a(b)):(l.type="codeTextData",h(b))}}class BE{constructor(a){this.left=a?[...a]:[],this.right=[]}get(a){if(a<0||a>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+a+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return a<this.left.length?this.left[a]:this.right[this.right.length-a+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(a,i){const s=i??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(a,s):a>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-a+this.left.length).reverse():this.left.slice(a).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(a,i,s){const u=i||0;this.setCursor(Math.trunc(a));const l=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return s&&es(this.left,s),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(a){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(a)}pushMany(a){this.setCursor(Number.POSITIVE_INFINITY),es(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),es(this.right,a.reverse())}setCursor(a){if(!(a===this.left.length||a>this.left.length&&this.right.length===0||a<0&&this.left.length===0))if(a<this.left.length){const i=this.left.splice(a,Number.POSITIVE_INFINITY);es(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-a,Number.POSITIVE_INFINITY);es(this.left,i.reverse())}}}function es(n,a){let i=0;if(a.length<1e4)n.push(...a);else for(;i<a.length;)n.push(...a.slice(i,i+1e4)),i+=1e4}function fm(n){const a={};let i=-1,s,u,l,c,f,d,h;const y=new BE(n);for(;++i<y.length;){for(;i in a;)i=a[i];if(s=y.get(i),i&&s[1].type==="chunkFlow"&&y.get(i-1)[1].type==="listItemPrefix"&&(d=s[1]._tokenizer.events,l=0,l<d.length&&d[l][1].type==="lineEndingBlank"&&(l+=2),l<d.length&&d[l][1].type==="content"))for(;++l<d.length&&d[l][1].type!=="content";)d[l][1].type==="chunkText"&&(d[l][1]._isInFirstContentOfListItem=!0,l++);if(s[0]==="enter")s[1].contentType&&(Object.assign(a,UE(y,i)),i=a[i],h=!0);else if(s[1]._container){for(l=i,u=void 0;l--;)if(c=y.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(u&&(y.get(u)[1].type="lineEndingBlank"),c[1].type="lineEnding",u=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;u&&(s[1].end={...y.get(u)[1].start},f=y.slice(u,i),f.unshift(s),y.splice(u,i-u+1,f))}}return Fn(n,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function UE(n,a){const i=n.get(a)[1],s=n.get(a)[2];let u=a-1;const l=[];let c=i._tokenizer;c||(c=s.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,d=[],h={};let y,b,_=-1,m=i,C=0,S=0;const x=[S];for(;m;){for(;n.get(++u)[1]!==m;);l.push(u),m._tokenizer||(y=s.sliceStream(m),m.next||y.push(null),b&&c.defineSkip(m.start),m._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),m._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),b=m,m=m.next}for(m=i;++_<f.length;)f[_][0]==="exit"&&f[_-1][0]==="enter"&&f[_][1].type===f[_-1][1].type&&f[_][1].start.line!==f[_][1].end.line&&(S=_+1,x.push(S),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(c.events=[],m?(m._tokenizer=void 0,m.previous=void 0):x.pop(),_=x.length;_--;){const w=f.slice(x[_],x[_+1]),k=l.pop();d.push([k,k+w.length-1]),n.splice(k,2,w)}for(d.reverse(),_=-1;++_<d.length;)h[C+d[_][0]]=C+d[_][1],C+=d[_][1]-d[_][0]-1;return h}const FE={resolve:HE,tokenize:qE},PE={partial:!0,tokenize:GE};function HE(n){return fm(n),n}function qE(n,a){let i;return s;function s(f){return n.enter("content"),i=n.enter("chunkContent",{contentType:"content"}),u(f)}function u(f){return f===null?l(f):Fe(f)?n.check(PE,c,l)(f):(n.consume(f),u)}function l(f){return n.exit("chunkContent"),n.exit("content"),a(f)}function c(f){return n.consume(f),n.exit("chunkContent"),i.next=n.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,u}}function GE(n,a,i){const s=this;return u;function u(c){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),pt(n,l,"linePrefix")}function l(c){if(c===null||Fe(c))return i(c);const f=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(c):n.interrupt(s.parser.constructs.flow,i,a)(c)}}function dm(n,a,i,s,u,l,c,f,d){const h=d||Number.POSITIVE_INFINITY;let y=0;return b;function b(w){return w===60?(n.enter(s),n.enter(u),n.enter(l),n.consume(w),n.exit(l),_):w===null||w===32||w===41||Tu(w)?i(w):(n.enter(s),n.enter(c),n.enter(f),n.enter("chunkString",{contentType:"string"}),S(w))}function _(w){return w===62?(n.enter(l),n.consume(w),n.exit(l),n.exit(u),n.exit(s),a):(n.enter(f),n.enter("chunkString",{contentType:"string"}),m(w))}function m(w){return w===62?(n.exit("chunkString"),n.exit(f),_(w)):w===null||w===60||Fe(w)?i(w):(n.consume(w),w===92?C:m)}function C(w){return w===60||w===62||w===92?(n.consume(w),m):m(w)}function S(w){return!y&&(w===null||w===41||Wt(w))?(n.exit("chunkString"),n.exit(f),n.exit(c),n.exit(s),a(w)):y<h&&w===40?(n.consume(w),y++,S):w===41?(n.consume(w),y--,S):w===null||w===32||w===40||Tu(w)?i(w):(n.consume(w),w===92?x:S)}function x(w){return w===40||w===41||w===92?(n.consume(w),S):S(w)}}function hm(n,a,i,s,u,l){const c=this;let f=0,d;return h;function h(m){return n.enter(s),n.enter(u),n.consume(m),n.exit(u),n.enter(l),y}function y(m){return f>999||m===null||m===91||m===93&&!d||m===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?i(m):m===93?(n.exit(l),n.enter(u),n.consume(m),n.exit(u),n.exit(s),a):Fe(m)?(n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),b(m))}function b(m){return m===null||m===91||m===93||Fe(m)||f++>999?(n.exit("chunkString"),y(m)):(n.consume(m),d||(d=!it(m)),m===92?_:b)}function _(m){return m===91||m===92||m===93?(n.consume(m),f++,b):b(m)}}function pm(n,a,i,s,u,l){let c;return f;function f(_){return _===34||_===39||_===40?(n.enter(s),n.enter(u),n.consume(_),n.exit(u),c=_===40?41:_,d):i(_)}function d(_){return _===c?(n.enter(u),n.consume(_),n.exit(u),n.exit(s),a):(n.enter(l),h(_))}function h(_){return _===c?(n.exit(l),d(c)):_===null?i(_):Fe(_)?(n.enter("lineEnding"),n.consume(_),n.exit("lineEnding"),pt(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(_))}function y(_){return _===c||_===null||Fe(_)?(n.exit("chunkString"),h(_)):(n.consume(_),_===92?b:y)}function b(_){return _===c||_===92?(n.consume(_),y):y(_)}}function ts(n,a){let i;return s;function s(u){return Fe(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),i=!0,s):it(u)?pt(n,s,i?"linePrefix":"lineSuffix")(u):a(u)}}const VE={name:"definition",tokenize:ZE},YE={partial:!0,tokenize:XE};function ZE(n,a,i){const s=this;let u;return l;function l(m){return n.enter("definition"),c(m)}function c(m){return hm.call(s,n,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function f(m){return u=Bi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),m===58?(n.enter("definitionMarker"),n.consume(m),n.exit("definitionMarker"),d):i(m)}function d(m){return Wt(m)?ts(n,h)(m):h(m)}function h(m){return dm(n,y,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function y(m){return n.attempt(YE,b,b)(m)}function b(m){return it(m)?pt(n,_,"whitespace")(m):_(m)}function _(m){return m===null||Fe(m)?(n.exit("definition"),s.parser.defined.push(u),a(m)):i(m)}}function XE(n,a,i){return s;function s(f){return Wt(f)?ts(n,u)(f):i(f)}function u(f){return pm(n,l,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function l(f){return it(f)?pt(n,c,"whitespace")(f):c(f)}function c(f){return f===null||Fe(f)?a(f):i(f)}}const KE={name:"hardBreakEscape",tokenize:QE};function QE(n,a,i){return s;function s(l){return n.enter("hardBreakEscape"),n.consume(l),u}function u(l){return Fe(l)?(n.exit("hardBreakEscape"),a(l)):i(l)}}const WE={name:"headingAtx",resolve:JE,tokenize:$E};function JE(n,a){let i=n.length-2,s=3,u,l;return n[s][1].type==="whitespace"&&(s+=2),i-2>s&&n[i][1].type==="whitespace"&&(i-=2),n[i][1].type==="atxHeadingSequence"&&(s===i-1||i-4>s&&n[i-2][1].type==="whitespace")&&(i-=s+1===i?2:4),i>s&&(u={type:"atxHeadingText",start:n[s][1].start,end:n[i][1].end},l={type:"chunkText",start:n[s][1].start,end:n[i][1].end,contentType:"text"},Fn(n,s,i-s+1,[["enter",u,a],["enter",l,a],["exit",l,a],["exit",u,a]])),n}function $E(n,a,i){let s=0;return u;function u(y){return n.enter("atxHeading"),l(y)}function l(y){return n.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&s++<6?(n.consume(y),c):y===null||Wt(y)?(n.exit("atxHeadingSequence"),f(y)):i(y)}function f(y){return y===35?(n.enter("atxHeadingSequence"),d(y)):y===null||Fe(y)?(n.exit("atxHeading"),a(y)):it(y)?pt(n,f,"whitespace")(y):(n.enter("atxHeadingText"),h(y))}function d(y){return y===35?(n.consume(y),d):(n.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||Wt(y)?(n.exit("atxHeadingText"),f(y)):(n.consume(y),h)}}const ew=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],mm=["pre","script","style","textarea"],tw={concrete:!0,name:"htmlFlow",resolveTo:iw,tokenize:aw},nw={partial:!0,tokenize:ow},rw={partial:!0,tokenize:sw};function iw(n){let a=n.length;for(;a--&&!(n[a][0]==="enter"&&n[a][1].type==="htmlFlow"););return a>1&&n[a-2][1].type==="linePrefix"&&(n[a][1].start=n[a-2][1].start,n[a+1][1].start=n[a-2][1].start,n.splice(a-2,2)),n}function aw(n,a,i){const s=this;let u,l,c,f,d;return h;function h(B){return y(B)}function y(B){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(B),b}function b(B){return B===33?(n.consume(B),_):B===47?(n.consume(B),l=!0,S):B===63?(n.consume(B),u=3,s.interrupt?a:q):Pn(B)?(n.consume(B),c=String.fromCharCode(B),x):i(B)}function _(B){return B===45?(n.consume(B),u=2,m):B===91?(n.consume(B),u=5,f=0,C):Pn(B)?(n.consume(B),u=4,s.interrupt?a:q):i(B)}function m(B){return B===45?(n.consume(B),s.interrupt?a:q):i(B)}function C(B){const te="CDATA[";return B===te.charCodeAt(f++)?(n.consume(B),f===te.length?s.interrupt?a:R:C):i(B)}function S(B){return Pn(B)?(n.consume(B),c=String.fromCharCode(B),x):i(B)}function x(B){if(B===null||B===47||B===62||Wt(B)){const te=B===47,ae=c.toLowerCase();return!te&&!l&&mm.includes(ae)?(u=1,s.interrupt?a(B):R(B)):ew.includes(c.toLowerCase())?(u=6,te?(n.consume(B),w):s.interrupt?a(B):R(B)):(u=7,s.interrupt&&!s.parser.lazy[s.now().line]?i(B):l?k(B):N(B))}return B===45||fn(B)?(n.consume(B),c+=String.fromCharCode(B),x):i(B)}function w(B){return B===62?(n.consume(B),s.interrupt?a:R):i(B)}function k(B){return it(B)?(n.consume(B),k):W(B)}function N(B){return B===47?(n.consume(B),W):B===58||B===95||Pn(B)?(n.consume(B),j):it(B)?(n.consume(B),N):W(B)}function j(B){return B===45||B===46||B===58||B===95||fn(B)?(n.consume(B),j):D(B)}function D(B){return B===61?(n.consume(B),M):it(B)?(n.consume(B),D):N(B)}function M(B){return B===null||B===60||B===61||B===62||B===96?i(B):B===34||B===39?(n.consume(B),d=B,L):it(B)?(n.consume(B),M):V(B)}function L(B){return B===d?(n.consume(B),d=null,F):B===null||Fe(B)?i(B):(n.consume(B),L)}function V(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||Wt(B)?D(B):(n.consume(B),V)}function F(B){return B===47||B===62||it(B)?N(B):i(B)}function W(B){return B===62?(n.consume(B),oe):i(B)}function oe(B){return B===null||Fe(B)?R(B):it(B)?(n.consume(B),oe):i(B)}function R(B){return B===45&&u===2?(n.consume(B),J):B===60&&u===1?(n.consume(B),K):B===62&&u===4?(n.consume(B),z):B===63&&u===3?(n.consume(B),q):B===93&&u===5?(n.consume(B),re):Fe(B)&&(u===6||u===7)?(n.exit("htmlFlowData"),n.check(nw,I,Q)(B)):B===null||Fe(B)?(n.exit("htmlFlowData"),Q(B)):(n.consume(B),R)}function Q(B){return n.check(rw,E,I)(B)}function E(B){return n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),G}function G(B){return B===null||Fe(B)?Q(B):(n.enter("htmlFlowData"),R(B))}function J(B){return B===45?(n.consume(B),q):R(B)}function K(B){return B===47?(n.consume(B),c="",ue):R(B)}function ue(B){if(B===62){const te=c.toLowerCase();return mm.includes(te)?(n.consume(B),z):R(B)}return Pn(B)&&c.length<8?(n.consume(B),c+=String.fromCharCode(B),ue):R(B)}function re(B){return B===93?(n.consume(B),q):R(B)}function q(B){return B===62?(n.consume(B),z):B===45&&u===2?(n.consume(B),q):R(B)}function z(B){return B===null||Fe(B)?(n.exit("htmlFlowData"),I(B)):(n.consume(B),z)}function I(B){return n.exit("htmlFlow"),a(B)}}function sw(n,a,i){const s=this;return u;function u(c){return Fe(c)?(n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),l):i(c)}function l(c){return s.parser.lazy[s.now().line]?i(c):a(c)}}function ow(n,a,i){return s;function s(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),n.attempt(co,a,i)}}const lw={name:"htmlText",tokenize:uw};function uw(n,a,i){const s=this;let u,l,c;return f;function f(q){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(q),d}function d(q){return q===33?(n.consume(q),h):q===47?(n.consume(q),D):q===63?(n.consume(q),N):Pn(q)?(n.consume(q),V):i(q)}function h(q){return q===45?(n.consume(q),y):q===91?(n.consume(q),l=0,C):Pn(q)?(n.consume(q),k):i(q)}function y(q){return q===45?(n.consume(q),m):i(q)}function b(q){return q===null?i(q):q===45?(n.consume(q),_):Fe(q)?(c=b,K(q)):(n.consume(q),b)}function _(q){return q===45?(n.consume(q),m):b(q)}function m(q){return q===62?J(q):q===45?_(q):b(q)}function C(q){const z="CDATA[";return q===z.charCodeAt(l++)?(n.consume(q),l===z.length?S:C):i(q)}function S(q){return q===null?i(q):q===93?(n.consume(q),x):Fe(q)?(c=S,K(q)):(n.consume(q),S)}function x(q){return q===93?(n.consume(q),w):S(q)}function w(q){return q===62?J(q):q===93?(n.consume(q),w):S(q)}function k(q){return q===null||q===62?J(q):Fe(q)?(c=k,K(q)):(n.consume(q),k)}function N(q){return q===null?i(q):q===63?(n.consume(q),j):Fe(q)?(c=N,K(q)):(n.consume(q),N)}function j(q){return q===62?J(q):N(q)}function D(q){return Pn(q)?(n.consume(q),M):i(q)}function M(q){return q===45||fn(q)?(n.consume(q),M):L(q)}function L(q){return Fe(q)?(c=L,K(q)):it(q)?(n.consume(q),L):J(q)}function V(q){return q===45||fn(q)?(n.consume(q),V):q===47||q===62||Wt(q)?F(q):i(q)}function F(q){return q===47?(n.consume(q),J):q===58||q===95||Pn(q)?(n.consume(q),W):Fe(q)?(c=F,K(q)):it(q)?(n.consume(q),F):J(q)}function W(q){return q===45||q===46||q===58||q===95||fn(q)?(n.consume(q),W):oe(q)}function oe(q){return q===61?(n.consume(q),R):Fe(q)?(c=oe,K(q)):it(q)?(n.consume(q),oe):F(q)}function R(q){return q===null||q===60||q===61||q===62||q===96?i(q):q===34||q===39?(n.consume(q),u=q,Q):Fe(q)?(c=R,K(q)):it(q)?(n.consume(q),R):(n.consume(q),E)}function Q(q){return q===u?(n.consume(q),u=void 0,G):q===null?i(q):Fe(q)?(c=Q,K(q)):(n.consume(q),Q)}function E(q){return q===null||q===34||q===39||q===60||q===61||q===96?i(q):q===47||q===62||Wt(q)?F(q):(n.consume(q),E)}function G(q){return q===47||q===62||Wt(q)?F(q):i(q)}function J(q){return q===62?(n.consume(q),n.exit("htmlTextData"),n.exit("htmlText"),a):i(q)}function K(q){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(q),n.exit("lineEnding"),ue}function ue(q){return it(q)?pt(n,re,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):re(q)}function re(q){return n.enter("htmlTextData"),c(q)}}const zu={name:"labelEnd",resolveAll:hw,resolveTo:pw,tokenize:mw},cw={tokenize:gw},fw={tokenize:yw},dw={tokenize:bw};function hw(n){let a=-1;const i=[];for(;++a<n.length;){const s=n[a][1];if(i.push(n[a]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const u=s.type==="labelImage"?4:2;s.type="data",a+=u}}return n.length!==i.length&&Fn(n,0,n.length,i),n}function pw(n,a){let i=n.length,s=0,u,l,c,f;for(;i--;)if(u=n[i][1],l){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;n[i][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(c){if(n[i][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(l=i,u.type!=="labelLink")){s=2;break}}else u.type==="labelEnd"&&(c=i);const d={type:n[l][1].type==="labelLink"?"link":"image",start:{...n[l][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[l][1].start},end:{...n[c][1].end}},y={type:"labelText",start:{...n[l+s+2][1].end},end:{...n[c-2][1].start}};return f=[["enter",d,a],["enter",h,a]],f=En(f,n.slice(l+1,l+s+3)),f=En(f,[["enter",y,a]]),f=En(f,Ru(a.parser.constructs.insideSpan.null,n.slice(l+s+4,c-3),a)),f=En(f,[["exit",y,a],n[c-2],n[c-1],["exit",h,a]]),f=En(f,n.slice(c+1)),f=En(f,[["exit",d,a]]),Fn(n,l,n.length,f),n}function mw(n,a,i){const s=this;let u=s.events.length,l,c;for(;u--;)if((s.events[u][1].type==="labelImage"||s.events[u][1].type==="labelLink")&&!s.events[u][1]._balanced){l=s.events[u][1];break}return f;function f(_){return l?l._inactive?b(_):(c=s.parser.defined.includes(Bi(s.sliceSerialize({start:l.end,end:s.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(_),n.exit("labelMarker"),n.exit("labelEnd"),d):i(_)}function d(_){return _===40?n.attempt(cw,y,c?y:b)(_):_===91?n.attempt(fw,y,c?h:b)(_):c?y(_):b(_)}function h(_){return n.attempt(dw,y,b)(_)}function y(_){return a(_)}function b(_){return l._balanced=!0,i(_)}}function gw(n,a,i){return s;function s(b){return n.enter("resource"),n.enter("resourceMarker"),n.consume(b),n.exit("resourceMarker"),u}function u(b){return Wt(b)?ts(n,l)(b):l(b)}function l(b){return b===41?y(b):dm(n,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function c(b){return Wt(b)?ts(n,d)(b):y(b)}function f(b){return i(b)}function d(b){return b===34||b===39||b===40?pm(n,h,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):y(b)}function h(b){return Wt(b)?ts(n,y)(b):y(b)}function y(b){return b===41?(n.enter("resourceMarker"),n.consume(b),n.exit("resourceMarker"),n.exit("resource"),a):i(b)}}function yw(n,a,i){const s=this;return u;function u(f){return hm.call(s,n,l,c,"reference","referenceMarker","referenceString")(f)}function l(f){return s.parser.defined.includes(Bi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?a(f):i(f)}function c(f){return i(f)}}function bw(n,a,i){return s;function s(l){return n.enter("reference"),n.enter("referenceMarker"),n.consume(l),n.exit("referenceMarker"),u}function u(l){return l===93?(n.enter("referenceMarker"),n.consume(l),n.exit("referenceMarker"),n.exit("reference"),a):i(l)}}const vw={name:"labelStartImage",resolveAll:zu.resolveAll,tokenize:_w};function _w(n,a,i){const s=this;return u;function u(f){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(f),n.exit("labelImageMarker"),l}function l(f){return f===91?(n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelImage"),c):i(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in s.parser.constructs?i(f):a(f)}}const Sw={name:"labelStartLink",resolveAll:zu.resolveAll,tokenize:Ew};function Ew(n,a,i){const s=this;return u;function u(c){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(c),n.exit("labelMarker"),n.exit("labelLink"),l}function l(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?i(c):a(c)}}const Mu={name:"lineEnding",tokenize:ww};function ww(n,a){return i;function i(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),pt(n,a,"linePrefix")}}const fo={name:"thematicBreak",tokenize:xw};function xw(n,a,i){let s=0,u;return l;function l(h){return n.enter("thematicBreak"),c(h)}function c(h){return u=h,f(h)}function f(h){return h===u?(n.enter("thematicBreakSequence"),d(h)):s>=3&&(h===null||Fe(h))?(n.exit("thematicBreak"),a(h)):i(h)}function d(h){return h===u?(n.consume(h),s++,d):(n.exit("thematicBreakSequence"),it(h)?pt(n,f,"whitespace")(h):f(h))}}const Jt={continuation:{tokenize:Aw},exit:Nw,name:"list",tokenize:Tw},Cw={partial:!0,tokenize:Ow},kw={partial:!0,tokenize:Rw};function Tw(n,a,i){const s=this,u=s.events[s.events.length-1];let l=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,c=0;return f;function f(m){const C=s.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!s.containerState.marker||m===s.containerState.marker:Au(m)){if(s.containerState.type||(s.containerState.type=C,n.enter(C,{_container:!0})),C==="listUnordered")return n.enter("listItemPrefix"),m===42||m===45?n.check(fo,i,h)(m):h(m);if(!s.interrupt||m===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),d(m)}return i(m)}function d(m){return Au(m)&&++c<10?(n.consume(m),d):(!s.interrupt||c<2)&&(s.containerState.marker?m===s.containerState.marker:m===41||m===46)?(n.exit("listItemValue"),h(m)):i(m)}function h(m){return n.enter("listItemMarker"),n.consume(m),n.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||m,n.check(co,s.interrupt?i:y,n.attempt(Cw,_,b))}function y(m){return s.containerState.initialBlankLine=!0,l++,_(m)}function b(m){return it(m)?(n.enter("listItemPrefixWhitespace"),n.consume(m),n.exit("listItemPrefixWhitespace"),_):i(m)}function _(m){return s.containerState.size=l+s.sliceSerialize(n.exit("listItemPrefix"),!0).length,a(m)}}function Aw(n,a,i){const s=this;return s.containerState._closeFlow=void 0,n.check(co,u,l);function u(f){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,pt(n,a,"listItemIndent",s.containerState.size+1)(f)}function l(f){return s.containerState.furtherBlankLines||!it(f)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(f)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,n.attempt(kw,a,c)(f))}function c(f){return s.containerState._closeFlow=!0,s.interrupt=void 0,pt(n,n.attempt(Jt,a,i),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function Rw(n,a,i){const s=this;return pt(n,u,"listItemIndent",s.containerState.size+1);function u(l){const c=s.events[s.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===s.containerState.size?a(l):i(l)}}function Nw(n){n.exit(this.containerState.type)}function Ow(n,a,i){const s=this;return pt(n,u,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(l){const c=s.events[s.events.length-1];return!it(l)&&c&&c[1].type==="listItemPrefixWhitespace"?a(l):i(l)}}const gm={name:"setextUnderline",resolveTo:zw,tokenize:Mw};function zw(n,a){let i=n.length,s,u,l;for(;i--;)if(n[i][0]==="enter"){if(n[i][1].type==="content"){s=i;break}n[i][1].type==="paragraph"&&(u=i)}else n[i][1].type==="content"&&n.splice(i,1),!l&&n[i][1].type==="definition"&&(l=i);const c={type:"setextHeading",start:{...n[s][1].start},end:{...n[n.length-1][1].end}};return n[u][1].type="setextHeadingText",l?(n.splice(u,0,["enter",c,a]),n.splice(l+1,0,["exit",n[s][1],a]),n[s][1].end={...n[l][1].end}):n[s][1]=c,n.push(["exit",c,a]),n}function Mw(n,a,i){const s=this;let u;return l;function l(h){let y=s.events.length,b;for(;y--;)if(s.events[y][1].type!=="lineEnding"&&s.events[y][1].type!=="linePrefix"&&s.events[y][1].type!=="content"){b=s.events[y][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||b)?(n.enter("setextHeadingLine"),u=h,c(h)):i(h)}function c(h){return n.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===u?(n.consume(h),f):(n.exit("setextHeadingLineSequence"),it(h)?pt(n,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Fe(h)?(n.exit("setextHeadingLine"),a(h)):i(h)}}const Dw={tokenize:Iw};function Iw(n){const a=this,i=n.attempt(co,s,n.attempt(this.parser.constructs.flowInitial,u,pt(n,n.attempt(this.parser.constructs.flow,u,n.attempt(FE,u)),"linePrefix")));return i;function s(l){if(l===null){n.consume(l);return}return n.enter("lineEndingBlank"),n.consume(l),n.exit("lineEndingBlank"),a.currentConstruct=void 0,i}function u(l){if(l===null){n.consume(l);return}return n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),a.currentConstruct=void 0,i}}const jw={resolveAll:bm()},Lw=ym("string"),Bw=ym("text");function ym(n){return{resolveAll:bm(n==="text"?Uw:void 0),tokenize:a};function a(i){const s=this,u=this.parser.constructs[n],l=i.attempt(u,c,f);return c;function c(y){return h(y)?l(y):f(y)}function f(y){if(y===null){i.consume(y);return}return i.enter("data"),i.consume(y),d}function d(y){return h(y)?(i.exit("data"),l(y)):(i.consume(y),d)}function h(y){if(y===null)return!0;const b=u[y];let _=-1;if(b)for(;++_<b.length;){const m=b[_];if(!m.previous||m.previous.call(s,s.previous))return!0}return!1}}}function bm(n){return a;function a(i,s){let u=-1,l;for(;++u<=i.length;)l===void 0?i[u]&&i[u][1].type==="data"&&(l=u,u++):(!i[u]||i[u][1].type!=="data")&&(u!==l+2&&(i[l][1].end=i[u-1][1].end,i.splice(l+2,u-l-2),u=l+2),l=void 0);return n?n(i,s):i}}function Uw(n,a){let i=0;for(;++i<=n.length;)if((i===n.length||n[i][1].type==="lineEnding")&&n[i-1][1].type==="data"){const s=n[i-1][1],u=a.sliceStream(s);let l=u.length,c=-1,f=0,d;for(;l--;){const h=u[l];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)d=!0,f++;else if(h!==-1){l++;break}}if(a._contentTypeTextTrailing&&i===n.length&&(f=0),f){const h={type:i===n.length||d||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:s.start._bufferIndex+c,_index:s.start._index+l,line:s.end.line,column:s.end.column-f,offset:s.end.offset-f},end:{...s.end}};s.end={...h.start},s.start.offset===s.end.offset?Object.assign(s,h):(n.splice(i,0,["enter",h,a],["exit",h,a]),i+=2)}i++}return n}const Fw=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:VE},disable:{null:[]},document:{42:Jt,43:Jt,45:Jt,48:Jt,49:Jt,50:Jt,51:Jt,52:Jt,53:Jt,54:Jt,55:Jt,56:Jt,57:Jt,62:sm},flow:{35:WE,42:fo,45:[gm,fo],60:tw,61:gm,95:fo,96:cm,126:cm},flowInitial:{[-2]:Ou,[-1]:Ou,32:Ou},insideSpan:{null:[Nu,jw]},string:{38:lm,92:om},text:{[-5]:Mu,[-4]:Mu,[-3]:Mu,33:vw,38:lm,42:Nu,60:[SE,lw],91:Sw,92:[KE,om],93:zu,95:Nu,96:DE}},Symbol.toStringTag,{value:"Module"}));function Pw(n,a,i){let s={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const u={},l=[];let c=[],f=[];const d={attempt:L(D),check:L(M),consume:k,enter:N,exit:j,interrupt:L(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:S,events:[],now:C,parser:n,previous:null,sliceSerialize:_,sliceStream:m,write:b};let y=a.tokenize.call(h,d);return a.resolveAll&&l.push(a),h;function b(oe){return c=En(c,oe),x(),c[c.length-1]!==null?[]:(V(a,0),h.events=Ru(l,h.events,h),h.events)}function _(oe,R){return qw(m(oe),R)}function m(oe){return Hw(c,oe)}function C(){const{_bufferIndex:oe,_index:R,line:Q,column:E,offset:G}=s;return{_bufferIndex:oe,_index:R,line:Q,column:E,offset:G}}function S(oe){u[oe.line]=oe.column,W()}function x(){let oe;for(;s._index<c.length;){const R=c[s._index];if(typeof R=="string")for(oe=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===oe&&s._bufferIndex<R.length;)w(R.charCodeAt(s._bufferIndex));else w(R)}}function w(oe){y=y(oe)}function k(oe){Fe(oe)?(s.line++,s.column=1,s.offset+=oe===-3?2:1,W()):oe!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===c[s._index].length&&(s._bufferIndex=-1,s._index++)),h.previous=oe}function N(oe,R){const Q=R||{};return Q.type=oe,Q.start=C(),h.events.push(["enter",Q,h]),f.push(Q),Q}function j(oe){const R=f.pop();return R.end=C(),h.events.push(["exit",R,h]),R}function D(oe,R){V(oe,R.from)}function M(oe,R){R.restore()}function L(oe,R){return Q;function Q(E,G,J){let K,ue,re,q;return Array.isArray(E)?I(E):"tokenize"in E?I([E]):z(E);function z(xe){return Te;function Te(Ce){const ke=Ce!==null&&xe[Ce],je=Ce!==null&&xe.null,_e=[...Array.isArray(ke)?ke:ke?[ke]:[],...Array.isArray(je)?je:je?[je]:[]];return I(_e)(Ce)}}function I(xe){return K=xe,ue=0,xe.length===0?J:B(xe[ue])}function B(xe){return Te;function Te(Ce){return q=F(),re=xe,xe.partial||(h.currentConstruct=xe),xe.name&&h.parser.constructs.disable.null.includes(xe.name)?ae():xe.tokenize.call(R?Object.assign(Object.create(h),R):h,d,te,ae)(Ce)}}function te(xe){return oe(re,q),G}function ae(xe){return q.restore(),++ue<K.length?B(K[ue]):J}}}function V(oe,R){oe.resolveAll&&!l.includes(oe)&&l.push(oe),oe.resolve&&Fn(h.events,R,h.events.length-R,oe.resolve(h.events.slice(R),h)),oe.resolveTo&&(h.events=oe.resolveTo(h.events,h))}function F(){const oe=C(),R=h.previous,Q=h.currentConstruct,E=h.events.length,G=Array.from(f);return{from:E,restore:J};function J(){s=oe,h.previous=R,h.currentConstruct=Q,h.events.length=E,f=G,W()}}function W(){s.line in u&&s.column<2&&(s.column=u[s.line],s.offset+=u[s.line]-1)}}function Hw(n,a){const i=a.start._index,s=a.start._bufferIndex,u=a.end._index,l=a.end._bufferIndex;let c;if(i===u)c=[n[i].slice(s,l)];else{if(c=n.slice(i,u),s>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(s):c.shift()}l>0&&c.push(n[u].slice(0,l))}return c}function qw(n,a){let i=-1;const s=[];let u;for(;++i<n.length;){const l=n[i];let c;if(typeof l=="string")c=l;else switch(l){case-5:{c="\r";break}case-4:{c=`
|
|
43
|
+
`}),O.jsxs(da,{className:b,children:[O.jsx("div",{className:"flex-shrink-0 sticky top-0 z-50",children:O.jsx(r1,{onClose:l,title:s,iconUrl:i,startNewConversation:o})}),O.jsx("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col",children:u}),f&&O.jsxs("div",{className:"flex-shrink-0 sticky bottom-0 z-50",children:[O.jsx(P.Suspense,{fallback:null,children:O.jsx(i1,{value:f.value,onChange:f.onChange,onSend:f.onSend,onFileChange:f.onFileChange,onRecording:f.onRecording,isRecording:f.isRecording,hasAttachment:f.hasAttachment,attachmentFiles:f.attachmentFiles,isDisabled:f.isDisabled,isMobile:h,placeholder:f.placeholder,recordingStatus:f.recordingStatus})}),c&&m==="development"&&O.jsx("div",{className:"px-6 flex justify-center items-center",children:O.jsxs("p",{className:"text-[8px] text-gray-600 font-mono opacity-50",children:["Session ID: ",c]})})]})]})]})}function Wh(){const[n,l]=P.useState(typeof navigator<"u"?navigator.onLine:!0);return P.useEffect(()=>{const i=()=>l(!0),o=()=>l(!1);return window.addEventListener("online",i),window.addEventListener("offline",o),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",o)}},[]),{isOnline:n}}const l1=({environment:n,userId:l,onInlineText:i})=>{const[o,u]=P.useState([]),[s,c]=P.useState(!1),[f,m]=P.useState(0),[h,g]=P.useState(!1),[y,v]=P.useState([]),b=P.useRef(null),w=P.useRef(null),{isOnline:E}=Wh(),{agentId:T,setSessionId:_,setSessionToken:A,sessionId:k,sessionToken:q,setError:H,setConnectionStatus:M,setShowRetryButton:I,setStartNewConnection:Y,setIsStreaming:F,setIsWaitingForResponse:$,isStreaming:ie,initialMessage:D,isWaitingForResponse:ne,setProgressMessage:C,setRecordingStatus:V,clearSession:Z,addMessageToSession:Q,getMessagesForSession:se,updateMessageInSession:de,setInitialMessage:L}=Yr();P.useEffect(()=>{E?h?B()&&(M(Ge.ConnectionStatus.CONNECTED),re()):M(Ge.ConnectionStatus.CONNECTING):M(Ge.ConnectionStatus.NOT_CONNECTED)},[E,h]),P.useEffect(()=>{if(k){const S=se(k)||[];u(S),v([])}},[k]),P.useEffect(()=>{if(g(!1),!T)return;const S=new Ge.SynapseSDK({agentId:T,environment:n,userId:l,callbacks:{onError:K=>{if(K instanceof Ge.SynapseError)switch(K.code){case Ge.SynapseErrorCode.SESSION:M(Ge.ConnectionStatus.NOT_CONNECTED),I(!0);break;case Ge.SynapseErrorCode.RECORDING:H({title:"Recording failed",description:K?.displayMessage||"Please try again later"});break;default:H({title:"Something went wrong",description:"Please try again later"}),I(!0);break}},onSessionRefreshed:K=>{K?.session_id&&K?.session_token&&(_(K.session_id),A(K.session_token))}}});return b.current=S,g(!0),()=>{g(!1),b.current?.endSession(),b.current=null,w.current&&(clearTimeout(w.current),w.current=null)}},[T,n,l]),P.useEffect(()=>{const S=o[o.length-1];!S?.role||!k||(S?.role===On.USER?Q(k,S):!ie&&!S.isStored&&(u(K=>{const W=[...K];return W[W.length-1]={...S,isStored:!0},W}),Q(k,{...S,isStored:!0})))},[o,ie]),P.useEffect(()=>{const S=o[o.length-1];return()=>{S&&!S?.isStored&&k&&Q(k,{...S,isStored:!0})}},[]),P.useEffect(()=>(w.current&&(clearTimeout(w.current),w.current=null),ne&&!ie?w.current=setTimeout(()=>{$(!1),w.current=null},3e4):ie&&w.current&&(clearTimeout(w.current),w.current=null),()=>{w.current&&(clearTimeout(w.current),w.current=null)}),[ne,ie,$]);const N=async(S=!1)=>{try{if(!b.current){H({title:"SDK not initialized",description:"Please ensure agentId is configured"}),c(!1);return}c(!0);let K;S?(await Z(),re(),K=await b.current.startSession()):K=await b.current.startSession({session_id:k||"",session_token:q||""}),K?.session_id&&K?.session_token&&(_(K.session_id),A(K.session_token),K?.initial_message?.text&&K?.initial_message?.suggestions?.length&&L(K.initial_message)),ce()}catch{H({title:"Something Went wrong!",description:"Please try again later."}),c(!1);return}finally{c(!1)}},B=()=>b.current?.isConnected()??!1,z=()=>{b.current?.endSession()},re=()=>{m(0),I(!1),Y(!1),H(null)},ce=()=>{b.current?.on(Ge.SYNAPSE_REALTIME_EVENTS.MESSAGE_CHUNK,S=>{const K=S;if(K.data?.text&&K.messageId){ie||($(!1),F(!0));const W=K.data.text,U=K.messageId,j=K.timestamp;u(X=>{const he=X[X.length-1];if(he&&he.id===U&&he.role===On.ASSISTANT){const pe=[...X];return pe[pe.length-1]={...he,content:he.content+W},pe}else return[...X,{id:U,content:W,role:On.ASSISTANT,timestamp:fa(j??Date.now()),isStored:!1}]})}}),b.current?.on(Ge.SYNAPSE_REALTIME_EVENTS.END_OF_STREAM,()=>{F(!1),C(null)}),b.current?.on(Ge.SYNAPSE_REALTIME_EVENTS.CONNECTED,()=>{re(),M(Ge.ConnectionStatus.CONNECTED)}),b.current?.on(Ge.SYNAPSE_REALTIME_EVENTS.TOOL_CALL,S=>{const K=S;if(!K?.messageId||!K?.data||!K?.data?.details?.component)return;const W=K.messageId,U=K.timestamp??Date.now();u(j=>{const X=j[j.length-1];if(X.id===W&&X.role===On.ASSISTANT){const he=[...j],pe={...X,toolEscalationData:{...K.data,isResponded:!1},isResponseFromTool:!0};return he[j.length-1]=pe,de(k,W,pe),he}else{const he={id:W,content:K.data?.text||"",role:On.ASSISTANT,toolEscalationData:{...K.data,isResponded:!1},isResponseFromTool:!0,timestamp:fa(U),isStored:!1};return[...j,he]}})}),b.current?.on(Ge.SYNAPSE_REALTIME_EVENTS.DISCONNECTED,S=>{M(Ge.ConnectionStatus.NOT_CONNECTED),f<2?(m(K=>K+1),I(!0)):Y(!0)}),b.current?.on(Ge.SYNAPSE_REALTIME_EVENTS.ERROR,S=>{I(!0)}),b.current?.on(Ge.SYNAPSE_REALTIME_EVENTS.INLINE_TEXT,S=>{const K=S;K?.data?.text&&i&&(V(Ft.IDLE),i?.(K.data.text)),F(!1),$(!1),C(null)}),b.current?.on(Ge.SYNAPSE_REALTIME_EVENTS.PROGRESS_MESSAGE,S=>{const K=S;K.data?.text&&($(!1),C(K.data.text))})},we=async({message:S,messageId:K,files:W,audio:U,toolCalled:j})=>{if(!B()||W&&W.length<0&&S?.trim()===""&&!U?.audio)return;H(null);const X=o.length==2&&y.length==2?y:null;if(S||W&&W.length>0||U?.audio){const he=o.length-1,pe=he>=0?o[he]:null,le=pe?pe?.isResponseFromTool||pe.role===On.ASSISTANT&&pe.toolEscalationData:null;await b.current?.sendMessage({message:S,files:W,audio:U,...X&&{initial_prompts:X},...le&&!j?{tool_declined:!0,tool_id:pe?.toolEscalationData?.tool_id||""}:{}}),u(Ee=>{const _e=[...Ee],Se=_e.length-1;return le&&Se>=0&&_e[Se].toolEscalationData&&(_e[Se]={..._e[Se],toolEscalationData:{..._e[Se].toolEscalationData,tool_id:null,isResponded:!0}},de(k,_e[he].id||Date.now().toString(),_e[he])),[..._e,{id:K||Date.now().toString(),content:S||"",files:W||[],role:On.USER,timestamp:fa(Date.now()),isStored:!0}]}),$(!0)}};return{sendMessage:we,startSession:N,incomingMessages:o,loading:s,endSession:z,isReady:h,startRecording:async()=>{if(!B())throw new Error("Not connected to the server");try{await b.current?.startRecording({onChunks:async S=>{V(Ft.PROCESSING),await we({audio:S}),V(Ft.TRANSCRIBING)},onError(S){V(Ft.IDLE)}}),V(Ft.LISTENING)}catch(S){throw V(Ft.IDLE),S}},stopRecording:()=>{B()&&b.current?.endRecording()},handleRetry:async()=>{if(!B())re(),await N(!1);else{const S=o[o.length-1];S&&S.role===On.USER&&b.current?.sendMessage({message:S.content,files:S.files||[],messageId:S.id})}},isValidFile:S=>{const K=S.type.toLowerCase(),U=S.name.toLowerCase().split(".").pop()||"";return K&&["application/pdf","image/jpeg","image/jpg","image/png","image/heic","image/heif","application/vnd.openxmlformats-officedocument.wordprocessingml.document","image/tiff","text/plain","text/markdown"].some(X=>K.includes(X))?!0:!K||K===""?["pdf","jpg","jpeg","png","heic","docx","tiff","txt","md"].includes(U):!1},handleStartNewConnection:async()=>{re(),await Z(),await N(!0)},callTool:async(S,K)=>{try{if(!B())throw new Error("Not connected to the server");const W=await b.current?.callTool(S,K);if(!W)throw new Error("Failed to call tool");return W}catch(W){throw W}},handleInitialTaskClick:async S=>{if(!D?.suggestions.length||!S)return;const K=D.suggestions.find(W=>W.value===S);if(!K||!K.response){await we({message:S});return}u(W=>[...W,{id:Date.now().toString(),content:S,role:On.USER,timestamp:fa(Date.now()),isStored:!0}]),$(!0),await Jv(1e3),$(!1),u(W=>[...W,{id:Date.now().toString(),content:K.response||"Please try again",role:On.ASSISTANT,timestamp:fa(Date.now()),isStored:!1}]),v([{role:"user",text:S},{role:"assistant",text:K.response}])}}},o1=P.lazy(()=>Promise.resolve().then(()=>Gw)),s1=P.lazy(()=>Promise.resolve().then(()=>Kw)),u1=P.lazy(()=>Promise.resolve().then(()=>Jw).then(n=>({default:n.ConnectionStatus})));function c1({isOpen:n,agentId:l,config:i}){const[o,u]=P.useState(""),[s,c]=P.useState(!1),[f,m]=P.useState(!1),[h,g]=P.useState([]),y=P.useRef(!1),v=P.useRef(null),b=P.useRef(null),[w,E]=P.useState(!1),T=P.useRef(0),{setAgentId:_,startNewConnection:A,showRetryButton:k,clearError:q,error:H,connectionStatus:M,recordingStatus:I,isWaitingForResponse:Y,isStreaming:F,setError:$,initialMessage:ie,sessionId:D}=Yr(),{incomingMessages:ne,loading:C,sendMessage:V,startSession:Z,isReady:Q,startRecording:se,stopRecording:de,handleRetry:L,handleStartNewConnection:N,isValidFile:B,callTool:z,handleInitialTaskClick:re}=l1({environment:"production",onInlineText:j=>{u(X=>X+j)}});P.useEffect(()=>{l&&(_(l),n&&Q&&!y.current&&(y.current=!0,Z(!1)))},[n,Q,l]);const ce=()=>v.current?.querySelector("[data-radix-scroll-area-viewport]")||null,we=()=>{const j=ce();j&&(j.scrollTo({top:j.scrollHeight,behavior:"smooth"}),E(!1))},Te=()=>{const j=ce();return j?j.scrollHeight-j.scrollTop-j.clientHeight<50:!0};P.useEffect(()=>{ne.length>T.current&&(setTimeout(()=>{we()},100),T.current=ne.length)},[ne.length]),P.useEffect(()=>{const j=ce();if(!j)return;const X=()=>{E(!Te())},he=()=>{X()},pe=new MutationObserver(()=>{X()});return pe.observe(j,{childList:!0,subtree:!0}),j.addEventListener("scroll",he),X(),()=>{pe.disconnect(),j.removeEventListener("scroll",he)}},[ne.length]);const ke=ne.length>0,Ae=M===Ge.ConnectionStatus.CONNECTED,He=C||!Ae||Y||F,ve=C||!Ae,ze=P.useMemo(()=>I===Ft.IDLE?null:I===Ft.LISTENING?"Listening...":I===Ft.PROCESSING?"Processing...":I===Ft.TRANSCRIBING?"Transcribing...":null,[I]),je=ve?"Connecting...":ze||(Y||F?"Please wait for the response...":"Ask me anything…"),S=async()=>{if(!He&&(o.trim()||s||f)){const j=Date.now().toString();h.length>0?(await V({files:h,message:o.trim(),messageId:j}),g([]),m(!1)):o.trim()&&await V({message:o,messageId:j}),u(""),c(!1),m(!1),setTimeout(()=>{we()},100)}},K=async j=>{j&&await re(j)},W=j=>{if(j&&j.length>0){const X=j.filter(he=>B(he)?!0:($({title:`File type not supported: ${he.name}`,description:"Only PDF, images (JPG, JPEG, PNG, HEIC), documents (DOCX, TIFF), and text files (TXT, MD) are allowed."}),!1));if(X?.length>0)j=X;else return}g(X=>(m((X?.length??0)+(j?.length??0)>0),[...X,...j]))},U=async()=>{if(s)await de(),c(!1);else{if(He)return;try{await se(),c(!0)}catch{}}};return O.jsx(a1,{isOpen:n,onClose:i.onClose,title:i.title,iconUrl:i.iconUrl,onStartNewSession:()=>Z(!0),sessionId:D,environment:i.environment,chatComposer:{value:o,onChange:u,onSend:S,onFileChange:W,onRecording:U,isRecording:s,hasAttachment:f,attachmentFiles:h,isDisabled:He,placeholder:je,recordingStatus:I},children:!C&&O.jsx(P.Suspense,{fallback:O.jsx(f1,{}),children:O.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-white backdrop-blur-2xl relative",children:[O.jsx(Ud,{ref:v,className:"flex-1 min-h-0",children:O.jsxs("div",{className:Ye("transition-all duration-300",ke?"p-4 space-y-3":"p-6 space-y-6"),children:[!ke&&ie?.text?O.jsx(s1,{tasks:ie.suggestions,initialPrompt:ie.text,onTaskClick:K,disabled:He}):O.jsx(o1,{messages:ne,onSendMessage:V,iconUrl:i.iconUrl,callTool:z}),O.jsx("div",{ref:b})]})}),w&&O.jsx("div",{className:"absolute bottom-[10px] left-1/2 transform -translate-x-1/2 z-10",children:O.jsx(kt,{onClick:we,size:"icon",className:"h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-lg border border-lavender-200/60 hover:bg-white hover:shadow-xl transition-all duration-200",children:O.jsx(Rs,{className:"w-5 h-5 text-slate-700"})})}),O.jsx(u1,{className:"mt-2",onRetry:L,onStartNewSession:N,showRetryButton:k,startNewConnection:A,clearError:q,error:H,isConnected:Ae})]})})})}function f1(){return O.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-white backdrop-blur-2xl animate-pulse",children:[O.jsxs("div",{className:"flex-1 p-6 space-y-4",children:[O.jsx("div",{className:"h-16 bg-gray-100 rounded-2xl"}),O.jsx("div",{className:"h-16 bg-gray-100 rounded-2xl"}),O.jsx("div",{className:"h-16 bg-gray-100 rounded-2xl"})]}),O.jsx("div",{className:"h-24 border-t border-gray-100 bg-gray-50"})]})}function d1({agentId:n,config:l}){const[i,o]=P.useState(!1);P.useEffect(()=>{o(!0)},[]);const u=()=>{o(!1),l?.onClose?.()};return O.jsx(c1,{isOpen:i,agentId:n,config:{...l,environment:l.environment??"production",onClose:u,title:l.title??"Medi Clinic"}})}const $h=(n,l,i)=>{Lb.createRoot(n).render(O.jsx(P.StrictMode,{children:O.jsx(d1,{agentId:l,config:i||{}})}))};typeof window<"u"&&(window.renderMedAssist=$h);const em=P.forwardRef(({className:n,...l},i)=>O.jsx("textarea",{className:Ye("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:i,...l}));em.displayName="Textarea";function h1({value:n,onChange:l,onSend:i,onFileChange:o,onRecording:u,isRecording:s,hasAttachment:c,attachmentFiles:f,isDisabled:m,placeholder:h,isMobile:g,recordingStatus:y}){const v=P.useRef(null),b=P.useRef(null),w=n.trim().length>0||c,E=(m||y!==Ft.IDLE)&&!s,T=Ye("rounded-full transition-all duration-200 ",s?"bg-gradient-to-r from-rose-400 via-lavender-500 to-indigo-500 text-white ring-2 ring-white/60 animate-pulse shadow-[0_0_20px_rgba(139,92,246,0.45)]":E?"text-lavender-300 cursor-not-allowed shadow-none":"text-lavender-600 hover:bg-gray-100"),_=M=>{const I=Array.from(M.target.files||[]);I.length>0&&o(I)},A=()=>{m||v.current?.click()},k=M=>{M.key==="Enter"&&!M.shiftKey&&w&&!m&&(M.preventDefault(),i())},q=M=>{M.style.height="auto",M.style.overflow="hidden";const I=M.scrollHeight,Y=40,F=120,$=Math.max(Y,Math.min(I,F));M.style.height=$+"px",I>F?M.style.overflow="auto":M.style.overflow="hidden"},H=M=>{q(M.currentTarget)};return P.useEffect(()=>{b.current&&q(b.current)},[n]),P.useEffect(()=>{!m&&!g&&b.current?.focus()},[m]),O.jsxs("div",{className:"border-t border-white/20 bg-white/70 backdrop-blur-xl px-4 py-2",children:[O.jsx("input",{ref:v,type:"file",multiple:!0,accept:"image/jpeg, image/png, image/jpg, image/tiff, application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/plain, text/markdown, image/heif, image/heic",className:"hidden",onChange:_,disabled:m,title:"Attach file","aria-label":"Attach file"}),O.jsxs("div",{className:Ye("flex items-center gap-2 bg-white/70 backdrop-blur rounded-xl px-4 py-2 shadow-md focus-within:border-lavender-100/50 focus-within:ring-2 focus-within:ring-lavender-400/50 transition-all",s||c?"ring-2 ring-lavender-200/40":"ring-2 ring-lavender-300/40 backdrop-blur-xl",m&&"opacity-60"),children:[c&&f.length>0&&O.jsxs("span",{className:"text-xs text-lavender-600 mr-2",children:[f.length," file(s)"]}),O.jsx(em,{ref:b,onInput:H,placeholder:h,value:n,onChange:M=>l(M.target.value),rows:1,maxLength:1e3,autoFocus:!m,style:{wordBreak:"break-word",overflowWrap:"anywhere",minHeight:"40px",maxHeight:"120px",fontSize:window.innerWidth<=768?"16px":"14px"},onKeyPress:k,disabled:m,title:"Enter your message",className:"flex-1 border-0 outline-none focus-visible:ring-0 focus-visible:ring-offset-0 text-sm !placeholder:text-gray-400 bg-transparent disabled:cursor-not-allowed rounded-none break-words overflow-wrap-anywhere whitespace-pre-wrap"}),O.jsx(kt,{type:"button",variant:"ghost",size:"icon",onClick:A,disabled:m,className:`rounded-full transition-all ${c?"bg-lavender-200/30 text-lavender-600 hover:bg-lavender-200/40":"hover:bg-gray-100 text-lavender-600 hover:text-gray-700"}`,title:"Attach file",children:O.jsx(ES,{className:"w-5 h-5"})}),s?O.jsx(kt,{type:"button",variant:"ghost",size:"icon",onClick:u,className:"rounded-full bg-gradient-to-r from-red-400 to-rose-500 text-white hover:from-red-500 hover:to-rose-600 shadow-lg transition-all duration-200 hover:scale-105 active:scale-95",title:"Stop recording",children:O.jsx(_S,{className:"w-4 h-4"})}):O.jsx(kt,{type:"button",variant:"ghost",size:"icon",onClick:u,disabled:E,className:T,title:"Start recording",children:O.jsx(SS,{className:"w-5 h-5"})}),w&&!m&&O.jsx(kt,{type:"button",size:"icon",onClick:i,className:"h-10 w-10 bg-gradient-to-r from-lavender-400 to-lavender-500 hover:from-lavender-500 hover:to-lavender-600 rounded-full text-white transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95",children:O.jsx(xS,{className:"w-4 h-4"})})]})]})}const m1=Object.freeze(Object.defineProperty({__proto__:null,default:h1},Symbol.toStringTag,{value:"Module"}));function zT(){}function MT(){}function p1(n,l){const i={};return(n[n.length-1]===""?[...n,""]:n).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const g1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,y1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,b1={};function tm(n,l){return(b1.jsx?y1:g1).test(n)}const v1=/[ \t\n\f\r]/g;function S1(n){return typeof n=="object"?n.type==="text"?nm(n.value):!1:nm(n)}function nm(n){return n.replace(v1,"")===""}class Na{constructor(l,i,o){this.normal=i,this.property=l,o&&(this.space=o)}}Na.prototype.normal={},Na.prototype.property={},Na.prototype.space=void 0;function rm(n,l){const i={},o={};for(const u of n)Object.assign(i,u.property),Object.assign(o,u.normal);return new Na(i,o,l)}function Gs(n){return n.toLowerCase()}class Yt{constructor(l,i){this.attribute=i,this.property=l}}Yt.prototype.attribute="",Yt.prototype.booleanish=!1,Yt.prototype.boolean=!1,Yt.prototype.commaOrSpaceSeparated=!1,Yt.prototype.commaSeparated=!1,Yt.prototype.defined=!1,Yt.prototype.mustUseProperty=!1,Yt.prototype.number=!1,Yt.prototype.overloadedBoolean=!1,Yt.prototype.property="",Yt.prototype.spaceSeparated=!1,Yt.prototype.space=void 0;let E1=0;const Pe=Vr(),xt=Vr(),Xs=Vr(),xe=Vr(),ft=Vr(),gi=Vr(),en=Vr();function Vr(){return 2**++E1}const Zs=Object.freeze(Object.defineProperty({__proto__:null,boolean:Pe,booleanish:xt,commaOrSpaceSeparated:en,commaSeparated:gi,number:xe,overloadedBoolean:Xs,spaceSeparated:ft},Symbol.toStringTag,{value:"Module"})),Ks=Object.keys(Zs);class Qs extends Yt{constructor(l,i,o,u){let s=-1;if(super(l,i),im(this,"space",u),typeof o=="number")for(;++s<Ks.length;){const c=Ks[s];im(this,Ks[s],(o&Zs[c])===Zs[c])}}}Qs.prototype.defined=!0;function im(n,l,i){i&&(n[l]=i)}function yi(n){const l={},i={};for(const[o,u]of Object.entries(n.properties)){const s=new Qs(o,n.transform(n.attributes||{},o),u,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(s.mustUseProperty=!0),l[o]=s,i[Gs(o)]=o,i[Gs(s.attribute)]=o}return new Na(l,i,n.space)}const am=yi({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:ft,ariaCurrent:null,ariaDescribedBy:ft,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:ft,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:ft,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ft,ariaLevel:xe,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:ft,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:ft,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:xt,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(n,l){return l==="role"?l:"aria-"+l.slice(4).toLowerCase()}});function lm(n,l){return l in n?n[l]:l}function om(n,l){return lm(n,l.toLowerCase())}const x1=yi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gi,acceptCharset:ft,accessKey:ft,action:null,allow:null,allowFullScreen:Pe,allowPaymentRequest:Pe,allowUserMedia:Pe,alt:null,as:null,async:Pe,autoCapitalize:null,autoComplete:ft,autoFocus:Pe,autoPlay:Pe,blocking:ft,capture:null,charSet:null,checked:Pe,cite:null,className:ft,cols:xe,colSpan:null,content:null,contentEditable:xt,controls:Pe,controlsList:ft,coords:xe|gi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Pe,defer:Pe,dir:null,dirName:null,disabled:Pe,download:Xs,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Pe,formTarget:null,headers:ft,height:xe,hidden:Xs,high:xe,href:null,hrefLang:null,htmlFor:ft,httpEquiv:ft,id:null,imageSizes:null,imageSrcSet:null,inert:Pe,inputMode:null,integrity:null,is:null,isMap:Pe,itemId:null,itemProp:ft,itemRef:ft,itemScope:Pe,itemType:ft,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Pe,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:Pe,muted:Pe,name:null,nonce:null,noModule:Pe,noValidate:Pe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Pe,optimum:xe,pattern:null,ping:ft,placeholder:null,playsInline:Pe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Pe,referrerPolicy:null,rel:ft,required:Pe,reversed:Pe,rows:xe,rowSpan:xe,sandbox:ft,scope:null,scoped:Pe,seamless:Pe,selected:Pe,shadowRootClonable:Pe,shadowRootDelegatesFocus:Pe,shadowRootMode:null,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:Pe,useMap:null,value:xt,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ft,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Pe,declare:Pe,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:Pe,noHref:Pe,noShade:Pe,noWrap:Pe,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:xt,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Pe,disableRemotePlayback:Pe,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:om}),_1=yi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:en,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:ft,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:Pe,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:gi,g2:gi,glyphName:gi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:en,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ft,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:en,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:en,rev:en,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:en,requiredFeatures:en,requiredFonts:en,requiredFormats:en,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:en,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:en,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:en,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lm}),sm=yi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,l){return"xlink:"+l.slice(5).toLowerCase()}}),um=yi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:om}),cm=yi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,l){return"xml:"+l.slice(3).toLowerCase()}}),w1={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},C1=/[A-Z]/g,fm=/-[a-z]/g,T1=/^data[-\w.:]+$/i;function A1(n,l){const i=Gs(l);let o=l,u=Yt;if(i in n.normal)return n.property[n.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&T1.test(l)){if(l.charAt(4)==="-"){const s=l.slice(5).replace(fm,N1);o="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=l.slice(4);if(!fm.test(s)){let c=s.replace(C1,k1);c.charAt(0)!=="-"&&(c="-"+c),l="data"+c}}u=Qs}return new u(o,l)}function k1(n){return"-"+n.toLowerCase()}function N1(n){return n.charAt(1).toUpperCase()}const R1=rm([am,x1,sm,um,cm],"html"),Js=rm([am,_1,sm,um,cm],"svg");function O1(n){return n.join(" ").trim()}var bi={},Ws,dm;function z1(){if(dm)return Ws;dm=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,i=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
44
|
+
`,h="/",g="*",y="",v="comment",b="declaration";function w(T,_){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];_=_||{};var A=1,k=1;function q(C){var V=C.match(l);V&&(A+=V.length);var Z=C.lastIndexOf(m);k=~Z?C.length-Z:k+C.length}function H(){var C={line:A,column:k};return function(V){return V.position=new M(C),F(),V}}function M(C){this.start=C,this.end={line:A,column:k},this.source=_.source}M.prototype.content=T;function I(C){var V=new Error(_.source+":"+A+":"+k+": "+C);if(V.reason=C,V.filename=_.source,V.line=A,V.column=k,V.source=T,!_.silent)throw V}function Y(C){var V=C.exec(T);if(V){var Z=V[0];return q(Z),T=T.slice(Z.length),V}}function F(){Y(i)}function $(C){var V;for(C=C||[];V=ie();)V!==!1&&C.push(V);return C}function ie(){var C=H();if(!(h!=T.charAt(0)||g!=T.charAt(1))){for(var V=2;y!=T.charAt(V)&&(g!=T.charAt(V)||h!=T.charAt(V+1));)++V;if(V+=2,y===T.charAt(V-1))return I("End of comment missing");var Z=T.slice(2,V-2);return k+=2,q(Z),T=T.slice(V),k+=2,C({type:v,comment:Z})}}function D(){var C=H(),V=Y(o);if(V){if(ie(),!Y(u))return I("property missing ':'");var Z=Y(s),Q=C({type:b,property:E(V[0].replace(n,y)),value:Z?E(Z[0].replace(n,y)):y});return Y(c),Q}}function ne(){var C=[];$(C);for(var V;V=D();)V!==!1&&(C.push(V),$(C));return C}return F(),ne()}function E(T){return T?T.replace(f,y):y}return Ws=w,Ws}var hm;function M1(){if(hm)return bi;hm=1;var n=bi&&bi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(bi,"__esModule",{value:!0}),bi.default=i;const l=n(z1());function i(o,u){let s=null;if(!o||typeof o!="string")return s;const c=(0,l.default)(o),f=typeof u=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:g}=m;f?u(h,g,m):g&&(s=s||{},s[h]=g)}),s}return bi}var Ra={},mm;function D1(){if(mm)return Ra;mm=1,Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,i=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,s=function(h){return!h||i.test(h)||n.test(h)},c=function(h,g){return g.toUpperCase()},f=function(h,g){return"".concat(g,"-")},m=function(h,g){return g===void 0&&(g={}),s(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(u,f):h=h.replace(o,f),h.replace(l,c))};return Ra.camelCase=m,Ra}var Oa,pm;function j1(){if(pm)return Oa;pm=1;var n=Oa&&Oa.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},l=n(M1()),i=D1();function o(u,s){var c={};return!u||typeof u!="string"||(0,l.default)(u,function(f,m){f&&m&&(c[(0,i.camelCase)(f,s)]=m)}),c}return o.default=o,Oa=o,Oa}var L1=j1();const I1=ms(L1),gm=ym("end"),$s=ym("start");function ym(n){return l;function l(i){const o=i&&i.position&&i.position[n]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function B1(n){const l=$s(n),i=gm(n);if(l&&i)return{start:l,end:i}}function za(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?bm(n.position):"start"in n||"end"in n?bm(n):"line"in n||"column"in n?eu(n):""}function eu(n){return vm(n&&n.line)+":"+vm(n&&n.column)}function bm(n){return eu(n&&n.start)+"-"+eu(n&&n.end)}function vm(n){return n&&typeof n=="number"?n:1}class Ht extends Error{constructor(l,i,o){super(),typeof i=="string"&&(o=i,i=void 0);let u="",s={},c=!1;if(i&&("line"in i&&"column"in i?s={place:i}:"start"in i&&"end"in i?s={place:i}:"type"in i?s={ancestors:[i],place:i.position}:s={...i}),typeof l=="string"?u=l:!s.cause&&l&&(c=!0,u=l.message,s.cause=l),!s.ruleId&&!s.source&&typeof o=="string"){const m=o.indexOf(":");m===-1?s.ruleId=o:(s.source=o.slice(0,m),s.ruleId=o.slice(m+1))}if(!s.place&&s.ancestors&&s.ancestors){const m=s.ancestors[s.ancestors.length-1];m&&(s.place=m.position)}const f=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=f?f.line:void 0,this.name=za(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=c&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ht.prototype.file="",Ht.prototype.name="",Ht.prototype.reason="",Ht.prototype.message="",Ht.prototype.stack="",Ht.prototype.column=void 0,Ht.prototype.line=void 0,Ht.prototype.ancestors=void 0,Ht.prototype.cause=void 0,Ht.prototype.fatal=void 0,Ht.prototype.place=void 0,Ht.prototype.ruleId=void 0,Ht.prototype.source=void 0;const tu={}.hasOwnProperty,U1=new Map,H1=/[A-Z]/g,q1=new Set(["table","tbody","thead","tfoot","tr"]),P1=new Set(["td","th"]),Sm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function F1(n,l){if(!l||l.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=l.filePath||void 0;let o;if(l.development){if(typeof l.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=J1(i,l.jsxDEV)}else{if(typeof l.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof l.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=Q1(i,l.jsx,l.jsxs)}const u={Fragment:l.Fragment,ancestors:[],components:l.components||{},create:o,elementAttributeNameCase:l.elementAttributeNameCase||"react",evaluater:l.createEvaluater?l.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:l.ignoreInvalidStyle||!1,passKeys:l.passKeys!==!1,passNode:l.passNode||!1,schema:l.space==="svg"?Js:R1,stylePropertyNameCase:l.stylePropertyNameCase||"dom",tableCellAlignToStyle:l.tableCellAlignToStyle!==!1},s=Em(u,n,void 0);return s&&typeof s!="string"?s:u.create(n,u.Fragment,{children:s||void 0},void 0)}function Em(n,l,i){if(l.type==="element")return Y1(n,l,i);if(l.type==="mdxFlowExpression"||l.type==="mdxTextExpression")return V1(n,l);if(l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement")return X1(n,l,i);if(l.type==="mdxjsEsm")return G1(n,l);if(l.type==="root")return Z1(n,l,i);if(l.type==="text")return K1(n,l)}function Y1(n,l,i){const o=n.schema;let u=o;l.tagName.toLowerCase()==="svg"&&o.space==="html"&&(u=Js,n.schema=u),n.ancestors.push(l);const s=_m(n,l.tagName,!1),c=W1(n,l);let f=ru(n,l);return q1.has(l.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!S1(m):!0})),xm(n,c,s,l),nu(c,f),n.ancestors.pop(),n.schema=o,n.create(l,s,c,i)}function V1(n,l){if(l.data&&l.data.estree&&n.evaluater){const o=l.data.estree.body[0];return o.type,n.evaluater.evaluateExpression(o.expression)}Ma(n,l.position)}function G1(n,l){if(l.data&&l.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(l.data.estree);Ma(n,l.position)}function X1(n,l,i){const o=n.schema;let u=o;l.name==="svg"&&o.space==="html"&&(u=Js,n.schema=u),n.ancestors.push(l);const s=l.name===null?n.Fragment:_m(n,l.name,!0),c=$1(n,l),f=ru(n,l);return xm(n,c,s,l),nu(c,f),n.ancestors.pop(),n.schema=o,n.create(l,s,c,i)}function Z1(n,l,i){const o={};return nu(o,ru(n,l)),n.create(l,n.Fragment,o,i)}function K1(n,l){return l.value}function xm(n,l,i,o){typeof i!="string"&&i!==n.Fragment&&n.passNode&&(l.node=o)}function nu(n,l){if(l.length>0){const i=l.length>1?l:l[0];i&&(n.children=i)}}function Q1(n,l,i){return o;function o(u,s,c,f){const h=Array.isArray(c.children)?i:l;return f?h(s,c,f):h(s,c)}}function J1(n,l){return i;function i(o,u,s,c){const f=Array.isArray(s.children),m=$s(o);return l(u,s,c,f,{columnNumber:m?m.column-1:void 0,fileName:n,lineNumber:m?m.line:void 0},void 0)}}function W1(n,l){const i={};let o,u;for(u in l.properties)if(u!=="children"&&tu.call(l.properties,u)){const s=eE(n,u,l.properties[u]);if(s){const[c,f]=s;n.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&P1.has(l.tagName)?o=f:i[c]=f}}if(o){const s=i.style||(i.style={});s[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return i}function $1(n,l){const i={};for(const o of l.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&n.evaluater){const s=o.data.estree.body[0];s.type;const c=s.expression;c.type;const f=c.properties[0];f.type,Object.assign(i,n.evaluater.evaluateExpression(f.argument))}else Ma(n,l.position);else{const u=o.name;let s;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&n.evaluater){const f=o.value.data.estree.body[0];f.type,s=n.evaluater.evaluateExpression(f.expression)}else Ma(n,l.position);else s=o.value===null?!0:o.value;i[u]=s}return i}function ru(n,l){const i=[];let o=-1;const u=n.passKeys?new Map:U1;for(;++o<l.children.length;){const s=l.children[o];let c;if(n.passKeys){const m=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(m){const h=u.get(m)||0;c=m+"-"+h,u.set(m,h+1)}}const f=Em(n,s,c);f!==void 0&&i.push(f)}return i}function eE(n,l,i){const o=A1(n.schema,l);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=o.commaSeparated?p1(i):O1(i)),o.property==="style"){let u=typeof i=="object"?i:tE(n,String(i));return n.stylePropertyNameCase==="css"&&(u=nE(u)),["style",u]}return[n.elementAttributeNameCase==="react"&&o.space?w1[o.property]||o.property:o.attribute,i]}}function tE(n,l){try{return I1(l,{reactCompat:!0})}catch(i){if(n.ignoreInvalidStyle)return{};const o=i,u=new Ht("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=n.filePath||void 0,u.url=Sm+"#cannot-parse-style-attribute",u}}function _m(n,l,i){let o;if(!i)o={type:"Literal",value:l};else if(l.includes(".")){const u=l.split(".");let s=-1,c;for(;++s<u.length;){const f=tm(u[s])?{type:"Identifier",name:u[s]}:{type:"Literal",value:u[s]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(s&&f.type==="Literal"),optional:!1}:f}o=c}else o=tm(l)&&!/^[a-z]/.test(l)?{type:"Identifier",name:l}:{type:"Literal",value:l};if(o.type==="Literal"){const u=o.value;return tu.call(n.components,u)?n.components[u]:u}if(n.evaluater)return n.evaluater.evaluateExpression(o);Ma(n)}function Ma(n,l){const i=new Ht("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:l,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=n.filePath||void 0,i.url=Sm+"#cannot-handle-mdx-estrees-without-createevaluater",i}function nE(n){const l={};let i;for(i in n)tu.call(n,i)&&(l[rE(i)]=n[i]);return l}function rE(n){let l=n.replace(H1,iE);return l.slice(0,3)==="ms-"&&(l="-"+l),l}function iE(n){return"-"+n.toLowerCase()}const iu={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},aE={};function lE(n,l){const i=aE,o=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,u=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return wm(n,o,u)}function wm(n,l,i){if(oE(n)){if("value"in n)return n.type==="html"&&!i?"":n.value;if(l&&"alt"in n&&n.alt)return n.alt;if("children"in n)return Cm(n.children,l,i)}return Array.isArray(n)?Cm(n,l,i):""}function Cm(n,l,i){const o=[];let u=-1;for(;++u<n.length;)o[u]=wm(n[u],l,i);return o.join("")}function oE(n){return!!(n&&typeof n=="object")}const Tm=document.createElement("i");function au(n){const l="&"+n+";";Tm.innerHTML=l;const i=Tm.textContent;return i.charCodeAt(i.length-1)===59&&n!=="semi"||i===l?!1:i}function zn(n,l,i,o){const u=n.length;let s=0,c;if(l<0?l=-l>u?0:u+l:l=l>u?u:l,i=i>0?i:0,o.length<1e4)c=Array.from(o),c.unshift(l,i),n.splice(...c);else for(i&&n.splice(l,i);s<o.length;)c=o.slice(s,s+1e4),c.unshift(l,0),n.splice(...c),s+=1e4,l+=1e4}function dn(n,l){return n.length>0?(zn(n,n.length,0,l),n):l}const Am={}.hasOwnProperty;function sE(n){const l={};let i=-1;for(;++i<n.length;)uE(l,n[i]);return l}function uE(n,l){let i;for(i in l){const u=(Am.call(n,i)?n[i]:void 0)||(n[i]={}),s=l[i];let c;if(s)for(c in s){Am.call(u,c)||(u[c]=[]);const f=s[c];cE(u[c],Array.isArray(f)?f:f?[f]:[])}}}function cE(n,l){let i=-1;const o=[];for(;++i<l.length;)(l[i].add==="after"?n:o).push(l[i]);zn(n,0,0,o)}function km(n,l){const i=Number.parseInt(n,l);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function vi(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Mn=dr(/[A-Za-z]/),tn=dr(/[\dA-Za-z]/),fE=dr(/[#-'*+\--9=?A-Z^-~]/);function lu(n){return n!==null&&(n<32||n===127)}const ou=dr(/\d/),dE=dr(/[\dA-Fa-f]/),hE=dr(/[!-/:-@[-`{-~]/);function Be(n){return n!==null&&n<-2}function Vt(n){return n!==null&&(n<0||n===32)}function rt(n){return n===-2||n===-1||n===32}const mE=dr(new RegExp("\\p{P}|\\p{S}","u")),pE=dr(/\s/);function dr(n){return l;function l(i){return i!==null&&i>-1&&n.test(String.fromCharCode(i))}}function Si(n){const l=[];let i=-1,o=0,u=0;for(;++i<n.length;){const s=n.charCodeAt(i);let c="";if(s===37&&tn(n.charCodeAt(i+1))&&tn(n.charCodeAt(i+2)))u=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(c=String.fromCharCode(s));else if(s>55295&&s<57344){const f=n.charCodeAt(i+1);s<56320&&f>56319&&f<57344?(c=String.fromCharCode(s,f),u=1):c="�"}else c=String.fromCharCode(s);c&&(l.push(n.slice(o,i),encodeURIComponent(c)),o=i+u+1,c=""),u&&(i+=u,u=0)}return l.join("")+n.slice(o)}function dt(n,l,i,o){const u=o?o-1:Number.POSITIVE_INFINITY;let s=0;return c;function c(m){return rt(m)?(n.enter(i),f(m)):l(m)}function f(m){return rt(m)&&s++<u?(n.consume(m),f):(n.exit(i),l(m))}}const gE={tokenize:yE};function yE(n){const l=n.attempt(this.parser.constructs.contentInitial,o,u);let i;return l;function o(f){if(f===null){n.consume(f);return}return n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),dt(n,l,"linePrefix")}function u(f){return n.enter("paragraph"),s(f)}function s(f){const m=n.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=m),i=m,c(f)}function c(f){if(f===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(f);return}return Be(f)?(n.consume(f),n.exit("chunkText"),s):(n.consume(f),c)}}const bE={tokenize:vE},Nm={tokenize:SE};function vE(n){const l=this,i=[];let o=0,u,s,c;return f;function f(k){if(o<i.length){const q=i[o];return l.containerState=q[1],n.attempt(q[0].continuation,m,h)(k)}return h(k)}function m(k){if(o++,l.containerState._closeFlow){l.containerState._closeFlow=void 0,u&&A();const q=l.events.length;let H=q,M;for(;H--;)if(l.events[H][0]==="exit"&&l.events[H][1].type==="chunkFlow"){M=l.events[H][1].end;break}_(o);let I=q;for(;I<l.events.length;)l.events[I][1].end={...M},I++;return zn(l.events,H+1,0,l.events.slice(q)),l.events.length=I,h(k)}return f(k)}function h(k){if(o===i.length){if(!u)return v(k);if(u.currentConstruct&&u.currentConstruct.concrete)return w(k);l.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return l.containerState={},n.check(Nm,g,y)(k)}function g(k){return u&&A(),_(o),v(k)}function y(k){return l.parser.lazy[l.now().line]=o!==i.length,c=l.now().offset,w(k)}function v(k){return l.containerState={},n.attempt(Nm,b,w)(k)}function b(k){return o++,i.push([l.currentConstruct,l.containerState]),v(k)}function w(k){if(k===null){u&&A(),_(0),n.consume(k);return}return u=u||l.parser.flow(l.now()),n.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:s}),E(k)}function E(k){if(k===null){T(n.exit("chunkFlow"),!0),_(0),n.consume(k);return}return Be(k)?(n.consume(k),T(n.exit("chunkFlow")),o=0,l.interrupt=void 0,f):(n.consume(k),E)}function T(k,q){const H=l.sliceStream(k);if(q&&H.push(null),k.previous=s,s&&(s.next=k),s=k,u.defineSkip(k.start),u.write(H),l.parser.lazy[k.start.line]){let M=u.events.length;for(;M--;)if(u.events[M][1].start.offset<c&&(!u.events[M][1].end||u.events[M][1].end.offset>c))return;const I=l.events.length;let Y=I,F,$;for(;Y--;)if(l.events[Y][0]==="exit"&&l.events[Y][1].type==="chunkFlow"){if(F){$=l.events[Y][1].end;break}F=!0}for(_(o),M=I;M<l.events.length;)l.events[M][1].end={...$},M++;zn(l.events,Y+1,0,l.events.slice(I)),l.events.length=M}}function _(k){let q=i.length;for(;q-- >k;){const H=i[q];l.containerState=H[1],H[0].exit.call(l,n)}i.length=k}function A(){u.write([null]),s=void 0,u=void 0,l.containerState._closeFlow=void 0}}function SE(n,l,i){return dt(n,n.attempt(this.parser.constructs.document,l,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Rm(n){if(n===null||Vt(n)||pE(n))return 1;if(mE(n))return 2}function su(n,l,i){const o=[];let u=-1;for(;++u<n.length;){const s=n[u].resolveAll;s&&!o.includes(s)&&(l=s(l,i),o.push(s))}return l}const uu={name:"attention",resolveAll:EE,tokenize:xE};function EE(n,l){let i=-1,o,u,s,c,f,m,h,g;for(;++i<n.length;)if(n[i][0]==="enter"&&n[i][1].type==="attentionSequence"&&n[i][1]._close){for(o=i;o--;)if(n[o][0]==="exit"&&n[o][1].type==="attentionSequence"&&n[o][1]._open&&l.sliceSerialize(n[o][1]).charCodeAt(0)===l.sliceSerialize(n[i][1]).charCodeAt(0)){if((n[o][1]._close||n[i][1]._open)&&(n[i][1].end.offset-n[i][1].start.offset)%3&&!((n[o][1].end.offset-n[o][1].start.offset+n[i][1].end.offset-n[i][1].start.offset)%3))continue;m=n[o][1].end.offset-n[o][1].start.offset>1&&n[i][1].end.offset-n[i][1].start.offset>1?2:1;const y={...n[o][1].end},v={...n[i][1].start};Om(y,-m),Om(v,m),c={type:m>1?"strongSequence":"emphasisSequence",start:y,end:{...n[o][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...n[i][1].start},end:v},s={type:m>1?"strongText":"emphasisText",start:{...n[o][1].end},end:{...n[i][1].start}},u={type:m>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},n[o][1].end={...c.start},n[i][1].start={...f.end},h=[],n[o][1].end.offset-n[o][1].start.offset&&(h=dn(h,[["enter",n[o][1],l],["exit",n[o][1],l]])),h=dn(h,[["enter",u,l],["enter",c,l],["exit",c,l],["enter",s,l]]),h=dn(h,su(l.parser.constructs.insideSpan.null,n.slice(o+1,i),l)),h=dn(h,[["exit",s,l],["enter",f,l],["exit",f,l],["exit",u,l]]),n[i][1].end.offset-n[i][1].start.offset?(g=2,h=dn(h,[["enter",n[i][1],l],["exit",n[i][1],l]])):g=0,zn(n,o-1,i-o+3,h),i=o+h.length-g-2;break}}for(i=-1;++i<n.length;)n[i][1].type==="attentionSequence"&&(n[i][1].type="data");return n}function xE(n,l){const i=this.parser.constructs.attentionMarkers.null,o=this.previous,u=Rm(o);let s;return c;function c(m){return s=m,n.enter("attentionSequence"),f(m)}function f(m){if(m===s)return n.consume(m),f;const h=n.exit("attentionSequence"),g=Rm(m),y=!g||g===2&&u||i.includes(m),v=!u||u===2&&g||i.includes(o);return h._open=!!(s===42?y:y&&(u||!v)),h._close=!!(s===42?v:v&&(g||!y)),l(m)}}function Om(n,l){n.column+=l,n.offset+=l,n._bufferIndex+=l}const _E={name:"autolink",tokenize:wE};function wE(n,l,i){let o=0;return u;function u(b){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(b),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),s}function s(b){return Mn(b)?(n.consume(b),c):b===64?i(b):h(b)}function c(b){return b===43||b===45||b===46||tn(b)?(o=1,f(b)):h(b)}function f(b){return b===58?(n.consume(b),o=0,m):(b===43||b===45||b===46||tn(b))&&o++<32?(n.consume(b),f):(o=0,h(b))}function m(b){return b===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(b),n.exit("autolinkMarker"),n.exit("autolink"),l):b===null||b===32||b===60||lu(b)?i(b):(n.consume(b),m)}function h(b){return b===64?(n.consume(b),g):fE(b)?(n.consume(b),h):i(b)}function g(b){return tn(b)?y(b):i(b)}function y(b){return b===46?(n.consume(b),o=0,g):b===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(b),n.exit("autolinkMarker"),n.exit("autolink"),l):v(b)}function v(b){if((b===45||tn(b))&&o++<63){const w=b===45?v:y;return n.consume(b),w}return i(b)}}const Fl={partial:!0,tokenize:CE};function CE(n,l,i){return o;function o(s){return rt(s)?dt(n,u,"linePrefix")(s):u(s)}function u(s){return s===null||Be(s)?l(s):i(s)}}const zm={continuation:{tokenize:AE},exit:kE,name:"blockQuote",tokenize:TE};function TE(n,l,i){const o=this;return u;function u(c){if(c===62){const f=o.containerState;return f.open||(n.enter("blockQuote",{_container:!0}),f.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(c),n.exit("blockQuoteMarker"),s}return i(c)}function s(c){return rt(c)?(n.enter("blockQuotePrefixWhitespace"),n.consume(c),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),l):(n.exit("blockQuotePrefix"),l(c))}}function AE(n,l,i){const o=this;return u;function u(c){return rt(c)?dt(n,s,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):s(c)}function s(c){return n.attempt(zm,l,i)(c)}}function kE(n){n.exit("blockQuote")}const Mm={name:"characterEscape",tokenize:NE};function NE(n,l,i){return o;function o(s){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(s),n.exit("escapeMarker"),u}function u(s){return hE(s)?(n.enter("characterEscapeValue"),n.consume(s),n.exit("characterEscapeValue"),n.exit("characterEscape"),l):i(s)}}const Dm={name:"characterReference",tokenize:RE};function RE(n,l,i){const o=this;let u=0,s,c;return f;function f(y){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(y),n.exit("characterReferenceMarker"),m}function m(y){return y===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(y),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),s=31,c=tn,g(y))}function h(y){return y===88||y===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(y),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),s=6,c=dE,g):(n.enter("characterReferenceValue"),s=7,c=ou,g(y))}function g(y){if(y===59&&u){const v=n.exit("characterReferenceValue");return c===tn&&!au(o.sliceSerialize(v))?i(y):(n.enter("characterReferenceMarker"),n.consume(y),n.exit("characterReferenceMarker"),n.exit("characterReference"),l)}return c(y)&&u++<s?(n.consume(y),g):i(y)}}const jm={partial:!0,tokenize:zE},Lm={concrete:!0,name:"codeFenced",tokenize:OE};function OE(n,l,i){const o=this,u={partial:!0,tokenize:H};let s=0,c=0,f;return m;function m(M){return h(M)}function h(M){const I=o.events[o.events.length-1];return s=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,f=M,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),g(M)}function g(M){return M===f?(c++,n.consume(M),g):c<3?i(M):(n.exit("codeFencedFenceSequence"),rt(M)?dt(n,y,"whitespace")(M):y(M))}function y(M){return M===null||Be(M)?(n.exit("codeFencedFence"),o.interrupt?l(M):n.check(jm,E,q)(M)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),v(M))}function v(M){return M===null||Be(M)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),y(M)):rt(M)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),dt(n,b,"whitespace")(M)):M===96&&M===f?i(M):(n.consume(M),v)}function b(M){return M===null||Be(M)?y(M):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),w(M))}function w(M){return M===null||Be(M)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),y(M)):M===96&&M===f?i(M):(n.consume(M),w)}function E(M){return n.attempt(u,q,T)(M)}function T(M){return n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),_}function _(M){return s>0&&rt(M)?dt(n,A,"linePrefix",s+1)(M):A(M)}function A(M){return M===null||Be(M)?n.check(jm,E,q)(M):(n.enter("codeFlowValue"),k(M))}function k(M){return M===null||Be(M)?(n.exit("codeFlowValue"),A(M)):(n.consume(M),k)}function q(M){return n.exit("codeFenced"),l(M)}function H(M,I,Y){let F=0;return $;function $(V){return M.enter("lineEnding"),M.consume(V),M.exit("lineEnding"),ie}function ie(V){return M.enter("codeFencedFence"),rt(V)?dt(M,D,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):D(V)}function D(V){return V===f?(M.enter("codeFencedFenceSequence"),ne(V)):Y(V)}function ne(V){return V===f?(F++,M.consume(V),ne):F>=c?(M.exit("codeFencedFenceSequence"),rt(V)?dt(M,C,"whitespace")(V):C(V)):Y(V)}function C(V){return V===null||Be(V)?(M.exit("codeFencedFence"),I(V)):Y(V)}}}function zE(n,l,i){const o=this;return u;function u(c){return c===null?i(c):(n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),s)}function s(c){return o.parser.lazy[o.now().line]?i(c):l(c)}}const cu={name:"codeIndented",tokenize:DE},ME={partial:!0,tokenize:jE};function DE(n,l,i){const o=this;return u;function u(h){return n.enter("codeIndented"),dt(n,s,"linePrefix",5)(h)}function s(h){const g=o.events[o.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(h):i(h)}function c(h){return h===null?m(h):Be(h)?n.attempt(ME,c,m)(h):(n.enter("codeFlowValue"),f(h))}function f(h){return h===null||Be(h)?(n.exit("codeFlowValue"),c(h)):(n.consume(h),f)}function m(h){return n.exit("codeIndented"),l(h)}}function jE(n,l,i){const o=this;return u;function u(c){return o.parser.lazy[o.now().line]?i(c):Be(c)?(n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),u):dt(n,s,"linePrefix",5)(c)}function s(c){const f=o.events[o.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(c):Be(c)?u(c):i(c)}}const LE={name:"codeText",previous:BE,resolve:IE,tokenize:UE};function IE(n){let l=n.length-4,i=3,o,u;if((n[i][1].type==="lineEnding"||n[i][1].type==="space")&&(n[l][1].type==="lineEnding"||n[l][1].type==="space")){for(o=i;++o<l;)if(n[o][1].type==="codeTextData"){n[i][1].type="codeTextPadding",n[l][1].type="codeTextPadding",i+=2,l-=2;break}}for(o=i-1,l++;++o<=l;)u===void 0?o!==l&&n[o][1].type!=="lineEnding"&&(u=o):(o===l||n[o][1].type==="lineEnding")&&(n[u][1].type="codeTextData",o!==u+2&&(n[u][1].end=n[o-1][1].end,n.splice(u+2,o-u-2),l-=o-u-2,o=u+2),u=void 0);return n}function BE(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function UE(n,l,i){let o=0,u,s;return c;function c(y){return n.enter("codeText"),n.enter("codeTextSequence"),f(y)}function f(y){return y===96?(n.consume(y),o++,f):(n.exit("codeTextSequence"),m(y))}function m(y){return y===null?i(y):y===32?(n.enter("space"),n.consume(y),n.exit("space"),m):y===96?(s=n.enter("codeTextSequence"),u=0,g(y)):Be(y)?(n.enter("lineEnding"),n.consume(y),n.exit("lineEnding"),m):(n.enter("codeTextData"),h(y))}function h(y){return y===null||y===32||y===96||Be(y)?(n.exit("codeTextData"),m(y)):(n.consume(y),h)}function g(y){return y===96?(n.consume(y),u++,g):u===o?(n.exit("codeTextSequence"),n.exit("codeText"),l(y)):(s.type="codeTextData",h(y))}}class HE{constructor(l){this.left=l?[...l]:[],this.right=[]}get(l){if(l<0||l>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+l+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return l<this.left.length?this.left[l]:this.right[this.right.length-l+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(l,i){const o=i??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(l,o):l>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-l+this.left.length).reverse():this.left.slice(l).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(l,i,o){const u=i||0;this.setCursor(Math.trunc(l));const s=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return o&&Da(this.left,o),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(l){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(l)}pushMany(l){this.setCursor(Number.POSITIVE_INFINITY),Da(this.left,l)}unshift(l){this.setCursor(0),this.right.push(l)}unshiftMany(l){this.setCursor(0),Da(this.right,l.reverse())}setCursor(l){if(!(l===this.left.length||l>this.left.length&&this.right.length===0||l<0&&this.left.length===0))if(l<this.left.length){const i=this.left.splice(l,Number.POSITIVE_INFINITY);Da(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-l,Number.POSITIVE_INFINITY);Da(this.left,i.reverse())}}}function Da(n,l){let i=0;if(l.length<1e4)n.push(...l);else for(;i<l.length;)n.push(...l.slice(i,i+1e4)),i+=1e4}function Im(n){const l={};let i=-1,o,u,s,c,f,m,h;const g=new HE(n);for(;++i<g.length;){for(;i in l;)i=l[i];if(o=g.get(i),i&&o[1].type==="chunkFlow"&&g.get(i-1)[1].type==="listItemPrefix"&&(m=o[1]._tokenizer.events,s=0,s<m.length&&m[s][1].type==="lineEndingBlank"&&(s+=2),s<m.length&&m[s][1].type==="content"))for(;++s<m.length&&m[s][1].type!=="content";)m[s][1].type==="chunkText"&&(m[s][1]._isInFirstContentOfListItem=!0,s++);if(o[0]==="enter")o[1].contentType&&(Object.assign(l,qE(g,i)),i=l[i],h=!0);else if(o[1]._container){for(s=i,u=void 0;s--;)if(c=g.get(s),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(u&&(g.get(u)[1].type="lineEndingBlank"),c[1].type="lineEnding",u=s);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;u&&(o[1].end={...g.get(u)[1].start},f=g.slice(u,i),f.unshift(o),g.splice(u,i-u+1,f))}}return zn(n,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function qE(n,l){const i=n.get(l)[1],o=n.get(l)[2];let u=l-1;const s=[];let c=i._tokenizer;c||(c=o.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,m=[],h={};let g,y,v=-1,b=i,w=0,E=0;const T=[E];for(;b;){for(;n.get(++u)[1]!==b;);s.push(u),b._tokenizer||(g=o.sliceStream(b),b.next||g.push(null),y&&c.defineSkip(b.start),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),y=b,b=b.next}for(b=i;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(E=v+1,T.push(E),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(c.events=[],b?(b._tokenizer=void 0,b.previous=void 0):T.pop(),v=T.length;v--;){const _=f.slice(T[v],T[v+1]),A=s.pop();m.push([A,A+_.length-1]),n.splice(A,2,_)}for(m.reverse(),v=-1;++v<m.length;)h[w+m[v][0]]=w+m[v][1],w+=m[v][1]-m[v][0]-1;return h}const PE={resolve:YE,tokenize:VE},FE={partial:!0,tokenize:GE};function YE(n){return Im(n),n}function VE(n,l){let i;return o;function o(f){return n.enter("content"),i=n.enter("chunkContent",{contentType:"content"}),u(f)}function u(f){return f===null?s(f):Be(f)?n.check(FE,c,s)(f):(n.consume(f),u)}function s(f){return n.exit("chunkContent"),n.exit("content"),l(f)}function c(f){return n.consume(f),n.exit("chunkContent"),i.next=n.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,u}}function GE(n,l,i){const o=this;return u;function u(c){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),dt(n,s,"linePrefix")}function s(c){if(c===null||Be(c))return i(c);const f=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(c):n.interrupt(o.parser.constructs.flow,i,l)(c)}}function Bm(n,l,i,o,u,s,c,f,m){const h=m||Number.POSITIVE_INFINITY;let g=0;return y;function y(_){return _===60?(n.enter(o),n.enter(u),n.enter(s),n.consume(_),n.exit(s),v):_===null||_===32||_===41||lu(_)?i(_):(n.enter(o),n.enter(c),n.enter(f),n.enter("chunkString",{contentType:"string"}),E(_))}function v(_){return _===62?(n.enter(s),n.consume(_),n.exit(s),n.exit(u),n.exit(o),l):(n.enter(f),n.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(n.exit("chunkString"),n.exit(f),v(_)):_===null||_===60||Be(_)?i(_):(n.consume(_),_===92?w:b)}function w(_){return _===60||_===62||_===92?(n.consume(_),b):b(_)}function E(_){return!g&&(_===null||_===41||Vt(_))?(n.exit("chunkString"),n.exit(f),n.exit(c),n.exit(o),l(_)):g<h&&_===40?(n.consume(_),g++,E):_===41?(n.consume(_),g--,E):_===null||_===32||_===40||lu(_)?i(_):(n.consume(_),_===92?T:E)}function T(_){return _===40||_===41||_===92?(n.consume(_),E):E(_)}}function Um(n,l,i,o,u,s){const c=this;let f=0,m;return h;function h(b){return n.enter(o),n.enter(u),n.consume(b),n.exit(u),n.enter(s),g}function g(b){return f>999||b===null||b===91||b===93&&!m||b===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?i(b):b===93?(n.exit(s),n.enter(u),n.consume(b),n.exit(u),n.exit(o),l):Be(b)?(n.enter("lineEnding"),n.consume(b),n.exit("lineEnding"),g):(n.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===null||b===91||b===93||Be(b)||f++>999?(n.exit("chunkString"),g(b)):(n.consume(b),m||(m=!rt(b)),b===92?v:y)}function v(b){return b===91||b===92||b===93?(n.consume(b),f++,y):y(b)}}function Hm(n,l,i,o,u,s){let c;return f;function f(v){return v===34||v===39||v===40?(n.enter(o),n.enter(u),n.consume(v),n.exit(u),c=v===40?41:v,m):i(v)}function m(v){return v===c?(n.enter(u),n.consume(v),n.exit(u),n.exit(o),l):(n.enter(s),h(v))}function h(v){return v===c?(n.exit(s),m(c)):v===null?i(v):Be(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),dt(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===c||v===null||Be(v)?(n.exit("chunkString"),h(v)):(n.consume(v),v===92?y:g)}function y(v){return v===c||v===92?(n.consume(v),g):g(v)}}function ja(n,l){let i;return o;function o(u){return Be(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),i=!0,o):rt(u)?dt(n,o,i?"linePrefix":"lineSuffix")(u):l(u)}}const XE={name:"definition",tokenize:KE},ZE={partial:!0,tokenize:QE};function KE(n,l,i){const o=this;let u;return s;function s(b){return n.enter("definition"),c(b)}function c(b){return Um.call(o,n,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return u=vi(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),b===58?(n.enter("definitionMarker"),n.consume(b),n.exit("definitionMarker"),m):i(b)}function m(b){return Vt(b)?ja(n,h)(b):h(b)}function h(b){return Bm(n,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return n.attempt(ZE,y,y)(b)}function y(b){return rt(b)?dt(n,v,"whitespace")(b):v(b)}function v(b){return b===null||Be(b)?(n.exit("definition"),o.parser.defined.push(u),l(b)):i(b)}}function QE(n,l,i){return o;function o(f){return Vt(f)?ja(n,u)(f):i(f)}function u(f){return Hm(n,s,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function s(f){return rt(f)?dt(n,c,"whitespace")(f):c(f)}function c(f){return f===null||Be(f)?l(f):i(f)}}const JE={name:"hardBreakEscape",tokenize:WE};function WE(n,l,i){return o;function o(s){return n.enter("hardBreakEscape"),n.consume(s),u}function u(s){return Be(s)?(n.exit("hardBreakEscape"),l(s)):i(s)}}const $E={name:"headingAtx",resolve:ex,tokenize:tx};function ex(n,l){let i=n.length-2,o=3,u,s;return n[o][1].type==="whitespace"&&(o+=2),i-2>o&&n[i][1].type==="whitespace"&&(i-=2),n[i][1].type==="atxHeadingSequence"&&(o===i-1||i-4>o&&n[i-2][1].type==="whitespace")&&(i-=o+1===i?2:4),i>o&&(u={type:"atxHeadingText",start:n[o][1].start,end:n[i][1].end},s={type:"chunkText",start:n[o][1].start,end:n[i][1].end,contentType:"text"},zn(n,o,i-o+1,[["enter",u,l],["enter",s,l],["exit",s,l],["exit",u,l]])),n}function tx(n,l,i){let o=0;return u;function u(g){return n.enter("atxHeading"),s(g)}function s(g){return n.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&o++<6?(n.consume(g),c):g===null||Vt(g)?(n.exit("atxHeadingSequence"),f(g)):i(g)}function f(g){return g===35?(n.enter("atxHeadingSequence"),m(g)):g===null||Be(g)?(n.exit("atxHeading"),l(g)):rt(g)?dt(n,f,"whitespace")(g):(n.enter("atxHeadingText"),h(g))}function m(g){return g===35?(n.consume(g),m):(n.exit("atxHeadingSequence"),f(g))}function h(g){return g===null||g===35||Vt(g)?(n.exit("atxHeadingText"),f(g)):(n.consume(g),h)}}const nx=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],qm=["pre","script","style","textarea"],rx={concrete:!0,name:"htmlFlow",resolveTo:lx,tokenize:ox},ix={partial:!0,tokenize:ux},ax={partial:!0,tokenize:sx};function lx(n){let l=n.length;for(;l--&&!(n[l][0]==="enter"&&n[l][1].type==="htmlFlow"););return l>1&&n[l-2][1].type==="linePrefix"&&(n[l][1].start=n[l-2][1].start,n[l+1][1].start=n[l-2][1].start,n.splice(l-2,2)),n}function ox(n,l,i){const o=this;let u,s,c,f,m;return h;function h(z){return g(z)}function g(z){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(z),y}function y(z){return z===33?(n.consume(z),v):z===47?(n.consume(z),s=!0,E):z===63?(n.consume(z),u=3,o.interrupt?l:L):Mn(z)?(n.consume(z),c=String.fromCharCode(z),T):i(z)}function v(z){return z===45?(n.consume(z),u=2,b):z===91?(n.consume(z),u=5,f=0,w):Mn(z)?(n.consume(z),u=4,o.interrupt?l:L):i(z)}function b(z){return z===45?(n.consume(z),o.interrupt?l:L):i(z)}function w(z){const re="CDATA[";return z===re.charCodeAt(f++)?(n.consume(z),f===re.length?o.interrupt?l:D:w):i(z)}function E(z){return Mn(z)?(n.consume(z),c=String.fromCharCode(z),T):i(z)}function T(z){if(z===null||z===47||z===62||Vt(z)){const re=z===47,ce=c.toLowerCase();return!re&&!s&&qm.includes(ce)?(u=1,o.interrupt?l(z):D(z)):nx.includes(c.toLowerCase())?(u=6,re?(n.consume(z),_):o.interrupt?l(z):D(z)):(u=7,o.interrupt&&!o.parser.lazy[o.now().line]?i(z):s?A(z):k(z))}return z===45||tn(z)?(n.consume(z),c+=String.fromCharCode(z),T):i(z)}function _(z){return z===62?(n.consume(z),o.interrupt?l:D):i(z)}function A(z){return rt(z)?(n.consume(z),A):$(z)}function k(z){return z===47?(n.consume(z),$):z===58||z===95||Mn(z)?(n.consume(z),q):rt(z)?(n.consume(z),k):$(z)}function q(z){return z===45||z===46||z===58||z===95||tn(z)?(n.consume(z),q):H(z)}function H(z){return z===61?(n.consume(z),M):rt(z)?(n.consume(z),H):k(z)}function M(z){return z===null||z===60||z===61||z===62||z===96?i(z):z===34||z===39?(n.consume(z),m=z,I):rt(z)?(n.consume(z),M):Y(z)}function I(z){return z===m?(n.consume(z),m=null,F):z===null||Be(z)?i(z):(n.consume(z),I)}function Y(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Vt(z)?H(z):(n.consume(z),Y)}function F(z){return z===47||z===62||rt(z)?k(z):i(z)}function $(z){return z===62?(n.consume(z),ie):i(z)}function ie(z){return z===null||Be(z)?D(z):rt(z)?(n.consume(z),ie):i(z)}function D(z){return z===45&&u===2?(n.consume(z),Z):z===60&&u===1?(n.consume(z),Q):z===62&&u===4?(n.consume(z),N):z===63&&u===3?(n.consume(z),L):z===93&&u===5?(n.consume(z),de):Be(z)&&(u===6||u===7)?(n.exit("htmlFlowData"),n.check(ix,B,ne)(z)):z===null||Be(z)?(n.exit("htmlFlowData"),ne(z)):(n.consume(z),D)}function ne(z){return n.check(ax,C,B)(z)}function C(z){return n.enter("lineEnding"),n.consume(z),n.exit("lineEnding"),V}function V(z){return z===null||Be(z)?ne(z):(n.enter("htmlFlowData"),D(z))}function Z(z){return z===45?(n.consume(z),L):D(z)}function Q(z){return z===47?(n.consume(z),c="",se):D(z)}function se(z){if(z===62){const re=c.toLowerCase();return qm.includes(re)?(n.consume(z),N):D(z)}return Mn(z)&&c.length<8?(n.consume(z),c+=String.fromCharCode(z),se):D(z)}function de(z){return z===93?(n.consume(z),L):D(z)}function L(z){return z===62?(n.consume(z),N):z===45&&u===2?(n.consume(z),L):D(z)}function N(z){return z===null||Be(z)?(n.exit("htmlFlowData"),B(z)):(n.consume(z),N)}function B(z){return n.exit("htmlFlow"),l(z)}}function sx(n,l,i){const o=this;return u;function u(c){return Be(c)?(n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),s):i(c)}function s(c){return o.parser.lazy[o.now().line]?i(c):l(c)}}function ux(n,l,i){return o;function o(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),n.attempt(Fl,l,i)}}const cx={name:"htmlText",tokenize:fx};function fx(n,l,i){const o=this;let u,s,c;return f;function f(L){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(L),m}function m(L){return L===33?(n.consume(L),h):L===47?(n.consume(L),H):L===63?(n.consume(L),k):Mn(L)?(n.consume(L),Y):i(L)}function h(L){return L===45?(n.consume(L),g):L===91?(n.consume(L),s=0,w):Mn(L)?(n.consume(L),A):i(L)}function g(L){return L===45?(n.consume(L),b):i(L)}function y(L){return L===null?i(L):L===45?(n.consume(L),v):Be(L)?(c=y,Q(L)):(n.consume(L),y)}function v(L){return L===45?(n.consume(L),b):y(L)}function b(L){return L===62?Z(L):L===45?v(L):y(L)}function w(L){const N="CDATA[";return L===N.charCodeAt(s++)?(n.consume(L),s===N.length?E:w):i(L)}function E(L){return L===null?i(L):L===93?(n.consume(L),T):Be(L)?(c=E,Q(L)):(n.consume(L),E)}function T(L){return L===93?(n.consume(L),_):E(L)}function _(L){return L===62?Z(L):L===93?(n.consume(L),_):E(L)}function A(L){return L===null||L===62?Z(L):Be(L)?(c=A,Q(L)):(n.consume(L),A)}function k(L){return L===null?i(L):L===63?(n.consume(L),q):Be(L)?(c=k,Q(L)):(n.consume(L),k)}function q(L){return L===62?Z(L):k(L)}function H(L){return Mn(L)?(n.consume(L),M):i(L)}function M(L){return L===45||tn(L)?(n.consume(L),M):I(L)}function I(L){return Be(L)?(c=I,Q(L)):rt(L)?(n.consume(L),I):Z(L)}function Y(L){return L===45||tn(L)?(n.consume(L),Y):L===47||L===62||Vt(L)?F(L):i(L)}function F(L){return L===47?(n.consume(L),Z):L===58||L===95||Mn(L)?(n.consume(L),$):Be(L)?(c=F,Q(L)):rt(L)?(n.consume(L),F):Z(L)}function $(L){return L===45||L===46||L===58||L===95||tn(L)?(n.consume(L),$):ie(L)}function ie(L){return L===61?(n.consume(L),D):Be(L)?(c=ie,Q(L)):rt(L)?(n.consume(L),ie):F(L)}function D(L){return L===null||L===60||L===61||L===62||L===96?i(L):L===34||L===39?(n.consume(L),u=L,ne):Be(L)?(c=D,Q(L)):rt(L)?(n.consume(L),D):(n.consume(L),C)}function ne(L){return L===u?(n.consume(L),u=void 0,V):L===null?i(L):Be(L)?(c=ne,Q(L)):(n.consume(L),ne)}function C(L){return L===null||L===34||L===39||L===60||L===61||L===96?i(L):L===47||L===62||Vt(L)?F(L):(n.consume(L),C)}function V(L){return L===47||L===62||Vt(L)?F(L):i(L)}function Z(L){return L===62?(n.consume(L),n.exit("htmlTextData"),n.exit("htmlText"),l):i(L)}function Q(L){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(L),n.exit("lineEnding"),se}function se(L){return rt(L)?dt(n,de,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):de(L)}function de(L){return n.enter("htmlTextData"),c(L)}}const fu={name:"labelEnd",resolveAll:px,resolveTo:gx,tokenize:yx},dx={tokenize:bx},hx={tokenize:vx},mx={tokenize:Sx};function px(n){let l=-1;const i=[];for(;++l<n.length;){const o=n[l][1];if(i.push(n[l]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const u=o.type==="labelImage"?4:2;o.type="data",l+=u}}return n.length!==i.length&&zn(n,0,n.length,i),n}function gx(n,l){let i=n.length,o=0,u,s,c,f;for(;i--;)if(u=n[i][1],s){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;n[i][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(c){if(n[i][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(s=i,u.type!=="labelLink")){o=2;break}}else u.type==="labelEnd"&&(c=i);const m={type:n[s][1].type==="labelLink"?"link":"image",start:{...n[s][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[s][1].start},end:{...n[c][1].end}},g={type:"labelText",start:{...n[s+o+2][1].end},end:{...n[c-2][1].start}};return f=[["enter",m,l],["enter",h,l]],f=dn(f,n.slice(s+1,s+o+3)),f=dn(f,[["enter",g,l]]),f=dn(f,su(l.parser.constructs.insideSpan.null,n.slice(s+o+4,c-3),l)),f=dn(f,[["exit",g,l],n[c-2],n[c-1],["exit",h,l]]),f=dn(f,n.slice(c+1)),f=dn(f,[["exit",m,l]]),zn(n,s,n.length,f),n}function yx(n,l,i){const o=this;let u=o.events.length,s,c;for(;u--;)if((o.events[u][1].type==="labelImage"||o.events[u][1].type==="labelLink")&&!o.events[u][1]._balanced){s=o.events[u][1];break}return f;function f(v){return s?s._inactive?y(v):(c=o.parser.defined.includes(vi(o.sliceSerialize({start:s.end,end:o.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(v),n.exit("labelMarker"),n.exit("labelEnd"),m):i(v)}function m(v){return v===40?n.attempt(dx,g,c?g:y)(v):v===91?n.attempt(hx,g,c?h:y)(v):c?g(v):y(v)}function h(v){return n.attempt(mx,g,y)(v)}function g(v){return l(v)}function y(v){return s._balanced=!0,i(v)}}function bx(n,l,i){return o;function o(y){return n.enter("resource"),n.enter("resourceMarker"),n.consume(y),n.exit("resourceMarker"),u}function u(y){return Vt(y)?ja(n,s)(y):s(y)}function s(y){return y===41?g(y):Bm(n,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function c(y){return Vt(y)?ja(n,m)(y):g(y)}function f(y){return i(y)}function m(y){return y===34||y===39||y===40?Hm(n,h,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function h(y){return Vt(y)?ja(n,g)(y):g(y)}function g(y){return y===41?(n.enter("resourceMarker"),n.consume(y),n.exit("resourceMarker"),n.exit("resource"),l):i(y)}}function vx(n,l,i){const o=this;return u;function u(f){return Um.call(o,n,s,c,"reference","referenceMarker","referenceString")(f)}function s(f){return o.parser.defined.includes(vi(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?l(f):i(f)}function c(f){return i(f)}}function Sx(n,l,i){return o;function o(s){return n.enter("reference"),n.enter("referenceMarker"),n.consume(s),n.exit("referenceMarker"),u}function u(s){return s===93?(n.enter("referenceMarker"),n.consume(s),n.exit("referenceMarker"),n.exit("reference"),l):i(s)}}const Ex={name:"labelStartImage",resolveAll:fu.resolveAll,tokenize:xx};function xx(n,l,i){const o=this;return u;function u(f){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(f),n.exit("labelImageMarker"),s}function s(f){return f===91?(n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelImage"),c):i(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in o.parser.constructs?i(f):l(f)}}const _x={name:"labelStartLink",resolveAll:fu.resolveAll,tokenize:wx};function wx(n,l,i){const o=this;return u;function u(c){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(c),n.exit("labelMarker"),n.exit("labelLink"),s}function s(c){return c===94&&"_hiddenFootnoteSupport"in o.parser.constructs?i(c):l(c)}}const du={name:"lineEnding",tokenize:Cx};function Cx(n,l){return i;function i(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),dt(n,l,"linePrefix")}}const Yl={name:"thematicBreak",tokenize:Tx};function Tx(n,l,i){let o=0,u;return s;function s(h){return n.enter("thematicBreak"),c(h)}function c(h){return u=h,f(h)}function f(h){return h===u?(n.enter("thematicBreakSequence"),m(h)):o>=3&&(h===null||Be(h))?(n.exit("thematicBreak"),l(h)):i(h)}function m(h){return h===u?(n.consume(h),o++,m):(n.exit("thematicBreakSequence"),rt(h)?dt(n,f,"whitespace")(h):f(h))}}const Gt={continuation:{tokenize:Rx},exit:zx,name:"list",tokenize:Nx},Ax={partial:!0,tokenize:Mx},kx={partial:!0,tokenize:Ox};function Nx(n,l,i){const o=this,u=o.events[o.events.length-1];let s=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,c=0;return f;function f(b){const w=o.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!o.containerState.marker||b===o.containerState.marker:ou(b)){if(o.containerState.type||(o.containerState.type=w,n.enter(w,{_container:!0})),w==="listUnordered")return n.enter("listItemPrefix"),b===42||b===45?n.check(Yl,i,h)(b):h(b);if(!o.interrupt||b===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),m(b)}return i(b)}function m(b){return ou(b)&&++c<10?(n.consume(b),m):(!o.interrupt||c<2)&&(o.containerState.marker?b===o.containerState.marker:b===41||b===46)?(n.exit("listItemValue"),h(b)):i(b)}function h(b){return n.enter("listItemMarker"),n.consume(b),n.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||b,n.check(Fl,o.interrupt?i:g,n.attempt(Ax,v,y))}function g(b){return o.containerState.initialBlankLine=!0,s++,v(b)}function y(b){return rt(b)?(n.enter("listItemPrefixWhitespace"),n.consume(b),n.exit("listItemPrefixWhitespace"),v):i(b)}function v(b){return o.containerState.size=s+o.sliceSerialize(n.exit("listItemPrefix"),!0).length,l(b)}}function Rx(n,l,i){const o=this;return o.containerState._closeFlow=void 0,n.check(Fl,u,s);function u(f){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,dt(n,l,"listItemIndent",o.containerState.size+1)(f)}function s(f){return o.containerState.furtherBlankLines||!rt(f)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,c(f)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,n.attempt(kx,l,c)(f))}function c(f){return o.containerState._closeFlow=!0,o.interrupt=void 0,dt(n,n.attempt(Gt,l,i),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function Ox(n,l,i){const o=this;return dt(n,u,"listItemIndent",o.containerState.size+1);function u(s){const c=o.events[o.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===o.containerState.size?l(s):i(s)}}function zx(n){n.exit(this.containerState.type)}function Mx(n,l,i){const o=this;return dt(n,u,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(s){const c=o.events[o.events.length-1];return!rt(s)&&c&&c[1].type==="listItemPrefixWhitespace"?l(s):i(s)}}const Pm={name:"setextUnderline",resolveTo:Dx,tokenize:jx};function Dx(n,l){let i=n.length,o,u,s;for(;i--;)if(n[i][0]==="enter"){if(n[i][1].type==="content"){o=i;break}n[i][1].type==="paragraph"&&(u=i)}else n[i][1].type==="content"&&n.splice(i,1),!s&&n[i][1].type==="definition"&&(s=i);const c={type:"setextHeading",start:{...n[o][1].start},end:{...n[n.length-1][1].end}};return n[u][1].type="setextHeadingText",s?(n.splice(u,0,["enter",c,l]),n.splice(s+1,0,["exit",n[o][1],l]),n[o][1].end={...n[s][1].end}):n[o][1]=c,n.push(["exit",c,l]),n}function jx(n,l,i){const o=this;let u;return s;function s(h){let g=o.events.length,y;for(;g--;)if(o.events[g][1].type!=="lineEnding"&&o.events[g][1].type!=="linePrefix"&&o.events[g][1].type!=="content"){y=o.events[g][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||y)?(n.enter("setextHeadingLine"),u=h,c(h)):i(h)}function c(h){return n.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===u?(n.consume(h),f):(n.exit("setextHeadingLineSequence"),rt(h)?dt(n,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Be(h)?(n.exit("setextHeadingLine"),l(h)):i(h)}}const Lx={tokenize:Ix};function Ix(n){const l=this,i=n.attempt(Fl,o,n.attempt(this.parser.constructs.flowInitial,u,dt(n,n.attempt(this.parser.constructs.flow,u,n.attempt(PE,u)),"linePrefix")));return i;function o(s){if(s===null){n.consume(s);return}return n.enter("lineEndingBlank"),n.consume(s),n.exit("lineEndingBlank"),l.currentConstruct=void 0,i}function u(s){if(s===null){n.consume(s);return}return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),l.currentConstruct=void 0,i}}const Bx={resolveAll:Ym()},Ux=Fm("string"),Hx=Fm("text");function Fm(n){return{resolveAll:Ym(n==="text"?qx:void 0),tokenize:l};function l(i){const o=this,u=this.parser.constructs[n],s=i.attempt(u,c,f);return c;function c(g){return h(g)?s(g):f(g)}function f(g){if(g===null){i.consume(g);return}return i.enter("data"),i.consume(g),m}function m(g){return h(g)?(i.exit("data"),s(g)):(i.consume(g),m)}function h(g){if(g===null)return!0;const y=u[g];let v=-1;if(y)for(;++v<y.length;){const b=y[v];if(!b.previous||b.previous.call(o,o.previous))return!0}return!1}}}function Ym(n){return l;function l(i,o){let u=-1,s;for(;++u<=i.length;)s===void 0?i[u]&&i[u][1].type==="data"&&(s=u,u++):(!i[u]||i[u][1].type!=="data")&&(u!==s+2&&(i[s][1].end=i[u-1][1].end,i.splice(s+2,u-s-2),u=s+2),s=void 0);return n?n(i,o):i}}function qx(n,l){let i=0;for(;++i<=n.length;)if((i===n.length||n[i][1].type==="lineEnding")&&n[i-1][1].type==="data"){const o=n[i-1][1],u=l.sliceStream(o);let s=u.length,c=-1,f=0,m;for(;s--;){const h=u[s];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)m=!0,f++;else if(h!==-1){s++;break}}if(l._contentTypeTextTrailing&&i===n.length&&(f=0),f){const h={type:i===n.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?c:o.start._bufferIndex+c,_index:o.start._index+s,line:o.end.line,column:o.end.column-f,offset:o.end.offset-f},end:{...o.end}};o.end={...h.start},o.start.offset===o.end.offset?Object.assign(o,h):(n.splice(i,0,["enter",h,l],["exit",h,l]),i+=2)}i++}return n}const Px=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:XE},disable:{null:[]},document:{42:Gt,43:Gt,45:Gt,48:Gt,49:Gt,50:Gt,51:Gt,52:Gt,53:Gt,54:Gt,55:Gt,56:Gt,57:Gt,62:zm},flow:{35:$E,42:Yl,45:[Pm,Yl],60:rx,61:Pm,95:Yl,96:Lm,126:Lm},flowInitial:{[-2]:cu,[-1]:cu,32:cu},insideSpan:{null:[uu,Bx]},string:{38:Dm,92:Mm},text:{[-5]:du,[-4]:du,[-3]:du,33:Ex,38:Dm,42:uu,60:[_E,cx],91:_x,92:[JE,Mm],93:fu,95:uu,96:LE}},Symbol.toStringTag,{value:"Module"}));function Fx(n,l,i){let o={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const u={},s=[];let c=[],f=[];const m={attempt:I(H),check:I(M),consume:A,enter:k,exit:q,interrupt:I(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:w,parser:n,previous:null,sliceSerialize:v,sliceStream:b,write:y};let g=l.tokenize.call(h,m);return l.resolveAll&&s.push(l),h;function y(ie){return c=dn(c,ie),T(),c[c.length-1]!==null?[]:(Y(l,0),h.events=su(s,h.events,h),h.events)}function v(ie,D){return Vx(b(ie),D)}function b(ie){return Yx(c,ie)}function w(){const{_bufferIndex:ie,_index:D,line:ne,column:C,offset:V}=o;return{_bufferIndex:ie,_index:D,line:ne,column:C,offset:V}}function E(ie){u[ie.line]=ie.column,$()}function T(){let ie;for(;o._index<c.length;){const D=c[o._index];if(typeof D=="string")for(ie=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===ie&&o._bufferIndex<D.length;)_(D.charCodeAt(o._bufferIndex));else _(D)}}function _(ie){g=g(ie)}function A(ie){Be(ie)?(o.line++,o.column=1,o.offset+=ie===-3?2:1,$()):ie!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===c[o._index].length&&(o._bufferIndex=-1,o._index++)),h.previous=ie}function k(ie,D){const ne=D||{};return ne.type=ie,ne.start=w(),h.events.push(["enter",ne,h]),f.push(ne),ne}function q(ie){const D=f.pop();return D.end=w(),h.events.push(["exit",D,h]),D}function H(ie,D){Y(ie,D.from)}function M(ie,D){D.restore()}function I(ie,D){return ne;function ne(C,V,Z){let Q,se,de,L;return Array.isArray(C)?B(C):"tokenize"in C?B([C]):N(C);function N(we){return Te;function Te(ke){const Ae=ke!==null&&we[ke],He=ke!==null&&we.null,ve=[...Array.isArray(Ae)?Ae:Ae?[Ae]:[],...Array.isArray(He)?He:He?[He]:[]];return B(ve)(ke)}}function B(we){return Q=we,se=0,we.length===0?Z:z(we[se])}function z(we){return Te;function Te(ke){return L=F(),de=we,we.partial||(h.currentConstruct=we),we.name&&h.parser.constructs.disable.null.includes(we.name)?ce():we.tokenize.call(D?Object.assign(Object.create(h),D):h,m,re,ce)(ke)}}function re(we){return ie(de,L),V}function ce(we){return L.restore(),++se<Q.length?z(Q[se]):Z}}}function Y(ie,D){ie.resolveAll&&!s.includes(ie)&&s.push(ie),ie.resolve&&zn(h.events,D,h.events.length-D,ie.resolve(h.events.slice(D),h)),ie.resolveTo&&(h.events=ie.resolveTo(h.events,h))}function F(){const ie=w(),D=h.previous,ne=h.currentConstruct,C=h.events.length,V=Array.from(f);return{from:C,restore:Z};function Z(){o=ie,h.previous=D,h.currentConstruct=ne,h.events.length=C,f=V,$()}}function $(){o.line in u&&o.column<2&&(o.column=u[o.line],o.offset+=u[o.line]-1)}}function Yx(n,l){const i=l.start._index,o=l.start._bufferIndex,u=l.end._index,s=l.end._bufferIndex;let c;if(i===u)c=[n[i].slice(o,s)];else{if(c=n.slice(i,u),o>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(o):c.shift()}s>0&&c.push(n[u].slice(0,s))}return c}function Vx(n,l){let i=-1;const o=[];let u;for(;++i<n.length;){const s=n[i];let c;if(typeof s=="string")c=s;else switch(s){case-5:{c="\r";break}case-4:{c=`
|
|
46
45
|
`;break}case-3:{c=`\r
|
|
47
|
-
`;break}case-2:{c=a?" ":" ";break}case-1:{if(!a&&u)continue;c=" ";break}default:c=String.fromCharCode(l)}u=l===-2,s.push(c)}return s.join("")}function Gw(n){const s={constructs:sE([Fw,...(n||{}).extensions||[]]),content:u(pE),defined:[],document:u(gE),flow:u(Dw),lazy:{},string:u(Lw),text:u(Bw)};return s;function u(l){return c;function c(f){return Pw(s,l,f)}}}function Vw(n){for(;!fm(n););return n}const vm=/[\0\t\n\r]/g;function Yw(){let n=1,a="",i=!0,s;return u;function u(l,c,f){const d=[];let h,y,b,_,m;for(l=a+(typeof l=="string"?l.toString():new TextDecoder(c||void 0).decode(l)),b=0,a="",i&&(l.charCodeAt(0)===65279&&b++,i=void 0);b<l.length;){if(vm.lastIndex=b,h=vm.exec(l),_=h&&h.index!==void 0?h.index:l.length,m=l.charCodeAt(_),!h){a=l.slice(b);break}if(m===10&&b===_&&s)d.push(-3),s=void 0;else switch(s&&(d.push(-5),s=void 0),b<_&&(d.push(l.slice(b,_)),n+=_-b),m){case 0:{d.push(65533),n++;break}case 9:{for(y=Math.ceil(n/4)*4,d.push(-2);n++<y;)d.push(-1);break}case 10:{d.push(-4),n=1;break}default:s=!0,n=1}b=_+1}return f&&(s&&d.push(-5),a&&d.push(a),d.push(null)),d}}const Zw=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Xw(n){return n.replace(Zw,Kw)}function Kw(n,a,i){if(a)return a;if(i.charCodeAt(0)===35){const u=i.charCodeAt(1),l=u===120||u===88;return nm(i.slice(l?2:1),l?16:10)}return ku(i)||n}const _m={}.hasOwnProperty;function Qw(n,a,i){return typeof a!="string"&&(i=a,a=void 0),Ww(i)(Vw(Gw(i).document().write(Yw()(n,a,!0))))}function Ww(n){const a={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(U),autolinkProtocol:F,autolinkEmail:F,atxHeading:l(Y),blockQuote:l(je),characterEscape:F,characterReference:F,codeFenced:l(_e),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(_e,c),codeText:l(Re,c),codeTextData:F,data:F,codeFlowValue:F,definition:l(Ne),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(g),hardBreakEscape:l(Z),hardBreakTrailing:l(Z),htmlFlow:l(A,c),htmlFlowData:F,htmlText:l(A,c),htmlTextData:F,image:l(T),label:c,link:l(U),listItem:l(se),listItemValue:_,listOrdered:l(ee,b),listUnordered:l(ee),paragraph:l(X),reference:B,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(Y),strong:l(ce),thematicBreak:l(de)},exit:{atxHeading:d(),atxHeadingSequence:D,autolink:d(),autolinkEmail:ke,autolinkProtocol:Ce,blockQuote:d(),characterEscapeValue:W,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:xe,characterReference:Te,codeFenced:d(x),codeFencedFence:S,codeFencedFenceInfo:m,codeFencedFenceMeta:C,codeFlowValue:W,codeIndented:d(w),codeText:d(G),codeTextData:W,data:W,definition:d(),definitionDestinationString:j,definitionLabelString:k,definitionTitleString:N,emphasis:d(),hardBreakEscape:d(R),hardBreakTrailing:d(R),htmlFlow:d(Q),htmlFlowData:W,htmlText:d(E),htmlTextData:W,image:d(K),label:re,labelText:ue,lineEnding:oe,link:d(J),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:te,resourceDestinationString:q,resourceTitleString:z,resource:I,setextHeading:d(V),setextHeadingLineSequence:L,setextHeadingText:M,strong:d(),thematicBreak:d()}};Sm(a,(n||{}).mdastExtensions||[]);const i={};return s;function s(ie){let be={type:"root",children:[]};const Ee={stack:[be],tokenStack:[],config:a,enter:f,exit:h,buffer:c,resume:y,data:i},De=[];let qe=-1;for(;++qe<ie.length;)if(ie[qe][1].type==="listOrdered"||ie[qe][1].type==="listUnordered")if(ie[qe][0]==="enter")De.push(qe);else{const $e=De.pop();qe=u(ie,$e,qe)}for(qe=-1;++qe<ie.length;){const $e=a[ie[qe][0]];_m.call($e,ie[qe][1].type)&&$e[ie[qe][1].type].call(Object.assign({sliceSerialize:ie[qe][2].sliceSerialize},Ee),ie[qe][1])}if(Ee.tokenStack.length>0){const $e=Ee.tokenStack[Ee.tokenStack.length-1];($e[1]||Em).call(Ee,void 0,$e[0])}for(be.position={start:Ar(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:Ar(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<a.transforms.length;)be=a.transforms[qe](be)||be;return be}function u(ie,be,Ee){let De=be-1,qe=-1,$e=!1,Et,Le,st,vt;for(;++De<=Ee;){const Pe=ie[De];switch(Pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pe[0]==="enter"?qe++:qe--,vt=void 0;break}case"lineEndingBlank":{Pe[0]==="enter"&&(Et&&!vt&&!qe&&!st&&(st=De),vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:vt=void 0}if(!qe&&Pe[0]==="enter"&&Pe[1].type==="listItemPrefix"||qe===-1&&Pe[0]==="exit"&&(Pe[1].type==="listUnordered"||Pe[1].type==="listOrdered")){if(Et){let $t=De;for(Le=void 0;$t--;){const Zt=ie[$t];if(Zt[1].type==="lineEnding"||Zt[1].type==="lineEndingBlank"){if(Zt[0]==="exit")continue;Le&&(ie[Le][1].type="lineEndingBlank",$e=!0),Zt[1].type="lineEnding",Le=$t}else if(!(Zt[1].type==="linePrefix"||Zt[1].type==="blockQuotePrefix"||Zt[1].type==="blockQuotePrefixWhitespace"||Zt[1].type==="blockQuoteMarker"||Zt[1].type==="listItemIndent"))break}st&&(!Le||st<Le)&&(Et._spread=!0),Et.end=Object.assign({},Le?ie[Le][1].start:Pe[1].end),ie.splice(Le||De,0,["exit",Et,Pe[2]]),De++,Ee++}if(Pe[1].type==="listItemPrefix"){const $t={type:"listItem",_spread:!1,start:Object.assign({},Pe[1].start),end:void 0};Et=$t,ie.splice(De,0,["enter",$t,Pe[2]]),De++,Ee++,st=void 0,vt=!0}}}return ie[be][1]._spread=$e,Ee}function l(ie,be){return Ee;function Ee(De){f.call(this,ie(De),De),be&&be.call(this,De)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(ie,be,Ee){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([be,Ee||void 0]),ie.position={start:Ar(be.start),end:void 0}}function d(ie){return be;function be(Ee){ie&&ie.call(this,Ee),h.call(this,Ee)}}function h(ie,be){const Ee=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==ie.type&&(be?be.call(this,ie,De[0]):(De[1]||Em).call(this,ie,De[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Ja({start:ie.start,end:ie.end})+"): it’s not open");Ee.position.end=Ar(ie.end)}function y(){return iE(this.stack.pop())}function b(){this.data.expectingFirstListItemValue=!0}function _(ie){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function m(){const ie=this.resume(),be=this.stack[this.stack.length-1];be.lang=ie}function C(){const ie=this.resume(),be=this.stack[this.stack.length-1];be.meta=ie}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const ie=this.resume(),be=this.stack[this.stack.length-1];be.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const ie=this.resume(),be=this.stack[this.stack.length-1];be.value=ie.replace(/(\r?\n|\r)$/g,"")}function k(ie){const be=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=be,Ee.identifier=Bi(this.sliceSerialize(ie)).toLowerCase()}function N(){const ie=this.resume(),be=this.stack[this.stack.length-1];be.title=ie}function j(){const ie=this.resume(),be=this.stack[this.stack.length-1];be.url=ie}function D(ie){const be=this.stack[this.stack.length-1];if(!be.depth){const Ee=this.sliceSerialize(ie).length;be.depth=Ee}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function L(ie){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function F(ie){const Ee=this.stack[this.stack.length-1].children;let De=Ee[Ee.length-1];(!De||De.type!=="text")&&(De=pe(),De.position={start:Ar(ie.start),end:void 0},Ee.push(De)),this.stack.push(De)}function W(ie){const be=this.stack.pop();be.value+=this.sliceSerialize(ie),be.position.end=Ar(ie.end)}function oe(ie){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=be.children[be.children.length-1];Ee.position.end=Ar(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&a.canContainEols.includes(be.type)&&(F.call(this,ie),W.call(this,ie))}function R(){this.data.atHardBreak=!0}function Q(){const ie=this.resume(),be=this.stack[this.stack.length-1];be.value=ie}function E(){const ie=this.resume(),be=this.stack[this.stack.length-1];be.value=ie}function G(){const ie=this.resume(),be=this.stack[this.stack.length-1];be.value=ie}function J(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=be,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function K(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=be,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function ue(ie){const be=this.sliceSerialize(ie),Ee=this.stack[this.stack.length-2];Ee.label=Xw(be),Ee.identifier=Bi(be).toLowerCase()}function re(){const ie=this.stack[this.stack.length-1],be=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const De=ie.children;Ee.children=De}else Ee.alt=be}function q(){const ie=this.resume(),be=this.stack[this.stack.length-1];be.url=ie}function z(){const ie=this.resume(),be=this.stack[this.stack.length-1];be.title=ie}function I(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function te(ie){const be=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=be,Ee.identifier=Bi(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function ae(ie){this.data.characterReferenceType=ie.type}function xe(ie){const be=this.sliceSerialize(ie),Ee=this.data.characterReferenceType;let De;Ee?(De=nm(be,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=ku(be);const qe=this.stack[this.stack.length-1];qe.value+=De}function Te(ie){const be=this.stack.pop();be.position.end=Ar(ie.end)}function Ce(ie){W.call(this,ie);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(ie)}function ke(ie){W.call(this,ie);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(ie)}function je(){return{type:"blockquote",children:[]}}function _e(){return{type:"code",lang:null,meta:null,value:""}}function Re(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function g(){return{type:"emphasis",children:[]}}function Y(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function A(){return{type:"html",value:""}}function T(){return{type:"image",title:null,url:"",alt:null}}function U(){return{type:"link",title:null,url:"",children:[]}}function ee(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function se(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function X(){return{type:"paragraph",children:[]}}function ce(){return{type:"strong",children:[]}}function pe(){return{type:"text",value:""}}function de(){return{type:"thematicBreak"}}}function Ar(n){return{line:n.line,column:n.column,offset:n.offset}}function Sm(n,a){let i=-1;for(;++i<a.length;){const s=a[i];Array.isArray(s)?Sm(n,s):Jw(n,s)}}function Jw(n,a){let i;for(i in a)if(_m.call(a,i))switch(i){case"canContainEols":{const s=a[i];s&&n[i].push(...s);break}case"transforms":{const s=a[i];s&&n[i].push(...s);break}case"enter":case"exit":{const s=a[i];s&&Object.assign(n[i],s);break}}}function Em(n,a){throw n?new Error("Cannot close `"+n.type+"` ("+Ja({start:n.start,end:n.end})+"): a different token (`"+a.type+"`, "+Ja({start:a.start,end:a.end})+") is open"):new Error("Cannot close document, a token (`"+a.type+"`, "+Ja({start:a.start,end:a.end})+") is still open")}function $w(n){const a=this;a.parser=i;function i(s){return Qw(s,{...a.data("settings"),...n,extensions:a.data("micromarkExtensions")||[],mdastExtensions:a.data("fromMarkdownExtensions")||[]})}}function ex(n,a){const i={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(a),!0)};return n.patch(a,i),n.applyData(a,i)}function tx(n,a){const i={type:"element",tagName:"br",properties:{},children:[]};return n.patch(a,i),[n.applyData(a,i),{type:"text",value:`
|
|
48
|
-
`}]}function
|
|
49
|
-
`:"",
|
|
50
|
-
`}),
|
|
51
|
-
`});const h={type:"element",tagName:"li",properties:
|
|
46
|
+
`;break}case-2:{c=l?" ":" ";break}case-1:{if(!l&&u)continue;c=" ";break}default:c=String.fromCharCode(s)}u=s===-2,o.push(c)}return o.join("")}function Gx(n){const o={constructs:sE([Px,...(n||{}).extensions||[]]),content:u(gE),defined:[],document:u(bE),flow:u(Lx),lazy:{},string:u(Ux),text:u(Hx)};return o;function u(s){return c;function c(f){return Fx(o,s,f)}}}function Xx(n){for(;!Im(n););return n}const Vm=/[\0\t\n\r]/g;function Zx(){let n=1,l="",i=!0,o;return u;function u(s,c,f){const m=[];let h,g,y,v,b;for(s=l+(typeof s=="string"?s.toString():new TextDecoder(c||void 0).decode(s)),y=0,l="",i&&(s.charCodeAt(0)===65279&&y++,i=void 0);y<s.length;){if(Vm.lastIndex=y,h=Vm.exec(s),v=h&&h.index!==void 0?h.index:s.length,b=s.charCodeAt(v),!h){l=s.slice(y);break}if(b===10&&y===v&&o)m.push(-3),o=void 0;else switch(o&&(m.push(-5),o=void 0),y<v&&(m.push(s.slice(y,v)),n+=v-y),b){case 0:{m.push(65533),n++;break}case 9:{for(g=Math.ceil(n/4)*4,m.push(-2);n++<g;)m.push(-1);break}case 10:{m.push(-4),n=1;break}default:o=!0,n=1}y=v+1}return f&&(o&&m.push(-5),l&&m.push(l),m.push(null)),m}}const Kx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Qx(n){return n.replace(Kx,Jx)}function Jx(n,l,i){if(l)return l;if(i.charCodeAt(0)===35){const u=i.charCodeAt(1),s=u===120||u===88;return km(i.slice(s?2:1),s?16:10)}return au(i)||n}const Gm={}.hasOwnProperty;function Wx(n,l,i){return typeof l!="string"&&(i=l,l=void 0),$x(i)(Xx(Gx(i).document().write(Zx()(n,l,!0))))}function $x(n){const l={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(X),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(K),blockQuote:s(He),characterEscape:F,characterReference:F,codeFenced:s(ve),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:s(ve,c),codeText:s(ze,c),codeTextData:F,data:F,codeFlowValue:F,definition:s(je),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:s(S),hardBreakEscape:s(W),hardBreakTrailing:s(W),htmlFlow:s(U,c),htmlFlowData:F,htmlText:s(U,c),htmlTextData:F,image:s(j),label:c,link:s(X),listItem:s(pe),listItemValue:v,listOrdered:s(he,y),listUnordered:s(he),paragraph:s(le),reference:z,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:s(K),strong:s(Ee),thematicBreak:s(Se)},exit:{atxHeading:m(),atxHeadingSequence:H,autolink:m(),autolinkEmail:Ae,autolinkProtocol:ke,blockQuote:m(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:we,characterReference:Te,codeFenced:m(T),codeFencedFence:E,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:$,codeIndented:m(_),codeText:m(V),codeTextData:$,data:$,definition:m(),definitionDestinationString:q,definitionLabelString:A,definitionTitleString:k,emphasis:m(),hardBreakEscape:m(D),hardBreakTrailing:m(D),htmlFlow:m(ne),htmlFlowData:$,htmlText:m(C),htmlTextData:$,image:m(Q),label:de,labelText:se,lineEnding:ie,link:m(Z),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:re,resourceDestinationString:L,resourceTitleString:N,resource:B,setextHeading:m(Y),setextHeadingLineSequence:I,setextHeadingText:M,strong:m(),thematicBreak:m()}};Xm(l,(n||{}).mdastExtensions||[]);const i={};return o;function o(te){let be={type:"root",children:[]};const Ce={stack:[be],tokenStack:[],config:l,enter:f,exit:h,buffer:c,resume:g,data:i},Ie=[];let Je=-1;for(;++Je<te.length;)if(te[Je][1].type==="listOrdered"||te[Je][1].type==="listUnordered")if(te[Je][0]==="enter")Ie.push(Je);else{const pt=Ie.pop();Je=u(te,pt,Je)}for(Je=-1;++Je<te.length;){const pt=l[te[Je][0]];Gm.call(pt,te[Je][1].type)&&pt[te[Je][1].type].call(Object.assign({sliceSerialize:te[Je][2].sliceSerialize},Ce),te[Je][1])}if(Ce.tokenStack.length>0){const pt=Ce.tokenStack[Ce.tokenStack.length-1];(pt[1]||Zm).call(Ce,void 0,pt[0])}for(be.position={start:hr(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:hr(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Je=-1;++Je<l.transforms.length;)be=l.transforms[Je](be)||be;return be}function u(te,be,Ce){let Ie=be-1,Je=-1,pt=!1,qt,Xe,gt,Ot;for(;++Ie<=Ce;){const Ze=te[Ie];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?Je++:Je--,Ot=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(qt&&!Ot&&!Je&&!gt&&(gt=Ie),Ot=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ot=void 0}if(!Je&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||Je===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(qt){let Cn=Ie;for(Xe=void 0;Cn--;){const nn=te[Cn];if(nn[1].type==="lineEnding"||nn[1].type==="lineEndingBlank"){if(nn[0]==="exit")continue;Xe&&(te[Xe][1].type="lineEndingBlank",pt=!0),nn[1].type="lineEnding",Xe=Cn}else if(!(nn[1].type==="linePrefix"||nn[1].type==="blockQuotePrefix"||nn[1].type==="blockQuotePrefixWhitespace"||nn[1].type==="blockQuoteMarker"||nn[1].type==="listItemIndent"))break}gt&&(!Xe||gt<Xe)&&(qt._spread=!0),qt.end=Object.assign({},Xe?te[Xe][1].start:Ze[1].end),te.splice(Xe||Ie,0,["exit",qt,Ze[2]]),Ie++,Ce++}if(Ze[1].type==="listItemPrefix"){const Cn={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};qt=Cn,te.splice(Ie,0,["enter",Cn,Ze[2]]),Ie++,Ce++,gt=void 0,Ot=!0}}}return te[be][1]._spread=pt,Ce}function s(te,be){return Ce;function Ce(Ie){f.call(this,te(Ie),Ie),be&&be.call(this,Ie)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(te,be,Ce){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([be,Ce||void 0]),te.position={start:hr(be.start),end:void 0}}function m(te){return be;function be(Ce){te&&te.call(this,Ce),h.call(this,Ce)}}function h(te,be){const Ce=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==te.type&&(be?be.call(this,te,Ie[0]):(Ie[1]||Zm).call(this,te,Ie[0]));else throw new Error("Cannot close `"+te.type+"` ("+za({start:te.start,end:te.end})+"): it’s not open");Ce.position.end=hr(te.end)}function g(){return lE(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function v(te){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function b(){const te=this.resume(),be=this.stack[this.stack.length-1];be.lang=te}function w(){const te=this.resume(),be=this.stack[this.stack.length-1];be.meta=te}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const te=this.resume(),be=this.stack[this.stack.length-1];be.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const te=this.resume(),be=this.stack[this.stack.length-1];be.value=te.replace(/(\r?\n|\r)$/g,"")}function A(te){const be=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=be,Ce.identifier=vi(this.sliceSerialize(te)).toLowerCase()}function k(){const te=this.resume(),be=this.stack[this.stack.length-1];be.title=te}function q(){const te=this.resume(),be=this.stack[this.stack.length-1];be.url=te}function H(te){const be=this.stack[this.stack.length-1];if(!be.depth){const Ce=this.sliceSerialize(te).length;be.depth=Ce}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function I(te){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function Y(){this.data.setextHeadingSlurpLineEnding=void 0}function F(te){const Ce=this.stack[this.stack.length-1].children;let Ie=Ce[Ce.length-1];(!Ie||Ie.type!=="text")&&(Ie=_e(),Ie.position={start:hr(te.start),end:void 0},Ce.push(Ie)),this.stack.push(Ie)}function $(te){const be=this.stack.pop();be.value+=this.sliceSerialize(te),be.position.end=hr(te.end)}function ie(te){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ce=be.children[be.children.length-1];Ce.position.end=hr(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&l.canContainEols.includes(be.type)&&(F.call(this,te),$.call(this,te))}function D(){this.data.atHardBreak=!0}function ne(){const te=this.resume(),be=this.stack[this.stack.length-1];be.value=te}function C(){const te=this.resume(),be=this.stack[this.stack.length-1];be.value=te}function V(){const te=this.resume(),be=this.stack[this.stack.length-1];be.value=te}function Z(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=be,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function Q(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=be,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function se(te){const be=this.sliceSerialize(te),Ce=this.stack[this.stack.length-2];Ce.label=Qx(be),Ce.identifier=vi(be).toLowerCase()}function de(){const te=this.stack[this.stack.length-1],be=this.resume(),Ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ce.type==="link"){const Ie=te.children;Ce.children=Ie}else Ce.alt=be}function L(){const te=this.resume(),be=this.stack[this.stack.length-1];be.url=te}function N(){const te=this.resume(),be=this.stack[this.stack.length-1];be.title=te}function B(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function re(te){const be=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=be,Ce.identifier=vi(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function ce(te){this.data.characterReferenceType=te.type}function we(te){const be=this.sliceSerialize(te),Ce=this.data.characterReferenceType;let Ie;Ce?(Ie=km(be,Ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=au(be);const Je=this.stack[this.stack.length-1];Je.value+=Ie}function Te(te){const be=this.stack.pop();be.position.end=hr(te.end)}function ke(te){$.call(this,te);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(te)}function Ae(te){$.call(this,te);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(te)}function He(){return{type:"blockquote",children:[]}}function ve(){return{type:"code",lang:null,meta:null,value:""}}function ze(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function S(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function W(){return{type:"break"}}function U(){return{type:"html",value:""}}function j(){return{type:"image",title:null,url:"",alt:null}}function X(){return{type:"link",title:null,url:"",children:[]}}function he(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function pe(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function le(){return{type:"paragraph",children:[]}}function Ee(){return{type:"strong",children:[]}}function _e(){return{type:"text",value:""}}function Se(){return{type:"thematicBreak"}}}function hr(n){return{line:n.line,column:n.column,offset:n.offset}}function Xm(n,l){let i=-1;for(;++i<l.length;){const o=l[i];Array.isArray(o)?Xm(n,o):e_(n,o)}}function e_(n,l){let i;for(i in l)if(Gm.call(l,i))switch(i){case"canContainEols":{const o=l[i];o&&n[i].push(...o);break}case"transforms":{const o=l[i];o&&n[i].push(...o);break}case"enter":case"exit":{const o=l[i];o&&Object.assign(n[i],o);break}}}function Zm(n,l){throw n?new Error("Cannot close `"+n.type+"` ("+za({start:n.start,end:n.end})+"): a different token (`"+l.type+"`, "+za({start:l.start,end:l.end})+") is open"):new Error("Cannot close document, a token (`"+l.type+"`, "+za({start:l.start,end:l.end})+") is still open")}function t_(n){const l=this;l.parser=i;function i(o){return Wx(o,{...l.data("settings"),...n,extensions:l.data("micromarkExtensions")||[],mdastExtensions:l.data("fromMarkdownExtensions")||[]})}}function n_(n,l){const i={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(l),!0)};return n.patch(l,i),n.applyData(l,i)}function r_(n,l){const i={type:"element",tagName:"br",properties:{},children:[]};return n.patch(l,i),[n.applyData(l,i),{type:"text",value:`
|
|
47
|
+
`}]}function i_(n,l){const i=l.value?l.value+`
|
|
48
|
+
`:"",o={};l.lang&&(o.className=["language-"+l.lang]);let u={type:"element",tagName:"code",properties:o,children:[{type:"text",value:i}]};return l.meta&&(u.data={meta:l.meta}),n.patch(l,u),u=n.applyData(l,u),u={type:"element",tagName:"pre",properties:{},children:[u]},n.patch(l,u),u}function a_(n,l){const i={type:"element",tagName:"del",properties:{},children:n.all(l)};return n.patch(l,i),n.applyData(l,i)}function l_(n,l){const i={type:"element",tagName:"em",properties:{},children:n.all(l)};return n.patch(l,i),n.applyData(l,i)}function o_(n,l){const i=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",o=String(l.identifier).toUpperCase(),u=Si(o.toLowerCase()),s=n.footnoteOrder.indexOf(o);let c,f=n.footnoteCounts.get(o);f===void 0?(f=0,n.footnoteOrder.push(o),c=n.footnoteOrder.length):c=s+1,f+=1,n.footnoteCounts.set(o,f);const m={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+u,id:i+"fnref-"+u+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};n.patch(l,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return n.patch(l,h),n.applyData(l,h)}function s_(n,l){const i={type:"element",tagName:"h"+l.depth,properties:{},children:n.all(l)};return n.patch(l,i),n.applyData(l,i)}function u_(n,l){if(n.options.allowDangerousHtml){const i={type:"raw",value:l.value};return n.patch(l,i),n.applyData(l,i)}}function Km(n,l){const i=l.referenceType;let o="]";if(i==="collapsed"?o+="[]":i==="full"&&(o+="["+(l.label||l.identifier)+"]"),l.type==="imageReference")return[{type:"text",value:"!["+l.alt+o}];const u=n.all(l),s=u[0];s&&s.type==="text"?s.value="["+s.value:u.unshift({type:"text",value:"["});const c=u[u.length-1];return c&&c.type==="text"?c.value+=o:u.push({type:"text",value:o}),u}function c_(n,l){const i=String(l.identifier).toUpperCase(),o=n.definitionById.get(i);if(!o)return Km(n,l);const u={src:Si(o.url||""),alt:l.alt};o.title!==null&&o.title!==void 0&&(u.title=o.title);const s={type:"element",tagName:"img",properties:u,children:[]};return n.patch(l,s),n.applyData(l,s)}function f_(n,l){const i={src:Si(l.url)};l.alt!==null&&l.alt!==void 0&&(i.alt=l.alt),l.title!==null&&l.title!==void 0&&(i.title=l.title);const o={type:"element",tagName:"img",properties:i,children:[]};return n.patch(l,o),n.applyData(l,o)}function d_(n,l){const i={type:"text",value:l.value.replace(/\r?\n|\r/g," ")};n.patch(l,i);const o={type:"element",tagName:"code",properties:{},children:[i]};return n.patch(l,o),n.applyData(l,o)}function h_(n,l){const i=String(l.identifier).toUpperCase(),o=n.definitionById.get(i);if(!o)return Km(n,l);const u={href:Si(o.url||"")};o.title!==null&&o.title!==void 0&&(u.title=o.title);const s={type:"element",tagName:"a",properties:u,children:n.all(l)};return n.patch(l,s),n.applyData(l,s)}function m_(n,l){const i={href:Si(l.url)};l.title!==null&&l.title!==void 0&&(i.title=l.title);const o={type:"element",tagName:"a",properties:i,children:n.all(l)};return n.patch(l,o),n.applyData(l,o)}function p_(n,l,i){const o=n.all(l),u=i?g_(i):Qm(l),s={},c=[];if(typeof l.checked=="boolean"){const g=o[0];let y;g&&g.type==="element"&&g.tagName==="p"?y=g:(y={type:"element",tagName:"p",properties:{},children:[]},o.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:l.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let f=-1;for(;++f<o.length;){const g=o[f];(u||f!==0||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
|
|
49
|
+
`}),g.type==="element"&&g.tagName==="p"&&!u?c.push(...g.children):c.push(g)}const m=o[o.length-1];m&&(u||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
50
|
+
`});const h={type:"element",tagName:"li",properties:s,children:c};return n.patch(l,h),n.applyData(l,h)}function g_(n){let l=!1;if(n.type==="list"){l=n.spread||!1;const i=n.children;let o=-1;for(;!l&&++o<i.length;)l=Qm(i[o])}return l}function Qm(n){const l=n.spread;return l??n.children.length>1}function y_(n,l){const i={},o=n.all(l);let u=-1;for(typeof l.start=="number"&&l.start!==1&&(i.start=l.start);++u<o.length;){const c=o[u];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const s={type:"element",tagName:l.ordered?"ol":"ul",properties:i,children:n.wrap(o,!0)};return n.patch(l,s),n.applyData(l,s)}function b_(n,l){const i={type:"element",tagName:"p",properties:{},children:n.all(l)};return n.patch(l,i),n.applyData(l,i)}function v_(n,l){const i={type:"root",children:n.wrap(n.all(l))};return n.patch(l,i),n.applyData(l,i)}function S_(n,l){const i={type:"element",tagName:"strong",properties:{},children:n.all(l)};return n.patch(l,i),n.applyData(l,i)}function E_(n,l){const i=n.all(l),o=i.shift(),u=[];if(o){const c={type:"element",tagName:"thead",properties:{},children:n.wrap([o],!0)};n.patch(l.children[0],c),u.push(c)}if(i.length>0){const c={type:"element",tagName:"tbody",properties:{},children:n.wrap(i,!0)},f=$s(l.children[1]),m=gm(l.children[l.children.length-1]);f&&m&&(c.position={start:f,end:m}),u.push(c)}const s={type:"element",tagName:"table",properties:{},children:n.wrap(u,!0)};return n.patch(l,s),n.applyData(l,s)}function x_(n,l,i){const o=i?i.children:void 0,s=(o?o.indexOf(l):1)===0?"th":"td",c=i&&i.type==="table"?i.align:void 0,f=c?c.length:l.children.length;let m=-1;const h=[];for(;++m<f;){const y=l.children[m],v={},b=c?c[m]:void 0;b&&(v.align=b);let w={type:"element",tagName:s,properties:v,children:[]};y&&(w.children=n.all(y),n.patch(y,w),w=n.applyData(y,w)),h.push(w)}const g={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(l,g),n.applyData(l,g)}function __(n,l){const i={type:"element",tagName:"td",properties:{},children:n.all(l)};return n.patch(l,i),n.applyData(l,i)}const Jm=9,Wm=32;function w_(n){const l=String(n),i=/\r?\n|\r/g;let o=i.exec(l),u=0;const s=[];for(;o;)s.push($m(l.slice(u,o.index),u>0,!0),o[0]),u=o.index+o[0].length,o=i.exec(l);return s.push($m(l.slice(u),u>0,!1)),s.join("")}function $m(n,l,i){let o=0,u=n.length;if(l){let s=n.codePointAt(o);for(;s===Jm||s===Wm;)o++,s=n.codePointAt(o)}if(i){let s=n.codePointAt(u-1);for(;s===Jm||s===Wm;)u--,s=n.codePointAt(u-1)}return u>o?n.slice(o,u):""}function C_(n,l){const i={type:"text",value:w_(String(l.value))};return n.patch(l,i),n.applyData(l,i)}function T_(n,l){const i={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(l,i),n.applyData(l,i)}const A_={blockquote:n_,break:r_,code:i_,delete:a_,emphasis:l_,footnoteReference:o_,heading:s_,html:u_,imageReference:c_,image:f_,inlineCode:d_,linkReference:h_,link:m_,listItem:p_,list:y_,paragraph:b_,root:v_,strong:S_,table:E_,tableCell:__,tableRow:x_,text:C_,thematicBreak:T_,toml:Vl,yaml:Vl,definition:Vl,footnoteDefinition:Vl};function Vl(){}const ep=-1,Gl=0,La=1,Xl=2,hu=3,mu=4,pu=5,gu=6,tp=7,np=8,rp=typeof self=="object"?self:globalThis,k_=(n,l)=>{const i=(u,s)=>(n.set(s,u),u),o=u=>{if(n.has(u))return n.get(u);const[s,c]=l[u];switch(s){case Gl:case ep:return i(c,u);case La:{const f=i([],u);for(const m of c)f.push(o(m));return f}case Xl:{const f=i({},u);for(const[m,h]of c)f[o(m)]=o(h);return f}case hu:return i(new Date(c),u);case mu:{const{source:f,flags:m}=c;return i(new RegExp(f,m),u)}case pu:{const f=i(new Map,u);for(const[m,h]of c)f.set(o(m),o(h));return f}case gu:{const f=i(new Set,u);for(const m of c)f.add(o(m));return f}case tp:{const{name:f,message:m}=c;return i(new rp[f](m),u)}case np:return i(BigInt(c),u);case"BigInt":return i(Object(BigInt(c)),u);case"ArrayBuffer":return i(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return i(new DataView(f),c)}}return i(new rp[s](c),u)};return o},ip=n=>k_(new Map,n)(0),Ei="",{toString:N_}={},{keys:R_}=Object,Ia=n=>{const l=typeof n;if(l!=="object"||!n)return[Gl,l];const i=N_.call(n).slice(8,-1);switch(i){case"Array":return[La,Ei];case"Object":return[Xl,Ei];case"Date":return[hu,Ei];case"RegExp":return[mu,Ei];case"Map":return[pu,Ei];case"Set":return[gu,Ei];case"DataView":return[La,i]}return i.includes("Array")?[La,i]:i.includes("Error")?[tp,i]:[Xl,i]},Zl=([n,l])=>n===Gl&&(l==="function"||l==="symbol"),O_=(n,l,i,o)=>{const u=(c,f)=>{const m=o.push(c)-1;return i.set(f,m),m},s=c=>{if(i.has(c))return i.get(c);let[f,m]=Ia(c);switch(f){case Gl:{let g=c;switch(m){case"bigint":f=np,g=c.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+m);g=null;break;case"undefined":return u([ep],c)}return u([f,g],c)}case La:{if(m){let v=c;return m==="DataView"?v=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(v=new Uint8Array(c)),u([m,[...v]],c)}const g=[],y=u([f,g],c);for(const v of c)g.push(s(v));return y}case Xl:{if(m)switch(m){case"BigInt":return u([m,c.toString()],c);case"Boolean":case"Number":case"String":return u([m,c.valueOf()],c)}if(l&&"toJSON"in c)return s(c.toJSON());const g=[],y=u([f,g],c);for(const v of R_(c))(n||!Zl(Ia(c[v])))&&g.push([s(v),s(c[v])]);return y}case hu:return u([f,c.toISOString()],c);case mu:{const{source:g,flags:y}=c;return u([f,{source:g,flags:y}],c)}case pu:{const g=[],y=u([f,g],c);for(const[v,b]of c)(n||!(Zl(Ia(v))||Zl(Ia(b))))&&g.push([s(v),s(b)]);return y}case gu:{const g=[],y=u([f,g],c);for(const v of c)(n||!Zl(Ia(v)))&&g.push(s(v));return y}}const{message:h}=c;return u([f,{name:m,message:h}],c)};return s},ap=(n,{json:l,lossy:i}={})=>{const o=[];return O_(!(l||i),!!l,new Map,o)(n),o},Kl=typeof structuredClone=="function"?(n,l)=>l&&("json"in l||"lossy"in l)?ip(ap(n,l)):structuredClone(n):(n,l)=>ip(ap(n,l));function z_(n,l){const i=[{type:"text",value:"↩"}];return l>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(l)}]}),i}function M_(n,l){return"Back to reference "+(n+1)+(l>1?"-"+l:"")}function D_(n){const l=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",i=n.options.footnoteBackContent||z_,o=n.options.footnoteBackLabel||M_,u=n.options.footnoteLabel||"Footnotes",s=n.options.footnoteLabelTagName||"h2",c=n.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[m]);if(!h)continue;const g=n.all(h),y=String(h.identifier).toUpperCase(),v=Si(y.toLowerCase());let b=0;const w=[],E=n.footnoteCounts.get(y);for(;E!==void 0&&++b<=E;){w.length>0&&w.push({type:"text",value:" "});let A=typeof i=="string"?i:i(m,b);typeof A=="string"&&(A={type:"text",value:A}),w.push({type:"element",tagName:"a",properties:{href:"#"+l+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(m,b),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const T=g[g.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const A=T.children[T.children.length-1];A&&A.type==="text"?A.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...w)}else g.push(...w);const _={type:"element",tagName:"li",properties:{id:l+"fn-"+v},children:n.wrap(g,!0)};n.patch(h,_),f.push(_)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Kl(c),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
|
|
52
51
|
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(f,!0)},{type:"text",value:`
|
|
53
|
-
`}]}}const
|
|
54
|
-
`});++
|
|
55
|
-
`}),i.push(n[
|
|
56
|
-
`}),i}function
|
|
57
|
-
`},u),l}function Xx(n,a){return n&&"run"in n?async function(i,s){const u=Um(i,{file:s,...a});await n.run(u,s)}:function(i,s){return Um(i,{file:s,...n||a})}}function Fm(n){if(n)throw n}var Uu,Pm;function Kx(){if(Pm)return Uu;Pm=1;var n=Object.prototype.hasOwnProperty,a=Object.prototype.toString,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u=function(h){return typeof Array.isArray=="function"?Array.isArray(h):a.call(h)==="[object Array]"},l=function(h){if(!h||a.call(h)!=="[object Object]")return!1;var y=n.call(h,"constructor"),b=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!b)return!1;var _;for(_ in h);return typeof _>"u"||n.call(h,_)},c=function(h,y){i&&y.name==="__proto__"?i(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(n.call(h,y)){if(s)return s(h,y).value}else return;return h[y]};return Uu=function d(){var h,y,b,_,m,C,S=arguments[0],x=1,w=arguments.length,k=!1;for(typeof S=="boolean"&&(k=S,S=arguments[1]||{},x=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});x<w;++x)if(h=arguments[x],h!=null)for(y in h)b=f(S,y),_=f(h,y),S!==_&&(k&&_&&(l(_)||(m=u(_)))?(m?(m=!1,C=b&&u(b)?b:[]):C=b&&l(b)?b:{},c(S,{name:y,newValue:d(k,C,_)})):typeof _<"u"&&c(S,{name:y,newValue:_}));return S},Uu}var Qx=Kx();const Fu=Ws(Qx);function Pu(n){if(typeof n!="object"||n===null)return!1;const a=Object.getPrototypeOf(n);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function Wx(){const n=[],a={run:i,use:s};return a;function i(...u){let l=-1;const c=u.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...u);function f(d,...h){const y=n[++l];let b=-1;if(d){c(d);return}for(;++b<u.length;)(h[b]===null||h[b]===void 0)&&(h[b]=u[b]);u=h,y?Jx(y,f)(...h):c(null,...h)}}function s(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return n.push(u),a}}function Jx(n,a){let i;return s;function s(...c){const f=n.length>c.length;let d;f&&c.push(u);try{d=n.apply(this,c)}catch(h){const y=h;if(f&&i)throw y;return u(y)}f||(d&&d.then&&typeof d.then=="function"?d.then(l,u):d instanceof Error?u(d):l(d))}function u(c,...f){i||(i=!0,a(c,...f))}function l(c){u(null,c)}}const Hn={basename:$x,dirname:e2,extname:t2,join:n2,sep:"/"};function $x(n,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');is(n);let i=0,s=-1,u=n.length,l;if(a===void 0||a.length===0||a.length>n.length){for(;u--;)if(n.codePointAt(u)===47){if(l){i=u+1;break}}else s<0&&(l=!0,s=u+1);return s<0?"":n.slice(i,s)}if(a===n)return"";let c=-1,f=a.length-1;for(;u--;)if(n.codePointAt(u)===47){if(l){i=u+1;break}}else c<0&&(l=!0,c=u+1),f>-1&&(n.codePointAt(u)===a.codePointAt(f--)?f<0&&(s=u):(f=-1,s=c));return i===s?s=c:s<0&&(s=n.length),n.slice(i,s)}function e2(n){if(is(n),n.length===0)return".";let a=-1,i=n.length,s;for(;--i;)if(n.codePointAt(i)===47){if(s){a=i;break}}else s||(s=!0);return a<0?n.codePointAt(0)===47?"/":".":a===1&&n.codePointAt(0)===47?"//":n.slice(0,a)}function t2(n){is(n);let a=n.length,i=-1,s=0,u=-1,l=0,c;for(;a--;){const f=n.codePointAt(a);if(f===47){if(c){s=a+1;break}continue}i<0&&(c=!0,i=a+1),f===46?u<0?u=a:l!==1&&(l=1):u>-1&&(l=-1)}return u<0||i<0||l===0||l===1&&u===i-1&&u===s+1?"":n.slice(u,i)}function n2(...n){let a=-1,i;for(;++a<n.length;)is(n[a]),n[a]&&(i=i===void 0?n[a]:i+"/"+n[a]);return i===void 0?".":r2(i)}function r2(n){is(n);const a=n.codePointAt(0)===47;let i=i2(n,!a);return i.length===0&&!a&&(i="."),i.length>0&&n.codePointAt(n.length-1)===47&&(i+="/"),a?"/"+i:i}function i2(n,a){let i="",s=0,u=-1,l=0,c=-1,f,d;for(;++c<=n.length;){if(c<n.length)f=n.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(u===c-1||l===1))if(u!==c-1&&l===2){if(i.length<2||s!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(d=i.lastIndexOf("/"),d!==i.length-1){d<0?(i="",s=0):(i=i.slice(0,d),s=i.length-1-i.lastIndexOf("/")),u=c,l=0;continue}}else if(i.length>0){i="",s=0,u=c,l=0;continue}}a&&(i=i.length>0?i+"/..":"..",s=2)}else i.length>0?i+="/"+n.slice(u+1,c):i=n.slice(u+1,c),s=c-u-1;u=c,l=0}else f===46&&l>-1?l++:l=-1}return i}function is(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const a2={cwd:s2};function s2(){return"/"}function Hu(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function o2(n){if(typeof n=="string")n=new URL(n);else if(!Hu(n)){const a=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw a.code="ERR_INVALID_ARG_TYPE",a}if(n.protocol!=="file:"){const a=new TypeError("The URL must be of scheme file");throw a.code="ERR_INVALID_URL_SCHEME",a}return l2(n)}function l2(n){if(n.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const a=n.pathname;let i=-1;for(;++i<a.length;)if(a.codePointAt(i)===37&&a.codePointAt(i+1)===50){const s=a.codePointAt(i+2);if(s===70||s===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(a)}const qu=["history","path","basename","stem","extname","dirname"];class Hm{constructor(a){let i;a?Hu(a)?i={path:a}:typeof a=="string"||u2(a)?i={value:a}:i=a:i={},this.cwd="cwd"in i?"":a2.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<qu.length;){const l=qu[s];l in i&&i[l]!==void 0&&i[l]!==null&&(this[l]=l==="history"?[...i[l]]:i[l])}let u;for(u in i)qu.includes(u)||(this[u]=i[u])}get basename(){return typeof this.path=="string"?Hn.basename(this.path):void 0}set basename(a){Vu(a,"basename"),Gu(a,"basename"),this.path=Hn.join(this.dirname||"",a)}get dirname(){return typeof this.path=="string"?Hn.dirname(this.path):void 0}set dirname(a){qm(this.basename,"dirname"),this.path=Hn.join(a||"",this.basename)}get extname(){return typeof this.path=="string"?Hn.extname(this.path):void 0}set extname(a){if(Gu(a,"extname"),qm(this.dirname,"extname"),a){if(a.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(a.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Hn.join(this.dirname,this.stem+(a||""))}get path(){return this.history[this.history.length-1]}set path(a){Hu(a)&&(a=o2(a)),Vu(a,"path"),this.path!==a&&this.history.push(a)}get stem(){return typeof this.path=="string"?Hn.basename(this.path,this.extname):void 0}set stem(a){Vu(a,"stem"),Gu(a,"stem"),this.path=Hn.join(this.dirname||"",a+(this.extname||""))}fail(a,i,s){const u=this.message(a,i,s);throw u.fatal=!0,u}info(a,i,s){const u=this.message(a,i,s);return u.fatal=void 0,u}message(a,i,s){const u=new Gt(a,i,s);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(a){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(a||void 0).decode(this.value)}}function Gu(n,a){if(n&&n.includes(Hn.sep))throw new Error("`"+a+"` cannot be a path: did not expect `"+Hn.sep+"`")}function Vu(n,a){if(!n)throw new Error("`"+a+"` cannot be empty")}function qm(n,a){if(!n)throw new Error("Setting `"+a+"` requires `path` to be set too")}function u2(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const c2=(function(n){const s=this.constructor.prototype,u=s[n],l=function(){return u.apply(l,arguments)};return Object.setPrototypeOf(l,s),l}),f2={}.hasOwnProperty;class Yu extends c2{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Wx()}copy(){const a=new Yu;let i=-1;for(;++i<this.attachers.length;){const s=this.attachers[i];a.use(...s)}return a.data(Fu(!0,{},this.namespace)),a}data(a,i){return typeof a=="string"?arguments.length===2?(Ku("data",this.frozen),this.namespace[a]=i,this):f2.call(this.namespace,a)&&this.namespace[a]||void 0:a?(Ku("data",this.frozen),this.namespace=a,this):this.namespace}freeze(){if(this.frozen)return this;const a=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const u=i.call(a,...s);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(a){this.freeze();const i=vo(a),s=this.parser||this.Parser;return Zu("parse",s),s(String(i),i)}process(a,i){const s=this;return this.freeze(),Zu("process",this.parser||this.Parser),Xu("process",this.compiler||this.Compiler),i?u(void 0,i):new Promise(u);function u(l,c){const f=vo(a),d=s.parse(f);s.run(d,f,function(y,b,_){if(y||!b||!_)return h(y);const m=b,C=s.stringify(m,_);p2(C)?_.value=C:_.result=C,h(y,_)});function h(y,b){y||!b?c(y):l?l(b):i(void 0,b)}}}processSync(a){let i=!1,s;return this.freeze(),Zu("processSync",this.parser||this.Parser),Xu("processSync",this.compiler||this.Compiler),this.process(a,u),Vm("processSync","process",i),s;function u(l,c){i=!0,Fm(l),s=c}}run(a,i,s){Gm(a),this.freeze();const u=this.transformers;return!s&&typeof i=="function"&&(s=i,i=void 0),s?l(void 0,s):new Promise(l);function l(c,f){const d=vo(i);u.run(a,d,h);function h(y,b,_){const m=b||a;y?f(y):c?c(m):s(void 0,m,_)}}}runSync(a,i){let s=!1,u;return this.run(a,i,l),Vm("runSync","run",s),u;function l(c,f){Fm(c),u=f,s=!0}}stringify(a,i){this.freeze();const s=vo(i),u=this.compiler||this.Compiler;return Xu("stringify",u),Gm(a),u(a,s)}use(a,...i){const s=this.attachers,u=this.namespace;if(Ku("use",this.frozen),a!=null)if(typeof a=="function")d(a,i);else if(typeof a=="object")Array.isArray(a)?f(a):c(a);else throw new TypeError("Expected usable value, not `"+a+"`");return this;function l(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...b]=h;d(y,b)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(u.settings=Fu(!0,u.settings,h.settings))}function f(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const b=h[y];l(b)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,y){let b=-1,_=-1;for(;++b<s.length;)if(s[b][0]===h){_=b;break}if(_===-1)s.push([h,...y]);else if(y.length>0){let[m,...C]=y;const S=s[_][1];Pu(S)&&Pu(m)&&(m=Fu(!0,S,m)),s[_]=[h,m,...C]}}}}const d2=new Yu().freeze();function Zu(n,a){if(typeof a!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Xu(n,a){if(typeof a!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function Ku(n,a){if(a)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Gm(n){if(!Pu(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Vm(n,a,i){if(!i)throw new Error("`"+n+"` finished async. Use `"+a+"` instead")}function vo(n){return h2(n)?n:new Hm(n)}function h2(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function p2(n){return typeof n=="string"||m2(n)}function m2(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const g2="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ym=[],Zm={allowDangerousHtml:!0},y2=/^(https?|ircs?|mailto|xmpp)$/i,b2=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function v2(n){const a=_2(n),i=S2(n);return E2(a.runSync(a.parse(i),i),n)}function _2(n){const a=n.rehypePlugins||Ym,i=n.remarkPlugins||Ym,s=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Zm}:Zm;return d2().use($w).use(i).use(Xx,s).use(a)}function S2(n){const a=n.children||"",i=new Hm;return typeof a=="string"&&(i.value=a),i}function E2(n,a){const i=a.allowedElements,s=a.allowElement,u=a.components,l=a.disallowedElements,c=a.skipHtml,f=a.unwrapDisallowed,d=a.urlTransform||w2;for(const y of b2)Object.hasOwn(a,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+g2+y.id,void 0);return Lm(n,h),PS(n,{Fragment:H.Fragment,components:u,ignoreInvalidStyle:!0,jsx:H.jsx,jsxs:H.jsxs,passKeys:!0,passNode:!0});function h(y,b,_){if(y.type==="raw"&&_&&typeof b=="number")return c?_.children.splice(b,1):_.children[b]={type:"text",value:y.value},b;if(y.type==="element"){let m;for(m in Cu)if(Object.hasOwn(Cu,m)&&Object.hasOwn(y.properties,m)){const C=y.properties[m],S=Cu[m];(S===null||S.includes(y.tagName))&&(y.properties[m]=d(String(C||""),m,y))}}if(y.type==="element"){let m=i?!i.includes(y.tagName):l?l.includes(y.tagName):!1;if(!m&&s&&typeof b=="number"&&(m=!s(y,b,_)),m&&_&&typeof b=="number")return f&&y.children?_.children.splice(b,1,...y.children):_.children.splice(b,1),b}}}function w2(n){const a=n.indexOf(":"),i=n.indexOf("?"),s=n.indexOf("#"),u=n.indexOf("/");return a===-1||u!==-1&&a>u||i!==-1&&a>i||s!==-1&&a>s||y2.test(n.slice(0,a))?n:""}function x2({text:n,maxWidth:a="200px",className:i="",icon:s,onClick:u,disabled:l=!1}){const[c,f]=$.useState(!1),d=$.useRef(null),h=$.useRef(null);return $.useEffect(()=>{const y=()=>{if(d.current&&h.current){const b=d.current.offsetWidth,_=h.current.scrollWidth;f(_>b)}};return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[n,a]),n?H.jsxs("div",{ref:d,onClick:l?void 0:u,className:Ze("inline-flex items-center gap-2 rounded-full border border-lavender-200/60 bg-white/80 px-3 py-1 shadow-sm text-xs text-slate-700 hover: cursor-pointer",i,l?"opacity-50 cursor-not-allowed":""),style:{maxWidth:a},title:n,children:[s&&H.jsx("span",{className:"text-lavender-500",children:s}),H.jsx("div",{className:"pill-marquee-wrapper",children:H.jsx("span",{ref:h,className:Ze("block whitespace-normal",c?"pill-marquee":""),children:n})})]}):null}var C2=gd[" useInsertionEffect ".trim().toString()]||Sr;function k2({prop:n,defaultProp:a,onChange:i=()=>{},caller:s}){const[u,l,c]=T2({defaultProp:a,onChange:i}),f=n!==void 0,d=f?n:u;{const y=$.useRef(n!==void 0);$.useEffect(()=>{const b=y.current;b!==f&&console.warn(`${s} is changing from ${b?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,s])}const h=$.useCallback(y=>{if(f){const b=A2(y)?y(n):y;b!==n&&c.current?.(b)}else l(y)},[f,n,l,c]);return[d,h]}function T2({defaultProp:n,onChange:a}){const[i,s]=$.useState(n),u=$.useRef(i),l=$.useRef(a);return C2(()=>{l.current=a},[a]),$.useEffect(()=>{u.current!==i&&(l.current?.(i),u.current=i)},[i,u]),[i,s,l]}function A2(n){return typeof n=="function"}function R2(n){const a=$.useRef({value:n,previous:n});return $.useMemo(()=>(a.current.value!==n&&(a.current.previous=a.current.value,a.current.value=n),a.current.previous),[n])}function N2(n){const[a,i]=$.useState(void 0);return Sr(()=>{if(n){i({width:n.offsetWidth,height:n.offsetHeight});const s=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const l=u[0];let c,f;if("borderBoxSize"in l){const d=l.borderBoxSize,h=Array.isArray(d)?d[0]:d;c=h.inlineSize,f=h.blockSize}else c=n.offsetWidth,f=n.offsetHeight;i({width:c,height:f})});return s.observe(n,{box:"border-box"}),()=>s.unobserve(n)}else i(void 0)},[n]),a}var _o="Checkbox",[O2]=Cd(_o),[z2,Qu]=O2(_o);function M2(n){const{__scopeCheckbox:a,checked:i,children:s,defaultChecked:u,disabled:l,form:c,name:f,onCheckedChange:d,required:h,value:y="on",internal_do_not_use_render:b}=n,[_,m]=k2({prop:i,defaultProp:u??!1,onChange:d,caller:_o}),[C,S]=$.useState(null),[x,w]=$.useState(null),k=$.useRef(!1),N=C?!!c||!!C.closest("form"):!0,j={checked:_,disabled:l,setChecked:m,control:C,setControl:S,name:f,form:c,value:y,hasConsumerStoppedPropagationRef:k,required:h,defaultChecked:Rr(u)?!1:u,isFormControl:N,bubbleInput:x,setBubbleInput:w};return H.jsx(z2,{scope:a,...j,children:D2(b)?b(j):s})}var Xm="CheckboxTrigger",Km=$.forwardRef(({__scopeCheckbox:n,onKeyDown:a,onClick:i,...s},u)=>{const{control:l,value:c,disabled:f,checked:d,required:h,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:_,isFormControl:m,bubbleInput:C}=Qu(Xm,n),S=Xn(u,y),x=$.useRef(d);return $.useEffect(()=>{const w=l?.form;if(w){const k=()=>b(x.current);return w.addEventListener("reset",k),()=>w.removeEventListener("reset",k)}},[l,b]),H.jsx(_r.button,{type:"button",role:"checkbox","aria-checked":Rr(d)?"mixed":d,"aria-required":h,"data-state":eg(d),"data-disabled":f?"":void 0,disabled:f,value:c,...s,ref:S,onKeyDown:Kn(a,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:Kn(i,w=>{b(k=>Rr(k)?!0:!k),C&&m&&(_.current=w.isPropagationStopped(),_.current||w.stopPropagation())})})});Km.displayName=Xm;var Wu=$.forwardRef((n,a)=>{const{__scopeCheckbox:i,name:s,checked:u,defaultChecked:l,required:c,disabled:f,value:d,onCheckedChange:h,form:y,...b}=n;return H.jsx(M2,{__scopeCheckbox:i,checked:u,defaultChecked:l,disabled:f,required:c,onCheckedChange:h,name:s,form:y,value:d,internal_do_not_use_render:({isFormControl:_})=>H.jsxs(H.Fragment,{children:[H.jsx(Km,{...b,ref:a,__scopeCheckbox:i}),_&&H.jsx($m,{__scopeCheckbox:i})]})})});Wu.displayName=_o;var Qm="CheckboxIndicator",Wm=$.forwardRef((n,a)=>{const{__scopeCheckbox:i,forceMount:s,...u}=n,l=Qu(Qm,i);return H.jsx(Ai,{present:s||Rr(l.checked)||l.checked===!0,children:H.jsx(_r.span,{"data-state":eg(l.checked),"data-disabled":l.disabled?"":void 0,...u,ref:a,style:{pointerEvents:"none",...n.style}})})});Wm.displayName=Qm;var Jm="CheckboxBubbleInput",$m=$.forwardRef(({__scopeCheckbox:n,...a},i)=>{const{control:s,hasConsumerStoppedPropagationRef:u,checked:l,defaultChecked:c,required:f,disabled:d,name:h,value:y,form:b,bubbleInput:_,setBubbleInput:m}=Qu(Jm,n),C=Xn(i,m),S=R2(l),x=N2(s);$.useEffect(()=>{const k=_;if(!k)return;const N=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(N,"checked").set,M=!u.current;if(S!==l&&D){const L=new Event("click",{bubbles:M});k.indeterminate=Rr(l),D.call(k,Rr(l)?!1:l),k.dispatchEvent(L)}},[_,S,l,u]);const w=$.useRef(Rr(l)?!1:l);return H.jsx(_r.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??w.current,required:f,disabled:d,name:h,value:y,form:b,...a,tabIndex:-1,ref:C,style:{...a.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});$m.displayName=Jm;function D2(n){return typeof n=="function"}function Rr(n){return n==="indeterminate"}function eg(n){return Rr(n)?"indeterminate":n?"checked":"unchecked"}const Ju=$.forwardRef(({className:n,...a},i)=>H.jsx(Wu,{ref:i,className:Ze("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n),...a,children:H.jsx(Wm,{className:Ze("grid place-content-center text-current"),children:H.jsx(mh,{className:"h-4 w-4"})})}));Ju.displayName=Wu.displayName;var ci=(n=>(n.NOTA="none_of_the_above",n.AOTA="all_of_the_above",n))(ci||{});function I2({options:n,selectedValues:a,onSelectionChange:i,additionalOption:s,className:u,required:l=!0,maxSelections:c,error:f,disabled:d}){const h=s?{id:`extra-${s}`,label:s==="all_of_the_above"?"All of the above":"None of the above",value:s==="all_of_the_above"?"All of the above":"None of the above"}:{id:"extra-None of the above",label:"None of the above",value:"None of the above"},y=w=>h?w.filter(k=>k!==h.value):w,b=w=>h?s==="none_of_the_above"?(console.log("extraOption.value",h.value),w?[h.value]:[]):s==="all_of_the_above"?w?[...n.map(k=>k.value),h.value]:y(a):w?[...a,h.value]:y(a):a,_=(w,k)=>{const N=h?y(a):a;return k?c&&N.length>=c?null:[...N,w]:N.filter(j=>j!==w)},m=w=>!(l&&w.length===0&&a.length===1),C=(w,k)=>{const j=h&&w===h.value?b(k):_(w,k);j!==null&&m(j)&&(console.log("newSelection",j),i(j))},S=!l||a.length>0,x=h?a.filter(w=>w!==h.value).length:a.length;return n.length?H.jsxs("div",{className:Ze("bg-gray-50","rounded-lg","p-4","border border-gray-200",u),children:[H.jsxs("div",{className:"space-y-3",children:[n.map(w=>{const k=d||c&&x>=c&&!a.includes(w.value);return H.jsxs("div",{className:"flex items-center space-x-3",children:[H.jsx(Ju,{id:w.id,checked:!!a.includes(w.value),disabled:!!k,onCheckedChange:N=>C(w.value,!!N),className:"mt-0.5 border border-muted-foreground"}),H.jsx("label",{htmlFor:w.id,className:Ze("text-sm font-medium leading-none cursor-pointer",k?"text-muted-foreground cursor-not-allowed":"text-secondary-foreground"),children:w.label})]},w.id)}),h&&H.jsxs(H.Fragment,{children:[H.jsx("div",{className:"border-t border-gray-300 my-3"}),H.jsxs("div",{className:"flex items-center space-x-3",children:[H.jsx(Ju,{id:h.id,checked:a.includes(h.value),onCheckedChange:w=>C(h.value,w),className:"mt-0.5 border border-muted-foreground"}),H.jsx("label",{htmlFor:h.id,className:"text-sm font-medium leading-none cursor-pointer text-secondary-foreground",children:h.label})]})]})]}),f&&H.jsx("p",{className:"text-sm text-red-500 mt-3",children:f}),l&&!S&&H.jsx("p",{className:"text-sm text-red-500 mt-3",children:"Please select at least one option"}),c&&x>=c&&H.jsx("p",{className:"text-sm text-blue-600 mt-3",children:c===1?"You can select only 1 option":`Maximum ${c} selections allowed`})]}):null}function tg({file:n,onRemove:a,isPreview:i=!0,className:s=""}){const[u,l]=$.useState(!1),[c,f]=$.useState(""),d=n?.type?.startsWith("image/")??!1,h=n?.type==="application/pdf";$.useEffect(()=>{if(d){const _=URL.createObjectURL(n);return f(_),()=>URL.revokeObjectURL(_)}},[n,d]),$.useEffect(()=>{l(!1)},[n]);const y=()=>d?"text-green-600":"text-gray-600",b=_=>{if(_===0)return"0 B";const m=1024,C=["B","KB","MB","GB"],S=Math.floor(Math.log(_)/Math.log(m));return`${(_/Math.pow(m,S)).toFixed(1)} ${C[S]}`.toLowerCase()};return!d||u?H.jsxs("div",{className:`relative group inline-flex flex-shrink-0 bg-white border border-neutral-300 rounded-lg flex items-center gap-3 px-3 py-2.5 max-w-full ${i?"hover:bg-neutral-50":""} ${s}`,children:[H.jsx("div",{className:`flex-shrink-0 ${y()}`,children:H.jsx(V1,{className:"h-5 w-5"})}),H.jsxs("div",{className:"flex-1 min-w-0 max-w-[200px]",children:[n?.name&&H.jsx("div",{className:"text-sm font-medium text-[var(--color-foreground)] truncate",children:n.name}),n?.size&&H.jsx("div",{className:"text-xs text-[var(--color-muted-foreground)]",children:b(n.size)})]}),i&&a&&H.jsx("button",{onClick:a,"aria-label":`Remove ${n.name}`,className:"flex-shrink-0 flex items-center justify-center w-5 h-5 text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)] transition-colors",children:H.jsx(Wl,{className:"h-4 w-4"})})]}):H.jsxs("div",{className:`relative group flex-shrink-0 ${s}`,children:[H.jsx("div",{className:`w-20 h-20 bg-white border border-neutral-300 rounded-lg flex items-center justify-center overflow-hidden ${i?"hover:bg-neutral-100 cursor-pointer":""}`,children:c&&H.jsx("img",{src:c,alt:n.name,className:"w-full h-full object-cover",onError:()=>l(!0)})}),i&&a&&H.jsx("button",{onClick:a,"aria-label":`Remove ${n.name}`,className:"absolute top-0 right-0 bg-[var(--color-muted)] text-black rounded-full w-5 h-5 flex items-center justify-center hover:bg-[var(--color-muted-foreground)] transition-colors z-10 transform translate-x-1 -translate-y-1",children:H.jsx(Wl,{className:"h-3 w-3 text-black"})})]})}function j2({files:n,onRemoveFile:a,isPreview:i=!0,className:s=""}){if(n.length===0)return null;const u=n.filter(c=>c.type?.startsWith("image/")),l=n.filter(c=>!c.type?.startsWith("image/"));return H.jsxs("div",{className:`flex flex-wrap justify-end gap-2 max-w-full ${s}`,children:[l.map(c=>{const f=n.indexOf(c);return H.jsx(tg,{file:c,onRemove:a?()=>a(f):void 0,isPreview:i},`${c.name}-${c.size}-${f}`)}),u.length>0&&H.jsx("div",{className:"flex gap-2 overflow-x-auto max-w-full p-1 scrollbar-hide",children:u.map(c=>{const f=n.indexOf(c);return H.jsx(tg,{file:c,onRemove:a?()=>a(f):void 0,isPreview:i},`${c.name}-${c.size}-${f}`)})})]})}function L2({value:n,onValueChange:a,placeholder:i="Select an option",className:s,triggerClassName:u,contentClassName:l,disabled:c=!1,options:f=[],size:d="default"}){const[h,y]=$.useState(!1),b=$.useRef(null),_=$.useRef(null),m=f.find(x=>x.value===n);$.useEffect(()=>{const x=w=>{h&&w.key==="Escape"&&(y(!1),_.current?.focus())};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[h]);const C=x=>{a?.(x),y(!1),_.current?.focus()},S=()=>{c||y(!h)};return H.jsxs("div",{className:Ze("relative w-full",s),children:[H.jsxs("button",{ref:_,type:"button",onClick:S,disabled:c,className:Ze('border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*="text-"])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 overflow-hidden',d==="default"?"min-h-9":"min-h-8",u),"aria-expanded":h,"aria-haspopup":"listbox",children:[H.jsx("span",{className:Ze("flex-1 text-left min-w-0 overflow-hidden break-words line-clamp-2",!m&&"text-muted-foreground"),children:m?m.label:i}),H.jsx(Ql,{className:Ze("size-4 opacity-50 pointer-events-none shrink-0 transition-transform duration-200",h&&"rotate-180")})]}),h&&H.jsx("div",{ref:b,className:Ze("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 relative z-50 max-h-[300px] min-w-[8rem] w-full overflow-x-hidden overflow-y-auto rounded-md shadow-md mt-1",l),role:"listbox",children:H.jsx("div",{className:"p-1",children:f.length===0?H.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground text-center",children:"No options available"}):f.map(x=>{const w=x.value===n;return H.jsxs("div",{onClick:()=>C(x.value),className:Ze("relative flex w-full cursor-pointer items-center gap-1 rounded-sm py-2.5 px-3 text-sm outline-none select-none transition-colors duration-150","hover:bg-accent hover:text-accent-foreground","focus-visible:bg-accent focus-visible:text-accent-foreground","active:bg-accent/80",w&&"bg-accent/50 text-foreground",c&&"pointer-events-none opacity-50 cursor-not-allowed"),role:"option","aria-selected":w,tabIndex:c?-1:0,onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),c||C(x.value))},children:[H.jsx("span",{className:"flex-1 text-left min-w-0 break-words line-clamp-2",children:x.label}),w&&H.jsx("span",{className:"absolute right-3 flex size-4 items-center justify-center shrink-0 pointer-events-none",children:H.jsx(mh,{className:"size-4 text-foreground"})})]},x.value)})})})]})}const B2=n=>n?n.split(" ").map(a=>a[0]).slice(0,2).join("").toUpperCase():"DR",ng=n=>{const a=n.toLocaleDateString(void 0,{weekday:"short"}).toUpperCase(),i=n.toLocaleDateString(void 0,{day:"2-digit"});return{weekday:a,dayNum:i}},rg=n=>[...n].sort((a,i)=>new Date(a.date).getTime()-new Date(i.date).getTime()),ig=(n,a)=>(n?.[a]?.slots_details?.length??0)>0;function U2({doctor:n,availability:a,callbacks:i,onBook:s,disabled:u=!1,getAvailabilityDatesForAppointment:l,getAvailableSlotsForAppointment:c}){const[f,d]=$.useState(!1),[h,y]=$.useState(0),[b,_]=$.useState(null),[m,C]=$.useState(0),[S,x]=$.useState(()=>n.hospitals[0]||null),[w,k]=$.useState(!0),[N,j]=$.useState(!1),[D,M]=$.useState(null),[L,V]=$.useState(!1),[F,W]=$.useState(null),oe=si(_e=>_e.sessionId),R=S?.hospital_id,Q=!!i?.[Di.AVAILABILITY_DATES],E=!!i?.[Di.AVAILABILITY_SLOTS],G=$.useMemo(()=>{if(!R)return a||null;const _e=D?.[R],Re=a?.[R];return _e?{...a||{},[R]:_e}:Re?a:a||null},[D,a,R]),J=$.useCallback(async()=>{if(!(!n.doctor_id||!oe||!R)){k(!0),W(null);try{const _e=await l({doctor_id:n.doctor_id,hospital_id:R,region_id:S?.region_id||""}),Re=_e?.available_dates?.length&&_e?.available_dates?.map(U=>({date:U,slots:[]}))||[],Ne=a?.[R]?.slots_details||[],g=D?.[R]?.slots_details||[],Y=new Map;Ne.forEach(U=>{Y.set(U.date,U)}),g.forEach(U=>{Y.set(U.date,U)});const A=[...Array.from(Y.values())];Re.forEach(U=>{Y.has(U.date)||A.push(U)});const T=rg(A);M(U=>({...U||{},[R]:{slots_details:T}}))}catch{W("Failed to load availability dates")}finally{k(!1)}}},[n.doctor_id,oe,R,S?.region_id,l,a,D]);$.useEffect(()=>{if(!R)return;const _e=ig(D,R),Re=ig(a??null,R);V(!1),y(0),C(0),_(null),W(null),!_e&&!Re&&Q&&oe?J():k(!1)},[R]);const K=$.useMemo(()=>{if(!R)return new Date;const _e=G?.[R]?.slots_details;if(!_e?.length)return new Date;const Re=_e[0];return Re?new Date(Re.date):new Date},[G,R]),ue=$.useCallback(async _e=>{if(!(!n.doctor_id||!R||!S?.region_id||!oe)){j(!0);try{const Re=await c(_e,{doctor_id:n.doctor_id,hospital_id:R,region_id:S.region_id});if(!Re?.slots?.length)return;M(Ne=>{if(!Ne||!Ne?.[R]?.slots_details?.length)return{...Ne||{},[R]:{slots_details:[{date:_e,slots:Re.slots}]}};const g=Ne[R].slots_details.map(A=>A.date===_e?{...A,slots:Re.slots}:A),Z=Ne[R].slots_details.some(A=>A.date===_e)?g:[...g,{date:_e,slots:Re.slots}];return{...Ne,[R]:{slots_details:rg(Z)}}})}catch{W("Failed to load slots")}finally{j(!1)}}},[n.doctor_id,R,S?.region_id,oe,c]);$.useEffect(()=>{if(!R||L||w)return;const _e=G?.[R],Re=_e?.slots_details||[];if(R&&Re.length>0&&!L){let Ne=0;const g=_e?.selected_date||a?.[R]?.selected_date;if(g){const Z=Re.findIndex(A=>A.date===g);Z>=0&&(Ne=Z)}else{const Z=a?.[R]?.slots_details||[],A=Re.findIndex(T=>{const U=Z.find(ee=>ee.date===T.date);return U?.slots&&U.slots.length>0});A>=0&&(Ne=A)}y(Ne),C(Math.floor(Ne/3)*3);const Y=Re[Ne];Y&&(!Y?.slots||Y.slots.length===0)&&E&&oe&&ue(Y.date)}},[G,R,a,L,w]);const re=$.useMemo(()=>{const _e=R?G?.[R]?.slots_details:null;if(_e?.length){const Ne=Math.max(0,Math.floor(m/3)*3),g=Math.min(_e.length,Ne+3);return _e.slice(Ne,g).map(Y=>{const Z=new Date(Y.date),{weekday:A,dayNum:T}=ng(Z);return{weekday:A,dayNum:T,date:Y.date,hasAvailability:!0,fullDate:Z,hasSlots:!!(Y.slots&&Y.slots.length>0)}})}const Re=new Date(K);return Re.setDate(Re.getDate()+m),Array.from({length:3},(Ne,g)=>{const Y=new Date(Re);Y.setDate(Re.getDate()+g);const{weekday:Z,dayNum:A}=ng(Y),T=Y.toISOString().split("T")[0];return{weekday:Z,dayNum:A,date:T,hasAvailability:!1,fullDate:Y,hasSlots:!1}})},[K,m,G,R]),q=$.useMemo(()=>(R?G?.[R]?.slots_details:null)?.[h]||null,[G,R,h]),z=$.useMemo(()=>B2(n.name),[n.name]),I=$.useCallback(()=>{V(!0),C(_e=>Math.max(0,_e-3)),_(null)},[]),B=$.useCallback(()=>{V(!0);const _e=R?G?.[R]?.slots_details:null,Re=_e?.length?Math.max(0,_e.length-3):0;C(Ne=>Math.min(Re,Ne+3)),_(null)},[R,G]),te=$.useCallback(_e=>{V(!0);const Re=R?G?.[R]?.slots_details:null,Ne=Re?.findIndex(Y=>Y.date===_e)??-1;Ne>=0&&y(Ne),_(null);const g=Re?.find(Y=>Y.date===_e);E&&(!g?.slots||g.slots.length===0)&&n.doctor_id&&R&&S?.region_id&&oe&&ue(_e)},[R,G,E,n.doctor_id,S?.region_id]),ae=$.useMemo(()=>m>0,[m]),xe=$.useMemo(()=>{const _e=R?G?.[R]?.slots_details:null;if(!_e||_e.length===0)return!1;const Re=Math.max(0,_e.length-3);return m<Re},[m,G,R]),Te=$.useCallback(()=>{s&&q&&b&&s({date:q.date,time:b,doctorData:{doctor:n,hospital_id:R||"",region_id:S?.region_id||""}})},[s,q,b,n,R,S?.region_id]),Ce=$.useMemo(()=>n.hospitals.map(_e=>({value:_e.hospital_id,label:_e.name})),[n.hospitals]),ke=$.useCallback(_e=>{_(_e)},[]),je=$.useCallback(_e=>{const Re=n.hospitals.find(Ne=>Ne.hospital_id===_e);Re&&x(Re)},[n.hospitals]);return H.jsxs(Na,{className:"max-w-md rounded-xl border-lavender-200 shadow-md p-0 bg-white overflow-hidden","aria-label":"Appointment card",children:[H.jsx(yh,{className:"flex flex-row items-center justify-between gap-3 bg-lavender-50 rounded-t-xl p-4 border-b border-lavender-100 overflow-hidden",children:H.jsxs("div",{className:"flex items-center gap-3",children:[n.profile_pic&&H.jsxs(Oa,{className:"h-12 w-12 ring-2 ring-lavender-200",children:[H.jsx(Oh,{src:n.profile_pic,alt:`${n.name} profile photo`,crossOrigin:"anonymous"}),H.jsx(za,{className:"bg-lavender-100 text-lavender-700",children:z})]}),H.jsxs("div",{className:"min-w-0",children:[H.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[H.jsx("h3",{className:" text-base font-bold text-slate-900",children:n.name}),n.profile_link?H.jsx("a",{href:n.profile_link,target:"_blank",rel:"noreferrer",className:"text-xs font-semibold text-lavender-600 hover:text-lavender-700 hover:underline",children:"View profile"}):null]}),H.jsxs("p",{className:"mt-0.5 text-sm text-slate-600",children:[n.specialty,n.experience&&H.jsxs(H.Fragment,{children:[" • ",n.experience]})]})]})]})}),H.jsxs(bh,{className:"px-4 py-2",children:[H.jsxs("div",{className:"grid gap-2 border-b border-lavender-100 pb-3",children:[n?.timings&&H.jsxs("div",{className:"flex items-start gap-2 text-sm text-slate-900",children:[H.jsx(G1,{className:"h-4 w-4 text-lavender-600 mt-0.5 flex-shrink-0","aria-hidden":!0}),H.jsx("span",{className:"text-slate-600 text-xs",children:n?.timings})]}),n.languages?H.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-900",children:[H.jsx(Y1,{className:"h-4 w-4 text-lavender-600","aria-hidden":!0}),H.jsx("span",{className:"text-slate-600",children:n.languages})]}):null,n?.hospitals&&n.hospitals?.length>1?S&&S.name&&H.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-900",children:[H.jsx(ph,{className:"h-4 w-4 text-lavender-600","aria-hidden":!0}),H.jsx(L2,{options:Ce,placeholder:"Select Hospital",disabled:u,onValueChange:je,value:S?.hospital_id||""})]}):S&&S.name&&H.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-900",children:[H.jsx(ph,{className:"h-4 w-4 text-lavender-600","aria-hidden":!0}),H.jsx("span",{className:"text-slate-600",children:S.name})]})]}),S?.hospital_id&&G?.[S?.hospital_id]?.slots_details?.length||i?.[Di.AVAILABILITY_DATES]||w?H.jsx(Ot,{type:"button",variant:"outline","aria-expanded":f,"aria-controls":"ap-slots",onClick:()=>d(_e=>!_e),disabled:w,className:"mt-3 w-full border-lavender-500 text-lavender-600 hover:bg-lavender-50 hover:border-lavender-600 disabled:opacity-50",children:w?H.jsxs(H.Fragment,{children:[H.jsx(gh,{className:"h-4 w-4 mr-2 animate-spin"}),"Loading availability..."]}):H.jsxs(H.Fragment,{children:[H.jsx("span",{className:"mr-1",children:f?"Hide slots":"Show available slots"}),H.jsx(Ql,{className:`h-4 w-4 transition-transform ${f?"rotate-180":""}`,"aria-hidden":!0})]})}):H.jsx("div",{className:"mt-3 w-full flex items-center justify-center py-3 px-4 bg-lavender-50 border border-lavender-200 rounded-lg",children:H.jsx("span",{className:"text-sm text-slate-600 font-medium",children:"No details available"})}),f&&S?.hospital_id&&G?.[S?.hospital_id]?.slots_details?.length&&H.jsx("div",{id:"ap-slots",role:"region","aria-label":"Available slots",className:"pt-3",children:G?.[S?.hospital_id??""]?.slots_details?.length?H.jsxs(H.Fragment,{children:[H.jsxs("div",{className:"flex items-center gap-2 px-0.5",children:[H.jsx(Ot,{type:"button",variant:"outline",size:"icon",onClick:I,"aria-label":"Previous 3 days",disabled:u||!ae,className:"h-8 w-8 flex-shrink-0 rounded-md border-lavender-200 bg-white text-lavender-700 hover:bg-lavender-50 hover:border-lavender-300 disabled:opacity-50",children:H.jsx(H1,{className:"h-4 w-4"})}),H.jsx("div",{className:"flex-1 grid grid-cols-3 gap-1 min-w-0",children:re.map((_e,Re)=>{const Ne=q?.date===_e.date,g=!_e.hasAvailability;return H.jsxs(Ot,{type:"button",variant:"outline",onClick:()=>!g&&te(_e.date),disabled:g||u,"aria-current":Ne?"date":void 0,className:["flex flex-col items-center justify-center h-12 rounded-lg border-2 p-2 gap-0.5 min-w-0 transition-all",Ne?"border-lavender-500 ring-2 ring-lavender-200 bg-lavender-50 shadow-sm":g?"border-slate-200 bg-slate-50 text-slate-300 cursor-not-allowed":"border-slate-200 bg-white hover:bg-lavender-50 hover:border-lavender-300"].join(" "),children:[H.jsx("span",{className:["text-[10px] tracking-wide w-full text-center font-medium",Ne?"text-lavender-700":g?"text-slate-300":"text-slate-600"].join(" "),children:_e.weekday}),H.jsx("span",{className:["text-xs font-bold w-full text-center",Ne?"text-lavender-700":g?"text-slate-300":"text-slate-900"].join(" "),children:_e.dayNum})]},`${_e.date}-${Re}`)})}),H.jsx(Ot,{type:"button",variant:"outline",size:"icon",onClick:B,"aria-label":"Next 3 days",disabled:u||!xe,className:"h-8 w-8 flex-shrink-0 rounded-md border-lavender-200 bg-white text-lavender-700 hover:bg-lavender-50 hover:border-lavender-300 disabled:opacity-50",children:H.jsx(q1,{className:"h-4 w-4"})})]}),H.jsx("div",{className:"px-0.5 py-3",children:N?H.jsxs("div",{className:"flex items-center justify-center py-4",children:[H.jsx(gh,{className:"h-4 w-4 animate-spin text-lavender-600 mr-2"}),H.jsx("span",{className:"text-sm text-slate-600",children:"Loading slots..."})]}):q?.slots?.length?H.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-48 overflow-y-auto",children:q.slots.map((_e,Re)=>{const Ne=b===_e;return H.jsxs(Ot,{type:"button",variant:"outline",onClick:()=>ke(_e),"aria-pressed":Ne,disabled:u,className:["inline-flex h-9 items-center justify-center gap-2 rounded-lg px-3 text-xs font-semibold transition-all",Ne?"border-lavender-600 bg-lavender-600 text-white shadow-sm hover:bg-lavender-700 hover:border-lavender-700":"border-lavender-200 bg-white text-slate-900 hover:bg-lavender-50 hover:border-lavender-300"].join(" "),children:[H.jsx(P1,{className:`h-3.5 w-3.5 flex-shrink-0${Ne?"text-white":"text-lavender-600"}`}),H.jsx("span",{className:"truncate",children:_e})]},_e||`slot-${Re}`)})}):H.jsx("p",{className:"px-1 text-sm text-slate-600",children:"No slots available for this day."})}),H.jsx("div",{className:"px-0.5 pb-1.5",children:H.jsxs(Ot,{type:"button",onClick:Te,disabled:!b||u,"aria-disabled":!b,className:"w-full h-10 gap-2 bg-lavender-600 text-white hover:bg-lavender-700 disabled:opacity-60 shadow-sm font-semibold",children:["Book appointment",H.jsx(F1,{className:"h-4 w-4"})]})})]}):H.jsx("div",{className:"px-1 pb-2 pt-1",children:H.jsx("p",{className:"text-sm text-slate-600",children:F||"No availability provided."})})}),f&&!G?.[S?.hospital_id??""]?.slots_details?.length&&H.jsx("div",{className:"px-1 pb-2 pt-1",children:H.jsx("p",{className:"text-sm text-slate-600",children:F||"No availability provided."})})]})]})}function F2({callTool:n,doctorDetails:a,callbacks:i,onBook:s,disabled:u=!1}){const[l,c]=$.useState([]),[f,d]=$.useState(!1),[h,y]=$.useState(0),[b,_]=$.useState(null),m=si(M=>M.sessionId),C=a.doctor_ids||[],S=C.length,x=Math.min(3,S),w=S-x;$.useEffect(()=>{if(C.length===0||!m)return;(async()=>{d(!0),_(null);try{const L=C.slice(0,x),V=L.map(oe=>n(li.DOCTOR_DETAILS,{doctor_id:oe})),F=await Promise.allSettled(V),W=[];F.forEach((oe,R)=>{oe.status==="fulfilled"?W.push(oe.value):console.error(`Failed to load doctor ${L[R]}:`,oe.reason)}),c(W),y(W.length)}catch(L){console.error("Error loading initial doctors:",L),_("Failed to load doctor details. Please try again.")}finally{d(!1)}})()},[C,m,x]);const k=async()=>{if(!(h>=S||!m)){d(!0),_(null);try{const M=C.slice(h),L=M.map(W=>n(li.DOCTOR_DETAILS,{doctor_id:W})),V=await Promise.allSettled(L),F=[];V.forEach((W,oe)=>{W.status==="fulfilled"?F.push(W.value):console.error(`Failed to load doctor ${M[oe]}:`,W.reason)}),c(W=>[...W,...F]),y(W=>W+F.length)}catch(M){console.error("Error loading remaining doctors:",M),_("Failed to load more doctor details. Please try again.")}finally{d(!1)}}},N=M=>{s&&s(M)},j=async M=>{const L=i?.[Di.AVAILABILITY_DATES].tool_name||li.AVAILABILITY_DATES;return await n(L,{doctor_id:M.doctor_id,hospital_id:M.hospital_id,region_id:M.region_id})},D=async(M,L)=>{const V=i?.[Di.AVAILABILITY_SLOTS].tool_name||li.AVAILABILITY_SLOTS;return await n(V,{appointment_date:M,doctor_id:L.doctor_id,hospital_id:L.hospital_id,region_id:L.region_id})};return f&&l.length===0?H.jsx("div",{className:"flex items-center justify-center py-8",children:H.jsxs("div",{className:"text-center",children:[H.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[var(--color-primary)] mx-auto mb-3"}),H.jsx("p",{className:"text-sm text-gray-500",children:"Loading doctor details..."})]})}):b&&l.length===0?H.jsx("div",{className:"flex items-center justify-center py-8",children:H.jsxs("div",{className:"text-center",children:[H.jsx("p",{className:"text-sm text-red-500 mb-2",children:b}),H.jsx(Ot,{variant:"outline",size:"sm",onClick:()=>{_(null),C.length>0&&m&&(async()=>{d(!0);try{const V=C.slice(0,x).map(oe=>n(li.DOCTOR_DETAILS,{doctor_id:oe})),F=await Promise.allSettled(V),W=[];F.forEach((oe,R)=>{oe.status==="fulfilled"&&W.push(oe.value)}),c(W),y(W.length)}catch{_("Failed to load doctor details. Please try again.")}finally{d(!1)}})()},children:"Retry"})]})}):l.length===0?H.jsx("div",{className:"flex items-center justify-center py-2",children:H.jsx("p",{className:"text-sm text-gray-500",children:"No doctor details available."})}):H.jsxs("div",{className:"space-y-4",children:[H.jsx("div",{className:"space-y-4",children:l.map((M,L)=>M?.doctor_id&&H.jsx(U2,{doctor:M,availability:a.availability,callbacks:i,onBook:N,disabled:u,getAvailabilityDatesForAppointment:j,getAvailableSlotsForAppointment:D},`${L}`))}),h<S&&H.jsx("div",{className:"flex justify-center",children:H.jsx(Ot,{variant:"outline",onClick:k,disabled:f,className:"px-6 py-2",children:f?H.jsxs(H.Fragment,{children:[H.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--color-primary)] mr-2"}),"Loading more doctors..."]}):`Show more (${w} more)`})}),b&&l.length>0&&H.jsxs("div",{className:"text-center",children:[H.jsx("p",{className:"text-sm text-red-500 mb-2",children:b}),H.jsx(Ot,{variant:"outline",size:"sm",onClick:k,disabled:f,children:"Retry loading more"})]})]})}function P2({role:n,content:a,timestamp:i,iconUrl:s,files:u,isLastMessage:l,progressMessage:c,toolEscalationData:f,callTool:d,onSendMessage:h}){const y=n==="user",[b,_]=$.useState([]),m=async N=>{const j=Date.now().toString();await h({message:N,messageId:j,toolCalled:!0})},C=async N=>{await h({message:`I want to book an appointment for ${N.doctorData?.doctor?.name||"the doctor"} on ${N.date} for ${N.time}`,toolCalled:!0})},S=N=>{_(N),console.log("Multi-select changed:",N)},x=()=>{if(!f?.details?.input?.additional_option)return;const N=f.details?.input?.additional_option;if(typeof N=="string"&&(N===ci.NOTA||N===ci.AOTA))return N;if(typeof N=="object"&&N!==null){if(N.NOTA===ci.NOTA)return ci.NOTA;if(N.AOTA===ci.AOTA)return ci.AOTA}},w=()=>{const N=f?.details?.input?.options;return N?Array.isArray(N)?N.map((j,D)=>({id:`option-${D}`,label:j.label,value:j.value})):Object.keys(N).map((j,D)=>({id:`option-${D}`,label:j,value:j})):[]},k=async()=>{if(b.length>0){const N=b.join(", "),j=Date.now().toString();await h({message:N,messageId:j,toolCalled:!0})}};return H.jsx("div",{className:Ze("flex",y?"justify-end":"justify-start"),children:H.jsxs("div",{className:Ze("flex gap-3",y?"flex-row-reverse":"flex-row",f?.details?.component===uo.MULTI?"max-w-md":y?"max-w-[60%]":"max-w-xs"),children:[!y&&H.jsx(Oa,{className:"w-8 h-8 bg-gradient-to-br from-lavender-400 to-lavender-500 text-white text-xs font-bold flex-shrink-0",children:H.jsx(za,{className:"bg-transparent text-white text-xs font-bold",children:s?H.jsx("img",{src:s,alt:"Bot Icon",className:"w-full h-full"}):H.jsx(hh,{className:"w-full h-full"})})}),H.jsxs(Na,{className:Ze("px-4 py-2 rounded-2xl shadow-none break-words overflow-wrap-anywhere whitespace-pre-wrap",y?"bg-lavender-100/95 backdrop-blur-md text-slate-900 rounded-br-none border border-lavender-200/60":"bg-white/80 backdrop-blur-md text-slate-800 shadow-sm rounded-bl-none border border-lavender-200/40",f&&"w-full"),children:[c&&!y&&l&&H.jsx("p",{className:"text-sm font-medium text-slate-500 pb-2",children:c}),a&&H.jsx("div",{className:"text-sm markdown-content mb-3",children:H.jsx(v2,{children:a})}),u&&u.length>0&&H.jsx("div",{className:"mt-2",children:H.jsx(j2,{files:u,isPreview:!1,className:""})}),f?.details?.component===uo.PILL&&f?.details?.input?.options&&H.jsx("div",{className:"flex flex-wrap gap-2 mt-3",children:f.details?.input?.options.map((N,j)=>H.jsx(x2,{disabled:f?.isResponded,text:N?.label||"",onClick:()=>m(N?.value||""),className:"cursor-pointer hover:bg-lavender-100/80 transition-colors"},j))}),f?.details?.component===uo.MULTI&&f?.details?.input?.options&&H.jsxs("div",{className:"mt-3 space-y-3 break-words overflow-wrap-anywhere whitespace-pre-wrap",children:[H.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Select multiple options:"}),H.jsx(I2,{options:w(),selectedValues:b,onSelectionChange:S,additionalOption:x(),disabled:f?.isResponded}),H.jsx(Ot,{onClick:k,disabled:b.length===0||f?.isResponded,className:Ze("w-full rounded-lg px-4 py-2 text-sm font-medium transition-all","bg-blue-100 hover:bg-blue-200 text-blue-600 border border-blue-200","disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 disabled:border-gray-200","shadow-sm hover:shadow-md active:scale-[0.98] "),children:"Confirm"})]}),f?.details?.component===uo.DOCTOR_CARD&&f?.details?.input?.doctor_details&&d?H.jsx("div",{className:"mt-3",children:H.jsx(F2,{doctorDetails:f?.details?.input?.doctor_details,callTool:d,callbacks:f?.details?._meta?.callbacks,onBook:C,disabled:f?.isResponded})}):null,c&&!y&&l&&H.jsx("p",{className:"text-sm font-medium text-teal-600",children:c}),i&&H.jsx("p",{className:Ze("text-xs mt-2 text-right","text-slate-500"),children:i})]})]})})}function H2({messages:n,onSendMessage:a,iconUrl:i,callTool:s}){const u=si(c=>c.isWaitingForResponse),l=si(c=>c.progressMessage);return H.jsxs(H.Fragment,{children:[(n&&n.length>0||l)&&H.jsx(H.Fragment,{children:n.map((c,f)=>H.jsx("div",{className:"animate-slideUp scroll-mt-[80px]",id:f===n.length-1?"last-message":void 0,children:H.jsx(P2,{role:c.role,content:c.content,files:c.files||[],iconUrl:i,toolEscalationData:c.toolEscalationData,timestamp:c.timestamp,onSendMessage:a,isLastMessage:f===n.length-1,progressMessage:l,callTool:s})},c.id))}),u&&H.jsx(q2,{iconUrl:i})]})}function q2({iconUrl:n}){return H.jsx("div",{className:"animate-slideUp",children:H.jsx("div",{className:"flex justify-start",children:H.jsxs("div",{className:"flex gap-3",children:[H.jsx(Oa,{className:"w-8 h-8 bg-gradient-to-br from-lavender-400 to-lavender-500 text-white text-xs font-bold flex-shrink-0",children:H.jsx(za,{className:"bg-transparent text-white text-xs font-bold",children:n?H.jsx("img",{src:n,alt:"Bot Icon",className:"w-4 h-4",loading:"lazy"}):H.jsx(hh,{className:"w-4 h-4"})})}),H.jsx(Na,{className:"px-4 py-2 rounded-2xl shadow-none bg-white/80 backdrop-blur-md text-slate-800 shadow-sm rounded-bl-none border border-lavender-200/40",children:H.jsxs("div",{className:"flex items-center gap-1.5","aria-label":"Bot is typing",children:[H.jsx("span",{className:"text-sm text-slate-400",children:"Thinking"}),[0,1,2].map(a=>H.jsx("span",{className:"w-2 h-2 rounded-full bg-slate-400 animate-pulse",style:{animationDelay:`${a*150}ms`}},a))]})})]})})})}const G2=Object.freeze(Object.defineProperty({__proto__:null,default:H2},Symbol.toStringTag,{value:"Module"}));function V2({onTaskClick:n,disabled:a,tasks:i}){return i?.length?H.jsx("div",{className:"grid grid-cols-2 gap-3",children:i.map(s=>H.jsx(Ot,{type:"button",variant:"ghost",disabled:a,onClick:()=>n(s.value||""),className:"h-auto w-full flex flex-col items-start bg-white shadow-lg ring-1 ring-lavender-100 backdrop-blur-sm rounded-2xl p-4 hover:bg-white/95 hover:border-lavender-300 hover:shadow-lg transition-all text-left group",children:H.jsx("div",{className:"flex items-start justify-between gap-3",children:H.jsx("h3",{className:"font-semibold text-sm text-slate-900 text-wrap group-hover:text-lavender-600 transition-colors",children:s.label||""})})},s.value))}):null}function Y2({initialPrompt:n,tasks:a,onTaskClick:i,disabled:s}){return H.jsxs(H.Fragment,{children:[H.jsx("div",{className:"text-center space-y-2 animate-fadeIn",children:H.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:n||"How can I assist you today?"})}),H.jsx(V2,{onTaskClick:i,disabled:s,tasks:a})]})}const Z2=Object.freeze(Object.defineProperty({__proto__:null,default:Y2},Symbol.toStringTag,{value:"Module"}));function X2({className:n="",onRetry:a,onStartNewSession:i,showRetryButton:s,startNewConnection:u,clearError:l,error:c,isConnected:f}){const{isOnline:d}=kp(),[h,y]=$.useState(!0);return $.useEffect(()=>{if(!u&&!s&&!!c){y(!0);const m=setTimeout(()=>y(!1),5e3);return()=>clearTimeout(m)}y(!0)},[c,u,s]),u?H.jsx("div",{className:Ze("mx-4 mb-3 px-2 py-1 bg-[#FFFBEB] border border-[#FEE39B] rounded-lg",n),children:H.jsxs("div",{className:"flex items-center gap-3",children:[H.jsx("div",{className:"w-4 h-4 bg-[#F7B500] rounded-full flex items-center justify-center flex-shrink-0",children:H.jsx("span",{className:"text-white text-sm font-bold",children:"!"})}),H.jsxs("div",{className:"flex-1",children:[H.jsx("div",{className:"text-slate-700 font-semibold text-sm",children:c?.title??"Something went wrong"}),H.jsx("div",{className:"text-[#666666] text-xs mt-1",children:"Start a new session."})]}),H.jsxs("button",{onClick:()=>{l(),i?.()},className:"p-2 bg-[#3B71F7] text-white text-xs font-semibold rounded-lg hover:bg-[#2E5CD9] transition-colors flex items-center gap-2 flex-shrink-0",children:[H.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:H.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),H.jsx("span",{className:"text-xs font-semibold",children:"Start new chat"})]})]})}):s?(console.log("ConnectionStatus: showRetryButton",s),H.jsx("div",{className:Ze("mx-4 mb-3 p-2 bg-[#FFFBEB] border border-[#FEE39B] rounded-lg",n),children:H.jsxs("div",{className:"flex items-center gap-3",children:[H.jsx("div",{className:"w-5 h-5 bg-[#F7B500] rounded-full flex items-center justify-center flex-shrink-0",children:H.jsx("span",{className:"text-white text-sm font-bold",children:"!"})}),H.jsxs("div",{className:"flex-1",children:[H.jsx("div",{className:"text-slate-700 font-semibold text-sm",children:c?.title??"Failed to connect"}),H.jsx("div",{className:"text-slate-500 text-xs mt-1",children:c?.description??"Please check your connection and try again"})]}),H.jsxs("button",{onClick:()=>{l(),a?.()},className:"px-4 py-2 bg-lavender-600 text-white text-sm font-semibold rounded-lg hover:bg-lavender-700 transition-colors flex items-center gap-2 flex-shrink-0",children:[H.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:H.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Retry"]})]})})):f&&d&&!c?.title||!u&&!s&&!h?null:H.jsx("div",{className:Ze("mx-4 mb-3 p-2 bg-[#FFFBEB] border border-[#FDD835] rounded-lg transition-opacity duration-500",n),children:H.jsxs("div",{className:"flex items-center gap-3",children:[H.jsx("div",{className:"w-5 h-5 bg-[#FDD835] rounded-full flex items-center justify-center flex-shrink-0",children:H.jsx("span",{className:"text-white text-sm font-bold",children:"!"})}),H.jsxs("div",{className:"flex-1",children:[H.jsx("div",{className:"text-slate-700 font-semibold text-sm",children:d?c?.title||"Connecting...":"No internet connection"}),H.jsx("div",{className:"text-slate-500 text-xs mt-1",children:d?c?.description??"Please wait while we try to connect":"Please check your internet connection"})]}),!f&&H.jsx("div",{className:"flex-shrink-0",children:H.jsx("div",{className:"w-6 h-6 border-2 border-[#FDD835] border-t-transparent rounded-full animate-spin"})})]})})}const K2=Object.freeze(Object.defineProperty({__proto__:null,ConnectionStatus:X2},Symbol.toStringTag,{value:"Module"}));return Dl.renderMedAssist=Tp,Object.defineProperty(Dl,Symbol.toStringTag,{value:"Module"}),Dl})({});
|
|
52
|
+
`}]}}const lp=(function(n){if(n==null)return B_;if(typeof n=="function")return Ql(n);if(typeof n=="object")return Array.isArray(n)?j_(n):L_(n);if(typeof n=="string")return I_(n);throw new Error("Expected function, string, or object as test")});function j_(n){const l=[];let i=-1;for(;++i<n.length;)l[i]=lp(n[i]);return Ql(o);function o(...u){let s=-1;for(;++s<l.length;)if(l[s].apply(this,u))return!0;return!1}}function L_(n){const l=n;return Ql(i);function i(o){const u=o;let s;for(s in n)if(u[s]!==l[s])return!1;return!0}}function I_(n){return Ql(l);function l(i){return i&&i.type===n}}function Ql(n){return l;function l(i,o,u){return!!(U_(i)&&n.call(this,i,typeof o=="number"?o:void 0,u||void 0))}}function B_(){return!0}function U_(n){return n!==null&&typeof n=="object"&&"type"in n}function FT(n){return n}const op=[],H_=!0,sp=!1,q_="skip";function P_(n,l,i,o){let u;typeof l=="function"&&typeof i!="function"?(o=i,i=l):u=l;const s=lp(u),c=o?-1:1;f(n,void 0,[])();function f(m,h,g){const y=m&&typeof m=="object"?m:{};if(typeof y.type=="string"){const b=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(m.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=op,w,E,T;if((!l||s(m,h,g[g.length-1]||void 0))&&(b=F_(i(m,g)),b[0]===sp))return b;if("children"in m&&m.children){const _=m;if(_.children&&b[0]!==q_)for(E=(o?_.children.length:-1)+c,T=g.concat(_);E>-1&&E<_.children.length;){const A=_.children[E];if(w=f(A,E,T)(),w[0]===sp)return w;E=typeof w[1]=="number"?w[1]:E+c}}return b}}}function F_(n){return Array.isArray(n)?n:typeof n=="number"?[H_,n]:n==null?op:[n]}function up(n,l,i,o){let u,s,c;typeof l=="function"&&typeof i!="function"?(s=void 0,c=l,u=i):(s=l,c=i,u=o),P_(n,s,f,u);function f(m,h){const g=h[h.length-1],y=g?g.children.indexOf(m):void 0;return c(m,y,g)}}const yu={}.hasOwnProperty,Y_={};function V_(n,l){const i=l||Y_,o=new Map,u=new Map,s=new Map,c={...A_,...i.handlers},f={all:h,applyData:X_,definitionById:o,footnoteById:u,footnoteCounts:s,footnoteOrder:[],handlers:c,one:m,options:i,patch:G_,wrap:K_};return up(n,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?o:u,v=String(g.identifier).toUpperCase();y.has(v)||y.set(v,g)}}),f;function m(g,y){const v=g.type,b=f.handlers[v];if(yu.call(f.handlers,v)&&b)return b(f,g,y);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in g){const{children:E,...T}=g,_=Kl(T);return _.children=f.all(g),_}return Kl(g)}return(f.options.unknownHandler||Z_)(f,g,y)}function h(g){const y=[];if("children"in g){const v=g.children;let b=-1;for(;++b<v.length;){const w=f.one(v[b],g);if(w){if(b&&v[b-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=cp(w.value)),!Array.isArray(w)&&w.type==="element")){const E=w.children[0];E&&E.type==="text"&&(E.value=cp(E.value))}Array.isArray(w)?y.push(...w):y.push(w)}}}return y}}function G_(n,l){n.position&&(l.position=B1(n))}function X_(n,l){let i=l;if(n&&n.data){const o=n.data.hName,u=n.data.hChildren,s=n.data.hProperties;if(typeof o=="string")if(i.type==="element")i.tagName=o;else{const c="children"in i?i.children:[i];i={type:"element",tagName:o,properties:{},children:c}}i.type==="element"&&s&&Object.assign(i.properties,Kl(s)),"children"in i&&i.children&&u!==null&&u!==void 0&&(i.children=u)}return i}function Z_(n,l){const i=l.data||{},o="value"in l&&!(yu.call(i,"hProperties")||yu.call(i,"hChildren"))?{type:"text",value:l.value}:{type:"element",tagName:"div",properties:{},children:n.all(l)};return n.patch(l,o),n.applyData(l,o)}function K_(n,l){const i=[];let o=-1;for(l&&i.push({type:"text",value:`
|
|
53
|
+
`});++o<n.length;)o&&i.push({type:"text",value:`
|
|
54
|
+
`}),i.push(n[o]);return l&&n.length>0&&i.push({type:"text",value:`
|
|
55
|
+
`}),i}function cp(n){let l=0,i=n.charCodeAt(l);for(;i===9||i===32;)l++,i=n.charCodeAt(l);return n.slice(l)}function fp(n,l){const i=V_(n,l),o=i.one(n,void 0),u=D_(i),s=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return u&&s.children.push({type:"text",value:`
|
|
56
|
+
`},u),s}function Q_(n,l){return n&&"run"in n?async function(i,o){const u=fp(i,{file:o,...l});await n.run(u,o)}:function(i,o){return fp(i,{file:o,...n||l})}}function dp(n){if(n)throw n}var bu,hp;function J_(){if(hp)return bu;hp=1;var n=Object.prototype.hasOwnProperty,l=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u=function(h){return typeof Array.isArray=="function"?Array.isArray(h):l.call(h)==="[object Array]"},s=function(h){if(!h||l.call(h)!=="[object Object]")return!1;var g=n.call(h,"constructor"),y=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!y)return!1;var v;for(v in h);return typeof v>"u"||n.call(h,v)},c=function(h,g){i&&g.name==="__proto__"?i(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},f=function(h,g){if(g==="__proto__")if(n.call(h,g)){if(o)return o(h,g).value}else return;return h[g]};return bu=function m(){var h,g,y,v,b,w,E=arguments[0],T=1,_=arguments.length,A=!1;for(typeof E=="boolean"&&(A=E,E=arguments[1]||{},T=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});T<_;++T)if(h=arguments[T],h!=null)for(g in h)y=f(E,g),v=f(h,g),E!==v&&(A&&v&&(s(v)||(b=u(v)))?(b?(b=!1,w=y&&u(y)?y:[]):w=y&&s(y)?y:{},c(E,{name:g,newValue:m(A,w,v)})):typeof v<"u"&&c(E,{name:g,newValue:v}));return E},bu}var W_=J_();const vu=ms(W_);function Su(n){if(typeof n!="object"||n===null)return!1;const l=Object.getPrototypeOf(n);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function $_(){const n=[],l={run:i,use:o};return l;function i(...u){let s=-1;const c=u.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...u);function f(m,...h){const g=n[++s];let y=-1;if(m){c(m);return}for(;++y<u.length;)(h[y]===null||h[y]===void 0)&&(h[y]=u[y]);u=h,g?ew(g,f)(...h):c(null,...h)}}function o(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return n.push(u),l}}function ew(n,l){let i;return o;function o(...c){const f=n.length>c.length;let m;f&&c.push(u);try{m=n.apply(this,c)}catch(h){const g=h;if(f&&i)throw g;return u(g)}f||(m&&m.then&&typeof m.then=="function"?m.then(s,u):m instanceof Error?u(m):s(m))}function u(c,...f){i||(i=!0,l(c,...f))}function s(c){u(null,c)}}const Dn={basename:tw,dirname:nw,extname:rw,join:iw,sep:"/"};function tw(n,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');Ba(n);let i=0,o=-1,u=n.length,s;if(l===void 0||l.length===0||l.length>n.length){for(;u--;)if(n.codePointAt(u)===47){if(s){i=u+1;break}}else o<0&&(s=!0,o=u+1);return o<0?"":n.slice(i,o)}if(l===n)return"";let c=-1,f=l.length-1;for(;u--;)if(n.codePointAt(u)===47){if(s){i=u+1;break}}else c<0&&(s=!0,c=u+1),f>-1&&(n.codePointAt(u)===l.codePointAt(f--)?f<0&&(o=u):(f=-1,o=c));return i===o?o=c:o<0&&(o=n.length),n.slice(i,o)}function nw(n){if(Ba(n),n.length===0)return".";let l=-1,i=n.length,o;for(;--i;)if(n.codePointAt(i)===47){if(o){l=i;break}}else o||(o=!0);return l<0?n.codePointAt(0)===47?"/":".":l===1&&n.codePointAt(0)===47?"//":n.slice(0,l)}function rw(n){Ba(n);let l=n.length,i=-1,o=0,u=-1,s=0,c;for(;l--;){const f=n.codePointAt(l);if(f===47){if(c){o=l+1;break}continue}i<0&&(c=!0,i=l+1),f===46?u<0?u=l:s!==1&&(s=1):u>-1&&(s=-1)}return u<0||i<0||s===0||s===1&&u===i-1&&u===o+1?"":n.slice(u,i)}function iw(...n){let l=-1,i;for(;++l<n.length;)Ba(n[l]),n[l]&&(i=i===void 0?n[l]:i+"/"+n[l]);return i===void 0?".":aw(i)}function aw(n){Ba(n);const l=n.codePointAt(0)===47;let i=lw(n,!l);return i.length===0&&!l&&(i="."),i.length>0&&n.codePointAt(n.length-1)===47&&(i+="/"),l?"/"+i:i}function lw(n,l){let i="",o=0,u=-1,s=0,c=-1,f,m;for(;++c<=n.length;){if(c<n.length)f=n.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(u===c-1||s===1))if(u!==c-1&&s===2){if(i.length<2||o!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(m=i.lastIndexOf("/"),m!==i.length-1){m<0?(i="",o=0):(i=i.slice(0,m),o=i.length-1-i.lastIndexOf("/")),u=c,s=0;continue}}else if(i.length>0){i="",o=0,u=c,s=0;continue}}l&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+n.slice(u+1,c):i=n.slice(u+1,c),o=c-u-1;u=c,s=0}else f===46&&s>-1?s++:s=-1}return i}function Ba(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const ow={cwd:sw};function sw(){return"/"}function Eu(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function uw(n){if(typeof n=="string")n=new URL(n);else if(!Eu(n)){const l=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw l.code="ERR_INVALID_ARG_TYPE",l}if(n.protocol!=="file:"){const l=new TypeError("The URL must be of scheme file");throw l.code="ERR_INVALID_URL_SCHEME",l}return cw(n)}function cw(n){if(n.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const l=n.pathname;let i=-1;for(;++i<l.length;)if(l.codePointAt(i)===37&&l.codePointAt(i+1)===50){const o=l.codePointAt(i+2);if(o===70||o===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(l)}const xu=["history","path","basename","stem","extname","dirname"];class mp{constructor(l){let i;l?Eu(l)?i={path:l}:typeof l=="string"||fw(l)?i={value:l}:i=l:i={},this.cwd="cwd"in i?"":ow.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<xu.length;){const s=xu[o];s in i&&i[s]!==void 0&&i[s]!==null&&(this[s]=s==="history"?[...i[s]]:i[s])}let u;for(u in i)xu.includes(u)||(this[u]=i[u])}get basename(){return typeof this.path=="string"?Dn.basename(this.path):void 0}set basename(l){wu(l,"basename"),_u(l,"basename"),this.path=Dn.join(this.dirname||"",l)}get dirname(){return typeof this.path=="string"?Dn.dirname(this.path):void 0}set dirname(l){pp(this.basename,"dirname"),this.path=Dn.join(l||"",this.basename)}get extname(){return typeof this.path=="string"?Dn.extname(this.path):void 0}set extname(l){if(_u(l,"extname"),pp(this.dirname,"extname"),l){if(l.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(l.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Dn.join(this.dirname,this.stem+(l||""))}get path(){return this.history[this.history.length-1]}set path(l){Eu(l)&&(l=uw(l)),wu(l,"path"),this.path!==l&&this.history.push(l)}get stem(){return typeof this.path=="string"?Dn.basename(this.path,this.extname):void 0}set stem(l){wu(l,"stem"),_u(l,"stem"),this.path=Dn.join(this.dirname||"",l+(this.extname||""))}fail(l,i,o){const u=this.message(l,i,o);throw u.fatal=!0,u}info(l,i,o){const u=this.message(l,i,o);return u.fatal=void 0,u}message(l,i,o){const u=new Ht(l,i,o);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(l){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(l||void 0).decode(this.value)}}function _u(n,l){if(n&&n.includes(Dn.sep))throw new Error("`"+l+"` cannot be a path: did not expect `"+Dn.sep+"`")}function wu(n,l){if(!n)throw new Error("`"+l+"` cannot be empty")}function pp(n,l){if(!n)throw new Error("Setting `"+l+"` requires `path` to be set too")}function fw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const dw=(function(n){const o=this.constructor.prototype,u=o[n],s=function(){return u.apply(s,arguments)};return Object.setPrototypeOf(s,o),s}),hw={}.hasOwnProperty;class Cu extends dw{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=$_()}copy(){const l=new Cu;let i=-1;for(;++i<this.attachers.length;){const o=this.attachers[i];l.use(...o)}return l.data(vu(!0,{},this.namespace)),l}data(l,i){return typeof l=="string"?arguments.length===2?(ku("data",this.frozen),this.namespace[l]=i,this):hw.call(this.namespace,l)&&this.namespace[l]||void 0:l?(ku("data",this.frozen),this.namespace=l,this):this.namespace}freeze(){if(this.frozen)return this;const l=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const u=i.call(l,...o);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(l){this.freeze();const i=Jl(l),o=this.parser||this.Parser;return Tu("parse",o),o(String(i),i)}process(l,i){const o=this;return this.freeze(),Tu("process",this.parser||this.Parser),Au("process",this.compiler||this.Compiler),i?u(void 0,i):new Promise(u);function u(s,c){const f=Jl(l),m=o.parse(f);o.run(m,f,function(g,y,v){if(g||!y||!v)return h(g);const b=y,w=o.stringify(b,v);gw(w)?v.value=w:v.result=w,h(g,v)});function h(g,y){g||!y?c(g):s?s(y):i(void 0,y)}}}processSync(l){let i=!1,o;return this.freeze(),Tu("processSync",this.parser||this.Parser),Au("processSync",this.compiler||this.Compiler),this.process(l,u),yp("processSync","process",i),o;function u(s,c){i=!0,dp(s),o=c}}run(l,i,o){gp(l),this.freeze();const u=this.transformers;return!o&&typeof i=="function"&&(o=i,i=void 0),o?s(void 0,o):new Promise(s);function s(c,f){const m=Jl(i);u.run(l,m,h);function h(g,y,v){const b=y||l;g?f(g):c?c(b):o(void 0,b,v)}}}runSync(l,i){let o=!1,u;return this.run(l,i,s),yp("runSync","run",o),u;function s(c,f){dp(c),u=f,o=!0}}stringify(l,i){this.freeze();const o=Jl(i),u=this.compiler||this.Compiler;return Au("stringify",u),gp(l),u(l,o)}use(l,...i){const o=this.attachers,u=this.namespace;if(ku("use",this.frozen),l!=null)if(typeof l=="function")m(l,i);else if(typeof l=="object")Array.isArray(l)?f(l):c(l);else throw new TypeError("Expected usable value, not `"+l+"`");return this;function s(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...y]=h;m(g,y)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(u.settings=vu(!0,u.settings,h.settings))}function f(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const y=h[g];s(y)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,g){let y=-1,v=-1;for(;++y<o.length;)if(o[y][0]===h){v=y;break}if(v===-1)o.push([h,...g]);else if(g.length>0){let[b,...w]=g;const E=o[v][1];Su(E)&&Su(b)&&(b=vu(!0,E,b)),o[v]=[h,b,...w]}}}}const mw=new Cu().freeze();function Tu(n,l){if(typeof l!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Au(n,l){if(typeof l!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function ku(n,l){if(l)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gp(n){if(!Su(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function yp(n,l,i){if(!i)throw new Error("`"+n+"` finished async. Use `"+l+"` instead")}function Jl(n){return pw(n)?n:new mp(n)}function pw(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function gw(n){return typeof n=="string"||yw(n)}function yw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const bw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bp=[],vp={allowDangerousHtml:!0},vw=/^(https?|ircs?|mailto|xmpp)$/i,Sw=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ew(n){const l=xw(n),i=_w(n);return ww(l.runSync(l.parse(i),i),n)}function xw(n){const l=n.rehypePlugins||bp,i=n.remarkPlugins||bp,o=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...vp}:vp;return mw().use(t_).use(i).use(Q_,o).use(l)}function _w(n){const l=n.children||"",i=new mp;return typeof l=="string"&&(i.value=l),i}function ww(n,l){const i=l.allowedElements,o=l.allowElement,u=l.components,s=l.disallowedElements,c=l.skipHtml,f=l.unwrapDisallowed,m=l.urlTransform||Cw;for(const g of Sw)Object.hasOwn(l,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+bw+g.id,void 0);return up(n,h),F1(n,{Fragment:O.Fragment,components:u,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0});function h(g,y,v){if(g.type==="raw"&&v&&typeof y=="number")return c?v.children.splice(y,1):v.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let b;for(b in iu)if(Object.hasOwn(iu,b)&&Object.hasOwn(g.properties,b)){const w=g.properties[b],E=iu[b];(E===null||E.includes(g.tagName))&&(g.properties[b]=m(String(w||""),b,g))}}if(g.type==="element"){let b=i?!i.includes(g.tagName):s?s.includes(g.tagName):!1;if(!b&&o&&typeof y=="number"&&(b=!o(g,y,v)),b&&v&&typeof y=="number")return f&&g.children?v.children.splice(y,1,...g.children):v.children.splice(y,1),y}}}function Cw(n){const l=n.indexOf(":"),i=n.indexOf("?"),o=n.indexOf("#"),u=n.indexOf("/");return l===-1||u!==-1&&l>u||i!==-1&&l>i||o!==-1&&l>o||vw.test(n.slice(0,l))?n:""}function Tw({text:n,maxWidth:l="200px",className:i="",icon:o,onClick:u,disabled:s=!1}){const[c,f]=P.useState(!1),m=P.useRef(null),h=P.useRef(null);return P.useEffect(()=>{const g=()=>{if(m.current&&h.current){const y=m.current.offsetWidth,v=h.current.scrollWidth;f(v>y)}};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[n,l]),n?O.jsxs("div",{ref:m,onClick:s?void 0:u,className:Ye("inline-flex items-center gap-2 rounded-full border border-lavender-200/60 bg-white/80 px-3 py-1 shadow-sm text-xs text-slate-700 hover: cursor-pointer",i,s?"opacity-50 cursor-not-allowed":""),style:{maxWidth:l},title:n,children:[o&&O.jsx("span",{className:"text-lavender-500",children:o}),O.jsx("div",{className:"pill-marquee-wrapper",children:O.jsx("span",{ref:h,className:Ye("block whitespace-normal",c?"pill-marquee":""),children:n})})]}):null}var Aw=Qf[" useInsertionEffect ".trim().toString()]||ur;function kw({prop:n,defaultProp:l,onChange:i=()=>{},caller:o}){const[u,s,c]=Nw({defaultProp:l,onChange:i}),f=n!==void 0,m=f?n:u;{const g=P.useRef(n!==void 0);P.useEffect(()=>{const y=g.current;if(y!==f){const v=y?"controlled":"uncontrolled",b=f?"controlled":"uncontrolled"}g.current=f},[f,o])}const h=P.useCallback(g=>{if(f){const y=Rw(g)?g(n):g;y!==n&&c.current?.(y)}else s(g)},[f,n,s,c]);return[m,h]}function Nw({defaultProp:n,onChange:l}){const[i,o]=P.useState(n),u=P.useRef(i),s=P.useRef(l);return Aw(()=>{s.current=l},[l]),P.useEffect(()=>{u.current!==i&&(s.current?.(i),u.current=i)},[i,u]),[i,o,s]}function Rw(n){return typeof n=="function"}function Ow(n){const l=P.useRef({value:n,previous:n});return P.useMemo(()=>(l.current.value!==n&&(l.current.previous=l.current.value,l.current.value=n),l.current.previous),[n])}function zw(n){const[l,i]=P.useState(void 0);return ur(()=>{if(n){i({width:n.offsetWidth,height:n.offsetHeight});const o=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const s=u[0];let c,f;if("borderBoxSize"in s){const m=s.borderBoxSize,h=Array.isArray(m)?m[0]:m;c=h.inlineSize,f=h.blockSize}else c=n.offsetWidth,f=n.offsetHeight;i({width:c,height:f})});return o.observe(n,{box:"border-box"}),()=>o.unobserve(n)}else i(void 0)},[n]),l}var Wl="Checkbox",[Mw]=ad(Wl),[Dw,Nu]=Mw(Wl);function jw(n){const{__scopeCheckbox:l,checked:i,children:o,defaultChecked:u,disabled:s,form:c,name:f,onCheckedChange:m,required:h,value:g="on",internal_do_not_use_render:y}=n,[v,b]=kw({prop:i,defaultProp:u??!1,onChange:m,caller:Wl}),[w,E]=P.useState(null),[T,_]=P.useState(null),A=P.useRef(!1),k=w?!!c||!!w.closest("form"):!0,q={checked:v,disabled:s,setChecked:b,control:w,setControl:E,name:f,form:c,value:g,hasConsumerStoppedPropagationRef:A,required:h,defaultChecked:mr(u)?!1:u,isFormControl:k,bubbleInput:T,setBubbleInput:_};return O.jsx(Dw,{scope:l,...q,children:Lw(y)?y(q):o})}var Sp="CheckboxTrigger",Ep=P.forwardRef(({__scopeCheckbox:n,onKeyDown:l,onClick:i,...o},u)=>{const{control:s,value:c,disabled:f,checked:m,required:h,setControl:g,setChecked:y,hasConsumerStoppedPropagationRef:v,isFormControl:b,bubbleInput:w}=Nu(Sp,n),E=Hn(u,g),T=P.useRef(m);return P.useEffect(()=>{const _=s?.form;if(_){const A=()=>y(T.current);return _.addEventListener("reset",A),()=>_.removeEventListener("reset",A)}},[s,y]),O.jsx(sr.button,{type:"button",role:"checkbox","aria-checked":mr(m)?"mixed":m,"aria-required":h,"data-state":Tp(m),"data-disabled":f?"":void 0,disabled:f,value:c,...o,ref:E,onKeyDown:qn(l,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:qn(i,_=>{y(A=>mr(A)?!0:!A),w&&b&&(v.current=_.isPropagationStopped(),v.current||_.stopPropagation())})})});Ep.displayName=Sp;var Ru=P.forwardRef((n,l)=>{const{__scopeCheckbox:i,name:o,checked:u,defaultChecked:s,required:c,disabled:f,value:m,onCheckedChange:h,form:g,...y}=n;return O.jsx(jw,{__scopeCheckbox:i,checked:u,defaultChecked:s,disabled:f,required:c,onCheckedChange:h,name:o,form:g,value:m,internal_do_not_use_render:({isFormControl:v})=>O.jsxs(O.Fragment,{children:[O.jsx(Ep,{...y,ref:l,__scopeCheckbox:i}),v&&O.jsx(Cp,{__scopeCheckbox:i})]})})});Ru.displayName=Wl;var xp="CheckboxIndicator",_p=P.forwardRef((n,l)=>{const{__scopeCheckbox:i,forceMount:o,...u}=n,s=Nu(xp,i);return O.jsx(fi,{present:o||mr(s.checked)||s.checked===!0,children:O.jsx(sr.span,{"data-state":Tp(s.checked),"data-disabled":s.disabled?"":void 0,...u,ref:l,style:{pointerEvents:"none",...n.style}})})});_p.displayName=xp;var wp="CheckboxBubbleInput",Cp=P.forwardRef(({__scopeCheckbox:n,...l},i)=>{const{control:o,hasConsumerStoppedPropagationRef:u,checked:s,defaultChecked:c,required:f,disabled:m,name:h,value:g,form:y,bubbleInput:v,setBubbleInput:b}=Nu(wp,n),w=Hn(i,b),E=Ow(s),T=zw(o);P.useEffect(()=>{const A=v;if(!A)return;const k=window.HTMLInputElement.prototype,H=Object.getOwnPropertyDescriptor(k,"checked").set,M=!u.current;if(E!==s&&H){const I=new Event("click",{bubbles:M});A.indeterminate=mr(s),H.call(A,mr(s)?!1:s),A.dispatchEvent(I)}},[v,E,s,u]);const _=P.useRef(mr(s)?!1:s);return O.jsx(sr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??_.current,required:f,disabled:m,name:h,value:g,form:y,...l,tabIndex:-1,ref:w,style:{...l.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Cp.displayName=wp;function Lw(n){return typeof n=="function"}function mr(n){return n==="indeterminate"}function Tp(n){return mr(n)?"indeterminate":n?"checked":"unchecked"}const Ou=P.forwardRef(({className:n,...l},i)=>O.jsx(Ru,{ref:i,className:Ye("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n),...l,children:O.jsx(_p,{className:Ye("grid place-content-center text-current"),children:O.jsx(Kd,{className:"h-4 w-4"})})}));Ou.displayName=Ru.displayName;var Gr=(n=>(n.NOTA="none_of_the_above",n.AOTA="all_of_the_above",n))(Gr||{});function Iw({options:n,selectedValues:l,onSelectionChange:i,additionalOption:o,className:u,required:s=!0,maxSelections:c,error:f,disabled:m}){const h=o?{id:`extra-${o}`,label:o==="all_of_the_above"?"All of the above":"None of the above",value:o==="all_of_the_above"?"All of the above":"None of the above"}:{id:"extra-None of the above",label:"None of the above",value:"None of the above"},g=_=>h?_.filter(A=>A!==h.value):_,y=_=>h?o==="none_of_the_above"?_?[h.value]:[]:o==="all_of_the_above"?_?[...n.map(A=>A.value),h.value]:g(l):_?[...l,h.value]:g(l):l,v=(_,A)=>{const k=h?g(l):l;return A?c&&k.length>=c?null:[...k,_]:k.filter(q=>q!==_)},b=_=>!(s&&_.length===0&&l.length===1),w=(_,A)=>{const q=h&&_===h.value?y(A):v(_,A);q!==null&&b(q)&&i(q)},E=!s||l.length>0,T=h?l.filter(_=>_!==h.value).length:l.length;return n.length?O.jsxs("div",{className:Ye("bg-gray-50","rounded-lg","p-4","border border-gray-200",u),children:[O.jsxs("div",{className:"space-y-3",children:[n.map(_=>{const A=m||c&&T>=c&&!l.includes(_.value);return O.jsxs("div",{className:"flex items-center space-x-3",children:[O.jsx(Ou,{id:_.id,checked:!!l.includes(_.value),disabled:!!A,onCheckedChange:k=>w(_.value,!!k),className:"mt-0.5 border border-muted-foreground"}),O.jsx("label",{htmlFor:_.id,className:Ye("text-sm font-medium leading-none cursor-pointer",A?"text-muted-foreground cursor-not-allowed":"text-secondary-foreground"),children:_.label})]},_.id)}),h&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"border-t border-gray-300 my-3"}),O.jsxs("div",{className:"flex items-center space-x-3",children:[O.jsx(Ou,{id:h.id,checked:l.includes(h.value),onCheckedChange:_=>w(h.value,_),className:"mt-0.5 border border-muted-foreground"}),O.jsx("label",{htmlFor:h.id,className:"text-sm font-medium leading-none cursor-pointer text-secondary-foreground",children:h.label})]})]})]}),f&&O.jsx("p",{className:"text-sm text-red-500 mt-3",children:f}),s&&!E&&O.jsx("p",{className:"text-sm text-red-500 mt-3",children:"Please select at least one option"}),c&&T>=c&&O.jsx("p",{className:"text-sm text-blue-600 mt-3",children:c===1?"You can select only 1 option":`Maximum ${c} selections allowed`})]}):null}function Ap({file:n,onRemove:l,isPreview:i=!0,className:o=""}){const[u,s]=P.useState(!1),[c,f]=P.useState(""),m=n?.type?.startsWith("image/")??!1,h=n?.type==="application/pdf";P.useEffect(()=>{if(m){const v=URL.createObjectURL(n);return f(v),()=>URL.revokeObjectURL(v)}},[n,m]),P.useEffect(()=>{s(!1)},[n]);const g=()=>m?"text-green-600":"text-gray-600",y=v=>{if(v===0)return"0 B";const b=1024,w=["B","KB","MB","GB"],E=Math.floor(Math.log(v)/Math.log(b));return`${(v/Math.pow(b,E)).toFixed(1)} ${w[E]}`.toLowerCase()};return!m||u?O.jsxs("div",{className:`relative group inline-flex flex-shrink-0 bg-white border border-neutral-300 rounded-lg flex items-center gap-3 px-3 py-2.5 max-w-full ${i?"hover:bg-neutral-50":""} ${o}`,children:[O.jsx("div",{className:`flex-shrink-0 ${g()}`,children:O.jsx(yS,{className:"h-5 w-5"})}),O.jsxs("div",{className:"flex-1 min-w-0 max-w-[200px]",children:[n?.name&&O.jsx("div",{className:"text-sm font-medium text-[var(--color-foreground)] truncate",children:n.name}),n?.size&&O.jsx("div",{className:"text-xs text-[var(--color-muted-foreground)]",children:y(n.size)})]}),i&&l&&O.jsx("button",{onClick:l,"aria-label":`Remove ${n.name}`,className:"flex-shrink-0 flex items-center justify-center w-5 h-5 text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)] transition-colors",children:O.jsx(Os,{className:"h-4 w-4"})})]}):O.jsxs("div",{className:`relative group flex-shrink-0 ${o}`,children:[O.jsx("div",{className:`w-20 h-20 bg-white border border-neutral-300 rounded-lg flex items-center justify-center overflow-hidden ${i?"hover:bg-neutral-100 cursor-pointer":""}`,children:c&&O.jsx("img",{src:c,alt:n.name,className:"w-full h-full object-cover",onError:()=>s(!0)})}),i&&l&&O.jsx("button",{onClick:l,"aria-label":`Remove ${n.name}`,className:"absolute top-0 right-0 bg-[var(--color-muted)] text-black rounded-full w-5 h-5 flex items-center justify-center hover:bg-[var(--color-muted-foreground)] transition-colors z-10 transform translate-x-1 -translate-y-1",children:O.jsx(Os,{className:"h-3 w-3 text-black"})})]})}function Bw({files:n,onRemoveFile:l,isPreview:i=!0,className:o=""}){if(n.length===0)return null;const u=n.filter(c=>c.type?.startsWith("image/")),s=n.filter(c=>!c.type?.startsWith("image/"));return O.jsxs("div",{className:`flex flex-wrap justify-end gap-2 max-w-full ${o}`,children:[s.map(c=>{const f=n.indexOf(c);return O.jsx(Ap,{file:c,onRemove:l?()=>l(f):void 0,isPreview:i},`${c.name}-${c.size}-${f}`)}),u.length>0&&O.jsx("div",{className:"flex gap-2 overflow-x-auto max-w-full p-1 scrollbar-hide",children:u.map(c=>{const f=n.indexOf(c);return O.jsx(Ap,{file:c,onRemove:l?()=>l(f):void 0,isPreview:i},`${c.name}-${c.size}-${f}`)})})]})}function Uw({value:n,onValueChange:l,placeholder:i="Select an option",className:o,triggerClassName:u,contentClassName:s,disabled:c=!1,options:f=[],size:m="default"}){const[h,g]=P.useState(!1),y=P.useRef(null),v=P.useRef(null),b=f.find(T=>T.value===n);P.useEffect(()=>{const T=_=>{h&&_.key==="Escape"&&(g(!1),v.current?.focus())};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[h]);const w=T=>{l?.(T),g(!1),v.current?.focus()},E=()=>{c||g(!h)};return O.jsxs("div",{className:Ye("relative w-full",o),children:[O.jsxs("button",{ref:v,type:"button",onClick:E,disabled:c,className:Ye('border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*="text-"])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 overflow-hidden',m==="default"?"min-h-9":"min-h-8",u),"aria-expanded":h,"aria-haspopup":"listbox",children:[O.jsx("span",{className:Ye("flex-1 text-left min-w-0 overflow-hidden break-words line-clamp-2",!b&&"text-muted-foreground"),children:b?b.label:i}),O.jsx(Rs,{className:Ye("size-4 opacity-50 pointer-events-none shrink-0 transition-transform duration-200",h&&"rotate-180")})]}),h&&O.jsx("div",{ref:y,className:Ye("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 relative z-50 max-h-[300px] min-w-[8rem] w-full overflow-x-hidden overflow-y-auto rounded-md shadow-md mt-1",s),role:"listbox",children:O.jsx("div",{className:"p-1",children:f.length===0?O.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground text-center",children:"No options available"}):f.map(T=>{const _=T.value===n;return O.jsxs("div",{onClick:()=>w(T.value),className:Ye("relative flex w-full cursor-pointer items-center gap-1 rounded-sm py-2.5 px-3 text-sm outline-none select-none transition-colors duration-150","hover:bg-accent hover:text-accent-foreground","focus-visible:bg-accent focus-visible:text-accent-foreground","active:bg-accent/80",_&&"bg-accent/50 text-foreground",c&&"pointer-events-none opacity-50 cursor-not-allowed"),role:"option","aria-selected":_,tabIndex:c?-1:0,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),c||w(T.value))},children:[O.jsx("span",{className:"flex-1 text-left min-w-0 break-words line-clamp-2",children:T.label}),_&&O.jsx("span",{className:"absolute right-3 flex size-4 items-center justify-center shrink-0 pointer-events-none",children:O.jsx(Kd,{className:"size-4 text-foreground"})})]},T.value)})})})]})}const Hw=n=>n?n.split(" ").map(l=>l[0]).slice(0,2).join("").toUpperCase():"DR",kp=n=>{const l=n.toLocaleDateString(void 0,{weekday:"short"}).toUpperCase(),i=n.toLocaleDateString(void 0,{day:"2-digit"});return{weekday:l,dayNum:i}},Np=n=>[...n].sort((l,i)=>new Date(l.date).getTime()-new Date(i.date).getTime()),Rp=(n,l)=>(n?.[l]?.slots_details?.length??0)>0;function qw({doctor:n,availability:l,callbacks:i,onBook:o,disabled:u=!1,getAvailabilityDatesForAppointment:s,getAvailableSlotsForAppointment:c}){const[f,m]=P.useState(!1),[h,g]=P.useState(0),[y,v]=P.useState(null),[b,w]=P.useState(0),[E,T]=P.useState(()=>n.hospitals[0]||null),[_,A]=P.useState(!0),[k,q]=P.useState(!1),[H,M]=P.useState(null),[I,Y]=P.useState(!1),[F,$]=P.useState(null),ie=Yr(ve=>ve.sessionId),D=E?.hospital_id,ne=!!i?.[Ge.SYNAPSE_TOOL_CALLBACK_NAME.AVAILABILITY_DATES],C=!!i?.[Ge.SYNAPSE_TOOL_CALLBACK_NAME.AVAILABILITY_SLOTS],V=P.useMemo(()=>{if(!D)return l||null;const ve=H?.[D],ze=l?.[D];return ve?{...l||{},[D]:ve}:ze?l:l||null},[H,l,D]),Z=P.useCallback(async()=>{if(!(!n.doctor_id||!ie||!D)){A(!0),$(null);try{const ve=await s({doctor_id:n.doctor_id,hospital_id:D,region_id:E?.region_id||""}),ze=ve?.available_dates?.length&&ve?.available_dates?.map(X=>({date:X,slots:[]}))||[],je=l?.[D]?.slots_details||[],S=H?.[D]?.slots_details||[],K=new Map;je.forEach(X=>{K.set(X.date,X)}),S.forEach(X=>{K.set(X.date,X)});const U=[...Array.from(K.values())];ze.forEach(X=>{K.has(X.date)||U.push(X)});const j=Np(U);M(X=>({...X||{},[D]:{slots_details:j}}))}catch{$("Failed to load availability dates")}finally{A(!1)}}},[n.doctor_id,ie,D,E?.region_id,s,l,H]);P.useEffect(()=>{if(!D)return;const ve=Rp(H,D),ze=Rp(l??null,D);Y(!1),g(0),w(0),v(null),$(null),!ve&&!ze&&ne&&ie?Z():A(!1)},[D]);const Q=P.useMemo(()=>{if(!D)return new Date;const ve=V?.[D]?.slots_details;if(!ve?.length)return new Date;const ze=ve[0];return ze?new Date(ze.date):new Date},[V,D]),se=P.useCallback(async ve=>{if(!(!n.doctor_id||!D||!E?.region_id||!ie)){q(!0);try{const ze=await c(ve,{doctor_id:n.doctor_id,hospital_id:D,region_id:E.region_id});if(!ze?.slots?.length)return;M(je=>{if(!je||!je?.[D]?.slots_details?.length)return{...je||{},[D]:{slots_details:[{date:ve,slots:ze.slots}]}};const S=je[D].slots_details.map(U=>U.date===ve?{...U,slots:ze.slots}:U),W=je[D].slots_details.some(U=>U.date===ve)?S:[...S,{date:ve,slots:ze.slots}];return{...je,[D]:{slots_details:Np(W)}}})}catch{$("Failed to load slots")}finally{q(!1)}}},[n.doctor_id,D,E?.region_id,ie,c]);P.useEffect(()=>{if(!D||I||_)return;const ve=V?.[D],ze=ve?.slots_details||[];if(D&&ze.length>0&&!I){let je=0;const S=ve?.selected_date||l?.[D]?.selected_date;if(S){const W=ze.findIndex(U=>U.date===S);W>=0&&(je=W)}else{const W=l?.[D]?.slots_details||[],U=ze.findIndex(j=>{const X=W.find(he=>he.date===j.date);return X?.slots&&X.slots.length>0});U>=0&&(je=U)}g(je),w(Math.floor(je/3)*3);const K=ze[je];K&&(!K?.slots||K.slots.length===0)&&C&&ie&&se(K.date)}},[V,D,l,I,_]);const de=P.useMemo(()=>{const ve=D?V?.[D]?.slots_details:null;if(ve?.length){const je=Math.max(0,Math.floor(b/3)*3),S=Math.min(ve.length,je+3);return ve.slice(je,S).map(K=>{const W=new Date(K.date),{weekday:U,dayNum:j}=kp(W);return{weekday:U,dayNum:j,date:K.date,hasAvailability:!0,fullDate:W,hasSlots:!!(K.slots&&K.slots.length>0)}})}const ze=new Date(Q);return ze.setDate(ze.getDate()+b),Array.from({length:3},(je,S)=>{const K=new Date(ze);K.setDate(ze.getDate()+S);const{weekday:W,dayNum:U}=kp(K),j=K.toISOString().split("T")[0];return{weekday:W,dayNum:U,date:j,hasAvailability:!1,fullDate:K,hasSlots:!1}})},[Q,b,V,D]),L=P.useMemo(()=>(D?V?.[D]?.slots_details:null)?.[h]||null,[V,D,h]),N=P.useMemo(()=>Hw(n.name),[n.name]),B=P.useCallback(()=>{Y(!0),w(ve=>Math.max(0,ve-3)),v(null)},[]),z=P.useCallback(()=>{Y(!0);const ve=D?V?.[D]?.slots_details:null,ze=ve?.length?Math.max(0,ve.length-3):0;w(je=>Math.min(ze,je+3)),v(null)},[D,V]),re=P.useCallback(ve=>{Y(!0);const ze=D?V?.[D]?.slots_details:null,je=ze?.findIndex(K=>K.date===ve)??-1;je>=0&&g(je),v(null);const S=ze?.find(K=>K.date===ve);C&&(!S?.slots||S.slots.length===0)&&n.doctor_id&&D&&E?.region_id&&ie&&se(ve)},[D,V,C,n.doctor_id,E?.region_id]),ce=P.useMemo(()=>b>0,[b]),we=P.useMemo(()=>{const ve=D?V?.[D]?.slots_details:null;if(!ve||ve.length===0)return!1;const ze=Math.max(0,ve.length-3);return b<ze},[b,V,D]),Te=P.useCallback(()=>{o&&L&&y&&o({date:L.date,time:y,doctorData:{doctor:n,hospital_id:D||"",region_id:E?.region_id||""}})},[o,L,y,n,D,E?.region_id]),ke=P.useMemo(()=>n.hospitals.map(ve=>({value:ve.hospital_id,label:ve.name})),[n.hospitals]),Ae=P.useCallback(ve=>{v(ve)},[]),He=P.useCallback(ve=>{const ze=n.hospitals.find(je=>je.hospital_id===ve);ze&&T(ze)},[n.hospitals]);return O.jsxs(da,{className:"max-w-md rounded-xl border-lavender-200 shadow-md p-0 bg-white overflow-hidden","aria-label":"Appointment card",children:[O.jsx(Jd,{className:"flex flex-row items-center justify-between gap-3 bg-lavender-50 rounded-t-xl p-4 border-b border-lavender-100 overflow-hidden",children:O.jsxs("div",{className:"flex items-center gap-3",children:[n.profile_pic&&O.jsxs(ha,{className:"h-12 w-12 ring-2 ring-lavender-200",children:[O.jsx(fh,{src:n.profile_pic,alt:`${n.name} profile photo`,crossOrigin:"anonymous"}),O.jsx(ma,{className:"bg-lavender-100 text-lavender-700",children:N})]}),O.jsxs("div",{className:"min-w-0",children:[O.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[O.jsx("h3",{className:" text-base font-bold text-slate-900",children:n.name}),n.profile_link?O.jsx("a",{href:n.profile_link,target:"_blank",rel:"noreferrer",className:"text-xs font-semibold text-lavender-600 hover:text-lavender-700 hover:underline",children:"View profile"}):null]}),O.jsxs("p",{className:"mt-0.5 text-sm text-slate-600",children:[n.specialty,n.experience&&O.jsxs(O.Fragment,{children:[" • ",n.experience]})]})]})]})}),O.jsxs(Wd,{className:"px-4 py-2",children:[O.jsxs("div",{className:"grid gap-2 border-b border-lavender-100 pb-3",children:[n?.timings&&O.jsxs("div",{className:"flex items-start gap-2 text-sm text-slate-900",children:[O.jsx(gS,{className:"h-4 w-4 text-lavender-600 mt-0.5 flex-shrink-0","aria-hidden":!0}),O.jsx("span",{className:"text-slate-600 text-xs",children:n?.timings})]}),n.languages?O.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-900",children:[O.jsx(bS,{className:"h-4 w-4 text-lavender-600","aria-hidden":!0}),O.jsx("span",{className:"text-slate-600",children:n.languages})]}):null,n?.hospitals&&n.hospitals?.length>1?E&&E.name&&O.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-900",children:[O.jsx(Zd,{className:"h-4 w-4 text-lavender-600","aria-hidden":!0}),O.jsx(Uw,{options:ke,placeholder:"Select Hospital",disabled:u,onValueChange:He,value:E?.hospital_id||""})]}):E&&E.name&&O.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-900",children:[O.jsx(Zd,{className:"h-4 w-4 text-lavender-600","aria-hidden":!0}),O.jsx("span",{className:"text-slate-600",children:E.name})]})]}),E?.hospital_id&&V?.[E?.hospital_id]?.slots_details?.length||i?.[Ge.SYNAPSE_TOOL_CALLBACK_NAME.AVAILABILITY_DATES]||_?O.jsx(kt,{type:"button",variant:"outline","aria-expanded":f,"aria-controls":"ap-slots",onClick:()=>m(ve=>!ve),disabled:_,className:"mt-3 w-full border-lavender-500 text-lavender-600 hover:bg-lavender-50 hover:border-lavender-600 disabled:opacity-50",children:_?O.jsxs(O.Fragment,{children:[O.jsx(Qd,{className:"h-4 w-4 mr-2 animate-spin"}),"Loading availability..."]}):O.jsxs(O.Fragment,{children:[O.jsx("span",{className:"mr-1",children:f?"Hide slots":"Show available slots"}),O.jsx(Rs,{className:`h-4 w-4 transition-transform ${f?"rotate-180":""}`,"aria-hidden":!0})]})}):O.jsx("div",{className:"mt-3 w-full flex items-center justify-center py-3 px-4 bg-lavender-50 border border-lavender-200 rounded-lg",children:O.jsx("span",{className:"text-sm text-slate-600 font-medium",children:"No details available"})}),f&&E?.hospital_id&&V?.[E?.hospital_id]?.slots_details?.length&&O.jsx("div",{id:"ap-slots",role:"region","aria-label":"Available slots",className:"pt-3",children:V?.[E?.hospital_id??""]?.slots_details?.length?O.jsxs(O.Fragment,{children:[O.jsxs("div",{className:"flex items-center gap-2 px-0.5",children:[O.jsx(kt,{type:"button",variant:"outline",size:"icon",onClick:B,"aria-label":"Previous 3 days",disabled:u||!ce,className:"h-8 w-8 flex-shrink-0 rounded-md border-lavender-200 bg-white text-lavender-700 hover:bg-lavender-50 hover:border-lavender-300 disabled:opacity-50",children:O.jsx(mS,{className:"h-4 w-4"})}),O.jsx("div",{className:"flex-1 grid grid-cols-3 gap-1 min-w-0",children:de.map((ve,ze)=>{const je=L?.date===ve.date,S=!ve.hasAvailability;return O.jsxs(kt,{type:"button",variant:"outline",onClick:()=>!S&&re(ve.date),disabled:S||u,"aria-current":je?"date":void 0,className:["flex flex-col items-center justify-center h-12 rounded-lg border-2 p-2 gap-0.5 min-w-0 transition-all",je?"border-lavender-500 ring-2 ring-lavender-200 bg-lavender-50 shadow-sm":S?"border-slate-200 bg-slate-50 text-slate-300 cursor-not-allowed":"border-slate-200 bg-white hover:bg-lavender-50 hover:border-lavender-300"].join(" "),children:[O.jsx("span",{className:["text-[10px] tracking-wide w-full text-center font-medium",je?"text-lavender-700":S?"text-slate-300":"text-slate-600"].join(" "),children:ve.weekday}),O.jsx("span",{className:["text-xs font-bold w-full text-center",je?"text-lavender-700":S?"text-slate-300":"text-slate-900"].join(" "),children:ve.dayNum})]},`${ve.date}-${ze}`)})}),O.jsx(kt,{type:"button",variant:"outline",size:"icon",onClick:z,"aria-label":"Next 3 days",disabled:u||!we,className:"h-8 w-8 flex-shrink-0 rounded-md border-lavender-200 bg-white text-lavender-700 hover:bg-lavender-50 hover:border-lavender-300 disabled:opacity-50",children:O.jsx(pS,{className:"h-4 w-4"})})]}),O.jsx("div",{className:"px-0.5 py-3",children:k?O.jsxs("div",{className:"flex items-center justify-center py-4",children:[O.jsx(Qd,{className:"h-4 w-4 animate-spin text-lavender-600 mr-2"}),O.jsx("span",{className:"text-sm text-slate-600",children:"Loading slots..."})]}):L?.slots?.length?O.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-48 overflow-y-auto",children:L.slots.map((ve,ze)=>{const je=y===ve;return O.jsxs(kt,{type:"button",variant:"outline",onClick:()=>Ae(ve),"aria-pressed":je,disabled:u,className:["inline-flex h-9 items-center justify-center gap-2 rounded-lg px-3 text-xs font-semibold transition-all",je?"border-lavender-600 bg-lavender-600 text-white shadow-sm hover:bg-lavender-700 hover:border-lavender-700":"border-lavender-200 bg-white text-slate-900 hover:bg-lavender-50 hover:border-lavender-300"].join(" "),children:[O.jsx(hS,{className:`h-3.5 w-3.5 flex-shrink-0${je?"text-white":"text-lavender-600"}`}),O.jsx("span",{className:"truncate",children:ve})]},ve||`slot-${ze}`)})}):O.jsx("p",{className:"px-1 text-sm text-slate-600",children:"No slots available for this day."})}),O.jsx("div",{className:"px-0.5 pb-1.5",children:O.jsxs(kt,{type:"button",onClick:Te,disabled:!y||u,"aria-disabled":!y,className:"w-full h-10 gap-2 bg-lavender-600 text-white hover:bg-lavender-700 disabled:opacity-60 shadow-sm font-semibold",children:["Book appointment",O.jsx(dS,{className:"h-4 w-4"})]})})]}):O.jsx("div",{className:"px-1 pb-2 pt-1",children:O.jsx("p",{className:"text-sm text-slate-600",children:F||"No availability provided."})})}),f&&!V?.[E?.hospital_id??""]?.slots_details?.length&&O.jsx("div",{className:"px-1 pb-2 pt-1",children:O.jsx("p",{className:"text-sm text-slate-600",children:F||"No availability provided."})})]})]})}function Pw({callTool:n,doctorDetails:l,callbacks:i,onBook:o,disabled:u=!1}){const[s,c]=P.useState([]),[f,m]=P.useState(!1),[h,g]=P.useState(0),[y,v]=P.useState(null),b=Yr(M=>M.sessionId),w=l.doctor_ids||[],E=w.length,T=Math.min(3,E),_=E-T;P.useEffect(()=>{if(w.length===0||!b)return;(async()=>{m(!0),v(null);try{const Y=w.slice(0,T).map(ie=>n(Ge.SYNAPSE_TOOL_NAME.DOCTOR_DETAILS,{doctor_id:ie})),F=await Promise.allSettled(Y),$=[];F.forEach((ie,D)=>{ie.status==="fulfilled"&&$.push(ie.value)}),c($),g($.length)}catch{v("Failed to load doctor details. Please try again.")}finally{m(!1)}})()},[w,b,T]);const A=async()=>{if(!(h>=E||!b)){m(!0),v(null);try{const I=w.slice(h).map($=>n(Ge.SYNAPSE_TOOL_NAME.DOCTOR_DETAILS,{doctor_id:$})),Y=await Promise.allSettled(I),F=[];Y.forEach(($,ie)=>{$.status==="fulfilled"&&F.push($.value)}),c($=>[...$,...F]),g($=>$+F.length)}catch{v("Failed to load more doctor details. Please try again.")}finally{m(!1)}}},k=M=>{o&&o(M)},q=async M=>{const I=i?.[Ge.SYNAPSE_TOOL_CALLBACK_NAME.AVAILABILITY_DATES].tool_name||Ge.SYNAPSE_TOOL_NAME.AVAILABILITY_DATES;return await n(I,{doctor_id:M.doctor_id,hospital_id:M.hospital_id,region_id:M.region_id})},H=async(M,I)=>{const Y=i?.[Ge.SYNAPSE_TOOL_CALLBACK_NAME.AVAILABILITY_SLOTS].tool_name||Ge.SYNAPSE_TOOL_NAME.AVAILABILITY_SLOTS;return await n(Y,{appointment_date:M,doctor_id:I.doctor_id,hospital_id:I.hospital_id,region_id:I.region_id})};return f&&s.length===0?O.jsx("div",{className:"flex items-center justify-center py-8",children:O.jsxs("div",{className:"text-center",children:[O.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[var(--color-primary)] mx-auto mb-3"}),O.jsx("p",{className:"text-sm text-gray-500",children:"Loading doctor details..."})]})}):y&&s.length===0?O.jsx("div",{className:"flex items-center justify-center py-8",children:O.jsxs("div",{className:"text-center",children:[O.jsx("p",{className:"text-sm text-red-500 mb-2",children:y}),O.jsx(kt,{variant:"outline",size:"sm",onClick:()=>{v(null),w.length>0&&b&&(async()=>{m(!0);try{const Y=w.slice(0,T).map(ie=>n(Ge.SYNAPSE_TOOL_NAME.DOCTOR_DETAILS,{doctor_id:ie})),F=await Promise.allSettled(Y),$=[];F.forEach((ie,D)=>{ie.status==="fulfilled"&&$.push(ie.value)}),c($),g($.length)}catch{v("Failed to load doctor details. Please try again.")}finally{m(!1)}})()},children:"Retry"})]})}):s.length===0?O.jsx("div",{className:"flex items-center justify-center py-2",children:O.jsx("p",{className:"text-sm text-gray-500",children:"No doctor details available."})}):O.jsxs("div",{className:"space-y-4",children:[O.jsx("div",{className:"space-y-4",children:s.map((M,I)=>M?.doctor_id&&O.jsx(qw,{doctor:M,availability:l.availability,callbacks:i,onBook:k,disabled:u,getAvailabilityDatesForAppointment:q,getAvailableSlotsForAppointment:H},`${I}`))}),h<E&&O.jsx("div",{className:"flex justify-center",children:O.jsx(kt,{variant:"outline",onClick:A,disabled:f,className:"px-6 py-2",children:f?O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--color-primary)] mr-2"}),"Loading more doctors..."]}):`Show more (${_} more)`})}),y&&s.length>0&&O.jsxs("div",{className:"text-center",children:[O.jsx("p",{className:"text-sm text-red-500 mb-2",children:y}),O.jsx(kt,{variant:"outline",size:"sm",onClick:A,disabled:f,children:"Retry loading more"})]})]})}function Fw({role:n,content:l,timestamp:i,iconUrl:o,files:u,isLastMessage:s,progressMessage:c,toolEscalationData:f,callTool:m,onSendMessage:h}){const g=n==="user",[y,v]=P.useState([]),b=async k=>{const q=Date.now().toString();await h({message:k,messageId:q,toolCalled:!0})},w=async k=>{await h({message:`I want to book an appointment for ${k.doctorData?.doctor?.name||"the doctor"} on ${k.date} for ${k.time}`,toolCalled:!0})},E=k=>{v(k)},T=()=>{if(!f?.details?.input?.additional_option)return;const k=f.details?.input?.additional_option;if(typeof k=="string"&&(k===Gr.NOTA||k===Gr.AOTA))return k;if(typeof k=="object"&&k!==null){if(k.NOTA===Gr.NOTA)return Gr.NOTA;if(k.AOTA===Gr.AOTA)return Gr.AOTA}},_=()=>{const k=f?.details?.input?.options;return k?Array.isArray(k)?k.map((q,H)=>({id:`option-${H}`,label:q.label,value:q.value})):Object.keys(k).map((q,H)=>({id:`option-${H}`,label:q,value:q})):[]},A=async()=>{if(y.length>0){const k=y.join(", "),q=Date.now().toString();await h({message:k,messageId:q,toolCalled:!0})}};return O.jsx("div",{className:Ye("flex",g?"justify-end":"justify-start"),children:O.jsxs("div",{className:Ye("flex gap-3",g?"flex-row-reverse":"flex-row",f?.details?.component===Ge.SYNAPSE_COMPONENTS.MULTI?"max-w-md":g?"max-w-[60%]":"max-w-xs"),children:[!g&&O.jsx(ha,{className:"w-8 h-8 bg-gradient-to-br from-lavender-400 to-lavender-500 text-white text-xs font-bold flex-shrink-0",children:O.jsx(ma,{className:"bg-transparent text-white text-xs font-bold",children:o?O.jsx("img",{src:o,alt:"Bot Icon",className:"w-full h-full"}):O.jsx(Xd,{className:"w-full h-full"})})}),O.jsxs(da,{className:Ye("px-4 py-2 rounded-2xl shadow-none break-words overflow-wrap-anywhere whitespace-pre-wrap",g?"bg-lavender-100/95 backdrop-blur-md text-slate-900 rounded-br-none border border-lavender-200/60":"bg-white/80 backdrop-blur-md text-slate-800 shadow-sm rounded-bl-none border border-lavender-200/40",f&&"w-full"),children:[c&&!g&&s&&O.jsx("p",{className:"text-sm font-medium text-slate-500 pb-2",children:c}),l&&O.jsx("div",{className:"text-sm markdown-content mb-3",children:O.jsx(Ew,{children:l})}),u&&u.length>0&&O.jsx("div",{className:"mt-2",children:O.jsx(Bw,{files:u,isPreview:!1,className:""})}),f?.details?.component===Ge.SYNAPSE_COMPONENTS.PILL&&f?.details?.input?.options&&O.jsx("div",{className:"flex flex-wrap gap-2 mt-3",children:f.details?.input?.options.map((k,q)=>O.jsx(Tw,{disabled:f?.isResponded,text:k?.label||"",onClick:()=>b(k?.value||""),className:"cursor-pointer hover:bg-lavender-100/80 transition-colors"},q))}),f?.details?.component===Ge.SYNAPSE_COMPONENTS.MULTI&&f?.details?.input?.options&&O.jsxs("div",{className:"mt-3 space-y-3 break-words overflow-wrap-anywhere whitespace-pre-wrap",children:[O.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Select multiple options:"}),O.jsx(Iw,{options:_(),selectedValues:y,onSelectionChange:E,additionalOption:T(),disabled:f?.isResponded}),O.jsx(kt,{onClick:A,disabled:y.length===0||f?.isResponded,className:Ye("w-full rounded-lg px-4 py-2 text-sm font-medium transition-all","bg-blue-100 hover:bg-blue-200 text-blue-600 border border-blue-200","disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 disabled:border-gray-200","shadow-sm hover:shadow-md active:scale-[0.98] "),children:"Confirm"})]}),f?.details?.component===Ge.SYNAPSE_COMPONENTS.DOCTOR_CARD&&f?.details?.input?.doctor_details&&m?O.jsx("div",{className:"mt-3",children:O.jsx(Pw,{doctorDetails:f?.details?.input?.doctor_details,callTool:m,callbacks:f?.details?._meta?.callbacks,onBook:w,disabled:f?.isResponded})}):null,c&&!g&&s&&O.jsx("p",{className:"text-sm font-medium text-teal-600",children:c}),i&&O.jsx("p",{className:Ye("text-xs mt-2 text-right","text-slate-500"),children:i})]})]})})}function Yw({messages:n,onSendMessage:l,iconUrl:i,callTool:o}){const u=Yr(c=>c.isWaitingForResponse),s=Yr(c=>c.progressMessage);return O.jsxs(O.Fragment,{children:[(n&&n.length>0||s)&&O.jsx(O.Fragment,{children:n.map((c,f)=>O.jsx("div",{className:"animate-slideUp scroll-mt-[80px]",id:f===n.length-1?"last-message":void 0,children:O.jsx(Fw,{role:c.role,content:c.content,files:c.files||[],iconUrl:i,toolEscalationData:c.toolEscalationData,timestamp:c.timestamp,onSendMessage:l,isLastMessage:f===n.length-1,progressMessage:s,callTool:o})},c.id))}),u&&O.jsx(Vw,{iconUrl:i})]})}function Vw({iconUrl:n}){return O.jsx("div",{className:"animate-slideUp",children:O.jsx("div",{className:"flex justify-start",children:O.jsxs("div",{className:"flex gap-3",children:[O.jsx(ha,{className:"w-8 h-8 bg-gradient-to-br from-lavender-400 to-lavender-500 text-white text-xs font-bold flex-shrink-0",children:O.jsx(ma,{className:"bg-transparent text-white text-xs font-bold",children:n?O.jsx("img",{src:n,alt:"Bot Icon",className:"w-4 h-4",loading:"lazy"}):O.jsx(Xd,{className:"w-4 h-4"})})}),O.jsx(da,{className:"px-4 py-2 rounded-2xl shadow-none bg-white/80 backdrop-blur-md text-slate-800 shadow-sm rounded-bl-none border border-lavender-200/40",children:O.jsx("div",{className:"flex items-center gap-1.5","aria-label":"Bot is typing",children:[0,1,2].map(l=>O.jsx("span",{className:"w-2 h-2 rounded-full bg-slate-400 animate-pulse",style:{animationDelay:`${l*150}ms`}},l))})})]})})})}const Gw=Object.freeze(Object.defineProperty({__proto__:null,default:Yw},Symbol.toStringTag,{value:"Module"}));function Xw({onTaskClick:n,disabled:l,tasks:i}){return i?.length?O.jsx("div",{className:"grid grid-cols-2 gap-3",children:i.map(o=>O.jsx(kt,{type:"button",variant:"ghost",disabled:l,onClick:()=>n(o.value||""),className:"h-auto w-full flex flex-col items-start bg-white shadow-lg ring-1 ring-lavender-100 backdrop-blur-sm rounded-2xl p-4 hover:bg-white/95 hover:border-lavender-300 hover:shadow-lg transition-all text-left group",children:O.jsx("div",{className:"flex items-start justify-between gap-3",children:O.jsx("h3",{className:"font-semibold text-sm text-slate-900 text-wrap group-hover:text-lavender-600 transition-colors",children:o.label||""})})},o.value))}):null}function Zw({initialPrompt:n,tasks:l,onTaskClick:i,disabled:o}){return O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"text-center space-y-2 animate-fadeIn",children:O.jsx("h1",{className:"text-xl-minus font-semibold text-slate-900",children:n||"How can I assist you today?"})}),O.jsx(Xw,{onTaskClick:i,disabled:o,tasks:l})]})}const Kw=Object.freeze(Object.defineProperty({__proto__:null,default:Zw},Symbol.toStringTag,{value:"Module"}));function Qw({className:n="",onRetry:l,onStartNewSession:i,showRetryButton:o,startNewConnection:u,clearError:s,error:c,isConnected:f}){const{isOnline:m}=Wh(),[h,g]=P.useState(!0);return P.useEffect(()=>{if(!u&&!o&&!!c){g(!0);const b=setTimeout(()=>g(!1),5e3);return()=>clearTimeout(b)}g(!0)},[c,u,o]),u?O.jsx("div",{className:Ye("mx-4 mb-3 px-2 py-1 bg-[#FFFBEB] border border-[#FEE39B] rounded-lg",n),children:O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx("div",{className:"w-4 h-4 bg-[#F7B500] rounded-full flex items-center justify-center flex-shrink-0",children:O.jsx("span",{className:"text-white text-sm font-bold",children:"!"})}),O.jsxs("div",{className:"flex-1",children:[O.jsx("div",{className:"text-slate-700 font-semibold text-sm",children:c?.title??"Something went wrong"}),O.jsx("div",{className:"text-[#666666] text-xs mt-1",children:"Start a new session."})]}),O.jsxs("button",{onClick:()=>{s(),i?.()},className:"p-2 bg-[#3B71F7] text-white text-xs font-semibold rounded-lg hover:bg-[#2E5CD9] transition-colors flex items-center gap-2 flex-shrink-0",children:[O.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),O.jsx("span",{className:"text-xs font-semibold",children:"Start new chat"})]})]})}):o?O.jsx("div",{className:Ye("mx-4 mb-3 p-2 bg-[#FFFBEB] border border-[#FEE39B] rounded-lg",n),children:O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx("div",{className:"w-5 h-5 bg-[#F7B500] rounded-full flex items-center justify-center flex-shrink-0",children:O.jsx("span",{className:"text-white text-sm font-bold",children:"!"})}),O.jsxs("div",{className:"flex-1",children:[O.jsx("div",{className:"text-slate-700 font-semibold text-sm",children:c?.title??"Failed to connect"}),O.jsx("div",{className:"text-slate-500 text-xs mt-1",children:c?.description??"Please check your connection and try again"})]}),O.jsxs("button",{onClick:()=>{s(),l?.()},className:"px-4 py-2 bg-lavender-600 text-white text-sm font-semibold rounded-lg hover:bg-lavender-700 transition-colors flex items-center gap-2 flex-shrink-0",children:[O.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Retry"]})]})}):f&&m&&!c?.title||!u&&!o&&!h?null:O.jsx("div",{className:Ye("mx-4 mb-3 p-2 bg-[#FFFBEB] border border-[#FDD835] rounded-lg transition-opacity duration-500",n),children:O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx("div",{className:"w-5 h-5 bg-[#FDD835] rounded-full flex items-center justify-center flex-shrink-0",children:O.jsx("span",{className:"text-white text-sm font-bold",children:"!"})}),O.jsxs("div",{className:"flex-1",children:[O.jsx("div",{className:"text-slate-700 font-semibold text-sm",children:m?c?.title||"Connecting...":"No internet connection"}),O.jsx("div",{className:"text-slate-500 text-xs mt-1",children:m?c?.description??"Please wait while we try to connect":"Please check your internet connection"})]}),!f&&O.jsx("div",{className:"flex-shrink-0",children:O.jsx("div",{className:"w-6 h-6 border-2 border-[#FDD835] border-t-transparent rounded-full animate-spin"})})]})})}const Jw=Object.freeze(Object.defineProperty({__proto__:null,ConnectionStatus:Qw},Symbol.toStringTag,{value:"Module"}));return hs.renderMedAssist=$h,Object.defineProperty(hs,Symbol.toStringTag,{value:"Module"}),hs})({});
|
|
58
57
|
//# sourceMappingURL=medassist-widget.js.map
|